From b36ec6da87056324ce0cdf98a4745cdc992c5d52 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 10 Dec 2009 13:22:46 -0500 Subject: [PATCH] Fixed incorrect disabling of login_token. --- actions/login.php | 3 ++- lib/command.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/login.php b/actions/login.php index a6f86c0ca1..c775fa6924 100644 --- a/actions/login.php +++ b/actions/login.php @@ -77,12 +77,13 @@ class LoginAction extends Action parent::handle($args); $disabled = common_config('logincommand','disabled'); + $disabled = isset($disabled) && $disabled; if (common_is_real_login()) { $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->checkLogin(); - } else if (!isset($disabled) && isset($args['user_id']) && isset($args['token'])){ + } else if (!$disabled && isset($args['user_id']) && isset($args['token'])){ $this->checkLogin($args['user_id'],$args['token']); } else { common_ensure_session(); diff --git a/lib/command.php b/lib/command.php index af8855a7f2..450db9da37 100644 --- a/lib/command.php +++ b/lib/command.php @@ -584,7 +584,8 @@ class LoginCommand extends Command function execute($channel) { $disabled = common_config('logincommand','disabled'); - if(isset($disabled) && $disabled) { + $disabled = isset($disabled) && $disabled; + if($disabled) { $channel->error($this->user, _('Login command is disabled')); return; } -- 2.39.5