本文整理汇总了PHP中ACL::clear_caches方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::clear_caches方法的具体用法?PHP ACL::clear_caches怎么用?PHP ACL::clear_caches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACL
的用法示例。
在下文中一共展示了ACL::clear_caches方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_authorized
/**
* Checks if the proper credential has been supplied to access the current post
**/
private function is_authorized($post = null, $deny = false)
{
$auth = Controller::get_var('sharedraft');
// if there's no auth key, deny authorization automatically
if ($auth == null) {
return false;
}
ACL::clear_caches();
// sadly, caching can't be used with Hisa
// if someone has an auth token but should be denied, mess them up
if ($deny == true) {
// Utils::redirect( Site::get_url() );
exit;
return false;
}
// we assume the authorization is fine until actually testing the post
if ($post != null) {
if ($auth != $this->get_secret_key($post)) {
return false;
}
}
return true;
}
示例2: forget
/**
* Delete the user id from the session
*/
public function forget()
{
// is this user acting as another user?
if (isset($_SESSION['sudo'])) {
// if so, remove the sudo token, but don't log out
// the user
unset($_SESSION['sudo']);
Utils::redirect(Site::get_url('admin'));
}
ACL::clear_caches();
Plugins::act('user_forget', $this);
Session::clear_userid($_SESSION['user_id']);
unset($_SESSION['user_id']);
$home = Options::get('base_url');
Utils::redirect(Site::get_url('habari'));
}
示例3: revoke_user_token
/**
* Remove a permission token from the user permissions table
* @param integer $user_id The user ID
* @param mixed $token_id The name or ID of the permission token
* @return the result of the DB query
*/
public static function revoke_user_token($user_id, $token_id)
{
$token_id = self::token_id($token_id);
$result = DB::delete('{user_token_permissions}', array('user_id' => $user_id, 'token_id' => $token_id));
ACL::clear_caches();
return $result;
}
示例4: forget
/**
* Delete the user id from the session
* @param boolean $redirect Redirect the user to base_url after destroying session?
*/
public function forget($redirect = true)
{
// if the user is not actually logged in, just return so we don't throw any errors later
if ($this->loggedin != true) {
return;
}
// is this user acting as another user?
if (isset($_SESSION['sudo'])) {
// if so, remove the sudo token, but don't log out
// the user
unset($_SESSION['sudo']);
if ($redirect) {
Utils::redirect(Site::get_url('admin'));
} else {
// we want to return, not continue processing, or we'd log out the user too
return;
}
}
ACL::clear_caches();
Plugins::act('user_forget', $this);
Session::clear_userid($_SESSION['user_id']);
// then destroy the entire session
Session::destroy();
if ($redirect) {
Utils::redirect(Site::get_url('site'));
}
}