break; } // Get cookie $tempCookie = IEM::requestGetCookie('IEM_CookieLogin', array()); if (empty($tempCookie)) { break; } // Check if cookie contains user information if (!is_array($tempCookie) || !isset($tempCookie['user'])) { break; } // Get user $tempUser = new User_API(); $tempUser->Load(intval($tempCookie['user'])); // Check if the user is a valid user if (!isset($tempUser->settings['LoginCheck']) || !$tempUser->userid || !$tempUser->Status()) { break; } // Check whether or not the random number matches if (!$tempUser->settings['LoginCheck'] == $tempCookie['rand']) { break; } // The cookie is valid! Update session accordingly IEM::userLogin($tempUser->userid); $tempValid = true; // Check if we have login preferences $tempLoginPref = IEM::requestGetCookie('IEM_LoginPreference', array()); if (is_array($tempLoginPref) && isset($tempLoginPref['takemeto'])) { header('Location: ' . SENDSTUDIO_APPLICATION_URL . '/admin/' . $tempLoginPref['takemeto']); } break;