diff --git a/contact.php b/contact.php index 993105f..5bd1bef 100644 --- a/contact.php +++ b/contact.php @@ -12,8 +12,10 @@ $oUser = new User($_SESSION['current']->iUserId); /* Restrict error to logged-in users */ if(!$oUser->isLoggedIn()) - util_show_error_page_and_exit("You need to be logged in."); +{ + login_form(); + exit; +} $oRecipient = new User($aClean['iRecipientId']); diff --git a/include/objectManager.php b/include/objectManager.php index 02f40e5..6a282f8 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -164,8 +164,9 @@ class ObjectManager if(!$_SESSION['current']->isLoggedIn() && $this->bIsQueue) { $sQueueText = $this->bIsRejected ? "rejected" : "queued"; - echo '
You need to '; - echo "log in in order to process $sQueueText entries
\n"; + echo '
You need to '; + echo "log in in order to process $sQueueText entries
\n"; + login_form(false); return; } @@ -934,10 +935,8 @@ class ObjectManager if($oObject->allowAnonymousSubmissions() || $_SESSION['current']->isLoggedIn()) return; - util_show_error_page_and_exit("You need to be logged in. If you don’t have an ". - "account you can register ". - "now, it only takes a few seconds."); + login_form(); + exit; } private function displayMoveChildren($oObject) diff --git a/include/util.php b/include/util.php index 99362ac..4f6f546 100644 --- a/include/util.php +++ b/include/util.php @@ -55,6 +55,20 @@ function values($arr) 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 function print_date($sTimestamp) { diff --git a/queueditems.php b/queueditems.php index 4a226bc..373bb18 100644 --- a/queueditems.php +++ b/queueditems.php @@ -11,7 +11,10 @@ require_once(BASE."include/appData.php"); $oUser = new User($_SESSION['current']->iUserId); if(!$oUser->isLoggedIn()) - util_show_error_page_and_exit(); +{ + login_form(); + exit; +} apidb_header("View Your Queued Items");