Merged OAuth2 handling into Misuzu.
This commit is contained in:
parent
1994a9892d
commit
534e947522
115 changed files with 4556 additions and 77 deletions
public-legacy
|
@ -7,7 +7,7 @@ use Misuzu\Auth\AuthTokenCookie;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if($msz->authInfo->isLoggedIn) {
|
||||
if($msz->authInfo->loggedIn) {
|
||||
Tools::redirect($msz->urls->format('index'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use Misuzu\Auth\AuthTokenCookie;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if($msz->authInfo->isLoggedIn) {
|
||||
if($msz->authInfo->loggedIn) {
|
||||
if(!CSRF::validateRequest()) {
|
||||
Template::render('auth.logout');
|
||||
return;
|
||||
|
|
|
@ -7,7 +7,7 @@ use Misuzu\Users\User;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if($msz->authInfo->isLoggedIn) {
|
||||
if($msz->authInfo->loggedIn) {
|
||||
Tools::redirect($msz->urls->format('settings-account'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use Misuzu\Users\User;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if($msz->authInfo->isLoggedIn) {
|
||||
if($msz->authInfo->loggedIn) {
|
||||
Tools::redirect($msz->urls->format('index'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use Misuzu\Auth\AuthTokenCookie;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if($msz->authInfo->isLoggedIn) {
|
||||
if($msz->authInfo->loggedIn) {
|
||||
Tools::redirect($msz->urls->format('index'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ if(!Tools::isLocalURL($redirect))
|
|||
if(!CSRF::validateRequest())
|
||||
Template::displayInfo("Couldn't verify this request, please refresh the page and try again.", 403);
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::displayInfo('You must be logged in to manage comments.', 403);
|
||||
|
||||
if($msz->usersCtx->hasActiveBan($msz->authInfo->userInfo))
|
||||
|
|
|
@ -11,7 +11,7 @@ use Carbon\CarbonImmutable;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(401);
|
||||
|
||||
$currentUser = $msz->authInfo->userInfo;
|
||||
|
|
|
@ -11,7 +11,7 @@ if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
|||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
$viewerPerms = $msz->authInfo->getPerms('user');
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(403);
|
||||
|
||||
$currentUser = $msz->authInfo->userInfo;
|
||||
|
|
|
@ -6,7 +6,7 @@ use RuntimeException;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(403);
|
||||
|
||||
// TODO: restore forum-topics and forum-posts orderings
|
||||
|
|
|
@ -9,7 +9,7 @@ use Misuzu\Comments\CommentsCategory;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(403);
|
||||
|
||||
$searchQuery = !empty($_GET['q']) && is_string($_GET['q']) ? $_GET['q'] : '';
|
||||
|
|
|
@ -9,7 +9,7 @@ use chillerlan\QRCode\QROptions;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(401);
|
||||
|
||||
$errors = [];
|
||||
|
|
|
@ -8,7 +8,7 @@ use Misuzu\Users\UserInfo;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(401);
|
||||
|
||||
$dbConn = $msz->dbConn;
|
||||
|
|
|
@ -6,7 +6,7 @@ use RuntimeException;
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Script must be called through the Misuzu route dispatcher.');
|
||||
|
||||
if(!$msz->authInfo->isLoggedIn)
|
||||
if(!$msz->authInfo->loggedIn)
|
||||
Template::throwError(401);
|
||||
|
||||
$errors = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue