aboutsummaryrefslogtreecommitdiff
path: root/auth.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-17 11:15:39 +0300
committerValentin Popov <info@valentineus.link>2017-10-17 11:15:39 +0300
commit40e3e4f8a71bb95516c239892793a4173339ca8f (patch)
tree92fc033321ec0c1280a2f5ac9267a9ecdc2e0153 /auth.php
parent31cf02f67b72dc6410684383136c36fac23d00cb (diff)
downloadauth_link-40e3e4f8a71bb95516c239892793a4173339ca8f.tar.xz
auth_link-40e3e4f8a71bb95516c239892793a4173339ca8f.zip
Fix from Codacy
Diffstat (limited to 'auth.php')
-rw-r--r--auth.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/auth.php b/auth.php
index 85ad706..a8d4442 100644
--- a/auth.php
+++ b/auth.php
@@ -135,7 +135,7 @@ class auth_plugin_link extends auth_plugin_base {
$password = htmlspecialchars($_REQUEST['password']);
// User existence check.
- if ($user = $DB->get_record('user', array( 'username' => $username) )) {
+ if ($user = $DB->get_record('user', array('username' => $username) )) {
// Verification of authorization data.
if (validate_internal_user_password($user, $password)) {
complete_user_login($user);
@@ -152,12 +152,12 @@ class auth_plugin_link extends auth_plugin_base {
public function redirect_user() {
global $CFG, $SESSION;
+ $redirect = $CFG->wwwroot;
+
if (isset($SESSION->wantsurl)) {
$redirect = $SESSION->wantsurl;
} else if (isset($_GET['wantsurl'])) {
$redirect = htmlspecialchars($_GET['wantsurl']);
- } else {
- $redirect = $CFG->wwwroot;
}
redirect($redirect);