replace NULL with null
Another global search-and-replace update. Here, I've replaced the PHP keyword 'NULL' with its lowercase version. This is another PEAR code standards change. darcs-hash:20081223192129-84dde-4a0182e0ec16a01ad88745ad3e08f7cb501aee0b.gz
This commit is contained in:
parent
edbc0c665c
commit
eb2f9c98ac
@ -60,3 +60,11 @@ Evan Prodromou <evan@prodromou.name>**20081223191907
|
|||||||
readability, and that means more participation.
|
readability, and that means more participation.
|
||||||
|
|
||||||
]
|
]
|
||||||
|
[replace NULL with null
|
||||||
|
Evan Prodromou <evan@prodromou.name>**20081223192129
|
||||||
|
|
||||||
|
Another global search-and-replace update. Here, I've replaced the PHP
|
||||||
|
keyword 'NULL' with its lowercase version. This is another PEAR code
|
||||||
|
standards change.
|
||||||
|
|
||||||
|
]
|
Binary file not shown.
@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
|||||||
|
|
||||||
class AllrssAction extends Rss10Action {
|
class AllrssAction extends Rss10Action {
|
||||||
|
|
||||||
var $user = NULL;
|
var $user = null;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
@ -69,9 +69,9 @@ class AllrssAction extends Rss10Action {
|
|||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
return ($avatar) ? $avatar->url : NULL;
|
return ($avatar) ? $avatar->url : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -152,8 +152,8 @@ class ApiAction extends Action {
|
|||||||
header('Content-Type: application/xml; charset=utf-8');
|
header('Content-Type: application/xml; charset=utf-8');
|
||||||
common_start_xml();
|
common_start_xml();
|
||||||
common_element_start('hash');
|
common_element_start('hash');
|
||||||
common_element('error', NULL, $msg);
|
common_element('error', null, $msg);
|
||||||
common_element('request', NULL, $_SERVER['REQUEST_URI']);
|
common_element('request', null, $_SERVER['REQUEST_URI']);
|
||||||
common_element_end('hash');
|
common_element_end('hash');
|
||||||
common_end_xml();
|
common_end_xml();
|
||||||
} else if ($this->content_type == 'json') {
|
} else if ($this->content_type == 'json') {
|
||||||
|
@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
|
|||||||
|
|
||||||
class BlockAction extends Action {
|
class BlockAction extends Action {
|
||||||
|
|
||||||
var $profile = NULL;
|
var $profile = null;
|
||||||
|
|
||||||
function prepare($args) {
|
function prepare($args) {
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class BlockAction extends Action {
|
|||||||
|
|
||||||
common_show_header(_('Block user'));
|
common_show_header(_('Block user'));
|
||||||
|
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Are you sure you want to block this user? '.
|
_('Are you sure you want to block this user? '.
|
||||||
'Afterwards, they will be unsubscribed from you, '.
|
'Afterwards, they will be unsubscribed from you, '.
|
||||||
'unable to subscribe to you in the future, and '.
|
'unable to subscribe to you in the future, and '.
|
||||||
|
@ -88,7 +88,7 @@ class ConfirmaddressAction extends Action {
|
|||||||
$cur->query('COMMIT');
|
$cur->query('COMMIT');
|
||||||
|
|
||||||
common_show_header(_('Confirm Address'));
|
common_show_header(_('Confirm Address'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type));
|
sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type));
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class DeletenoticeAction extends DeleteAction {
|
|||||||
return _('Delete notice');
|
return _('Delete notice');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL) {
|
function show_form($error=null) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
common_show_header($this->get_title(), array($this, 'show_header'), $error,
|
common_show_header($this->get_title(), array($this, 'show_header'), $error,
|
||||||
@ -91,7 +91,7 @@ class DeletenoticeAction extends DeleteAction {
|
|||||||
$notice->delete();
|
$notice->delete();
|
||||||
} else {
|
} else {
|
||||||
if ($url) {
|
if ($url) {
|
||||||
common_set_returnto(NULL);
|
common_set_returnto(null);
|
||||||
} else {
|
} else {
|
||||||
$url = common_local_url('public');
|
$url = common_local_url('public');
|
||||||
}
|
}
|
||||||
|
@ -36,9 +36,9 @@ class DeleteprofileAction extends Action {
|
|||||||
return _('Export and delete your user information.');
|
return _('Export and delete your user information.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_header($title, $msg=NULL, $success=false) {
|
function form_header($title, $msg=null, $success=false) {
|
||||||
common_show_header($title,
|
common_show_header($title,
|
||||||
NULL,
|
null,
|
||||||
array($msg, $success),
|
array($msg, $success),
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
}
|
}
|
||||||
@ -84,9 +84,9 @@ class DeleteprofileAction extends Action {
|
|||||||
common_element_end('li');
|
common_element_end('li');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$this->form_header(_('Delete my account'), $msg, $success);
|
$this->form_header(_('Delete my account'), $msg, $success);
|
||||||
common_element('h2', NULL, _('Delete my account confirmation'));
|
common_element('h2', null, _('Delete my account confirmation'));
|
||||||
$this->show_confirm_delete_form();
|
$this->show_confirm_delete_form();
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ class DeleteprofileAction extends Action {
|
|||||||
$n_users_deleted = $user->delete();
|
$n_users_deleted = $user->delete();
|
||||||
|
|
||||||
// logout and redirect to public
|
// logout and redirect to public
|
||||||
common_set_user(NULL);
|
common_set_user(null);
|
||||||
common_real_login(false); # not logged in
|
common_real_login(false); # not logged in
|
||||||
common_forgetme(); # don't log back in!
|
common_forgetme(); # don't log back in!
|
||||||
common_redirect(common_local_url('public'));
|
common_redirect(common_local_url('public'));
|
||||||
|
@ -27,7 +27,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
return _('Manage how you get email from %%site.name%%.');
|
return _('Manage how you get email from %%site.name%%.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
$this->form_header(_('Email Settings'), $msg, $success);
|
$this->form_header(_('Email Settings'), $msg, $success);
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
@ -36,7 +36,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
common_local_url('emailsettings')));
|
common_local_url('emailsettings')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
|
|
||||||
common_element('h2', NULL, _('Address'));
|
common_element('h2', null, _('Address'));
|
||||||
|
|
||||||
if ($user->email) {
|
if ($user->email) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -58,14 +58,14 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
common_submit('cancel', _('Cancel'));
|
common_submit('cancel', _('Cancel'));
|
||||||
} else {
|
} else {
|
||||||
common_input('email', _('Email Address'),
|
common_input('email', _('Email Address'),
|
||||||
($this->arg('email')) ? $this->arg('email') : NULL,
|
($this->arg('email')) ? $this->arg('email') : null,
|
||||||
_('Email address, like "UserName@example.org"'));
|
_('Email address, like "UserName@example.org"'));
|
||||||
common_submit('add', _('Add'));
|
common_submit('add', _('Add'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->email) {
|
if ($user->email) {
|
||||||
common_element('h2', NULL, _('Incoming email'));
|
common_element('h2', null, _('Incoming email'));
|
||||||
|
|
||||||
if ($user->incomingemail) {
|
if ($user->incomingemail) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -83,7 +83,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
common_submit('newincoming', _('New'));
|
common_submit('newincoming', _('New'));
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element('h2', NULL, _('Preferences'));
|
common_element('h2', null, _('Preferences'));
|
||||||
|
|
||||||
common_checkbox('emailnotifysub',
|
common_checkbox('emailnotifysub',
|
||||||
_('Send me notices of new subscriptions through email.'),
|
_('Send me notices of new subscriptions through email.'),
|
||||||
@ -118,7 +118,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
if ($confirm->find(TRUE)) {
|
if ($confirm->find(TRUE)) {
|
||||||
return $confirm;
|
return $confirm;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
$user->query('BEGIN');
|
$user->query('BEGIN');
|
||||||
$original = clone($user);
|
$original = clone($user);
|
||||||
$user->email = NULL;
|
$user->email = null;
|
||||||
$result = $user->updateKeys($original);
|
$result = $user->updateKeys($original);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
@ -294,7 +294,7 @@ class EmailsettingsAction extends SettingsAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$orig = clone($user);
|
$orig = clone($user);
|
||||||
$user->incomingemail = NULL;
|
$user->incomingemail = null;
|
||||||
|
|
||||||
if (!$user->updateKeys($orig)) {
|
if (!$user->updateKeys($orig)) {
|
||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
|
@ -29,7 +29,7 @@ class FavoritedAction extends StreamAction {
|
|||||||
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
|
||||||
common_show_header(_('Popular notices'),
|
common_show_header(_('Popular notices'),
|
||||||
array($this, 'show_header'), NULL,
|
array($this, 'show_header'), null,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
$this->show_notices($page);
|
$this->show_notices($page);
|
||||||
|
@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
|||||||
|
|
||||||
class FavoritesrssAction extends Rss10Action {
|
class FavoritesrssAction extends Rss10Action {
|
||||||
|
|
||||||
var $user = NULL;
|
var $user = null;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
@ -68,6 +68,6 @@ class FavoritesrssAction extends Rss10Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_image() {
|
function get_image() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,7 +30,7 @@ class FeaturedAction extends StreamAction {
|
|||||||
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
|
||||||
common_show_header(_('Featured users'),
|
common_show_header(_('Featured users'),
|
||||||
array($this, 'show_header'), NULL,
|
array($this, 'show_header'), null,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
$this->show_notices($page);
|
$this->show_notices($page);
|
||||||
|
@ -97,7 +97,7 @@ class FinishaddopenidAction extends Action {
|
|||||||
|
|
||||||
function message($msg) {
|
function message($msg) {
|
||||||
common_show_header(_('OpenID Login'));
|
common_show_header(_('OpenID Login'));
|
||||||
common_element('p', NULL, $msg);
|
common_element('p', null, $msg);
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class FinishopenidloginAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($error=NULL) {
|
function show_top($error=null) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('div', array('class' => 'error'), $error);
|
common_element('div', array('class' => 'error'), $error);
|
||||||
} else {
|
} else {
|
||||||
@ -62,17 +62,17 @@ class FinishopenidloginAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL, $username=NULL) {
|
function show_form($error=null, $username=null) {
|
||||||
common_show_header(_('OpenID Account Setup'), NULL, $error,
|
common_show_header(_('OpenID Account Setup'), null, $error,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'account_connect',
|
'id' => 'account_connect',
|
||||||
'action' => common_local_url('finishopenidlogin')));
|
'action' => common_local_url('finishopenidlogin')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
common_element('h2', NULL,
|
common_element('h2', null,
|
||||||
_('Create new account'));
|
_('Create new account'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Create a new user with this nickname.'));
|
_('Create a new user with this nickname.'));
|
||||||
common_input('newname', _('New nickname'),
|
common_input('newname', _('New nickname'),
|
||||||
($username) ? $username : '',
|
($username) ? $username : '',
|
||||||
@ -88,9 +88,9 @@ class FinishopenidloginAction extends Action {
|
|||||||
common_text(_(' except this private data: password, email address, IM address, phone number.'));
|
common_text(_(' except this private data: password, email address, IM address, phone number.'));
|
||||||
common_element_end('p');
|
common_element_end('p');
|
||||||
common_submit('create', _('Create'));
|
common_submit('create', _('Create'));
|
||||||
common_element('h2', NULL,
|
common_element('h2', null,
|
||||||
_('Connect existing account'));
|
_('Connect existing account'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('If you already have an account, login with your username and password to connect it to your OpenID.'));
|
_('If you already have an account, login with your username and password to connect it to your OpenID.'));
|
||||||
common_input('nickname', _('Existing nickname'));
|
common_input('nickname', _('Existing nickname'));
|
||||||
common_password('password', _('Password'));
|
common_password('password', _('Password'));
|
||||||
@ -141,14 +141,14 @@ class FinishopenidloginAction extends Action {
|
|||||||
$this->go_home($user->nickname);
|
$this->go_home($user->nickname);
|
||||||
} else {
|
} else {
|
||||||
$this->save_values($display, $canonical, $sreg);
|
$this->save_values($display, $canonical, $sreg);
|
||||||
$this->show_form(NULL, $this->best_new_nickname($display, $sreg));
|
$this->show_form(null, $this->best_new_nickname($display, $sreg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function message($msg) {
|
function message($msg) {
|
||||||
common_show_header(_('OpenID Login'));
|
common_show_header(_('OpenID Login'));
|
||||||
common_element('p', NULL, $msg);
|
common_element('p', null, $msg);
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ class FinishopenidloginAction extends Action {
|
|||||||
$url = common_get_returnto();
|
$url = common_get_returnto();
|
||||||
if ($url) {
|
if ($url) {
|
||||||
# We don't have to return to it again
|
# We don't have to return to it again
|
||||||
common_set_returnto(NULL);
|
common_set_returnto(null);
|
||||||
} else {
|
} else {
|
||||||
$url = common_local_url('all',
|
$url = common_local_url('all',
|
||||||
array('nickname' =>
|
array('nickname' =>
|
||||||
@ -329,7 +329,7 @@ class FinishopenidloginAction extends Action {
|
|||||||
|
|
||||||
# XXX: others?
|
# XXX: others?
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_new_nickname($str) {
|
function is_new_nickname($str) {
|
||||||
@ -369,7 +369,7 @@ class FinishopenidloginAction extends Action {
|
|||||||
|
|
||||||
foreach ($bad as $badpart) {
|
foreach ($bad as $badpart) {
|
||||||
if (array_key_exists($badpart, $parts)) {
|
if (array_key_exists($badpart, $parts)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,14 +403,14 @@ class FinishopenidloginAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function xri_to_nickname($xri) {
|
function xri_to_nickname($xri) {
|
||||||
$base = $this->xri_base($xri);
|
$base = $this->xri_base($xri);
|
||||||
|
|
||||||
if (!$base) {
|
if (!$base) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
# =evan.prodromou
|
# =evan.prodromou
|
||||||
# or @gratis*evan.prodromou
|
# or @gratis*evan.prodromou
|
||||||
|
@ -278,7 +278,7 @@ class FinishremotesubscribeAction extends Action {
|
|||||||
common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__);
|
common_debug('got result: "'.print_r($result,TRUE).'"', __FILE__);
|
||||||
|
|
||||||
if ($result->status != 200) {
|
if ($result->status != 200) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_str($result->body, $return);
|
parse_str($result->body, $return);
|
||||||
|
@ -66,21 +66,21 @@ class FoafAction extends Action {
|
|||||||
# XXX: might not be a person
|
# XXX: might not be a person
|
||||||
common_element_start('Person', array('rdf:about' =>
|
common_element_start('Person', array('rdf:about' =>
|
||||||
$user->uri));
|
$user->uri));
|
||||||
common_element('mbox_sha1sum', NULL, sha1('mailto:' . $user->email));
|
common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email));
|
||||||
if ($profile->fullname) {
|
if ($profile->fullname) {
|
||||||
common_element('name', NULL, $profile->fullname);
|
common_element('name', null, $profile->fullname);
|
||||||
}
|
}
|
||||||
if ($profile->homepage) {
|
if ($profile->homepage) {
|
||||||
common_element('homepage', array('rdf:resource' => $profile->homepage));
|
common_element('homepage', array('rdf:resource' => $profile->homepage));
|
||||||
}
|
}
|
||||||
if ($profile->bio) {
|
if ($profile->bio) {
|
||||||
common_element('rdfs:comment', NULL, $profile->bio);
|
common_element('rdfs:comment', null, $profile->bio);
|
||||||
}
|
}
|
||||||
# XXX: more structured location data
|
# XXX: more structured location data
|
||||||
if ($profile->location) {
|
if ($profile->location) {
|
||||||
common_element_start('based_near');
|
common_element_start('based_near');
|
||||||
common_element_start('geo:SpatialThing');
|
common_element_start('geo:SpatialThing');
|
||||||
common_element('name', NULL, $profile->location);
|
common_element('name', null, $profile->location);
|
||||||
common_element_end('geo:SpatialThing');
|
common_element_end('geo:SpatialThing');
|
||||||
common_element_end('based_near');
|
common_element_end('based_near');
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ class FoafAction extends Action {
|
|||||||
common_element_end('Person');
|
common_element_end('Person');
|
||||||
|
|
||||||
foreach ($person as $uri => $p) {
|
foreach ($person as $uri => $p) {
|
||||||
$foaf_url = NULL;
|
$foaf_url = null;
|
||||||
if ($p[1] instanceof User) {
|
if ($p[1] instanceof User) {
|
||||||
$foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname));
|
$foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname));
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ class FoafAction extends Action {
|
|||||||
common_element('knows', array('rdf:resource' => $user->uri));
|
common_element('knows', array('rdf:resource' => $user->uri));
|
||||||
}
|
}
|
||||||
$this->show_microblogging_account($profile, ($p[1] instanceof User) ?
|
$this->show_microblogging_account($profile, ($p[1] instanceof User) ?
|
||||||
common_root_url() : NULL);
|
common_root_url() : null);
|
||||||
if ($foaf_url) {
|
if ($foaf_url) {
|
||||||
common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url));
|
common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url));
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ class FoafAction extends Action {
|
|||||||
common_element_end('PersonalProfileDocument');
|
common_element_end('PersonalProfileDocument');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_microblogging_account($profile, $service=NULL) {
|
function show_microblogging_account($profile, $service=null) {
|
||||||
# Their account
|
# Their account
|
||||||
common_element_start('holdsAccount');
|
common_element_start('holdsAccount');
|
||||||
common_element_start('OnlineAccount');
|
common_element_start('OnlineAccount');
|
||||||
@ -194,7 +194,7 @@ class FoafAction extends Action {
|
|||||||
common_element('accountServiceHomepage', array('rdf:resource' =>
|
common_element('accountServiceHomepage', array('rdf:resource' =>
|
||||||
$service));
|
$service));
|
||||||
}
|
}
|
||||||
common_element('accountName', NULL, $profile->nickname);
|
common_element('accountName', null, $profile->nickname);
|
||||||
common_element('homepage', array('rdf:resource' => $profile->profileurl));
|
common_element('homepage', array('rdf:resource' => $profile->profileurl));
|
||||||
common_element_end('OnlineAccount');
|
common_element_end('OnlineAccount');
|
||||||
common_element_end('holdsAccount');
|
common_element_end('holdsAccount');
|
||||||
|
@ -28,7 +28,7 @@ class ImsettingsAction extends SettingsAction {
|
|||||||
return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.');
|
return _('You can send and receive notices through Jabber/GTalk [instant messages](%%doc.im%%). Configure your address and settings below.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
$this->form_header(_('IM Settings'), $msg, $success);
|
$this->form_header(_('IM Settings'), $msg, $success);
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
@ -37,7 +37,7 @@ class ImsettingsAction extends SettingsAction {
|
|||||||
common_local_url('imsettings')));
|
common_local_url('imsettings')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
|
|
||||||
common_element('h2', NULL, _('Address'));
|
common_element('h2', null, _('Address'));
|
||||||
|
|
||||||
if ($user->jabber) {
|
if ($user->jabber) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -59,13 +59,13 @@ class ImsettingsAction extends SettingsAction {
|
|||||||
common_submit('cancel', _('Cancel'));
|
common_submit('cancel', _('Cancel'));
|
||||||
} else {
|
} else {
|
||||||
common_input('jabber', _('IM Address'),
|
common_input('jabber', _('IM Address'),
|
||||||
($this->arg('jabber')) ? $this->arg('jabber') : NULL,
|
($this->arg('jabber')) ? $this->arg('jabber') : null,
|
||||||
sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address()));
|
sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address()));
|
||||||
common_submit('add', _('Add'));
|
common_submit('add', _('Add'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element('h2', NULL, _('Preferences'));
|
common_element('h2', null, _('Preferences'));
|
||||||
|
|
||||||
common_checkbox('jabbernotify',
|
common_checkbox('jabbernotify',
|
||||||
_('Send me notices through Jabber/GTalk.'),
|
_('Send me notices through Jabber/GTalk.'),
|
||||||
@ -93,7 +93,7 @@ class ImsettingsAction extends SettingsAction {
|
|||||||
if ($confirm->find(TRUE)) {
|
if ($confirm->find(TRUE)) {
|
||||||
return $confirm;
|
return $confirm;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ class ImsettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
$user->query('BEGIN');
|
$user->query('BEGIN');
|
||||||
$original = clone($user);
|
$original = clone($user);
|
||||||
$user->jabber = NULL;
|
$user->jabber = null;
|
||||||
$result = $user->updateKeys($original);
|
$result = $user->updateKeys($original);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
|
@ -85,49 +85,49 @@ class InviteAction extends Action {
|
|||||||
|
|
||||||
common_show_header(_('Invitation(s) sent'));
|
common_show_header(_('Invitation(s) sent'));
|
||||||
if ($already) {
|
if ($already) {
|
||||||
common_element('p', NULL, _('You are already subscribed to these users:'));
|
common_element('p', null, _('You are already subscribed to these users:'));
|
||||||
common_element_start('ul');
|
common_element_start('ul');
|
||||||
foreach ($already as $other) {
|
foreach ($already as $other) {
|
||||||
common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
||||||
}
|
}
|
||||||
common_element_end('ul');
|
common_element_end('ul');
|
||||||
}
|
}
|
||||||
if ($subbed) {
|
if ($subbed) {
|
||||||
common_element('p', NULL, _('These people are already users and you were automatically subscribed to them:'));
|
common_element('p', null, _('These people are already users and you were automatically subscribed to them:'));
|
||||||
common_element_start('ul');
|
common_element_start('ul');
|
||||||
foreach ($subbed as $other) {
|
foreach ($subbed as $other) {
|
||||||
common_element('li', NULL, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
||||||
}
|
}
|
||||||
common_element_end('ul');
|
common_element_end('ul');
|
||||||
}
|
}
|
||||||
if ($sent) {
|
if ($sent) {
|
||||||
common_element('p', NULL, _('Invitation(s) sent to the following people:'));
|
common_element('p', null, _('Invitation(s) sent to the following people:'));
|
||||||
common_element_start('ul');
|
common_element_start('ul');
|
||||||
foreach ($sent as $other) {
|
foreach ($sent as $other) {
|
||||||
common_element('li', NULL, $other);
|
common_element('li', null, $other);
|
||||||
}
|
}
|
||||||
common_element_end('ul');
|
common_element_end('ul');
|
||||||
common_element('p', NULL, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!'));
|
common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!'));
|
||||||
}
|
}
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($error=NULL) {
|
function show_top($error=null) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('p', 'error', $error);
|
common_element('p', 'error', $error);
|
||||||
} else {
|
} else {
|
||||||
common_element_start('div', 'instructions');
|
common_element_start('div', 'instructions');
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Use this form to invite your friends and colleagues to use this service.'));
|
_('Use this form to invite your friends and colleagues to use this service.'));
|
||||||
common_element_end('div');
|
common_element_end('div');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL) {
|
function show_form($error=null) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
common_show_header(_('Invite new users'), NULL, $error, array($this, 'show_top'));
|
common_show_header(_('Invite new users'), null, $error, array($this, 'show_top'));
|
||||||
|
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'invite',
|
'id' => 'invite',
|
||||||
|
@ -63,7 +63,7 @@ class LoginAction extends Action {
|
|||||||
$url = common_get_returnto();
|
$url = common_get_returnto();
|
||||||
if ($url) {
|
if ($url) {
|
||||||
# We don't have to return to it again
|
# We don't have to return to it again
|
||||||
common_set_returnto(NULL);
|
common_set_returnto(null);
|
||||||
} else {
|
} else {
|
||||||
$url = common_local_url('all',
|
$url = common_local_url('all',
|
||||||
array('nickname' =>
|
array('nickname' =>
|
||||||
@ -91,7 +91,7 @@ class LoginAction extends Action {
|
|||||||
$url = common_get_returnto();
|
$url = common_get_returnto();
|
||||||
if ($url) {
|
if ($url) {
|
||||||
# We don't have to return to it again
|
# We don't have to return to it again
|
||||||
common_set_returnto(NULL);
|
common_set_returnto(null);
|
||||||
} else {
|
} else {
|
||||||
$url = common_local_url('all',
|
$url = common_local_url('all',
|
||||||
array('nickname' =>
|
array('nickname' =>
|
||||||
@ -100,8 +100,8 @@ class LoginAction extends Action {
|
|||||||
common_redirect($url);
|
common_redirect($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL) {
|
function show_form($error=null) {
|
||||||
common_show_header(_('Login'), NULL, $error, array($this, 'show_top'));
|
common_show_header(_('Login'), null, $error, array($this, 'show_top'));
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'login',
|
'id' => 'login',
|
||||||
'action' => common_local_url('login')));
|
'action' => common_local_url('login')));
|
||||||
@ -138,7 +138,7 @@ class LoginAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($error=NULL) {
|
function show_top($error=null) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('p', 'error', $error);
|
common_element('p', 'error', $error);
|
||||||
} else {
|
} else {
|
||||||
|
@ -32,7 +32,7 @@ class LogoutAction extends Action {
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
common_user_error(_('Not logged in.'));
|
common_user_error(_('Not logged in.'));
|
||||||
} else {
|
} else {
|
||||||
common_set_user(NULL);
|
common_set_user(null);
|
||||||
common_real_login(false); # not logged in
|
common_real_login(false); # not logged in
|
||||||
common_forgetme(); # don't log back in!
|
common_forgetme(); # don't log back in!
|
||||||
common_redirect(common_local_url('public'));
|
common_redirect(common_local_url('public'));
|
||||||
|
@ -98,7 +98,7 @@ class NewmessageAction extends Action {
|
|||||||
common_message_form($content, $user, $to);
|
common_message_form($content, $user, $to);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL) {
|
function show_form($msg=null) {
|
||||||
|
|
||||||
$content = $this->trimmed('content');
|
$content = $this->trimmed('content');
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -117,7 +117,7 @@ class NewmessageAction extends Action {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
common_show_header(_('New message'), NULL,
|
common_show_header(_('New message'), null,
|
||||||
array($content, $user, $other),
|
array($content, $user, $other),
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class NewnoticeAction extends Action {
|
|||||||
|
|
||||||
$replyto = $this->trimmed('inreplyto');
|
$replyto = $this->trimmed('inreplyto');
|
||||||
|
|
||||||
$notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? NULL : $replyto);
|
$notice = Notice::saveNew($user->id, $content, 'web', 1, ($replyto == 'false') ? null : $replyto);
|
||||||
|
|
||||||
if (is_string($notice)) {
|
if (is_string($notice)) {
|
||||||
$this->show_form($notice);
|
$this->show_form($notice);
|
||||||
@ -121,11 +121,11 @@ class NewnoticeAction extends Action {
|
|||||||
common_element_end('html');
|
common_element_end('html');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($content=NULL) {
|
function show_top($content=null) {
|
||||||
common_notice_form(NULL, $content);
|
common_notice_form(null, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL) {
|
function show_form($msg=null) {
|
||||||
if ($msg && $this->boolean('ajax')) {
|
if ($msg && $this->boolean('ajax')) {
|
||||||
$this->ajax_error_msg($msg);
|
$this->ajax_error_msg($msg);
|
||||||
return;
|
return;
|
||||||
@ -138,7 +138,7 @@ class NewnoticeAction extends Action {
|
|||||||
$content = '@' . $profile->nickname . ' ';
|
$content = '@' . $profile->nickname . ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
common_show_header(_('New notice'), NULL, $content,
|
common_show_header(_('New notice'), null, $content,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
if ($msg) {
|
if ($msg) {
|
||||||
common_element('p', array('id' => 'error'), $msg);
|
common_element('p', array('id' => 'error'), $msg);
|
||||||
|
@ -65,6 +65,6 @@ class NoticesearchrssAction extends Rss10Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_image() {
|
function get_image() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class OpenidloginAction extends Action {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$openid_url = oid_get_last();
|
$openid_url = oid_get_last();
|
||||||
$this->show_form(NULL, $openid_url);
|
$this->show_form(null, $openid_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class OpenidloginAction extends Action {
|
|||||||
return _('Login with an [OpenID](%%doc.openid%%) account.');
|
return _('Login with an [OpenID](%%doc.openid%%) account.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($error=NULL) {
|
function show_top($error=null) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('div', array('class' => 'error'), $error);
|
common_element('div', array('class' => 'error'), $error);
|
||||||
} else {
|
} else {
|
||||||
@ -72,8 +72,8 @@ class OpenidloginAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL, $openid_url) {
|
function show_form($error=null, $openid_url) {
|
||||||
common_show_header(_('OpenID Login'), NULL, $error, array($this, 'show_top'));
|
common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top'));
|
||||||
$formaction = common_local_url('openidlogin');
|
$formaction = common_local_url('openidlogin');
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'openidlogin',
|
'id' => 'openidlogin',
|
||||||
|
@ -30,7 +30,7 @@ class OpenidsettingsAction extends SettingsAction {
|
|||||||
' Manage your associated OpenIDs from here.');
|
' Manage your associated OpenIDs from here.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ class OpenidsettingsAction extends SettingsAction {
|
|||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('openidsettings')));
|
common_local_url('openidsettings')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
common_element('h2', NULL, _('Add OpenID'));
|
common_element('h2', null, _('Add OpenID'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('If you want to add an OpenID to your account, ' .
|
_('If you want to add an OpenID to your account, ' .
|
||||||
'enter it in the box below and click "Add".'));
|
'enter it in the box below and click "Add".'));
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -66,11 +66,11 @@ class OpenidsettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
if ($cnt > 0) {
|
if ($cnt > 0) {
|
||||||
|
|
||||||
common_element('h2', NULL, _('Remove OpenID'));
|
common_element('h2', null, _('Remove OpenID'));
|
||||||
|
|
||||||
if ($cnt == 1 && !$user->password) {
|
if ($cnt == 1 && !$user->password) {
|
||||||
|
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Removing your only OpenID would make it impossible to log in! ' .
|
_('Removing your only OpenID would make it impossible to log in! ' .
|
||||||
'If you need to remove it, add another OpenID first.'));
|
'If you need to remove it, add another OpenID first.'));
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class OpenidsettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('You can remove an OpenID from your account '.
|
_('You can remove an OpenID from your account '.
|
||||||
'by clicking the button marked "Remove".'));
|
'by clicking the button marked "Remove".'));
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
|
@ -42,16 +42,16 @@ class OpensearchAction extends Action {
|
|||||||
common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/'));
|
common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/'));
|
||||||
|
|
||||||
$short_name = common_config('site', 'name').' '.$short_name;
|
$short_name = common_config('site', 'name').' '.$short_name;
|
||||||
common_element('ShortName', NULL, $short_name);
|
common_element('ShortName', null, $short_name);
|
||||||
common_element('Contact', NULL, common_config('site', 'email'));
|
common_element('Contact', null, common_config('site', 'email'));
|
||||||
common_element('Url', array('type' => 'text/html', 'method' => 'get',
|
common_element('Url', array('type' => 'text/html', 'method' => 'get',
|
||||||
'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---')))));
|
'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---')))));
|
||||||
common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
|
common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
|
||||||
common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png'));
|
common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png'));
|
||||||
common_element('AdultContent', NULL, 'false');
|
common_element('AdultContent', null, 'false');
|
||||||
common_element('Language', NULL, common_language());
|
common_element('Language', null, common_language());
|
||||||
common_element('OutputEncoding', NULL, 'UTF-8');
|
common_element('OutputEncoding', null, 'UTF-8');
|
||||||
common_element('InputEncoding', NULL, 'UTF-8');
|
common_element('InputEncoding', null, 'UTF-8');
|
||||||
|
|
||||||
common_element_end('OpenSearchDescription');
|
common_element_end('OpenSearchDescription');
|
||||||
common_end_xml();
|
common_end_xml();
|
||||||
|
@ -27,12 +27,12 @@ class OthersettingsAction extends SettingsAction {
|
|||||||
return _('Manage various other options.');
|
return _('Manage various other options.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
$this->form_header(_('Other Settings'), $msg, $success);
|
$this->form_header(_('Other Settings'), $msg, $success);
|
||||||
|
|
||||||
common_element('h2', NULL, _('URL Auto-shortening'));
|
common_element('h2', null, _('URL Auto-shortening'));
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'othersettings',
|
'id' => 'othersettings',
|
||||||
'action' =>
|
'action' =>
|
||||||
@ -57,7 +57,7 @@ class OthersettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
common_element_end('form');
|
common_element_end('form');
|
||||||
|
|
||||||
// common_element('h2', NULL, _('Delete my account'));
|
// common_element('h2', null, _('Delete my account'));
|
||||||
// $this->show_delete_form();
|
// $this->show_delete_form();
|
||||||
|
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
|
@ -68,8 +68,8 @@ class PeoplesearchAction extends SearchAction {
|
|||||||
|
|
||||||
class PeopleSearchResults extends ProfileList {
|
class PeopleSearchResults extends ProfileList {
|
||||||
|
|
||||||
var $terms = NULL;
|
var $terms = null;
|
||||||
var $pattern = NULL;
|
var $pattern = null;
|
||||||
|
|
||||||
function __construct($profile, $terms) {
|
function __construct($profile, $terms) {
|
||||||
parent::__construct($profile);
|
parent::__construct($profile);
|
||||||
|
@ -43,7 +43,7 @@ class PeopletagAction extends Action {
|
|||||||
# Looks like we're good; show the header
|
# Looks like we're good; show the header
|
||||||
|
|
||||||
common_show_header(sprintf(_('Users self-tagged with %s - page %d'), $tag, $page),
|
common_show_header(sprintf(_('Users self-tagged with %s - page %d'), $tag, $page),
|
||||||
NULL, $tag, array($this, 'show_top'));
|
null, $tag, array($this, 'show_top'));
|
||||||
|
|
||||||
$this->show_people($tag, $page);
|
$this->show_people($tag, $page);
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class PeopletagAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_title() {
|
function get_title() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_header($arr) {
|
function show_header($arr) {
|
||||||
|
@ -28,14 +28,14 @@ class ProfilesettingsAction extends SettingsAction {
|
|||||||
'so people know more about you.');
|
'so people know more about you.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$this->form_header(_('Profile settings'), $msg, $success);
|
$this->form_header(_('Profile settings'), $msg, $success);
|
||||||
$this->show_settings_form();
|
$this->show_settings_form();
|
||||||
common_element('h2', NULL, _('Avatar'));
|
common_element('h2', null, _('Avatar'));
|
||||||
$this->show_avatar_form();
|
$this->show_avatar_form();
|
||||||
common_element('h2', NULL, _('Change password'));
|
common_element('h2', null, _('Change password'));
|
||||||
$this->show_password_form();
|
$this->show_password_form();
|
||||||
// common_element('h2', NULL, _('Delete my account'));
|
// common_element('h2', null, _('Delete my account'));
|
||||||
// $this->show_delete_form();
|
// $this->show_delete_form();
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class PublicAction extends StreamAction {
|
|||||||
header('X-XRDS-Location: '. common_local_url('publicxrds'));
|
header('X-XRDS-Location: '. common_local_url('publicxrds'));
|
||||||
|
|
||||||
common_show_header(_('Public timeline'),
|
common_show_header(_('Public timeline'),
|
||||||
array($this, 'show_header'), NULL,
|
array($this, 'show_header'), null,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
# XXX: Public sidebar here?
|
# XXX: Public sidebar here?
|
||||||
|
@ -52,6 +52,6 @@ class PublicrssAction extends Rss10Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_image() {
|
function get_image() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -42,7 +42,7 @@ class PublicxrdsAction extends Action {
|
|||||||
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
||||||
'version' => '2.0'));
|
'version' => '2.0'));
|
||||||
|
|
||||||
common_element('Type', NULL, 'xri://$xrds*simple');
|
common_element('Type', null, 'xri://$xrds*simple');
|
||||||
|
|
||||||
foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) {
|
foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) {
|
||||||
$this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE,
|
$this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE,
|
||||||
@ -55,24 +55,24 @@ class PublicxrdsAction extends Action {
|
|||||||
common_end_xml();
|
common_end_xml();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) {
|
function show_service($type, $uri, $params=null, $sigs=null, $localId=null) {
|
||||||
common_element_start('Service');
|
common_element_start('Service');
|
||||||
if ($uri) {
|
if ($uri) {
|
||||||
common_element('URI', NULL, $uri);
|
common_element('URI', null, $uri);
|
||||||
}
|
}
|
||||||
common_element('Type', NULL, $type);
|
common_element('Type', null, $type);
|
||||||
if ($params) {
|
if ($params) {
|
||||||
foreach ($params as $param) {
|
foreach ($params as $param) {
|
||||||
common_element('Type', NULL, $param);
|
common_element('Type', null, $param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($sigs) {
|
if ($sigs) {
|
||||||
foreach ($sigs as $sig) {
|
foreach ($sigs as $sig) {
|
||||||
common_element('Type', NULL, $sig);
|
common_element('Type', null, $sig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($localId) {
|
if ($localId) {
|
||||||
common_element('LocalID', NULL, $localId);
|
common_element('LocalID', null, $localId);
|
||||||
}
|
}
|
||||||
common_element_end('Service');
|
common_element_end('Service');
|
||||||
}
|
}
|
||||||
|
@ -132,12 +132,12 @@ class RecoverpasswordAction extends Action {
|
|||||||
unset($_SESSION['tempuser']);
|
unset($_SESSION['tempuser']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($msg=NULL) {
|
function show_top($msg=null) {
|
||||||
if ($msg) {
|
if ($msg) {
|
||||||
common_element('div', 'error', $msg);
|
common_element('div', 'error', $msg);
|
||||||
} else {
|
} else {
|
||||||
common_element_start('div', 'instructions');
|
common_element_start('div', 'instructions');
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('If you\'ve forgotten or lost your' .
|
_('If you\'ve forgotten or lost your' .
|
||||||
' password, you can get a new one sent to' .
|
' password, you can get a new one sent to' .
|
||||||
' the email address you have stored ' .
|
' the email address you have stored ' .
|
||||||
@ -146,7 +146,7 @@ class RecoverpasswordAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_password_top($msg=NULL) {
|
function show_password_top($msg=null) {
|
||||||
if ($msg) {
|
if ($msg) {
|
||||||
common_element('div', 'error', $msg);
|
common_element('div', 'error', $msg);
|
||||||
} else {
|
} else {
|
||||||
@ -156,9 +156,9 @@ class RecoverpasswordAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL) {
|
function show_form($msg=null) {
|
||||||
|
|
||||||
common_show_header(_('Recover password'), NULL,
|
common_show_header(_('Recover password'), null,
|
||||||
$msg, array($this, 'show_top'));
|
$msg, array($this, 'show_top'));
|
||||||
|
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
@ -173,9 +173,9 @@ class RecoverpasswordAction extends Action {
|
|||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_password_form($msg=NULL) {
|
function show_password_form($msg=null) {
|
||||||
|
|
||||||
common_show_header(_('Reset password'), NULL,
|
common_show_header(_('Reset password'), null,
|
||||||
$msg, array($this, 'show_password_top'));
|
$msg, array($this, 'show_password_top'));
|
||||||
|
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
@ -224,7 +224,7 @@ class RecoverpasswordAction extends Action {
|
|||||||
$confirm_email = Confirm_address::staticGet('user_id', $user->id);
|
$confirm_email = Confirm_address::staticGet('user_id', $user->id);
|
||||||
if ($confirm_email && $confirm_email->address_type != 'email') {
|
if ($confirm_email && $confirm_email->address_type != 'email') {
|
||||||
# Skip non-email confirmations
|
# Skip non-email confirmations
|
||||||
$confirm_email = NULL;
|
$confirm_email = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ class RecoverpasswordAction extends Action {
|
|||||||
mail_to_user($user, _('Password recovery requested'), $body, $confirm->address);
|
mail_to_user($user, _('Password recovery requested'), $body, $confirm->address);
|
||||||
|
|
||||||
common_show_header(_('Password recovery requested'));
|
common_show_header(_('Password recovery requested'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Instructions for recovering your password ' .
|
_('Instructions for recovering your password ' .
|
||||||
'have been sent to the email address registered to your ' .
|
'have been sent to the email address registered to your ' .
|
||||||
'account.'));
|
'account.'));
|
||||||
@ -324,7 +324,7 @@ class RecoverpasswordAction extends Action {
|
|||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
|
|
||||||
common_show_header(_('Password saved.'));
|
common_show_header(_('Password saved.'));
|
||||||
common_element('p', NULL, _('New password successfully saved. ' .
|
common_element('p', null, _('New password successfully saved. ' .
|
||||||
'You are now logged in.'));
|
'You are now logged in.'));
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ class RegisterAction extends Action {
|
|||||||
return ($user !== false);
|
return ($user !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($error=NULL) {
|
function show_top($error=null) {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('p', 'error', $error);
|
common_element('p', 'error', $error);
|
||||||
} else {
|
} else {
|
||||||
@ -164,7 +164,7 @@ class RegisterAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL) {
|
function show_form($error=null) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$code = $this->trimmed('code');
|
$code = $this->trimmed('code');
|
||||||
@ -178,7 +178,7 @@ class RegisterAction extends Action {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
common_show_header(_('Register'), NULL, $error, array($this, 'show_top'));
|
common_show_header(_('Register'), null, $error, array($this, 'show_top'));
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
'id' => 'login',
|
'id' => 'login',
|
||||||
'action' => common_local_url('register')));
|
'action' => common_local_url('register')));
|
||||||
|
@ -55,7 +55,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
' enter your profile URL below.');
|
' enter your profile URL below.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($err=NULL) {
|
function show_top($err=null) {
|
||||||
if ($err) {
|
if ($err) {
|
||||||
common_element('div', 'error', $err);
|
common_element('div', 'error', $err);
|
||||||
} else {
|
} else {
|
||||||
@ -67,10 +67,10 @@ class RemotesubscribeAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($err=NULL) {
|
function show_form($err=null) {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
$profile = $this->trimmed('profile_url');
|
$profile = $this->trimmed('profile_url');
|
||||||
common_show_header(_('Remote subscribe'), NULL, $err,
|
common_show_header(_('Remote subscribe'), null, $err,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
# id = remotesubscribe conflicts with the
|
# id = remotesubscribe conflicts with the
|
||||||
# button on profile page
|
# button on profile page
|
||||||
@ -153,7 +153,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_user() {
|
function get_user() {
|
||||||
$user = NULL;
|
$user = null;
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
if ($nickname) {
|
if ($nickname) {
|
||||||
$user = User::staticGet('nickname', $nickname);
|
$user = User::staticGet('nickname', $nickname);
|
||||||
@ -173,7 +173,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
$oauth_services = omb_get_services($xrds, OAUTH_DISCOVERY);
|
$oauth_services = omb_get_services($xrds, OAUTH_DISCOVERY);
|
||||||
|
|
||||||
if (!$oauth_services) {
|
if (!$oauth_services) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oauth_service = $oauth_services[0];
|
$oauth_service = $oauth_services[0];
|
||||||
@ -181,17 +181,17 @@ class RemotesubscribeAction extends Action {
|
|||||||
$oauth_xrd = $this->getXRD($oauth_service, $xrds);
|
$oauth_xrd = $this->getXRD($oauth_service, $xrds);
|
||||||
|
|
||||||
if (!$oauth_xrd) {
|
if (!$oauth_xrd) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->addServices($oauth_xrd, $oauth_endpoints, $omb)) {
|
if (!$this->addServices($oauth_xrd, $oauth_endpoints, $omb)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$omb_services = omb_get_services($xrds, OMB_NAMESPACE);
|
$omb_services = omb_get_services($xrds, OMB_NAMESPACE);
|
||||||
|
|
||||||
if (!$omb_services) {
|
if (!$omb_services) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$omb_service = $omb_services[0];
|
$omb_service = $omb_services[0];
|
||||||
@ -199,23 +199,23 @@ class RemotesubscribeAction extends Action {
|
|||||||
$omb_xrd = $this->getXRD($omb_service, $xrds);
|
$omb_xrd = $this->getXRD($omb_service, $xrds);
|
||||||
|
|
||||||
if (!$omb_xrd) {
|
if (!$omb_xrd) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->addServices($omb_xrd, $omb_endpoints, $omb)) {
|
if (!$this->addServices($omb_xrd, $omb_endpoints, $omb)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX: check that we got all the services we needed
|
# XXX: check that we got all the services we needed
|
||||||
|
|
||||||
foreach (array_merge($omb_endpoints, $oauth_endpoints) as $type) {
|
foreach (array_merge($omb_endpoints, $oauth_endpoints) as $type) {
|
||||||
if (!array_key_exists($type, $omb) || !$omb[$type]) {
|
if (!array_key_exists($type, $omb) || !$omb[$type]) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!omb_local_id($omb[OAUTH_ENDPOINT_REQUEST])) {
|
if (!omb_local_id($omb[OAUTH_ENDPOINT_REQUEST])) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $omb;
|
return $omb;
|
||||||
@ -225,7 +225,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
$uri = omb_service_uri($main_service);
|
$uri = omb_service_uri($main_service);
|
||||||
if (strpos($uri, "#") !== 0) {
|
if (strpos($uri, "#") !== 0) {
|
||||||
# FIXME: more rigorous handling of external service definitions
|
# FIXME: more rigorous handling of external service definitions
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$id = substr($uri, 1);
|
$id = substr($uri, 1);
|
||||||
$nodes = $main_xrds->allXrdNodes;
|
$nodes = $main_xrds->allXrdNodes;
|
||||||
@ -239,7 +239,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
return new Auth_Yadis_XRDS($parser, $bogus_nodes);
|
return new Auth_Yadis_XRDS($parser, $bogus_nodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addServices($xrd, $types, &$omb) {
|
function addServices($xrd, $types, &$omb) {
|
||||||
@ -267,12 +267,12 @@ class RemotesubscribeAction extends Action {
|
|||||||
$params = array();
|
$params = array();
|
||||||
parse_str($parsed['query'], $params);
|
parse_str($parsed['query'], $params);
|
||||||
|
|
||||||
$req = OAuthRequest::from_consumer_and_token($con, NULL, "POST", $url, $params);
|
$req = OAuthRequest::from_consumer_and_token($con, null, "POST", $url, $params);
|
||||||
|
|
||||||
$listener = omb_local_id($omb[OAUTH_ENDPOINT_REQUEST]);
|
$listener = omb_local_id($omb[OAUTH_ENDPOINT_REQUEST]);
|
||||||
|
|
||||||
if (!$listener) {
|
if (!$listener) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$req->set_parameter('omb_listener', $listener);
|
$req->set_parameter('omb_listener', $listener);
|
||||||
@ -280,7 +280,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
|
|
||||||
# XXX: test to see if endpoint accepts this signature method
|
# XXX: test to see if endpoint accepts this signature method
|
||||||
|
|
||||||
$req->sign_request(omb_hmac_sha1(), $con, NULL);
|
$req->sign_request(omb_hmac_sha1(), $con, null);
|
||||||
|
|
||||||
# We re-use this tool's fetcher, since it's pretty good
|
# We re-use this tool's fetcher, since it's pretty good
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ class RemotesubscribeAction extends Action {
|
|||||||
array('User-Agent' => 'Laconica/' . LACONICA_VERSION));
|
array('User-Agent' => 'Laconica/' . LACONICA_VERSION));
|
||||||
|
|
||||||
if ($result->status != 200) {
|
if ($result->status != 200) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_str($result->body, $return);
|
parse_str($result->body, $return);
|
||||||
|
@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
|||||||
|
|
||||||
class RepliesrssAction extends Rss10Action {
|
class RepliesrssAction extends Rss10Action {
|
||||||
|
|
||||||
var $user = NULL;
|
var $user = null;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
@ -71,9 +71,9 @@ class RepliesrssAction extends Rss10Action {
|
|||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
return ($avatar) ? $avatar->url : NULL;
|
return ($avatar) ? $avatar->url : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -53,7 +53,7 @@ class ShowmessageAction extends MailboxAction {
|
|||||||
function get_title($user, $page) {
|
function get_title($user, $page) {
|
||||||
$message = $this->get_message();
|
$message = $this->get_message();
|
||||||
if (!$message) {
|
if (!$message) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->id == $message->from_profile) {
|
if ($user->id == $message->from_profile) {
|
||||||
@ -85,7 +85,7 @@ class ShowmessageAction extends MailboxAction {
|
|||||||
return $message->getFrom();
|
return $message->getFrom();
|
||||||
} else {
|
} else {
|
||||||
# This shouldn't happen
|
# This shouldn't happen
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ require_once(INSTALLDIR.'/lib/stream.php');
|
|||||||
|
|
||||||
class ShownoticeAction extends StreamAction {
|
class ShownoticeAction extends StreamAction {
|
||||||
|
|
||||||
var $notice = NULL;
|
var $notice = null;
|
||||||
var $profile = NULL;
|
var $profile = null;
|
||||||
var $avatar = NULL;
|
var $avatar = null;
|
||||||
|
|
||||||
function prepare($args) {
|
function prepare($args) {
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class ShownoticeAction extends StreamAction {
|
|||||||
common_show_header(sprintf(_('%1$s\'s status on %2$s'),
|
common_show_header(sprintf(_('%1$s\'s status on %2$s'),
|
||||||
$this->profile->nickname,
|
$this->profile->nickname,
|
||||||
common_exact_date($this->notice->created)),
|
common_exact_date($this->notice->created)),
|
||||||
array($this, 'show_header'), NULL,
|
array($this, 'show_header'), null,
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
|
|
||||||
common_element_start('ul', array('id' => 'notices'));
|
common_element_start('ul', array('id' => 'notices'));
|
||||||
|
@ -285,7 +285,7 @@ class ShowstreamAction extends StreamAction {
|
|||||||
|
|
||||||
common_element_start('div', array('id' => 'subscriptions'));
|
common_element_start('div', array('id' => 'subscriptions'));
|
||||||
|
|
||||||
common_element('h2', NULL, _('Subscriptions'));
|
common_element('h2', null, _('Subscriptions'));
|
||||||
|
|
||||||
if ($subs_count > 0) {
|
if ($subs_count > 0) {
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ class ShowstreamAction extends StreamAction {
|
|||||||
|
|
||||||
function show_last_notice($profile) {
|
function show_last_notice($profile) {
|
||||||
|
|
||||||
common_element('h2', NULL, _('Currently'));
|
common_element('h2', null, _('Currently'));
|
||||||
|
|
||||||
$notice = $profile->getCurrentNotice();
|
$notice = $profile->getCurrentNotice();
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
return _('You can receive SMS messages through email from %%site.name%%.');
|
return _('You can receive SMS messages through email from %%site.name%%.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
$this->form_header(_('SMS Settings'), $msg, $success);
|
$this->form_header(_('SMS Settings'), $msg, $success);
|
||||||
common_element_start('form', array('method' => 'post',
|
common_element_start('form', array('method' => 'post',
|
||||||
@ -36,7 +36,7 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('smssettings')));
|
common_local_url('smssettings')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
common_element('h2', NULL, _('Address'));
|
common_element('h2', null, _('Address'));
|
||||||
|
|
||||||
if ($user->sms) {
|
if ($user->sms) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -60,12 +60,12 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
common_hidden('carrier', $confirm->address_extra);
|
common_hidden('carrier', $confirm->address_extra);
|
||||||
common_element_end('p');
|
common_element_end('p');
|
||||||
common_submit('cancel', _('Cancel'));
|
common_submit('cancel', _('Cancel'));
|
||||||
common_input('code', _('Confirmation code'), NULL,
|
common_input('code', _('Confirmation code'), null,
|
||||||
_('Enter the code you received on your phone.'));
|
_('Enter the code you received on your phone.'));
|
||||||
common_submit('confirm', _('Confirm'));
|
common_submit('confirm', _('Confirm'));
|
||||||
} else {
|
} else {
|
||||||
common_input('sms', _('SMS Phone number'),
|
common_input('sms', _('SMS Phone number'),
|
||||||
($this->arg('sms')) ? $this->arg('sms') : NULL,
|
($this->arg('sms')) ? $this->arg('sms') : null,
|
||||||
_('Phone number, no punctuation or spaces, with area code'));
|
_('Phone number, no punctuation or spaces, with area code'));
|
||||||
$this->carrier_select();
|
$this->carrier_select();
|
||||||
common_submit('add', _('Add'));
|
common_submit('add', _('Add'));
|
||||||
@ -73,7 +73,7 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($user->sms) {
|
if ($user->sms) {
|
||||||
common_element('h2', NULL, _('Incoming email'));
|
common_element('h2', null, _('Incoming email'));
|
||||||
|
|
||||||
if ($user->incomingemail) {
|
if ($user->incomingemail) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -91,7 +91,7 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
common_submit('newincoming', _('New'));
|
common_submit('newincoming', _('New'));
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element('h2', NULL, _('Preferences'));
|
common_element('h2', null, _('Preferences'));
|
||||||
|
|
||||||
common_checkbox('smsnotify',
|
common_checkbox('smsnotify',
|
||||||
_('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'),
|
_('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'),
|
||||||
@ -111,7 +111,7 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
if ($confirm->find(TRUE)) {
|
if ($confirm->find(TRUE)) {
|
||||||
return $confirm;
|
return $confirm;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,9 +268,9 @@ class SmssettingsAction extends EmailsettingsAction {
|
|||||||
|
|
||||||
$user->query('BEGIN');
|
$user->query('BEGIN');
|
||||||
$original = clone($user);
|
$original = clone($user);
|
||||||
$user->sms = NULL;
|
$user->sms = null;
|
||||||
$user->carrier = NULL;
|
$user->carrier = null;
|
||||||
$user->smsemail = NULL;
|
$user->smsemail = null;
|
||||||
$result = $user->updateKeys($original);
|
$result = $user->updateKeys($original);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
|
@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
|
|||||||
|
|
||||||
class SubeditAction extends Action {
|
class SubeditAction extends Action {
|
||||||
|
|
||||||
var $profile = NULL;
|
var $profile = null;
|
||||||
|
|
||||||
function prepare($args) {
|
function prepare($args) {
|
||||||
|
|
||||||
|
@ -49,12 +49,12 @@ class TagotherAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($profile, $error=NULL) {
|
function show_form($profile, $error=null) {
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
common_show_header(_('Tag a person'),
|
common_show_header(_('Tag a person'),
|
||||||
NULL, array($profile, $error), array($this, 'show_top'));
|
null, array($profile, $error), array($this, 'show_top'));
|
||||||
|
|
||||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
|
|
||||||
@ -178,13 +178,13 @@ class TagotherAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($arr = NULL) {
|
function show_top($arr = null) {
|
||||||
list($profile, $error) = $arr;
|
list($profile, $error) = $arr;
|
||||||
if ($error) {
|
if ($error) {
|
||||||
common_element('p', 'error', $error);
|
common_element('p', 'error', $error);
|
||||||
} else {
|
} else {
|
||||||
common_element_start('div', 'instructions');
|
common_element_start('div', 'instructions');
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('Use this form to add tags to your subscribers or subscriptions.'));
|
_('Use this form to add tags to your subscribers or subscriptions.'));
|
||||||
common_element_end('div');
|
common_element_end('div');
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class TagrssAction extends Rss10Action {
|
|||||||
$tag = $this->tag;
|
$tag = $this->tag;
|
||||||
|
|
||||||
if (is_null($tag)) {
|
if (is_null($tag)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
$notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
||||||
|
@ -228,12 +228,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction {
|
|||||||
$this->init_document('rss');
|
$this->init_document('rss');
|
||||||
|
|
||||||
common_element_start('channel');
|
common_element_start('channel');
|
||||||
common_element('title', NULL, $title);
|
common_element('title', null, $title);
|
||||||
|
|
||||||
common_element('link', NULL, $link);
|
common_element('link', null, $link);
|
||||||
common_element('description', NULL, $subtitle);
|
common_element('description', null, $subtitle);
|
||||||
common_element('language', NULL, 'en-us');
|
common_element('language', null, 'en-us');
|
||||||
common_element('ttl', NULL, '40');
|
common_element('ttl', null, '40');
|
||||||
|
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
foreach ($message as $m) {
|
foreach ($message as $m) {
|
||||||
@ -256,12 +256,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction {
|
|||||||
|
|
||||||
$this->init_document('atom');
|
$this->init_document('atom');
|
||||||
|
|
||||||
common_element('title', NULL, $title);
|
common_element('title', null, $title);
|
||||||
$siteserver = common_config('site', 'server');
|
$siteserver = common_config('site', 'server');
|
||||||
common_element('id', NULL, "tag:$siteserver,2008:DirectMessage");
|
common_element('id', null, "tag:$siteserver,2008:DirectMessage");
|
||||||
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL);
|
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
|
||||||
common_element('updated', NULL, common_date_iso8601(strftime('%c')));
|
common_element('updated', null, common_date_iso8601(strftime('%c')));
|
||||||
common_element('subtitle', NULL, $subtitle);
|
common_element('subtitle', null, $subtitle);
|
||||||
|
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
foreach ($message as $m) {
|
foreach ($message as $m) {
|
||||||
|
@ -138,7 +138,7 @@ class TwitapifriendshipsAction extends TwitterapiAction {
|
|||||||
switch ($apidata['content-type']) {
|
switch ($apidata['content-type']) {
|
||||||
case 'xml':
|
case 'xml':
|
||||||
$this->init_document('xml');
|
$this->init_document('xml');
|
||||||
common_element('friends', NULL, $result);
|
common_element('friends', null, $result);
|
||||||
$this->end_document('xml');
|
$this->end_document('xml');
|
||||||
break;
|
break;
|
||||||
case 'json':
|
case 'json':
|
||||||
|
@ -32,7 +32,7 @@ class TwitapihelpAction extends TwitterapiAction {
|
|||||||
|
|
||||||
if ($apidata['content-type'] == 'xml') {
|
if ($apidata['content-type'] == 'xml') {
|
||||||
$this->init_document('xml');
|
$this->init_document('xml');
|
||||||
common_element('ok', NULL, 'true');
|
common_element('ok', null, 'true');
|
||||||
$this->end_document('xml');
|
$this->end_document('xml');
|
||||||
} elseif ($apidata['content-type'] == 'json') {
|
} elseif ($apidata['content-type'] == 'json') {
|
||||||
$this->init_document('json');
|
$this->init_document('json');
|
||||||
|
@ -112,7 +112,7 @@ class TwitapistatusesAction extends TwitterapiAction {
|
|||||||
|
|
||||||
$since = strtotime($this->arg('since'));
|
$since = strtotime($this->arg('since'));
|
||||||
|
|
||||||
$user = $this->get_user(NULL, $apidata);
|
$user = $this->get_user(null, $apidata);
|
||||||
$this->auth_user = $user;
|
$this->auth_user = $user;
|
||||||
|
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
@ -200,7 +200,7 @@ class TwitapistatusesAction extends TwitterapiAction {
|
|||||||
# FriendFeed's SUP protocol
|
# FriendFeed's SUP protocol
|
||||||
# Also added RSS and Atom feeds
|
# Also added RSS and Atom feeds
|
||||||
|
|
||||||
$suplink = common_local_url('sup', NULL, $user->id);
|
$suplink = common_local_url('sup', null, $user->id);
|
||||||
header('X-SUP-ID: '.$suplink);
|
header('X-SUP-ID: '.$suplink);
|
||||||
|
|
||||||
# XXX: since
|
# XXX: since
|
||||||
@ -291,7 +291,7 @@ class TwitapistatusesAction extends TwitterapiAction {
|
|||||||
$apidata['api_arg'] = $n->id;
|
$apidata['api_arg'] = $n->id;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$reply_to = NULL;
|
$reply_to = null;
|
||||||
|
|
||||||
if ($in_reply_to_status_id) {
|
if ($in_reply_to_status_id) {
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ class TwittersettingsAction extends SettingsAction {
|
|||||||
'and subscribe to Twitter friends already here.');
|
'and subscribe to Twitter friends already here.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
$fuser = NULL;
|
$fuser = null;
|
||||||
$flink = Foreign_link::getByUserID($user->id, 1); // 1 == Twitter
|
$flink = Foreign_link::getByUserID($user->id, 1); // 1 == Twitter
|
||||||
|
|
||||||
if ($flink) {
|
if ($flink) {
|
||||||
@ -47,7 +47,7 @@ class TwittersettingsAction extends SettingsAction {
|
|||||||
common_local_url('twittersettings')));
|
common_local_url('twittersettings')));
|
||||||
common_hidden('token', common_session_token());
|
common_hidden('token', common_session_token());
|
||||||
|
|
||||||
common_element('h2', NULL, _('Twitter Account'));
|
common_element('h2', null, _('Twitter Account'));
|
||||||
|
|
||||||
if ($fuser) {
|
if ($fuser) {
|
||||||
common_element_start('p');
|
common_element_start('p');
|
||||||
@ -67,7 +67,7 @@ class TwittersettingsAction extends SettingsAction {
|
|||||||
common_password('twitter_password', _('Twitter password'));
|
common_password('twitter_password', _('Twitter password'));
|
||||||
}
|
}
|
||||||
|
|
||||||
common_element('h2', NULL, _('Preferences'));
|
common_element('h2', null, _('Preferences'));
|
||||||
|
|
||||||
common_checkbox('noticesync', _('Automatically send my notices to Twitter.'),
|
common_checkbox('noticesync', _('Automatically send my notices to Twitter.'),
|
||||||
($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true);
|
($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true);
|
||||||
@ -126,7 +126,7 @@ class TwittersettingsAction extends SettingsAction {
|
|||||||
|
|
||||||
if ($friends_count > 0) {
|
if ($friends_count > 0) {
|
||||||
|
|
||||||
common_element('h3', NULL, _('Twitter Friends'));
|
common_element('h3', null, _('Twitter Friends'));
|
||||||
common_element_start('div', array('id' => 'subscriptions'));
|
common_element_start('div', array('id' => 'subscriptions'));
|
||||||
common_element_start('ul', array('id' => 'subscriptions_avatars'));
|
common_element_start('ul', array('id' => 'subscriptions_avatars'));
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ if (!defined('LACONICA')) { exit(1); }
|
|||||||
|
|
||||||
class UnblockAction extends Action {
|
class UnblockAction extends Action {
|
||||||
|
|
||||||
var $profile = NULL;
|
var $profile = null;
|
||||||
|
|
||||||
function prepare($args) {
|
function prepare($args) {
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ class UserauthorizationAction extends Action {
|
|||||||
$avatar = $req->get_parameter('omb_listenee_avatar');
|
$avatar = $req->get_parameter('omb_listenee_avatar');
|
||||||
|
|
||||||
common_show_header(_('Authorize subscription'));
|
common_show_header(_('Authorize subscription'));
|
||||||
common_element('p', NULL, _('Please check these details to make sure '.
|
common_element('p', null, _('Please check these details to make sure '.
|
||||||
'that you want to subscribe to this user\'s notices. '.
|
'that you want to subscribe to this user\'s notices. '.
|
||||||
'If you didn\'t just ask to subscribe to someone\'s notices, '.
|
'If you didn\'t just ask to subscribe to someone\'s notices, '.
|
||||||
'click "Cancel".'));
|
'click "Cancel".'));
|
||||||
@ -320,7 +320,7 @@ class UserauthorizationAction extends Action {
|
|||||||
|
|
||||||
function show_accept_message($tok) {
|
function show_accept_message($tok) {
|
||||||
common_show_header(_('Subscription authorized'));
|
common_show_header(_('Subscription authorized'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('The subscription has been authorized, but no '.
|
_('The subscription has been authorized, but no '.
|
||||||
'callback URL was passed. Check with the site\'s instructions for '.
|
'callback URL was passed. Check with the site\'s instructions for '.
|
||||||
'details on how to authorize the subscription. Your subscription token is:'));
|
'details on how to authorize the subscription. Your subscription token is:'));
|
||||||
@ -330,7 +330,7 @@ class UserauthorizationAction extends Action {
|
|||||||
|
|
||||||
function show_reject_message($tok) {
|
function show_reject_message($tok) {
|
||||||
common_show_header(_('Subscription rejected'));
|
common_show_header(_('Subscription rejected'));
|
||||||
common_element('p', NULL,
|
common_element('p', null,
|
||||||
_('The subscription has been rejected, but no '.
|
_('The subscription has been rejected, but no '.
|
||||||
'callback URL was passed. Check with the site\'s instructions for '.
|
'callback URL was passed. Check with the site\'s instructions for '.
|
||||||
'details on how to fully reject the subscription.'));
|
'details on how to fully reject the subscription.'));
|
||||||
|
@ -38,7 +38,7 @@ class UserbyidAction extends Action {
|
|||||||
|
|
||||||
// support redirecting to FOAF rdf/xml if the agent prefers it
|
// support redirecting to FOAF rdf/xml if the agent prefers it
|
||||||
$page_prefs = 'application/rdf+xml,text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2';
|
$page_prefs = 'application/rdf+xml,text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2';
|
||||||
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : NULL;
|
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null;
|
||||||
$type = common_negotiate_type(common_accept_to_prefs($httpaccept),
|
$type = common_negotiate_type(common_accept_to_prefs($httpaccept),
|
||||||
common_accept_to_prefs($page_prefs));
|
common_accept_to_prefs($page_prefs));
|
||||||
$page = $type == 'application/rdf+xml' ? 'foaf' : 'showstream';
|
$page = $type == 'application/rdf+xml' ? 'foaf' : 'showstream';
|
||||||
|
@ -25,7 +25,7 @@ require_once(INSTALLDIR.'/lib/rssaction.php');
|
|||||||
|
|
||||||
class UserrssAction extends Rss10Action {
|
class UserrssAction extends Rss10Action {
|
||||||
|
|
||||||
var $user = NULL;
|
var $user = null;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
@ -44,7 +44,7 @@ class UserrssAction extends Rss10Action {
|
|||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
|
|
||||||
if (is_null($user)) {
|
if (is_null($user)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
$notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
|
||||||
@ -74,16 +74,16 @@ class UserrssAction extends Rss10Action {
|
|||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
$this->server_error(_('User without matching profile'));
|
$this->server_error(_('User without matching profile'));
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
return ($avatar) ? $avatar->url : NULL;
|
return ($avatar) ? $avatar->url : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
# override parent to add X-SUP-ID URL
|
# override parent to add X-SUP-ID URL
|
||||||
|
|
||||||
function init_rss($limit=0) {
|
function init_rss($limit=0) {
|
||||||
$url = common_local_url('sup', NULL, $this->user->id);
|
$url = common_local_url('sup', null, $this->user->id);
|
||||||
header('X-SUP-ID: '.$url);
|
header('X-SUP-ID: '.$url);
|
||||||
parent::init_rss($limit);
|
parent::init_rss($limit);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ class XrdsAction extends Action {
|
|||||||
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
||||||
'version' => '2.0'));
|
'version' => '2.0'));
|
||||||
|
|
||||||
common_element('Type', NULL, 'xri://$xrds*simple');
|
common_element('Type', null, 'xri://$xrds*simple');
|
||||||
|
|
||||||
$this->show_service(OAUTH_ENDPOINT_REQUEST,
|
$this->show_service(OAUTH_ENDPOINT_REQUEST,
|
||||||
common_local_url('requesttoken'),
|
common_local_url('requesttoken'),
|
||||||
@ -69,7 +69,7 @@ class XrdsAction extends Action {
|
|||||||
array(OAUTH_HMAC_SHA1));
|
array(OAUTH_HMAC_SHA1));
|
||||||
|
|
||||||
$this->show_service(OAUTH_ENDPOINT_RESOURCE,
|
$this->show_service(OAUTH_ENDPOINT_RESOURCE,
|
||||||
NULL,
|
null,
|
||||||
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY),
|
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY),
|
||||||
array(OAUTH_HMAC_SHA1));
|
array(OAUTH_HMAC_SHA1));
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class XrdsAction extends Action {
|
|||||||
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
|
||||||
'version' => '2.0'));
|
'version' => '2.0'));
|
||||||
|
|
||||||
common_element('Type', NULL, 'xri://$xrds*simple');
|
common_element('Type', null, 'xri://$xrds*simple');
|
||||||
|
|
||||||
$this->show_service(OMB_ENDPOINT_POSTNOTICE,
|
$this->show_service(OMB_ENDPOINT_POSTNOTICE,
|
||||||
common_local_url('postnotice'));
|
common_local_url('postnotice'));
|
||||||
@ -95,7 +95,7 @@ class XrdsAction extends Action {
|
|||||||
common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
|
common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
|
||||||
'version' => '2.0'));
|
'version' => '2.0'));
|
||||||
|
|
||||||
common_element('Type', NULL, 'xri://$xrds*simple');
|
common_element('Type', null, 'xri://$xrds*simple');
|
||||||
|
|
||||||
$this->show_service(OAUTH_DISCOVERY,
|
$this->show_service(OAUTH_DISCOVERY,
|
||||||
'#oauth');
|
'#oauth');
|
||||||
@ -108,24 +108,24 @@ class XrdsAction extends Action {
|
|||||||
common_end_xml();
|
common_end_xml();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) {
|
function show_service($type, $uri, $params=null, $sigs=null, $localId=null) {
|
||||||
common_element_start('Service');
|
common_element_start('Service');
|
||||||
if ($uri) {
|
if ($uri) {
|
||||||
common_element('URI', NULL, $uri);
|
common_element('URI', null, $uri);
|
||||||
}
|
}
|
||||||
common_element('Type', NULL, $type);
|
common_element('Type', null, $type);
|
||||||
if ($params) {
|
if ($params) {
|
||||||
foreach ($params as $param) {
|
foreach ($params as $param) {
|
||||||
common_element('Type', NULL, $param);
|
common_element('Type', null, $param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($sigs) {
|
if ($sigs) {
|
||||||
foreach ($sigs as $sig) {
|
foreach ($sigs as $sig) {
|
||||||
common_element('Type', NULL, $sig);
|
common_element('Type', null, $sig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($localId) {
|
if ($localId) {
|
||||||
common_element('LocalID', NULL, $localId);
|
common_element('LocalID', null, $localId);
|
||||||
}
|
}
|
||||||
common_element_end('Service');
|
common_element_end('Service');
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class Avatar extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Avatar',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Avatar',$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
|
||||||
@ -72,7 +72,7 @@ class Avatar extends Memcached_DataObject
|
|||||||
if ($scaled->insert()) {
|
if ($scaled->insert()) {
|
||||||
return $scaled;
|
return $scaled;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class Avatar extends Memcached_DataObject
|
|||||||
} else if ($this->mediatype == 'image/png') {
|
} else if ($this->mediatype == 'image/png') {
|
||||||
return imagecreatefrompng($filepath);
|
return imagecreatefrompng($filepath);
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@ class Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function source() {
|
function source() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class XMPPChannel extends Channel {
|
class XMPPChannel extends Channel {
|
||||||
|
|
||||||
var $conn = NULL;
|
var $conn = null;
|
||||||
|
|
||||||
function source() {
|
function source() {
|
||||||
return 'xmpp';
|
return 'xmpp';
|
||||||
@ -111,7 +111,7 @@ class WebChannel extends Channel {
|
|||||||
# XXX: even better, redirect to appropriate page
|
# XXX: even better, redirect to appropriate page
|
||||||
# depending on what command was run
|
# depending on what command was run
|
||||||
common_show_header(_('Command results'));
|
common_show_header(_('Command results'));
|
||||||
common_element('p', NULL, $text);
|
common_element('p', null, $text);
|
||||||
common_show_footer();
|
common_show_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,13 +149,13 @@ class AjaxWebChannel extends WebChannel {
|
|||||||
|
|
||||||
class MailChannel extends Channel {
|
class MailChannel extends Channel {
|
||||||
|
|
||||||
var $addr = NULL;
|
var $addr = null;
|
||||||
|
|
||||||
function source() {
|
function source() {
|
||||||
return 'mail';
|
return 'mail';
|
||||||
}
|
}
|
||||||
|
|
||||||
function __construct($addr=NULL) {
|
function __construct($addr=null) {
|
||||||
$this->addr = $addr;
|
$this->addr = $addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ require_once(INSTALLDIR.'/classes/Channel.php');
|
|||||||
|
|
||||||
class Command {
|
class Command {
|
||||||
|
|
||||||
var $user = NULL;
|
var $user = null;
|
||||||
|
|
||||||
function __construct($user=NULL) {
|
function __construct($user=null) {
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ class TrackOffCommand extends UnimplementedCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TrackCommand extends UnimplementedCommand {
|
class TrackCommand extends UnimplementedCommand {
|
||||||
var $word = NULL;
|
var $word = null;
|
||||||
function __construct($user, $word) {
|
function __construct($user, $word) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->word = $word;
|
$this->word = $word;
|
||||||
@ -55,7 +55,7 @@ class TrackCommand extends UnimplementedCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class UntrackCommand extends UnimplementedCommand {
|
class UntrackCommand extends UnimplementedCommand {
|
||||||
var $word = NULL;
|
var $word = null;
|
||||||
function __construct($user, $word) {
|
function __construct($user, $word) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->word = $word;
|
$this->word = $word;
|
||||||
@ -63,7 +63,7 @@ class UntrackCommand extends UnimplementedCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class NudgeCommand extends UnimplementedCommand {
|
class NudgeCommand extends UnimplementedCommand {
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
function __construct($user, $other) {
|
function __construct($user, $other) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
@ -71,7 +71,7 @@ class NudgeCommand extends UnimplementedCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class InviteCommand extends UnimplementedCommand {
|
class InviteCommand extends UnimplementedCommand {
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
function __construct($user, $other) {
|
function __construct($user, $other) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
@ -104,7 +104,7 @@ class StatsCommand extends Command {
|
|||||||
|
|
||||||
class FavCommand extends Command {
|
class FavCommand extends Command {
|
||||||
|
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other) {
|
function __construct($user, $other) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
@ -148,7 +148,7 @@ class FavCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class WhoisCommand extends Command {
|
class WhoisCommand extends Command {
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
function __construct($user, $other) {
|
function __construct($user, $other) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
@ -182,8 +182,8 @@ class WhoisCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MessageCommand extends Command {
|
class MessageCommand extends Command {
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
var $text = NULL;
|
var $text = null;
|
||||||
function __construct($user, $other, $text) {
|
function __construct($user, $other, $text) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
@ -225,7 +225,7 @@ class MessageCommand extends Command {
|
|||||||
|
|
||||||
class GetCommand extends Command {
|
class GetCommand extends Command {
|
||||||
|
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
|
|
||||||
function __construct($user, $other) {
|
function __construct($user, $other) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
@ -255,7 +255,7 @@ 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) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
@ -281,7 +281,7 @@ 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) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
@ -305,8 +305,8 @@ 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);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
}
|
}
|
||||||
@ -324,8 +324,8 @@ class OffCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class OnCommand extends Command {
|
class OnCommand extends Command {
|
||||||
var $other = NULL;
|
var $other = null;
|
||||||
function __construct($user, $other=NULL) {
|
function __construct($user, $other=null) {
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
$this->other = $other;
|
$this->other = $other;
|
||||||
}
|
}
|
||||||
|
@ -37,14 +37,14 @@ class CommandInterpreter {
|
|||||||
switch(strtolower($cmd)) {
|
switch(strtolower($cmd)) {
|
||||||
case 'help':
|
case 'help':
|
||||||
if ($arg) {
|
if ($arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
return new HelpCommand($user);
|
return new HelpCommand($user);
|
||||||
case 'on':
|
case 'on':
|
||||||
if ($arg) {
|
if ($arg) {
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new OnCommand($user, $other);
|
return new OnCommand($user, $other);
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ class CommandInterpreter {
|
|||||||
if ($arg) {
|
if ($arg) {
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new OffCommand($user, $other);
|
return new OffCommand($user, $other);
|
||||||
}
|
}
|
||||||
@ -65,105 +65,105 @@ class CommandInterpreter {
|
|||||||
case 'stop':
|
case 'stop':
|
||||||
case 'quit':
|
case 'quit':
|
||||||
if ($arg) {
|
if ($arg) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new OffCommand($user);
|
return new OffCommand($user);
|
||||||
}
|
}
|
||||||
case 'follow':
|
case 'follow':
|
||||||
case 'sub':
|
case 'sub':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new SubCommand($user, $other);
|
return new SubCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'leave':
|
case 'leave':
|
||||||
case 'unsub':
|
case 'unsub':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new UnsubCommand($user, $other);
|
return new UnsubCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'get':
|
case 'get':
|
||||||
case 'last':
|
case 'last':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new GetCommand($user, $other);
|
return new GetCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'd':
|
case 'd':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if (!$extra) {
|
if (!$extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new MessageCommand($user, $other, $extra);
|
return new MessageCommand($user, $other, $extra);
|
||||||
}
|
}
|
||||||
case 'whois':
|
case 'whois':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new WhoisCommand($user, $other);
|
return new WhoisCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'fav':
|
case 'fav':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new FavCommand($user, $other);
|
return new FavCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'nudge':
|
case 'nudge':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new NudgeCommand($user, $other);
|
return new NudgeCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'stats':
|
case 'stats':
|
||||||
if ($arg) {
|
if ($arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
return new StatsCommand($user);
|
return new StatsCommand($user);
|
||||||
case 'invite':
|
case 'invite':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($other, $extra) = explode(' ', $arg, 2);
|
list($other, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new InviteCommand($user, $other);
|
return new InviteCommand($user, $other);
|
||||||
}
|
}
|
||||||
case 'track':
|
case 'track':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($word, $extra) = explode(' ', $arg, 2);
|
list($word, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else if ($word == 'off') {
|
} else if ($word == 'off') {
|
||||||
return new TrackOffCommand($user);
|
return new TrackOffCommand($user);
|
||||||
} else {
|
} else {
|
||||||
@ -171,11 +171,11 @@ class CommandInterpreter {
|
|||||||
}
|
}
|
||||||
case 'untrack':
|
case 'untrack':
|
||||||
if (!$arg) {
|
if (!$arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
list($word, $extra) = explode(' ', $arg, 2);
|
list($word, $extra) = explode(' ', $arg, 2);
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
return NULL;
|
return null;
|
||||||
} else if ($word == 'all') {
|
} else if ($word == 'all') {
|
||||||
return new TrackOffCommand($user);
|
return new TrackOffCommand($user);
|
||||||
} else {
|
} else {
|
||||||
@ -184,7 +184,7 @@ class CommandInterpreter {
|
|||||||
case 'tracks':
|
case 'tracks':
|
||||||
case 'tracking':
|
case 'tracking':
|
||||||
if ($arg) {
|
if ($arg) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
return new TrackingCommand($user);
|
return new TrackingCommand($user);
|
||||||
default:
|
default:
|
||||||
|
@ -20,7 +20,7 @@ class Confirm_address extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Confirm_address',$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
|
||||||
|
@ -16,7 +16,7 @@ class Consumer extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Consumer',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Consumer',$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
|
||||||
|
@ -15,7 +15,7 @@ class Fave extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Fave',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Fave',$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
|
||||||
|
@ -21,7 +21,7 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_link',$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
|
||||||
@ -38,7 +38,7 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
return $flink;
|
return $flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getByForeignID($foreign_id, $service) {
|
static function getByForeignID($foreign_id, $service) {
|
||||||
@ -51,7 +51,7 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
return $flink;
|
return $flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convenience methods
|
# Convenience methods
|
||||||
@ -66,7 +66,7 @@ class Foreign_link extends Memcached_DataObject
|
|||||||
return $fuser;
|
return $fuser;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUser() {
|
function getUser() {
|
||||||
|
@ -17,7 +17,7 @@ class Foreign_service extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_service',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_service',$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
|
||||||
|
@ -16,7 +16,7 @@ class Foreign_subscription extends Memcached_DataObject
|
|||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_subscription',$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
|
||||||
|
@ -18,7 +18,7 @@ class Foreign_user extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Foreign_user',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Foreign_user',$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
|
||||||
@ -36,7 +36,7 @@ class Foreign_user extends Memcached_DataObject
|
|||||||
return $fuser;
|
return $fuser;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateKeys(&$orig) {
|
function updateKeys(&$orig) {
|
||||||
|
@ -17,7 +17,7 @@ class Invitation extends Memcached_DataObject
|
|||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Invitation',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Invitation',$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
|
||||||
|
@ -23,7 +23,7 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
|||||||
|
|
||||||
class Memcached_DataObject extends DB_DataObject
|
class Memcached_DataObject extends DB_DataObject
|
||||||
{
|
{
|
||||||
function &staticGet($cls, $k, $v=NULL) {
|
function &staticGet($cls, $k, $v=null) {
|
||||||
if (is_null($v)) {
|
if (is_null($v)) {
|
||||||
$v = $k;
|
$v = $k;
|
||||||
# XXX: HACK!
|
# XXX: HACK!
|
||||||
@ -56,7 +56,7 @@ class Memcached_DataObject extends DB_DataObject
|
|||||||
if ($i->find(true)) {
|
if ($i->find(true)) {
|
||||||
$i->encache();
|
$i->encache();
|
||||||
} else {
|
} else {
|
||||||
$i = NULL;
|
$i = null;
|
||||||
}
|
}
|
||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ class Memcached_DataObject extends DB_DataObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update($orig=NULL) {
|
function update($orig=null) {
|
||||||
if (is_object($orig) && $orig instanceof Memcached_DataObject) {
|
if (is_object($orig) && $orig instanceof Memcached_DataObject) {
|
||||||
$orig->decache(); # might be different keys
|
$orig->decache(); # might be different keys
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class Message extends Memcached_DataObject
|
|||||||
public $source; // varchar(32)
|
public $source; // varchar(32)
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Message',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Message',$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
|
||||||
|
@ -18,7 +18,7 @@ class Nonce extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Nonce',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Nonce',$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
|
||||||
|
@ -48,7 +48,7 @@ class Notice extends Memcached_DataObject
|
|||||||
public $source; // varchar(32)
|
public $source; // varchar(32)
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice',$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
|
||||||
@ -91,7 +91,7 @@ class Notice extends Memcached_DataObject
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function saveNew($profile_id, $content, $source=NULL, $is_local=1, $reply_to=NULL, $uri=NULL) {
|
static function saveNew($profile_id, $content, $source=null, $is_local=1, $reply_to=null, $uri=null) {
|
||||||
|
|
||||||
$profile = Profile::staticGet($profile_id);
|
$profile = Profile::staticGet($profile_id);
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ class Notice extends Memcached_DataObject
|
|||||||
# XXX: too many args; we need to move to named params or even a separate
|
# XXX: too many args; we need to move to named params or even a separate
|
||||||
# class for notice streams
|
# class for notice streams
|
||||||
|
|
||||||
static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=NULL, $since=NULL) {
|
static function getStream($qry, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $order=null, $since=null) {
|
||||||
|
|
||||||
if (common_config('memcached', 'enabled')) {
|
if (common_config('memcached', 'enabled')) {
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ class Notice extends Memcached_DataObject
|
|||||||
# If outside our cache window, just go to the DB
|
# If outside our cache window, just go to the DB
|
||||||
|
|
||||||
if ($offset + $limit > NOTICE_CACHE_WINDOW) {
|
if ($offset + $limit > NOTICE_CACHE_WINDOW) {
|
||||||
return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL);
|
return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the cache; if we can't, just go to the DB
|
# Get the cache; if we can't, just go to the DB
|
||||||
@ -391,7 +391,7 @@ class Notice extends Memcached_DataObject
|
|||||||
$cache = common_memcache();
|
$cache = common_memcache();
|
||||||
|
|
||||||
if (!$cache) {
|
if (!$cache) {
|
||||||
return Notice::getStreamDirect($qry, $offset, $limit, NULL, NULL, $order, NULL);
|
return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the notices out of the cache
|
# Get the notices out of the cache
|
||||||
@ -423,7 +423,7 @@ class Notice extends Memcached_DataObject
|
|||||||
# bet with our DB.
|
# bet with our DB.
|
||||||
|
|
||||||
$new_notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW,
|
$new_notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW,
|
||||||
$last_id, NULL, $order, NULL);
|
$last_id, null, $order, null);
|
||||||
|
|
||||||
if ($new_notice) {
|
if ($new_notice) {
|
||||||
$new_notices = array();
|
$new_notices = array();
|
||||||
@ -447,7 +447,7 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
# Otherwise, get the full cache window out of the DB
|
# Otherwise, get the full cache window out of the DB
|
||||||
|
|
||||||
$notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, NULL, NULL, $order, NULL);
|
$notice = Notice::getStreamDirect($qry, 0, NOTICE_CACHE_WINDOW, null, null, $order, null);
|
||||||
|
|
||||||
# If there are no hits, just return the value
|
# If there are no hits, just return the value
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ class Notice extends Memcached_DataObject
|
|||||||
return $wrapper;
|
return $wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=NULL) {
|
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null) {
|
||||||
|
|
||||||
$parts = array();
|
$parts = array();
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
return Notice::getStream($qry,
|
return Notice::getStream($qry,
|
||||||
'public',
|
'public',
|
||||||
$offset, $limit, $since_id, $before_id, NULL, $since);
|
$offset, $limit, $since_id, $before_id, null, $since);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToInboxes() {
|
function addToInboxes() {
|
||||||
|
@ -35,7 +35,7 @@ class NoticeWrapper extends Notice {
|
|||||||
public $is_local; // tinyint(1)
|
public $is_local; // tinyint(1)
|
||||||
public $source; // varchar(32)
|
public $source; // varchar(32)
|
||||||
|
|
||||||
var $notices = NULL;
|
var $notices = null;
|
||||||
var $i = -1;
|
var $i = -1;
|
||||||
|
|
||||||
function __construct($arr) {
|
function __construct($arr) {
|
||||||
|
@ -33,7 +33,7 @@ class Notice_inbox extends Memcached_DataObject
|
|||||||
public $source; // tinyint(1) default_1
|
public $source; // tinyint(1) default_1
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_inbox',$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
|
||||||
|
@ -17,7 +17,7 @@ class Notice_source extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_source',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_source',$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
|
||||||
|
@ -30,7 +30,7 @@ class Notice_tag extends Memcached_DataObject
|
|||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Notice_tag',$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
|
||||||
|
@ -41,12 +41,12 @@ class Profile extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile',$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 getAvatar($width, $height=NULL) {
|
function getAvatar($width, $height=null) {
|
||||||
if (is_null($height)) {
|
if (is_null($height)) {
|
||||||
$height = $width;
|
$height = $width;
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ class Profile extends Memcached_DataObject
|
|||||||
if ($avatar->find(true)) {
|
if ($avatar->find(true)) {
|
||||||
return $avatar;
|
return $avatar;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,12 +71,12 @@ class Profile extends Memcached_DataObject
|
|||||||
$info = @getimagesize($source);
|
$info = @getimagesize($source);
|
||||||
|
|
||||||
if (!$info) {
|
if (!$info) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = common_avatar_filename($this->id,
|
$filename = common_avatar_filename($this->id,
|
||||||
image_type_to_extension($info[2]),
|
image_type_to_extension($info[2]),
|
||||||
NULL, common_timestamp());
|
null, common_timestamp());
|
||||||
$filepath = common_avatar_path($filename);
|
$filepath = common_avatar_path($filename);
|
||||||
|
|
||||||
copy($source, $filepath);
|
copy($source, $filepath);
|
||||||
@ -96,12 +96,12 @@ class Profile extends Memcached_DataObject
|
|||||||
|
|
||||||
if (!$this->delete_avatars()) {
|
if (!$this->delete_avatars()) {
|
||||||
@unlink($filepath);
|
@unlink($filepath);
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$avatar->insert()) {
|
if (!$avatar->insert()) {
|
||||||
@unlink($filepath);
|
@unlink($filepath);
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
@ -109,7 +109,7 @@ class Profile extends Memcached_DataObject
|
|||||||
if (!($avatar->width == $size && $avatar->height == $size)) {
|
if (!($avatar->width == $size && $avatar->height == $size)) {
|
||||||
$s = $avatar->scale($size);
|
$s = $avatar->scale($size);
|
||||||
if (!$s) {
|
if (!$s) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ class Profile extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Get latest notice on or before date; default now
|
# Get latest notice on or before date; default now
|
||||||
function getCurrentNotice($dt=NULL) {
|
function getCurrentNotice($dt=null) {
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
$notice->profile_id = $this->id;
|
$notice->profile_id = $this->id;
|
||||||
if ($dt) {
|
if ($dt) {
|
||||||
@ -143,7 +143,7 @@ class Profile extends Memcached_DataObject
|
|||||||
if ($notice->find(true)) {
|
if ($notice->find(true)) {
|
||||||
return $notice;
|
return $notice;
|
||||||
}
|
}
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) {
|
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) {
|
||||||
|
@ -36,7 +36,7 @@ class Profile_block extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_block',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_block',$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
|
||||||
|
@ -16,7 +16,7 @@ class Profile_tag extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Profile_tag',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Profile_tag',$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
|
||||||
|
@ -16,7 +16,7 @@ class Queue_item extends Memcached_DataObject
|
|||||||
public $claimed; // datetime()
|
public $claimed; // datetime()
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Queue_item',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Queue_item',$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
|
||||||
@ -28,7 +28,7 @@ class Queue_item extends Memcached_DataObject
|
|||||||
$qi = new Queue_item();
|
$qi = new Queue_item();
|
||||||
$qi->transport = $transport;
|
$qi->transport = $transport;
|
||||||
$qi->orderBy('created');
|
$qi->orderBy('created');
|
||||||
$qi->whereAdd('claimed is NULL');
|
$qi->whereAdd('claimed is null');
|
||||||
|
|
||||||
$qi->limit(1);
|
$qi->limit(1);
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class Queue_item extends Memcached_DataObject
|
|||||||
|
|
||||||
if ($cnt) {
|
if ($cnt) {
|
||||||
# XXX: potential race condition
|
# XXX: potential race condition
|
||||||
# can we force it to only update if claimed is still NULL
|
# can we force it to only update if claimed is still null
|
||||||
# (or old)?
|
# (or old)?
|
||||||
common_log(LOG_INFO, 'claiming queue item = ' . $qi->notice_id . ' for transport ' . $transport);
|
common_log(LOG_INFO, 'claiming queue item = ' . $qi->notice_id . ' for transport ' . $transport);
|
||||||
$orig = clone($qi);
|
$orig = clone($qi);
|
||||||
@ -49,7 +49,7 @@ class Queue_item extends Memcached_DataObject
|
|||||||
common_log(LOG_INFO, 'claim failed.');
|
common_log(LOG_INFO, 'claim failed.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$qi = NULL;
|
$qi = null;
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ class Remember_me extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remember_me',$k,$v); }
|
function staticGet($k,$v=null) { 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
|
||||||
|
@ -38,7 +38,7 @@ class Remote_profile extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Remote_profile',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Remote_profile',$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
|
||||||
|
@ -16,7 +16,7 @@ class Reply extends Memcached_DataObject
|
|||||||
public $replied_id; // int(4)
|
public $replied_id; // int(4)
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Reply',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Reply',$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
|
||||||
|
@ -17,7 +17,7 @@ class Sms_carrier extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Sms_carrier',$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
|
||||||
|
@ -40,7 +40,7 @@ class Subscription extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Subscription',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Subscription',$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
|
||||||
|
@ -19,7 +19,7 @@ class Token extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Token',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('Token',$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
|
||||||
|
@ -62,7 +62,7 @@ class User extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User',$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
|
||||||
@ -118,10 +118,10 @@ class User extends Memcached_DataObject
|
|||||||
return !in_array($nickname, $merged);
|
return !in_array($nickname, $merged);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentNotice($dt=NULL) {
|
function getCurrentNotice($dt=null) {
|
||||||
$profile = $this->getProfile();
|
$profile = $this->getProfile();
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
return $profile->getCurrentNotice($dt);
|
return $profile->getCurrentNotice($dt);
|
||||||
}
|
}
|
||||||
@ -336,20 +336,20 @@ class User extends Memcached_DataObject
|
|||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
|
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
|
||||||
$qry =
|
$qry =
|
||||||
'SELECT notice.* ' .
|
'SELECT notice.* ' .
|
||||||
'FROM notice JOIN reply ON notice.id = reply.notice_id ' .
|
'FROM notice JOIN reply ON notice.id = reply.notice_id ' .
|
||||||
'WHERE reply.profile_id = %d ';
|
'WHERE reply.profile_id = %d ';
|
||||||
return Notice::getStream(sprintf($qry, $this->id),
|
return Notice::getStream(sprintf($qry, $this->id),
|
||||||
'user:replies:'.$this->id,
|
'user:replies:'.$this->id,
|
||||||
$offset, $limit, $since_id, $before_id, NULL, $since);
|
$offset, $limit, $since_id, $before_id, null, $since);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
|
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
|
||||||
$profile = $this->getProfile();
|
$profile = $this->getProfile();
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return $profile->getNotices($offset, $limit, $since_id, $before_id);
|
return $profile->getNotices($offset, $limit, $since_id, $before_id);
|
||||||
}
|
}
|
||||||
@ -365,7 +365,7 @@ class User extends Memcached_DataObject
|
|||||||
$offset, $limit);
|
$offset, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=NULL) {
|
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) {
|
||||||
$enabled = common_config('inboxes', 'enabled');
|
$enabled = common_config('inboxes', 'enabled');
|
||||||
|
|
||||||
# Complicated code, depending on whether we support inboxes yet
|
# Complicated code, depending on whether we support inboxes yet
|
||||||
@ -377,7 +377,7 @@ class User extends Memcached_DataObject
|
|||||||
'SELECT notice.* ' .
|
'SELECT notice.* ' .
|
||||||
'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' .
|
'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' .
|
||||||
'WHERE subscription.subscriber = %d ';
|
'WHERE subscription.subscriber = %d ';
|
||||||
$order = NULL;
|
$order = null;
|
||||||
} else if ($enabled === true ||
|
} else if ($enabled === true ||
|
||||||
($enabled == 'transitional' && $this->inboxed == 1)) {
|
($enabled == 'transitional' && $this->inboxed == 1)) {
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class User_openid extends Memcached_DataObject
|
|||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User_openid',$k,$v); }
|
function staticGet($k,$v=null) { return Memcached_DataObject::staticGet('User_openid',$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
|
||||||
|
@ -58,16 +58,16 @@ $config =
|
|||||||
'server' => 'localhost',
|
'server' => 'localhost',
|
||||||
'theme' => 'default',
|
'theme' => 'default',
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'logfile' => NULL,
|
'logfile' => null,
|
||||||
'fancy' => false,
|
'fancy' => false,
|
||||||
'locale_path' => INSTALLDIR.'/locale',
|
'locale_path' => INSTALLDIR.'/locale',
|
||||||
'language' => 'en_US',
|
'language' => 'en_US',
|
||||||
'languages' => get_all_languages(),
|
'languages' => get_all_languages(),
|
||||||
'email' =>
|
'email' =>
|
||||||
array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : NULL,
|
array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
|
||||||
'broughtby' => NULL,
|
'broughtby' => null,
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'UTC',
|
||||||
'broughtbyurl' => NULL,
|
'broughtbyurl' => null,
|
||||||
'closed' => false,
|
'closed' => false,
|
||||||
'inviteonly' => false,
|
'inviteonly' => false,
|
||||||
'private' => false),
|
'private' => false),
|
||||||
@ -82,19 +82,19 @@ $config =
|
|||||||
'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'),
|
'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'),
|
||||||
'mail' =>
|
'mail' =>
|
||||||
array('backend' => 'mail',
|
array('backend' => 'mail',
|
||||||
'params' => NULL),
|
'params' => null),
|
||||||
'nickname' =>
|
'nickname' =>
|
||||||
array('blacklist' => array(),
|
array('blacklist' => array(),
|
||||||
'featured' => array()),
|
'featured' => array()),
|
||||||
'profile' =>
|
'profile' =>
|
||||||
array('banned' => array()),
|
array('banned' => array()),
|
||||||
'avatar' =>
|
'avatar' =>
|
||||||
array('server' => NULL),
|
array('server' => null),
|
||||||
'public' =>
|
'public' =>
|
||||||
array('localonly' => true,
|
array('localonly' => true,
|
||||||
'blacklist' => array()),
|
'blacklist' => array()),
|
||||||
'theme' =>
|
'theme' =>
|
||||||
array('server' => NULL),
|
array('server' => null),
|
||||||
'throttle' =>
|
'throttle' =>
|
||||||
array('enabled' => false, // whether to throttle edits; false by default
|
array('enabled' => false, // whether to throttle edits; false by default
|
||||||
'count' => 20, // number of allowed messages in timespan
|
'count' => 20, // number of allowed messages in timespan
|
||||||
@ -107,7 +107,7 @@ $config =
|
|||||||
'encryption' => true,
|
'encryption' => true,
|
||||||
'resource' => 'uniquename',
|
'resource' => 'uniquename',
|
||||||
'password' => 'blahblahblah',
|
'password' => 'blahblahblah',
|
||||||
'host' => NULL, # only set if != server
|
'host' => null, # only set if != server
|
||||||
'debug' => false, # print extra debug info
|
'debug' => false, # print extra debug info
|
||||||
'public' => array()), # JIDs of users who want to receive the public stream
|
'public' => array()), # JIDs of users who want to receive the public stream
|
||||||
'sphinx' =>
|
'sphinx' =>
|
||||||
@ -140,7 +140,7 @@ $config['db'] =
|
|||||||
'class_location' => INSTALLDIR . '/classes',
|
'class_location' => INSTALLDIR . '/classes',
|
||||||
'require_prefix' => 'classes/',
|
'require_prefix' => 'classes/',
|
||||||
'class_prefix' => '',
|
'class_prefix' => '',
|
||||||
'mirror' => NULL,
|
'mirror' => null,
|
||||||
'db_driver' => 'DB', # XXX: JanRain libs only work with DB
|
'db_driver' => 'DB', # XXX: JanRain libs only work with DB
|
||||||
'quote_identifiers' => false,
|
'quote_identifiers' => false,
|
||||||
'type' => 'mysql' );
|
'type' => 'mysql' );
|
||||||
|
@ -43,7 +43,7 @@ class DeleteAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($arr=NULL) {
|
function show_top($arr=null) {
|
||||||
$instr = $this->get_instructions();
|
$instr = $this->get_instructions();
|
||||||
$output = common_markup_to_html($instr);
|
$output = common_markup_to_html($instr);
|
||||||
common_element_start('div', 'instructions');
|
common_element_start('div', 'instructions');
|
||||||
@ -52,7 +52,7 @@ class DeleteAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_title() {
|
function get_title() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_header() {
|
function show_header() {
|
||||||
|
@ -81,7 +81,7 @@ class FacebookAction extends Action {
|
|||||||
|
|
||||||
$fbml_main = "<fb:narrow>$content $html</fb:narrow>";
|
$fbml_main = "<fb:narrow>$content $html</fb:narrow>";
|
||||||
|
|
||||||
$facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main);
|
$facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Display methods
|
# Display methods
|
||||||
@ -235,7 +235,7 @@ class FacebookAction extends Action {
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) {
|
function pagination($have_before, $have_after, $page, $fbaction, $args=null) {
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ class FacebookAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pagination_url($fbaction, $args=NULL) {
|
function pagination_url($fbaction, $args=null) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$extra = '';
|
$extra = '';
|
||||||
|
@ -33,7 +33,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
|
|||||||
$con->seed = common_good_rand(16);
|
$con->seed = common_good_rand(16);
|
||||||
$con->created = DB_DataObject_Cast::dateTime();
|
$con->created = DB_DataObject_Cast::dateTime();
|
||||||
if (!$con->insert()) {
|
if (!$con->insert()) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new OAuthConsumer($con->consumer_key, '');
|
return new OAuthConsumer($con->consumer_key, '');
|
||||||
@ -47,7 +47,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
|
|||||||
if ($t->find(true)) {
|
if ($t->find(true)) {
|
||||||
return new OAuthToken($t->tok, $t->secret);
|
return new OAuthToken($t->tok, $t->secret);
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
|
|||||||
$t->state = 0; # unauthorized
|
$t->state = 0; # unauthorized
|
||||||
$t->created = DB_DataObject_Cast::dateTime();
|
$t->created = DB_DataObject_Cast::dateTime();
|
||||||
if (!$t->insert()) {
|
if (!$t->insert()) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return new OAuthToken($t->tok, $t->secret);
|
return new OAuthToken($t->tok, $t->secret);
|
||||||
}
|
}
|
||||||
@ -104,35 +104,35 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
|
|||||||
if (!$at->insert()) {
|
if (!$at->insert()) {
|
||||||
$e = $at->_lastError;
|
$e = $at->_lastError;
|
||||||
common_debug('access token "'.$at->tok.'" not inserted: "'.$e->message.'"', __FILE__);
|
common_debug('access token "'.$at->tok.'" not inserted: "'.$e->message.'"', __FILE__);
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
common_debug('access token "'.$at->tok.'" inserted', __FILE__);
|
common_debug('access token "'.$at->tok.'" inserted', __FILE__);
|
||||||
# burn the old one
|
# burn the old one
|
||||||
$orig_rt = clone($rt);
|
$orig_rt = clone($rt);
|
||||||
$rt->state = 2; # used
|
$rt->state = 2; # used
|
||||||
if (!$rt->update($orig_rt)) {
|
if (!$rt->update($orig_rt)) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
common_debug('request token "'.$rt->tok.'" updated', __FILE__);
|
common_debug('request token "'.$rt->tok.'" updated', __FILE__);
|
||||||
# Update subscription
|
# Update subscription
|
||||||
# XXX: mixing levels here
|
# XXX: mixing levels here
|
||||||
$sub = Subscription::staticGet('token', $rt->tok);
|
$sub = Subscription::staticGet('token', $rt->tok);
|
||||||
if (!$sub) {
|
if (!$sub) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
common_debug('subscription for request token found', __FILE__);
|
common_debug('subscription for request token found', __FILE__);
|
||||||
$orig_sub = clone($sub);
|
$orig_sub = clone($sub);
|
||||||
$sub->token = $at->tok;
|
$sub->token = $at->tok;
|
||||||
$sub->secret = $at->secret;
|
$sub->secret = $at->secret;
|
||||||
if (!$sub->update($orig_sub)) {
|
if (!$sub->update($orig_sub)) {
|
||||||
return NULL;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
common_debug('subscription updated to use access token', __FILE__);
|
common_debug('subscription updated to use access token', __FILE__);
|
||||||
return new OAuthToken($at->tok, $at->secret);
|
return new OAuthToken($at->tok, $at->secret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ define('OAUTH_POST_BODY', OAUTH_NAMESPACE.'parameters/post-body');
|
|||||||
define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1');
|
define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1');
|
||||||
|
|
||||||
function omb_oauth_consumer() {
|
function omb_oauth_consumer() {
|
||||||
static $con = NULL;
|
static $con = null;
|
||||||
if (!$con) {
|
if (!$con) {
|
||||||
$con = new OAuthConsumer(common_root_url(), '');
|
$con = new OAuthConsumer(common_root_url(), '');
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ function omb_oauth_server() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function omb_oauth_datastore() {
|
function omb_oauth_datastore() {
|
||||||
static $store = NULL;
|
static $store = null;
|
||||||
if (!$store) {
|
if (!$store) {
|
||||||
$store = new LaconicaOAuthDataStore();
|
$store = new LaconicaOAuthDataStore();
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ function omb_oauth_datastore() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function omb_hmac_sha1() {
|
function omb_hmac_sha1() {
|
||||||
static $hmac_method = NULL;
|
static $hmac_method = null;
|
||||||
if (!$hmac_method) {
|
if (!$hmac_method) {
|
||||||
$hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
|
$hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
|
||||||
}
|
}
|
||||||
@ -91,22 +91,22 @@ function omb_match_service($service, $type) {
|
|||||||
|
|
||||||
function omb_service_uri($service) {
|
function omb_service_uri($service) {
|
||||||
if (!$service) {
|
if (!$service) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$uris = $service->getURIs();
|
$uris = $service->getURIs();
|
||||||
if (!$uris) {
|
if (!$uris) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
return $uris[0];
|
return $uris[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function omb_local_id($service) {
|
function omb_local_id($service) {
|
||||||
if (!$service) {
|
if (!$service) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$els = $service->getElements('xrd:LocalID');
|
$els = $service->getElements('xrd:LocalID');
|
||||||
if (!$els) {
|
if (!$els) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
$el = $els[0];
|
$el = $els[0];
|
||||||
return $service->parser->content($el);
|
return $service->parser->content($el);
|
||||||
|
@ -32,7 +32,7 @@ define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60));
|
|||||||
define('OPENID_COOKIE_KEY', 'lastusedopenid');
|
define('OPENID_COOKIE_KEY', 'lastusedopenid');
|
||||||
|
|
||||||
function oid_store() {
|
function oid_store() {
|
||||||
static $store = NULL;
|
static $store = null;
|
||||||
if (!$store) {
|
if (!$store) {
|
||||||
# Can't be called statically
|
# Can't be called statically
|
||||||
$user = new User();
|
$user = new User();
|
||||||
@ -63,7 +63,7 @@ function oid_get_last() {
|
|||||||
if ($openid_url && strlen($openid_url) > 0) {
|
if ($openid_url && strlen($openid_url) > 0) {
|
||||||
return $openid_url;
|
return $openid_url;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ function oid_link_user($id, $canonical, $display) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function oid_get_user($openid_url) {
|
function oid_get_user($openid_url) {
|
||||||
$user = NULL;
|
$user = null;
|
||||||
$oid = User_openid::staticGet('canonical', $openid_url);
|
$oid = User_openid::staticGet('canonical', $openid_url);
|
||||||
if ($oid) {
|
if ($oid) {
|
||||||
$user = User::staticGet('id', $oid->user_id);
|
$user = User::staticGet('id', $oid->user_id);
|
||||||
@ -93,7 +93,7 @@ function oid_get_user($openid_url) {
|
|||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
function oid_check_immediate($openid_url, $backto=NULL) {
|
function oid_check_immediate($openid_url, $backto=null) {
|
||||||
if (!$backto) {
|
if (!$backto) {
|
||||||
$action = $_REQUEST['action'];
|
$action = $_REQUEST['action'];
|
||||||
$args = common_copy_args($_GET);
|
$args = common_copy_args($_GET);
|
||||||
@ -177,9 +177,9 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) {
|
|||||||
if (Auth_OpenID::isFailure($form_html)) {
|
if (Auth_OpenID::isFailure($form_html)) {
|
||||||
$this->show_form(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
|
$this->show_form(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
|
||||||
} else {
|
} else {
|
||||||
common_show_header(_('OpenID Auto-Submit'), NULL, NULL, '_oid_print_instructions');
|
common_show_header(_('OpenID Auto-Submit'), null, null, '_oid_print_instructions');
|
||||||
common_raw($form_html);
|
common_raw($form_html);
|
||||||
common_element('script', NULL,
|
common_element('script', null,
|
||||||
'$(document).ready(function() { ' .
|
'$(document).ready(function() { ' .
|
||||||
' $("#'. $form_id .'").submit(); '.
|
' $("#'. $form_id .'").submit(); '.
|
||||||
'});');
|
'});');
|
||||||
|
@ -32,7 +32,7 @@ class PersonalAction extends Action {
|
|||||||
|
|
||||||
function views_menu() {
|
function views_menu() {
|
||||||
|
|
||||||
$user = NULL;
|
$user = null;
|
||||||
$action = $this->trimmed('action');
|
$action = $this->trimmed('action');
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
|
|
||||||
|
@ -24,11 +24,11 @@ define('PROFILES_PER_PAGE', 20);
|
|||||||
|
|
||||||
class ProfileList {
|
class ProfileList {
|
||||||
|
|
||||||
var $profile = NULL;
|
var $profile = null;
|
||||||
var $owner = NULL;
|
var $owner = null;
|
||||||
var $action = NULL;
|
var $action = null;
|
||||||
|
|
||||||
function __construct($profile, $owner=NULL, $action=NULL) {
|
function __construct($profile, $owner=null, $action=null) {
|
||||||
$this->profile = $profile;
|
$this->profile = $profile;
|
||||||
$this->owner = $owner;
|
$this->owner = $owner;
|
||||||
$this->action = $action;
|
$this->action = $action;
|
||||||
|
@ -29,7 +29,7 @@ class QueueHandler extends Daemon {
|
|||||||
|
|
||||||
var $_id = 'generic';
|
var $_id = 'generic';
|
||||||
|
|
||||||
function QueueHandler($id=NULL) {
|
function QueueHandler($id=null) {
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$this->set_id($id);
|
$this->set_id($id);
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ class QueueHandler extends Daemon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function transport() {
|
function transport() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
@ -83,7 +83,7 @@ class QueueHandler extends Daemon {
|
|||||||
if (!$result) {
|
if (!$result) {
|
||||||
$this->log(LOG_WARNING, 'Failed broadcast for notice ID = ' . $notice->id);
|
$this->log(LOG_WARNING, 'Failed broadcast for notice ID = ' . $notice->id);
|
||||||
$orig = $qi;
|
$orig = $qi;
|
||||||
$qi->claimed = NULL;
|
$qi->claimed = null;
|
||||||
$qi->update($orig);
|
$qi->update($orig);
|
||||||
$this->log(LOG_WARNING, 'Abandoned claim for notice ID = ' . $notice->id);
|
$this->log(LOG_WARNING, 'Abandoned claim for notice ID = ' . $notice->id);
|
||||||
continue;
|
continue;
|
||||||
@ -91,7 +91,7 @@ class QueueHandler extends Daemon {
|
|||||||
$this->log(LOG_INFO, 'finished broadcasting notice ID = ' . $notice->id);
|
$this->log(LOG_INFO, 'finished broadcasting notice ID = ' . $notice->id);
|
||||||
$notice->free();
|
$notice->free();
|
||||||
unset($notice);
|
unset($notice);
|
||||||
$notice = NULL;
|
$notice = null;
|
||||||
} else {
|
} else {
|
||||||
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
|
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class Rss10Action extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_image() {
|
function get_image() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_rss($limit=0) {
|
function show_rss($limit=0) {
|
||||||
@ -84,9 +84,9 @@ class Rss10Action extends Action {
|
|||||||
$image = $this->get_image();
|
$image = $this->get_image();
|
||||||
|
|
||||||
common_element_start('channel', array('rdf:about' => $channel['url']));
|
common_element_start('channel', array('rdf:about' => $channel['url']));
|
||||||
common_element('title', NULL, $channel['title']);
|
common_element('title', null, $channel['title']);
|
||||||
common_element('link', NULL, $channel['link']);
|
common_element('link', null, $channel['link']);
|
||||||
common_element('description', NULL, $channel['description']);
|
common_element('description', null, $channel['description']);
|
||||||
common_element('cc:licence', array('rdf:resource' => common_config('license','url')));
|
common_element('cc:licence', array('rdf:resource' => common_config('license','url')));
|
||||||
|
|
||||||
if ($image) {
|
if ($image) {
|
||||||
@ -111,9 +111,9 @@ class Rss10Action extends Action {
|
|||||||
if ($image) {
|
if ($image) {
|
||||||
$channel = $this->get_channel();
|
$channel = $this->get_channel();
|
||||||
common_element_start('image', array('rdf:about' => $image));
|
common_element_start('image', array('rdf:about' => $image));
|
||||||
common_element('title', NULL, $channel['title']);
|
common_element('title', null, $channel['title']);
|
||||||
common_element('link', NULL, $channel['link']);
|
common_element('link', null, $channel['link']);
|
||||||
common_element('url', NULL, $image);
|
common_element('url', null, $image);
|
||||||
common_element_end('image');
|
common_element_end('image');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,11 +124,11 @@ class Rss10Action extends Action {
|
|||||||
$creator_uri = common_profile_uri($profile);
|
$creator_uri = common_profile_uri($profile);
|
||||||
common_element_start('item', array('rdf:about' => $notice->uri));
|
common_element_start('item', array('rdf:about' => $notice->uri));
|
||||||
$title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
|
$title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
|
||||||
common_element('title', NULL, $title);
|
common_element('title', null, $title);
|
||||||
common_element('link', NULL, $nurl);
|
common_element('link', null, $nurl);
|
||||||
common_element('description', NULL, $profile->nickname."'s status on ".common_exact_date($notice->created));
|
common_element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created));
|
||||||
common_element('dc:date', NULL, common_date_w3dtf($notice->created));
|
common_element('dc:date', null, common_date_w3dtf($notice->created));
|
||||||
common_element('dc:creator', NULL, ($profile->fullname) ? $profile->fullname : $profile->nickname);
|
common_element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
|
||||||
common_element('sioc:has_creator', array('rdf:resource' => $creator_uri));
|
common_element('sioc:has_creator', array('rdf:resource' => $creator_uri));
|
||||||
common_element('laconica:postIcon', array('rdf:resource' => common_profile_avatar_url($profile)));
|
common_element('laconica:postIcon', array('rdf:resource' => common_profile_avatar_url($profile)));
|
||||||
common_element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
|
common_element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
|
||||||
@ -141,11 +141,11 @@ class Rss10Action extends Action {
|
|||||||
$id = $profile->id;
|
$id = $profile->id;
|
||||||
$nickname = $profile->nickname;
|
$nickname = $profile->nickname;
|
||||||
common_element_start('sioc:User', array('rdf:about' => $uri));
|
common_element_start('sioc:User', array('rdf:about' => $uri));
|
||||||
common_element('foaf:nick', NULL, $nickname);
|
common_element('foaf:nick', null, $nickname);
|
||||||
if ($profile->fullname) {
|
if ($profile->fullname) {
|
||||||
common_element('foaf:name', NULL, $profile->fullname);
|
common_element('foaf:name', null, $profile->fullname);
|
||||||
}
|
}
|
||||||
common_element('sioc:id', NULL, $id);
|
common_element('sioc:id', null, $id);
|
||||||
$avatar = common_profile_avatar_url($profile);
|
$avatar = common_profile_avatar_url($profile);
|
||||||
common_element('sioc:avatar', array('rdf:resource' => $avatar));
|
common_element('sioc:avatar', array('rdf:resource' => $avatar));
|
||||||
common_element_end('sioc:User');
|
common_element_end('sioc:User');
|
||||||
@ -175,7 +175,7 @@ class Rss10Action extends Action {
|
|||||||
'http://laconi.ca/ont/',
|
'http://laconi.ca/ont/',
|
||||||
'xmlns' => 'http://purl.org/rss/1.0/'));
|
'xmlns' => 'http://purl.org/rss/1.0/'));
|
||||||
common_element_start('sioc:Site', array('rdf:about' => common_root_url()));
|
common_element_start('sioc:Site', array('rdf:about' => common_root_url()));
|
||||||
common_element('sioc:name', NULL, common_config('site', 'name'));
|
common_element('sioc:name', null, common_config('site', 'name'));
|
||||||
common_element_start('sioc:container_of');
|
common_element_start('sioc:container_of');
|
||||||
common_element('sioc:Container', array('rdf:about' =>
|
common_element('sioc:Container', array('rdf:about' =>
|
||||||
$channel['url']));
|
$channel['url']));
|
||||||
|
@ -30,7 +30,7 @@ class SearchAction extends Action {
|
|||||||
$this->show_form();
|
$this->show_form();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_top($arr=NULL) {
|
function show_top($arr=null) {
|
||||||
if ($arr) {
|
if ($arr) {
|
||||||
$error = $arr[1];
|
$error = $arr[1];
|
||||||
}
|
}
|
||||||
@ -47,14 +47,14 @@ class SearchAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_title() {
|
function get_title() {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_header($arr) {
|
function show_header($arr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($error=NULL) {
|
function show_form($error=null) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$q = $this->trimmed('q');
|
$q = $this->trimmed('q');
|
||||||
@ -99,11 +99,11 @@ class SearchAction extends Action {
|
|||||||
array(
|
array(
|
||||||
_('People'),
|
_('People'),
|
||||||
_('Find people on this site'),
|
_('Find people on this site'),
|
||||||
($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL),
|
($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null),
|
||||||
'noticesearch' =>
|
'noticesearch' =>
|
||||||
array( _('Text'),
|
array( _('Text'),
|
||||||
_('Find content of notices'),
|
_('Find content of notices'),
|
||||||
($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL)
|
($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : null)
|
||||||
);
|
);
|
||||||
$this->nav_menu($menu);
|
$this->nav_menu($menu);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ class SettingsAction extends Action {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_form($msg=NULL, $success=false) {
|
function show_form($msg=null, $success=false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,9 +55,9 @@ class SettingsAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_header($title, $msg=NULL, $success=false) {
|
function form_header($title, $msg=null, $success=false) {
|
||||||
common_show_header($title,
|
common_show_header($title,
|
||||||
NULL,
|
null,
|
||||||
array($msg, $success),
|
array($msg, $success),
|
||||||
array($this, 'show_top'));
|
array($this, 'show_top'));
|
||||||
}
|
}
|
||||||
|
@ -148,13 +148,13 @@ function retreive_twitter_friends($twitter_id, $screen_name, $password) {
|
|||||||
$data = get_twitter_data($uri . $i, $screen_name, $password);
|
$data = get_twitter_data($uri . $i, $screen_name, $password);
|
||||||
|
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$more_friends = json_decode($data);
|
$more_friends = json_decode($data);
|
||||||
|
|
||||||
if (!$more_friends) {
|
if (!$more_friends) {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$friends = array_merge($friends, $more_friends);
|
$friends = array_merge($friends, $more_friends);
|
||||||
|
@ -34,15 +34,15 @@ class TwitterapiAction extends Action {
|
|||||||
$twitter_user['name'] = $profile->getBestName();
|
$twitter_user['name'] = $profile->getBestName();
|
||||||
$twitter_user['followers_count'] = $this->count_subscriptions($profile);
|
$twitter_user['followers_count'] = $this->count_subscriptions($profile);
|
||||||
$twitter_user['screen_name'] = $profile->nickname;
|
$twitter_user['screen_name'] = $profile->nickname;
|
||||||
$twitter_user['description'] = ($profile->bio) ? $profile->bio : NULL;
|
$twitter_user['description'] = ($profile->bio) ? $profile->bio : null;
|
||||||
$twitter_user['location'] = ($profile->location) ? $profile->location : NULL;
|
$twitter_user['location'] = ($profile->location) ? $profile->location : null;
|
||||||
$twitter_user['id'] = intval($profile->id);
|
$twitter_user['id'] = intval($profile->id);
|
||||||
|
|
||||||
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
|
||||||
|
|
||||||
$twitter_user['profile_image_url'] = ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE);
|
$twitter_user['profile_image_url'] = ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE);
|
||||||
$twitter_user['protected'] = 'false'; # not supported by Laconica yet
|
$twitter_user['protected'] = 'false'; # not supported by Laconica yet
|
||||||
$twitter_user['url'] = ($profile->homepage) ? $profile->homepage : NULL;
|
$twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null;
|
||||||
|
|
||||||
if ($get_notice) {
|
if ($get_notice) {
|
||||||
$notice = $profile->getCurrentNotice();
|
$notice = $profile->getCurrentNotice();
|
||||||
@ -63,10 +63,10 @@ class TwitterapiAction extends Action {
|
|||||||
$twitter_status['text'] = $notice->content;
|
$twitter_status['text'] = $notice->content;
|
||||||
$twitter_status['truncated'] = 'false'; # Not possible on Laconica
|
$twitter_status['truncated'] = 'false'; # Not possible on Laconica
|
||||||
$twitter_status['created_at'] = $this->date_twitter($notice->created);
|
$twitter_status['created_at'] = $this->date_twitter($notice->created);
|
||||||
$twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : NULL;
|
$twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : null;
|
||||||
$twitter_status['source'] = $this->source_link($notice->source);
|
$twitter_status['source'] = $this->source_link($notice->source);
|
||||||
$twitter_status['id'] = intval($notice->id);
|
$twitter_status['id'] = intval($notice->id);
|
||||||
$twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : NULL;
|
$twitter_status['in_reply_to_user_id'] = ($notice->reply_to) ? $this->replier_by_reply(intval($notice->reply_to)) : null;
|
||||||
|
|
||||||
if (isset($this->auth_user)) {
|
if (isset($this->auth_user)) {
|
||||||
$twitter_status['favorited'] = ($this->auth_user->hasFave($notice)) ? 'true' : 'false';
|
$twitter_status['favorited'] = ($this->auth_user->hasFave($notice)) ? 'true' : 'false';
|
||||||
@ -157,10 +157,10 @@ class TwitterapiAction extends Action {
|
|||||||
$this->show_twitter_xml_user($twitter_status['user']);
|
$this->show_twitter_xml_user($twitter_status['user']);
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
common_element($element, NULL, common_xml_safe_str($value));
|
common_element($element, null, common_xml_safe_str($value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
common_element($element, NULL, $value);
|
common_element($element, null, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
common_element_end('status');
|
common_element_end('status');
|
||||||
@ -172,7 +172,7 @@ class TwitterapiAction extends Action {
|
|||||||
if ($element == 'status') {
|
if ($element == 'status') {
|
||||||
$this->show_twitter_xml_status($twitter_user['status']);
|
$this->show_twitter_xml_status($twitter_user['status']);
|
||||||
} else {
|
} else {
|
||||||
common_element($element, NULL, $value);
|
common_element($element, null, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
common_element_end($role);
|
common_element_end($role);
|
||||||
@ -180,22 +180,22 @@ class TwitterapiAction extends Action {
|
|||||||
|
|
||||||
function show_twitter_rss_item($entry) {
|
function show_twitter_rss_item($entry) {
|
||||||
common_element_start('item');
|
common_element_start('item');
|
||||||
common_element('title', NULL, $entry['title']);
|
common_element('title', null, $entry['title']);
|
||||||
common_element('description', NULL, $entry['description']);
|
common_element('description', null, $entry['description']);
|
||||||
common_element('pubDate', NULL, $entry['pubDate']);
|
common_element('pubDate', null, $entry['pubDate']);
|
||||||
common_element('guid', NULL, $entry['guid']);
|
common_element('guid', null, $entry['guid']);
|
||||||
common_element('link', NULL, $entry['link']);
|
common_element('link', null, $entry['link']);
|
||||||
common_element_end('item');
|
common_element_end('item');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_twitter_atom_entry($entry) {
|
function show_twitter_atom_entry($entry) {
|
||||||
common_element_start('entry');
|
common_element_start('entry');
|
||||||
common_element('title', NULL, $entry['title']);
|
common_element('title', null, $entry['title']);
|
||||||
common_element('content', array('type' => 'html'), $entry['content']);
|
common_element('content', array('type' => 'html'), $entry['content']);
|
||||||
common_element('id', NULL, $entry['id']);
|
common_element('id', null, $entry['id']);
|
||||||
common_element('published', NULL, $entry['published']);
|
common_element('published', null, $entry['published']);
|
||||||
common_element('updated', NULL, $entry['updated']);
|
common_element('updated', null, $entry['updated']);
|
||||||
common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), NULL);
|
common_element('link', array('href' => $entry['link'], 'rel' => 'alternate', 'type' => 'text/html'), null);
|
||||||
common_element_end('entry');
|
common_element_end('entry');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,10 +240,10 @@ class TwitterapiAction extends Action {
|
|||||||
$this->show_twitter_xml_user($value, $element);
|
$this->show_twitter_xml_user($value, $element);
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
common_element($element, NULL, common_xml_safe_str($value));
|
common_element($element, null, common_xml_safe_str($value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
common_element($element, NULL, $value);
|
common_element($element, null, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
common_element_end('direct_message');
|
common_element_end('direct_message');
|
||||||
@ -270,13 +270,13 @@ class TwitterapiAction extends Action {
|
|||||||
$this->end_document('xml');
|
$this->end_document('xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=NULL) {
|
function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=null) {
|
||||||
|
|
||||||
$this->init_document('rss');
|
$this->init_document('rss');
|
||||||
|
|
||||||
common_element_start('channel');
|
common_element_start('channel');
|
||||||
common_element('title', NULL, $title);
|
common_element('title', null, $title);
|
||||||
common_element('link', NULL, $link);
|
common_element('link', null, $link);
|
||||||
if (!is_null($suplink)) {
|
if (!is_null($suplink)) {
|
||||||
# For FriendFeed's SUP protocol
|
# For FriendFeed's SUP protocol
|
||||||
common_element('link', array('xmlns' => 'http://www.w3.org/2005/Atom',
|
common_element('link', array('xmlns' => 'http://www.w3.org/2005/Atom',
|
||||||
@ -284,9 +284,9 @@ class TwitterapiAction extends Action {
|
|||||||
'href' => $suplink,
|
'href' => $suplink,
|
||||||
'type' => 'application/json'));
|
'type' => 'application/json'));
|
||||||
}
|
}
|
||||||
common_element('description', NULL, $subtitle);
|
common_element('description', null, $subtitle);
|
||||||
common_element('language', NULL, 'en-us');
|
common_element('language', null, 'en-us');
|
||||||
common_element('ttl', NULL, '40');
|
common_element('ttl', null, '40');
|
||||||
|
|
||||||
if (is_array($notice)) {
|
if (is_array($notice)) {
|
||||||
foreach ($notice as $n) {
|
foreach ($notice as $n) {
|
||||||
@ -304,20 +304,20 @@ class TwitterapiAction extends Action {
|
|||||||
$this->end_twitter_rss();
|
$this->end_twitter_rss();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_atom_timeline($notice, $title, $id, $link, $subtitle=NULL, $suplink=NULL) {
|
function show_atom_timeline($notice, $title, $id, $link, $subtitle=null, $suplink=null) {
|
||||||
|
|
||||||
$this->init_document('atom');
|
$this->init_document('atom');
|
||||||
|
|
||||||
common_element('title', NULL, $title);
|
common_element('title', null, $title);
|
||||||
common_element('id', NULL, $id);
|
common_element('id', null, $id);
|
||||||
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL);
|
common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
|
||||||
if (!is_null($suplink)) {
|
if (!is_null($suplink)) {
|
||||||
# For FriendFeed's SUP protocol
|
# For FriendFeed's SUP protocol
|
||||||
common_element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
|
common_element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
|
||||||
'href' => $suplink,
|
'href' => $suplink,
|
||||||
'type' => 'application/json'));
|
'type' => 'application/json'));
|
||||||
}
|
}
|
||||||
common_element('subtitle', NULL, $subtitle);
|
common_element('subtitle', null, $subtitle);
|
||||||
|
|
||||||
if (is_array($notice)) {
|
if (is_array($notice)) {
|
||||||
foreach ($notice as $n) {
|
foreach ($notice as $n) {
|
||||||
@ -377,7 +377,7 @@ class TwitterapiAction extends Action {
|
|||||||
} else {
|
} else {
|
||||||
common_debug("Can't get notice: $reply_id", __FILE__);
|
common_debug("Can't get notice: $reply_id", __FILE__);
|
||||||
}
|
}
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: Candidate for a general utility method somewhere?
|
// XXX: Candidate for a general utility method somewhere?
|
||||||
@ -488,8 +488,8 @@ class TwitterapiAction extends Action {
|
|||||||
if ($content_type == 'xml') {
|
if ($content_type == 'xml') {
|
||||||
$this->init_document('xml');
|
$this->init_document('xml');
|
||||||
common_element_start('hash');
|
common_element_start('hash');
|
||||||
common_element('error', NULL, $msg);
|
common_element('error', null, $msg);
|
||||||
common_element('request', NULL, $_SERVER['REQUEST_URI']);
|
common_element('request', null, $_SERVER['REQUEST_URI']);
|
||||||
common_element_end('hash');
|
common_element_end('hash');
|
||||||
$this->end_document('xml');
|
$this->end_document('xml');
|
||||||
} else {
|
} else {
|
||||||
@ -521,7 +521,7 @@ class TwitterapiAction extends Action {
|
|||||||
common_element_end('feed');
|
common_element_end('feed');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_profile($profile, $content_type='xml', $notice=NULL) {
|
function show_profile($profile, $content_type='xml', $notice=null) {
|
||||||
$profile_array = $this->twitter_user_array($profile, true);
|
$profile_array = $this->twitter_user_array($profile, true);
|
||||||
switch ($content_type) {
|
switch ($content_type) {
|
||||||
case 'xml':
|
case 'xml':
|
||||||
@ -537,7 +537,7 @@ class TwitterapiAction extends Action {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_user($id, $apidata=NULL) {
|
function get_user($id, $apidata=null) {
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
return $apidata['user'];
|
return $apidata['user'];
|
||||||
} else if (is_numeric($id)) {
|
} else if (is_numeric($id)) {
|
||||||
@ -556,7 +556,7 @@ class TwitterapiAction extends Action {
|
|||||||
if ($user) {
|
if ($user) {
|
||||||
return $user->getProfile();
|
return $user->getProfile();
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user