* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiGroupMembershipAction extends ApiPrivateAuthAction
{
var $group = null;
* @param array $args $_REQUEST args
*
* @return boolean success flag
- *
*/
-
function prepare($args)
{
parent::prepare($args);
$this->group = $this->getTargetGroup($this->arg('id'));
+ if (empty($this->group)) {
+ // TRANS: Client error displayed trying to show group membership on a non-existing group.
+ $this->clientError(_('Group not found.'), 404, $this->format);
+ return false;
+ }
+
$this->profiles = $this->getProfiles();
return true;
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
- if (empty($this->group)) {
- $this->clientError(_('Group not found.'), 404, $this->format);
- return false;
- }
-
// XXX: RSS and Atom
switch($this->format) {
break;
default:
$this->clientError(
+ // TRANS: Client error displayed trying to execute an unknown API method showing group membership.
_('API method not found.'),
404,
$this->format
*
* @return array $profiles list of profiles
*/
-
function getProfiles()
{
$profiles = array();
*
* @return boolean true
*/
-
function isReadOnly($args)
{
return true;
*
* @return string datestamp of the lastest profile in the group
*/
-
function lastModified()
{
if (!empty($this->profiles) && (count($this->profiles) > 0)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->profiles) && (count($this->profiles) > 0)) {
return null;
}
-
}