本文整理汇总了PHP中ACL::destroy_token方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::destroy_token方法的具体用法?PHP ACL::destroy_token怎么用?PHP ACL::destroy_token使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACL
的用法示例。
在下文中一共展示了ACL::destroy_token方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_plugin_deactivation
public function action_plugin_deactivation($file)
{
if ($file == str_replace('\\', '/', $this->get_file())) {
# delete default access token
ACL::destroy_token('manage_cronjobs');
}
}
示例2: action_plugin_deactivation
public function action_plugin_deactivation($file)
{
if (realpath($file) == __FILE__) {
CronTab::delete_cronjob('pbem_check_accounts');
ACL::destroy_token('PBEM');
}
}
示例3: action_plugin_deactivation
public function action_plugin_deactivation($file)
{
# delete default access tokens for: 'system', 'plugin', 'theme', 'class'
ACL::destroy_token('install_new_system');
ACL::destroy_token('install_new_plugin');
ACL::destroy_token('install_new_theme');
ACL::destroy_token('install_new_class');
}
示例4: action_plugin_deactivation
/**
*
* @param string $file. The name of the plugin file
*
* Delete the special silo permissions if they're no longer
* being used.
*/
public function action_plugin_deactivation( $file ) {
$silos = Plugins::get_by_interface( 'MediaSilo' );
if ( count( $silos ) <= 1 ) {
ACL::destroy_token( 'upload_media' );
ACL::destroy_token( 'delete_media' );
ACL::destroy_token( 'create_directories' );
ACL::destroy_token( 'delete_directories' );
}
}
示例5: test_user_permissions
public function test_user_permissions()
{
ACL::create_token('acltest', 'A test ACL permission', 'Administration');
$this->acl_user_alice->grant('acltest', 'full');
$this->assert_true($this->acl_user_alice->can('acltest', 'full'), 'Could not grant acltest permission to user.');
$this->acl_user_alice->revoke('acltest');
// check that members of a group inherit that group's permissions
$this->acl_group->grant('acltest', 'full');
$this->assert_true($this->acl_user_alice->can('acltest', 'full'), 'User did not inherit group permissions.');
ACL::destroy_token('acltest');
}
示例6: action_plugin_deactivation
public function action_plugin_deactivation($file = '')
{
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
ACL::destroy_token('snapshot');
// wipe out the default options we added
Options::delete('exportsnapshot__frequency');
Options::delete('exportsnapshot__type');
// remove the module
Modules::remove_by_name(_t('Snapshots', 'exportsnapshot'));
// @todo what about the snapshots option and deleting those cached items?
// probably an uninstall method too?
}
}
示例7: action_plugin_deactivation
/**
* Remove the admin token
**/
public function action_plugin_deactivation($file)
{
// delete default access token
ACL::destroy_token('manage_menus');
// delete menu vocabularies that were created
$vocabs = DB::get_results('SELECT * FROM {vocabularies} WHERE name LIKE "menu_%"', array(), 'Vocabulary');
foreach ($vocabs as $vocab) {
// This should only delete the ones that are menu vocabularies, unless others have been named 'menu_xxxxx'
$vocab->delete();
}
// delete blocks that were created
$blocks = DB::get_results('SELECT * FROM {blocks} WHERE type = "menu"', array(), 'Block');
foreach ($blocks as $block) {
$block->delete();
}
}
示例8: delete_post_type
/**
* removes a post type from the database, if it exists and there are no posts
* of the type
* @param string The post type name
* @return boolean
* true if post type has been deleted
* false if it has not been deleted (does not exist or there are posts using
* this content type)
*/
public static function delete_post_type( $type )
{
// refresh the cache from the DB, just to be sure
$types = self::list_all_post_types( true );
if ( array_key_exists( $type, $types ) ) {
// Exists in DB.. check if there are content with this type.
if ( ! DB::exists( '{posts}', array( 'content_type' => Post::type( $type ) ) ) ) {
// Finally, remove from database and destroy tokens
DB::delete( '{posttype}', array( 'name' => $type ) );
ACL::destroy_token( 'post_' . Utils::slugify( $type ) );
// now force a refresh of the caches, so the removed type is no longer
// available for use
$types = self::list_active_post_types( true );
$types = self::list_all_post_types( true );
return true;
}
}
return false;
}
示例9: action_plugin_deactivation
/**
* Action: plugin deactivation
*
* Cleans up after this plugin when deactivated, including:
*
* - Removes ACL token
* - Removes plugin options
*
* @return void
*/
public function action_plugin_deactivation($file)
{
if ($file == str_replace('\\', '/', $this->get_file())) {
ACL::destroy_token('manage_options');
}
Options::delete($this->class_name . '__allow_delete_core');
Options::delete($this->class_name . '__allow_delete_other');
}
示例10: action_plugin_deactivation
public function action_plugin_deactivation($file)
{
if ($file == str_replace('\\', '/', $this->get_file())) {
ACL::destroy_token(self::PLUGIN_TOKEN);
}
}
示例11: action_plugin_deactivation
/**
* Hook on deactivation of this plugin
*/
public function action_plugin_deactivation()
{
// when deactivating, don't destroy data, just turn it 'off'
Post::deactivate_post_type('addon');
ACL::destroy_token('manage_versions');
}
示例12: uninstall
/**
* Set up needed permissions
*/
private static function uninstall()
{
// Deactivate post types
Post::deactivate_post_type('thread');
Post::deactivate_post_type('forum');
// Remove tokens
ACL::destroy_token('forum_close_thread');
ACL::destroy_token('forum_see_private');
}
示例13: action_plugin_deactivation
public function action_plugin_deactivation($plugin_file)
{
if (Plugins::id_from_file(__FILE__) == Plugins::id_from_file($plugin_file)) {
ACL::destroy_token('private');
}
}
示例14: action_plugin_deactivation
/**
* remove ACL tokens when this plugin is deactivated
**/
function action_plugin_deactivation($plugin_file)
{
ACL::destroy_token('Rewriter');
}
示例15: teardown_acl
public function teardown_acl()
{
ACL::destroy_token('test permission');
ACL::destroy_token('test deny permission');
}