summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-08 23:10:34 +0000
committerSarven Capadisli <csarven@status.net>2009-11-08 23:10:34 +0000
commit8e58f241739b97bd53f78035781f16e2067a31d9 (patch)
tree8ad366f5f408d1181b1816f607a120fe0c91c502 /classes
parent2a0a363e1d846334bc37d46b5f6f42e64a5a96eb (diff)
parentb78a35ec73980d8dfa2fcb68ef81936f4b3c110b (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/File_redirection.php8
-rw-r--r--classes/Notice.php6
-rw-r--r--classes/Profile.php4
-rw-r--r--classes/User.php14
-rw-r--r--classes/User_group.php2
-rw-r--r--classes/User_role.php3
7 files changed, 22 insertions, 17 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/File_redirection.php b/classes/File_redirection.php
index 08a6e8d8b..c951c1ee7 100644
--- a/classes/File_redirection.php
+++ b/classes/File_redirection.php
@@ -53,7 +53,7 @@ class File_redirection extends Memcached_DataObject
'connect_timeout' => 10, // # seconds to wait
'max_redirs' => $redirs, // # max number of http redirections to follow
'follow_redirects' => true, // Follow redirects
- 'store_body' => false, // We won't need body content here.
+ 'store_body' => false, // We will not need body content here.
));
return $request;
}
@@ -81,12 +81,12 @@ class File_redirection extends Memcached_DataObject
}
try {
$request = self::_commonHttp($short_url, $redirs);
- // Don't include body in output
+ // Do not include body in output
$request->setMethod(HTTP_Request2::METHOD_HEAD);
$response = $request->send();
if (405 == $response->getStatus()) {
- // Server doesn't support HEAD method? Can this really happen?
+ // Server does not support HEAD method? Can this really happen?
// We'll try again as a GET and ignore the response data.
$request = self::_commonHttp($short_url, $redirs);
$response = $request->send();
@@ -178,7 +178,7 @@ class File_redirection extends Memcached_DataObject
case 'aim':
case 'jabber':
case 'xmpp':
- // don't touch anything
+ // do not touch anything
break;
default:
diff --git a/classes/Notice.php b/classes/Notice.php
index 9886875cb..32a8b693c 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -146,7 +146,7 @@ class Notice extends Memcached_DataObject
/* Add them to the database */
foreach(array_unique($hashtags) as $hashtag) {
- /* elide characters we don't want in the tag */
+ /* elide characters we do not want in the tag */
$this->saveTag($hashtag);
}
return true;
@@ -1105,7 +1105,7 @@ class Notice extends Memcached_DataObject
if (empty($recipient)) {
continue;
}
- // Don't save replies from blocked profile to local user
+ // Do not save replies from blocked profile to local user
$recipient_user = User::staticGet('id', $recipient->id);
if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) {
continue;
@@ -1131,7 +1131,7 @@ class Notice extends Memcached_DataObject
$tagged = Profile_tag::getTagged($sender->id, $tag);
foreach ($tagged as $t) {
if (!$replied[$t->id]) {
- // Don't save replies from blocked profile to local user
+ // Do not save replies from blocked profile to local user
$t_user = User::staticGet('id', $t->id);
if ($t_user && $t_user->hasBlocked($sender)) {
continue;
diff --git a/classes/Profile.php b/classes/Profile.php
index 7c1e9db33..a50f4951d 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -101,7 +101,7 @@ class Profile extends Memcached_DataObject
}
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
- # We don't do a scaled one if original is our scaled size
+ # We do not do a scaled one if original is our scaled size
if (!($avatar->width == $size && $avatar->height == $size)) {
$scaled_filename = $imagefile->resize($size);
@@ -174,7 +174,7 @@ class Profile extends Memcached_DataObject
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0, $since=null)
{
- // XXX: I'm not sure this is going to be any faster. It probably isn't.
+ // XXX: I'm not sure this is going to be any faster. It probably is not.
$ids = Notice::stream(array($this, '_streamDirect'),
array(),
'profile:notice_ids:' . $this->id,
diff --git a/classes/User.php b/classes/User.php
index b0d372be8..c529b82e0 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -87,7 +87,7 @@ class User extends Memcached_DataObject
return (is_null($sub)) ? false : true;
}
- // 'update' won't write key columns, so we have to do it ourselves.
+ // 'update' will not write key columns, so we have to do it ourselves.
function updateKeys(&$orig)
{
@@ -384,7 +384,7 @@ class User extends Memcached_DataObject
return false;
}
- // Otherwise, cache doesn't have all faves;
+ // Otherwise, cache does not have all faves;
// fall through to the default
}
@@ -463,7 +463,7 @@ class User extends Memcached_DataObject
{
$cache = common_memcache();
if ($cache) {
- // Faves don't happen chronologically, so we need to blow
+ // Faves do not happen chronologically, so we need to blow
// ;last cache, too
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
@@ -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';
}