当前位置: 首页>>代码示例>>PHP>>正文


PHP ACL::destroy_token方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:habari-extras,项目名称:crontabmanager,代码行数:7,代码来源:crontabmanager.plugin.php

示例2: action_plugin_deactivation

 public function action_plugin_deactivation($file)
 {
     if (realpath($file) == __FILE__) {
         CronTab::delete_cronjob('pbem_check_accounts');
         ACL::destroy_token('PBEM');
     }
 }
开发者ID:habari-extras,项目名称:pbem,代码行数:7,代码来源:pbem.plugin.php

示例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');
 }
开发者ID:habari-extras,项目名称:hpm,代码行数:8,代码来源:hpm.plugin.php

示例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' );
		}
	}
开发者ID:nerdfiles,项目名称:habari_boilerplate,代码行数:16,代码来源:habarisilo.plugin.php

示例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');
 }
开发者ID:habari,项目名称:tests,代码行数:11,代码来源:test_acl.php

示例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?
     }
 }
开发者ID:habari-extras,项目名称:exportsnapshot,代码行数:13,代码来源:exportsnapshot.plugin.php

示例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();
     }
 }
开发者ID:habari-extras,项目名称:termmenus,代码行数:19,代码来源:termmenus.plugin.php

示例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;
	}
开发者ID:rynodivino,项目名称:system,代码行数:34,代码来源:post.php

示例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');
 }
开发者ID:habari-extras,项目名称:optionsmanager,代码行数:18,代码来源:optionsmanager.plugin.php

示例10: action_plugin_deactivation

 public function action_plugin_deactivation($file)
 {
     if ($file == str_replace('\\', '/', $this->get_file())) {
         ACL::destroy_token(self::PLUGIN_TOKEN);
     }
 }
开发者ID:habari-extras,项目名称:atomicon,代码行数:6,代码来源:atomicon.plugin.php

示例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');
 }
开发者ID:habari-extras,项目名称:addon_catalog,代码行数:9,代码来源:addon_catalog.plugin.php

示例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');
 }
开发者ID:habari-extras,项目名称:spreking,代码行数:12,代码来源:spreking.plugin.php

示例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');
     }
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:6,代码来源:simple_private_posts.plugin.php

示例14: action_plugin_deactivation

 /**
  * remove ACL tokens when this plugin is deactivated
  **/
 function action_plugin_deactivation($plugin_file)
 {
     ACL::destroy_token('Rewriter');
 }
开发者ID:habari-extras,项目名称:rewriter,代码行数:7,代码来源:rewriter.plugin.php

示例15: teardown_acl

 public function teardown_acl()
 {
     ACL::destroy_token('test permission');
     ACL::destroy_token('test deny permission');
 }
开发者ID:habari,项目名称:tests,代码行数:5,代码来源:test_usergroup.php


注:本文中的ACL::destroy_token方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。