summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/login.php5
-rw-r--r--lib/command.php5
2 files changed, 9 insertions, 1 deletions
diff --git a/actions/login.php b/actions/login.php
index cee29fd09..a6f86c0ca 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -75,11 +75,14 @@ class LoginAction extends Action
function handle($args)
{
parent::handle($args);
+
+ $disabled = common_config('logincommand','disabled');
+
if (common_is_real_login()) {
$this->clientError(_('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->checkLogin();
- } else if (isset($args['user_id']) && isset($args['token'])){
+ } else if (!isset($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 7e98156b6..e2a665511 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -583,6 +583,11 @@ class LoginCommand extends Command
{
function execute($channel)
{
+ $disabled = common_config('logincommand','disabled');
+ if(isset($disabled)) {
+ $channel->error($this->user, _('Login command is disabled'));
+ return;
+ }
$login_token = Login_token::staticGet('user_id',$this->user->id);
if($login_token){
$login_token->delete();