summaryrefslogtreecommitdiffstats
path: root/wp-inst/xmlrpc.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-15 11:12:16 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-15 11:12:16 +0000
commit8a682722d1b64ba299997ff3f6099db353fab43a (patch)
treef5e794047b9e92676e44100cedb7848297a9600b /wp-inst/xmlrpc.php
parenteb69639d667f0c15130e26e79e06fd6f891f3936 (diff)
downloadwordpress-mu-8a682722d1b64ba299997ff3f6099db353fab43a.tar.gz
wordpress-mu-8a682722d1b64ba299997ff3f6099db353fab43a.tar.xz
wordpress-mu-8a682722d1b64ba299997ff3f6099db353fab43a.zip
Merge from WP SVN.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@27 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/xmlrpc.php')
-rw-r--r--wp-inst/xmlrpc.php26
1 files changed, 12 insertions, 14 deletions
diff --git a/wp-inst/xmlrpc.php b/wp-inst/xmlrpc.php
index a00abc0..6326596 100644
--- a/wp-inst/xmlrpc.php
+++ b/wp-inst/xmlrpc.php
@@ -157,8 +157,8 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error;
}
- $user_data = get_userdatabylogin($user_login);
- $is_admin = $user_data->user_level > 3;
+ $user = new WP_User($user_login);
+ $is_admin = $user->has_cap('level_8');
$struct = array(
'isAdmin' => $is_admin,
@@ -295,10 +295,9 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error;
}
- $user_data = get_userdatabylogin($user_login);
-
- if ($user_data->user_level < 3) {
- return new IXR_Error(401, 'Sorry, users whose level is less than 3, can not edit the template.');
+ $user = new WP_User($user_login);
+ if ( !$user->has_cap('edit_themes') ) {
+ return new IXR_Error(401, 'Sorry, this user can not edit the template.');
}
/* warning: here we make the assumption that the weblog's URI is on the same server */
@@ -331,10 +330,9 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error;
}
- $user_data = get_userdatabylogin($user_login);
-
- if ($user_data->user_level < 3) {
- return new IXR_Error(401, 'Sorry, users whose level is less than 3, can not edit the template.');
+ $user = new WP_User($user_login);
+ if ( !$user->has_cap('edit_themes') ) {
+ return new IXR_Error(401, 'Sorry, this user can not edit the template.');
}
/* warning: here we make the assumption that the weblog's URI is on the same server */
@@ -849,9 +847,9 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error;
}
- if(get_settings('fileupload_minlevel') > $user_data->user_level) {
- // User has not enough privileges
- logIO('O', '(MW) Not enough privilege: user level too low');
+ $user = new WP_User($user_login);
+ if ( !$user->has_cap('upload_files') ) {
+ logIO('O', '(MW) User does not have upload_files capability');
$this->error = new IXR_Error(401, 'You are not allowed to upload files to this site.');
return $this->error;
}
@@ -1310,4 +1308,4 @@ class wp_xmlrpc_server extends IXR_Server {
$wp_xmlrpc_server = new wp_xmlrpc_server();
-?> \ No newline at end of file
+?>