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

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