"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/admin/modules/config/settings.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

settings.php  (mybb_1821):settings.php  (mybb_1822)
skipping to change at line 428 skipping to change at line 428
"onoff" => $lang->onoff, "onoff" => $lang->onoff,
"select" => $lang->select, "select" => $lang->select,
"forumselect" => $lang->forum_selection_box, "forumselect" => $lang->forum_selection_box,
"forumselectsingle" => $lang->forum_selection_single, "forumselectsingle" => $lang->forum_selection_single,
"groupselect" => $lang->group_selection_box, "groupselect" => $lang->group_selection_box,
"groupselectsingle" => $lang->group_selection_single, "groupselectsingle" => $lang->group_selection_single,
"radio" => $lang->radio, "radio" => $lang->radio,
"checkbox" => $lang->checkbox, "checkbox" => $lang->checkbox,
"language" => $lang->language_selection_box, "language" => $lang->language_selection_box,
"adminlanguage" => $lang->adminlanguage, "adminlanguage" => $lang->adminlanguage,
"cpstyle" => $lang->cpstyle "cpstyle" => $lang->cpstyle,
"prefixselect" => $lang->prefix_selection_box
//"php" => $lang->php // Internal Use Only //"php" => $lang->php // Internal Use Only
); );
$form_container->output_row($lang->type." <em>*</em>", "", $form->generat e_select_box("type", $setting_types, $mybb->input['type'], array('id' => 'type') ), 'type'); $form_container->output_row($lang->type." <em>*</em>", "", $form->generat e_select_box("type", $setting_types, $mybb->input['type'], array('id' => 'type') ), 'type');
$form_container->output_row($lang->extra, $lang->extra_desc, $form->gener ate_text_area('extra', $mybb->input['extra'], array('id' => 'extra')), 'extra', array(), array('id' => 'row_extra')); $form_container->output_row($lang->extra, $lang->extra_desc, $form->gener ate_text_area('extra', $mybb->input['extra'], array('id' => 'extra')), 'extra', array(), array('id' => 'row_extra'));
$form_container->output_row($lang->value, "", $form->generate_text_area(' value', $mybb->input['value'], array('id' => 'value')), 'value'); $form_container->output_row($lang->value, "", $form->generate_text_area(' value', $mybb->input['value'], array('id' => 'value')), 'value');
$form_container->end(); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->insert_new_setting); $buttons[] = $form->generate_submit_button($lang->insert_new_setting);
$form->output_submit_wrapper($buttons); $form->output_submit_wrapper($buttons);
skipping to change at line 646 skipping to change at line 647
"onoff" => $lang->onoff, "onoff" => $lang->onoff,
"select" => $lang->select, "select" => $lang->select,
"forumselect" => $lang->forum_selection_box, "forumselect" => $lang->forum_selection_box,
"forumselectsingle" => $lang->forum_selection_single, "forumselectsingle" => $lang->forum_selection_single,
"groupselect" => $lang->group_selection_box, "groupselect" => $lang->group_selection_box,
"groupselectsingle" => $lang->group_selection_single, "groupselectsingle" => $lang->group_selection_single,
"radio" => $lang->radio, "radio" => $lang->radio,
"checkbox" => $lang->checkbox, "checkbox" => $lang->checkbox,
"language" => $lang->language_selection_box, "language" => $lang->language_selection_box,
"adminlanguage" => $lang->adminlanguage, "adminlanguage" => $lang->adminlanguage,
"cpstyle" => $lang->cpstyle "cpstyle" => $lang->cpstyle,
"prefixselect" => $lang->prefix_selection_box
//"php" => $lang->php // Internal Use Only //"php" => $lang->php // Internal Use Only
); );
$form_container->output_row($lang->type." <em>*</em>", "", $form->generat e_select_box("type", $setting_types, $setting_data['type'], array('id' => 'type' )), 'type'); $form_container->output_row($lang->type." <em>*</em>", "", $form->generat e_select_box("type", $setting_types, $setting_data['type'], array('id' => 'type' )), 'type');
$form_container->output_row($lang->extra, $lang->extra_desc, $form->gener ate_text_area('extra', $setting_data['extra'], array('id' => 'extra')), 'extra', array(), array('id' => 'row_extra')); $form_container->output_row($lang->extra, $lang->extra_desc, $form->gener ate_text_area('extra', $setting_data['extra'], array('id' => 'extra')), 'extra', array(), array('id' => 'row_extra'));
$form_container->output_row($lang->value, '', $form->generate_text_area(' value', $setting_data['value'], array('id' => 'value')), 'value'); $form_container->output_row($lang->value, '', $form->generate_text_area(' value', $setting_data['value'], array('id' => 'value')), 'value');
$form_container->end(); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_setting); $buttons[] = $form->generate_submit_button($lang->update_setting);
$form->output_submit_wrapper($buttons); $form->output_submit_wrapper($buttons);
skipping to change at line 969 skipping to change at line 971
// Have we opted for a reCAPTCHA and not set a public/private key ? // Have we opted for a reCAPTCHA and not set a public/private key ?
if((isset($mybb->input['upsetting']['captchaimage']) && in_array( $mybb->input['upsetting']['captchaimage'], array(4, 5)) && (!$mybb->input['upset ting']['captchaprivatekey'] || !$mybb->input['upsetting']['captchapublickey'])) if((isset($mybb->input['upsetting']['captchaimage']) && in_array( $mybb->input['upsetting']['captchaimage'], array(4, 5)) && (!$mybb->input['upset ting']['captchaprivatekey'] || !$mybb->input['upsetting']['captchapublickey']))
|| (in_array($mybb->settings['captchaimage'], array(4, 5)) && (!$mybb->settings['captchaprivatekey'] || !$mybb->settings['captchapublickey'])) ) || (in_array($mybb->settings['captchaimage'], array(4, 5)) && (!$mybb->settings['captchaprivatekey'] || !$mybb->settings['captchapublickey'])) )
{ {
$mybb->input['upsetting']['captchaimage'] = 1; $mybb->input['upsetting']['captchaimage'] = 1;
$lang->success_settings_updated .= $lang->success_setting s_updated_captchaimage; $lang->success_settings_updated .= $lang->success_setting s_updated_captchaimage;
} }
// Get settings which optionscode is a forum/group select, checkb ox or numeric // Get settings which optionscode is a forum/group select, checkb ox or numeric
// We cannot rely on user input to decide this // We cannot rely on user input to decide this
$checkbox_settings = $forum_group_select = array(); $checkbox_settings = $forum_group_select = $prefix_select = array
$query = $db->simple_select('settings', 'name, optionscode', "opt ();
ionscode IN('forumselect', 'groupselect') OR optionscode LIKE 'checkbox%' OR opt $query = $db->simple_select('settings', 'name, optionscode', "opt
ionscode LIKE 'numeric%'"); ionscode IN('forumselect', 'groupselect', 'prefixselect') OR optionscode LIKE 'c
heckbox%' OR optionscode LIKE 'numeric%'");
while($multisetting = $db->fetch_array($query)) while($multisetting = $db->fetch_array($query))
{ {
$options = array(); $options = array();
if(substr($multisetting['optionscode'], 0, 8) == 'checkbo x') if(substr($multisetting['optionscode'], 0, 8) == 'checkbo x')
{ {
$checkbox_settings[] = $multisetting['name']; $checkbox_settings[] = $multisetting['name'];
// All checkboxes deselected = no $mybb->input['u psetting'] for them, we need to initialize it manually then, but only on pages w here the setting is shown // All checkboxes deselected = no $mybb->input['u psetting'] for them, we need to initialize it manually then, but only on pages w here the setting is shown
skipping to change at line 1042 skipping to change at line 1044
$mybb->input['upsetting']['username_method'] = 0; $mybb->input['upsetting']['username_method'] = 0;
$lang->success_settings_updated .= $lang->success _settings_updated_username_method; $lang->success_settings_updated .= $lang->success _settings_updated_username_method;
} }
else else
{ {
$mybb->input['upsetting']['allowmultipleemails'] = 0; $mybb->input['upsetting']['allowmultipleemails'] = 0;
$lang->success_settings_updated .= $lang->success _settings_updated_allowmultipleemails; $lang->success_settings_updated .= $lang->success _settings_updated_allowmultipleemails;
} }
} }
// reject dangerous/unsupported upload paths
$fields = array( $fields = array(
'uploadspath', 'uploadspath',
'cdnpath', 'cdnpath',
'avataruploadpath', 'avataruploadpath',
); );
$dynamic_include_directories = array(
MYBB_ROOT.'cache/',
MYBB_ROOT.'inc/plugins/',
MYBB_ROOT.'inc/languages/',
MYBB_ROOT.'inc/tasks/',
);
$dynamic_include_directories_realpath = array_map('realpath', $dy
namic_include_directories);
foreach($fields as $field) foreach($fields as $field)
{ {
if( if(
isset($mybb->input['upsetting'][$field]) && isset($mybb->input['upsetting'][$field]) &&
is_string($mybb->input['upsetting'][$field]) && is_string($mybb->input['upsetting'][$field]) &&
strpos($mybb->input['upsetting'][$field], '://') !== false) strpos($mybb->input['upsetting'][$field], '://') !== false)
{ {
unset($mybb->input['upsetting'][$field]); unset($mybb->input['upsetting'][$field]);
continue;
}
$realpath = realpath(MYBB_ROOT.$mybb->input['upsetting'][
$field]);
if ($realpath === false) {
unset($mybb->input['upsetting'][$field]);
continue;
}
foreach ($dynamic_include_directories_realpath as $forbid
den_realpath)
{
if ($realpath === $forbidden_realpath || strpos($
realpath, $forbidden_realpath.DIRECTORY_SEPARATOR) === 0)
{
unset($mybb->input['upsetting'][$field]);
continue 2;
}
} }
} }
if(is_array($mybb->input['upsetting'])) if(is_array($mybb->input['upsetting']))
{ {
foreach($mybb->input['upsetting'] as $name => $value) foreach($mybb->input['upsetting'] as $name => $value)
{ {
if($forum_group_select && in_array($name, $forum_ group_select)) if($forum_group_select && in_array($name, $forum_ group_select))
{ {
if($value == 'all') if($value == 'all')
skipping to change at line 1502 skipping to change at line 1530
</dl> </dl>
<script type=\"text/javascript\"> <script type=\"text/javascript\">
checkAction('{$element_id}'); checkAction('{$element_id}');
</script>"; </script>";
} }
else if($type[0] == "groupselectsingle") else if($type[0] == "groupselectsingle")
{ {
$selected_value = (int)$setting['value']; // No n eed to check if empty, int will give 0 $selected_value = (int)$setting['value']; // No n eed to check if empty, int will give 0
$setting_code = $form->generate_group_select($ele ment_name, $selected_value, array('id' => $element_id, 'main_option' => $lang->n one)); $setting_code = $form->generate_group_select($ele ment_name, $selected_value, array('id' => $element_id, 'main_option' => $lang->n one));
} }
else if($type[0] == "prefixselect")
{
$selected_values = '';
if($setting['value'] != '' && $setting['value'] !
= -1)
{
$selected_values = explode(',', (string)$
setting['value']);
foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}
$prefix_checked = array('all' => '', 'custom' =>
'', 'none' => '');
if($setting['value'] == -1)
{
$prefix_checked['all'] = 'checked="checke
d"';
}
elseif($setting['value'] != '')
{
$prefix_checked['custom'] = 'checked="che
cked"';
}
else
{
$prefix_checked['none'] = 'checked="check
ed"';
}
print_selection_javascript();
$setting_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; widt
h: 100%\">
<dt><label style=\"display: block;\"><inp
ut type=\"radio\" name=\"{$element_name}\" value=\"all\" {$prefix_checked['all']
} class=\"{$element_id}_forums_groups_check\" onclick=\"checkAction('{$element_i
d}');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_prefix}</strong
></label></dt>
<dt><label style=\"display: block;\"><inp
ut type=\"radio\" name=\"{$element_name}\" value=\"custom\" {$prefix_checked['cu
stom']} class=\"{$element_id}_forums_groups_check\" onclick=\"checkAction('{$ele
ment_id}');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_prefix
}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"{$ele
ment_id}_forums_groups_custom\" class=\"{$element_id}_forums_groups\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\
"><small>{$lang->prefix_colon}</small></td>
<td>".$form->gene
rate_prefix_select('select['.$setting['name'].'][]', $selected_values, array('id
' => $element_id, 'multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><inp
ut type=\"radio\" name=\"{$element_name}\" value=\"none\" {$prefix_checked['none
']} class=\"{$element_id}_forums_groups_check\" onclick=\"checkAction('{$element
_id}');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></l
abel></dt>
</dl>
<script type=\"text/javascript\">
checkAction('{$element_id}');
</script>";
}
else else
{ {
$typecount = count($type); $typecount = count($type);
if($type[0] == 'checkbox') if($type[0] == 'checkbox')
{ {
$multivalue = explode(',', $setting['valu e']); $multivalue = explode(',', $setting['valu e']);
} }
for($i = 0; $i < $typecount; $i++) for($i = 0; $i < $typecount; $i++)
 End of changes. 7 change blocks. 
6 lines changed or deleted 106 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)