i find again the plugin to re download I dont know why i have re made to the start without " " and save and re install is not workingt to ask for password ? why
is not appear now i have recount and rebuil the cache i dont know if is can help but change nothing .. i have try uninstall and re install 10 time ..
omg my website not working with the cote single is white page not loading i have restart nginx etc and not working again i take out the quote is working i think is make a mistake in the cote
when i use your quote single is Write bbname in Black and not in pink purple .. is made error
if is can help
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("modcp_start", "modcppassword");
$plugins->add_hook("modcp_start", "modcppassword_logout");
$plugins->add_hook("moderation_start", "modcp_loggedin");
function modcppassword_info()
{
return array(
"name" => "Mod CP Password",
"description" => "Requires a password to enter the Mod CP.",
"website" => "http://www.mybbsecurity.net/",
"author" => "MyBB Security Group",
"authorsite" => "http://www.mybbsecurity.net/",
"version" => "1.0",
"compatibility" => "18*",
);
}
function modcppassword_install()
{
global $db;
$group = array(
"gid" => "NULL",
"name" => "modcppassword",
"title" => "Mod CP Password",
"description" => "Settings for the plugin.",
"disporder" => "9999",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $group);
$gid = $db->insert_id();
$setting_1 = array(
"sid" => "NULL",
"name" => "modcppassword_enabled",
"title" => "Enabled?",
"description" => "Should this plugin be enabled?",
"optionscode" => "yesno",
"value" => "2",
"disporder" => "1",
"gid" => intval($gid),
);
$db->insert_query("settings", $setting_1);
$setting_2 = array(
"sid" => "NULL",
"name" => "modcppassword_password",
"title" => "Mod CP Password",
"description" => "The password used to login to the Mod CP. A blank password will have the same effect as it being disabled.",
"optionscode" => "text",
"value" => random_str(),
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query("settings", $setting_2);
}
function modcppassword_uninstall()
{
global $db, $mybb;
$query = $db->query("SELECT gid FROM ".TABLE_PREFIX."settinggroups WHERE name='modcppassword'");
$g = $db->fetch_array($query);
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE gid='".$g['gid']."'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE gid='".$g['gid']."'");
rebuild_settings();
}
function modcppassword_activate()
{
global $db;
$template_1 = array(
"tid" => NULL,
"title" => 'modcp_password',
"template" => '<html>
<head>
<title>{\$mybb->settings[bbname]} - {\$lang->password_required} </title>
{\$headerinclude}
</head>
<body>
{\$header}
<form action="{\$_SERVER[REQUEST_URI]}" method="post">
<table border="0" cellspacing="{\$theme[borderwidth]}" cellpadding="{\$theme[tablespace]}" class="tborder">
<tr>
<td class="thead" align="center" colspan="2"><strong>{\$lang->password_required}</strong></td>
</tr>
<tr>
<td class="trow2" colspan="2">{\$lang->modcp_password_note}</td>
</tr>
<tr>
<td class="tcat" colspan="2"><strong>{\$lang->enter_password_below}</strong></td>
</tr>
{\$pwnote}
<tr>
<td class="trow1" align="center" colspan="2"><input type="password" class="textbox" name="pwverify" size="50" value="" /></td>
</tr>
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{\$lang->verify_modcp_password}" /></div>
</form>
{\$footer}
</body>
</html>',
"sid" => "-1",
"version" => "1605",
"dateline" => TIME_NOW,
);
$db->insert_query("templates", $template_1);
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("modcp_nav", "#".preg_quote('{$lang->nav_menu}')."#i", '{$lang->nav_menu} (<a href="modcp.php?action=logout&my_post_key={$mybb->post_code}">{$lang->welcome_logout}</a>)');
}
function modcppassword_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title = 'modcp_password'");
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("modcp_nav", "#".preg_quote('(<a href="modcp.php?action=logout&my_post_key={$mybb->post_code}">{$lang->welcome_logout}</a>)')."#i", '');
}
function modcppassword_is_installed()
{
global $db;
$query = $db->simple_select("settings", "name", "name='modcppassword_enabled'");
$rows = $db->num_rows($query);
if(intval($rows) == 1)
{
return true;
}
return false;
}
function modcppassword()
{
global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;
$lang->modcp_password_note = 'The administrator has required it so that a password is required for access the moderator control panel.';
$lang->verify_modcp_password = 'Verify Password';
$showform = true;
$enabled = false;
if($mybb->settings['modcppassword_enabled'] == 1)
{
$enabled = true;
}
$password = $mybb->settings['modcppassword_password'];
if($enabled && $password !== '')
{
if($mybb->input['pwverify'])
{
if($password == $mybb->input['pwverify'])
{
my_setcookie("modcppassword", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);
$showform = false;
}
else
{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");
$showform = true;
}
}
else
{
if(!$mybb->cookies['modcppassword'] || ($mybb->cookies['modcppassword'] && md5($mybb->user['uid'].$password) != $mybb->cookies['modcppassword']))
{
$showform = true;
}
else
{
$showform = false;
}
}
}
else
{
$showform = false;
}
if($showform)
{
if($pid)
{
header("Location: ".$_SERVER['REQUEST_URI']);
}
else
{
$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
eval("\$pwform = \"".$templates->get("modcp_password")."\";");
output_page($pwform);
}
exit;
}
}
function modcppassword_logout()
{
global $mybb;
if($mybb->input['action'] == 'logout')
{
verify_post_check($mybb->input['my_post_key']);
my_setcookie("modcppassword", '', null, true);
redirect('modcp.php');
exit;
}
}
function modcp_loggedin()
{
$password = $mybb->settings['modcppassword_password'];
if($mybb->settings['modcppassword_enabled'] == 1 && $mybb->cookies['modcppassword'] && md5($mybb->user['uid'].$password) == $mybb->cookies['modcppassword'])
{
redirect('modcp.php');
exit;
}
}
?>