Changeset 591
- Timestamp:
- 06/22/06 18:31:50 (2 years ago)
- Files:
-
- trunk/favicon.ico (copied) (copied from trunk/wp-inst/favicon.ico)
- trunk/htaccess.dist (modified) (2 diffs)
- trunk/index-install.php (copied) (copied from trunk/index.php) (12 diffs)
- trunk/index.php (copied) (copied from trunk/wp-inst/index.php)
- trunk/license.txt (copied) (copied from trunk/wp-inst/license.txt)
- trunk/wp-activate.php (copied) (copied from trunk/wp-inst/wp-activate.php)
- trunk/wp-admin (copied) (copied from trunk/wp-inst/wp-admin)
- trunk/wp-admin/admin-functions.php (modified) (1 diff)
- trunk/wp-atom.php (copied) (copied from trunk/wp-inst/wp-atom.php)
- trunk/wp-blog-header.php (copied) (copied from trunk/wp-inst/wp-blog-header.php) (1 diff)
- trunk/wp-comments-post.php (copied) (copied from trunk/wp-inst/wp-comments-post.php)
- trunk/wp-commentsrss2.php (copied) (copied from trunk/wp-inst/wp-commentsrss2.php)
- trunk/wp-config-sample.php (copied) (copied from trunk/wp-inst/wp-config-sample.php)
- trunk/wp-content (copied) (copied from trunk/wp-inst/wp-content)
- trunk/wp-cron.php (copied) (copied from trunk/wp-inst/wp-cron.php)
- trunk/wp-feed.php (copied) (copied from trunk/wp-inst/wp-feed.php)
- trunk/wp-includes (copied) (copied from trunk/wp-inst/wp-includes)
- trunk/wp-inst (deleted)
- trunk/wp-links-opml.php (copied) (copied from trunk/wp-inst/wp-links-opml.php)
- trunk/wp-login.php (copied) (copied from trunk/wp-inst/wp-login.php)
- trunk/wp-mail.php (copied) (copied from trunk/wp-inst/wp-mail.php)
- trunk/wp-pass.php (copied) (copied from trunk/wp-inst/wp-pass.php)
- trunk/wp-rdf.php (copied) (copied from trunk/wp-inst/wp-rdf.php)
- trunk/wp-register.php (copied) (copied from trunk/wp-inst/wp-register.php)
- trunk/wp-rss.php (copied) (copied from trunk/wp-inst/wp-rss.php)
- trunk/wp-rss2.php (copied) (copied from trunk/wp-inst/wp-rss2.php)
- trunk/wp-settings.php (copied) (copied from trunk/wp-inst/wp-settings.php)
- trunk/wp-signup.php (copied) (copied from trunk/wp-inst/wp-signup.php) (3 diffs)
- trunk/wp-trackback.php (copied) (copied from trunk/wp-inst/wp-trackback.php)
- trunk/wpmu-settings.php (copied) (copied from trunk/wp-inst/wpmu-settings.php) (1 diff)
- trunk/xmlrpc.php (copied) (copied from trunk/wp-inst/xmlrpc.php)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/htaccess.dist
r575 r591 1 #php_flag register_globals 02 #php_flag display_errors 03 1 RewriteEngine On 4 2 RewriteBase BASE/ … … 8 6 RewriteRule ^(.*) http://%1/$1 [R,L] 9 7 10 ### 11 #### blogs 12 ### 13 RewriteRule ^([_0-9a-zA-Z-]+)/templates/(.*) BASE/wp-inst/wp-content/blogs/$1/templates/$2 [L] 14 RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) BASE/wp-inst/wp-content/blogs.php?file=$1 [L] 15 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) BASE/wp-inst/wp-content/blogs.php?file=$3 [L] 16 RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/themes/(.*) BASE/wp-inst/wp-content/themes/$2 [L] 17 RewriteRule ^wp-content/themes/(.*) BASE/wp-inst/wp-content/themes/$1 [L] 8 #uploaded files 9 RewriteRule ^files/(.*) wp-content/blogs.php?file=$1 [L] 18 10 19 # rewrite these 20 RewriteRule ^([_0-9a-zA-Z-]+)/category/(.*)/page/(.*)/ BASE/wp-inst/index.php?wpblog=$1&category_name=$2&paged=$3 [L] 21 RewriteRule ^([_0-9a-zA-Z-]+)/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&category_name=$2&feed=$3 [L] 22 RewriteRule ^([_0-9a-zA-Z-]+)/category/?(.*) BASE/wp-inst/index.php?wpblog=$1&category_name=$2 [L] 23 24 RewriteRule ^([_0-9a-zA-Z-]+)/tag/(.*)/page/(.*)/ BASE/wp-inst/index.php?wpblog=$1&category_name=$2&paged=$3 [L] 25 RewriteRule ^([_0-9a-zA-Z-]+)/tag/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&category_name=$2&feed=$3 [L] 26 RewriteRule ^([_0-9a-zA-Z-]+)/tag/?(.*) BASE/wp-inst/index.php?wpblog=$1&category_name=$2 [L] 27 28 RewriteRule ^([_0-9a-zA-Z-]+)/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&author_name=$2&feed=$3 [L] 29 RewriteRule ^([_0-9a-zA-Z-]+)/author/?(.*) BASE/wp-inst/index.php?wpblog=$1&author_name=$2 [L] 30 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-zA-Z-]+)?/?([0-9]+)?/?$ BASE/wp-inst/index.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5&page=$6 [L] 31 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-zA-Z-]+)/(feed|rdf|rss|rss2|atom)/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5&feed=$6 [L] 32 RewriteRule ^([_0-9a-zA-Z-]+)/([0-9]{4})/?([0-9]{1,2})/([0-9]{1,2})/([_0-9a-zA-Z-]+)/trackback/?$ BASE/wp-inst/wp-trackback.php?wpblog=$1&year=$2&monthnum=$3&day=$4&name=$5 [L] 33 RewriteRule ^([_0-9a-zA-Z-]+)/page/?([0-9]+)?/?$ BASE/wp-inst/index.php?paged=$2 [L] 34 RewriteRule ^([_0-9a-zA-Z-]+)/feed/?([_0-9a-zA-Z-]+)?/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&feed=$2 [L] 35 RewriteRule ^([_0-9a-zA-Z-]+)/comments/feed/?([_0-9a-zA-Z-]+)?/?$ BASE/wp-inst/wp-feed.php?wpblog=$1&feed=$2&withcomments=1 [L] 36 RewriteRule ^([_0-9a-zA-Z-]+)/archives/p/([0-9]+)/?(.*)? BASE/wp-inst/index.php?wpblog=$1&redirect=yes&p=$2 [L] 37 RewriteRule ^([_0-9a-zA-Z-]+)/archives/cat/([0-9]+)/?(.*)? BASE/wp-inst/index.php?wpblog=$1&redirect=yes&cat=$2 [L] 38 RewriteRule ^([_0-9a-zA-Z-]+)/archives/m/([0-9]+)\#?(.*)? BASE/wp-inst/index.php?wpblog=$1&redirect=yes&m=$2 [L] 39 RewriteRule ^([_0-9a-zA-Z-]+)/b2rss2.php(.*)? BASE/wp-inst/wp-feed.php?wpblog=$1&feed=rss2 [L] 40 RewriteRule ^([_0-9a-zA-Z-]+)/b2rdf.php(.*)? BASE/wp-inst/wp-feed.php?wpblog=$1&feed=rdf [L] 41 42 # We want to pass these files straight through 43 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*) BASE/wp-inst/wp-comments-post.php [L] 44 RewriteRule ^([_0-9a-zA-Z-]+)/pages/(.*) BASE/wp-inst/pages/$2 [L] 45 RewriteRule ^([_0-9a-zA-Z-]+)/wp-admin/(.*) BASE/wp-inst/wp-admin/$2 [L] 46 RewriteRule ^([_0-9a-zA-Z-]+)/wp-atom.php(.*) BASE/wp-inst/wp-atom.php [L] 47 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-popup.php(.*) BASE/wp-inst/wp-comments-popup.php [L] 48 RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*) BASE/wp-inst/wp-comments-post.php [L] 49 RewriteRule ^([_0-9a-zA-Z-]+)/wp-commentsrss2.php(.*) BASE/wp-inst/wp-commentsrss2.php [L] 50 RewriteRule ^([_0-9a-zA-Z-]+)/wp-counter.php(.+)? BASE/wp-inst/wp-counter.php [L] 51 RewriteRule ^([_0-9a-zA-Z-]+)/wp-feed.php(.*) BASE/wp-inst/wp-feed.php [L] 52 RewriteRule ^([_0-9a-zA-Z-]+)/wp-images/(.*) BASE/wp-inst/wp-images/$2 [L] 53 RewriteRule ^([_0-9a-zA-Z-]+)/wp-links-opml.php(.*) BASE/wp-inst/wp-links-opml.php [L] 54 RewriteRule ^([_0-9a-zA-Z-]+)/wp-login.php(.*) BASE/wp-inst/wp-login.php [L] 55 RewriteRule ^([_0-9a-zA-Z-]+)/wp-mail.php(.*) BASE/wp-inst/wp-mail.php [L] 56 RewriteRule ^([_0-9a-zA-Z-]+)/wp-pass.php(.*) BASE/wp-inst/wp-pass.php [L] 57 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rdf.php(.*) BASE/wp-inst/wp-rdf.php [L] 58 RewriteRule ^([_0-9a-zA-Z-]+)/wp-register.php(.*) BASE/wp-inst/wp-register.php [L] 59 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rss.php(.*) BASE/wp-inst/wp-rss.php [L] 60 RewriteRule ^([_0-9a-zA-Z-]+)/wp-rss2.php(.*) BASE/wp-inst/wp-rss2.php [L] 61 RewriteRule ^([_0-9a-zA-Z-]+)/wp-sidebar.php(.*) BASE/wp-inst/wp-sidebar.php [L] 62 RewriteRule ^([_0-9a-zA-Z-]+)/wp-trackback.php(.*) BASE/wp-inst/wp-trackback.php [L] 63 RewriteRule ^([_0-9a-zA-Z-]+)/wp-cron.php(.*) BASE/wp-inst/wp-cron.php [L] 64 RewriteRule ^([_0-9a-zA-Z-]+)/xmlrpc.php(.*) BASE/wp-inst/xmlrpc.php [L] 65 RewriteRule ^([_0-9a-zA-Z-]+)/maintenance.php BASE/wp-inst/maintenance.php [L] 66 RewriteRule ^([_0-9a-zA-Z-]+)/favicon.ico BASE/wp-inst/favicon.ico [L] 67 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/images/(.*) BASE/wp-inst/wp-includes/images/$2 [L] 68 RewriteRule ^([_0-9a-zA-Z-]+)/wp-includes/js/(.*) BASE/wp-inst/wp-includes/js/$2 [L] 69 70 RewriteRule ^wp-comments-post.php BASE/wp-inst/wp-comments-post.php [L] 71 RewriteRule ^wp-signup.php$ BASE/wp-inst/wp-signup.php [L] 72 RewriteRule ^wp-activate.php$ BASE/wp-inst/wp-activate.php [L] 73 RewriteRule ^wp-login.php BASE/wp-inst/wp-login.php [L] 74 RewriteRule ^wp-admin/(.*) BASE/wp-inst/wp-admin/$1 [L] 75 RewriteRule ^wp-includes/images/(.*) BASE/wp-inst/wp-includes/images/$1 [L] 76 RewriteRule ^wp-includes/js/(.*) BASE/wp-inst/wp-includes/js/$1 [L] 77 RewriteRule ^signup/ BASE/wp-inst/wp-newblog.php [L] 78 RewriteRule ^invite/(.*)/? BASE/wp-inst/wp-newblog.php?u=$1 [L] 79 RewriteRule ^index.php BASE/wp-inst/index.php [L] 80 81 RewriteRule ^$ BASE/wp-inst/index.php [L] 82 83 # catch all rules 84 RewriteRule ^([_0-9a-zA-Z-]+)/ BASE/wp-inst/index.php [L] 85 RewriteRule ^([_0-9a-zA-Z-]+) $1/ [R,L] 86 87 AddType text/css .css 11 RewriteCond %{REQUEST_FILENAME} -f [OR] 12 RewriteCond %{REQUEST_FILENAME} -d 13 RewriteRule . - [L] 14 RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] 15 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 16 RewriteRule . index.php [L] trunk/index-install.php
r589 r591 58 58 <body> 59 59 60 <h1><img src="wp-in st/wp-includes/images/wordpress-mu.png" alt="WordPress MU" /></h1>60 <h1><img src="wp-includes/images/wordpress-mu.png" alt="WordPress MU" /></h1> 61 61 '; 62 62 } … … 172 172 $ret = true; 173 173 $ret = check_writeable_dir( dirname(__FILE__), $ret ); 174 $ret = check_writeable_dir( dirname(__FILE__) . "/wp-inst", $ret ); 175 $ret = check_writeable_dir( dirname(__FILE__) . "/wp-inst/wp-content/", $ret ); 174 $ret = check_writeable_dir( dirname(__FILE__) . "/wp-content/", $ret ); 176 175 177 176 if( $ret == false ) … … 207 206 208 207 // Create Blogs living area. 209 @mkdir( dirname(__FILE__) . "/wp- inst/wp-content/blogs.dir", 0777 );208 @mkdir( dirname(__FILE__) . "/wp-content/blogs.dir", 0777 ); 210 209 211 210 … … 224 223 225 224 function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'password', $dbhost = 'localhost', $prefix = 'wp_' ) { 225 $weblog_title = 'My new WPMU Blog'; 226 $email = ''; 227 $hostname = str_replace( "www.", "", $_SERVER[ 'HTTP_HOST' ] ); 226 228 print " 227 229 <form method='post' action='index.php'> … … 253 255 </tr> 254 256 </table> 257 <h2>Server Address</h2> 258 <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.<br /><b>Server Address:</b> <input type='text' name='basedomain' value='{$hostname}'></label></p> 259 <h2>Blog Details</h2> 260 <table width='100%'> 261 <tr> 262 <th scope='row'>Weblog Title</th> 263 <td><input name='weblog_title' type='text' size='45' value='".$weblog_title."' /></td> 264 <td>What would you like to call your weblog? </td> 265 </tr> 266 <tr> 267 <th scope='row'>Email</th> 268 <td><input name='email' type='text' size='45' value='".$email."' /></td> 269 <td>Your email address.</td> 270 </tr> 271 </table> 255 272 <p class='submit'><input name='submit' type='submit' value='Submit' /> </p> 256 273 </form> "; … … 258 275 259 276 function step2() { 277 global $wpdb, $table_prefix, $base, $blog_id; 260 278 $dbname = $_POST['dbname']; 261 279 $uname = $_POST['uname']; … … 275 293 define('DB_HOST', $dbhost); 276 294 277 if (!file_exists('wp- inst/wp-config-sample.php'))295 if (!file_exists('wp-config-sample.php')) 278 296 die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 279 297 280 $configFile = file('wp- inst/wp-config-sample.php');298 $configFile = file('wp-config-sample.php'); 281 299 // We'll fail here if the values are no good. 282 require_once('wp-in st/wp-includes/wp-db.php');300 require_once('wp-includes/wp-db.php'); 283 301 printheader(); 284 302 285 303 print "Creating Database Config File: "; 286 304 287 $handle = fopen('wp- inst/wp-config.php', 'w');305 $handle = fopen('wp-config.php', 'w'); 288 306 289 307 foreach ($configFile as $line_num => $line) { … … 316 334 } 317 335 fclose($handle); 318 chmod('wp- inst/wp-config.php', 0666);336 chmod('wp-config.php', 0666); 319 337 print "<b style='color: #00aa00; font-weight: bold'>DONE</b><br />"; 320 338 } … … 326 344 <input type='hidden' name='action' value='step3'> 327 345 <p>To finish setting up your blog, please fill in the following form and click <q>Submit</q>.</p> 328 <h2>Server Address</h2>329 <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.<br /><b>Server Address:</b> <input type='text' name='basedomain' value='{$hostname}'></label></p>330 <h2>Blog Details</h2>331 <table width='100%'>332 <tr>333 <th scope='row'>Weblog Title</th>334 <td><input name='weblog_title' type='text' size='45' value='".$weblog_title."' /></td>335 <td>What would you like to call your weblog? </td>336 </tr>337 <tr>338 <th scope='row'>Email</th>339 <td><input name='email' type='text' size='45' value='".$email."' /></td>340 <td>Your email address.</td>341 </tr>342 </table>343 346 <input name='submit' type='submit' value='Submit' /> 344 347 </form> … … 406 409 case "step2": 407 410 // get blog username 408 // create wp- inst/wp-config.php411 // create wp-config.php 409 412 step2(); 410 printuserdetailsform(); 413 // Install Blog! 414 include_once('./wp-config.php'); 415 include_once('./wp-admin/upgrade-functions.php'); 416 make_db_current_silent(); 417 populate_options(); 418 do_htaccess( 'htaccess.dist', '.htaccess', $base, ''); 419 printheader(); 420 step3(); 411 421 break; 412 422 case "step3": … … 414 424 // create .htaccess 415 425 // print login info and links. 416 require_once('./wp- inst/wp-config.php');417 require_once('./wp- inst/wp-admin/upgrade-functions.php');426 require_once('./wp-config.php'); 427 require_once('./wp-admin/upgrade-functions.php'); 418 428 make_db_current_silent(); 419 429 populate_options(); … … 424 434 default: 425 435 // check that directories are writeable. 426 // create wp -inst/wpmu-settings.php436 // create wpmu-settings.php 427 437 // get db auth info. 428 438 printheader(); 429 439 if( step1() ) { 430 printstep1form();440 printstep1form(); 431 441 } 432 442 break; trunk/wp-admin/admin-functions.php
r587 r591 1087 1087 // Returns true on write success, false on failure. 1088 1088 function insert_with_markers($filename, $marker, $insertion) { 1089 return true; 1089 1090 if (!file_exists($filename) || is_writeable($filename)) { 1090 1091 if (!file_exists($filename)) { trunk/wp-blog-header.php
r13 r591 5 5 if ( strstr( $_SERVER['PHP_SELF'], 'wp-admin') ) $path = ''; 6 6 else $path = 'wp-admin/'; 7 die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='{$path}setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file."); 7 include( "index-install.php" ); // install WPMU! 8 die(); 8 9 } 9 10 trunk/wp-signup.php
r589 r591 172 172 173 173 function validate_another_blog_signup() { 174 global $current_user , $current_site;174 global $current_user; 175 175 176 176 $result = validate_blog_form(); … … 185 185 $meta = array ('lang_id' => 'en', 'public' => $public); 186 186 187 wpmu_create_blog($domain, $ current_site->path, $blog_title, $current_user->id, $meta);188 confirm_another_blog_signup($domain, $ current_site->path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);187 wpmu_create_blog($domain, $path, $blog_title, $current_user->id, $meta); 188 confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); 189 189 } 190 190 … … 192 192 ?> 193 193 <h2><?php printf(__('%s Is Yours'), $domain.$path ) ?></h2> 194 <p><?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, $domain.$path . "wp-login.php", $user_name) ?></p>194 <p><?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name) ?></p> 195 195 <?php 196 196 do_action('signup_finished'); trunk/wpmu-settings.php
r586 r591 33 33 $blogname = htmlspecialchars( str_replace( $path, '', $_SERVER[ 'REQUEST_URI' ] ) ); 34 34 $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) ); 35 if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' ) {35 if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' ) { 36 36 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'"); 37 37 } else { 38 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$ blogname.$domain' AND path = '$path'");38 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '{$path}{$blogname}/'"); 39 39 } 40 40 }
