public function disable_step($old_state) { switch ($old_state) { case '': // We need to change the CAPTCHA configuration back to something // builtin if we're disabled when we're the active CAPTCHA, otherwise // it'll confuse the board something chronic. /* @var $config \phpbb\config\config */ $config = $this->container->get('config'); /* @var $recaptcha2 \gothick\recaptcha2\captcha\recaptcha2 */ $recaptcha2 = $this->container->get('gothick.recaptcha2.captcha.recaptcha2'); if ($recaptcha2->get_service_name() == $config['captcha_plugin']) { // Used to fall back to reCAPTCHA, but of course, that may not be // configured. Fall back to something that doesn't need configuration // and is likely to just work. $config->set('captcha_plugin', 'core.captcha.plugins.nogd'); } return 'captcha_reset_to_core'; break; default: // Run parent disable step method return parent::disable_step($old_state); break; } }
function disable_step($old_state) { global $db; $sql = 'DELETE FROM ' . USER_NOTIFICATIONS_TABLE . "\n\t\t\tWHERE method = 'notification.method.mobilenotifier'"; $db->sql_query($sql); return parent::enable_step($old_state); }
/** * Check phpBB's VigLink switches and set them during install * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function enable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet /* @var $cache \phpbb\cache\service */ $cache = $this->container->get('cache'); /* @var $config \phpbb\config\config */ $config = $this->container->get('config'); /* @var $file_downloader \phpbb\file_downloader */ $file_downloader = $this->container->get('file_downloader'); /* @var $user \phpbb\user */ $user = $this->container->get('user'); $viglink_helper = new \phpbb\viglink\acp\viglink_helper($cache, $config, $file_downloader, $user); try { $viglink_helper->set_viglink_services(); } catch (\RuntimeException $e) { // fail silently } return 'viglink'; break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
/** * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // delete posting template data $config_text = $this->container->get('config_text'); $db = $this->container->get('dbal.conn'); $config_text_table = $this->container->getParameter('tables.config_text'); // there's no method in the config_text service to retrieve the names with a sql like expression, so we do it with a query here. $sql = 'SELECT config_name FROM ' . $config_text_table . ' WHERE config_name ' . $db->sql_like_expression('marttiphpbb_postingtemplate_forum' . $db->get_any_char()); $result = $db->sql_query($sql); $postingtemplates = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if (sizeof($postingtemplates)) { $postingtemplates = array_map(function ($row) { return $row['config_name']; }, $postingtemplates); $config_text->delete_array($postingtemplates); } return '1'; break; default: return parent::purge_step($old_state); break; } }
public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet global $phpbb_root_path; $phpbb_store_path = $phpbb_root_path . 'store/'; $this->del_content_dir('d120de/banner/default/'); $this->del_content_dir('d120de/banner/event/'); $this->del_content_dir('d120de/banner/'); unlink($phpbb_store_path . 'd120de/index.htm'); //this fails if there are other folders than banner $del_res = rmdir($phpbb_store_path . 'd120de/'); if ($del_res === false) { //we faild create index.htm again touch($phpbb_store_path . 'd120de/index.htm'); } return 'del_content_dir'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function enable_step($old_state) { if (empty($old_state)) { $this->container->get('user')->add_lang_ext('forumhulp/sysoverview', 'info_acp_sysoverview'); $this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] . (isset($this->container->get('user')->lang['SYSOVERVIEW_NOTICE']) ? sprintf($this->container->get('user')->lang['SYSOVERVIEW_NOTICE'], $this->container->get('user')->lang['ACP_CAT_SYSTEM'], $this->container->get('user')->lang['ACP_GENERAL_TASKS'], $this->container->get('user')->lang['ACP_SYSOVERVIEW_TITLE']) : '')); } // Run parent enable step method return parent::enable_step($old_state); }
public function purge_step($old_state) { global $phpbb_root_path; $database = $phpbb_root_path . 'store/messenger.db'; if (is_file($database)) { unlink($database); } return parent::purge_step($old_state); }
public function enable_step($old_state) { if (empty($old_state)) { // global $user; // $user->lang['EXTENSION_ENABLE_SUCCESS'] = $user->lang['EXTENSION_ENABLE_SUCCESS']; } // Run parent enable step method return parent::enable_step($old_state); }
public function enable_step($old_state) { if (empty($old_state)) { global $user; $user->add_lang_ext('forumhulp/htmlemail', 'info_acp_htmlemail'); $user->lang['EXTENSION_ENABLE_SUCCESS'] .= isset($user->lang['HTML_EMAIL_NOTICE']) ? $user->lang['HTML_EMAIL_NOTICE'] : ''; } // Run parent enable step method return parent::enable_step($old_state); }
public function enable_step($old_state) { if (empty($old_state)) { global $user; $info = '<div style="width:80%;margin:20px auto;"><p style="text-align:left;">Settings for this extension are in General >> Board configuration >> Board features.</p></div>'; $user->lang['EXTENSION_ENABLE_SUCCESS'] = $user->lang['EXTENSION_ENABLE_SUCCESS'] . $info; } // Run parent enable step method return parent::enable_step($old_state); }
/** * Single purge step * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ public function purge_step($old_state) { switch ($old_state) { case '': // Before the first migration // Remove the remember flag for sortables being the default captcha. return $this->handle_default_captcha_on('purge'); default: // Run parent purge step method return parent::purge_step($old_state); } }
function enable_step($old_state) { global $phpEx; global $phpbb_root_path; global $request; /*Require WP includes*/ $proxy = new Proxy(); $proxy->cache(); //AAAAAAAAAAAAND let's hope it works? // Run parent enable step method return parent::enable_step($old_state); }
/** * Overwrite purge_step to purge Auto Groups notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge Auto Groups notifications return $this->notification_handler('purge', array('phpbb.autogroups.notification.type.group_added', 'phpbb.autogroups.notification.type.group_removed')); break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet $phpbb_root_path = $this->container->getParameter('core.root_path'); $user = $this->container->get('user'); $customcode_directory = new customcode_directory($user, $phpbb_root_path); $customcode_directory->remove(); return '1'; break; default: return parent::purge_step($old_state); break; } }
function enable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet $this->container->get('user')->add_lang_ext('forumhulp/loginwithemail', 'info_acp_loginwithemail'); $this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] . (isset($this->container->get('user')->lang['LIWE_NOTICE']) ? sprintf($this->container->get('user')->lang['LIWE_NOTICE'], $this->container->get('user')->lang['ACP_CAT_GENERAL'], $this->container->get('user')->lang['ACP_BOARD_CONFIGURATION'], $this->container->get('user')->lang['ACP_REGISTER_SETTINGS'], $this->container->get('user')->lang['ACP_LIWE']) : '')); // Run parent enable step method return parent::enable_step($old_state); break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
function enable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet $this->container->get('user')->add_lang_ext('forumhulp/postsstats', 'info_acp_postsstats'); $this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] . (isset($this->container->get('user')->lang['POSTSSTAT_NOTICE']) ? sprintf($this->container->get('user')->lang['POSTSSTAT_NOTICE'], $this->container->get('user')->lang['ACP_CAT_GENERAL'], $this->container->get('user')->lang['ACP_QUICK_ACCESS'], $this->container->get('user')->lang['ACP_POSTSTATISTICS']) : '')); // Run parent enable step method return parent::enable_step($old_state); break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
function enable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet $this->container->get('user')->add_lang_ext('forumhulp/pmspy', 'info_acp_pmspy'); $this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] . (isset($this->container->get('user')->lang['PMSPY_NOTICE']) ? sprintf($this->container->get('user')->lang['PMSPY_NOTICE'], $this->container->get('user')->lang['ACP_CAT_POSTING'], $this->container->get('user')->lang['ACP_MESSAGES'], $this->container->get('user')->lang['ACP_PM_SPY']) : '')); // Run parent enable step method return parent::enable_step($old_state); break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
/** * Overwrite purge_step to purge advanced polls notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('wolfsblvt.advancedpolls.notification.type.pollended'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
function enable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet global $user; $user->add_lang_ext('forumhulp/statistics', 'info_acp_statistics'); $user->lang['EXTENSION_ENABLE_SUCCESS'] .= isset($user->lang['STATISTICS_NOTICE']) ? sprintf($user->lang['STATISTICS_NOTICE'], $user->lang['ACP_CAT_GENERAL'], $user->lang['ACP_QUICK_ACCESS'], $user->lang['ACP_STATISTICS']) : ''; // Run parent enable step method return parent::enable_step($old_state); break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
function disable_step($old_state) { switch ($old_state) { case '': $db = $this->container->get('dbal.conn'); $modules = array('UCP_PROFILE_REG_DETAILS', 'UCP_PROFILE_AUTOLOGIN_KEYS', 'UCP_AUTH_LINK_MANAGE'); $sql = 'UPDATE ' . MODULES_TABLE . ' SET module_enabled = 1 WHERE ' . $db->sql_in_set('module_langname', $modules); $db->sql_query($sql); return 'ucp_modules_disabled'; break; default: return parent::disable_step($old_state); break; } }
function purge_step($old_state) { switch ($old_state) { case '': try { $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('dmzx.ultimatepoints.notification.type.points'); } catch (\phpbb\notification\exception $e) { // continue } return 'notifications'; break; default: return parent::purge_step($old_state); break; } }
/** * Single disable step that does nothing * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function disable_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Disable list of official extensions $extensions = $this->container->get('ext.manager'); foreach ($this->add_ons as $var) { $extensions->disable($var); } return true; break; default: // Run parent disable step method return parent::disable_step($old_state); break; } }
function enable_step($old_state) { //echo 'step ',$old_state,'<br />'; return parent::enable_step($old_state); switch ($old_state) { case '': // Empty means nothing has run yet /* // Get config $config = $this->container->get('config'); if (!isset($config['fancyDiceMacro_1'])) { // if nothing else has been set, support basic dice set_config('fancyDiceMacro_1', json_encode(array('d'=>'@[1_>]'))); } */ return 'fancyDice_config_changed'; break; default: // Run parent enable step method return parent::enable_step($old_state); break; } }
public function purge_step($old_state) { global $phpbb_root_path; $database = $phpbb_root_path . 'store/messenger.db'; if (is_file($database)) { unlink($database); } $messengerDir = $phpbb_root_path . 'store/messenger'; if (is_dir($messengerDir)) { $objects = scandir($messengerDir); foreach ($objects as $object) { if ($object != '.' && $object != '..') { if (filetype($messengerDir . "/" . $object) == "dir") { rmdir($messengerDir . "/" . $object); } else { unlink($messengerDir . "/" . $object); } } } reset($objects); rmdir($messengerDir); } return parent::purge_step($old_state); }
/** * Overwrite purge_step to purge board rules notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('alg.adminnotifications.notification.type.fromadmin'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge reputation notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge reputation notifications $phpbb_notifications = $this->container->get('notification_manager'); foreach ($this->reputation_notification_types as $reputation_notification_type) { $phpbb_notifications->purge_notifications($reputation_notification_type); } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Purge our notifications * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state * @access public */ public function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $this->container->get('notification_manager'); foreach (self::$notification_types as $type) { $phpbb_notifications->purge_notifications($type); } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * @see \phpbb\extension\base::purge_step() */ public function purge_step($old_state) { switch ($old_state) { case '': $phpbb_notifications = $this->container->get('notification_manager'); foreach ($this->notification_types as $notification_type) { $phpbb_notifications->purge_notifications($notification_type); } return 'notifications'; break; default: return parent::purge_step($old_state); break; } }
/** * Single purge step that reverts any included and installed migrations * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet /** * @todo Remove this try/catch condition once purge_notifications is fixed * in the core to work with disabled extensions without fatal errors. * https://tracker.phpbb.com/browse/PHPBB3-12435 */ try { // Purge board rules notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_image_for_approval'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_image_approved'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_image'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_comment'); $phpbb_notifications->purge_notifications('notification.type.phpbbgallery_new_report'); } catch (\phpbb\notification\exception $e) { // continue } return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }
/** * Overwrite purge_step to purge notifications before * any included and installed migrations are reverted. * * @param mixed $old_state State returned by previous call of this method * @return mixed Returns false after last step, otherwise temporary state */ function purge_step($old_state) { switch ($old_state) { case '': // Empty means nothing has run yet // Purge notifications $phpbb_notifications = $this->container->get('notification_manager'); $phpbb_notifications->purge_notifications('gfksx.thanksforposts.notification.type.thanks'); $phpbb_notifications->purge_notifications('gfksx.thanksforposts.notification.type.thanks_remove'); return 'notifications'; break; default: // Run parent purge step method return parent::purge_step($old_state); break; } }