public function action_plugin_deactivation($file) { if ($file == str_replace('\\', '/', $this->get_file())) { # delete default access token ACL::destroy_token('manage_cronjobs'); } }
public function action_plugin_deactivation($file) { if (realpath($file) == __FILE__) { CronTab::delete_cronjob('pbem_check_accounts'); ACL::destroy_token('PBEM'); } }
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'); }
/** * * @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' ); } }
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'); }
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? } }
/** * 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(); } }
/** * 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; }
/** * 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'); }
public function action_plugin_deactivation($file) { if ($file == str_replace('\\', '/', $this->get_file())) { ACL::destroy_token(self::PLUGIN_TOKEN); } }
/** * 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'); }
/** * 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'); }
public function action_plugin_deactivation($plugin_file) { if (Plugins::id_from_file(__FILE__) == Plugins::id_from_file($plugin_file)) { ACL::destroy_token('private'); } }
/** * remove ACL tokens when this plugin is deactivated **/ function action_plugin_deactivation($plugin_file) { ACL::destroy_token('Rewriter'); }
public function teardown_acl() { ACL::destroy_token('test permission'); ACL::destroy_token('test deny permission'); }
/** * Remove the admin token * **/ public function action_plugin_deactivation($file) { // delete default access token ACL::destroy_token('manage_categories'); }
/** * * @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) { ACL::destroy_token('upload_s3_media'); ACL::destroy_token('delete_s3_media'); }
private function upgrade_db_post_3158() { // delete own_post_typeX tokens rather than rebuild the whole default token set foreach (Post::list_active_post_types() as $name => $posttype) { ACL::destroy_token('own_post_' . Utils::slugify($name)); } ACL::destroy_token('own_posts_any'); ACL::create_token('own_posts', _t('Permissions on one\'s own posts'), 'Content', true); }
/** * Remove tokens from the tokens table. * @param integer $num number of tokens to remove, or configured value if null. */ private function populate_tokens_remove($num = null) { // Get our own tokens. $tokens = $this->populate_tokens_get($num); // clean these tokens foreach ($tokens as $id => $token) { ACL::destroy_token($token->id); } return; }