Vergleich admin/inc/functions.php - 1.8.12 - 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;

			}


			}


			if($navigation)
{
$navigation .= $navsep;

			if($navigation)
{
$navigation .= $navsep;

Zeile 259Zeile 261
			$query2 = $db->simple_select("usergroups", $db->escape_string(implode(',', array_keys($usergroup_permission_fields))), "gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);
}

			$query2 = $db->simple_select("usergroups", $db->escape_string(implode(',', array_keys($usergroup_permission_fields))), "gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);
}





		// Delete existing permissions
$db->delete_query("forumpermissions", "fid='{$fid}' AND gid='{$usergroup['gid']}'");


		// Delete existing permissions
$db->delete_query("forumpermissions", "fid='{$fid}' AND gid='{$usergroup['gid']}'");


Zeile 278Zeile 280
			if($canpostthreads[$usergroup['gid']] == 1)
{
$pthreads = 1;

			if($canpostthreads[$usergroup['gid']] == 1)
{
$pthreads = 1;

			}
else
{

			}
else
{

				$pthreads = 0;
}


				$pthreads = 0;
}


Zeile 354Zeile 356

require_once $modules_dir."/".$action['module']."/module_meta.php";
if(function_exists($action['module']."_admin_permissions"))


require_once $modules_dir."/".$action['module']."/module_meta.php";
if(function_exists($action['module']."_admin_permissions"))

	{

	{

		$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 429Zeile 434
	if($get_gid && !$get_uid)
{
// A group only

	if($get_gid && !$get_uid)
{
// A group only





		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",

		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",

Zeile 446Zeile 451
			"order_by" => "uid",
"order_dir" => "DESC"
);

			"order_by" => "uid",
"order_dir" => "DESC"
);





		// Prepare user's groups into SQL format
$group_sql = '';
foreach($gid_array as $gid)

		// Prepare user's groups into SQL format
$group_sql = '';
foreach($gid_array as $gid)

Zeile 473Zeile 478
			else
{
$perms_def = $perm['permissions'];

			else
{
$perms_def = $perm['permissions'];

			}

			}

		}

// Figure out group permissions...ugh.

		}

// Figure out group permissions...ugh.

Zeile 501Zeile 506
		if(isset($final_group_perms))
{
return $final_group_perms;

		if(isset($final_group_perms))
{
return $final_group_perms;

		}
else
{

		}
elseif(isset($perms_def))
{

			return $perms_def;
}

			return $perms_def;
}

 

return array();

	}
}


	}
}


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)
{
return false;

	}

if($attempts['loginattempts'] <= 0)
{
return false;

	}

	}


if($mybb->settings['maxloginattempts'] > 0 && $attempts['loginattempts'] >= $mybb->settings['maxloginattempts'])
{
// Has the expiry dateline been set yet?
if($attempts['loginlockoutexpiry'] == 0 && $return_num == false)


if($mybb->settings['maxloginattempts'] > 0 && $attempts['loginattempts'] >= $mybb->settings['maxloginattempts'])
{
// Has the expiry dateline been set yet?
if($attempts['loginlockoutexpiry'] == 0 && $return_num == false)

		{

		{

			$db->update_query("adminoptions", array("loginlockoutexpiry" => TIME_NOW+((int)$mybb->settings['loginattemptstimeout']*60)), "uid='".(int)$uid."'");
}

// Are we returning the # of login attempts?
if($return_num == true)

			$db->update_query("adminoptions", array("loginlockoutexpiry" => TIME_NOW+((int)$mybb->settings['loginattemptstimeout']*60)), "uid='".(int)$uid."'");
}

// Are we returning the # of login attempts?
if($return_num == true)

		{

		{

			return $attempts;
}
// Otherwise are we still locked out?

			return $attempts;
}
// Otherwise are we still locked out?

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 651Zeile 663
 *
* @param string $template The template to be scanned
* @return boolean A true/false depending on if an issue was detected

 *
* @param string $template The template to be scanned
* @return boolean A true/false depending on if an issue was detected

 */

 */

function check_template($template)
{
// Check to see if our database password is in the template

function check_template($template)
{
// Check to see if our database password is in the template

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 800Zeile 812
		}
}
</script>";

		}
}
</script>";

 
}

if(!function_exists('array_column'))
{
function array_column($input, $column_key)
{
$values = array();

if(!is_array($input))
{
$input = array($input);
}

foreach($input as $val)
{
if(is_array($val) && isset($val[$column_key]))
{
$values[] = $val[$column_key];
}
elseif(is_object($val) && isset($val->$column_key))
{
$values[] = $val->$column_key;
}
}

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;

}

}