Hi,
if a user is banned, then he always goes to the error_nopermission page:
Can someone tell me where the php code is located that points to the error template above for banned users?
EDIT: I think I got it now. In inc/functions.php I replaced this:
with this:
I made an additional template error_banned:
Now it works exactly as it should. Can anyone verify if I forgot something?
if a user is banned, then he always goes to the error_nopermission page:
<html>
<head>
<title>{$title}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>{$title}</strong></span></td>
</tr>
<tr>
<td class="trow1">{$error}</td>
</tr>
</table>
{$footer}
</body>
</html>
Can someone tell me where the php code is located that points to the error template above for banned users?
EDIT: I think I got it now. In inc/functions.php I replaced this:
/**
* Produce a friendly error message page
*
* @param string The error message to be shown
* @param string The title of the message shown in the title of the page and the error table
*/
function error($error="", $title="")
{
global $header, $footer, $theme, $headerinclude, $db, $templates, $lang, $mybb, $plugins;
$error = $plugins->run_hooks("error", $error);
if(!$error)
{
$error = $lang->unknown_error;
}
// AJAX error message?
if($mybb->input['ajax'])
{
// Send our headers.
@header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<error>{$error}</error>\n";
exit;
}
if(!$title)
{
$title = $mybb->settings['bbname'];
}
$timenow = my_date($mybb->settings['dateformat'], TIME_NOW) . " " . my_date($mybb->settings['timeformat'], TIME_NOW);
reset_breadcrumb();
add_breadcrumb($lang->error);
eval("\$errorpage = \"".$templates->get("error")."\";");
output_page($errorpage);
exit;
}
with this:
/**
* Produce a friendly error message page
*
* @param string The error message to be shown
* @param string The title of the message shown in the title of the page and the error table
*/
function error($error="", $title="")
{
global $header, $footer, $theme, $headerinclude, $db, $templates, $lang, $mybb, $plugins;
$error = $plugins->run_hooks("error", $error);
if(!$error)
{
$error = $lang->unknown_error;
}
// AJAX error message?
if($mybb->input['ajax'])
{
// Send our headers.
@header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<error>{$error}</error>\n";
exit;
}
if(!$title)
{
$title = $mybb->settings['bbname'];
}
$timenow = my_date($mybb->settings['dateformat'], TIME_NOW) . " " . my_date($mybb->settings['timeformat'], TIME_NOW);
reset_breadcrumb();
add_breadcrumb($lang->error);
if($mybb->usergroup['isbannedgroup'] == 1)
{
eval("\$errorpage = \"".$templates->get("error_banned")."\";");
output_page($errorpage);
}
else
{
eval("\$errorpage = \"".$templates->get("error")."\";");
output_page($errorpage);
}
exit;
}
I made an additional template error_banned:
<html>
<head>
<title>{$title}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
{$footer}
</body>
</html>
Now it works exactly as it should. Can anyone verify if I forgot something?