-
+ 94A4B8303155C1A4377CCB0F582728071A68B3BEA50B357DAE5B14D8BA53CF7EF9CF7B318BE47C18B1A9FA08CF0D39E67205C9FD72AB71C57599A2C580869B96
mp-wp/wp-admin/options.php
(0 . 0)(1 . 143)
54406 <?php
54407 /**
54408 * Options Management Administration Panel.
54409 *
54410 * Just allows for displaying of options.
54411 *
54412 * This isn't referenced or linked to, but will show all of the options and
54413 * allow editing. The issue is that serialized data is not supported to be
54414 * modified. Options can not be removed.
54415 *
54416 * @package WordPress
54417 * @subpackage Administration
54418 */
54419
54420 /** WordPress Administration Bootstrap */
54421 require_once('admin.php');
54422
54423 $title = __('Settings');
54424 $this_file = 'options.php';
54425 $parent_file = 'options-general.php';
54426
54427 wp_reset_vars(array('action'));
54428
54429 $whitelist_options = array(
54430 'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role' ),
54431 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
54432 'misc' => array( 'hack_file', 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
54433 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
54434 'privacy' => array( 'blog_public' ),
54435 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
54436 'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
54437 'options' => array( '' ) );
54438 if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
54439 if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
54440
54441 $whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
54442
54443 if ( !current_user_can('manage_options') )
54444 wp_die(__('Cheatin’ uh?'));
54445
54446 switch($action) {
54447
54448 case 'update':
54449 if ( isset($_POST[ 'option_page' ]) ) {
54450 $option_page = $_POST[ 'option_page' ];
54451 check_admin_referer( $option_page . '-options' );
54452 } else {
54453 // This is for back compat and will eventually be removed.
54454 $option_page = 'options';
54455 check_admin_referer( 'update-options' );
54456 }
54457
54458 if ( !isset( $whitelist_options[ $option_page ] ) )
54459 wp_die( __( 'Error! Options page not found.' ) );
54460
54461 if ( 'options' == $option_page ) {
54462 $options = explode(',', stripslashes( $_POST[ 'page_options' ] ));
54463 } else {
54464 $options = $whitelist_options[ $option_page ];
54465 }
54466
54467 // Handle custom date/time formats
54468 if ( 'general' == $option_page ) {
54469 if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) )
54470 $_POST['date_format'] = $_POST['date_format_custom'];
54471 if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) )
54472 $_POST['time_format'] = $_POST['time_format_custom'];
54473 }
54474
54475 if ( $options ) {
54476 foreach ( $options as $option ) {
54477 $option = trim($option);
54478 $value = null;
54479 if ( isset($_POST[$option]) )
54480 $value = $_POST[$option];
54481 if ( !is_array($value) ) $value = trim($value);
54482 $value = stripslashes_deep($value);
54483 update_option($option, $value);
54484 }
54485 }
54486
54487 $goback = add_query_arg( 'updated', 'true', wp_get_referer() );
54488 wp_redirect( $goback );
54489 break;
54490
54491 default:
54492 include('admin-header.php'); ?>
54493
54494 <div class="wrap">
54495 <?php screen_icon(); ?>
54496 <h2><?php _e('All Settings'); ?></h2>
54497 <form name="form" action="options.php" method="post" id="all-options">
54498 <?php wp_nonce_field('options-options') ?>
54499 <input type="hidden" name="action" value="update" />
54500 <input type='hidden' name='option_page' value='options' />
54501 <table class="form-table">
54502 <?php
54503 $options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name");
54504
54505 foreach ( (array) $options as $option) :
54506 $disabled = '';
54507 $option->option_name = attribute_escape($option->option_name);
54508 if ( is_serialized($option->option_value) ) {
54509 if ( is_serialized_string($option->option_value) ) {
54510 // this is a serialized string, so we should display it
54511 $value = maybe_unserialize($option->option_value);
54512 $options_to_update[] = $option->option_name;
54513 $class = 'all-options';
54514 } else {
54515 $value = 'SERIALIZED DATA';
54516 $disabled = ' disabled="disabled"';
54517 $class = 'all-options disabled';
54518 }
54519 } else {
54520 $value = $option->option_value;
54521 $options_to_update[] = $option->option_name;
54522 $class = 'all-options';
54523 }
54524 echo "
54525 <tr>
54526 <th scope='row'><label for='$option->option_name'>$option->option_name</label></th>
54527 <td>";
54528
54529 if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>" . wp_specialchars($value) . "</textarea>";
54530 else echo "<input class='regular-text $class' type='text' name='$option->option_name' id='$option->option_name' value='" . attribute_escape($value) . "'$disabled />";
54531
54532 echo "</td>
54533 </tr>";
54534 endforeach;
54535 ?>
54536 </table>
54537 <?php $options_to_update = implode(',', $options_to_update); ?>
54538 <p class="submit"><input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" /><input type="submit" name="Update" value="<?php _e('Save Changes') ?>" class="button-primary" /></p>
54539 </form>
54540 </div>
54541
54542
54543 <?php
54544 break;
54545 } // end switch
54546
54547 include('admin-footer.php');
54548 ?>