本文整理汇总了PHP中UserUtil::checkUserGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtil::checkUserGroup方法的具体用法?PHP UserUtil::checkUserGroup怎么用?PHP UserUtil::checkUserGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtil
的用法示例。
在下文中一共展示了UserUtil::checkUserGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$cookiePath = $config["cookie"]["cookiepath"];
$cookieDomain = $config["cookie"]["cookiedomain"];
$secure = $_SERVER["SERVER_PORT"] == 443 ? 1 : 0;
@setcookie($k, "", time() - 86400, $cookiePath, $cookieDomain, $secure, false);
}
$account = Ibos::app()->setting->get("setting/account");
$user = Ibos::app()->user;
if ($account["allowshare"] != 1) {
$user->setStateKeyPrefix(Ibos::app()->setting->get("sid"));
}
$user->login($identity);
$log = array("terminal" => "bqqsso", "password" => "", "ip" => $ip, "user" => $curUser["username"], "loginType" => $identity::LOGIN_BY_USERNAME, "address" => "", "gps" => "");
Log::write($log, "login", sprintf("module.user.%d", $uid));
$rule = UserUtil::updateCreditByAction("daylogin", $uid);
if (!$rule["updateCredit"]) {
UserUtil::checkUserGroup($uid);
}
if ($returnurl == "index") {
header("Location: ../../index.php", true);
} else {
$url = parse_url($returnurl);
if (isset($url["scheme"])) {
header("Location:" . $returnurl, true);
} else {
header("Location:../../" . $returnurl, true);
}
}
}
} else {
EnvUtil::iExit($status["msg"]);
}
示例2: doLogin
protected function doLogin($userName, $passWord, $loginType, $account, $autoLogin = 1, $cookieTime = 0, $inajax = 0)
{
if (!$passWord || $passWord != addslashes($passWord)) {
$this->error(Ibos::lang("Passwd illegal"));
}
$errornum = $this->loginCheck($account);
$ip = Ibos::app()->setting->get("clientip");
$identity = new ICUserIdentity($userName, $passWord, $loginType);
$result = $identity->authenticate();
if (0 < $result) {
$user = Ibos::app()->user;
if (empty($autoLogin)) {
$user->setState($user::AUTH_TIMEOUT_VAR, TIMESTAMP + $account["timeout"]);
} else {
MainUtil::setCookie("autologin", 1, $cookieTime);
}
$user->login($identity, $cookieTime);
if ($user->uid != 1) {
MainUtil::checkLicenseLimit(true);
}
if (!$inajax) {
$urlForward = EnvUtil::referer();
$log = array("terminal" => "web", "password" => StringUtil::passwordMask($passWord), "ip" => $ip, "user" => $userName, "loginType" => $loginType, "address" => "", "gps" => "");
Log::write($log, "login", sprintf("module.user.%d", $user->uid));
$rule = UserUtil::updateCreditByAction("daylogin", $user->uid);
if (!$rule["updateCredit"]) {
UserUtil::checkUserGroup($user->uid);
}
$this->success(Ibos::lang("Login succeed", "", array("{username}" => $user->realname)), $urlForward);
} else {
$this->ajaxReturn(array("isSuccess" => true));
}
} elseif ($result === 0) {
$this->error(Ibos::lang("User not fount", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -1) {
$this->error(Ibos::lang("User lock", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -2) {
$this->error(Ibos::lang("User disabled", "", array("{username}" => $userName)), "", array(), array("error" => $result));
} elseif ($result === -3) {
FailedLogin::model()->updateFailed($ip);
list($ip1, $ip2) = explode(".", $ip);
$newIp = $ip1 . "." . $ip2;
FailedIp::model()->insertIp($newIp);
$log = array("user" => $userName, "password" => StringUtil::passwordMask($passWord), "ip" => $ip);
Log::write($log, "illegal", "module.user.login");
if ($errornum) {
$this->error("登录失败,您还可以尝试" . ($errornum - 1) . "次");
} else {
$this->error(Ibos::lang("User name or password is not correct"), "", array(), array("error" => $result));
}
}
}