Changeset 593

Show
Ignore:
Timestamp:
06/23/06 15:55:37 (2 years ago)
Author:
donncha
Message:

Installer, signup and vhosts lookup fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-activate.php

    r591 r593  
    6969</tr> 
    7070</table> 
    71 <h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://' . $_SERVER[ 'SERVER_NAME' ] . '/' ); ?></h3> 
     71<h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://' . $url . '/wp-login.php' ); ?></h3> 
    7272<?php 
    7373                } 
  • trunk/wp-includes/wpmu-functions.php

    r589 r593  
    10271027                $activate_url = "http://" . $current_site->domain . $current_site->path . "wp-activate.php?key=$key"; 
    10281028        } else { 
    1029                 $activate_url = "http://{$domain}{$path}/wp-activate.php?key=$key"; 
     1029                $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; 
    10301030        } 
    10311031        $message_headers = 'From: ' . stripslashes($title) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; 
    1032         $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://$domain.$path"); 
     1032        $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://{$domain}{$path}"); 
    10331033        // TODO: Don't hard code activation link. 
    10341034        $subject = sprintf(__('Activate %s'), $domain.$path); 
     
    10391039        // Send email with activation link. 
    10401040        $message_headers = 'From: ' . stripslashes($user) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; 
    1041         $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"),  
    1042                 "http://{$_SERVER[ 'SERVER_NAME' ]}/wp-activate.php?key=$key", "http://{$_SERVER[ 'SERVER_NAME' ]}"); 
     1041        $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"), "http://{$_SERVER[ 'SERVER_NAME' ]}/wp-activate.php?key=$key" ); 
    10431042        // TODO: Don't hard code activation link. 
    10441043        $subject = sprintf(__('Activate %s'), $user); 
  • trunk/wpmu-settings.php

    r591 r593  
    1616$wpdb->hide_errors(); 
    1717 
     18#$sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); 
     19#if( count( $sites ) == 1 ) { 
     20        #$current_site = $sites[0]; 
     21#} 
     22         
     23if( isset( $current_site ) == false ) { 
     24        $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) ); 
     25        if( constant( 'VHOST' ) == 'yes' ) { 
     26                $sitedomain = substr( $domain, 1 + strpos( $domain, '.' ) ); 
     27                $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" ); 
     28                if( $current_site == null ) { 
     29                        $path = '/'; 
     30                        $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" ); 
     31                        if( $current_site == null && defined( "WP_INSTALLING" ) == false ) 
     32                                die( "No WPMU site defined on this host." ); 
     33                } 
     34        } else { 
     35                $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 
     36                if( $current_site == null ) { 
     37                        $path = '/'; 
     38                        $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 
     39                        if( $current_site == null && defined( "WP_INSTALLING" ) == false ) 
     40                                die( "No WPMU site defined on this host." ); 
     41                } 
     42        } 
     43} 
     44 
     45 
    1846// Get site and blog details 
    1947if( defined( "WP_INSTALLING" ) == false ) { 
     
    2351                        $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'"); 
    2452        } else { 
    25                 $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) ); 
    26                 $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 
    27                 if( $current_site == null ) { 
    28                         $path = '/'; 
    29                         $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 
    30                         if( $current_site == null ) 
    31                                 die( "No WPMU site defined on this host." ); 
    32                 } 
    33                 $blogname = htmlspecialchars( str_replace( $path, '', $_SERVER[ 'REQUEST_URI' ] ) ); 
    34                 $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) ); 
    35                 if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' ) { 
     53                $blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) ); 
     54                if( strpos( $blogname, '/' ) ) 
     55                        $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) ); 
     56                if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' || $blogname == 'feed' ) { 
    3657                        $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'"); 
    3758                } else { 
     
    5172 
    5273        $current_site->site_name = $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = '$site_id' AND meta_key = 'site_name'" ); 
     74        if( $current_site->site_name == null ) 
     75                $current_site->site_name = ucfirst( $current_site->domain ); 
    5376} 
    5477if( $blog_id == false ) {