summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-06-26 10:17:36 -0400
committerBrion Vibber <brion@pobox.com>2010-06-26 10:17:36 -0400
commit696e4ba393c658d5b2e1fe46e1389bd7b2cfdb34 (patch)
tree45c4f1512599175afea67f8a68e1b3ad66cace97 /actions
parent72e486a3226c9101f33bd86f953dbb9650c19fd1 (diff)
parentd9e56e15cc3174093fc994e524d1d9cf402ae8a3 (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: plugins/OpenID/openidserver.php (cleaned up mismatched comment)
Diffstat (limited to 'actions')
-rw-r--r--actions/apiaccountverifycredentials.php2
-rw-r--r--actions/apisearchatom.php (renamed from actions/twitapisearchatom.php)12
-rw-r--r--actions/apisearchjson.php (renamed from actions/twitapisearchjson.php)7
-rw-r--r--actions/apisubscriptions.php3
-rw-r--r--actions/apitrends.php (renamed from actions/twitapitrends.php)8
-rw-r--r--actions/showgroup.php10
6 files changed, 23 insertions, 19 deletions
diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php
index ea61a3205..79416e9b2 100644
--- a/actions/apiaccountverifycredentials.php
+++ b/actions/apiaccountverifycredentials.php
@@ -75,7 +75,7 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
if ($this->format == 'xml') {
$this->initDocument('xml');
- $this->showTwitterXmlUser($twitter_user);
+ $this->showTwitterXmlUser($twitter_user, 'user', true);
$this->endDocument('xml');
} elseif ($this->format == 'json') {
$this->initDocument('json');
diff --git a/actions/twitapisearchatom.php b/actions/apisearchatom.php
index 51e8a8881..60bb8b040 100644
--- a/actions/twitapisearchatom.php
+++ b/actions/apisearchatom.php
@@ -22,7 +22,7 @@
* @category Search
* @package StatusNet
* @author Zach Copley <zach@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -31,6 +31,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
+require_once INSTALLDIR.'/lib/apiprivateauth.php';
+
/**
* Action for outputting search results in Twitter compatible Atom
* format.
@@ -44,10 +46,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*
- * @see ApiAction
+ * @see ApiPrivateAuthAction
*/
-class TwitapisearchatomAction extends ApiAction
+class ApiSearchAtomAction extends ApiPrivateAuthAction
{
var $cnt;
@@ -96,8 +98,11 @@ class TwitapisearchatomAction extends ApiAction
function prepare($args)
{
+ common_debug("in apisearchatom prepare()");
+
parent::prepare($args);
+
$this->query = $this->trimmed('q');
$this->lang = $this->trimmed('lang');
$this->rpp = $this->trimmed('rpp');
@@ -138,6 +143,7 @@ class TwitapisearchatomAction extends ApiAction
function handle($args)
{
parent::handle($args);
+ common_debug("In apisearchatom handle()");
$this->showAtom();
}
diff --git a/actions/twitapisearchjson.php b/actions/apisearchjson.php
index b5c006aa7..e44634684 100644
--- a/actions/twitapisearchjson.php
+++ b/actions/apisearchjson.php
@@ -22,7 +22,7 @@
* @category Search
* @package StatusNet
* @author Zach Copley <zach@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -31,6 +31,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
+require_once INSTALLDIR.'/lib/apiprivateauth.php';
require_once INSTALLDIR.'/lib/jsonsearchresultslist.php';
/**
@@ -44,7 +45,7 @@ require_once INSTALLDIR.'/lib/jsonsearchresultslist.php';
* @see ApiAction
*/
-class TwitapisearchjsonAction extends ApiAction
+class ApiSearchJSONAction extends ApiPrivateAuthAction
{
var $query;
var $lang;
@@ -64,6 +65,8 @@ class TwitapisearchjsonAction extends ApiAction
function prepare($args)
{
+ common_debug("apisearchjson prepare()");
+
parent::prepare($args);
$this->query = $this->trimmed('q');
diff --git a/actions/apisubscriptions.php b/actions/apisubscriptions.php
index 0ba324057..63d65f289 100644
--- a/actions/apisubscriptions.php
+++ b/actions/apisubscriptions.php
@@ -206,7 +206,8 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
{
switch ($this->format) {
case 'xml':
- $this->elementStart('users', array('type' => 'array'));
+ $this->elementStart('users', array('type' => 'array',
+ 'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
foreach ($this->profiles as $profile) {
$this->showProfile(
$profile,
diff --git a/actions/twitapitrends.php b/actions/apitrends.php
index 5a04569a2..5b74636c6 100644
--- a/actions/twitapitrends.php
+++ b/actions/apitrends.php
@@ -22,7 +22,7 @@
* @category Search
* @package StatusNet
* @author Zach Copley <zach@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -31,6 +31,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
+require_once INSTALLDIR.'/lib/apiprivateauth.php';
+
/**
* Returns the top ten queries that are currently trending
*
@@ -43,7 +45,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @see ApiAction
*/
-class TwitapitrendsAction extends ApiAction
+class ApiTrendsAction extends ApiPrivateAuthAction
{
var $callback;
@@ -82,7 +84,7 @@ class TwitapitrendsAction extends ApiAction
*/
function showTrends()
{
- $this->serverError(_('API method under construction.'), $code = 501);
+ $this->serverError(_('API method under construction.'), 501);
}
} \ No newline at end of file
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 3d369e9eb..17c37e4d7 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -430,14 +430,6 @@ class ShowgroupAction extends GroupDesignAction
function showStatistics()
{
- // XXX: WORM cache this
- $members = $this->group->getMembers();
- $members_count = 0;
- /** $member->count() doesn't work. */
- while ($members->fetch()) {
- $members_count++;
- }
-
$this->elementStart('div', array('id' => 'entity_statistics',
'class' => 'section'));
@@ -451,7 +443,7 @@ class ShowgroupAction extends GroupDesignAction
$this->elementStart('dl', 'entity_members');
$this->element('dt', null, _('Members'));
- $this->element('dd', null, (is_int($members_count)) ? $members_count : '0');
+ $this->element('dd', null, $this->group->getMemberCount());
$this->elementEnd('dl');
$this->elementEnd('div');