forked from GNUsocial/gnu-social
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
This commit is contained in:
commit
3839627a6f
@ -42,8 +42,9 @@ class Avatar extends Memcached_DataObject
|
|||||||
return Memcached_DataObject::pkeyGet('Avatar', $kv);
|
return Memcached_DataObject::pkeyGet('Avatar', $kv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// where should the avatar go for this user?
|
/**
|
||||||
|
* Where should the avatar go for this user?
|
||||||
|
*/
|
||||||
static function filename($id, $extension, $size=null, $extra=null)
|
static function filename($id, $extension, $size=null, $extra=null)
|
||||||
{
|
{
|
||||||
if ($size) {
|
if ($size) {
|
||||||
|
@ -65,5 +65,4 @@ class Consumer extends Memcached_DataObject
|
|||||||
$nonce->consumer_key = $this->consumer_key;
|
$nonce->consumer_key = $this->consumer_key;
|
||||||
$nonce->delete();
|
$nonce->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,4 @@ class Conversation extends Memcached_DataObject
|
|||||||
|
|
||||||
return $conv;
|
return $conv;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,8 +144,11 @@ class Fave extends Memcached_DataObject
|
|||||||
common_date_iso8601($this->modified));
|
common_date_iso8601($this->modified));
|
||||||
|
|
||||||
$act->time = strtotime($this->modified);
|
$act->time = strtotime($this->modified);
|
||||||
|
// TRANS: Activity title when marking a notice as favorite.
|
||||||
$act->title = _("Favor");
|
$act->title = _("Favor");
|
||||||
$act->content = sprintf(_("%s marked notice %s as a favorite."),
|
// TRANS: Ntofication given when a user marks a notice as favorite.
|
||||||
|
// TRANS: %1$s is a user nickname or full name, %2$s is a notice URI.
|
||||||
|
$act->content = sprintf(_("%1$s marked notice %2$s as a favorite."),
|
||||||
$profile->getBestName(),
|
$profile->getBestName(),
|
||||||
$notice->uri);
|
$notice->uri);
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ require_once INSTALLDIR.'/classes/File_to_post.php';
|
|||||||
/**
|
/**
|
||||||
* Table Definition for file
|
* Table Definition for file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class File extends Memcached_DataObject
|
class File extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
|
@ -131,4 +131,3 @@ class File_oembed extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,4 +281,3 @@ class File_redirection extends Memcached_DataObject
|
|||||||
$file_redir->insert();
|
$file_redir->insert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,4 +57,3 @@ class File_thumbnail extends Memcached_DataObject
|
|||||||
$tn->insert();
|
$tn->insert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,4 +67,3 @@ class File_to_post extends Memcached_DataObject
|
|||||||
return Memcached_DataObject::pkeyGet('File_to_post', $kv);
|
return Memcached_DataObject::pkeyGet('File_to_post', $kv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
$result = $flink->find(true);
|
$result = $flink->find(true);
|
||||||
|
|
||||||
return empty($result) ? null : $flink;
|
return empty($result) ? null : $flink;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getByForeignID($foreign_id, $service)
|
static function getByForeignID($foreign_id, $service)
|
||||||
@ -129,5 +128,4 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Foreign_service extends Memcached_DataObject
|
class Foreign_service extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -12,7 +12,7 @@ class Foreign_service extends Memcached_DataObject
|
|||||||
public $__table = 'foreign_service'; // table name
|
public $__table = 'foreign_service'; // table name
|
||||||
public $id; // int(4) primary_key not_null
|
public $id; // int(4) primary_key not_null
|
||||||
public $name; // varchar(32) unique_key not_null
|
public $name; // varchar(32) unique_key not_null
|
||||||
public $description; // varchar(255)
|
public $description; // varchar(255)
|
||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Foreign_subscription extends Memcached_DataObject
|
class Foreign_subscription extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
|
@ -83,5 +83,4 @@ class Foreign_user extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -111,5 +111,4 @@ class Group_block extends Memcached_DataObject
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table Definition for group_inbox
|
* Table Definition for group_inbox
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Group_inbox extends Memcached_DataObject
|
class Group_inbox extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
|
@ -71,7 +71,9 @@ class Group_member extends Memcached_DataObject
|
|||||||
$member = Profile::staticGet('id', $this->profile_id);
|
$member = Profile::staticGet('id', $this->profile_id);
|
||||||
|
|
||||||
if (empty($member)) {
|
if (empty($member)) {
|
||||||
throw new Exception("Profile ID {$this->profile_id} invalid.");
|
// TRANS: Exception thrown providing an invalid profile ID.
|
||||||
|
// TRANS: %s is the invalid profile ID.
|
||||||
|
throw new Exception(sprintf(_("Profile ID %s is invalid."),$this->profile_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $member;
|
return $member;
|
||||||
@ -82,7 +84,9 @@ class Group_member extends Memcached_DataObject
|
|||||||
$group = User_group::staticGet('id', $this->group_id);
|
$group = User_group::staticGet('id', $this->group_id);
|
||||||
|
|
||||||
if (empty($group)) {
|
if (empty($group)) {
|
||||||
throw new Exception("Group ID {$this->group_id} invalid.");
|
// TRANS: Exception thrown providing an invalid group ID.
|
||||||
|
// TRANS: %s is the invalid group ID.
|
||||||
|
throw new Exception(sprintf(_("Group ID %s is invalid."),$this->group_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $group;
|
return $group;
|
||||||
@ -105,6 +109,7 @@ class Group_member extends Memcached_DataObject
|
|||||||
$act->objects[] = ActivityObject::fromGroup($group);
|
$act->objects[] = ActivityObject::fromGroup($group);
|
||||||
|
|
||||||
$act->time = strtotime($this->created);
|
$act->time = strtotime($this->created);
|
||||||
|
// TRANS: Activity title.
|
||||||
$act->title = _("Join");
|
$act->title = _("Join");
|
||||||
|
|
||||||
// TRANS: Success message for subscribe to group attempt through OStatus.
|
// TRANS: Success message for subscribe to group attempt through OStatus.
|
||||||
|
@ -55,7 +55,6 @@ class Inbox extends Memcached_DataObject
|
|||||||
/**
|
/**
|
||||||
* Create a new inbox from existing Notice_inbox stuff
|
* Create a new inbox from existing Notice_inbox stuff
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function initialize($user_id)
|
static function initialize($user_id)
|
||||||
{
|
{
|
||||||
$inbox = Inbox::fromNoticeInbox($user_id);
|
$inbox = Inbox::fromNoticeInbox($user_id);
|
||||||
@ -115,10 +114,10 @@ class Inbox extends Memcached_DataObject
|
|||||||
*/
|
*/
|
||||||
static function insertNotice($user_id, $notice_id)
|
static function insertNotice($user_id, $notice_id)
|
||||||
{
|
{
|
||||||
// Going straight to the DB rather than trusting our caching
|
// Going straight to the DB rather than trusting our caching
|
||||||
// during an update. Note: not using DB_DataObject::staticGet,
|
// during an update. Note: not using DB_DataObject::staticGet,
|
||||||
// which is unsafe to use directly (in-process caching causes
|
// which is unsafe to use directly (in-process caching causes
|
||||||
// memory leaks, which accumulate in queue processes).
|
// memory leaks, which accumulate in queue processes).
|
||||||
$inbox = new Inbox();
|
$inbox = new Inbox();
|
||||||
if (!$inbox->get('user_id', $user_id)) {
|
if (!$inbox->get('user_id', $user_id)) {
|
||||||
$inbox = Inbox::initialize($user_id);
|
$inbox = Inbox::initialize($user_id);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Invitation extends Memcached_DataObject
|
class Invitation extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
|
@ -189,11 +189,11 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
str_replace("\n", " ", $e->getTraceAsString()));
|
str_replace("\n", " ", $e->getTraceAsString()));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$keys = $this->_allCacheKeys();
|
$keys = $this->_allCacheKeys();
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
$c->set($key, $this);
|
$c->set($key, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,4 +637,3 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
return $vstr;
|
return $vstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ class Message extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function saveNew($from, $to, $content, $source) {
|
static function saveNew($from, $to, $content, $source) {
|
||||||
|
|
||||||
$sender = Profile::staticGet('id', $from);
|
$sender = Profile::staticGet('id', $from);
|
||||||
|
|
||||||
if (!$sender->hasRight(Right::NEWMESSAGE)) {
|
if (!$sender->hasRight(Right::NEWMESSAGE)) {
|
||||||
|
@ -36,5 +36,4 @@ class Nonce extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
return array('consumer_key,token' => 'token:consumer_key,token');
|
return array('consumer_key,token' => 'token:consumer_key,token');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -745,6 +745,7 @@ class Notice extends Memcached_DataObject
|
|||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($conversation->N > 0) {
|
if ($conversation->N > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1305,13 +1306,10 @@ class Notice extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Event::handle('StartActivitySource', array(&$this, &$xs))) {
|
if (Event::handle('StartActivitySource', array(&$this, &$xs))) {
|
||||||
|
|
||||||
if ($source) {
|
if ($source) {
|
||||||
|
|
||||||
$atom_feed = $profile->getAtomFeed();
|
$atom_feed = $profile->getAtomFeed();
|
||||||
|
|
||||||
if (!empty($atom_feed)) {
|
if (!empty($atom_feed)) {
|
||||||
|
|
||||||
$xs->elementStart('source');
|
$xs->elementStart('source');
|
||||||
|
|
||||||
// XXX: we should store the actual feed ID
|
// XXX: we should store the actual feed ID
|
||||||
@ -1899,7 +1897,6 @@ class Notice extends Memcached_DataObject
|
|||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
if (!empty($location_id) && !empty($location_ns)) {
|
if (!empty($location_id) && !empty($location_ns)) {
|
||||||
|
|
||||||
$options['location_id'] = $location_id;
|
$options['location_id'] = $location_id;
|
||||||
$options['location_ns'] = $location_ns;
|
$options['location_ns'] = $location_ns;
|
||||||
|
|
||||||
@ -1911,7 +1908,6 @@ class Notice extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (!empty($lat) && !empty($lon)) {
|
} else if (!empty($lat) && !empty($lon)) {
|
||||||
|
|
||||||
$options['lat'] = $lat;
|
$options['lat'] = $lat;
|
||||||
$options['lon'] = $lon;
|
$options['lon'] = $lon;
|
||||||
|
|
||||||
@ -1922,7 +1918,6 @@ class Notice extends Memcached_DataObject
|
|||||||
$options['location_ns'] = $location->location_ns;
|
$options['location_ns'] = $location->location_ns;
|
||||||
}
|
}
|
||||||
} else if (!empty($profile)) {
|
} else if (!empty($profile)) {
|
||||||
|
|
||||||
if (isset($profile->lat) && isset($profile->lon)) {
|
if (isset($profile->lat) && isset($profile->lon)) {
|
||||||
$options['lat'] = $profile->lat;
|
$options['lat'] = $profile->lat;
|
||||||
$options['lon'] = $profile->lon;
|
$options['lon'] = $profile->lon;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Notice_source extends Memcached_DataObject
|
class Notice_source extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
|
@ -110,7 +110,6 @@ class Oauth_application extends Memcached_DataObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function uploadLogo()
|
function uploadLogo()
|
||||||
{
|
{
|
||||||
if ($_FILES['app_icon']['error'] ==
|
if ($_FILES['app_icon']['error'] ==
|
||||||
@ -153,5 +152,4 @@ class Oauth_application extends Memcached_DataObject
|
|||||||
$oauser->application_id = $this->id;
|
$oauser->application_id = $this->id;
|
||||||
$oauser->delete();
|
$oauser->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,5 +40,4 @@ class Oauth_application_user extends Memcached_DataObject
|
|||||||
|
|
||||||
return empty($result) ? null : $oau;
|
return empty($result) ? null : $oau;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,6 @@ class Profile extends Memcached_DataObject
|
|||||||
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
|
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 don't do a scaled one if original is our scaled size
|
||||||
if (!($avatar->width == $size && $avatar->height == $size)) {
|
if (!($avatar->width == $size && $avatar->height == $size)) {
|
||||||
|
|
||||||
$scaled_filename = $imagefile->resize($size);
|
$scaled_filename = $imagefile->resize($size);
|
||||||
|
|
||||||
//$scaled = DB_DataObject::factory('avatar');
|
//$scaled = DB_DataObject::factory('avatar');
|
||||||
@ -790,13 +789,14 @@ class Profile extends Memcached_DataObject
|
|||||||
* @param $right string Name of the right, usually a constant in class Right
|
* @param $right string Name of the right, usually a constant in class Right
|
||||||
* @return boolean whether the user has the right in question
|
* @return boolean whether the user has the right in question
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function hasRight($right)
|
function hasRight($right)
|
||||||
{
|
{
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
if ($this->hasRole(Profile_role::DELETED)) {
|
if ($this->hasRole(Profile_role::DELETED)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
|
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
|
||||||
switch ($right)
|
switch ($right)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,6 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
static function getTags($tagger, $tagged) {
|
static function getTags($tagger, $tagged) {
|
||||||
|
|
||||||
$tags = array();
|
$tags = array();
|
||||||
|
|
||||||
# XXX: store this in memcached
|
# XXX: store this in memcached
|
||||||
@ -44,7 +43,6 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function setTags($tagger, $tagged, $newtags) {
|
static function setTags($tagger, $tagged, $newtags) {
|
||||||
|
|
||||||
$newtags = array_unique($newtags);
|
$newtags = array_unique($newtags);
|
||||||
$oldtags = Profile_tag::getTags($tagger, $tagged);
|
$oldtags = Profile_tag::getTags($tagger, $tagged);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Remember_me extends Memcached_DataObject
|
class Remember_me extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -16,11 +16,15 @@ class Remember_me extends Memcached_DataObject
|
|||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=null)
|
function staticGet($k,$v=null)
|
||||||
{ return Memcached_DataObject::staticGet('Remember_me',$k,$v); }
|
{
|
||||||
|
return Memcached_DataObject::staticGet('Remember_me',$k,$v);
|
||||||
|
}
|
||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
function sequenceKey()
|
function sequenceKey()
|
||||||
{ return array(false, false); }
|
{
|
||||||
|
return array(false, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Remote_profile extends Memcached_DataObject
|
class Remote_profile extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -32,8 +32,8 @@ class Remote_profile extends Memcached_DataObject
|
|||||||
public $__table = 'remote_profile'; // table name
|
public $__table = 'remote_profile'; // table name
|
||||||
public $id; // int(4) primary_key not_null
|
public $id; // int(4) primary_key not_null
|
||||||
public $uri; // varchar(255) unique_key
|
public $uri; // varchar(255) unique_key
|
||||||
public $postnoticeurl; // varchar(255)
|
public $postnoticeurl; // varchar(255)
|
||||||
public $updateprofileurl; // varchar(255)
|
public $updateprofileurl; // varchar(255)
|
||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class Remote_profile extends Memcached_DataObject
|
|||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
function hasRight($right)
|
function hasRight($right)
|
||||||
{
|
{
|
||||||
$profile = Profile::staticGet($this->id);
|
$profile = Profile::staticGet($this->id);
|
||||||
|
@ -287,4 +287,3 @@ class Safe_DataObject extends DB_DataObject
|
|||||||
return Safe_DataObject::$iniCache[$key];
|
return Safe_DataObject::$iniCache[$key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Sms_carrier extends Memcached_DataObject
|
class Sms_carrier extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -22,7 +22,7 @@ class Sms_carrier extends Memcached_DataObject
|
|||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
function toEmailAddress($sms)
|
function toEmailAddress($sms)
|
||||||
{
|
{
|
||||||
return sprintf($this->email_pattern, $sms);
|
return sprintf($this->email_pattern, $sms);
|
||||||
|
@ -168,16 +168,16 @@ class Status_network extends Safe_DataObject
|
|||||||
$orig->decache();
|
$orig->decache();
|
||||||
$result = $this->query($qry);
|
$result = $this->query($qry);
|
||||||
$this->decache();
|
$this->decache();
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
$this->decache(); # while we still have the values!
|
$this->decache(); # while we still have the values!
|
||||||
return parent::delete();
|
return parent::delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $servername hostname
|
* @param string $servername hostname
|
||||||
* @param string $wildcard hostname suffix to match wildcard config
|
* @param string $wildcard hostname suffix to match wildcard config
|
||||||
@ -313,7 +313,7 @@ class Status_network extends Safe_DataObject
|
|||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
return explode('|', $this->tags);
|
return explode('|', $this->tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ class Status_network extends Safe_DataObject
|
|||||||
$snt->site_id = $this->site_id;
|
$snt->site_id = $this->site_id;
|
||||||
$snt->tag = $tag;
|
$snt->tag = $tag;
|
||||||
$snt->created = common_sql_now();
|
$snt->created = common_sql_now();
|
||||||
|
|
||||||
$id = $snt->insert();
|
$id = $snt->insert();
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
// TRANS: Exception thrown when a tag cannot be saved.
|
// TRANS: Exception thrown when a tag cannot be saved.
|
||||||
@ -356,7 +356,7 @@ class Status_network extends Safe_DataObject
|
|||||||
|
|
||||||
$tag->free();
|
$tag->free();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this site record has a particular meta-info tag attached.
|
* Check if this site record has a particular meta-info tag attached.
|
||||||
* @param string $tag
|
* @param string $tag
|
||||||
|
@ -26,7 +26,7 @@ class Status_network_tag extends Safe_DataObject
|
|||||||
|
|
||||||
public $__table = 'status_network_tag'; // table name
|
public $__table = 'status_network_tag'; // table name
|
||||||
public $site_id; // int(4) primary_key not_null
|
public $site_id; // int(4) primary_key not_null
|
||||||
public $tag; // varchar(64) primary_key not_null
|
public $tag; // varchar(64) primary_key not_null
|
||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
|
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class Status_network_tag extends Safe_DataObject
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
global $_DB_DATAOBJECT;
|
global $_DB_DATAOBJECT;
|
||||||
|
|
||||||
$sn = new Status_network();
|
$sn = new Status_network();
|
||||||
$sn->_connect();
|
$sn->_connect();
|
||||||
|
|
||||||
|
@ -251,8 +251,11 @@ class Subscription extends Memcached_DataObject
|
|||||||
common_date_iso8601($this->created));
|
common_date_iso8601($this->created));
|
||||||
|
|
||||||
$act->time = strtotime($this->created);
|
$act->time = strtotime($this->created);
|
||||||
|
// TRANS: Activity tile when subscribing to another person.
|
||||||
$act->title = _("Follow");
|
$act->title = _("Follow");
|
||||||
$act->content = sprintf(_("%s is now following %s."),
|
// TRANS: Notification given when one person starts following another.
|
||||||
|
// TRANS: %1$s is the subscriber, %2$s is the subscribed.
|
||||||
|
$act->content = sprintf(_("%1$s is now following %2$s."),
|
||||||
$subscriber->getBestName(),
|
$subscriber->getBestName(),
|
||||||
$subscribed->getBestName());
|
$subscribed->getBestName());
|
||||||
|
|
||||||
|
@ -465,7 +465,6 @@ class User_group extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function register($fields) {
|
static function register($fields) {
|
||||||
|
|
||||||
// MAGICALLY put fields into current scope
|
// MAGICALLY put fields into current scope
|
||||||
|
|
||||||
extract($fields);
|
extract($fields);
|
||||||
|
@ -18,7 +18,9 @@ class User_username extends Memcached_DataObject
|
|||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=null)
|
function staticGet($k,$v=null)
|
||||||
{ return Memcached_DataObject::staticGet('User_username',$k,$v); }
|
{
|
||||||
|
return Memcached_DataObject::staticGet('User_username',$k,$v);
|
||||||
|
}
|
||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
@ -37,6 +39,7 @@ class User_username extends Memcached_DataObject
|
|||||||
$user_username->provider_name = $provider_name;
|
$user_username->provider_name = $provider_name;
|
||||||
$user_username->username = $username;
|
$user_username->username = $username;
|
||||||
$user_username->created = DB_DataObject_Cast::dateTime();
|
$user_username->created = DB_DataObject_Cast::dateTime();
|
||||||
|
|
||||||
if($user_username->insert()){
|
if($user_username->insert()){
|
||||||
return $user_username;
|
return $user_username;
|
||||||
}else{
|
}else{
|
||||||
@ -57,5 +60,4 @@ class User_username extends Memcached_DataObject
|
|||||||
function keys() {
|
function keys() {
|
||||||
return array('provider_name' => 'K', 'username' => 'K');
|
return array('provider_name' => 'K', 'username' => 'K');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/settingsaction.php';
|
|||||||
*
|
*
|
||||||
* @see Widget
|
* @see Widget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AccountSettingsAction extends SettingsAction
|
class AccountSettingsAction extends SettingsAction
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -54,7 +53,6 @@ class AccountSettingsAction extends SettingsAction
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showLocalNav()
|
function showLocalNav()
|
||||||
{
|
{
|
||||||
$menu = new AccountSettingsNav($this);
|
$menu = new AccountSettingsNav($this);
|
||||||
@ -73,7 +71,6 @@ class AccountSettingsAction extends SettingsAction
|
|||||||
*
|
*
|
||||||
* @see HTMLOutputter
|
* @see HTMLOutputter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AccountSettingsNav extends Widget
|
class AccountSettingsNav extends Widget
|
||||||
{
|
{
|
||||||
var $action = null;
|
var $action = null;
|
||||||
@ -83,7 +80,6 @@ class AccountSettingsNav extends Widget
|
|||||||
*
|
*
|
||||||
* @param Action $action current action, used for output
|
* @param Action $action current action, used for output
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($action=null)
|
function __construct($action=null)
|
||||||
{
|
{
|
||||||
parent::__construct($action);
|
parent::__construct($action);
|
||||||
@ -95,7 +91,6 @@ class AccountSettingsNav extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$action_name = $this->action->trimmed('action');
|
$action_name = $this->action->trimmed('action');
|
||||||
|
@ -314,7 +314,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return nothing
|
* @return nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showFeeds()
|
function showFeeds()
|
||||||
{
|
{
|
||||||
$feeds = $this->getFeeds();
|
$feeds = $this->getFeeds();
|
||||||
@ -710,7 +709,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return nothing
|
* @return nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showAside()
|
function showAside()
|
||||||
{
|
{
|
||||||
$this->elementStart('div', array('id' => 'aside_primary',
|
$this->elementStart('div', array('id' => 'aside_primary',
|
||||||
@ -731,7 +729,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showExportData()
|
function showExportData()
|
||||||
{
|
{
|
||||||
$feeds = $this->getFeeds();
|
$feeds = $this->getFeeds();
|
||||||
@ -807,6 +804,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
// TRANS: Secondary navigation menu option leading to contact information on the StatusNet site.
|
// TRANS: Secondary navigation menu option leading to contact information on the StatusNet site.
|
||||||
_('Contact'));
|
_('Contact'));
|
||||||
$this->menuItem(common_local_url('doc', array('title' => 'badge')),
|
$this->menuItem(common_local_url('doc', array('title' => 'badge')),
|
||||||
|
// TRANS: Secondary navigation menu option.
|
||||||
_('Badge'));
|
_('Badge'));
|
||||||
Event::handle('EndSecondaryNav', array($this));
|
Event::handle('EndSecondaryNav', array($this));
|
||||||
}
|
}
|
||||||
@ -954,7 +952,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -1053,7 +1050,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isCacheable()
|
function isCacheable()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -1067,7 +1063,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function _hasEtag($etag, $if_none_match)
|
function _hasEtag($etag, $if_none_match)
|
||||||
{
|
{
|
||||||
$etags = explode(',', $if_none_match);
|
$etags = explode(',', $if_none_match);
|
||||||
@ -1107,7 +1102,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return integer integer value
|
* @return integer integer value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function int($key, $defValue=null, $maxValue=null, $minValue=null)
|
function int($key, $defValue=null, $maxValue=null, $minValue=null)
|
||||||
{
|
{
|
||||||
$arg = strtolower($this->trimmed($key));
|
$arg = strtolower($this->trimmed($key));
|
||||||
@ -1135,7 +1129,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return nothing
|
* @return nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function serverError($msg, $code=500)
|
function serverError($msg, $code=500)
|
||||||
{
|
{
|
||||||
$action = $this->trimmed('action');
|
$action = $this->trimmed('action');
|
||||||
@ -1151,7 +1144,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return nothing
|
* @return nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function clientError($msg, $code=400)
|
function clientError($msg, $code=400)
|
||||||
{
|
{
|
||||||
$action = $this->trimmed('action');
|
$action = $this->trimmed('action');
|
||||||
@ -1164,7 +1156,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return string current URL
|
* @return string current URL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function selfUrl()
|
function selfUrl()
|
||||||
{
|
{
|
||||||
list($action, $args) = $this->returnToArgs();
|
list($action, $args) = $this->returnToArgs();
|
||||||
@ -1176,7 +1167,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return array two elements: action, other args
|
* @return array two elements: action, other args
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function returnToArgs()
|
function returnToArgs()
|
||||||
{
|
{
|
||||||
$action = $this->trimmed('action');
|
$action = $this->trimmed('action');
|
||||||
@ -1283,7 +1273,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return array Feed object to show in head and links
|
* @return array Feed object to show in head and links
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFeeds()
|
function getFeeds()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -1294,7 +1283,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return Design a design object to use
|
* @return Design a design object to use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getDesign()
|
function getDesign()
|
||||||
{
|
{
|
||||||
return Design::siteDesign();
|
return Design::siteDesign();
|
||||||
@ -1308,7 +1296,6 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// XXX: Finding this type of check with the same message about 50 times.
|
// XXX: Finding this type of check with the same message about 50 times.
|
||||||
// Possible to refactor?
|
// Possible to refactor?
|
||||||
function checkSessionToken()
|
function checkSessionToken()
|
||||||
|
@ -48,7 +48,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Activity
|
class Activity
|
||||||
{
|
{
|
||||||
const SPEC = 'http://activitystrea.ms/spec/1.0/';
|
const SPEC = 'http://activitystrea.ms/spec/1.0/';
|
||||||
@ -108,7 +107,6 @@ class Activity
|
|||||||
* @param DOMElement $entry Atom entry to poke at
|
* @param DOMElement $entry Atom entry to poke at
|
||||||
* @param DOMElement $feed Atom feed, for context
|
* @param DOMElement $feed Atom feed, for context
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($entry = null, $feed = null)
|
function __construct($entry = null, $feed = null)
|
||||||
{
|
{
|
||||||
if (is_null($entry)) {
|
if (is_null($entry)) {
|
||||||
@ -133,6 +131,7 @@ class Activity
|
|||||||
$entry->localName == 'item') {
|
$entry->localName == 'item') {
|
||||||
$this->_fromRssItem($entry, $feed);
|
$this->_fromRssItem($entry, $feed);
|
||||||
} else {
|
} else {
|
||||||
|
// Low level exception. No need for i18n.
|
||||||
throw new Exception("Unknown DOM element: {$entry->namespaceURI} {$entry->localName}");
|
throw new Exception("Unknown DOM element: {$entry->namespaceURI} {$entry->localName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +312,6 @@ class Activity
|
|||||||
*
|
*
|
||||||
* @return DOMElement Atom entry
|
* @return DOMElement Atom entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function toAtomEntry()
|
function toAtomEntry()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -49,7 +49,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ActivityObject
|
class ActivityObject
|
||||||
{
|
{
|
||||||
const ARTICLE = 'http://activitystrea.ms/schema/1.0/article';
|
const ARTICLE = 'http://activitystrea.ms/schema/1.0/article';
|
||||||
@ -116,7 +115,6 @@ class ActivityObject
|
|||||||
*
|
*
|
||||||
* @param DOMElement $element DOM thing to turn into an Activity thing
|
* @param DOMElement $element DOM thing to turn into an Activity thing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($element = null)
|
function __construct($element = null)
|
||||||
{
|
{
|
||||||
if (empty($element)) {
|
if (empty($element)) {
|
||||||
@ -216,8 +214,7 @@ class ActivityObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme rationalize with Activity::_fromRssItem()
|
// @todo FIXME: rationalize with Activity::_fromRssItem()
|
||||||
|
|
||||||
private function _fromRssItem($item)
|
private function _fromRssItem($item)
|
||||||
{
|
{
|
||||||
$this->title = ActivityUtils::childContent($item, ActivityObject::TITLE, Activity::RSS);
|
$this->title = ActivityUtils::childContent($item, ActivityObject::TITLE, Activity::RSS);
|
||||||
|
@ -82,13 +82,11 @@ class ActivityUtils
|
|||||||
$els = $element->childNodes;
|
$els = $element->childNodes;
|
||||||
|
|
||||||
foreach ($els as $link) {
|
foreach ($els as $link) {
|
||||||
|
|
||||||
if (!($link instanceof DOMElement)) {
|
if (!($link instanceof DOMElement)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
|
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
|
||||||
|
|
||||||
$linkRel = $link->getAttribute(self::REL);
|
$linkRel = $link->getAttribute(self::REL);
|
||||||
$linkType = $link->getAttribute(self::TYPE);
|
$linkType = $link->getAttribute(self::TYPE);
|
||||||
|
|
||||||
@ -109,7 +107,6 @@ class ActivityUtils
|
|||||||
|
|
||||||
foreach ($els as $link) {
|
foreach ($els as $link) {
|
||||||
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
|
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
|
||||||
|
|
||||||
$linkRel = $link->getAttribute(self::REL);
|
$linkRel = $link->getAttribute(self::REL);
|
||||||
$linkType = $link->getAttribute(self::TYPE);
|
$linkType = $link->getAttribute(self::TYPE);
|
||||||
|
|
||||||
|
@ -79,5 +79,4 @@ class AdminForm extends Form
|
|||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,6 @@ class ApiAction extends Action
|
|||||||
$entry = array();
|
$entry = array();
|
||||||
|
|
||||||
if (Event::handle('StartRssEntryArray', array($notice, &$entry))) {
|
if (Event::handle('StartRssEntryArray', array($notice, &$entry))) {
|
||||||
|
|
||||||
$profile = $notice->getProfile();
|
$profile = $notice->getProfile();
|
||||||
|
|
||||||
// We trim() to avoid extraneous whitespace in the output
|
// We trim() to avoid extraneous whitespace in the output
|
||||||
@ -552,7 +551,6 @@ class ApiAction extends Action
|
|||||||
$notifications = false;
|
$notifications = false;
|
||||||
|
|
||||||
if ($source->isSubscribed($target)) {
|
if ($source->isSubscribed($target)) {
|
||||||
|
|
||||||
$sub = Subscription::pkeyGet(array('subscriber' =>
|
$sub = Subscription::pkeyGet(array('subscriber' =>
|
||||||
$source->id, 'subscribed' => $target->id));
|
$source->id, 'subscribed' => $target->id));
|
||||||
|
|
||||||
@ -738,7 +736,6 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
function showXmlTimeline($notice)
|
function showXmlTimeline($notice)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->initDocument('xml');
|
$this->initDocument('xml');
|
||||||
$this->elementStart('statuses', array('type' => 'array',
|
$this->elementStart('statuses', array('type' => 'array',
|
||||||
'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
|
'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
|
||||||
@ -763,7 +760,6 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
function showRssTimeline($notice, $title, $link, $subtitle, $suplink = null, $logo = null, $self = null)
|
function showRssTimeline($notice, $title, $link, $subtitle, $suplink = null, $logo = null, $self = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->initDocument('rss');
|
$this->initDocument('rss');
|
||||||
|
|
||||||
$this->element('title', null, $title);
|
$this->element('title', null, $title);
|
||||||
@ -819,7 +815,6 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
function showAtomTimeline($notice, $title, $id, $link, $subtitle=null, $suplink=null, $selfuri=null, $logo=null)
|
function showAtomTimeline($notice, $title, $id, $link, $subtitle=null, $suplink=null, $selfuri=null, $logo=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->initDocument('atom');
|
$this->initDocument('atom');
|
||||||
|
|
||||||
$this->element('title', null, $title);
|
$this->element('title', null, $title);
|
||||||
@ -863,7 +858,6 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
function showRssGroups($group, $title, $link, $subtitle)
|
function showRssGroups($group, $title, $link, $subtitle)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->initDocument('rss');
|
$this->initDocument('rss');
|
||||||
|
|
||||||
$this->element('title', null, $title);
|
$this->element('title', null, $title);
|
||||||
@ -1362,7 +1356,6 @@ class ApiAction extends Action
|
|||||||
function getTargetUser($id)
|
function getTargetUser($id)
|
||||||
{
|
{
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
|
|
||||||
// Twitter supports these other ways of passing the user ID
|
// Twitter supports these other ways of passing the user ID
|
||||||
if (is_numeric($this->arg('id'))) {
|
if (is_numeric($this->arg('id'))) {
|
||||||
return User::staticGet($this->arg('id'));
|
return User::staticGet($this->arg('id'));
|
||||||
|
@ -62,7 +62,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
|
|||||||
*/
|
*/
|
||||||
class ApiBareAuthAction extends ApiAuthAction
|
class ApiBareAuthAction extends ApiAuthAction
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take arguments for running
|
* Take arguments for running
|
||||||
*
|
*
|
||||||
|
@ -149,7 +149,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
|
|||||||
// Okay, good
|
// Okay, good
|
||||||
return new OAuthToken($at->tok, $at->secret);
|
return new OAuthToken($at->tok, $at->secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -173,10 +172,12 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
|
|||||||
$rt->tok = $token_key;
|
$rt->tok = $token_key;
|
||||||
$rt->type = $type;
|
$rt->type = $type;
|
||||||
$rt->state = 0;
|
$rt->state = 0;
|
||||||
|
|
||||||
if (!$rt->find(true)) {
|
if (!$rt->find(true)) {
|
||||||
// TRANS: Exception thrown when an attempt is made to revoke an unknown token.
|
// TRANS: Exception thrown when an attempt is made to revoke an unknown token.
|
||||||
throw new Exception(_('Tried to revoke unknown token.'));
|
throw new Exception(_('Tried to revoke unknown token.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$rt->delete()) {
|
if (!$rt->delete()) {
|
||||||
// TRANS: Exception thrown when an attempt is made to remove a revoked token.
|
// TRANS: Exception thrown when an attempt is made to remove a revoked token.
|
||||||
throw new Exception(_('Failed to delete revoked token.'));
|
throw new Exception(_('Failed to delete revoked token.'));
|
||||||
|
@ -197,7 +197,8 @@ class ApplicationEditForm extends Form
|
|||||||
$maxDesc = Oauth_application::maxDesc();
|
$maxDesc = Oauth_application::maxDesc();
|
||||||
if ($maxDesc > 0) {
|
if ($maxDesc > 0) {
|
||||||
// TRANS: Form input field instructions.
|
// TRANS: Form input field instructions.
|
||||||
$descInstr = sprintf(_('Describe your application in %d characters'),
|
// TRANS: %d is the number of available characters for the description.
|
||||||
|
$descInstr = sprintf(ngettext('Describe your application in %d character','Describe your application in %d characters',$maxDesc),
|
||||||
$maxDesc);
|
$maxDesc);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Form input field instructions.
|
// TRANS: Form input field instructions.
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StatusNet, the distributed open-source microblogging tool
|
* StatusNet, the distributed open-source microblogging tool
|
||||||
*
|
*
|
||||||
@ -139,7 +138,7 @@ class ApplicationList extends Widget
|
|||||||
$access = ($this->application->access_type & Oauth_application::$writeAccess)
|
$access = ($this->application->access_type & Oauth_application::$writeAccess)
|
||||||
? $readWriteText : $readOnlyText;
|
? $readWriteText : $readOnlyText;
|
||||||
$modifiedDate = common_date_string($appUser->modified);
|
$modifiedDate = common_date_string($appUser->modified);
|
||||||
// TRANS: Used in application list. %1$s is a modified date, %2$s is access type (read-write or read-only)
|
// TRANS: Used in application list. %1$s is a modified date, %2$s is access type ("read-write" or "read-only")
|
||||||
$txt = sprintf(_('Approved %1$s - "%2$s" access.'),$modifiedDate,$access);
|
$txt = sprintf(_('Approved %1$s - "%2$s" access.'),$modifiedDate,$access);
|
||||||
|
|
||||||
$this->out->raw($txt);
|
$this->out->raw($txt);
|
||||||
|
@ -109,7 +109,7 @@ class Atom10Feed extends XMLStringer
|
|||||||
$xs->element('name', null, $name);
|
$xs->element('name', null, $name);
|
||||||
} else {
|
} else {
|
||||||
throw new Atom10FeedException(
|
throw new Atom10FeedException(
|
||||||
'author element must contain a name element.'
|
_('author element must contain a name element.')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,5 +323,4 @@ class Atom10Feed extends XMLStringer
|
|||||||
|
|
||||||
array_push($this->links, $attrs);
|
array_push($this->links, $attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($user, $cur = null, $indent = true) {
|
function __construct($user, $cur = null, $indent = true) {
|
||||||
parent::__construct($cur, $indent);
|
parent::__construct($cur, $indent);
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
@ -49,7 +49,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @see NoticeListItem
|
* @see NoticeListItem
|
||||||
* @see ProfileNoticeList
|
* @see ProfileNoticeList
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AttachmentList extends Widget
|
class AttachmentList extends Widget
|
||||||
{
|
{
|
||||||
/** the current stream of notices being displayed. */
|
/** the current stream of notices being displayed. */
|
||||||
@ -61,7 +60,6 @@ class AttachmentList extends Widget
|
|||||||
*
|
*
|
||||||
* @param Notice $notice stream of notices from DB_DataObject
|
* @param Notice $notice stream of notices from DB_DataObject
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($notice, $out=null)
|
function __construct($notice, $out=null)
|
||||||
{
|
{
|
||||||
parent::__construct($out);
|
parent::__construct($out);
|
||||||
@ -76,7 +74,6 @@ class AttachmentList extends Widget
|
|||||||
*
|
*
|
||||||
* @return int count of notices listed.
|
* @return int count of notices listed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$atts = new File;
|
$atts = new File;
|
||||||
@ -111,7 +108,6 @@ class AttachmentList extends Widget
|
|||||||
*
|
*
|
||||||
* @return NoticeListItem a list item for displaying the notice
|
* @return NoticeListItem a list item for displaying the notice
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function newListItem($attachment)
|
function newListItem($attachment)
|
||||||
{
|
{
|
||||||
return new AttachmentListItem($attachment, $this->out);
|
return new AttachmentListItem($attachment, $this->out);
|
||||||
@ -135,7 +131,6 @@ class AttachmentList extends Widget
|
|||||||
* @see NoticeList
|
* @see NoticeList
|
||||||
* @see ProfileNoticeListItem
|
* @see ProfileNoticeListItem
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AttachmentListItem extends Widget
|
class AttachmentListItem extends Widget
|
||||||
{
|
{
|
||||||
/** The attachment this item will show. */
|
/** The attachment this item will show. */
|
||||||
@ -151,7 +146,6 @@ class AttachmentListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @param Notice $notice The notice we'll display
|
* @param Notice $notice The notice we'll display
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($attachment, $out=null)
|
function __construct($attachment, $out=null)
|
||||||
{
|
{
|
||||||
parent::__construct($out);
|
parent::__construct($out);
|
||||||
@ -185,7 +179,6 @@ class AttachmentListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$this->showStart();
|
$this->showStart();
|
||||||
@ -221,7 +214,6 @@ class AttachmentListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showStart()
|
function showStart()
|
||||||
{
|
{
|
||||||
// XXX: RDFa
|
// XXX: RDFa
|
||||||
@ -236,7 +228,6 @@ class AttachmentListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showEnd()
|
function showEnd()
|
||||||
{
|
{
|
||||||
$this->out->elementEnd('li');
|
$this->out->elementEnd('li');
|
||||||
@ -257,7 +248,7 @@ class Attachment extends AttachmentListItem
|
|||||||
$this->out->elementEnd('div');
|
$this->out->elementEnd('div');
|
||||||
|
|
||||||
if (!empty($this->oembed->author_name) || !empty($this->oembed->provider)) {
|
if (!empty($this->oembed->author_name) || !empty($this->oembed->provider)) {
|
||||||
$this->out->elementStart('div', array('id' => 'oembed_info',
|
$this->out->elementStart('div', array('id' => 'oembed_info',
|
||||||
'class' => 'entry-content'));
|
'class' => 'entry-content'));
|
||||||
if (!empty($this->oembed->author_name)) {
|
if (!empty($this->oembed->author_name)) {
|
||||||
$this->out->elementStart('dl', 'vcard author');
|
$this->out->elementStart('dl', 'vcard author');
|
||||||
@ -438,4 +429,3 @@ class Attachment extends AttachmentListItem
|
|||||||
$this->out->raw('<script>window.location = ' . json_encode($this->attachment->url) . ';</script>');
|
$this->out->raw('<script>window.location = ' . json_encode($this->attachment->url) . ';</script>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AttachmentNoticeSection extends NoticeSection
|
class AttachmentNoticeSection extends NoticeSection
|
||||||
{
|
{
|
||||||
function showContent() {
|
function showContent() {
|
||||||
@ -59,7 +58,7 @@ class AttachmentNoticeSection extends NoticeSection
|
|||||||
$notice->orderBy('created desc');
|
$notice->orderBy('created desc');
|
||||||
$notice->selectAdd('post_id as id');
|
$notice->selectAdd('post_id as id');
|
||||||
$notice->find();
|
$notice->find();
|
||||||
return $notice;
|
return $notice;
|
||||||
}
|
}
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
@ -73,4 +72,3 @@ class AttachmentNoticeSection extends NoticeSection
|
|||||||
return 'popular_notices';
|
return 'popular_notices';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AttachmentTagCloudSection extends TagCloudSection
|
class AttachmentTagCloudSection extends TagCloudSection
|
||||||
{
|
{
|
||||||
function title()
|
function title()
|
||||||
@ -81,4 +80,3 @@ class AttachmentTagCloudSection extends TagCloudSection
|
|||||||
return $notice_tag;
|
return $notice_tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,12 +40,11 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
abstract class AuthenticationPlugin extends Plugin
|
abstract class AuthenticationPlugin extends Plugin
|
||||||
{
|
{
|
||||||
//is this plugin authoritative for authentication?
|
//is this plugin authoritative for authentication?
|
||||||
public $authoritative = false;
|
public $authoritative = false;
|
||||||
|
|
||||||
//should accounts be automatically created after a successful login attempt?
|
//should accounts be automatically created after a successful login attempt?
|
||||||
public $autoregistration = false;
|
public $autoregistration = false;
|
||||||
|
|
||||||
@ -218,12 +217,14 @@ abstract class AuthenticationPlugin extends Plugin
|
|||||||
//stop handling of other handlers, because what was requested was done
|
//stop handling of other handlers, because what was requested was done
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
throw new Exception(_('Password changing failed'));
|
// TRANS: Exception thrown when a password change fails.
|
||||||
|
throw new Exception(_('Password changing failed.'));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if($this->authoritative){
|
if($this->authoritative){
|
||||||
//since we're authoritative, no other plugin could do this
|
//since we're authoritative, no other plugin could do this
|
||||||
throw new Exception(_('Password changing failed'));
|
// TRANS: Exception thrown when a password change fails.
|
||||||
|
throw new Exception(_('Password changing failed.'));
|
||||||
}else{
|
}else{
|
||||||
//let another handler try
|
//let another handler try
|
||||||
return null;
|
return null;
|
||||||
@ -233,7 +234,8 @@ abstract class AuthenticationPlugin extends Plugin
|
|||||||
}else{
|
}else{
|
||||||
if($this->authoritative){
|
if($this->authoritative){
|
||||||
//since we're authoritative, no other plugin could do this
|
//since we're authoritative, no other plugin could do this
|
||||||
throw new Exception(_('Password changing is not allowed'));
|
// TRANS: Exception thrown when a password change attempt fails because it is not allowed.
|
||||||
|
throw new Exception(_('Password changing is not allowed.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,4 +269,3 @@ abstract class AuthenticationPlugin extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
abstract class AuthorizationPlugin extends Plugin
|
abstract class AuthorizationPlugin extends Plugin
|
||||||
{
|
{
|
||||||
//is this plugin authoritative for authorization?
|
//is this plugin authoritative for authorization?
|
||||||
@ -103,4 +102,3 @@ abstract class AuthorizationPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
*
|
*
|
||||||
* @see UnblockForm
|
* @see UnblockForm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BlockForm extends ProfileActionForm
|
class BlockForm extends ProfileActionForm
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -63,7 +62,6 @@ class BlockForm extends ProfileActionForm
|
|||||||
*
|
*
|
||||||
* @return string Title of the form, internationalized
|
* @return string Title of the form, internationalized
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
// TRANS: Title for the form to block a user.
|
// TRANS: Title for the form to block a user.
|
||||||
@ -75,7 +73,6 @@ class BlockForm extends ProfileActionForm
|
|||||||
*
|
*
|
||||||
* @return string description of the form, internationalized
|
* @return string description of the form, internationalized
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function description()
|
function description()
|
||||||
{
|
{
|
||||||
// TRANS: Description of the form to block a user.
|
// TRANS: Description of the form to block a user.
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Cache
|
class Cache
|
||||||
{
|
{
|
||||||
var $_items = array();
|
var $_items = array();
|
||||||
@ -56,7 +55,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return Cache cache object
|
* @return Cache cache object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function instance()
|
static function instance()
|
||||||
{
|
{
|
||||||
if (is_null(self::$_inst)) {
|
if (is_null(self::$_inst)) {
|
||||||
@ -77,7 +75,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return string full key
|
* @return string full key
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function key($extra)
|
static function key($extra)
|
||||||
{
|
{
|
||||||
$base_key = common_config('cache', 'base');
|
$base_key = common_config('cache', 'base');
|
||||||
@ -98,7 +95,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return string keyized string
|
* @return string keyized string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static function keyize($str)
|
static function keyize($str)
|
||||||
{
|
{
|
||||||
$str = strtolower($str);
|
$str = strtolower($str);
|
||||||
@ -115,7 +111,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return string retrieved value or null if unfound
|
* @return string retrieved value or null if unfound
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function get($key)
|
function get($key)
|
||||||
{
|
{
|
||||||
$value = false;
|
$value = false;
|
||||||
@ -140,7 +135,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return boolean success flag
|
* @return boolean success flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function set($key, $value, $flag=null, $expiry=null)
|
function set($key, $value, $flag=null, $expiry=null)
|
||||||
{
|
{
|
||||||
$success = false;
|
$success = false;
|
||||||
@ -192,7 +186,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return boolean success flag
|
* @return boolean success flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function delete($key)
|
function delete($key)
|
||||||
{
|
{
|
||||||
$success = false;
|
$success = false;
|
||||||
@ -214,7 +207,6 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @return boolean success flag
|
* @return boolean success flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function reconnect()
|
function reconnect()
|
||||||
{
|
{
|
||||||
$success = false;
|
$success = false;
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Needs documentation.
|
||||||
|
*/
|
||||||
class Channel
|
class Channel
|
||||||
{
|
{
|
||||||
function on($user)
|
function on($user)
|
||||||
@ -68,7 +71,6 @@ class CLIChannel extends Channel
|
|||||||
|
|
||||||
class XMPPChannel extends Channel
|
class XMPPChannel extends Channel
|
||||||
{
|
{
|
||||||
|
|
||||||
var $conn = null;
|
var $conn = null;
|
||||||
|
|
||||||
function source()
|
function source()
|
||||||
@ -154,6 +156,7 @@ class WebChannel extends Channel
|
|||||||
# depending on what command was run
|
# depending on what command was run
|
||||||
$this->out->startHTML();
|
$this->out->startHTML();
|
||||||
$this->out->elementStart('head');
|
$this->out->elementStart('head');
|
||||||
|
// TRANS: Title for command results.
|
||||||
$this->out->element('title', null, _('Command results'));
|
$this->out->element('title', null, _('Command results'));
|
||||||
$this->out->elementEnd('head');
|
$this->out->elementEnd('head');
|
||||||
$this->out->elementStart('body');
|
$this->out->elementStart('body');
|
||||||
@ -174,6 +177,7 @@ class AjaxWebChannel extends WebChannel
|
|||||||
{
|
{
|
||||||
$this->out->startHTML('text/xml;charset=utf-8');
|
$this->out->startHTML('text/xml;charset=utf-8');
|
||||||
$this->out->elementStart('head');
|
$this->out->elementStart('head');
|
||||||
|
// TRANS: Title for command results.
|
||||||
$this->out->element('title', null, _('Command results'));
|
$this->out->element('title', null, _('Command results'));
|
||||||
$this->out->elementEnd('head');
|
$this->out->elementEnd('head');
|
||||||
$this->out->elementStart('body');
|
$this->out->elementStart('body');
|
||||||
@ -186,7 +190,8 @@ class AjaxWebChannel extends WebChannel
|
|||||||
{
|
{
|
||||||
$this->out->startHTML('text/xml;charset=utf-8');
|
$this->out->startHTML('text/xml;charset=utf-8');
|
||||||
$this->out->elementStart('head');
|
$this->out->elementStart('head');
|
||||||
$this->out->element('title', null, _('Ajax Error'));
|
// TRANS: Title for command results.
|
||||||
|
$this->out->element('title', null, _('AJAX error'));
|
||||||
$this->out->elementEnd('head');
|
$this->out->elementEnd('head');
|
||||||
$this->out->elementStart('body');
|
$this->out->elementStart('body');
|
||||||
$this->out->element('p', array('id' => 'error'), $text);
|
$this->out->element('p', array('id' => 'error'), $text);
|
||||||
@ -197,7 +202,6 @@ class AjaxWebChannel extends WebChannel
|
|||||||
|
|
||||||
class MailChannel extends Channel
|
class MailChannel extends Channel
|
||||||
{
|
{
|
||||||
|
|
||||||
var $addr = null;
|
var $addr = null;
|
||||||
|
|
||||||
function source()
|
function source()
|
||||||
@ -222,10 +226,10 @@ class MailChannel extends Channel
|
|||||||
|
|
||||||
function output($user, $text)
|
function output($user, $text)
|
||||||
{
|
{
|
||||||
|
|
||||||
$headers['From'] = $user->incomingemail;
|
$headers['From'] = $user->incomingemail;
|
||||||
$headers['To'] = $this->addr;
|
$headers['To'] = $this->addr;
|
||||||
|
|
||||||
|
// TRANS: E-mail subject when a command has completed.
|
||||||
$headers['Subject'] = _('Command complete');
|
$headers['Subject'] = _('Command complete');
|
||||||
|
|
||||||
return mail_send(array($this->addr), $headers, $text);
|
return mail_send(array($this->addr), $headers, $text);
|
||||||
@ -233,10 +237,10 @@ class MailChannel extends Channel
|
|||||||
|
|
||||||
function error($user, $text)
|
function error($user, $text)
|
||||||
{
|
{
|
||||||
|
|
||||||
$headers['From'] = $user->incomingemail;
|
$headers['From'] = $user->incomingemail;
|
||||||
$headers['To'] = $this->addr;
|
$headers['To'] = $this->addr;
|
||||||
|
|
||||||
|
// TRANS: E-mail subject when a command has failed.
|
||||||
$headers['Subject'] = _('Command failed');
|
$headers['Subject'] = _('Command failed');
|
||||||
|
|
||||||
return mail_send(array($this->addr), $headers, $text);
|
return mail_send(array($this->addr), $headers, $text);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client error action.
|
* Client error action.
|
||||||
*
|
*
|
||||||
|
@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ClientException extends Exception
|
class ClientException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = null, $code = 400) {
|
public function __construct($message = null, $code = 400) {
|
||||||
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ColumnDef
|
class ColumnDef
|
||||||
{
|
{
|
||||||
/** name of the column. */
|
/** name of the column. */
|
||||||
@ -76,7 +75,6 @@ class ColumnDef
|
|||||||
* @param value $extra unused
|
* @param value $extra unused
|
||||||
* @param boolean $auto_increment
|
* @param boolean $auto_increment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($name=null, $type=null, $size=null,
|
function __construct($name=null, $type=null, $size=null,
|
||||||
$nullable=true, $key=null, $default=null,
|
$nullable=true, $key=null, $default=null,
|
||||||
$extra=null, $auto_increment=false)
|
$extra=null, $auto_increment=false)
|
||||||
@ -99,7 +97,6 @@ class ColumnDef
|
|||||||
*
|
*
|
||||||
* @return boolean true if equivalent, otherwise false.
|
* @return boolean true if equivalent, otherwise false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function equals($other)
|
function equals($other)
|
||||||
{
|
{
|
||||||
return ($this->name == $other->name &&
|
return ($this->name == $other->name &&
|
||||||
@ -122,7 +119,6 @@ class ColumnDef
|
|||||||
*
|
*
|
||||||
* @return boolean true if they're about equivalent
|
* @return boolean true if they're about equivalent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function _typeMatch($other)
|
private function _typeMatch($other)
|
||||||
{
|
{
|
||||||
switch ($this->type) {
|
switch ($this->type) {
|
||||||
@ -145,7 +141,6 @@ class ColumnDef
|
|||||||
*
|
*
|
||||||
* @return boolean true if defaults are effectively the same.
|
* @return boolean true if defaults are effectively the same.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function _defaultMatch($other)
|
private function _defaultMatch($other)
|
||||||
{
|
{
|
||||||
return ((is_null($this->default) && is_null($other->default)) ||
|
return ((is_null($this->default) && is_null($other->default)) ||
|
||||||
@ -160,7 +155,6 @@ class ColumnDef
|
|||||||
*
|
*
|
||||||
* @return boolean true if these columns 'null' the same.
|
* @return boolean true if these columns 'null' the same.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function _nullMatch($other)
|
private function _nullMatch($other)
|
||||||
{
|
{
|
||||||
return ((!is_null($this->default) && !is_null($other->default) &&
|
return ((!is_null($this->default) && !is_null($other->default) &&
|
||||||
|
@ -23,7 +23,6 @@ require_once(INSTALLDIR.'/lib/channel.php');
|
|||||||
|
|
||||||
class Command
|
class Command
|
||||||
{
|
{
|
||||||
|
|
||||||
var $user = null;
|
var $user = null;
|
||||||
|
|
||||||
function __construct($user=null)
|
function __construct($user=null)
|
||||||
@ -49,7 +48,6 @@ class Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override this with the meat!
|
* Override this with the meat!
|
||||||
*
|
*
|
||||||
@ -313,7 +311,6 @@ class FavCommand extends Command
|
|||||||
// TRANS: Text shown when a notice has been marked as favourite successfully.
|
// TRANS: Text shown when a notice has been marked as favourite successfully.
|
||||||
$channel->output($this->user, _('Notice marked as fave.'));
|
$channel->output($this->user, _('Notice marked as fave.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class JoinCommand extends Command
|
class JoinCommand extends Command
|
||||||
@ -361,8 +358,8 @@ class JoinCommand extends Command
|
|||||||
$cur->nickname,
|
$cur->nickname,
|
||||||
$group->nickname));
|
$group->nickname));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DropCommand extends Command
|
class DropCommand extends Command
|
||||||
{
|
{
|
||||||
var $other = null;
|
var $other = null;
|
||||||
@ -409,7 +406,6 @@ class DropCommand extends Command
|
|||||||
$cur->nickname,
|
$cur->nickname,
|
||||||
$group->nickname));
|
$group->nickname));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class WhoisCommand extends Command
|
class WhoisCommand extends Command
|
||||||
@ -471,6 +467,7 @@ class MessageCommand extends Command
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
// TRANS: Command exception text shown when trying to send a direct message to a remote user (a user not registered at the current server).
|
// TRANS: Command exception text shown when trying to send a direct message to a remote user (a user not registered at the current server).
|
||||||
|
// TRANS: %s is a remote profile.
|
||||||
throw new CommandException(sprintf(_('%s is a remote profile; you can only send direct messages to users on the same server.'), $this->other));
|
throw new CommandException(sprintf(_('%s is a remote profile; you can only send direct messages to users on the same server.'), $this->other));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,7 +608,6 @@ class ReplyCommand extends Command
|
|||||||
|
|
||||||
class GetCommand extends Command
|
class GetCommand extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
var $other = null;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other)
|
function __construct($user, $other)
|
||||||
@ -638,7 +634,6 @@ class GetCommand extends Command
|
|||||||
|
|
||||||
class SubCommand extends Command
|
class SubCommand extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
var $other = null;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other)
|
function __construct($user, $other)
|
||||||
@ -678,7 +673,6 @@ class SubCommand extends Command
|
|||||||
|
|
||||||
class UnsubCommand extends Command
|
class UnsubCommand extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
var $other = null;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other)
|
function __construct($user, $other)
|
||||||
@ -712,6 +706,7 @@ class UnsubCommand extends Command
|
|||||||
class OffCommand extends Command
|
class OffCommand extends Command
|
||||||
{
|
{
|
||||||
var $other = null;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other=null)
|
function __construct($user, $other=null)
|
||||||
{
|
{
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
|
@ -272,7 +272,7 @@ class CommandInterpreter
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Split arguments without triggering a PHP notice warning
|
* Split arguments without triggering a PHP notice warning
|
||||||
*/
|
*/
|
||||||
@ -285,4 +285,3 @@ class CommandInterpreter
|
|||||||
return $pieces;
|
return $pieces;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,11 +132,17 @@ try {
|
|||||||
} catch (NoConfigException $e) {
|
} catch (NoConfigException $e) {
|
||||||
// XXX: Throw a conniption if database not installed
|
// XXX: Throw a conniption if database not installed
|
||||||
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
|
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
|
||||||
|
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
|
||||||
echo '<p>'. _('No configuration file found. ') .'</p>';
|
echo '<p>'. _('No configuration file found. ') .'</p>';
|
||||||
echo '<p>'. _('I looked for configuration files in the following places: ') .'<br/> ';
|
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
|
||||||
echo implode($e->configFiles, '<br/>');
|
// TRANS: Is followed by a list of directories (separated by HTML breaks).
|
||||||
|
echo '<p>'. _('I looked for configuration files in the following places: ') .'<br /> ';
|
||||||
|
echo implode($e->configFiles, '<br />');
|
||||||
|
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
|
||||||
echo '<p>'. _('You may wish to run the installer to fix this.') .'</p>';
|
echo '<p>'. _('You may wish to run the installer to fix this.') .'</p>';
|
||||||
|
// @todo FIXME Link should be in a para?
|
||||||
|
// TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
|
||||||
|
// TRANS: The text is link text that leads to the installer page.
|
||||||
echo '<a href="install.php">'. _('Go to the installer.') .'</a>';
|
echo '<a href="install.php">'. _('Go to the installer.') .'</a>';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/settingsaction.php';
|
|||||||
*
|
*
|
||||||
* @see Widget
|
* @see Widget
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConnectSettingsAction extends SettingsAction
|
class ConnectSettingsAction extends SettingsAction
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -54,7 +53,6 @@ class ConnectSettingsAction extends SettingsAction
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showLocalNav()
|
function showLocalNav()
|
||||||
{
|
{
|
||||||
$menu = new ConnectSettingsNav($this);
|
$menu = new ConnectSettingsNav($this);
|
||||||
@ -73,7 +71,6 @@ class ConnectSettingsAction extends SettingsAction
|
|||||||
*
|
*
|
||||||
* @see HTMLOutputter
|
* @see HTMLOutputter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConnectSettingsNav extends Widget
|
class ConnectSettingsNav extends Widget
|
||||||
{
|
{
|
||||||
var $action = null;
|
var $action = null;
|
||||||
@ -83,7 +80,6 @@ class ConnectSettingsNav extends Widget
|
|||||||
*
|
*
|
||||||
* @param Action $action current action, used for output
|
* @param Action $action current action, used for output
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($action=null)
|
function __construct($action=null)
|
||||||
{
|
{
|
||||||
parent::__construct($action);
|
parent::__construct($action);
|
||||||
@ -95,7 +91,6 @@ class ConnectSettingsNav extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$action_name = $this->action->trimmed('action');
|
$action_name = $this->action->trimmed('action');
|
||||||
@ -107,17 +102,23 @@ class ConnectSettingsNav extends Widget
|
|||||||
$menu = array();
|
$menu = array();
|
||||||
if (common_config('xmpp', 'enabled')) {
|
if (common_config('xmpp', 'enabled')) {
|
||||||
$menu['imsettings'] =
|
$menu['imsettings'] =
|
||||||
array(_('IM'),
|
// TRANS: Menu item for Instant Messaging settings.
|
||||||
|
array(_m('MENU','IM'),
|
||||||
|
// TRANS: Tooltip for Instant Messaging menu item.
|
||||||
_('Updates by instant messenger (IM)'));
|
_('Updates by instant messenger (IM)'));
|
||||||
}
|
}
|
||||||
if (common_config('sms', 'enabled')) {
|
if (common_config('sms', 'enabled')) {
|
||||||
$menu['smssettings'] =
|
$menu['smssettings'] =
|
||||||
array(_('SMS'),
|
// TRANS: Menu item for Short Message Service settings.
|
||||||
|
array(_m('MENU','SMS'),
|
||||||
|
// TRANS: Tooltip for Short Message Service menu item.
|
||||||
_('Updates by SMS'));
|
_('Updates by SMS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu['oauthconnectionssettings'] = array(
|
$menu['oauthconnectionssettings'] = array(
|
||||||
_('Connections'),
|
// TRANS: Menu item for OAth connection settings.
|
||||||
|
_m('MENU','Connections'),
|
||||||
|
// TRANS: Tooltip for connected applications (Connections through OAth) menu item.
|
||||||
_('Authorized connected applications')
|
_('Authorized connected applications')
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -133,6 +134,4 @@ class ConnectSettingsNav extends Widget
|
|||||||
|
|
||||||
$this->action->elementEnd('ul');
|
$this->action->elementEnd('ul');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CurrentUserDesignAction extends Action
|
class CurrentUserDesignAction extends Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -54,7 +53,6 @@ class CurrentUserDesignAction extends Action
|
|||||||
*
|
*
|
||||||
* @return Design a design object to use
|
* @return Design a design object to use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getDesign()
|
function getDesign()
|
||||||
{
|
{
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user