Changeset 1062

Show
Ignore:
Timestamp:
10/04/07 15:07:51 (1 year ago)
Author:
donncha
Message:

Add registration disable/enable radio controls to wpmu-options page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index-install.php

    r1049 r1062  
    368368        $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'admin_email', '".$email."')" ); 
    369369        $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'admin_user_id', '1')" ); 
     370        $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'registration', 'all')" ); 
    370371        $wpdb->query( "INSERT INTO ".$wpdb->site." ( id, domain, path ) VALUES ( NULL, '$domain', '$base' )" ); 
    371372        $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " ( cat_ID, cat_name, category_nicename, last_updated ) VALUES (1, 'Uncategorized', 'uncategorized', NOW())" ); 
  • trunk/wp-admin/wpmu-edit.php

    r1033 r1062  
    2525                } 
    2626                update_site_option( "illegal_names", $names ); 
     27                update_site_option( "registration", $wpdb->escape( $_POST[ 'registration' ] ) ); 
    2728                if( $_POST[ 'limited_email_domains' ] != '' ) { 
    2829                        update_site_option( "limited_email_domains", split( ' ', $_POST[ 'limited_email_domains' ] ) ); 
  • trunk/wp-admin/wpmu-options.php

    r990 r1062  
    3434                <br /> 
    3535                <?php printf( __( 'Registration and support mails will come from this address. Make it generic like "support@%s"' ), $current_site->domain ); ?></td> 
     36                </tr>  
     37                <tr valign="top">  
     38                <th scope="row"><?php _e('Allow new blog registrations') ?></th>  
     39                <?php 
     40                if( !get_site_option('registration') ) 
     41                        update_site_option( 'registration', 'all' ); 
     42                ?> 
     43                <td><input name="registration1" type="radio" id="registration1" value='none' <?php echo get_site_option('registration') == 'none' ? 'checked' : ''; ?> /> Disabled<br /> 
     44                <input name="registration2" type="radio" id="registration2" value='all' <?php echo get_site_option('registration') == 'all' ? 'checked' : ''; ?> /> Enabled for all. Blogs and user accounts can be created.<br /> 
     45                <input name="registration3" type="radio" id="registration3" value='user' <?php echo get_site_option('registration') == 'user' ? 'checked' : ''; ?> /> Enabled for users only. Only user account can be created.<br /> 
     46                <input name="registration4" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked' : ''; ?> /> Enabled for blogs only. Only logged in users can create new blogs.<br /> 
     47                <?php _e('Disable or enable registration and who or what can be registered. (Default=all)') ?></td>  
    3648                </tr>  
    3749                <tr valign="top">  
  • trunk/wp-signup.php

    r1046 r1062  
    368368 
    369369// Main 
    370 $active_signup = 'all'; 
     370$active_signup = get_site_option( 'registration' ); 
     371if( !$active_signup ) 
     372        $active_signup = 'all'; 
     373 
    371374$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 
    372375 
     
    401404                } elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) { 
    402405                        signup_user( $newblogname, $user_email ); 
     406                } elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) { 
     407                        _e( "I'm sorry. We're not accepting new registrations at this time." ); 
    403408                } else { 
    404409                        _e( "You're logged in already. No need to register again!" );