本文整理汇总了PHP中Guest::confCheckResetKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Guest::confCheckResetKey方法的具体用法?PHP Guest::confCheckResetKey怎么用?PHP Guest::confCheckResetKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guest
的用法示例。
在下文中一共展示了Guest::confCheckResetKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
static function action($token, $request)
{
$answer = array('request' => array(), 'id' => 0, 'level' => 0, 'language' => '', 'design' => 0);
if (!empty($token)) {
$co = Guest::connect($token);
$answer['id'] = $co['id'];
$answer['level'] = $co['level'];
$answer['language'] = $co['language'];
$answer['design'] = $co['design'];
} elseif (!empty($request)) {
if (!empty($request['connection']) && !empty($request['connection'][0]) && !empty($request['connection'][1])) {
$rep = Guest::connexion($request['connection'][0], $request['connection'][1]);
$answer['request']['connection'] = $rep;
if (!empty($rep) && $rep['id'] > 0) {
$answer['id'] = $rep['id'];
$answer['level'] = $rep['level'];
$answer['language'] = $rep['language'];
$answer['design'] = $rep['design'];
}
} elseif (!empty($request['confCheckResetKey'])) {
if (!empty($request['confCheckResetKey'][0])) {
$res = Guest::confCheckResetKey($request['confCheckResetKey'][0]);
} else {
$res = False;
}
$answer['request']['confCheckResetKey'] = $res;
} elseif (!empty($request['confResetPassword']) && !empty($request['confResetPassword'][0]) && !empty($request['confResetPassword'][1])) {
$res = Guest::confResetPassword($request['confResetPassword'][0], $request['confResetPassword'][1]);
$answer['request']['confResetPassword'] = $res;
}
}
if ($answer['id'] > 0) {
//Fix pour ne pas détruire la réponse lors de la connexion
if (!empty($request['connection'])) {
unset($request['connection']);
}
/**
* 1: User
* 2: Admin
* 3: SuperAdmin
*/
switch ($answer['level']) {
case 1:
$user = new User($answer['id']);
break;
case 2:
$user = new Admin($answer['id']);
break;
case 3:
$user = new Root($answer['id']);
break;
default:
//Error
exit;
break;
}
$user->setLevel($answer['level']);
$user->setLanguage($answer['language']);
if (empty($request)) {
$user->activity();
}
if (!defined('LOCALE')) {
defineLocale($answer['language']);
}
if (!empty($request) && is_array($request)) {
foreach ($request as $action => $var) {
$res = null;
switch ($action) {
/*** Disconnect ***/
case 'disconnect':
$res = $user->disconnect($token);
break;
/*** Profile ***/
/*** Profile ***/
case 'profileList':
$res = $user->profileList();
break;
case 'profileInfo':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileInfo($var[0]);
break;
case 'profileNew':
if (!empty($var[0]) && !empty($var[1])) {
$res = $user->profileNew($var[0], $var[1]);
}
break;
case 'profileRemove':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileRemove($var[0]);
break;
case 'profileRename':
if (empty($var[0])) {
$var[0] = '';
}
if (empty($var[1])) {
$var[1] = '';
//.........这里部分代码省略.........