More cap migration.

git-svn-id: https://develop.svn.wordpress.org/trunk@2714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-07-15 02:16:45 +00:00
parent 235345a916
commit 9527e184fe
13 changed files with 45 additions and 62 deletions

View File

@@ -21,7 +21,7 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
}
}
if ($user_level < 6)
if ( !current_user_can('manage_options') )
die ( __('Cheatin&#8217; uh?') );
switch($action) {
@@ -50,17 +50,14 @@ case 'update':
if ($options) {
$options = apply_filters( 'options_to_update' , $options );
foreach ($options as $option) {
// should we even bother checking?
if ($user_level >= $option->option_admin_level) {
$old_val = $option->option_value;
$new_val = trim($_POST[$option->option_name]);
if( in_array($option->option_name, $nonbools) && ( $new_val == '0' || $new_val == '') )
$new_val = 'closed';
if ($new_val !== $old_val) {
$result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'");
$any_changed++;
}
}
$old_val = $option->option_value;
$new_val = trim($_POST[$option->option_name]);
if( in_array($option->option_name, $nonbools) && ( $new_val == '0' || $new_val == '') )
$new_val = 'closed';
if ($new_val !== $old_val) {
$result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'");
$any_changed++;
}
}
unset($cache_settings); // so they will be re-read
get_settings('siteurl'); // make it happen now