forked from GNUsocial/gnu-social
Merge branch '0.9.x' into finish-account-api
* 0.9.x: (26 commits) just sent a http 200 for the check-fancy from install.php Add a new event: CanUserChangeField shorten flag notification and include a class Added flag icon for UserFlag plugin Fixed notice option alignment in IE add a method to Theme class to list available themes Updated Realtime plugin to use the util's NoticeReply object Localisation updates from translatewiki.net (2009-11-08) Update pot again Rebuild pot file *without* --join-existing to get rid of the cruft. Not sure why "--join-existing" must be in. Only thing I can think of is manual additions, which I could not find. Revert "More precise field label" Remove more contractions Revert "* [Cc]an't -> [Cc]annot" Revert "More specifics on 'address'" * [Cc]an't -> [Cc]annot Revert "* check usage of 'people' in UI and change it to 'users' or something else in most places" add utilities for calculating local and installation theme root dirs Harmonise UI message "No such user." Restructure theme.php to define a class Theme entity_action responses look more inactive now ...
This commit is contained in:
commit
cae06a49ea
@ -489,6 +489,10 @@ ChangePassword: Handle a password change request
|
|||||||
- $newpassword: the desired new password
|
- $newpassword: the desired new password
|
||||||
- &$errormsg: set this to an error message if the password could not be changed. If the password was changed, leave this as false
|
- &$errormsg: set this to an error message if the password could not be changed. If the password was changed, leave this as false
|
||||||
|
|
||||||
|
CanUserChangeField: Determines if a user is allowed to change a specific profile field
|
||||||
|
- $nickname: nickname of the user who would like to know which of their profile fields are mutable
|
||||||
|
- $field: name of the field the user wants to change (nickname, fullname, password, avatar, etc)
|
||||||
|
|
||||||
UserDeleteRelated: Specify additional tables to delete entries from when deleting users
|
UserDeleteRelated: Specify additional tables to delete entries from when deleting users
|
||||||
- $user: User object
|
- $user: User object
|
||||||
- &$related: array of DB_DataObject class names to delete entries on matching user_id.
|
- &$related: array of DB_DataObject class names to delete entries on matching user_id.
|
||||||
|
@ -129,7 +129,7 @@ class AllAction extends ProfileAction
|
|||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
$current_user = common_current_user();
|
$current_user = common_current_user();
|
||||||
if ($this->user->id === $current_user->id) {
|
if ($this->user->id === $current_user->id) {
|
||||||
$message .= _('Try subscribing to more users, [join a group](%%action.groups%%) or post something yourself.');
|
$message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.');
|
||||||
} else {
|
} else {
|
||||||
$message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
|
$message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class AllrssAction extends Rss10Action
|
|||||||
*
|
*
|
||||||
* @param array $args Web and URL arguments
|
* @param array $args Web and URL arguments
|
||||||
*
|
*
|
||||||
* @return boolean false if user doesn't exist
|
* @return boolean false if user does not exist
|
||||||
*/
|
*/
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ if (!defined('STATUSNET')) {
|
|||||||
require_once INSTALLDIR . '/lib/apibareauth.php';
|
require_once INSTALLDIR . '/lib/apibareauth.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We don't have a rate limit, but some clients check this method.
|
* We do not have a rate limit, but some clients check this method.
|
||||||
* It always returns the same thing: 150 hits left.
|
* It always returns the same thing: 150 hits left.
|
||||||
*
|
*
|
||||||
* @category API
|
* @category API
|
||||||
|
@ -94,7 +94,7 @@ class ApiBlockCreateAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user) || empty($this->other)) {
|
if (empty($this->user) || empty($this->other)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class ApiBlockDestroyAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user) || empty($this->other)) {
|
if (empty($this->user) || empty($this->other)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class ApiDirectMessageAction extends ApiAuthAction
|
|||||||
$this->user = $this->auth_user;
|
$this->user = $this->auth_user;
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
|
|||||||
$this->user = $this->auth_user;
|
$this->user = $this->auth_user;
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow unsubscribing from yourself!
|
// Do not allow unsubscribing from yourself!
|
||||||
|
|
||||||
if ($this->user->id == $this->other->id) {
|
if ($this->user->id == $this->other->id) {
|
||||||
$this->clientError(
|
$this->clientError(
|
||||||
|
@ -109,7 +109,7 @@ class ApiGroupCreateAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
|
|||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ApiGroupJoinAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class ApiGroupListAction extends ApiBareAuthAction
|
|||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
|
|||||||
$this->user = $this->getTargetUser($this->arg('id'));
|
$this->user = $this->getTargetUser($this->arg('id'));
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
|
|||||||
$this->user = $this->getTargetUser($this->arg('id'));
|
$this->user = $this->getTargetUser($this->arg('id'));
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
|
|||||||
$this->user = $this->getTargetUser($this->arg('id'));
|
$this->user = $this->getTargetUser($this->arg('id'));
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
|
|||||||
$this->user = $this->getTargetUser($this->arg('id'));
|
$this->user = $this->getTargetUser($this->arg('id'));
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
|
|||||||
$this->user = $this->getTargetUser($this->arg('id'));
|
$this->user = $this->getTargetUser($this->arg('id'));
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$this->clientError(_('No such user!'), 404, $this->format);
|
$this->clientError(_('No such user.'), 404, $this->format);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class AttachmentAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show local navigation
|
* Do not show local navigation
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -170,7 +170,7 @@ class AttachmentAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show page notice
|
* Do not show page notice
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -49,7 +49,7 @@ class AvatarbynicknameAction extends Action
|
|||||||
*
|
*
|
||||||
* @param array $args query arguments
|
* @param array $args query arguments
|
||||||
*
|
*
|
||||||
* @return boolean false if nickname or user isn't found
|
* @return boolean false if nickname or user is not found
|
||||||
*/
|
*/
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ class DeletenoticeAction extends Action
|
|||||||
common_user_error(_('Not logged in.'));
|
common_user_error(_('Not logged in.'));
|
||||||
exit;
|
exit;
|
||||||
} else if ($this->notice->profile_id != $this->user_profile->id &&
|
} else if ($this->notice->profile_id != $this->user_profile->id &&
|
||||||
!$this->user->hasRight(Right::deleteOthersNotice)) {
|
!$this->user->hasRight(Right::DELETEOTHERSNOTICE)) {
|
||||||
common_user_error(_('Can\'t delete this notice.'));
|
common_user_error(_('Can\'t delete this notice.'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class FoafAction extends Action
|
|||||||
$person = $this->showMicrobloggingAccount($this->profile,
|
$person = $this->showMicrobloggingAccount($this->profile,
|
||||||
common_root_url(), $this->user->uri, false);
|
common_root_url(), $this->user->uri, false);
|
||||||
|
|
||||||
// Get users who subscribe to user
|
// Get people who subscribe to user
|
||||||
|
|
||||||
$sub = new Subscription();
|
$sub = new Subscription();
|
||||||
$sub->subscribed = $this->profile->id;
|
$sub->subscribed = $this->profile->id;
|
||||||
@ -250,7 +250,7 @@ class FoafAction extends Action
|
|||||||
if ($isSubscriber) {
|
if ($isSubscriber) {
|
||||||
$this->element('sioc:follows', array('rdf:resource'=>$this->user->uri . '#acct'));
|
$this->element('sioc:follows', array('rdf:resource'=>$this->user->uri . '#acct'));
|
||||||
} else {
|
} else {
|
||||||
// Get users user is subscribed to
|
// Get people user is subscribed to
|
||||||
$sub = new Subscription();
|
$sub = new Subscription();
|
||||||
$sub->subscriber = $profile->id;
|
$sub->subscriber = $profile->id;
|
||||||
$sub->whereAdd('subscriber != subscribed');
|
$sub->whereAdd('subscriber != subscribed');
|
||||||
|
@ -95,7 +95,7 @@ class GroupblockAction extends Action
|
|||||||
$this->clientError(_('User is already blocked from group.'));
|
$this->clientError(_('User is already blocked from group.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// XXX: could have proactive blocks, but we don't have UI for it.
|
// XXX: could have proactive blocks, but we do not have UI for it.
|
||||||
if (!$this->profile->isMember($this->group)) {
|
if (!$this->profile->isMember($this->group)) {
|
||||||
$this->clientError(_('User is not a member of group.'));
|
$this->clientError(_('User is not a member of group.'));
|
||||||
return false;
|
return false;
|
||||||
|
@ -88,12 +88,11 @@ class GroupsAction extends Action
|
|||||||
{
|
{
|
||||||
$notice =
|
$notice =
|
||||||
sprintf(_('%%%%site.name%%%% groups let you find and talk with ' .
|
sprintf(_('%%%%site.name%%%% groups let you find and talk with ' .
|
||||||
'users of similar interests. After you join a group ' .
|
'people of similar interests. After you join a group ' .
|
||||||
'you can send messages to all other members using the ' .
|
'you can send messages to all other members using the ' .
|
||||||
'syntax "!groupname". Are you not seeing any groups ' .
|
'syntax "!groupname". Don\'t see a group you like? Try ' .
|
||||||
'you like? Try ' .
|
|
||||||
'[searching for one](%%%%action.groupsearch%%%%) or ' .
|
'[searching for one](%%%%action.groupsearch%%%%) or ' .
|
||||||
'[start your own](%%%%action.newgroup%%%%)!'));
|
'[start your own!](%%%%action.newgroup%%%%)'));
|
||||||
$this->elementStart('div', 'instructions');
|
$this->elementStart('div', 'instructions');
|
||||||
$this->raw(common_markup_to_html($notice));
|
$this->raw(common_markup_to_html($notice));
|
||||||
$this->elementEnd('div');
|
$this->elementEnd('div');
|
||||||
|
@ -69,7 +69,7 @@ class ImsettingsAction extends ConnectSettingsAction
|
|||||||
{
|
{
|
||||||
return _('You can send and receive notices through '.
|
return _('You can send and receive notices through '.
|
||||||
'Jabber/GTalk [instant messages](%%doc.im%%). '.
|
'Jabber/GTalk [instant messages](%%doc.im%%). '.
|
||||||
'Configure your instant messages address and settings below.');
|
'Configure your address and settings below.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,7 +97,7 @@ class ImsettingsAction extends ConnectSettingsAction
|
|||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('imsettings')));
|
common_local_url('imsettings')));
|
||||||
$this->elementStart('fieldset', array('id' => 'settings_im_address'));
|
$this->elementStart('fieldset', array('id' => 'settings_im_address'));
|
||||||
$this->element('legend', null, _('IM address'));
|
$this->element('legend', null, _('Address'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
if ($user->jabber) {
|
if ($user->jabber) {
|
||||||
@ -111,7 +111,7 @@ class ImsettingsAction extends ConnectSettingsAction
|
|||||||
if ($confirm) {
|
if ($confirm) {
|
||||||
$this->element('p', 'form_unconfirmed', $confirm->address);
|
$this->element('p', 'form_unconfirmed', $confirm->address);
|
||||||
$this->element('p', 'form_note',
|
$this->element('p', 'form_note',
|
||||||
sprintf(_('Awaiting confirmation on this IM address. '.
|
sprintf(_('Awaiting confirmation on this address. '.
|
||||||
'Check your Jabber/GTalk account for a '.
|
'Check your Jabber/GTalk account for a '.
|
||||||
'message with further instructions. '.
|
'message with further instructions. '.
|
||||||
'(Did you add %s to your buddy list?)'),
|
'(Did you add %s to your buddy list?)'),
|
||||||
@ -151,7 +151,7 @@ class ImsettingsAction extends ConnectSettingsAction
|
|||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->checkbox('jabberreplies',
|
$this->checkbox('jabberreplies',
|
||||||
_('Send me replies through Jabber/GTalk '.
|
_('Send me replies through Jabber/GTalk '.
|
||||||
'from users I am not subscribed to.'),
|
'from people I\'m not subscribed to.'),
|
||||||
$user->jabberreplies);
|
$user->jabberreplies);
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
@ -133,7 +133,7 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
}
|
}
|
||||||
if ($this->subbed) {
|
if ($this->subbed) {
|
||||||
$this->element('p', null, _('These are already users and you were automatically subscribed to them:'));
|
$this->element('p', null, _('These people are already users and you were automatically subscribed to them:'));
|
||||||
$this->elementStart('ul');
|
$this->elementStart('ul');
|
||||||
foreach ($this->subbed as $other) {
|
foreach ($this->subbed as $other) {
|
||||||
$this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
$this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
|
||||||
@ -141,7 +141,7 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
}
|
}
|
||||||
if ($this->sent) {
|
if ($this->sent) {
|
||||||
$this->element('p', null, _('Invitation(s) sent to the following e-mail addresses:'));
|
$this->element('p', null, _('Invitation(s) sent to the following people:'));
|
||||||
$this->elementStart('ul');
|
$this->elementStart('ul');
|
||||||
foreach ($this->sent as $other) {
|
foreach ($this->sent as $other) {
|
||||||
$this->element('li', null, $other);
|
$this->element('li', null, $other);
|
||||||
@ -226,9 +226,9 @@ class InviteAction extends CurrentUserDesignAction
|
|||||||
$headers['Subject'] = sprintf(_('%1$s has invited you to join them on %2$s'), $bestname, $sitename);
|
$headers['Subject'] = sprintf(_('%1$s has invited you to join them on %2$s'), $bestname, $sitename);
|
||||||
|
|
||||||
$body = sprintf(_("%1\$s has invited you to join them on %2\$s (%3\$s).\n\n".
|
$body = sprintf(_("%1\$s has invited you to join them on %2\$s (%3\$s).\n\n".
|
||||||
"%2\$s is a micro-blogging service that lets you keep up-to-date with those you know and those who interest you.\n\n".
|
"%2\$s is a micro-blogging service that lets you keep up-to-date with people you know and people who interest you.\n\n".
|
||||||
"You can also share news about yourself, your thoughts, or your life online with users who know about you. ".
|
"You can also share news about yourself, your thoughts, or your life online with people who know about you. ".
|
||||||
"It is also great for meeting others who share your interests.\n\n".
|
"It's also great for meeting new people who share your interests.\n\n".
|
||||||
"%1\$s said:\n\n%4\$s\n\n".
|
"%1\$s said:\n\n%4\$s\n\n".
|
||||||
"You can see %1\$s's profile page on %2\$s here:\n\n".
|
"You can see %1\$s's profile page on %2\$s here:\n\n".
|
||||||
"%5\$s\n\n".
|
"%5\$s\n\n".
|
||||||
|
@ -159,7 +159,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 do not 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',
|
||||||
|
@ -81,7 +81,7 @@ class LogoutAction extends Action
|
|||||||
{
|
{
|
||||||
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(); // do not log back in!
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class MicrosummaryAction extends Action
|
|||||||
$user = User::staticGet('nickname', $nickname);
|
$user = User::staticGet('nickname', $nickname);
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$this->clientError(_('No such user'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class NewmessageAction extends Action
|
|||||||
/**
|
/**
|
||||||
* Title of the page
|
* Title of the page
|
||||||
*
|
*
|
||||||
* Note that this usually doesn't get called unless something went wrong
|
* Note that this usually does not get called unless something went wrong
|
||||||
*
|
*
|
||||||
* @return string page title
|
* @return string page title
|
||||||
*/
|
*/
|
||||||
@ -113,7 +113,7 @@ class NewmessageAction extends Action
|
|||||||
$this->other = User::staticGet('id', $this->to);
|
$this->other = User::staticGet('id', $this->to);
|
||||||
|
|
||||||
if (!$this->other) {
|
if (!$this->other) {
|
||||||
$this->clientError(_('No such user'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class NewnoticeAction extends Action
|
|||||||
/**
|
/**
|
||||||
* Title of the page
|
* Title of the page
|
||||||
*
|
*
|
||||||
* Note that this usually doesn't get called unless something went wrong
|
* Note that this usually does not get called unless something went wrong
|
||||||
*
|
*
|
||||||
* @return string page title
|
* @return string page title
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +44,7 @@ require_once INSTALLDIR.'/lib/searchaction.php';
|
|||||||
* @author Robin Millette <millette@status.net>
|
* @author Robin Millette <millette@status.net>
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
* @todo common parent for user and content search?
|
* @todo common parent for people and content search?
|
||||||
*/
|
*/
|
||||||
class NoticesearchAction extends SearchAction
|
class NoticesearchAction extends SearchAction
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ class OpensearchAction extends Action
|
|||||||
*
|
*
|
||||||
* @param array $args query arguments
|
* @param array $args query arguments
|
||||||
*
|
*
|
||||||
* @return boolean false if user doesn't exist
|
* @return boolean false if user does not exist
|
||||||
*/
|
*/
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
@ -61,7 +61,7 @@ class OpensearchAction extends Action
|
|||||||
$short_name = '';
|
$short_name = '';
|
||||||
if ($type == 'people') {
|
if ($type == 'people') {
|
||||||
$type = 'peoplesearch';
|
$type = 'peoplesearch';
|
||||||
$short_name = _('User Search');
|
$short_name = _('People Search');
|
||||||
} else {
|
} else {
|
||||||
$type = 'noticesearch';
|
$type = 'noticesearch';
|
||||||
$short_name = _('Notice Search');
|
$short_name = _('Notice Search');
|
||||||
@ -75,7 +75,7 @@ class OpensearchAction extends Action
|
|||||||
$this->element('Url', array('type' => 'text/html', 'method' => 'get',
|
$this->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' => '---')))));
|
||||||
$this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
|
$this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
|
||||||
$this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png'));
|
$this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), Theme::path('logo.png'));
|
||||||
$this->element('AdultContent', null, 'false');
|
$this->element('AdultContent', null, 'false');
|
||||||
$this->element('Language', null, common_language());
|
$this->element('Language', null, common_language());
|
||||||
$this->element('OutputEncoding', null, 'UTF-8');
|
$this->element('OutputEncoding', null, 'UTF-8');
|
||||||
|
@ -58,6 +58,19 @@ class PasswordsettingsAction extends AccountSettingsAction
|
|||||||
return _('Change password');
|
return _('Change password');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prepare($args){
|
||||||
|
parent::prepare($args);
|
||||||
|
|
||||||
|
$user = common_current_user();
|
||||||
|
|
||||||
|
Event::handle('CanUserChangeField', array($user->nickname, 'password'));
|
||||||
|
|
||||||
|
if(! $fields['password']){
|
||||||
|
//user is not allowed to change his password
|
||||||
|
$this->clientError(_('You are not allowed to change your password'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instructions for use
|
* Instructions for use
|
||||||
*
|
*
|
||||||
@ -86,6 +99,7 @@ class PasswordsettingsAction extends AccountSettingsAction
|
|||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
$this->elementStart('form', array('method' => 'POST',
|
$this->elementStart('form', array('method' => 'POST',
|
||||||
'id' => 'form_password',
|
'id' => 'form_password',
|
||||||
'class' => 'form_settings',
|
'class' => 'form_settings',
|
||||||
@ -97,7 +111,7 @@ class PasswordsettingsAction extends AccountSettingsAction
|
|||||||
|
|
||||||
|
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
// Users who logged in with OpenID won't have a pwd
|
// Users who logged in with OpenID will not have a pwd
|
||||||
if ($user->password) {
|
if ($user->password) {
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->password('oldpassword', _('Old password'));
|
$this->password('oldpassword', _('Old password'));
|
||||||
|
@ -49,7 +49,7 @@ class PeoplesearchAction extends SearchAction
|
|||||||
{
|
{
|
||||||
function getInstructions()
|
function getInstructions()
|
||||||
{
|
{
|
||||||
return _('Search for users on %%site.name%% by their name, location, or interests. ' .
|
return _('Search for people on %%site.name%% by their name, location, or interests. ' .
|
||||||
'Separate the terms by spaces; they must be 3 characters or more.');
|
'Separate the terms by spaces; they must be 3 characters or more.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class PeopletagAction extends Action
|
|||||||
$this->tag = $this->trimmed('tag');
|
$this->tag = $this->trimmed('tag');
|
||||||
|
|
||||||
if (!common_valid_profile_tag($this->tag)) {
|
if (!common_valid_profile_tag($this->tag)) {
|
||||||
$this->clientError(sprintf(_('Not a valid user tag: %s'),
|
$this->clientError(sprintf(_('Not a valid people tag: %s'),
|
||||||
$this->tag));
|
$this->tag));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class ProfilesettingsAction extends AccountSettingsAction
|
|||||||
function getInstructions()
|
function getInstructions()
|
||||||
{
|
{
|
||||||
return _('You can update your personal profile info here '.
|
return _('You can update your personal profile info here '.
|
||||||
'so readers know more about you.');
|
'so people know more about you.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showScripts()
|
function showScripts()
|
||||||
|
@ -82,14 +82,14 @@ class RegisterAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (common_config('site', 'inviteonly') && empty($this->code)) {
|
if (common_config('site', 'inviteonly') && empty($this->code)) {
|
||||||
$this->clientError(_('Sorry. Only those invited can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->code)) {
|
if (!empty($this->code)) {
|
||||||
$this->invite = Invitation::staticGet('code', $this->code);
|
$this->invite = Invitation::staticGet('code', $this->code);
|
||||||
if (empty($this->invite)) {
|
if (empty($this->invite)) {
|
||||||
$this->clientError(_('Sorry. This is an invalid invitation code.'));
|
$this->clientError(_('Sorry, invalid invitation code.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Store this in case we need it
|
// Store this in case we need it
|
||||||
@ -174,7 +174,7 @@ class RegisterAction extends Action
|
|||||||
$bio = $this->trimmed('bio');
|
$bio = $this->trimmed('bio');
|
||||||
$location = $this->trimmed('location');
|
$location = $this->trimmed('location');
|
||||||
|
|
||||||
// We don't trim these... whitespace is OK in a password!
|
// We do not trim these... whitespace is OK in a password!
|
||||||
$password = $this->arg('password');
|
$password = $this->arg('password');
|
||||||
$confirm = $this->arg('confirm');
|
$confirm = $this->arg('confirm');
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ class RegisterAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
||||||
$this->clientError(_('Sorry. Only those invited can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ class RegisterAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
||||||
$this->clientError(_('Sorry. Only those invited can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ class RegisterAction extends Action
|
|||||||
'(%%%%action.imsettings%%%%) '.
|
'(%%%%action.imsettings%%%%) '.
|
||||||
'so you can send notices '.
|
'so you can send notices '.
|
||||||
'through instant messages.' . "\n" .
|
'through instant messages.' . "\n" .
|
||||||
'* [Search for users](%%%%action.peoplesearch%%%%) '.
|
'* [Search for people](%%%%action.peoplesearch%%%%) '.
|
||||||
'that you may know or '.
|
'that you may know or '.
|
||||||
'that share your interests. ' . "\n" .
|
'that share your interests. ' . "\n" .
|
||||||
'* Update your [profile settings]'.
|
'* Update your [profile settings]'.
|
||||||
|
@ -151,7 +151,7 @@ class RemotesubscribeAction extends Action
|
|||||||
$this->profile_url = $this->trimmed('profile_url');
|
$this->profile_url = $this->trimmed('profile_url');
|
||||||
|
|
||||||
if (!$this->profile_url) {
|
if (!$this->profile_url) {
|
||||||
$this->showForm(_('No such user'));
|
$this->showForm(_('No such user.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,12 +195,12 @@ class RepliesAction extends OwnerDesignAction
|
|||||||
|
|
||||||
function showEmptyListMessage()
|
function showEmptyListMessage()
|
||||||
{
|
{
|
||||||
$message = sprintf(_('This is the timeline showing replies to %s but %s has not received a notice to his attention yet.'), $this->user->nickname, $this->user->nickname) . ' ';
|
$message = sprintf(_('This is the timeline showing replies to %s but %s hasn\'t received a notice to his attention yet.'), $this->user->nickname, $this->user->nickname) . ' ';
|
||||||
|
|
||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
$current_user = common_current_user();
|
$current_user = common_current_user();
|
||||||
if ($this->user->id === $current_user->id) {
|
if ($this->user->id === $current_user->id) {
|
||||||
$message .= _('You can engage other users in a conversation, subscribe to more users or [join groups](%%action.groups%%).');
|
$message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).');
|
||||||
} else {
|
} else {
|
||||||
$message .= sprintf(_('You can try to [nudge %s](../%s) or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
|
$message .= sprintf(_('You can try to [nudge %s](../%s) or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
|
||||||
}
|
}
|
||||||
|
@ -418,7 +418,7 @@ class ShowgroupAction extends GroupDesignAction
|
|||||||
// XXX: WORM cache this
|
// XXX: WORM cache this
|
||||||
$members = $this->group->getMembers();
|
$members = $this->group->getMembers();
|
||||||
$members_count = 0;
|
$members_count = 0;
|
||||||
/** $member->count() doesn't work. */
|
/** $member->count() does not work. */
|
||||||
while ($members->fetch()) {
|
while ($members->fetch()) {
|
||||||
$members_count++;
|
$members_count++;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class ShowmessageAction extends MailboxAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show local navigation
|
* Do not show local navigation
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -147,7 +147,7 @@ class ShowmessageAction extends MailboxAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show page notice
|
* Do not show page notice
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -157,7 +157,7 @@ class ShowmessageAction extends MailboxAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show aside
|
* Do not show aside
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -167,7 +167,7 @@ class ShowmessageAction extends MailboxAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show any instructions
|
* Do not show any instructions
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -208,7 +208,7 @@ class ShownoticeAction extends OwnerDesignAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show local navigation
|
* Do not show local navigation
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -234,7 +234,7 @@ class ShownoticeAction extends OwnerDesignAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show page notice
|
* Do not show page notice
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -244,7 +244,7 @@ class ShownoticeAction extends OwnerDesignAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't show aside
|
* Do not show aside
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +253,7 @@ class ShowstreamAction extends ProfileAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't show the author for a profile, since we already know who it is!
|
// We do not show the author for a profile, since we already know who it is!
|
||||||
|
|
||||||
class ProfileNoticeList extends NoticeList
|
class ProfileNoticeList extends NoticeList
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ class SmssettingsAction extends ConnectSettingsAction
|
|||||||
common_local_url('smssettings')));
|
common_local_url('smssettings')));
|
||||||
|
|
||||||
$this->elementStart('fieldset', array('id' => 'settings_sms_address'));
|
$this->elementStart('fieldset', array('id' => 'settings_sms_address'));
|
||||||
$this->element('legend', null, _('SMS address'));
|
$this->element('legend', null, _('Address'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
if ($user->sms) {
|
if ($user->sms) {
|
||||||
|
@ -60,12 +60,12 @@ class SubscribersAction extends GalleryAction
|
|||||||
$user =& common_current_user();
|
$user =& common_current_user();
|
||||||
if ($user && ($user->id == $this->profile->id)) {
|
if ($user && ($user->id == $this->profile->id)) {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
_('These are the users who have subscribed to '.
|
_('These are the people who listen to '.
|
||||||
'your notices.'));
|
'your notices.'));
|
||||||
} else {
|
} else {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
sprintf(_('These are the users who '.
|
sprintf(_('These are the people who '.
|
||||||
'have subscribed to %s\'s notices.'),
|
'listen to %s\'s notices.'),
|
||||||
$this->profile->nickname));
|
$this->profile->nickname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ class SubscribersAction extends GalleryAction
|
|||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
$current_user = common_current_user();
|
$current_user = common_current_user();
|
||||||
if ($this->user->id === $current_user->id) {
|
if ($this->user->id === $current_user->id) {
|
||||||
$message = _('You have no subscribers. Try subscribing to users you know and they might return the favor');
|
$message = _('You have no subscribers. Try subscribing to people you know and they might return the favor');
|
||||||
} else {
|
} else {
|
||||||
$message = sprintf(_('%s has no subscribers. Want to be the first?'), $this->user->nickname);
|
$message = sprintf(_('%s has no subscribers. Want to be the first?'), $this->user->nickname);
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,12 @@ class SubscriptionsAction extends GalleryAction
|
|||||||
$user =& common_current_user();
|
$user =& common_current_user();
|
||||||
if ($user && ($user->id == $this->profile->id)) {
|
if ($user && ($user->id == $this->profile->id)) {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
_('These are the users whose notices '.
|
_('These are the people whose notices '.
|
||||||
'you have subscribed to.'));
|
'you listen to.'));
|
||||||
} else {
|
} else {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
sprintf(_('These are the users whose '.
|
sprintf(_('These are the people whose '.
|
||||||
'notices %s has subscribed to.'),
|
'notices %s listens to.'),
|
||||||
$this->profile->nickname));
|
$this->profile->nickname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ class SubscriptionsAction extends GalleryAction
|
|||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
$current_user = common_current_user();
|
$current_user = common_current_user();
|
||||||
if ($this->user->id === $current_user->id) {
|
if ($this->user->id === $current_user->id) {
|
||||||
$message = _('You have not subscribed to anyone\'s notices right now. Try subscribing to users you know. Try [user search](%%action.peoplesearch%%), look for members in groups you\'re interested in and in our [featured users](%%action.featured%%). If you are a [Twitter user](%%action.twittersettings%%), you can automatically subscribe to users you already follow there.');
|
$message = _('You\'re not listening to anyone\'s notices right now, try subscribing to people you know. Try [people search](%%action.peoplesearch%%), look for members in groups you\'re interested in and in our [featured users](%%action.featured%%). If you\'re a [Twitter user](%%action.twittersettings%%), you can automatically subscribe to people you already follow there.');
|
||||||
} else {
|
} else {
|
||||||
$message = sprintf(_('%s is not listening to anyone.'), $this->user->nickname);
|
$message = sprintf(_('%s is not listening to anyone.'), $this->user->nickname);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class SupAction extends Action
|
|||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
|
|
||||||
# XXX: cache this. Depends on how big this protocol becomes;
|
# XXX: cache this. Depends on how big this protocol becomes;
|
||||||
# Re-doing this query every 15 seconds isn't the end of the world.
|
# Re-doing this query every 15 seconds is not the end of the world.
|
||||||
|
|
||||||
$divider = common_sql_date(time() - $seconds);
|
$divider = common_sql_date(time() - $seconds);
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class TagotherAction extends Action
|
|||||||
!Subscription::pkeyGet(array('subscriber' => $this->profile->id,
|
!Subscription::pkeyGet(array('subscriber' => $this->profile->id,
|
||||||
'subscribed' => $user->id)))
|
'subscribed' => $user->id)))
|
||||||
{
|
{
|
||||||
$this->clientError(_('You can only tag users you are subscribed to or who are subscribed to you.'));
|
$this->clientError(_('You can only tag people you are subscribed to or who are subscribed to you.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ class TwitapisearchatomAction extends ApiAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: this alternate link is not quite right because our
|
// FIXME: this alternate link is not quite right because our
|
||||||
// web-based notice search doesn't support a rpp (responses per
|
// web-based notice search does not support a rpp (responses per
|
||||||
// page) param yet
|
// page) param yet
|
||||||
|
|
||||||
$this->element('link', array('type' => 'text/html',
|
$this->element('link', array('type' => 'text/html',
|
||||||
|
@ -55,7 +55,7 @@ class TwitapitrendsAction extends ApiAction
|
|||||||
*
|
*
|
||||||
* @param array $args Web and URL arguments
|
* @param array $args Web and URL arguments
|
||||||
*
|
*
|
||||||
* @return boolean false if user doesn't exist
|
* @return boolean false if user does not exist
|
||||||
*/
|
*/
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
|
@ -102,6 +102,6 @@ class Avatar extends Memcached_DataObject
|
|||||||
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
|
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
|
||||||
AVATAR_STREAM_SIZE => 'stream',
|
AVATAR_STREAM_SIZE => 'stream',
|
||||||
AVATAR_MINI_SIZE => 'mini');
|
AVATAR_MINI_SIZE => 'mini');
|
||||||
return theme_path('default-avatar-'.$sizenames[$size].'.png');
|
return Theme::path('default-avatar-'.$sizenames[$size].'.png');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ class File_redirection extends Memcached_DataObject
|
|||||||
'connect_timeout' => 10, // # seconds to wait
|
'connect_timeout' => 10, // # seconds to wait
|
||||||
'max_redirs' => $redirs, // # max number of http redirections to follow
|
'max_redirs' => $redirs, // # max number of http redirections to follow
|
||||||
'follow_redirects' => true, // Follow redirects
|
'follow_redirects' => true, // Follow redirects
|
||||||
'store_body' => false, // We won't need body content here.
|
'store_body' => false, // We will not need body content here.
|
||||||
));
|
));
|
||||||
return $request;
|
return $request;
|
||||||
}
|
}
|
||||||
@ -81,12 +81,12 @@ class File_redirection extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$request = self::_commonHttp($short_url, $redirs);
|
$request = self::_commonHttp($short_url, $redirs);
|
||||||
// Don't include body in output
|
// Do not include body in output
|
||||||
$request->setMethod(HTTP_Request2::METHOD_HEAD);
|
$request->setMethod(HTTP_Request2::METHOD_HEAD);
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
|
|
||||||
if (405 == $response->getStatus()) {
|
if (405 == $response->getStatus()) {
|
||||||
// Server doesn't support HEAD method? Can this really happen?
|
// Server does not support HEAD method? Can this really happen?
|
||||||
// We'll try again as a GET and ignore the response data.
|
// We'll try again as a GET and ignore the response data.
|
||||||
$request = self::_commonHttp($short_url, $redirs);
|
$request = self::_commonHttp($short_url, $redirs);
|
||||||
$response = $request->send();
|
$response = $request->send();
|
||||||
@ -178,7 +178,7 @@ class File_redirection extends Memcached_DataObject
|
|||||||
case 'aim':
|
case 'aim':
|
||||||
case 'jabber':
|
case 'jabber':
|
||||||
case 'xmpp':
|
case 'xmpp':
|
||||||
// don't touch anything
|
// do not touch anything
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -146,7 +146,7 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
/* Add them to the database */
|
/* Add them to the database */
|
||||||
foreach(array_unique($hashtags) as $hashtag) {
|
foreach(array_unique($hashtags) as $hashtag) {
|
||||||
/* elide characters we don't want in the tag */
|
/* elide characters we do not want in the tag */
|
||||||
$this->saveTag($hashtag);
|
$this->saveTag($hashtag);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1105,7 +1105,7 @@ class Notice extends Memcached_DataObject
|
|||||||
if (empty($recipient)) {
|
if (empty($recipient)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Don't save replies from blocked profile to local user
|
// Do not save replies from blocked profile to local user
|
||||||
$recipient_user = User::staticGet('id', $recipient->id);
|
$recipient_user = User::staticGet('id', $recipient->id);
|
||||||
if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) {
|
if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) {
|
||||||
continue;
|
continue;
|
||||||
@ -1131,7 +1131,7 @@ class Notice extends Memcached_DataObject
|
|||||||
$tagged = Profile_tag::getTagged($sender->id, $tag);
|
$tagged = Profile_tag::getTagged($sender->id, $tag);
|
||||||
foreach ($tagged as $t) {
|
foreach ($tagged as $t) {
|
||||||
if (!$replied[$t->id]) {
|
if (!$replied[$t->id]) {
|
||||||
// Don't save replies from blocked profile to local user
|
// Do not save replies from blocked profile to local user
|
||||||
$t_user = User::staticGet('id', $t->id);
|
$t_user = User::staticGet('id', $t->id);
|
||||||
if ($t_user && $t_user->hasBlocked($sender)) {
|
if ($t_user && $t_user->hasBlocked($sender)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -101,7 +101,7 @@ class Profile extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
|
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
|
||||||
# We don't do a scaled one if original is our scaled size
|
# We do not do a scaled one if original is our scaled size
|
||||||
if (!($avatar->width == $size && $avatar->height == $size)) {
|
if (!($avatar->width == $size && $avatar->height == $size)) {
|
||||||
|
|
||||||
$scaled_filename = $imagefile->resize($size);
|
$scaled_filename = $imagefile->resize($size);
|
||||||
@ -174,7 +174,7 @@ class Profile extends Memcached_DataObject
|
|||||||
|
|
||||||
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0, $since=null)
|
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0, $since=null)
|
||||||
{
|
{
|
||||||
// XXX: I'm not sure this is going to be any faster. It probably isn't.
|
// XXX: I'm not sure this is going to be any faster. It probably is not.
|
||||||
$ids = Notice::stream(array($this, '_streamDirect'),
|
$ids = Notice::stream(array($this, '_streamDirect'),
|
||||||
array(),
|
array(),
|
||||||
'profile:notice_ids:' . $this->id,
|
'profile:notice_ids:' . $this->id,
|
||||||
|
@ -87,7 +87,7 @@ class User extends Memcached_DataObject
|
|||||||
return (is_null($sub)) ? false : true;
|
return (is_null($sub)) ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'update' won't write key columns, so we have to do it ourselves.
|
// 'update' will not write key columns, so we have to do it ourselves.
|
||||||
|
|
||||||
function updateKeys(&$orig)
|
function updateKeys(&$orig)
|
||||||
{
|
{
|
||||||
@ -384,7 +384,7 @@ class User extends Memcached_DataObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, cache doesn't have all faves;
|
// Otherwise, cache does not have all faves;
|
||||||
// fall through to the default
|
// fall through to the default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ class User extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
$cache = common_memcache();
|
$cache = common_memcache();
|
||||||
if ($cache) {
|
if ($cache) {
|
||||||
// Faves don't happen chronologically, so we need to blow
|
// Faves do not happen chronologically, so we need to blow
|
||||||
// ;last cache, too
|
// ;last cache, too
|
||||||
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
|
||||||
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
|
||||||
@ -705,9 +705,11 @@ class User extends Memcached_DataObject
|
|||||||
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
|
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
|
||||||
switch ($right)
|
switch ($right)
|
||||||
{
|
{
|
||||||
case Right::deleteOthersNotice:
|
case Right::DELETEOTHERSNOTICE:
|
||||||
$result = $this->hasRole('moderator');
|
$result = $this->hasRole(User_role::MODERATOR);
|
||||||
break;
|
break;
|
||||||
|
case Right::CONFIGURESITE:
|
||||||
|
$result = $this->hasRole(User_role::ADMINISTRATOR);
|
||||||
default:
|
default:
|
||||||
$result = false;
|
$result = false;
|
||||||
break;
|
break;
|
||||||
|
@ -34,7 +34,7 @@ class User_group extends Memcached_DataObject
|
|||||||
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
|
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
|
||||||
AVATAR_STREAM_SIZE => 'stream',
|
AVATAR_STREAM_SIZE => 'stream',
|
||||||
AVATAR_MINI_SIZE => 'mini');
|
AVATAR_MINI_SIZE => 'mini');
|
||||||
return theme_path('default-avatar-'.$sizenames[$size].'.png');
|
return Theme::path('default-avatar-'.$sizenames[$size].'.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
function homeUrl()
|
function homeUrl()
|
||||||
|
@ -45,4 +45,7 @@ class User_role extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
return Memcached_DataObject::pkeyGet('User_role', $kv);
|
return Memcached_DataObject::pkeyGet('User_role', $kv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MODERATOR = 'moderator';
|
||||||
|
const ADMINISTRATOR = 'administrator';
|
||||||
}
|
}
|
||||||
|
@ -102,26 +102,31 @@ class AccountSettingsNav extends Widget
|
|||||||
$this->action->elementStart('ul', array('class' => 'nav'));
|
$this->action->elementStart('ul', array('class' => 'nav'));
|
||||||
|
|
||||||
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
|
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
|
||||||
|
$user = common_current_user();
|
||||||
|
|
||||||
$menu =
|
$menu = array();
|
||||||
array('profilesettings' =>
|
$menu['profilesettings'] =
|
||||||
array(_('Profile'),
|
array(_('Profile'),
|
||||||
_('Change your profile settings')),
|
_('Change your profile settings'));
|
||||||
'avatarsettings' =>
|
if(Event::handle('CanUserChangeField', array($user->nickname, 'avatar'))){
|
||||||
|
$menu['avatarsettings'] =
|
||||||
array(_('Avatar'),
|
array(_('Avatar'),
|
||||||
_('Upload an avatar')),
|
_('Upload an avatar'));
|
||||||
'passwordsettings' =>
|
}
|
||||||
|
if(Event::handle('CanUserChangeField', array($user->nickname, 'password'))){
|
||||||
|
$menu['passwordsettings'] =
|
||||||
array(_('Password'),
|
array(_('Password'),
|
||||||
_('Change your password')),
|
_('Change your password'));
|
||||||
'emailsettings' =>
|
}
|
||||||
|
$menu['emailsettings'] =
|
||||||
array(_('Email'),
|
array(_('Email'),
|
||||||
_('Change email handling')),
|
_('Change email handling'));
|
||||||
'userdesignsettings' =>
|
$menu['userdesignsettings'] =
|
||||||
array(_('Design'),
|
array(_('Design'),
|
||||||
_('Design your profile')),
|
_('Design your profile'));
|
||||||
'othersettings' =>
|
$menu['othersettings'] =
|
||||||
array(_('Other'),
|
array(_('Other'),
|
||||||
_('Other options')));
|
_('Other options'));
|
||||||
|
|
||||||
foreach ($menu as $menuaction => $menudesc) {
|
foreach ($menu as $menuaction => $menudesc) {
|
||||||
$this->action->menuItem(common_local_url($menuaction),
|
$this->action->menuItem(common_local_url($menuaction),
|
||||||
|
@ -168,7 +168,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
{
|
{
|
||||||
if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/favicon.ico')) {
|
if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/favicon.ico')) {
|
||||||
$this->element('link', array('rel' => 'shortcut icon',
|
$this->element('link', array('rel' => 'shortcut icon',
|
||||||
'href' => theme_path('favicon.ico')));
|
'href' => Theme::path('favicon.ico')));
|
||||||
} else {
|
} else {
|
||||||
$this->element('link', array('rel' => 'shortcut icon',
|
$this->element('link', array('rel' => 'shortcut icon',
|
||||||
'href' => common_path('favicon.ico')));
|
'href' => common_path('favicon.ico')));
|
||||||
@ -177,7 +177,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
if (common_config('site', 'mobile')) {
|
if (common_config('site', 'mobile')) {
|
||||||
if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/apple-touch-icon.png')) {
|
if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/apple-touch-icon.png')) {
|
||||||
$this->element('link', array('rel' => 'apple-touch-icon',
|
$this->element('link', array('rel' => 'apple-touch-icon',
|
||||||
'href' => theme_path('apple-touch-icon.png')));
|
'href' => Theme::path('apple-touch-icon.png')));
|
||||||
} else {
|
} else {
|
||||||
$this->element('link', array('rel' => 'apple-touch-icon',
|
$this->element('link', array('rel' => 'apple-touch-icon',
|
||||||
'href' => common_path('apple-touch-icon.png')));
|
'href' => common_path('apple-touch-icon.png')));
|
||||||
@ -210,16 +210,16 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
|
|
||||||
if (Event::handle('StartShowUAStyles', array($this))) {
|
if (Event::handle('StartShowUAStyles', array($this))) {
|
||||||
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
|
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
|
||||||
'href="'.theme_path('css/ie.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]');
|
'href="'.Theme::path('css/ie.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]');
|
||||||
foreach (array(6,7) as $ver) {
|
foreach (array(6,7) as $ver) {
|
||||||
if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) {
|
if (file_exists(Theme::file('css/ie'.$ver.'.css', 'base'))) {
|
||||||
// Yes, IE people should be put in jail.
|
// Yes, IE people should be put in jail.
|
||||||
$this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '.
|
$this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '.
|
||||||
'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]');
|
'href="'.Theme::path('css/ie'.$ver.'.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
|
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
|
||||||
'href="'.theme_path('css/ie.css', null).'?version='.STATUSNET_VERSION.'" /><![endif]');
|
'href="'.Theme::path('css/ie.css', null).'?version='.STATUSNET_VERSION.'" /><![endif]');
|
||||||
Event::handle('EndShowUAStyles', array($this));
|
Event::handle('EndShowUAStyles', array($this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,9 +391,9 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
if (Event::handle('StartAddressData', array($this))) {
|
if (Event::handle('StartAddressData', array($this))) {
|
||||||
$this->elementStart('a', array('class' => 'url home bookmark',
|
$this->elementStart('a', array('class' => 'url home bookmark',
|
||||||
'href' => common_local_url('public')));
|
'href' => common_local_url('public')));
|
||||||
if (common_config('site', 'logo') || file_exists(theme_file('logo.png'))) {
|
if (common_config('site', 'logo') || file_exists(Theme::file('logo.png'))) {
|
||||||
$this->element('img', array('class' => 'logo photo',
|
$this->element('img', array('class' => 'logo photo',
|
||||||
'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : theme_path('logo.png'),
|
'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : Theme::path('logo.png'),
|
||||||
'alt' => common_config('site', 'name')));
|
'alt' => common_config('site', 'name')));
|
||||||
}
|
}
|
||||||
$this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
|
$this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
|
||||||
@ -456,7 +456,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
_('Help'), _('Help me!'), false, 'nav_help');
|
_('Help'), _('Help me!'), false, 'nav_help');
|
||||||
if ($user || !common_config('site', 'private')) {
|
if ($user || !common_config('site', 'private')) {
|
||||||
$this->menuItem(common_local_url('peoplesearch'),
|
$this->menuItem(common_local_url('peoplesearch'),
|
||||||
_('Search'), _('Search for users or text'), false, 'nav_search');
|
_('Search'), _('Search for people or text'), false, 'nav_search');
|
||||||
}
|
}
|
||||||
Event::handle('EndPrimaryNav', array($this));
|
Event::handle('EndPrimaryNav', array($this));
|
||||||
}
|
}
|
||||||
@ -1101,4 +1101,22 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
{
|
{
|
||||||
return Design::siteDesign();
|
return Design::siteDesign();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the session token.
|
||||||
|
*
|
||||||
|
* Checks that the current form has the correct session token,
|
||||||
|
* and throw an exception if it does not.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
|
||||||
|
function checkSessionToken()
|
||||||
|
{
|
||||||
|
// CSRF protection
|
||||||
|
$token = $this->trimmed('token');
|
||||||
|
if (empty($token) || $token != common_session_token()) {
|
||||||
|
$this->clientError(_('There was a problem with your session token.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
14
lib/api.php
14
lib/api.php
@ -66,7 +66,7 @@ class ApiAction extends Action
|
|||||||
*
|
*
|
||||||
* @param array $args Web and URL arguments
|
* @param array $args Web and URL arguments
|
||||||
*
|
*
|
||||||
* @return boolean false if user doesn't exist
|
* @return boolean false if user does not exist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
@ -138,7 +138,7 @@ class ApiAction extends Action
|
|||||||
$design = null;
|
$design = null;
|
||||||
$user = $profile->getUser();
|
$user = $profile->getUser();
|
||||||
|
|
||||||
// Note: some profiles don't have an associated user
|
// Note: some profiles do not have an associated user
|
||||||
|
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
$design = $user->getDesign();
|
$design = $user->getDesign();
|
||||||
@ -208,7 +208,7 @@ class ApiAction extends Action
|
|||||||
if ($get_notice) {
|
if ($get_notice) {
|
||||||
$notice = $profile->getCurrentNotice();
|
$notice = $profile->getCurrentNotice();
|
||||||
if ($notice) {
|
if ($notice) {
|
||||||
# don't get user!
|
# do not get user!
|
||||||
$twitter_user['status'] = $this->twitterStatusArray($notice, false);
|
$twitter_user['status'] = $this->twitterStatusArray($notice, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ class ApiAction extends Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($include_user) {
|
if ($include_user) {
|
||||||
# Don't get notice (recursive!)
|
# Do not get notice (recursive!)
|
||||||
$twitter_user = $this->twitterUserArray($profile, false);
|
$twitter_user = $this->twitterUserArray($profile, false);
|
||||||
$twitter_status['user'] = $twitter_user;
|
$twitter_status['user'] = $twitter_user;
|
||||||
}
|
}
|
||||||
@ -1079,7 +1079,7 @@ class ApiAction extends Action
|
|||||||
function initTwitterAtom()
|
function initTwitterAtom()
|
||||||
{
|
{
|
||||||
$this->startXML();
|
$this->startXML();
|
||||||
// FIXME: don't hardcode the language here!
|
// FIXME: do not hardcode the language here!
|
||||||
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
|
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
|
||||||
'xml:lang' => 'en-US',
|
'xml:lang' => 'en-US',
|
||||||
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
|
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
|
||||||
@ -1121,7 +1121,7 @@ class ApiAction extends Action
|
|||||||
return User::staticGet('nickname', $nickname);
|
return User::staticGet('nickname', $nickname);
|
||||||
} else if ($this->arg('user_id')) {
|
} else if ($this->arg('user_id')) {
|
||||||
// This is to ensure that a non-numeric user_id still
|
// This is to ensure that a non-numeric user_id still
|
||||||
// overrides screen_name even if it doesn't get used
|
// overrides screen_name even if it does not get used
|
||||||
if (is_numeric($this->arg('user_id'))) {
|
if (is_numeric($this->arg('user_id'))) {
|
||||||
return User::staticGet('id', $this->arg('user_id'));
|
return User::staticGet('id', $this->arg('user_id'));
|
||||||
}
|
}
|
||||||
@ -1151,7 +1151,7 @@ class ApiAction extends Action
|
|||||||
return User_group::staticGet('nickname', $nickname);
|
return User_group::staticGet('nickname', $nickname);
|
||||||
} else if ($this->arg('group_id')) {
|
} else if ($this->arg('group_id')) {
|
||||||
// This is to ensure that a non-numeric user_id still
|
// This is to ensure that a non-numeric user_id still
|
||||||
// overrides screen_name even if it doesn't get used
|
// overrides screen_name even if it does not get used
|
||||||
if (is_numeric($this->arg('group_id'))) {
|
if (is_numeric($this->arg('group_id'))) {
|
||||||
return User_group::staticGet('id', $this->arg('group_id'));
|
return User_group::staticGet('id', $this->arg('group_id'));
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class ApiAuthAction extends ApiAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for a user specified via HTTP basic auth. If there isn't
|
* Check for a user specified via HTTP basic auth. If there is not
|
||||||
* one, try to get one by outputting the basic auth header.
|
* one, try to get one by outputting the basic auth header.
|
||||||
*
|
*
|
||||||
* @return boolean true or false
|
* @return boolean true or false
|
||||||
|
@ -38,6 +38,8 @@ define('FOREIGN_NOTICE_SEND_REPLY', 4);
|
|||||||
define('FOREIGN_FRIEND_SEND', 1);
|
define('FOREIGN_FRIEND_SEND', 1);
|
||||||
define('FOREIGN_FRIEND_RECV', 2);
|
define('FOREIGN_FRIEND_RECV', 2);
|
||||||
|
|
||||||
|
if ( $_REQUEST['p'] == 'check-fancy') { exit; } //exit with 200 response, if this is checking fancy from the installer
|
||||||
|
|
||||||
define_syslog_variables();
|
define_syslog_variables();
|
||||||
|
|
||||||
# append our extlib dir as the last-resort place to find libs
|
# append our extlib dir as the last-resort place to find libs
|
||||||
@ -227,7 +229,6 @@ require_once 'markdown.php';
|
|||||||
|
|
||||||
require_once INSTALLDIR.'/lib/util.php';
|
require_once INSTALLDIR.'/lib/util.php';
|
||||||
require_once INSTALLDIR.'/lib/action.php';
|
require_once INSTALLDIR.'/lib/action.php';
|
||||||
require_once INSTALLDIR.'/lib/theme.php';
|
|
||||||
require_once INSTALLDIR.'/lib/mail.php';
|
require_once INSTALLDIR.'/lib/mail.php';
|
||||||
require_once INSTALLDIR.'/lib/subs.php';
|
require_once INSTALLDIR.'/lib/subs.php';
|
||||||
require_once INSTALLDIR.'/lib/Shorturl_api.php';
|
require_once INSTALLDIR.'/lib/Shorturl_api.php';
|
||||||
|
@ -39,7 +39,7 @@ require_once INSTALLDIR.'/lib/servererroraction.php';
|
|||||||
*
|
*
|
||||||
* This only occurs if there's been a DB_DataObject_Error that's
|
* This only occurs if there's been a DB_DataObject_Error that's
|
||||||
* reported through PEAR, so we try to avoid doing anything that connects
|
* reported through PEAR, so we try to avoid doing anything that connects
|
||||||
* to the DB, so we don't trigger it again.
|
* to the DB, so we do not trigger it again.
|
||||||
*
|
*
|
||||||
* @category Action
|
* @category Action
|
||||||
* @package StatusNet
|
* @package StatusNet
|
||||||
@ -62,12 +62,12 @@ class DBErrorAction extends ServerErrorAction
|
|||||||
|
|
||||||
function getLanguage()
|
function getLanguage()
|
||||||
{
|
{
|
||||||
// Don't try to figure out user's language; just show the page
|
// Do not try to figure out user's language; just show the page
|
||||||
return common_config('site', 'language');
|
return common_config('site', 'language');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPrimaryNav()
|
function showPrimaryNav()
|
||||||
{
|
{
|
||||||
// don't show primary nav
|
// do not show primary nav
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,11 +104,11 @@ class ErrorAction extends Action
|
|||||||
{
|
{
|
||||||
parent::showPage();
|
parent::showPage();
|
||||||
|
|
||||||
// We don't want to have any more output after this
|
// We do not want to have any more output after this
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overload a bunch of stuff so the page isn't too bloated
|
// Overload a bunch of stuff so the page is not too bloated
|
||||||
|
|
||||||
function showBody()
|
function showBody()
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
/**
|
/**
|
||||||
* Start an HTML document
|
* Start an HTML document
|
||||||
*
|
*
|
||||||
* If $type isn't specified, will attempt to do content negotiation.
|
* If $type is not specified, will attempt to do content negotiation.
|
||||||
*
|
*
|
||||||
* Attempts to do content negotiation for language, also.
|
* Attempts to do content negotiation for language, also.
|
||||||
*
|
*
|
||||||
@ -375,8 +375,8 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
$url = parse_url($src);
|
$url = parse_url($src);
|
||||||
if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
|
if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
|
||||||
{
|
{
|
||||||
if(file_exists(theme_file($src,$theme))){
|
if(file_exists(Theme::file($src,$theme))){
|
||||||
$src = theme_path($src, $theme) . '?version=' . STATUSNET_VERSION;
|
$src = Theme::path($src, $theme) . '?version=' . STATUSNET_VERSION;
|
||||||
}else{
|
}else{
|
||||||
$src = common_path($src);
|
$src = common_path($src);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class ImageFile
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't crop/scale if it isn't necessary
|
// Do not crop/scale if it is not necessary
|
||||||
if ($size === $this->width
|
if ($size === $this->width
|
||||||
&& $size === $this->height
|
&& $size === $this->height
|
||||||
&& $x === 0
|
&& $x === 0
|
||||||
|
@ -437,7 +437,7 @@ function jabber_public_notice($notice)
|
|||||||
|
|
||||||
$public = common_config('xmpp', 'public');
|
$public = common_config('xmpp', 'public');
|
||||||
|
|
||||||
// FIXME PRIV don't send out private messages here
|
// FIXME PRIV do not send out private messages here
|
||||||
// XXX: should we send out non-local messages if public,localonly
|
// XXX: should we send out non-local messages if public,localonly
|
||||||
// = false? I think not
|
// = false? I think not
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ function mail_notify_nudge($from, $to)
|
|||||||
"these days and is inviting you to post some news.\n\n".
|
"these days and is inviting you to post some news.\n\n".
|
||||||
"So let's hear from you :)\n\n".
|
"So let's hear from you :)\n\n".
|
||||||
"%3\$s\n\n".
|
"%3\$s\n\n".
|
||||||
"Don't reply to this email; it won't get to them.\n\n".
|
"Do not reply to this email. It will not get to them.\n\n".
|
||||||
"With kind regards,\n".
|
"With kind regards,\n".
|
||||||
"%4\$s\n"),
|
"%4\$s\n"),
|
||||||
$from_profile->getBestName(),
|
$from_profile->getBestName(),
|
||||||
@ -516,7 +516,7 @@ function mail_notify_message($message, $from=null, $to=null)
|
|||||||
"------------------------------------------------------\n\n".
|
"------------------------------------------------------\n\n".
|
||||||
"You can reply to their message here:\n\n".
|
"You can reply to their message here:\n\n".
|
||||||
"%4\$s\n\n".
|
"%4\$s\n\n".
|
||||||
"Don't reply to this email; it won't get to them.\n\n".
|
"Do not reply to this email. It will not get to them.\n\n".
|
||||||
"With kind regards,\n".
|
"With kind regards,\n".
|
||||||
"%5\$s\n"),
|
"%5\$s\n"),
|
||||||
$from_profile->getBestName(),
|
$from_profile->getBestName(),
|
||||||
@ -532,7 +532,7 @@ function mail_notify_message($message, $from=null, $to=null)
|
|||||||
/**
|
/**
|
||||||
* notify a user that one of their notices has been chosen as a 'fave'
|
* notify a user that one of their notices has been chosen as a 'fave'
|
||||||
*
|
*
|
||||||
* Doesn't check that the user has an email address nor if they
|
* Does not check that the user has an email address nor if they
|
||||||
* want to receive notification of faves. Maybe this happens higher
|
* want to receive notification of faves. Maybe this happens higher
|
||||||
* up the stack...?
|
* up the stack...?
|
||||||
*
|
*
|
||||||
|
@ -347,7 +347,7 @@ class NoticeListItem extends Widget
|
|||||||
* show the link to the main page for the notice
|
* show the link to the main page for the notice
|
||||||
*
|
*
|
||||||
* Displays a link to the page for a notice, with "relative" time. Tries to
|
* Displays a link to the page for a notice, with "relative" time. Tries to
|
||||||
* get remote notice URLs correct, but doesn't always succeed.
|
* get remote notice URLs correct, but does not always succeed.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -483,7 +483,7 @@ class NoticeListItem extends Widget
|
|||||||
* show a link to reply to the current notice
|
* show a link to reply to the current notice
|
||||||
*
|
*
|
||||||
* Should either do the reply in the current notice form (if available), or
|
* Should either do the reply in the current notice form (if available), or
|
||||||
* link out to the notice-posting form. A little flakey, doesn't always work.
|
* link out to the notice-posting form. A little flakey, does not always work.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -513,7 +513,7 @@ class NoticeListItem extends Widget
|
|||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
if (!empty($user) &&
|
if (!empty($user) &&
|
||||||
($this->notice->profile_id == $user->id || $user->hasRight(Right::deleteOthersNotice))) {
|
($this->notice->profile_id == $user->id || $user->hasRight(Right::DELETEOTHERSNOTICE))) {
|
||||||
|
|
||||||
$deleteurl = common_local_url('deletenotice',
|
$deleteurl = common_local_url('deletenotice',
|
||||||
array('notice' => $this->notice->id));
|
array('notice' => $this->notice->id));
|
||||||
|
@ -114,7 +114,7 @@ class NoticeSection extends Section
|
|||||||
$att_class = 'attachments';
|
$att_class = 'attachments';
|
||||||
}
|
}
|
||||||
|
|
||||||
$clip = theme_path('images/icons/clip.png', 'base');
|
$clip = Theme::path('images/icons/clip.png', 'base');
|
||||||
$this->out->elementStart('a', array('class' => $att_class, 'style' => "font-style: italic;", 'href' => $href, 'title' => "# of attachments: $count"));
|
$this->out->elementStart('a', array('class' => $att_class, 'style' => "font-style: italic;", 'href' => $href, 'title' => "# of attachments: $count"));
|
||||||
$this->out->raw(" ($count ");
|
$this->out->raw(" ($count ");
|
||||||
$this->out->element('img', array('style' => 'display: inline', 'align' => 'top', 'width' => 20, 'height' => 20, 'src' => $clip, 'alt' => 'alt'));
|
$this->out->element('img', array('style' => 'display: inline', 'align' => 'top', 'width' => 20, 'height' => 20, 'src' => $clip, 'alt' => 'alt'));
|
||||||
|
@ -351,7 +351,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
|
|||||||
$author = User::staticGet('uri', $author_uri);
|
$author = User::staticGet('uri', $author_uri);
|
||||||
}
|
}
|
||||||
if (!$author) {
|
if (!$author) {
|
||||||
throw new Exception('No such user');
|
throw new Exception('No such user.');
|
||||||
}
|
}
|
||||||
|
|
||||||
common_log(LOG_DEBUG, print_r($author, true), __FILE__);
|
common_log(LOG_DEBUG, print_r($author, true), __FILE__);
|
||||||
@ -407,7 +407,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
|
|||||||
$user = User::staticGet('uri', $uri);
|
$user = User::staticGet('uri', $uri);
|
||||||
}
|
}
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw new Exception('No such user');
|
throw new Exception('No such user.');
|
||||||
}
|
}
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,8 @@ class QueueHandler extends Daemon
|
|||||||
* Initialization, run when the queue handler starts.
|
* Initialization, run when the queue handler starts.
|
||||||
* If this function indicates failure, the handler run will be aborted.
|
* If this function indicates failure, the handler run will be aborted.
|
||||||
*
|
*
|
||||||
* @fixme run() will abort if this doesn't return true,
|
* @fixme run() will abort if this does not return true,
|
||||||
* but some subclasses don't bother.
|
* but some subclasses do not bother.
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function start()
|
function start()
|
||||||
@ -108,8 +108,8 @@ class QueueHandler extends Daemon
|
|||||||
* Cleanup, run when the queue handler ends.
|
* Cleanup, run when the queue handler ends.
|
||||||
* If this function indicates failure, a warning will be logged.
|
* If this function indicates failure, a warning will be logged.
|
||||||
*
|
*
|
||||||
* @fixme run() will throw warnings if this doesn't return true,
|
* @fixme run() will throw warnings if this does not return true,
|
||||||
* but many subclasses don't bother.
|
* but many subclasses do not bother.
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function finish()
|
function finish()
|
||||||
@ -137,7 +137,7 @@ class QueueHandler extends Daemon
|
|||||||
* method, which passes control back to our handle_notice() method for
|
* method, which passes control back to our handle_notice() method for
|
||||||
* each notice that comes in on the queue.
|
* each notice that comes in on the queue.
|
||||||
*
|
*
|
||||||
* Most of the time this won't need to be overridden in a subclass.
|
* Most of the time this will not need to be overridden in a subclass.
|
||||||
*
|
*
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
@ -173,7 +173,7 @@ class QueueHandler extends Daemon
|
|||||||
* Called by QueueHandler after each handled item or empty polling cycle.
|
* Called by QueueHandler after each handled item or empty polling cycle.
|
||||||
* This is a good time to e.g. service your XMPP connection.
|
* This is a good time to e.g. service your XMPP connection.
|
||||||
*
|
*
|
||||||
* Doesn't need to be overridden if there's no maintenance to do.
|
* Does not need to be overridden if there's no maintenance to do.
|
||||||
*
|
*
|
||||||
* @param int $timeout seconds to sleep if there's nothing to do
|
* @param int $timeout seconds to sleep if there's nothing to do
|
||||||
*/
|
*/
|
||||||
|
@ -45,6 +45,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
|
|
||||||
class Right
|
class Right
|
||||||
{
|
{
|
||||||
const deleteOthersNotice = 'deleteothersnotice';
|
const DELETEOTHERSNOTICE = 'deleteothersnotice';
|
||||||
|
const CONFIGURESITE = 'configuresite';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ class Rss10Action extends Action
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: doesn't handle modified profiles, avatars, deleted notices
|
// FIXME: does not handle modified profiles, avatars, deleted notices
|
||||||
|
|
||||||
return strtotime($this->notices[0]->created);
|
return strtotime($this->notices[0]->created);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class MySQLSearch extends SearchEngine
|
|||||||
return true;
|
return true;
|
||||||
} else if ('identica_notices' === $this->table) {
|
} else if ('identica_notices' === $this->table) {
|
||||||
|
|
||||||
// Don't show imported notices
|
// Do not show imported notices
|
||||||
$this->target->whereAdd('notice.is_local != ' . Notice::GATEWAY);
|
$this->target->whereAdd('notice.is_local != ' . Notice::GATEWAY);
|
||||||
|
|
||||||
if (strtolower($q) != $q) {
|
if (strtolower($q) != $q) {
|
||||||
|
199
lib/theme.php
199
lib/theme.php
@ -23,7 +23,7 @@
|
|||||||
* @package StatusNet
|
* @package StatusNet
|
||||||
* @author Evan Prodromou <evan@status.net>
|
* @author Evan Prodromou <evan@status.net>
|
||||||
* @author Sarven Capadisli <csarven@status.net>
|
* @author Sarven Capadisli <csarven@status.net>
|
||||||
* @copyright 2008 StatusNet, Inc.
|
* @copyright 2008-2009 StatusNet, Inc.
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
@ -33,41 +33,63 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the full path of a file in a theme dir based on its relative name
|
* Class for querying and manipulating a theme
|
||||||
*
|
*
|
||||||
* @param string $relative relative path within the theme directory
|
* Themes are directories with some expected sub-directories and files
|
||||||
* @param string $theme name of the theme; defaults to current theme
|
* in them. They're found in either local/theme (for locally-installed themes)
|
||||||
|
* or theme/ subdir of installation dir.
|
||||||
*
|
*
|
||||||
* @return string File path to the theme file
|
* This used to be a couple of functions, but for various reasons it's nice
|
||||||
|
* to have a class instead.
|
||||||
|
*
|
||||||
|
* @category Output
|
||||||
|
* @package StatusNet
|
||||||
|
* @author Evan Prodromou <evan@status.net>
|
||||||
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function theme_file($relative, $theme=null)
|
class Theme
|
||||||
{
|
{
|
||||||
if (empty($theme)) {
|
var $dir = null;
|
||||||
$theme = common_config('site', 'theme');
|
var $path = null;
|
||||||
}
|
|
||||||
$dir = common_config('theme', 'dir');
|
|
||||||
if (empty($dir)) {
|
|
||||||
$dir = INSTALLDIR.'/theme';
|
|
||||||
}
|
|
||||||
return $dir.'/'.$theme.'/'.$relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the full URL of a file in a theme dir based on its relative name
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $relative relative path within the theme directory
|
* Determines the proper directory and path for this theme.
|
||||||
* @param string $theme name of the theme; defaults to current theme
|
|
||||||
*
|
*
|
||||||
* @return string URL of the file
|
* @param string $name Name of the theme; defaults to config value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function theme_path($relative, $theme=null)
|
function __construct($name=null)
|
||||||
{
|
{
|
||||||
if (empty($theme)) {
|
if (empty($name)) {
|
||||||
$theme = common_config('site', 'theme');
|
$name = common_config('site', 'theme');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check to see if it's in the local dir
|
||||||
|
|
||||||
|
$localroot = self::localRoot();
|
||||||
|
|
||||||
|
$fulldir = $localroot.'/'.$name;
|
||||||
|
|
||||||
|
if (file_exists($fulldir) && is_dir($fulldir)) {
|
||||||
|
$this->dir = $fulldir;
|
||||||
|
$this->path = common_path('local/theme/'.$name.'/');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check to see if it's in the distribution dir
|
||||||
|
|
||||||
|
$instroot = self::installRoot();
|
||||||
|
|
||||||
|
$fulldir = $instroot.'/'.$name;
|
||||||
|
|
||||||
|
if (file_exists($fulldir) && is_dir($fulldir)) {
|
||||||
|
|
||||||
|
$this->dir = $fulldir;
|
||||||
|
|
||||||
$path = common_config('theme', 'path');
|
$path = common_config('theme', 'path');
|
||||||
|
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
@ -90,5 +112,136 @@ function theme_path($relative, $theme=null)
|
|||||||
|
|
||||||
// XXX: protocol
|
// XXX: protocol
|
||||||
|
|
||||||
return 'http://'.$server.$path.$theme.'/'.$relative;
|
$this->path = 'http://'.$server.$path.$name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the full local filename of a file in this theme.
|
||||||
|
*
|
||||||
|
* @param string $relative relative name, like 'logo.png'
|
||||||
|
*
|
||||||
|
* @return string full pathname, like /var/www/mublog/theme/default/logo.png
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getFile($relative)
|
||||||
|
{
|
||||||
|
return $this->dir.'/'.$relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the full HTTP url of a file in this theme
|
||||||
|
*
|
||||||
|
* @param string $relative relative name, like 'logo.png'
|
||||||
|
*
|
||||||
|
* @return string full URL, like 'http://example.com/theme/default/logo.png'
|
||||||
|
*/
|
||||||
|
|
||||||
|
function getPath($relative)
|
||||||
|
{
|
||||||
|
return $this->path.'/'.$relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the full path of a file in a theme dir based on its relative name
|
||||||
|
*
|
||||||
|
* @param string $relative relative path within the theme directory
|
||||||
|
* @param string $name name of the theme; defaults to current theme
|
||||||
|
*
|
||||||
|
* @return string File path to the theme file
|
||||||
|
*/
|
||||||
|
|
||||||
|
static function file($relative, $name=null)
|
||||||
|
{
|
||||||
|
$theme = new Theme($name);
|
||||||
|
return $theme->getFile($relative);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the full URL of a file in a theme dir based on its relative name
|
||||||
|
*
|
||||||
|
* @param string $relative relative path within the theme directory
|
||||||
|
* @param string $name name of the theme; defaults to current theme
|
||||||
|
*
|
||||||
|
* @return string URL of the file
|
||||||
|
*/
|
||||||
|
|
||||||
|
static function path($relative, $name=null)
|
||||||
|
{
|
||||||
|
$theme = new Theme($name);
|
||||||
|
return $theme->getPath($relative);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list available theme names
|
||||||
|
*
|
||||||
|
* @return array list of available theme names
|
||||||
|
*/
|
||||||
|
|
||||||
|
static function listAvailable()
|
||||||
|
{
|
||||||
|
$local = self::subdirsOf(self::localRoot());
|
||||||
|
$install = self::subdirsOf(self::installRoot());
|
||||||
|
|
||||||
|
$i = array_search('base', $install);
|
||||||
|
|
||||||
|
unset($install[$i]);
|
||||||
|
|
||||||
|
return array_merge($local, $install);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility for getting subdirs of a directory
|
||||||
|
*
|
||||||
|
* @param string $dir full path to directory to check
|
||||||
|
*
|
||||||
|
* @return array relative filenames of subdirs, or empty array
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected static function subdirsOf($dir)
|
||||||
|
{
|
||||||
|
$subdirs = array();
|
||||||
|
|
||||||
|
if (is_dir($dir)) {
|
||||||
|
if ($dh = opendir($dir)) {
|
||||||
|
while (($filename = readdir($dh)) !== false) {
|
||||||
|
if ($filename != '..' && $filename !== '.' &&
|
||||||
|
is_dir($dir.'/'.$filename)) {
|
||||||
|
$subdirs[] = $filename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $subdirs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local root dir for themes
|
||||||
|
*
|
||||||
|
* @return string local root dir for themes
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected static function localRoot()
|
||||||
|
{
|
||||||
|
return INSTALLDIR.'/local/theme';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Root dir for themes that are shipped with StatusNet
|
||||||
|
*
|
||||||
|
* @return string root dir for StatusNet themes
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected static function installRoot()
|
||||||
|
{
|
||||||
|
$instroot = common_config('theme', 'dir');
|
||||||
|
|
||||||
|
if (empty($instroot)) {
|
||||||
|
$instroot = INSTALLDIR.'/theme';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $instroot;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
12
lib/util.php
12
lib/util.php
@ -62,7 +62,7 @@ function common_init_language()
|
|||||||
$locale_set = common_init_locale($language);
|
$locale_set = common_init_locale($language);
|
||||||
setlocale(LC_CTYPE, 'C');
|
setlocale(LC_CTYPE, 'C');
|
||||||
|
|
||||||
// So we don't have to make people install the gettext locales
|
// So we do not have to make people install the gettext locales
|
||||||
$path = common_config('site','locale_path');
|
$path = common_config('site','locale_path');
|
||||||
bindtextdomain("statusnet", $path);
|
bindtextdomain("statusnet", $path);
|
||||||
bind_textdomain_codeset("statusnet", "UTF-8");
|
bind_textdomain_codeset("statusnet", "UTF-8");
|
||||||
@ -139,7 +139,7 @@ function common_check_user($nickname, $password)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//no handler indicated the credentials were valid, and we know their not valid because the user isn't in the database
|
//no handler indicated the credentials were valid, and we know their not valid because the user is not in the database
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -396,7 +396,7 @@ function common_current_user()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logins that are 'remembered' aren't 'real' -- they're subject to
|
// Logins that are 'remembered' aren't 'real' -- they're subject to
|
||||||
// cookie-stealing. So, we don't let them do certain things. New reg,
|
// cookie-stealing. So, we do not let them do certain things. New reg,
|
||||||
// OpenID, and password logins _are_ real.
|
// OpenID, and password logins _are_ real.
|
||||||
|
|
||||||
function common_real_login($real=true)
|
function common_real_login($real=true)
|
||||||
@ -1147,7 +1147,7 @@ function common_accept_to_prefs($accept, $def = '*/*')
|
|||||||
$parts = explode(',', $accept);
|
$parts = explode(',', $accept);
|
||||||
|
|
||||||
foreach($parts as $part) {
|
foreach($parts as $part) {
|
||||||
// FIXME: doesn't deal with params like 'text/html; level=1'
|
// FIXME: does not deal with params like 'text/html; level=1'
|
||||||
@list($value, $qpart) = explode(';', trim($part));
|
@list($value, $qpart) = explode(';', trim($part));
|
||||||
$match = array();
|
$match = array();
|
||||||
if(!isset($qpart)) {
|
if(!isset($qpart)) {
|
||||||
@ -1346,7 +1346,7 @@ function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: show error page if we're on the Web
|
// FIXME: show error page if we're on the Web
|
||||||
/* Don't execute PHP internal error handler */
|
/* Do not execute PHP internal error handler */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1448,7 +1448,7 @@ function common_shorten_url($long_url)
|
|||||||
}
|
}
|
||||||
global $_shorteners;
|
global $_shorteners;
|
||||||
if (!isset($_shorteners[$svc])) {
|
if (!isset($_shorteners[$svc])) {
|
||||||
//the user selected service doesn't exist, so default to ur1.ca
|
//the user selected service does not exist, so default to ur1.ca
|
||||||
$svc = 'ur1.ca';
|
$svc = 'ur1.ca';
|
||||||
}
|
}
|
||||||
if (!isset($_shorteners[$svc])) {
|
if (!isset($_shorteners[$svc])) {
|
||||||
|
@ -112,7 +112,7 @@ class XMLOutputter
|
|||||||
*
|
*
|
||||||
* Utility for outputting an XML element. A convenient wrapper
|
* Utility for outputting an XML element. A convenient wrapper
|
||||||
* for a bunch of longer XMLWriter calls. This is best for
|
* for a bunch of longer XMLWriter calls. This is best for
|
||||||
* when an element doesn't have any sub-elements; if that's the
|
* when an element does not have any sub-elements; if that's the
|
||||||
* case, use elementStart() and elementEnd() instead.
|
* case, use elementStart() and elementEnd() instead.
|
||||||
*
|
*
|
||||||
* The $content element will be escaped for XML. If you need
|
* The $content element will be escaped for XML. If you need
|
||||||
|
@ -37,7 +37,7 @@ class XmppQueueHandler extends QueueHandler
|
|||||||
|
|
||||||
function start()
|
function start()
|
||||||
{
|
{
|
||||||
# Low priority; we don't want to receive messages
|
# Low priority; we do not want to receive messages
|
||||||
|
|
||||||
$this->log(LOG_INFO, "INITIALIZE");
|
$this->log(LOG_INFO, "INITIALIZE");
|
||||||
$this->conn = jabber_connect($this->_id.$this->transport());
|
$this->conn = jabber_connect($this->_id.$this->transport());
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user