* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class PluginEnableAction extends Action
{
var $user;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
// Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // 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;
}
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Client error displayed when trying to enable or disable a plugin while not logged in.
$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');
$defaultPlugins = common_config('plugins', 'default');
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 void
*/
-
function handle($args)
{
$key = 'disable-' . $this->plugin;