本文整理匯總了PHP中jAcl2::clearCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP jAcl2::clearCache方法的具體用法?PHP jAcl2::clearCache怎麽用?PHP jAcl2::clearCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jAcl2
的用法示例。
在下文中一共展示了jAcl2::clearCache方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onAuthLogout
function onAuthLogout($event)
{
try {
jAcl2::clearCache();
} catch (Exception $e) {
}
}
示例2: setRightsOnForum
/**
* set rights on the given forum
* @param integer $group the group id.
* @param array $rights list of rights key = subject, value = true
* @param string $resource the resource corresponding to the "forum" string + id_forum
*/
public static function setRightsOnForum($group, $rights, $resource)
{
$dao = jDao::get('jacl2db~jacl2rights', jAcl2Db::getProfile());
$dao->deleteHfnuByGroup($group, $resource);
foreach ($rights as $sbj => $val) {
if ($val != '') {
jAcl2DbManager::addRight($group, $sbj, $resource);
}
}
jAcl2::clearCache();
}
示例3: logout
/**
* logout a user and delete the user in the php session
*/
public static function logout()
{
$config = self::_getConfig();
jEvent::notify('AuthLogout', array('login' => $_SESSION[$config['session_name']]->login));
$_SESSION[$config['session_name']] = new jAuthDummyUser();
try {
jAcl::clearCache();
} catch (Exception $e) {
}
try {
jAcl2::clearCache();
} catch (Exception $e) {
}
if (isset($config['persistant_enable']) && $config['persistant_enable']) {
if (!isset($config['persistant_cookie_name'])) {
throw new jException('jelix~auth.error.persistant.incorrectconfig', 'persistant_cookie_name, persistant_crypt_key');
}
setcookie($config['persistant_cookie_name'] . '[auth]', '', time() - 3600, $config['persistant_cookie_path']);
}
}
示例4: removeSubject
/**
* Delete the given subject
* @param string $subject the key of the subject
*/
public static function removeSubject($subject)
{
$p = jAcl2Db::getProfile();
jDao::get('jelix~jacl2rights', $p)->deleteBySubject($subject);
jDao::get('jelix~jacl2subject', $p)->delete($subject);
jAcl2::clearCache();
}
示例5: removeSubjectGroup
/**
* Delete the given subject
* @param string $subjectGroup the key of the subject group
* @since 1.3
*/
public static function removeSubjectGroup($subjectGroup)
{
jDao::get('jacl2db~jacl2subject', 'jacl2_profile')->removeSubjectFromGroup($subjectGroup);
jDao::get('jacl2db~jacl2subjectgroup', 'jacl2_profile')->delete($subjectGroup);
jAcl2::clearCache();
}
示例6: testGetRightDisconnect
public function testGetRightDisconnect()
{
jAuth::logout();
jAcl2::clearCache();
$this->assertFalse(jAcl2::check('super.cms.list'));
$this->assertFalse(jAcl2::check('admin.access'));
jAcl2::clearCache();
jAcl2DbManager::addRight('__anonymous', 'super.cms.list');
$this->assertTrue(jAcl2::check('super.cms.list'));
$this->assertFalse(jAcl2::check('admin.access'));
jAcl2::clearCache();
}