Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct() {
}

function trustExternal($user, $pass, $sticky = false) {
global $USERINFO, $ID;
global $USERINFO, $ID, $conf;

//get user info in session
if (!empty($_SESSION[DOKU_COOKIE]['authgoogle']['info'])) {
Expand Down Expand Up @@ -75,7 +75,7 @@ function trustExternal($user, $pass, $sticky = false) {
$client->setApplicationName("Google Application");
$client->setClientId($this->getConf('client_id'));
$client->setClientSecret($this->getConf('client_secret'));
$client->setRedirectUri(wl('start',array('do'=>'login'),true, '&'));
$client->setRedirectUri(wl($conf['start'],array('do'=>'login'),true, '&'));
$client->setAccessType('online');
$client->setApprovalPrompt('auto');

Expand All @@ -90,7 +90,7 @@ function trustExternal($user, $pass, $sticky = false) {
//save token in cookies
$this->_updateCookie($_SESSION[DOKU_COOKIE]['authgoogle']['token'], time() + 60 * 60 * 24 * 365);
//redirect to login page
header("Location: ".wl('start', array('do'=>'login'), true, '&'));
header("Location: ".wl($conf['start'], array('do'=>'login'), true, '&'));
die();
} catch (Exception $e) {
msg('Auth Google Error: '.$e->getMessage());
Expand Down Expand Up @@ -171,7 +171,7 @@ function trustExternal($user, $pass, $sticky = false) {

//if login page - redirect to main page
if (isset($_GET['do']) && $_GET['do']=='login')
header("Location: ".wl('start', '', true));
header("Location: ".wl($conf['start'], '', true));

return true;
} else {
Expand Down