Rename errorpage() to util_show_error_page() and move util_show_error_page() into include/util.php
This commit is contained in:
@@ -530,7 +530,7 @@ class Application {
|
||||
/* is this user supposed to view this version? */
|
||||
if(!$_SESSION['current']->canViewApplication($this))
|
||||
{
|
||||
errorpage("Something went wrong with the application or version id");
|
||||
util_show_error_page("Something went wrong with the application or version id");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -164,23 +164,6 @@ function apidb_image($name)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* display an error page
|
||||
*/
|
||||
function errorpage($text = null, $message = null)
|
||||
{
|
||||
if (!$text) {
|
||||
$text = "You must be logged in to perform that operation.";
|
||||
}
|
||||
header("HTTP/1.0 404 Object not found or user is not logged in");
|
||||
apidb_header("Oops");
|
||||
echo "<div align=center><font color=red><b>$text</b></font></div>\n";
|
||||
echo "<p>$message</p>\n";
|
||||
apidb_footer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* redirect to $url
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* display an error page
|
||||
*/
|
||||
function util_show_error_page($text = null, $message = null)
|
||||
{
|
||||
if (!$text) {
|
||||
$text = "You must be logged in to perform that operation.";
|
||||
}
|
||||
header("HTTP/1.0 404 Object not found or user is not logged in");
|
||||
apidb_header("Oops");
|
||||
echo "<div align=center><font color=red><b>$text</b></font></div>\n";
|
||||
echo "<p>$message</p>\n";
|
||||
apidb_footer();
|
||||
}
|
||||
|
||||
function makeSafe($var)
|
||||
{
|
||||
|
||||
@@ -623,7 +623,7 @@ class Version {
|
||||
/* is this user supposed to view this version? */
|
||||
if(!$_SESSION['current']->canViewVersion($this))
|
||||
{
|
||||
errorpage("Something went wrong with the application or version id");
|
||||
util_show_error_page("Something went wrong with the application or version id");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -631,14 +631,14 @@ class Version {
|
||||
if(!$oApp->iAppId)
|
||||
{
|
||||
// Oops! application not found or other error. do something
|
||||
errorpage('Internal Database Access Error. No App found.');
|
||||
util_show_error_page('Internal Database Access Error. No App found.');
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!$this->iVersionId)
|
||||
{
|
||||
// Oops! Version not found or other error. do something
|
||||
errorpage('Internal Database Access Error. No Version Found.');
|
||||
util_show_error_page('Internal Database Access Error. No Version Found.');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ function vote_update($vars)
|
||||
{
|
||||
if(!$_SESSION['current']->isLoggedIn())
|
||||
{
|
||||
errorpage("You must be logged in to vote");
|
||||
util_show_error_page("You must be logged in to vote");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user