Make WordPress Core

Changeset 13039


Ignore:
Timestamp:
02/09/2010 06:03:46 PM (15 years ago)
Author:
wpmuguru
Message:

prevent editing site domain/path on multisite main site, see #12177

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-sites.php

    r12978 r13039  
    8080        $details = get_blog_details($id);
    8181        $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" );
     82        $is_main_site = is_main_site( $id );
    8283        ?>
    8384        <div class="wrap">
     
    9495                            <tr class="form-field form-required">
    9596                                <th scope="row"><?php _e('Domain') ?></th>
     97<?php if ( $is_main_site ) { ?>
     98                                <td>http://<?php echo esc_attr($details->domain) ?></td>
     99<?php } else { ?>
    96100                                <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr($details->domain) ?>" size="33" /></td>
     101<?php } ?>
    97102                            </tr>
    98103                            <tr class="form-field form-required">
    99104                                <th scope="row"><?php _e('Path') ?></th>
     105<?php if ( $is_main_site ) { ?>
     106                                <td><?php echo esc_attr($details->path) ?></td>
     107<?php } else { ?>
    100108                                <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details->path) ?>" size="40" style='margin-bottom:5px;' />
    101109                                <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id($id) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id($id) ) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
     110<?php } ?>
    102111                            </tr>
    103112                            <tr class="form-field">
     
    177186                                    <tr class="form-field">
    178187                                        <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
     188<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
     189                                        <td><?php echo esc_attr( $option->option_value ) ?></td>
     190<?php } else { ?>
    179191                                        <td><input name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php echo $disabled ?> /></td>
     192<?php } ?>
    180193                                    </tr>
    181194                                <?php
Note: See TracChangeset for help on using the changeset viewer.