本文整理汇总了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();
}