本文整理汇总了PHP中IEM::requestGetCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::requestGetCookie方法的具体用法?PHP IEM::requestGetCookie怎么用?PHP IEM::requestGetCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEM
的用法示例。
在下文中一共展示了IEM::requestGetCookie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User_API
// 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;
}
if (!$tempValid) {
$page = 'login';
}
unset($tempValid);
unset($tempCookie);
unset($tempUser);
} else {
$tempUser = GetUser();
if (!$tempUser->Find($tempUser->username)) {
$page = 'login';
示例2: ShowLoginForm
/**
* ShowLoginForm
* This shows the login form.
* If there is a template to use in the data/templates folder it will use that as the login form.
* Otherwise it uses the default one below. If you pass in a message it will show that message above the login form.
*
* @param String $template Uses the template passed in for the message (eg success / error).
* @param String $msg Prints the message passed in above the login form (eg unsuccessful attempt).
*
* @see FetchTemplate
* @see PrintHeader
* @see PrintFooter
*
* @return Void Doesn't return anything, just prints the login form.
*/
function ShowLoginForm($template=false, $msg=false)
{
if (!IEM::getCurrentUser()) {
$this->GlobalAreas['InfoTips'] = '';
}
$this->PrintHeader(true);
$GLOBALS['Message'] = GetLang('Help_Login');
if ($template && $msg) {
switch ($template) {
case 'login_error':
$GLOBALS['Error'] = $msg;
break;
case 'login_success':
$this->GlobalAreas['Success'] = $msg;
break;
}
$GLOBALS['Message'] = $this->ParseTemplate($template,true);
}
$username = IEM::requestGetPOST('ss_username', false);
if ($username) {
$GLOBALS['ss_username'] = htmlspecialchars($username, ENT_QUOTES, SENDSTUDIO_CHARSET);
}
$GLOBALS['ss_takemeto'] = 'index.php';
$loginPreference = IEM::requestGetCookie('IEM_LoginPreference', array());
if (is_array($loginPreference) && isset($loginPreference['takemeto'])) {
$GLOBALS['ss_takemeto'] = $loginPreference['takemeto'];
}
$this->GlobalAreas['SubmitAction'] = 'Login';
$this->ParseTemplate('login');
$this->PrintFooter(true);
}