Merge branch '0.9.x' into 1.0.x

Conflicts:
	actions/confirmaddress.php
	actions/emailsettings.php
	actions/hostmeta.php
	actions/imsettings.php
	actions/login.php
	actions/profilesettings.php
	actions/showgroup.php
	actions/smssettings.php
	actions/urlsettings.php
	actions/userauthorization.php
	actions/userdesignsettings.php
	classes/Memcached_DataObject.php
	index.php
	lib/accountsettingsaction.php
	lib/action.php
	lib/common.php
	lib/connectsettingsaction.php
	lib/designsettings.php
	lib/personalgroupnav.php
	lib/profileaction.php
	lib/userprofile.php
	plugins/ClientSideShorten/ClientSideShortenPlugin.php
	plugins/Facebook/FBConnectSettings.php
	plugins/Facebook/FacebookPlugin.php
	plugins/NewMenu/NewMenuPlugin.php
	plugins/NewMenu/newmenu.css
This commit is contained in:
Zach Copley
2011-02-28 15:39:43 -08:00
1504 changed files with 136871 additions and 78532 deletions

View File

@@ -354,7 +354,10 @@ class Profile extends Memcached_DataObject
$profiles = array();
while ($subs->fetch()) {
$profiles[] = Profile::staticGet($subs->subscribed);
$profile = Profile::staticGet($subs->subscribed);
if ($profile) {
$profiles[] = $profile;
}
}
return new ArrayWrapper($profiles);
@@ -369,7 +372,10 @@ class Profile extends Memcached_DataObject
$profiles = array();
while ($subs->fetch()) {
$profiles[] = Profile::staticGet($subs->subscriber);
$profile = Profile::staticGet($subs->subscriber);
if ($profile) {
$profiles[] = $profile;
}
}
return new ArrayWrapper($profiles);
@@ -746,6 +752,10 @@ class Profile extends Memcached_DataObject
throw new Exception("Can't save role '$name' for profile '{$this->id}'");
}
if ($name == 'owner') {
User::blow('user:site_owner');
}
Event::handle('EndGrantRole', array($this, $name));
}
@@ -774,6 +784,10 @@ class Profile extends Memcached_DataObject
throw new Exception(sprintf(_('Cannot revoke role "%1$s" for user #%2$d; database error.'),$name, $this->id));
}
if ($name == 'owner') {
User::blow('user:site_owner');
}
Event::handle('EndRevokeRole', array($this, $name));
return true;
@@ -859,6 +873,12 @@ class Profile extends Memcached_DataObject
case Right::EMAILONFAVE:
$result = !$this->isSandboxed();
break;
case Right::WEBLOGIN:
$result = !$this->isSilenced();
break;
case Right::API:
$result = !$this->isSilenced();
break;
case Right::BACKUPACCOUNT:
$result = common_config('profile', 'backup');
break;
@@ -918,6 +938,31 @@ class Profile extends Memcached_DataObject
return $xs->getString();
}
/**
* Extra profile info for atom entries
*
* Clients use some extra profile info in the atom stream.
* This gives it to them.
*
* @param User $cur Current user
*
* @return array representation of <statusnet:profile_info> element or null
*/
function profileInfo($cur)
{
$profileInfoAttr = array('local_id' => $this->id);
if ($cur != null) {
// Whether the current user is a subscribed to this profile
$profileInfoAttr['following'] = $cur->isSubscribed($this) ? 'true' : 'false';
// Whether the current user is has blocked this profile
$profileInfoAttr['blocking'] = $cur->hasBlocked($this) ? 'true' : 'false';
}
return array('statusnet:profile_info', $profileInfoAttr, null);
}
/**
* Returns an XML string fragment with profile information as an
* Activity Streams <activity:actor> element.