Code Duplication    Length = 4-8 lines in 3 locations

mail/inc/class.mail_ui.inc.php 1 location

@@ 136-139 (lines=4) @@
133
		// no autohide of the sidebox, as we use it for folderlist now.
134
		unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
135
136
		if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
137
		{
138
			self::$icServerID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
139
		}
140
		if ($_GET["resetConnection"])
141
		{
142
			unset($_GET["resetConnection"]);

api/src/Mail.php 2 locations

@@ 226-233 (lines=8) @@
223
		}
224
		if ($_profileID == 0)
225
		{
226
			if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
227
			{
228
				$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
229
			}
230
			else
231
			{
232
				$profileID = Mail\Account::get_default_acc_id();
233
			}
234
			if ($profileID!=$_profileID) $_restoreSession==false;
235
			$_profileID=$profileID;
236
			if (self::$debug) error_log(__METHOD__.' ('.__LINE__.') '.' called with profileID==0 using '.$profileID.' instead->'.function_backtrace());
@@ 308-311 (lines=4) @@
305
	 */
306
	public static function storeActiveProfileIDToPref($_icServerObject, $_profileID=0, $_testConnection=true)
307
	{
308
		if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']) && !empty($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
309
		{
310
			$oldProfileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
311
		}
312
		if ($_testConnection)
313
		{
314
			try