Vergleich admin/modules/config/settings.php - 1.8.27 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 118Zeile 118
	$group = $db->fetch_array($query);

// Does the setting not exist?

	$group = $db->fetch_array($query);

// Does the setting not exist?

	if(!$group['gid'])

	if(!$group)

	{
flash_message($lang->error_invalid_gid2, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

	{
flash_message($lang->error_invalid_gid2, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

Zeile 220Zeile 220
	$group = $db->fetch_array($query);

// Does the setting group not exist?

	$group = $db->fetch_array($query);

// Does the setting group not exist?

	if(!$group['gid'])

	if(!$group)

	{
flash_message($lang->error_invalid_gid2, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

	{
flash_message($lang->error_invalid_gid2, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

Zeile 293Zeile 293
		}

// do some type filtering

		}

// do some type filtering

		$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")

		$mybb->input['type'] = $mybb->get_input('type');
if(!ctype_alnum($mybb->input['type']) || strtolower($mybb->input['type']) == "php")

		{
$mybb->input['type'] = "";
}

		{
$mybb->input['type'] = "";
}

Zeile 306Zeile 306

if(!$errors)
{


if(!$errors)
{

			if($mybb->input['type'] == "custom")
{
$options_code = $mybb->input['extra'];
}
else if($mybb->input['extra'])

			if($mybb->input['extra'])





			{
$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}

			{
$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}

Zeile 357Zeile 353

$page->add_breadcrumb_item($lang->add_new_setting);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting);


$page->add_breadcrumb_item($lang->add_new_setting);
$page->output_header($lang->board_settings." - ".$lang->add_new_setting);





	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"

	$sub_tabs['change_settings'] = array(
'title' => $lang->change_settings,
'link' => "index.php?module=config-settings"

	);

	);


$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,


$sub_tabs['add_setting'] = array(
'title' => $lang->add_new_setting,

Zeile 377Zeile 373
	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&action=manage"

	$sub_tabs['modify_setting'] = array(
'title' => $lang->modify_existing_settings,
'link' => "index.php?module=config-settings&action=manage"

	);

$page->output_nav_tabs($sub_tabs, 'add_setting');

	);

$page->output_nav_tabs($sub_tabs, 'add_setting');


$form = new Form("index.php?module=config-settings&action=add", "post", "add");



$form = new Form("index.php?module=config-settings&action=add", "post", "add");


Zeile 447Zeile 443
		// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");
</script>';

		// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");
</script>';





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 456Zeile 452
{
$query = $db->simple_select("settings", "*", "sid='".$mybb->get_input('sid', MyBB::INPUT_INT)."'");
$setting = $db->fetch_array($query);

{
$query = $db->simple_select("settings", "*", "sid='".$mybb->get_input('sid', MyBB::INPUT_INT)."'");
$setting = $db->fetch_array($query);





	// Does the setting not exist?

	// Does the setting not exist?

	if(!$setting['sid'])

	if(!$setting)

	{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings");

	{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings");

	}

	}


// Prevent editing of default
if($setting['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');


// Prevent editing of default
if($setting['isdefault'] == 1)
{
flash_message($lang->error_cannot_edit_default, 'error');

		admin_redirect("index.php?module=config-settings&action=manage");
}

$plugins->run_hooks("admin_config_settings_edit");

		admin_redirect("index.php?module=config-settings&action=manage");
}

$plugins->run_hooks("admin_config_settings_edit");


$type = explode("\n", $setting['optionscode'], 2);
$type = trim($type[0]);


$type = explode("\n", $setting['optionscode'], 2);
$type = trim($type[0]);

Zeile 480Zeile 476
		flash_message($lang->error_cannot_edit_php, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}

		flash_message($lang->error_cannot_edit_php, 'error');
admin_redirect("index.php?module=config-settings&action=manage");
}





	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

Zeile 493Zeile 489
			$errors[] = $lang->error_missing_name;
}
$query = $db->simple_select("settings", "title", "name='".$db->escape_string($mybb->input['name'])."' AND sid != '{$setting['sid']}'");

			$errors[] = $lang->error_missing_name;
}
$query = $db->simple_select("settings", "title", "name='".$db->escape_string($mybb->input['name'])."' AND sid != '{$setting['sid']}'");

		if($db->num_rows($query) > 0)

		if($db->num_rows($query) > 0)

		{
$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);

		{
$dup_setting_title = $db->fetch_field($query, 'title');
$errors[] = $lang->sprintf($lang->error_duplicate_name, $dup_setting_title);

		}


		}


		// do some type filtering

		// do some type filtering

		$mybb->input['type'] = str_replace("\n", "", $mybb->input['type']);
if(strtolower(substr($mybb->input['type'], 0, 3)) == "php")
{

		$mybb->input['type'] = $mybb->get_input('type');
if(!ctype_alnum($mybb->input['type']) || strtolower($mybb->input['type']) == "php")
{

			$mybb->input['type'] = "";

			$mybb->input['type'] = "";

		}

		}


if(!$mybb->input['type'])
{


if(!$mybb->input['type'])
{

Zeile 513Zeile 509

if(!$errors)
{


if(!$errors)
{

			if($mybb->input['type'] == "custom")
{
$options_code = $mybb->input['extra'];
}
else if($mybb->input['extra'])

			if($mybb->input['extra'])





			{
$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}

			{
$options_code = "{$mybb->input['type']}\n{$mybb->input['extra']}";
}

Zeile 681Zeile 673
	$setting = $db->fetch_array($query);

// Does the setting not exist?

	$setting = $db->fetch_array($query);

// Does the setting not exist?

	if(empty($setting['sid']))

	if(!$setting)

	{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

	{
flash_message($lang->error_invalid_sid, 'error');
admin_redirect("index.php?module=config-settings&action=manage");

Zeile 1040Zeile 1032
		$hcaptchapublickey = $mybb->settings['hcaptchapublickey'];

if(in_array($captchaimage, array(captcha::NOCAPTCHA_RECAPTCHA, captcha::RECAPTCHA_INVISIBLE)) && (!$recaptchaprivatekey || !$recaptchapublickey))

		$hcaptchapublickey = $mybb->settings['hcaptchapublickey'];

if(in_array($captchaimage, array(captcha::NOCAPTCHA_RECAPTCHA, captcha::RECAPTCHA_INVISIBLE)) && (!$recaptchaprivatekey || !$recaptchapublickey))

		{
$set_captcha_image = true;

		{
$set_captcha_image = true;

		}
else if(in_array($captchaimage, array(captcha::RECAPTCHA_V3)) && (!$recaptchaprivatekey || !$recaptchapublickey || !$recaptchascore))
{

		}
else if(in_array($captchaimage, array(captcha::RECAPTCHA_V3)) && (!$recaptchaprivatekey || !$recaptchapublickey || !$recaptchascore))
{

Zeile 1086Zeile 1078
				if(empty($mybb->input['upsetting'][$multisetting['name']]) && isset($mybb->input["isvisible_{$multisetting['name']}"]))
{
$mybb->input['upsetting'][$multisetting['name']] = array();

				if(empty($mybb->input['upsetting'][$multisetting['name']]) && isset($mybb->input["isvisible_{$multisetting['name']}"]))
{
$mybb->input['upsetting'][$multisetting['name']] = array();

				}
}

				}
}

			elseif(substr($multisetting['optionscode'], 0, 7) == 'numeric')
{
if(isset($mybb->input['upsetting'][$multisetting['name']]))

			elseif(substr($multisetting['optionscode'], 0, 7) == 'numeric')
{
if(isset($mybb->input['upsetting'][$multisetting['name']]))

Zeile 1155Zeile 1147
		}

if(isset($mybb->input['upsetting']['username_method'], $mybb->input['upsetting']['allowmultipleemails']))

		}

if(isset($mybb->input['upsetting']['username_method'], $mybb->input['upsetting']['allowmultipleemails']))

		{

		{

			// Administrator is changing registration email allowance
if((int)$mybb->settings['username_method'] > 0 && (int)$mybb->input['upsetting']['allowmultipleemails'] !== 0)
{

			// Administrator is changing registration email allowance
if((int)$mybb->settings['username_method'] > 0 && (int)$mybb->input['upsetting']['allowmultipleemails'] !== 0)
{

Zeile 1200Zeile 1192
				$realpath = realpath(mk_path_abs($mybb->input['upsetting'][$field]));

if ($realpath === false)

				$realpath = realpath(mk_path_abs($mybb->input['upsetting'][$field]));

if ($realpath === false)

				{

				{

					unset($mybb->input['upsetting'][$field]);
continue;
}

					unset($mybb->input['upsetting'][$field]);
continue;
}

Zeile 1216Zeile 1208
			}
}


			}
}






		if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)
{
if($forum_group_select && in_array($name, $forum_group_select))

		if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)
{
if($forum_group_select && in_array($name, $forum_group_select))

				{

				{

					if($value == 'all')
{
$value = -1;

					if($value == 'all')
{
$value = -1;

Zeile 1291Zeile 1283
		{
my_unsetcookie("adminsid");
$mybb->settings['cookieprefix'] = $mybb->input['upsetting']['cookieprefix'];

		{
my_unsetcookie("adminsid");
$mybb->settings['cookieprefix'] = $mybb->input['upsetting']['cookieprefix'];

			my_setcookie("adminsid", $admin_session['sid'], '', true, "lax");

			my_setcookie("adminsid", $admin_session['sid'], '', true, "strict");

		}

if(isset($mybb->input['upsetting']['statstopreferrer']) && $mybb->input['upsetting']['statstopreferrer'] != $mybb->settings['statstopreferrer'])

		}

if(isset($mybb->input['upsetting']['statstopreferrer']) && $mybb->input['upsetting']['statstopreferrer'] != $mybb->settings['statstopreferrer'])

Zeile 1335Zeile 1327
				ORDER BY s.disporder
");
while($setting = $db->fetch_array($query))

				ORDER BY s.disporder
");
while($setting = $db->fetch_array($query))

			{

			{

				$search_in = $setting['name'] . ' ' . $setting['title'] . ' ' . $setting['description'] . ' ' . $setting['gname'] . ' ' . $setting['gtitle'] . ' ' . $setting['gdescription'];
foreach(array("setting_{$setting['name']}", "setting_{$setting['name']}_desc", "setting_group_{$setting['gname']}", "setting_group_{$setting['gname']}_desc") as $search_in_lang_key)
{

				$search_in = $setting['name'] . ' ' . $setting['title'] . ' ' . $setting['description'] . ' ' . $setting['gname'] . ' ' . $setting['gtitle'] . ' ' . $setting['gdescription'];
foreach(array("setting_{$setting['name']}", "setting_{$setting['name']}_desc", "setting_group_{$setting['gname']}", "setting_group_{$setting['gname']}_desc") as $search_in_lang_key)
{

Zeile 1403Zeile 1395
		if(!$db->num_rows($query))
{
flash_message($lang->error_no_settings_found, 'error');

		if(!$db->num_rows($query))
{
flash_message($lang->error_no_settings_found, 'error');

			admin_redirect("index.php?module=config-settings");
}

$group_lang_var = "setting_group_{$groupinfo['name']}";
if(isset($lang->$group_lang_var))
{
$groupinfo['title'] = $lang->$group_lang_var;
}




			admin_redirect("index.php?module=config-settings");
}

$group_lang_var = "setting_group_{$groupinfo['name']}";
if(isset($lang->$group_lang_var))
{
$groupinfo['title'] = $lang->$group_lang_var;
}

$groupinfo['title'] = htmlspecialchars_uni($groupinfo['title']);


		// Page header
$page->add_breadcrumb_item($groupinfo['title']);
$page->output_header($lang->board_settings." - {$groupinfo['title']}");

		// Page header
$page->add_breadcrumb_item($groupinfo['title']);
$page->output_header($lang->board_settings." - {$groupinfo['title']}");

Zeile 1436Zeile 1430
		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;

		}

		}


// Page header
$page->add_breadcrumb_item($lang->show_all_settings);


// Page header
$page->add_breadcrumb_item($lang->show_all_settings);

Zeile 1453Zeile 1447
		if(isset($lang->$group_lang_var))
{
$groupinfo['title'] = $lang->$group_lang_var;

		if(isset($lang->$group_lang_var))
{
$groupinfo['title'] = $lang->$group_lang_var;

		}




		}

$groupinfo['title'] = htmlspecialchars_uni($groupinfo['title']);


		$form_container = new FormContainer($groupinfo['title']);

if(empty($cache_settings[$groupinfo['gid']]))
{
$form_container->output_cell($lang->error_no_settings_found);
$form_container->construct_row();

		$form_container = new FormContainer($groupinfo['title']);

if(empty($cache_settings[$groupinfo['gid']]))
{
$form_container->output_cell($lang->error_no_settings_found);
$form_container->construct_row();





			$form_container->end();
echo '<br />';

			$form_container->end();
echo '<br />';





			continue;
}

			continue;
}





		foreach($cache_settings[$groupinfo['gid']] as $setting)
{

		foreach($cache_settings[$groupinfo['gid']] as $setting)
{

 
			$setting['name'] = htmlspecialchars_uni($setting['name']);


			$options = "";
$type = explode("\n", $setting['optionscode']);
$type[0] = trim($type[0]);

			$options = "";
$type = explode("\n", $setting['optionscode']);
$type[0] = trim($type[0]);

Zeile 1706Zeile 1704
					$multivalue = explode(',', $setting['value']);
}


					$multivalue = explode(',', $setting['value']);
}


 
				$option_list = array();

				for($i = 0; $i < $typecount; $i++)
{
$optionsexp = explode("=", $type[$i]);
if(!isset($optionsexp[1]))
{
continue;

				for($i = 0; $i < $typecount; $i++)
{
$optionsexp = explode("=", $type[$i]);
if(!isset($optionsexp[1]))
{
continue;

					}

					}

					$title_lang = "setting_{$setting['name']}_{$optionsexp[0]}";
if(isset($lang->$title_lang))
{

					$title_lang = "setting_{$setting['name']}_{$optionsexp[0]}";
if(isset($lang->$title_lang))
{

Zeile 1726Zeile 1725
					else if($type[0] == "radio")
{
if($setting['value'] == $optionsexp[0])

					else if($type[0] == "radio")
{
if($setting['value'] == $optionsexp[0])

						{

						{

							$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

							$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

						}

						}

						else
{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));

						else
{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));

						}
}

						}
}

					else if($type[0] == "checkbox")
{
if(in_array($optionsexp[0], $multivalue))

					else if($type[0] == "checkbox")
{
if(in_array($optionsexp[0], $multivalue))

Zeile 1760Zeile 1759
						$setting_code .= $form->generate_hidden_field("isvisible_{$setting['name']}", 1);
}
}

						$setting_code .= $form->generate_hidden_field("isvisible_{$setting['name']}", 1);
}
}

				$option_list = array();

 
			}

// Do we have a custom language variable for this title or description?

			}

// Do we have a custom language variable for this title or description?

Zeile 1930Zeile 1928
		while($group = $db->fetch_array($query))
{
$group_lang_var = "setting_group_{$group['name']}";

		while($group = $db->fetch_array($query))
{
$group_lang_var = "setting_group_{$group['name']}";

			if($lang->$group_lang_var)

			if(isset($lang->$group_lang_var))

			{
$group_title = htmlspecialchars_uni($lang->$group_lang_var);
}

			{
$group_title = htmlspecialchars_uni($lang->$group_lang_var);
}

Zeile 1940Zeile 1938
			}

$group_desc_lang_var = "setting_group_{$group['name']}_desc";

			}

$group_desc_lang_var = "setting_group_{$group['name']}_desc";

			if($lang->$group_desc_lang_var)

			if(isset($lang->$group_desc_lang_var))

			{
$group_desc = htmlspecialchars_uni($lang->$group_desc_lang_var);
}

			{
$group_desc = htmlspecialchars_uni($lang->$group_desc_lang_var);
}