summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-08 23:22:50 +0100
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-08 23:22:50 +0100
commit104a47e4a2903f1c7ea73363a73cee12f0cf14ac (patch)
treeac68398c8b50e1eb63e43499d5c6e11cc3443dd1 /classes
parent0ab17f382b9993ada3d12d4cdace72cca53fb545 (diff)
parent111f6a775daf9334adb05c9f8e539d682238f4dd (diff)
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r--classes/Avatar.php2
-rw-r--r--classes/User.php8
-rw-r--r--classes/User_group.php2
-rw-r--r--classes/User_role.php3
4 files changed, 10 insertions, 5 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 64f105179..cc7a6b647 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -102,6 +102,6 @@ class Avatar extends Memcached_DataObject
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
- return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ return Theme::path('default-avatar-'.$sizenames[$size].'.png');
}
}
diff --git a/classes/User.php b/classes/User.php
index b0d372be8..9b90ce61b 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -705,10 +705,12 @@ class User extends Memcached_DataObject
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
switch ($right)
{
- case Right::deleteOthersNotice:
- $result = $this->hasRole('moderator');
+ case Right::DELETEOTHERSNOTICE:
+ $result = $this->hasRole(User_role::MODERATOR);
break;
- default:
+ case Right::CONFIGURESITE:
+ $result = $this->hasRole(User_role::ADMINISTRATOR);
+ default:
$result = false;
break;
}
diff --git a/classes/User_group.php b/classes/User_group.php
index 310ecff1e..b92638f7a 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -34,7 +34,7 @@ class User_group extends Memcached_DataObject
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
AVATAR_STREAM_SIZE => 'stream',
AVATAR_MINI_SIZE => 'mini');
- return theme_path('default-avatar-'.$sizenames[$size].'.png');
+ return Theme::path('default-avatar-'.$sizenames[$size].'.png');
}
function homeUrl()
diff --git a/classes/User_role.php b/classes/User_role.php
index 85ecfb422..fc3806897 100644
--- a/classes/User_role.php
+++ b/classes/User_role.php
@@ -45,4 +45,7 @@ class User_role extends Memcached_DataObject
{
return Memcached_DataObject::pkeyGet('User_role', $kv);
}
+
+ const MODERATOR = 'moderator';
+ const ADMINISTRATOR = 'administrator';
}