Vergleich admin/inc/functions.php - 1.8.13 - 1.8.33

  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 224Zeile 226
	}
return $navigation;
}

	}
return $navigation;
}





/**
* @param int $fid
*/
function save_quick_perms($fid)
{
global $db, $inherit, $canview, $canpostthreads, $canpostreplies, $canpostpolls, $canpostattachments, $cache;

/**
* @param int $fid
*/
function save_quick_perms($fid)
{
global $db, $inherit, $canview, $canpostthreads, $canpostreplies, $canpostpolls, $canpostattachments, $cache;





	$permission_fields = array();

	$permission_fields = array();





	$field_list = $db->show_fields_from("forumpermissions");
foreach($field_list as $field)
{

	$field_list = $db->show_fields_from("forumpermissions");
foreach($field_list as $field)
{

Zeile 242Zeile 244
			$permission_fields[$field['Field']] = 1;
}
}

			$permission_fields[$field['Field']] = 1;
}
}





	// "Can Only View Own Threads" and "Can Only Reply Own Threads" permissions are forum permission only options
$usergroup_permission_fields = $permission_fields;
unset($usergroup_permission_fields['canonlyviewownthreads']);

	// "Can Only View Own Threads" and "Can Only Reply Own Threads" permissions are forum permission only options
$usergroup_permission_fields = $permission_fields;
unset($usergroup_permission_fields['canonlyviewownthreads']);

Zeile 264Zeile 266
		$db->delete_query("forumpermissions", "fid='{$fid}' AND gid='{$usergroup['gid']}'");

// Only insert the new ones if we're using custom permissions

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

// Only insert the new ones if we're using custom permissions

		if($inherit[$usergroup['gid']] != 1)

		if(empty($inherit[$usergroup['gid']]))

		{

		{

			if($canview[$usergroup['gid']] == 1)

			if(!empty($canview[$usergroup['gid']]))

			{
$pview = 1;
}

			{
$pview = 1;
}

			else
{
$pview = 0;
}

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

			else
{
$pview = 0;
}

if(!empty($canpostthreads[$usergroup['gid']]))
{

				$pthreads = 1;

				$pthreads = 1;

			}

			}

			else
{
$pthreads = 0;

			else
{
$pthreads = 0;

			}

if($canpostreplies[$usergroup['gid']] == 1)
{

			}

if(!empty($canpostreplies[$usergroup['gid']]))
{

				$preplies = 1;

				$preplies = 1;

			}
else

			}
else

			{
$preplies = 0;
}

			{
$preplies = 0;
}


if($canpostpolls[$usergroup['gid']] == 1)
{
$ppolls = 1;
}


if(!empty($canpostpolls[$usergroup['gid']]))
{
$ppolls = 1;
}

			else
{
$ppolls = 0;

			else
{
$ppolls = 0;

Zeile 327Zeile 329
					continue;
}


					continue;
}


				$insertquery[$db->escape_string($field)] = (int)$existing_permissions[$field];

				$insertquery[$db->escape_string($field)] = isset($existing_permissions[$field]) ? (int)$existing_permissions[$field] : 0;

			}

$db->insert_query("forumpermissions", $insertquery);
}

			}

$db->insert_query("forumpermissions", $insertquery);
}

	}

	}

	$cache->update_forumpermissions();
}


	$cache->update_forumpermissions();
}


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)

			{

			{

				$page->output_header($lang->access_denied);
$page->add_breadcrumb_item($lang->access_denied, "index.php?module=home-index");
$page->output_error("<b>{$lang->access_denied}</b><ul><li style=\"list-style-type: none;\">{$lang->access_denied_desc}</li></ul>");

				$page->output_header($lang->access_denied);
$page->add_breadcrumb_item($lang->access_denied, "index.php?module=home-index");
$page->output_error("<b>{$lang->access_denied}</b><ul><li style=\"list-style-type: none;\">{$lang->access_denied_desc}</li></ul>");

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

}

}