Vergleich admin/inc/functions.php - 1.8.15 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 205Zeile 205

reset($pforumcache);
reset($pforumcache[$fid]);


reset($pforumcache);
reset($pforumcache[$fid]);

 

$navigation = '';


foreach($pforumcache[$fid] as $key => $forum)
{
if($fid == $forum['fid'])
{


foreach($pforumcache[$fid] as $key => $forum)
{
if($fid == $forum['fid'])
{

			if($pforumcache[$forum['pid']])

			if(!empty($pforumcache[$forum['pid']]))

			{
$navigation = make_parent_list($forum['pid'], $navsep).$navigation;
}

			{
$navigation = make_parent_list($forum['pid'], $navsep).$navigation;
}

Zeile 357Zeile 359
	{
$func = $action['module']."_admin_permissions";
$permissions = $func();

	{
$func = $action['module']."_admin_permissions";
$permissions = $func();

		if($permissions['permissions'][$action['action']] && $mybb->admin['permissions'][$action['module']][$action['action']] != 1)




		if(
!empty($permissions['permissions'][$action['action']]) &&
empty($mybb->admin['permissions'][$action['module']][$action['action']])
)

		{
if($error)
{

		{
if($error)
{

Zeile 439Zeile 444
		return my_unserialize($db->fetch_field($query, "permissions"));
}
else

		return my_unserialize($db->fetch_field($query, "permissions"));
}
else

	{

	{

		// A user and/or group

$options = array(

		// A user and/or group

$options = array(

Zeile 459Zeile 464
		while($perm = $db->fetch_array($query))
{
$perm['permissions'] = my_unserialize($perm['permissions']);

		while($perm = $db->fetch_array($query))
{
$perm['permissions'] = my_unserialize($perm['permissions']);





			// Sorting out which permission is which
if($perm['uid'] > 0)
{

			// Sorting out which permission is which
if($perm['uid'] > 0)
{

Zeile 478Zeile 483

// Figure out group permissions...ugh.
foreach($perms_group as $gperms)


// Figure out group permissions...ugh.
foreach($perms_group as $gperms)

		{

		{

			if(!isset($final_group_perms))
{
// Use this group as the base for admin group permissions

			if(!isset($final_group_perms))
{
// Use this group as the base for admin group permissions

Zeile 502Zeile 507
		{
return $final_group_perms;
}

		{
return $final_group_perms;
}

		else

		elseif(isset($perms_def))

		{
return $perms_def;
}

		{
return $perms_def;
}

 

return array();

	}
}


	}
}


Zeile 516Zeile 523
 * @return string The iconv/mb encoding
*/
function fetch_iconv_encoding($mysql_encoding)

 * @return string The iconv/mb encoding
*/
function fetch_iconv_encoding($mysql_encoding)

{

{

    $mysql_encoding = explode("_", $mysql_encoding);
switch($mysql_encoding[0])
{

    $mysql_encoding = explode("_", $mysql_encoding);
switch($mysql_encoding[0])
{

Zeile 546Zeile 553
	while($adminoption = $db->fetch_array($query))
{
$adminoption['permissions'] = my_unserialize($adminoption['permissions']);

	while($adminoption = $db->fetch_array($query))
{
$adminoption['permissions'] = my_unserialize($adminoption['permissions']);





		if($default == -1)
{
if(!empty($page))

		if($default == -1)
{
if(!empty($page))

Zeile 565Zeile 572
				if($adminoption['uid'] == 0)
{
$adminoption['permissions'][$tab][$page] = 0;

				if($adminoption['uid'] == 0)
{
$adminoption['permissions'][$tab][$page] = 0;

				}

				}

				else
{
$adminoption['permissions'][$tab][$page] = $default;

				else
{
$adminoption['permissions'][$tab][$page] = $default;

Zeile 594Zeile 601
 * @param integer $uid The uid of the admin to check
* @param boolean $return_num Return an array of the number of attempts and expiry time? (default false)
* @return mixed Return an array if the second parameter is true, boolean otherwise.

 * @param integer $uid The uid of the admin to check
* @param boolean $return_num Return an array of the number of attempts and expiry time? (default false)
* @return mixed Return an array if the second parameter is true, boolean otherwise.

 */

 */

function login_attempt_check_acp($uid=0, $return_num=false)
{
global $db, $mybb;

function login_attempt_check_acp($uid=0, $return_num=false)
{
global $db, $mybb;

Zeile 605Zeile 612
	{
$query = $db->simple_select("adminoptions", "loginattempts, loginlockoutexpiry", "uid='".(int)$uid."'", 1);
$attempts = $db->fetch_array($query);

	{
$query = $db->simple_select("adminoptions", "loginattempts, loginlockoutexpiry", "uid='".(int)$uid."'", 1);
$attempts = $db->fetch_array($query);

 

if(!$attempts)
{
return false;
}

	}

if($attempts['loginattempts'] <= 0)

	}

if($attempts['loginattempts'] <= 0)

Zeile 633Zeile 645
	}

return false;

	}

return false;

}

}


/**
* Checks whether the administrator is on a mobile device


/**
* Checks whether the administrator is on a mobile device

Zeile 662Zeile 674

// System calls via backtick
if(preg_match('#\$\s*\{#', $template))


// System calls via backtick
if(preg_match('#\$\s*\{#', $template))

	{

	{

		return true;
}


		return true;
}


Zeile 671Zeile 683
	if(preg_match("~\\{\\$.+?\\}~s", preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~', '', $template)))
{
return true;

	if(preg_match("~\\{\\$.+?\\}~s", preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~', '', $template)))
{
return true;

	}

	}


return false;
}


return false;
}

Zeile 724Zeile 736
		{
while($post = $db->fetch_array($query))
{

		{
while($post = $db->fetch_array($query))
{

				if($post['usepostcounts'] != 0 && $post['visible'] != 0)

				if($post['usepostcounts'] != 0 && $post['visible'] == 1)

				{
++$post_count;
}

				{
++$post_count;
}

Zeile 827Zeile 839

return $values;
}


return $values;
}

 
}

/**
* Output the auto redirect block.
*
* @param \Form $form An existing form instance to wrap the redirect within.
* @param string $prompt The prompt to show.
*/
function output_auto_redirect($form, $prompt)
{
global $lang;

echo <<<HTML
<div class="confirm_action">
<p>{$prompt}</p>
<br />
<script type="text/javascript">
$(function() {
var button = $("#proceed_button");
if (button.length > 0) {
// create a temporary div element to render the text within, un-escaping HTML entities
var textElement = $('<div/>').html('{$lang->automatically_redirecting}');

button.val(textElement.text());
button.attr("disabled", true);
button.css("color", "#aaa");
button.css("borderColor", "#aaa");

var parent_form = button.closest('form');

if (parent_form.length > 0) {
parent_form.submit();
}
}
});
</script>
<p class="buttons">
{$form->generate_submit_button($lang->proceed, array('class' => 'button_yes', 'id' => 'proceed_button'))}
</p>
</div>
HTML;

}

}