Extend Action with redirect after login logic, update some actions to use it
This commit is contained in:
parent
691df04103
commit
43df2d201c
|
@ -47,6 +47,8 @@ if (!defined('GNUSOCIAL')) {
|
|||
*/
|
||||
class ConversationAction extends ManagedAction
|
||||
{
|
||||
protected $redirectAfterLogin = true;
|
||||
|
||||
public $conv = null;
|
||||
public $page = null;
|
||||
public $notices = null;
|
||||
|
|
|
@ -44,6 +44,8 @@ require_once INSTALLDIR.'/lib/noticelist.php';
|
|||
*/
|
||||
class ShownoticeAction extends ManagedAction
|
||||
{
|
||||
protected $redirectAfterLogin = true;
|
||||
|
||||
/**
|
||||
* Notice object to show
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ if (!defined('GNUSOCIAL')) {
|
|||
*/
|
||||
class GroupdirectoryAction extends ManagedAction
|
||||
{
|
||||
protected $redirectAfterLogin = true;
|
||||
|
||||
/**
|
||||
* The page we're on
|
||||
*
|
||||
|
@ -143,8 +145,6 @@ class GroupdirectoryAction extends ManagedAction
|
|||
$this->reverse = $this->boolean('reverse');
|
||||
$this->q = $this->trimmed('q');
|
||||
$this->sort = $this->arg('sort', 'nickname');
|
||||
|
||||
common_set_returnto($this->selfUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,6 +42,8 @@ if (!defined('GNUSOCIAL')) {
|
|||
*/
|
||||
class UserdirectoryAction extends ManagedAction
|
||||
{
|
||||
protected $redirectAfterLogin = true;
|
||||
|
||||
/**
|
||||
* The page we're on
|
||||
*
|
||||
|
@ -140,8 +142,6 @@ class UserdirectoryAction extends ManagedAction
|
|||
$this->reverse = $this->boolean('reverse');
|
||||
$this->q = $this->trimmed('q');
|
||||
$this->sort = $this->arg('sort', 'nickname');
|
||||
|
||||
common_set_returnto($this->selfUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user