Zeile 118 | Zeile 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 220 | Zeile 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 454 | Zeile 454 |
---|
$setting = $db->fetch_array($query);
// Does the setting not exist?
|
$setting = $db->fetch_array($query);
// 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");
|
Zeile 673 | Zeile 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 1208 | Zeile 1208 |
---|
} }
|
} }
|
| // reject dangerous/unsupported file paths $field = 'errorloglocation';
if(isset($mybb->input['upsetting'][$field]) && is_string($mybb->input['upsetting'][$field])) { if( strpos($mybb->input['upsetting'][$field], '://') !== false || substr($mybb->input['upsetting'][$field], -4) === '.php' ) { unset($mybb->input['upsetting'][$field]); } }
|
if(is_array($mybb->input['upsetting'])) {
| if(is_array($mybb->input['upsetting'])) {
|
Zeile 1276 | Zeile 1289 |
---|
if(isset($mybb->input['upsetting']['delayedthreadviews']) && $mybb->settings['delayedthreadviews'] != $mybb->input['upsetting']['delayedthreadviews']) { $db->update_query("tasks", array('enabled' => (int)$mybb->input['upsetting']['delayedthreadviews']), "file='threadviews'");
|
if(isset($mybb->input['upsetting']['delayedthreadviews']) && $mybb->settings['delayedthreadviews'] != $mybb->input['upsetting']['delayedthreadviews']) { $db->update_query("tasks", array('enabled' => (int)$mybb->input['upsetting']['delayedthreadviews']), "file='threadviews'");
|
}
| }
|
// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out if(isset($mybb->input['upsetting']['cookieprefix']) && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['cookieprefix']) { my_unsetcookie("adminsid"); $mybb->settings['cookieprefix'] = $mybb->input['upsetting']['cookieprefix'];
|
// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out if(isset($mybb->input['upsetting']['cookieprefix']) && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['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 1294 | Zeile 1307 |
---|
$statslimit = $mybb->settings['statslimit'];
rebuild_settings();
|
$statslimit = $mybb->settings['statslimit'];
rebuild_settings();
|
|
|
if(isset($mybb->input['upsetting']['statslimit']) && $mybb->input['upsetting']['statslimit'] != $statslimit) { $cache->update_most_replied_threads();
| if(isset($mybb->input['upsetting']['statslimit']) && $mybb->input['upsetting']['statslimit'] != $statslimit) { $cache->update_most_replied_threads();
|
Zeile 1345 | Zeile 1358 |
---|
if(!count($cache_settings)) { if(isset($mybb->input['ajax_search']))
|
if(!count($cache_settings)) { if(isset($mybb->input['ajax_search']))
|
{
| {
|
echo json_encode(array("errors" => array($lang->error_no_settings_found))); exit; }
| echo json_encode(array("errors" => array($lang->error_no_settings_found))); exit; }
|
Zeile 1367 | Zeile 1380 |
---|
// Page header only if not AJAX if(!isset($mybb->input['ajax_search']))
|
// Page header only if not AJAX if(!isset($mybb->input['ajax_search']))
|
{
| {
|
$page->add_breadcrumb_item($lang->settings_search); $page->output_header($lang->board_settings." - {$lang->settings_search}"); }
| $page->add_breadcrumb_item($lang->settings_search); $page->output_header($lang->board_settings." - {$lang->settings_search}"); }
|
Zeile 1379 | Zeile 1392 |
---|
$query = $db->simple_select("settinggroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'"); $groupinfo = $db->fetch_array($query); $cache_groups[$groupinfo['gid']] = $groupinfo;
|
$query = $db->simple_select("settinggroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'"); $groupinfo = $db->fetch_array($query); $cache_groups[$groupinfo['gid']] = $groupinfo;
|
if(!$db->num_rows($query)) {
| if(!$db->num_rows($query)) {
|
$page->output_error($lang->error_invalid_gid2); }
// Cache settings $query = $db->simple_select("settings", "*", "gid='".$mybb->get_input('gid', MyBB::INPUT_INT)."'", array('order_by' => 'disporder')); while($setting = $db->fetch_array($query))
|
$page->output_error($lang->error_invalid_gid2); }
// Cache settings $query = $db->simple_select("settings", "*", "gid='".$mybb->get_input('gid', MyBB::INPUT_INT)."'", array('order_by' => 'disporder')); while($setting = $db->fetch_array($query))
|
{
| {
|
$cache_settings[$setting['gid']][$setting['sid']] = $setting; }
| $cache_settings[$setting['gid']][$setting['sid']] = $setting; }
|
Zeile 1403 | Zeile 1416 |
---|
{ $groupinfo['title'] = $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 header $page->add_breadcrumb_item($groupinfo['title']);
|
Zeile 1446 | Zeile 1461 |
---|
{ $groupinfo['title'] = $lang->$group_lang_var; }
|
{ $groupinfo['title'] = $lang->$group_lang_var; }
|
| $groupinfo['title'] = htmlspecialchars_uni($groupinfo['title']);
|
$form_container = new FormContainer($groupinfo['title']);
| $form_container = new FormContainer($groupinfo['title']);
|
Zeile 1462 | Zeile 1479 |
---|
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]); $element_name = "upsetting[{$setting['name']}]"; $element_id = "setting_{$setting['name']}"; if($type[0] == "text" || $type[0] == "")
|
$options = ""; $type = explode("\n", $setting['optionscode']); $type[0] = trim($type[0]); $element_name = "upsetting[{$setting['name']}]"; $element_id = "setting_{$setting['name']}"; if($type[0] == "text" || $type[0] == "")
|
{
| {
|
$setting_code = $form->generate_text_box($element_name, $setting['value'], array('id' => $element_id)); } else if($type[0] == "numeric")
| $setting_code = $form->generate_text_box($element_name, $setting['value'], array('id' => $element_id)); } else if($type[0] == "numeric")
|
Zeile 1481 | Zeile 1500 |
---|
$optionsexp = explode("=", $type[$i]); $opt = array_map('trim', $optionsexp); if(in_array($opt[0], array('min', 'max', 'step')))
|
$optionsexp = explode("=", $type[$i]); $opt = array_map('trim', $optionsexp); if(in_array($opt[0], array('min', 'max', 'step')))
|
{
| {
|
if($opt[0] != 'step' || $opt[1] != 'any') { $opt[1] = (float)$opt[1]; } $field_options[$opt[0]] = $opt[1]; }
|
if($opt[0] != 'step' || $opt[1] != 'any') { $opt[1] = (float)$opt[1]; } $field_options[$opt[0]] = $opt[1]; }
|
}
| }
|
} $setting_code = $form->generate_numeric_field($element_name, $setting['value'], $field_options);
|
} $setting_code = $form->generate_numeric_field($element_name, $setting['value'], $field_options);
|
}
| }
|
else if($type[0] == "textarea") { $setting_code = $form->generate_text_area($element_name, $setting['value'], array('id' => $element_id));
|
else if($type[0] == "textarea") { $setting_code = $form->generate_text_area($element_name, $setting['value'], array('id' => $element_id));
|
}
| }
|
else if($type[0] == "yesno")
|
else if($type[0] == "yesno")
|
{
| {
|
$setting_code = $form->generate_yes_no_radio($element_name, $setting['value'], true, array('id' => $element_id.'_yes', 'class' => $element_id), array('id' => $element_id.'_no', 'class' => $element_id));
|
$setting_code = $form->generate_yes_no_radio($element_name, $setting['value'], true, array('id' => $element_id.'_yes', 'class' => $element_id), array('id' => $element_id.'_no', 'class' => $element_id));
|
}
| }
|
else if($type[0] == "onoff") { $setting_code = $form->generate_on_off_radio($element_name, $setting['value'], true, array('id' => $element_id.'_on', 'class' => $element_id), array('id' => $element_id.'_off', 'class' => $element_id));
|
else if($type[0] == "onoff") { $setting_code = $form->generate_on_off_radio($element_name, $setting['value'], true, array('id' => $element_id.'_on', 'class' => $element_id), array('id' => $element_id.'_off', 'class' => $element_id));
|
}
| }
|
else if($type[0] == "cpstyle") { $dir = @opendir(MYBB_ROOT.$config['admin_dir']."/styles");
$folders = array(); while($folder = readdir($dir))
|
else if($type[0] == "cpstyle") { $dir = @opendir(MYBB_ROOT.$config['admin_dir']."/styles");
$folders = array(); while($folder = readdir($dir))
|
{
| {
|
if($folder != "." && $folder != ".." && @file_exists(MYBB_ROOT.$config['admin_dir']."/styles/$folder/main.css")) { $folders[$folder] = ucfirst($folder);
| if($folder != "." && $folder != ".." && @file_exists(MYBB_ROOT.$config['admin_dir']."/styles/$folder/main.css")) { $folders[$folder] = ucfirst($folder);
|
Zeile 1540 | Zeile 1559 |
---|
eval("\$setting_code = \"".$setting['optionscode']."\";"); } else if($type[0] == "forumselect")
|
eval("\$setting_code = \"".$setting['optionscode']."\";"); } else if($type[0] == "forumselect")
|
{ $selected_values = ''; if($setting['value'] != '' && $setting['value'] != -1) { $selected_values = explode(',', (string)$setting['value']);
foreach($selected_values as &$value) { $value = (int)$value; }
| { $selected_values = ''; if($setting['value'] != '' && $setting['value'] != -1) { $selected_values = explode(',', (string)$setting['value']);
foreach($selected_values as &$value) { $value = (int)$value; }
|
unset($value); }
| unset($value); }
|
Zeile 1557 | Zeile 1576 |
---|
if($setting['value'] == -1) { $forum_checked['all'] = 'checked="checked"';
|
if($setting['value'] == -1) { $forum_checked['all'] = 'checked="checked"';
|
} elseif($setting['value'] != '') {
| } elseif($setting['value'] != '') {
|
$forum_checked['custom'] = 'checked="checked"'; } else { $forum_checked['none'] = 'checked="checked"';
|
$forum_checked['custom'] = 'checked="checked"'; } else { $forum_checked['none'] = 'checked="checked"';
|
}
| }
|
print_selection_javascript();
$setting_code = "
| print_selection_javascript();
$setting_code = "
|
Zeile 1615 | Zeile 1634 |
---|
{ $group_checked['custom'] = 'checked="checked"'; }
|
{ $group_checked['custom'] = 'checked="checked"'; }
|
else { $group_checked['none'] = 'checked="checked"'; }
| else { $group_checked['none'] = 'checked="checked"'; }
|
print_selection_javascript();
| print_selection_javascript();
|
Zeile 1698 | Zeile 1717 |
---|
$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 1718 | Zeile 1738 |
---|
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 1752 | Zeile 1772 |
---|
$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?
|