diff -r 854eecfada20 -r 474f8be55943 includes/pageprocess.php
--- a/includes/pageprocess.php Fri Dec 07 16:42:22 2007 -0500
+++ b/includes/pageprocess.php Fri Dec 07 18:47:37 2007 -0500
@@ -152,6 +152,8 @@
function send( $do_stats = false )
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
+
if ( !$this->perms->get_permissions('read') )
{
$this->err_access_denied();
@@ -187,7 +189,7 @@
{
if ( !$this->page_exists )
{
- redirect( makeUrl(getConfig('main_page')), 'Can\'t find special page', 'The special or administration page you requested does not exist. You will now be transferred to the main page.', 2 );
+ die_semicritical('Exception in PageProcessor', '
Special page not existent but exception not previously caught by path manager.
');
}
$func_name = "page_{$this->namespace}_{$this->page_id}";
if ( function_exists($func_name) )
@@ -196,9 +198,8 @@
}
else
{
- $title = 'Page backend not found';
- $message = "The administration page you are looking for was properly registered using the page API, but the backend function
- ($fname) was not found. If this is a plugin page, then this is almost certainly a bug with the plugin.";
+ $title = $lang->get('page_err_custompage_function_missing_title');
+ $message = $lang->get('page_err_custompage_function_missing_body', array( 'function_name' => $fname ));
if ( $this->send_headers )
{
@@ -291,7 +292,7 @@
$page_id_data = RenderMan::strToPageID($page_to);
if ( count($this->redirect_stack) >= 3 )
{
- $this->render( (!$strict_no_headers), 'The maximum number of internal redirects has been exceeded.
' );
+ $this->render( (!$strict_no_headers), '' . $lang->get('page_err_redirects_exceeded') . '
' );
}
else
{
@@ -381,6 +382,7 @@
function render($incl_inner_headers = true, $_errormsg = false)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
$text = $this->fetch_text();
$text = preg_replace('/([\s]*)__NOBREADCRUMBS__([\s]*)/', '', $text);
@@ -414,11 +416,7 @@
- This page is a redirector.
- This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.
- To create a redirect page, make the first characters in the page content #redirect [[Page_ID]]. For more information, see the
- Enano Wiki formatting guide.
- This page redirects to ' . $a . '.
+ ' . $lang->get('page_msg_this_is_a_redirector', array( 'redirect_target' => $a )) . '
|
@@ -956,19 +954,29 @@
function _handle_redirect($page_id, $namespace)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
$arr_pid = array($this->page_id, $this->namespace);
if ( $namespace == 'Special' || $namespace == 'Admin' )
{
- return 'This page redirects to a Special or Administration page, which is not allowed.';
+ return $lang->get('page_err_redirect_to_special');
}
- if ( in_array($this->redirect_stack, $arr_pid) )
+ $looped = false;
+ foreach ( $this->redirect_stack as $page )
{
- return 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.';
+ if ( $page[0] == $arr_pid[0] && $page[1] == $arr_pid[1] )
+ {
+ $looped = true;
+ break;
+ }
+ }
+ if ( $looped )
+ {
+ return $lang->get('page_err_redirect_infinite_loop');
}
$page_id_key = $paths->nslist[ $namespace ] . sanitize_page_id($page_id);
if ( !isset($paths->pages[$page_id_key]) )
{
- return 'This page redirects to another page that doesn\'t exist.';
+ return $lang->get('page_err_redirect_to_nonexistent');
}
$this->redirect_stack[] = $arr_pid;
@@ -988,6 +996,8 @@
function err_access_denied()
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
+ global $email;
// Log it for crying out loud
$q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \''.date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')');
@@ -1022,7 +1032,10 @@
}
}
- $ob .= 'Access to this page is denied.
This may be because you are not logged in or you have not met certain criteria for viewing this page.
';
+ $email_link = $email->encryptEmail(getConfig('contact_email'), '', '', $lang->get('page_err_access_denied_siteadmin'));
+
+ $ob .= "" . $lang->get('page_err_access_denied_title') . "
";
+ $ob .= "" . $lang->get('page_err_access_denied_body', array('site_administration' => $email_link)) . "
";
if ( $this->send_headers )
{