summaryrefslogtreecommitdiff
path: root/actions/login.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/login.php')
-rw-r--r--actions/login.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/actions/login.php b/actions/login.php
index cd1326813..a6f86c0ca 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -75,10 +75,15 @@ 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($disabled) && isset($args['user_id']) && isset($args['token'])){
+ $this->checkLogin($args['user_id'],$args['token']);
} else {
common_ensure_session();
$this->showForm();
@@ -95,7 +100,7 @@ class LoginAction extends Action
* @return void
*/
- function checkLogin()
+ function checkLogin($user_id=null, $token=null)
{
if(isset($token) && isset($user_id)){
//Token based login (from the LoginCommand)
@@ -137,11 +142,6 @@ class LoginAction extends Action
$user = common_check_user($nickname, $password);
}
- $nickname = common_canonical_nickname($this->trimmed('nickname'));
- $password = $this->arg('password');
-
- $user = common_check_user($nickname, $password);
-
if (!$user) {
$this->showForm(_('Incorrect username or password.'));
return;