summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-10-28 12:27:48 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-10-28 12:27:48 +0000
commitdca76ad19c0cc8299b9bc32f6db8d13b5542717b (patch)
treea870bacf5fc98f6d01bd3280d5c43b3e22a406a6 /wp-inst/wp-admin
parent3335ee3f39fd50d52cfacf11de8f83a07dfe91bf (diff)
downloadwordpress-mu-dca76ad19c0cc8299b9bc32f6db8d13b5542717b.tar.gz
wordpress-mu-dca76ad19c0cc8299b9bc32f6db8d13b5542717b.tar.xz
wordpress-mu-dca76ad19c0cc8299b9bc32f6db8d13b5542717b.zip
Massive WP merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@414 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin')
-rw-r--r--wp-inst/wp-admin/admin-functions.php10
-rw-r--r--wp-inst/wp-admin/bookmarklet.php48
-rw-r--r--wp-inst/wp-admin/image-uploading.php2
-rw-r--r--wp-inst/wp-admin/import/rss.php3
-rw-r--r--wp-inst/wp-admin/install.php2
-rw-r--r--wp-inst/wp-admin/upgrade-schema.php4
6 files changed, 36 insertions, 33 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php
index b2530a5..cdfbd37 100644
--- a/wp-inst/wp-admin/admin-functions.php
+++ b/wp-inst/wp-admin/admin-functions.php
@@ -1505,12 +1505,16 @@ function wp_upload_dir() {
$dir = 'wp-content/uploads';
$path = ABSPATH . $dir;
+
+ // Give the new dirs the same perms as wp-content.
+ $stat = stat(ABSPATH . 'wp-content');
+ $dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
// Make sure we have an uploads dir
if ( ! file_exists( $path ) ) {
if ( ! mkdir( $path ) )
return array('error' => "Unable to create directory $path. Is its parent directory writable by the server?");
- @ chmod( ABSPATH . $path, 0774 );
+ @ chmod( $path, $dir_perms );
}
// Generate the yearly and monthly dirs
@@ -1524,14 +1528,14 @@ function wp_upload_dir() {
if ( ! file_exists( $pathy ) ) {
if ( ! mkdir( $pathy ) )
return array('error' => "Unable to create directory $pathy. Is $path writable?");
- @ chmod( $pathy, 0774 );
+ @ chmod( $pathy, $dir_perms );
}
// Make sure we have a monthly dir
if ( ! file_exists( $pathym ) ) {
if ( ! mkdir( $pathym ) )
return array('error' => "Unable to create directory $pathym. Is $pathy writable?");
- @ chmod( $pathym, 0774 );
+ @ chmod( $pathym, $dir_perms );
}
$uploads = array('path' => $pathym, 'url' => get_option('siteurl') . "/$dir/$y/$m", 'error' => false);
diff --git a/wp-inst/wp-admin/bookmarklet.php b/wp-inst/wp-admin/bookmarklet.php
index 2562ae2..195e35c 100644
--- a/wp-inst/wp-admin/bookmarklet.php
+++ b/wp-inst/wp-admin/bookmarklet.php
@@ -5,8 +5,7 @@ require_once('admin.php');
if ( ! current_user_can('edit_posts') )
die ("Cheatin' uh?");
-if ('b' == $a) {
-
+if ('b' == $a):
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@@ -19,33 +18,32 @@ window.close()
<body></body>
</html>
<?php
-} else {
- $popuptitle = wp_specialchars(stripslashes($popuptitle));
- $text = wp_specialchars(stripslashes(urldecode($text)));
+exit;
+endif;
+
+$post = get_default_post_to_edit();
+
+$popuptitle = wp_specialchars(stripslashes($popuptitle));
+$text = wp_specialchars(stripslashes(urldecode($text)));
- $popuptitle = funky_javascript_fix($popuptitle);
- $text = funky_javascript_fix($text);
+$popuptitle = funky_javascript_fix($popuptitle);
+$text = funky_javascript_fix($text);
- $post_title = wp_specialchars($_REQUEST['post_title']);
- if (!empty($post_title)) {
- $post_title = stripslashes($post_title);
- } else {
- $post_title = $popuptitle;
- }
+$post_title = wp_specialchars($_REQUEST['post_title']);
+if (!empty($post_title))
+ $post->post_title = stripslashes($post_title);
+else
+ $post->post_title = $popuptitle;
- $edited_post_title = wp_specialchars($post_title);
-
-// $post_pingback needs to be set in any file that includes edit-form.php
- $post_pingback = get_settings('default_pingback_flag');
-
- $content = wp_specialchars($_REQUEST['content']);
- $popupurl = wp_specialchars($_REQUEST['popupurl']);
+
+$content = wp_specialchars($_REQUEST['content']);
+$popupurl = wp_specialchars($_REQUEST['popupurl']);
if ( !empty($content) ) {
- $content = wp_specialchars( stripslashes($_REQUEST['content']) );
+ $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
} else {
- $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
+ $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
}
-
+
/* /big funky fixes */
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -103,6 +101,4 @@ window.close()
<?php do_action('admin_footer', ''); ?>
</body>
-</html><?php
-}
-?>
+</html>
diff --git a/wp-inst/wp-admin/image-uploading.php b/wp-inst/wp-admin/image-uploading.php
index ccc97d1..b921040 100644
--- a/wp-inst/wp-admin/image-uploading.php
+++ b/wp-inst/wp-admin/image-uploading.php
@@ -113,7 +113,7 @@ while ( file_exists($uploads['path'] . "/$filename") )
$file = $uploads['path'] . "/$filename";
if ( false === move_uploaded_file($_FILES['image']['tmp_name'], $file) )
die('The uploaded file could not be moved to $file.');
-chmod($file, 0775);
+chmod($file, 0666); // FIXME: Need to set this according to rw bits on parent dir.
// Compute the URL
$url = $uploads['url'] . "/$filename";
diff --git a/wp-inst/wp-admin/import/rss.php b/wp-inst/wp-admin/import/rss.php
index 3662013..5ed8416 100644
--- a/wp-inst/wp-admin/import/rss.php
+++ b/wp-inst/wp-admin/import/rss.php
@@ -98,8 +98,7 @@ class RSS_Import {
$post_author = 1;
$post_status = 'publish';
- $post_date_gmt = $post_date; // FIXME
- $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories');
+ $this->posts[$index] = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status', 'guid', 'categories');
$index++;
}
}
diff --git a/wp-inst/wp-admin/install.php b/wp-inst/wp-admin/install.php
index 814803d..dd7380e 100644
--- a/wp-inst/wp-admin/install.php
+++ b/wp-inst/wp-admin/install.php
@@ -138,6 +138,7 @@ flush();
// Set everything up
make_db_current_silent();
populate_options();
+populate_roles();
$wpdb->query("UPDATE $wpdb->options SET option_value = '$weblog_title' WHERE option_name = 'blogname'");
$wpdb->query("UPDATE $wpdb->options SET option_value = '$admin_email' WHERE option_name = 'admin_email'");
@@ -196,7 +197,6 @@ http://wordpress.org/
@wp_mail($admin_email, __('New WordPress Blog'), $message, $message_headers);
-upgrade_all();
?>
<p><em><?php _e('Finished!'); ?></em></p>
diff --git a/wp-inst/wp-admin/upgrade-schema.php b/wp-inst/wp-admin/upgrade-schema.php
index f68eca2..fe548ae 100644
--- a/wp-inst/wp-admin/upgrade-schema.php
+++ b/wp-inst/wp-admin/upgrade-schema.php
@@ -283,6 +283,10 @@ function populate_options() {
}
function populate_roles() {
+ populate_roles_160();
+}
+
+function populate_roles_160() {
global $wp_roles;
// Add roles