Vergleich admin/index.php - 1.6.2 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: index.php 5156 2010-07-31 22:58:56Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 80Zeile 80
$fail_check = 0;
$post_verify = true;


$fail_check = 0;
$post_verify = true;


if($mybb->input['action'] == "logout")
{
// Delete session from the database
$db->delete_query("adminsessions", "sid='".$db->escape_string($mybb->cookies['adminsid'])."'");
my_setcookie("adminsid", "");
$logged_out = true;
}
elseif($mybb->input['action'] == "unlock")

if($mybb->input['action'] == "unlock")








{
$user = array();
if($mybb->input['username'])

{
$user = array();
if($mybb->input['username'])

Zeile 104Zeile 97
		$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
if(!$user['uid'])

		$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
if(!$user['uid'])

		{

		{

			$error[] = $lang->error_invalid_uid;
}
}

			$error[] = $lang->error_invalid_uid;
}
}

Zeile 121Zeile 114
			$db->update_query("adminoptions", array('loginlockoutexpiry' => 0, 'loginattempts' => 0), "uid='".intval($user['uid'])."'");

admin_redirect("index.php");

			$db->update_query("adminoptions", array('loginlockoutexpiry' => 0, 'loginattempts' => 0), "uid='".intval($user['uid'])."'");

admin_redirect("index.php");

		}

		}

		else
{
$error[] = $lang->error_invalid_token;

		else
{
$error[] = $lang->error_invalid_token;

Zeile 158Zeile 151
			"ip" => $db->escape_string(get_ip()),
"dateline" => TIME_NOW,
"lastactive" => TIME_NOW,

			"ip" => $db->escape_string(get_ip()),
"dateline" => TIME_NOW,
"lastactive" => TIME_NOW,

			"data" => "",

			"data" => serialize(array()),

		);
$db->insert_query("adminsessions", $admin_session);

		);
$db->insert_query("adminsessions", $admin_session);

 
		$admin_session['data'] = array();

		$db->update_query("adminoptions", array("loginattempts" => 0, "loginlockoutexpiry" => 0), "uid='".intval($mybb->user['uid'])."'", 1);
my_setcookie("adminsid", $sid);
my_setcookie('acploginattempts', 0);
$post_verify = false;

$mybb->request_method = "get";

		$db->update_query("adminoptions", array("loginattempts" => 0, "loginlockoutexpiry" => 0), "uid='".intval($mybb->user['uid'])."'", 1);
my_setcookie("adminsid", $sid);
my_setcookie('acploginattempts', 0);
$post_verify = false;

$mybb->request_method = "get";

 
		
if(!empty($mybb->input['module']))
{
// $query_string should contain the module
$query_string = '?module='.htmlspecialchars($mybb->input['module']);

// Now we look for any paramters passed in $_SERVER['QUERY_STRING']
if($_SERVER['QUERY_STRING'])
{
$qstring = '?'.preg_replace('#adminsid=(.{32})#i', '', $_SERVER['QUERY_STRING']);
$qstring = str_replace('action=logout', '', $qstring);
$qstring = preg_replace('#&+#', '&', $qstring);
$qstring = str_replace('?&', '?', $qstring);

// So what do we do? We know that parameters are devided by ampersands
// That means we must get to work!
$parameters = explode('&', $qstring);

// Remove our first member if it's for the module
if(substr($parameters[0], 0, 8) == '?module=')
{
unset($parameters[0]);
}

foreach($parameters as $key => $param)
{
$params = explode("=", $param);

$query_string .= '&'.htmlspecialchars($params[0])."=".htmlspecialchars($params[1]);
}
}

admin_redirect("index.php".$query_string);
}

	}
else
{

	}
else
{

Zeile 281Zeile 309
				}
}
}

				}
}
}

 
	}
}

if($mybb->input['action'] == "logout" && $mybb->user)
{
if(verify_post_check($mybb->input['my_post_key']))
{
$db->delete_query("adminsessions", "sid='".$db->escape_string($mybb->cookies['adminsid'])."'");
my_setcookie("adminsid", "");
$logged_out = true;

	}
}


	}
}


Zeile 291Zeile 329
else
{
$mybbgroups = $mybb->user['usergroup'].",".$mybb->user['additionalgroups'];

else
{
$mybbgroups = $mybb->user['usergroup'].",".$mybb->user['additionalgroups'];

}

}

$mybb->usergroup = usergroup_permissions($mybbgroups);

$mybb->usergroup = usergroup_permissions($mybbgroups);





if($mybb->usergroup['cancp'] != 1 || !$mybb->user['uid'])
{
$db->delete_query("adminsessions", "uid='".intval($mybb->user['uid'])."'");

if($mybb->usergroup['cancp'] != 1 || !$mybb->user['uid'])
{
$db->delete_query("adminsessions", "uid='".intval($mybb->user['uid'])."'");

Zeile 302Zeile 340
}

if($mybb->user['uid'])

}

if($mybb->user['uid'])

{

{

	$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);


Zeile 374Zeile 412
$page->add_breadcrumb_item($lang->home, "index.php");

// Begin dealing with the modules

$page->add_breadcrumb_item($lang->home, "index.php");

// Begin dealing with the modules

 
$is_super_admin = is_super_admin($mybb->user['uid']);


$modules_dir = MYBB_ADMIN_DIR."modules";
$dir = opendir($modules_dir);
while(($module = readdir($dir)) !== false)

$modules_dir = MYBB_ADMIN_DIR."modules";
$dir = opendir($modules_dir);
while(($module = readdir($dir)) !== false)

Zeile 388Zeile 428
		$has_permission = false;
if(function_exists($module."_admin_permissions"))
{

		$has_permission = false;
if(function_exists($module."_admin_permissions"))
{

			if(isset($mybb->admin['permissions'][$module]))

			if(isset($mybb->admin['permissions'][$module]) || $is_super_admin == true)

			{
$has_permission = true;
}

			{
$has_permission = true;
}

Zeile 416Zeile 456
	}
}


	}
}


$plugins->run_hooks_by_ref("admin_tabs", $modules);

$modules = $plugins->run_hooks("admin_tabs", $modules);


closedir($dir);



closedir($dir);