Extend Action with redirect after login logic, update some actions to use it

This commit is contained in:
brunoccast
2019-06-02 13:55:12 +01:00
committed by Diogo Cordeiro
parent 691df04103
commit 43df2d201c
5 changed files with 13 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ class Action extends HTMLOutputter // lawsuit
protected $ajax = false;
protected $menus = true;
protected $needLogin = false;
protected $redirectAfterLogin = false;
protected $needPost = false; // implies canPost if true
protected $canPost = false; // can this action handle POST method?
@@ -248,6 +249,10 @@ class Action extends HTMLOutputter // lawsuit
if ($this->needLogin) {
$this->checkLogin(); // if not logged in, this redirs/excepts
}
if ($this->redirectAfterLogin) {
common_set_returnto($this->selfUrl());
}
$this->updateScopedProfile();