We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit cae06a49 authored by Zach Copley's avatar Zach Copley

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
  ...
parents dbb86f94 223fee2a
......@@ -489,6 +489,10 @@ ChangePassword: Handle a password change request
- $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
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
- $user: User object
- &$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()) {
$current_user = common_current_user();
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 {
$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
*
* @return boolean false if user doesn't exist
* @return boolean false if user does not exist
*/
function prepare($args)
{
......
......@@ -36,7 +36,7 @@ if (!defined('STATUSNET')) {
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.
*
* @category API
......
......@@ -94,7 +94,7 @@ class ApiBlockCreateAction extends ApiAuthAction
}
if (empty($this->user) || empty($this->other)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -93,7 +93,7 @@ class ApiBlockDestroyAction extends ApiAuthAction
}
if (empty($this->user) || empty($this->other)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -74,7 +74,7 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->user = $this->auth_user;
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -72,7 +72,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
$this->user = $this->auth_user;
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -113,7 +113,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
return;
}
// Don't allow unsubscribing from yourself!
// Do not allow unsubscribing from yourself!
if ($this->user->id == $this->other->id) {
$this->clientError(
......
......@@ -109,7 +109,7 @@ class ApiGroupCreateAction extends ApiAuthAction
}
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -87,7 +87,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
parent::handle($args);
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -96,7 +96,7 @@ class ApiGroupJoinAction extends ApiAuthAction
}
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -96,7 +96,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
}
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -87,7 +87,7 @@ class ApiGroupListAction extends ApiBareAuthAction
parent::handle($args);
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -136,7 +136,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
}
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -84,7 +84,7 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('id'));
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return false;
}
......
......@@ -67,7 +67,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('id'));
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -76,7 +76,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('id'));
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -76,7 +76,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('id'));
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -78,7 +78,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$this->user = $this->getTargetUser($this->arg('id'));
if (empty($this->user)) {
$this->clientError(_('No such user!'), 404, $this->format);
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
......
......@@ -146,7 +146,7 @@ class AttachmentAction extends Action
}
/**
* Don't show local navigation
* Do not show local navigation
*
* @return void
*/
......@@ -170,7 +170,7 @@ class AttachmentAction extends Action
}
/**
* Don't show page notice
* Do not show page notice
*
* @return void
*/
......
......@@ -49,7 +49,7 @@ class AvatarbynicknameAction extends Action
*
* @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)
{
......
......@@ -67,7 +67,7 @@ class DeletenoticeAction extends Action
common_user_error(_('Not logged in.'));
exit;
} 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.'));
exit;
}
......
......@@ -136,7 +136,7 @@ class FoafAction extends Action
$person = $this->showMicrobloggingAccount($this->profile,
common_root_url(), $this->user->uri, false);
// Get users who subscribe to user
// Get people who subscribe to user
$sub = new Subscription();
$sub->subscribed = $this->profile->id;
......@@ -250,7 +250,7 @@ class FoafAction extends Action
if ($isSubscriber) {
$this->element('sioc:follows', array('rdf:resource'=>$this->user->uri . '#acct'));
} else {
// Get users user is subscribed to
// Get people user is subscribed to
$sub = new Subscription();
$sub->subscriber = $profile->id;
$sub->whereAdd('subscriber != subscribed');
......
......@@ -95,7 +95,7 @@ class GroupblockAction extends Action
$this->clientError(_('User is already blocked from group.'));
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)) {
$this->clientError(_('User is not a member of group.'));
return false;
......
......@@ -88,12 +88,11 @@ class GroupsAction extends Action
{
$notice =
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 ' .
'syntax "!groupname". Are you not seeing any groups ' .
'you like? Try ' .
'syntax "!groupname". Don\'t see a group you like? Try ' .
'[searching for one](%%%%action.groupsearch%%%%) or ' .
'[start your own](%%%%action.newgroup%%%%)!'));
'[start your own!](%%%%action.newgroup%%%%)'));
$this->elementStart('div', 'instructions');
$this->raw(common_markup_to_html($notice));
$this->elementEnd('div');
......
......@@ -69,7 +69,7 @@ class ImsettingsAction extends ConnectSettingsAction
{
return _('You can send and receive notices through '.
'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' =>
common_local_url('imsettings')));
$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());
if ($user->jabber) {
......@@ -111,7 +111,7 @@ class ImsettingsAction extends ConnectSettingsAction
if ($confirm) {
$this->element('p', 'form_unconfirmed', $confirm->address);
$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 '.
'message with further instructions. '.
'(Did you add %s to your buddy list?)'),
......@@ -151,7 +151,7 @@ class ImsettingsAction extends ConnectSettingsAction
$this->elementStart('li');
$this->checkbox('jabberreplies',
_('Send me replies through Jabber/GTalk '.
'from users I am not subscribed to.'),
'from people I\'m not subscribed to.'),
$user->jabberreplies);
$this->elementEnd('li');
$this->elementStart('li');
......
......@@ -133,7 +133,7 @@ class InviteAction extends CurrentUserDesignAction
$this->elementEnd('ul');
}
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');
foreach ($this->subbed as $other) {
$this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
......@@ -141,7 +141,7 @@ class InviteAction extends CurrentUserDesignAction
$this->elementEnd('ul');
}
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');
foreach ($this->sent as $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);
$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".
"You can also share news about yourself, your thoughts, or your life online with users who know about you. ".
"It is also great for meeting others who share your interests.\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 people who know about you. ".
"It's also great for meeting new people who share your interests.\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".
"%5\$s\n\n".
......
......@@ -159,7 +159,7 @@ class LoginAction extends Action
$url = common_get_returnto();
if ($url) {
// We don't have to return to it again
// We do not have to return to it again
common_set_returnto(null);
} else {
$url = common_local_url('all',
......
......@@ -81,7 +81,7 @@ class LogoutAction extends Action
{
common_set_user(null);
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);
if (!$user) {
$this->clientError(_('No such user'), 404);
$this->clientError(_('No such user.'), 404);
return;
}
......
......@@ -61,7 +61,7 @@ class NewmessageAction extends Action
/**
* 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
*/
......@@ -113,7 +113,7 @@ class NewmessageAction extends Action
$this->other = User::staticGet('id', $this->to);
if (!$this->other) {
$this->clientError(_('No such user'), 404);
$this->clientError(_('No such user.'), 404);
return false;
}
......
......@@ -59,7 +59,7 @@ class NewnoticeAction extends Action
/**
* 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
*/
......
......@@ -44,7 +44,7 @@ require_once INSTALLDIR.'/lib/searchaction.php';
* @author Robin Millette <millette@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
* @todo common parent for user and content search?
* @todo common parent for people and content search?
*/
class NoticesearchAction extends SearchAction
{
......
......@@ -52,7 +52,7 @@ class OpensearchAction extends Action
*
* @param array $args query arguments
*
* @return boolean false if user doesn't exist
* @return boolean false if user does not exist
*/
function handle($args)
{
......@@ -61,7 +61,7 @@ class OpensearchAction extends Action
$short_name = '';
if ($type == 'people') {
$type = 'peoplesearch';
$short_name = _('User Search');
$short_name = _('People Search');
} else {
$type = 'noticesearch';
$short_name = _('Notice Search');
......@@ -75,7 +75,7 @@ class OpensearchAction extends Action
$this->element('Url', array('type' => 'text/html', 'method' => 'get',
'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' => 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('Language', null, common_language());
$this->element('OutputEncoding', null, 'UTF-8');
......
......@@ -58,6 +58,19 @@ class PasswordsettingsAction extends AccountSettingsAction
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
*
......@@ -86,6 +99,7 @@ class PasswordsettingsAction extends AccountSettingsAction
function showContent()
{
$user = common_current_user();
$this->elementStart('form', array('method' => 'POST',
'id' => 'form_password',
'class' => 'form_settings',
......@@ -97,7 +111,7 @@ class PasswordsettingsAction extends AccountSettingsAction
$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) {
$this->elementStart('li');
$this->password('oldpassword', _('Old password'));
......
......@@ -49,7 +49,7 @@ class PeoplesearchAction extends SearchAction
{
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.');
}
......
......@@ -67,7 +67,7 @@ class PeopletagAction extends Action
$this->tag = $this->trimmed('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));
return;
}
......
......@@ -68,8 +68,8 @@ class ProfilesettingsAction extends AccountSettingsAction
function getInstructions()
{
return _('You can update your personal profile info here ' .
'so readers know more about you.');
return _('You can update your personal profile info here '.
'so people know more about you.');
}
function showScripts()
......
......@@ -82,14 +82,14 @@ class RegisterAction extends Action
}
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;
}
if (!empty($this->code)) {
$this->invite = Invitation::staticGet('code', $this->code);
if (empty($this->invite)) {
$this->clientError(_('Sorry. This is an invalid invitation code.'));
$this->clientError(_('Sorry, invalid invitation code.'));
return false;
}
// Store this in case we need it
......@@ -174,7 +174,7 @@ class RegisterAction extends Action
$bio = $this->trimmed('bio');
$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');
$confirm = $this->arg('confirm');
......@@ -186,7 +186,7 @@ class RegisterAction extends Action
}
if (common_config('site', 'inviteonly') && !($code && $invite)) {
$this->clientError(_('Sorry. Only those invited can register.'));
$this->clientError(_('Sorry, only invited people can register.'));
return;
}
......@@ -401,7 +401,7 @@ class RegisterAction extends Action
}
if (common_config('site', 'inviteonly') && !($code && $invite)) {
$this->clientError(_('Sorry. Only those invited can register.'));
$this->clientError(_('Sorry, only invited people can register.'));
return;
}
......@@ -542,7 +542,7 @@ class RegisterAction extends Action
'(%%%%action.imsettings%%%%) '.
'so you can send notices '.
'through instant messages.' . "\n" .
'* [Search for users](%%%%action.peoplesearch%%%%) '.
'* [Search for people](%%%%action.peoplesearch%%%%) '.
'that you may know or '.
'that share your interests. ' . "\n" .
'* Update your [profile settings]'.
......
......@@ -151,7 +151,7 @@ class RemotesubscribeAction extends Action
$this->profile_url = $this->trimmed('profile_url');
if (!$this->profile_url) {
$this->showForm(_('No such user'));
$this->showForm(_('No such user.'));
return;
}
......
......@@ -195,12 +195,12 @@ class RepliesAction extends OwnerDesignAction
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()) {
$current_user = common_current_user();
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 {