summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-10 15:25:43 -0800
committerZach Copley <zach@status.net>2009-11-10 15:25:43 -0800
commitdb64b612961c37477d0729e9ff4f882fb5df7b8d (patch)
tree9ae5a31b58a289fc838c29c34230edd3962c231f /actions
parentee3fc8ba03ddd8451cac60547af72ea2cef7dc6a (diff)
parent91332cdadc20e721c22fcf22ca1773cedbde95c5 (diff)
Merge branch '0.9.x' into finish-account-api
* 0.9.x: Added a events for the settings menu items Bringing Sphinx search support up to code: broken out to a plugin, now supports multiple sites on a single server. Changed to Evan's event style and added an AuthPlugin superclass add geo output to statuses in json, xml, atom, rss in API Localisation updates from translatewiki.net (2009-11-10) Localisation updates from translatewiki.net Update pot add lat and long parameters to api/statuses/update change credential check to work more like other events fixup output of object attributes in db error code Performance fix for subscription/subscriber lists based on feedback from ops. Adjusting indexes to make favorites query more efficient, based on feedback from ops. Revert untested code; spews PHP notice warnings on every page view: "just sent a http 200 for the check-fancy from install.php" Added hook for the Group navigation items Updated block @title text (shouldn't say from group) Updated group block markup Revert "Remove more contractions"
Diffstat (limited to 'actions')
-rw-r--r--actions/allrss.php2
-rw-r--r--actions/apiaccountratelimitstatus.php2
-rw-r--r--actions/apifriendshipsdestroy.php2
-rw-r--r--actions/apistatusesupdate.php19
-rw-r--r--actions/attachment.php4
-rw-r--r--actions/avatarbynickname.php2
-rw-r--r--actions/block.php4
-rw-r--r--actions/groupblock.php19
-rw-r--r--actions/login.php2
-rw-r--r--actions/logout.php2
-rw-r--r--actions/newmessage.php2
-rw-r--r--actions/newnotice.php2
-rw-r--r--actions/noticesearch.php2
-rw-r--r--actions/noticesearchrss.php2
-rw-r--r--actions/opensearch.php2
-rw-r--r--actions/passwordsettings.php25
-rw-r--r--actions/peoplesearch.php2
-rw-r--r--actions/register.php2
-rw-r--r--actions/showgroup.php2
-rw-r--r--actions/showmessage.php8
-rw-r--r--actions/shownotice.php6
-rw-r--r--actions/showstream.php2
-rw-r--r--actions/sup.php2
-rw-r--r--actions/twitapisearchatom.php4
-rw-r--r--actions/twitapisearchjson.php2
-rw-r--r--actions/twitapitrends.php2
26 files changed, 65 insertions, 60 deletions
diff --git a/actions/allrss.php b/actions/allrss.php
index 4a5d15c7b..28b1be27d 100644
--- a/actions/allrss.php
+++ b/actions/allrss.php
@@ -56,7 +56,7 @@ class AllrssAction extends Rss10Action
*
* @param array $args Web and URL arguments
*
- * @return boolean false if user does not exist
+ * @return boolean false if user doesn't exist
*/
function prepare($args)
{
diff --git a/actions/apiaccountratelimitstatus.php b/actions/apiaccountratelimitstatus.php
index dd3fe312c..1a5afd552 100644
--- a/actions/apiaccountratelimitstatus.php
+++ b/actions/apiaccountratelimitstatus.php
@@ -36,7 +36,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/lib/apibareauth.php';
/**
- * We do not have a rate limit, but some clients check this method.
+ * We don't have a rate limit, but some clients check this method.
* It always returns the same thing: 150 hits left.
*
* @category API
diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php
index fb73624c9..3d9b7e001 100644
--- a/actions/apifriendshipsdestroy.php
+++ b/actions/apifriendshipsdestroy.php
@@ -113,7 +113,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
return;
}
- // Do not allow unsubscribing from yourself!
+ // Don't allow unsubscribing from yourself!
if ($this->user->id == $this->other->id) {
$this->clientError(
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php
index 5c23accca..7ddf7703b 100644
--- a/actions/apistatusesupdate.php
+++ b/actions/apistatusesupdate.php
@@ -61,6 +61,9 @@ class ApiStatusesUpdateAction extends ApiAuthAction
var $source = null;
var $status = null;
var $in_reply_to_status_id = null;
+ var $lat = null;
+ var $lon = null;
+
static $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api');
/**
@@ -79,6 +82,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$this->user = $this->auth_user;
$this->status = $this->trimmed('status');
$this->source = $this->trimmed('source');
+ $this->lat = $this->trimmed('lat');
+ $this->lon = $this->trimmed('long');
if (empty($this->source) || in_array($source, self::$reserved_sources)) {
$this->source = 'api';
@@ -198,6 +203,12 @@ class ApiStatusesUpdateAction extends ApiAuthAction
}
}
+ $location = null;
+
+ if (!empty($this->lat) && !empty($this->lon)) {
+ $location = Location::fromLatLon($this->lat, $this->lon);
+ }
+
$upload = null;
try {
@@ -225,7 +236,13 @@ class ApiStatusesUpdateAction extends ApiAuthAction
html_entity_decode($status_shortened, ENT_NOQUOTES, 'UTF-8'),
$this->source,
1,
- $reply_to
+ $reply_to,
+ null,
+ null,
+ empty($location) ? null : $location->lat,
+ empty($location) ? null : $location->lon,
+ empty($location) ? null : $location->location_id,
+ empty($location) ? null : $location->location_ns
);
if (isset($upload)) {
diff --git a/actions/attachment.php b/actions/attachment.php
index ca9e57845..6981354d1 100644
--- a/actions/attachment.php
+++ b/actions/attachment.php
@@ -146,7 +146,7 @@ class AttachmentAction extends Action
}
/**
- * Do not show local navigation
+ * Don't show local navigation
*
* @return void
*/
@@ -170,7 +170,7 @@ class AttachmentAction extends Action
}
/**
- * Do not show page notice
+ * Don't show page notice
*
* @return void
*/
diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php
index 1a6925e11..537950792 100644
--- a/actions/avatarbynickname.php
+++ b/actions/avatarbynickname.php
@@ -49,7 +49,7 @@ class AvatarbynicknameAction extends Action
*
* @param array $args query arguments
*
- * @return boolean false if nickname or user is not found
+ * @return boolean false if nickname or user isn't found
*/
function handle($args)
{
diff --git a/actions/block.php b/actions/block.php
index 408f16434..b125d2d8b 100644
--- a/actions/block.php
+++ b/actions/block.php
@@ -146,8 +146,8 @@ class BlockAction extends Action
$this->hidden($k, $v);
}
}
- $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group"));
- $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group'));
+ $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user"));
+ $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user'));
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
diff --git a/actions/groupblock.php b/actions/groupblock.php
index 133101eb7..faf18c6ad 100644
--- a/actions/groupblock.php
+++ b/actions/groupblock.php
@@ -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 do not have UI for it.
+ // XXX: could have proactive blocks, but we don't have UI for it.
if (!$this->profile->isMember($this->group)) {
$this->clientError(_('User is not a member of group.'));
return false;
@@ -151,17 +151,19 @@ class GroupblockAction extends Action
function areYouSureForm()
{
$id = $this->profile->id;
+ $this->elementStart('form', array('id' => 'block-' . $id,
+ 'method' => 'post',
+ 'class' => 'form_settings form_entity_block',
+ 'action' => common_local_url('groupblock')));
+ $this->elementStart('fieldset');
+ $this->hidden('token', common_session_token());
+ $this->element('legend', _('Block user'));
$this->element('p', null,
sprintf(_('Are you sure you want to block user "%s" from the group "%s"? '.
'They will be removed from the group, unable to post, and '.
'unable to subscribe to the group in the future.'),
$this->profile->getBestName(),
$this->group->getBestName()));
- $this->elementStart('form', array('id' => 'block-' . $id,
- 'method' => 'post',
- 'class' => 'block',
- 'action' => common_local_url('groupblock')));
- $this->hidden('token', common_session_token());
$this->hidden('blockto-' . $this->profile->id,
$this->profile->id,
'blockto');
@@ -173,8 +175,9 @@ class GroupblockAction extends Action
$this->hidden($k, $v);
}
}
- $this->submit('no', _('No'));
- $this->submit('yes', _('Yes'));
+ $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group"));
+ $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group'));
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
diff --git a/actions/login.php b/actions/login.php
index 679817520..ad57dd667 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -159,7 +159,7 @@ class LoginAction extends Action
$url = common_get_returnto();
if ($url) {
- // We do not have to return to it again
+ // We don't have to return to it again
common_set_returnto(null);
} else {
$url = common_local_url('all',
diff --git a/actions/logout.php b/actions/logout.php
index 7e768fca6..1e0adae57 100644
--- a/actions/logout.php
+++ b/actions/logout.php
@@ -81,7 +81,7 @@ class LogoutAction extends Action
{
common_set_user(null);
common_real_login(false); // not logged in
- common_forgetme(); // do not log back in!
+ common_forgetme(); // don't log back in!
}
}
diff --git a/actions/newmessage.php b/actions/newmessage.php
index 73307fdfc..0db2e7181 100644
--- a/actions/newmessage.php
+++ b/actions/newmessage.php
@@ -61,7 +61,7 @@ class NewmessageAction extends Action
/**
* Title of the page
*
- * Note that this usually does not get called unless something went wrong
+ * Note that this usually doesn't get called unless something went wrong
*
* @return string page title
*/
diff --git a/actions/newnotice.php b/actions/newnotice.php
index fc06e5c98..fbd7ab6bc 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -59,7 +59,7 @@ class NewnoticeAction extends Action
/**
* Title of the page
*
- * Note that this usually does not get called unless something went wrong
+ * Note that this usually doesn't get called unless something went wrong
*
* @return string page title
*/
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index 79cf572cc..1e5a69180 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -104,7 +104,7 @@ class NoticesearchAction extends SearchAction
{
$notice = new Notice();
- $search_engine = $notice->getSearchEngine('identica_notices');
+ $search_engine = $notice->getSearchEngine('notice');
$search_engine->set_sort_mode('chron');
// Ask for an extra to see if there's more.
$search_engine->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php
index f59ad7962..18f07f855 100644
--- a/actions/noticesearchrss.php
+++ b/actions/noticesearchrss.php
@@ -62,7 +62,7 @@ class NoticesearchrssAction extends Rss10Action
$notice = new Notice();
- $search_engine = $notice->getSearchEngine('identica_notices');
+ $search_engine = $notice->getSearchEngine('notice');
$search_engine->set_sort_mode('chron');
if (!$limit) $limit = 20;
diff --git a/actions/opensearch.php b/actions/opensearch.php
index b205d2fe2..861b53d7d 100644
--- a/actions/opensearch.php
+++ b/actions/opensearch.php
@@ -52,7 +52,7 @@ class OpensearchAction extends Action
*
* @param array $args query arguments
*
- * @return boolean false if user does not exist
+ * @return boolean false if user doesn't exist
*/
function handle($args)
{
diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php
index 15539d4a0..9e79501e2 100644
--- a/actions/passwordsettings.php
+++ b/actions/passwordsettings.php
@@ -58,19 +58,6 @@ 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
*
@@ -111,7 +98,7 @@ class PasswordsettingsAction extends AccountSettingsAction
$this->elementStart('ul', 'form_data');
- // Users who logged in with OpenID will not have a pwd
+ // Users who logged in with OpenID won't have a pwd
if ($user->password) {
$this->elementStart('li');
$this->password('oldpassword', _('Old password'));
@@ -182,8 +169,8 @@ class PasswordsettingsAction extends AccountSettingsAction
$oldpassword = null;
}
- $errormsg = false;
- if(! Event::handle('ChangePassword', array($user->nickname, $oldpassword, $newpassword, &$errormsg))){
+ $success = false;
+ if(! Event::handle('StartChangePassword', array($user->nickname, $oldpassword, $newpassword))){
//no handler changed the password, so change the password internally
$original = clone($user);
@@ -199,11 +186,9 @@ class PasswordsettingsAction extends AccountSettingsAction
$this->serverError(_('Can\'t save new password.'));
return;
}
+ Event::handle('EndChangePassword', array($nickname));
}
- if($errormsg === false)
- $this->showForm(_('Password saved.'), true);
- else
- $this->showForm($errormsg);
+ $this->showForm(_('Password saved.'), true);
}
}
diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php
index 38135ecbd..69de44859 100644
--- a/actions/peoplesearch.php
+++ b/actions/peoplesearch.php
@@ -61,7 +61,7 @@ class PeoplesearchAction extends SearchAction
function showResults($q, $page)
{
$profile = new Profile();
- $search_engine = $profile->getSearchEngine('identica_people');
+ $search_engine = $profile->getSearchEngine('profile');
$search_engine->set_sort_mode('chron');
// Ask for an extra to see if there's more.
$search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
diff --git a/actions/register.php b/actions/register.php
index c4f6760aa..57f8e7bdf 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -174,7 +174,7 @@ class RegisterAction extends Action
$bio = $this->trimmed('bio');
$location = $this->trimmed('location');
- // We do not trim these... whitespace is OK in a password!
+ // We don't trim these... whitespace is OK in a password!
$password = $this->arg('password');
$confirm = $this->arg('confirm');
diff --git a/actions/showgroup.php b/actions/showgroup.php
index ae956befa..a4af29391 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -418,7 +418,7 @@ class ShowgroupAction extends GroupDesignAction
// XXX: WORM cache this
$members = $this->group->getMembers();
$members_count = 0;
- /** $member->count() does not work. */
+ /** $member->count() doesn't work. */
while ($members->fetch()) {
$members_count++;
}
diff --git a/actions/showmessage.php b/actions/showmessage.php
index cf3a819c1..db757948b 100644
--- a/actions/showmessage.php
+++ b/actions/showmessage.php
@@ -137,7 +137,7 @@ class ShowmessageAction extends MailboxAction
}
/**
- * Do not show local navigation
+ * Don't show local navigation
*
* @return void
*/
@@ -147,7 +147,7 @@ class ShowmessageAction extends MailboxAction
}
/**
- * Do not show page notice
+ * Don't show page notice
*
* @return void
*/
@@ -157,7 +157,7 @@ class ShowmessageAction extends MailboxAction
}
/**
- * Do not show aside
+ * Don't show aside
*
* @return void
*/
@@ -167,7 +167,7 @@ class ShowmessageAction extends MailboxAction
}
/**
- * Do not show any instructions
+ * Don't show any instructions
*
* @return string
*/
diff --git a/actions/shownotice.php b/actions/shownotice.php
index 688089f02..5d16fdad9 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -208,7 +208,7 @@ class ShownoticeAction extends OwnerDesignAction
}
/**
- * Do not show local navigation
+ * Don't show local navigation
*
* @return void
*/
@@ -234,7 +234,7 @@ class ShownoticeAction extends OwnerDesignAction
}
/**
- * Do not show page notice
+ * Don't show page notice
*
* @return void
*/
@@ -244,7 +244,7 @@ class ShownoticeAction extends OwnerDesignAction
}
/**
- * Do not show aside
+ * Don't show aside
*
* @return void
*/
diff --git a/actions/showstream.php b/actions/showstream.php
index 4952ebdb7..663638c18 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -253,7 +253,7 @@ class ShowstreamAction extends ProfileAction
}
}
-// We do not show the author for a profile, since we already know who it is!
+// We don't show the author for a profile, since we already know who it is!
class ProfileNoticeList extends NoticeList
{
diff --git a/actions/sup.php b/actions/sup.php
index a199f247e..5daf0a1c1 100644
--- a/actions/sup.php
+++ b/actions/sup.php
@@ -61,7 +61,7 @@ class SupAction extends Action
$notice = new Notice();
# XXX: cache this. Depends on how big this protocol becomes;
- # Re-doing this query every 15 seconds is not the end of the world.
+ # Re-doing this query every 15 seconds isn't the end of the world.
$divider = common_sql_date(time() - $seconds);
diff --git a/actions/twitapisearchatom.php b/actions/twitapisearchatom.php
index 511d7cdc6..526ca2ae8 100644
--- a/actions/twitapisearchatom.php
+++ b/actions/twitapisearchatom.php
@@ -161,7 +161,7 @@ class TwitapisearchatomAction extends ApiAction
// lcase it for comparison
$q = strtolower($this->query);
- $search_engine = $notice->getSearchEngine('identica_notices');
+ $search_engine = $notice->getSearchEngine('notice');
$search_engine->set_sort_mode('chron');
$search_engine->limit(($this->page - 1) * $this->rpp,
$this->rpp + 1, true);
@@ -250,7 +250,7 @@ class TwitapisearchatomAction extends ApiAction
}
// FIXME: this alternate link is not quite right because our
- // web-based notice search does not support a rpp (responses per
+ // web-based notice search doesn't support a rpp (responses per
// page) param yet
$this->element('link', array('type' => 'text/html',
diff --git a/actions/twitapisearchjson.php b/actions/twitapisearchjson.php
index c7fa741a0..741ed78d6 100644
--- a/actions/twitapisearchjson.php
+++ b/actions/twitapisearchjson.php
@@ -121,7 +121,7 @@ class TwitapisearchjsonAction extends ApiAction
// lcase it for comparison
$q = strtolower($this->query);
- $search_engine = $notice->getSearchEngine('identica_notices');
+ $search_engine = $notice->getSearchEngine('notice');
$search_engine->set_sort_mode('chron');
$search_engine->limit(($this->page - 1) * $this->rpp, $this->rpp + 1, true);
if (false === $search_engine->query($q)) {
diff --git a/actions/twitapitrends.php b/actions/twitapitrends.php
index 2d17e77cc..779405e6d 100644
--- a/actions/twitapitrends.php
+++ b/actions/twitapitrends.php
@@ -55,7 +55,7 @@ class TwitapitrendsAction extends ApiAction
*
* @param array $args Web and URL arguments
*
- * @return boolean false if user does not exist
+ * @return boolean false if user doesn't exist
*/
function prepare($args)
{