Show login form when login is required
This commit is contained in:
committed by
Chris Morgan
parent
70e4306e2b
commit
734a4f8a1f
@@ -12,8 +12,10 @@ $oUser = new User($_SESSION['current']->iUserId);
|
|||||||
|
|
||||||
/* Restrict error to logged-in users */
|
/* Restrict error to logged-in users */
|
||||||
if(!$oUser->isLoggedIn())
|
if(!$oUser->isLoggedIn())
|
||||||
util_show_error_page_and_exit("You need to be <a href=\"".login_url().
|
{
|
||||||
"\">logged in</a>.");
|
login_form();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$oRecipient = new User($aClean['iRecipientId']);
|
$oRecipient = new User($aClean['iRecipientId']);
|
||||||
|
|||||||
@@ -164,8 +164,9 @@ class ObjectManager
|
|||||||
if(!$_SESSION['current']->isLoggedIn() && $this->bIsQueue)
|
if(!$_SESSION['current']->isLoggedIn() && $this->bIsQueue)
|
||||||
{
|
{
|
||||||
$sQueueText = $this->bIsRejected ? "rejected" : "queued";
|
$sQueueText = $this->bIsRejected ? "rejected" : "queued";
|
||||||
echo '<div align="center">You need to <a href="'.login_url().'">';
|
echo '<div align="center">You need to ';
|
||||||
echo "log in</a> in order to process $sQueueText entries</div>\n";
|
echo "log in in order to process $sQueueText entries</div>\n";
|
||||||
|
login_form(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -934,10 +935,8 @@ class ObjectManager
|
|||||||
if($oObject->allowAnonymousSubmissions() || $_SESSION['current']->isLoggedIn())
|
if($oObject->allowAnonymousSubmissions() || $_SESSION['current']->isLoggedIn())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
util_show_error_page_and_exit("You need to be <a href=\"".login_url().
|
login_form();
|
||||||
"\">logged in</a>. If you don’t have an ".
|
exit;
|
||||||
"account you can <a href=\"".BASE."account.php?sCmd=new\">register ".
|
|
||||||
"now</a>, it only takes a few seconds.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function displayMoveChildren($oObject)
|
private function displayMoveChildren($oObject)
|
||||||
|
|||||||
@@ -55,6 +55,20 @@ function values($arr)
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Display a login form */
|
||||||
|
function login_form($bShowHeader = true)
|
||||||
|
{
|
||||||
|
global $aClean;
|
||||||
|
$aClean['sReturnTo'] = urlencode($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
|
if($bShowHeader)
|
||||||
|
apidb_header("Login");
|
||||||
|
include(BASE."include/"."form_login.php");
|
||||||
|
|
||||||
|
if($bShowHeader)
|
||||||
|
apidb_footer();
|
||||||
|
}
|
||||||
|
|
||||||
// print the month, day, year, hour, minute, second
|
// print the month, day, year, hour, minute, second
|
||||||
function print_date($sTimestamp)
|
function print_date($sTimestamp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ require_once(BASE."include/appData.php");
|
|||||||
$oUser = new User($_SESSION['current']->iUserId);
|
$oUser = new User($_SESSION['current']->iUserId);
|
||||||
|
|
||||||
if(!$oUser->isLoggedIn())
|
if(!$oUser->isLoggedIn())
|
||||||
util_show_error_page_and_exit();
|
{
|
||||||
|
login_form();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
apidb_header("View Your Queued Items");
|
apidb_header("View Your Queued Items");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user