Zeile 299 | Zeile 299 |
---|
$db->update_query("adminoptions", array("loginattempts" => 0, "loginlockoutexpiry" => 0), "uid='{$mybb->user['uid']}'"); }
|
$db->update_query("adminoptions", array("loginattempts" => 0, "loginlockoutexpiry" => 0), "uid='{$mybb->user['uid']}'"); }
|
my_setcookie("adminsid", $sid, '', true);
| my_setcookie("adminsid", $sid, '', true, "lax");
|
my_setcookie('acploginattempts', 0); $post_verify = false;
| my_setcookie('acploginattempts', 0); $post_verify = false;
|
Zeile 462 | Zeile 462 |
---|
else if(ADMIN_IPV6_SEGMENTS > 0 && strpos($ip_address, ':') !== false) { // Expand IPv6 addresses
|
else if(ADMIN_IPV6_SEGMENTS > 0 && strpos($ip_address, ':') !== false) { // Expand IPv6 addresses
|
$hex = unpack("H*hex", my_inet_pton($ip_address));
| $hex = unpack("H*hex", my_inet_pton($ip_address));
|
$expanded_ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
|
$expanded_ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
|
$hex_admin = unpack("H*hex", $admin_session['ip']);
| $hex_admin = unpack("H*hex", $admin_session['ip']);
|
$expanded_admin_ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex_admin['hex']), 0, -1);
$exploded_ip = explode(":", $expanded_ip);
| $expanded_admin_ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex_admin['hex']), 0, -1);
$exploded_ip = explode(":", $expanded_ip);
|
Zeile 536 | Zeile 536 |
---|
{ $query = $db->simple_select("adminoptions", "*", "uid='".$mybb->user['uid']."'"); $admin_options = $db->fetch_array($query);
|
{ $query = $db->simple_select("adminoptions", "*", "uid='".$mybb->user['uid']."'"); $admin_options = $db->fetch_array($query);
|
if(!empty($admin_options['cplanguage']) && file_exists(MYBB_ROOT."inc/languages/".$admin_options['cplanguage']."/admin/home_dashboard.lang.php")) { $cp_language = $admin_options['cplanguage']; $lang->set_language($cp_language, "admin"); $lang->load("global"); // Reload global language vars $lang->load("messages", true); }
if(!empty($admin_options['cpstyle']) && file_exists(MYBB_ADMIN_DIR."/styles/{$admin_options['cpstyle']}/main.css")) { $cp_style = $admin_options['cpstyle']; }
| |
// Update the session information in the DB if($admin_session['sid']) { $db->update_query("adminsessions", array('lastactive' => TIME_NOW, 'ip' => $db->escape_binary(my_inet_pton(get_ip()))), "sid='".$db->escape_string($admin_session['sid'])."'"); }
|
// Update the session information in the DB if($admin_session['sid']) { $db->update_query("adminsessions", array('lastactive' => TIME_NOW, 'ip' => $db->escape_binary(my_inet_pton(get_ip()))), "sid='".$db->escape_string($admin_session['sid'])."'"); }
|
|
|
// Fetch administrator permissions $mybb->admin['permissions'] = get_admin_permissions($mybb->user['uid']);
|
// Fetch administrator permissions $mybb->admin['permissions'] = get_admin_permissions($mybb->user['uid']);
|
}
// Include the layout generation class overrides for this style if(file_exists(MYBB_ADMIN_DIR."/styles/{$cp_style}/style.php")) { require_once MYBB_ADMIN_DIR."/styles/{$cp_style}/style.php"; }
// Check if any of the layout generation classes we can override exist in the style file $classes = array( "Page" => "DefaultPage", "SidebarItem" => "DefaultSidebarItem", "PopupMenu" => "DefaultPopupMenu", "Table" => "DefaultTable", "Form" => "DefaultForm", "FormContainer" => "DefaultFormContainer" ); foreach($classes as $style_name => $default_name) { // Style does not have this layout generation class, create it if(!class_exists($style_name)) { eval("class {$style_name} extends {$default_name} { }"); } }
$page = new Page; $page->style = $cp_style;
| }
|
// Do not have a valid Admin user, throw back to login page. if(!isset($mybb->user['uid']) || $logged_out == true) { if($logged_out == true) {
|
// Do not have a valid Admin user, throw back to login page. if(!isset($mybb->user['uid']) || $logged_out == true) { if($logged_out == true) {
|
$page->show_login($lang->success_logged_out);
| $default_page->show_login($lang->success_logged_out);
|
} elseif($fail_check == 1) {
|
} elseif($fail_check == 1) {
|
$page->show_login($login_lang_string, "error");
| $default_page->show_login($login_lang_string, "error");
|
} else {
| } else {
|
Zeile 606 | Zeile 566 |
---|
echo json_encode(array("errors" => array("login"))); exit; }
|
echo json_encode(array("errors" => array("login"))); exit; }
|
$page->show_login($login_message, "error");
| $default_page->show_login($login_message, "error");
|
} }
| } }
|
Zeile 690 | Zeile 650 |
---|
) );
|
) );
|
$page->show_lockedout();
| $default_page->show_lockedout();
|
}
|
}
|
|
|
// Still here? Show a custom login page
|
// Still here? Show a custom login page
|
$page->show_login($lang->my2fa_failed, "error"); } }
| $default_page->show_login($lang->my2fa_failed, "error"); } }
|
// Show our 2FA page if(!empty($admin_options['authsecret']) && $admin_session['authenticated'] != 1) {
|
// Show our 2FA page if(!empty($admin_options['authsecret']) && $admin_session['authenticated'] != 1) {
|
$page->show_2fa();
| $default_page->show_2fa(); }
// Now the user is fully authenticated setup their personal options if(!empty($admin_options['cplanguage']) && file_exists(MYBB_ROOT."inc/languages/".$admin_options['cplanguage']."/admin/home_dashboard.lang.php")) { $cp_language = $admin_options['cplanguage']; $lang->set_language($cp_language, "admin"); $lang->load("global"); // Reload global language vars $lang->load("messages", true); } if(!empty($admin_options['cpstyle']) && file_exists(MYBB_ADMIN_DIR."/styles/{$admin_options['cpstyle']}/main.css")) { $cp_style = $admin_options['cpstyle']; }
// Include the layout generation class overrides for this style if(file_exists(MYBB_ADMIN_DIR."/styles/{$cp_style}/style.php")) { require_once MYBB_ADMIN_DIR."/styles/{$cp_style}/style.php"; }
// Check if any of the layout generation classes we can override exist in the style file $classes = array( "Page" => "DefaultPage", "SidebarItem" => "DefaultSidebarItem", "PopupMenu" => "DefaultPopupMenu", "Table" => "DefaultTable", "Form" => "DefaultForm", "FormContainer" => "DefaultFormContainer" ); foreach($classes as $style_name => $default_name) { // Style does not have this layout generation class, create it if(!class_exists($style_name)) { eval("class {$style_name} extends {$default_name} { }"); }
|
}
|
}
|
| $page = new Page; $page->style = $cp_style;
|
$page->add_breadcrumb_item($lang->home, "index.php");
| $page->add_breadcrumb_item($lang->home, "index.php");
|