X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpluginenable.php;h=711b1b2c56d273149f65c50c87651307d625082a;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=156a604cf060ed64008795f00b4c82af110d53f2;hpb=513c54fa89085fde783a73c298d61576f834b131;p=quix0rs-gnu-social.git diff --git a/actions/pluginenable.php b/actions/pluginenable.php index 156a604cf0..711b1b2c56 100644 --- a/actions/pluginenable.php +++ b/actions/pluginenable.php @@ -64,7 +64,7 @@ class PluginEnableAction extends Action * * @return boolean success flag */ - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); @@ -76,7 +76,6 @@ class PluginEnableAction extends Action // TRANS: Client error displayed when trying to use another method than POST. // TRANS: Do not translate POST. $this->clientError(_('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -87,7 +86,6 @@ class PluginEnableAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -97,13 +95,11 @@ class PluginEnableAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } if (!AdminPanelAction::canAdmin('plugins')) { // TRANS: Client error displayed when trying to enable or disable a plugin without access rights. $this->clientError(_('You cannot administer plugins.')); - return false; } $this->plugin = $this->arg('plugin'); @@ -111,7 +107,6 @@ class PluginEnableAction extends Action if (!array_key_exists($this->plugin, $defaultPlugins)) { // TRANS: Client error displayed when trying to enable or disable a non-existing plugin. $this->clientError(_('No such plugin.')); - return false; } return true; @@ -126,7 +121,7 @@ class PluginEnableAction extends Action * * @return void */ - function handle($args) + function handle(array $args=array()) { $key = 'disable-' . $this->plugin; Config::save('plugins', $key, $this->overrideValue()); @@ -141,7 +136,7 @@ class PluginEnableAction extends Action $form = $this->successNextForm(); $form->show(); $this->elementEnd('body'); - $this->elementEnd('html'); + $this->endHTML(); } else { $url = common_local_url('pluginsadminpanel'); common_redirect($url, 303);