Client API: add response on successful authorisation
This commit is contained in:
parent
18fa942259
commit
e448651e07
6
auth.php
6
auth.php
@ -111,8 +111,12 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('client')))
|
|||||||
session_name('ulogger');
|
session_name('ulogger');
|
||||||
session_start();
|
session_start();
|
||||||
$user->storeInSession();
|
$user->storeInSession();
|
||||||
|
if (!defined('client')) {
|
||||||
|
// redirect
|
||||||
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
||||||
header("Location: $ssl://$url");
|
header("Location: $ssl://$url");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// unsuccessful
|
// unsuccessful
|
||||||
$error = "?auth_error=1";
|
$error = "?auth_error=1";
|
||||||
@ -130,9 +134,9 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('client')))
|
|||||||
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
||||||
header("Location: $ssl://$url$error");
|
header("Location: $ssl://$url$error");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end of authentication */
|
/* end of authentication */
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user