* PHP version 5
*
* @category Action
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://laconi.ca/
+ * @link http://status.net/
*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
* Make another user an admin of a group
*
* @category Action
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class MakeadminAction extends Action
return false;
}
$user = common_current_user();
- if (!$user->isAdmin($this->group)) {
+ if (!$user->isAdmin($this->group) &&
+ !$user->hasRight(Right::MAKEGROUPADMIN)) {
$this->clientError(_('Only an admin can make another user an admin.'), 401);
return false;
}
if ($this->profile->isAdmin($this->group)) {
- $this->clientError(sprintf(_('%s is already an admin for group "%s".'),
+ $this->clientError(sprintf(_('%1$s is already an admin for group "%2$s".'),
$this->profile->getBestName(),
$this->group->getBestName()),
401);
'profile_id' => $this->profile->id));
if (empty($member)) {
- $this->serverError(_('Can\'t get membership record for %s in group %s'),
+ $this->serverError(_('Can\'t get membership record for %1$s in group %2$s.'),
$this->profile->getBestName(),
$this->group->getBestName());
}
if (!$result) {
common_log_db_error($member, 'UPDATE', __FILE__);
- $this->serverError(_('Can\'t make %s an admin for group %s'),
+ $this->serverError(_('Can\'t make %1$s an admin for group %2$s.'),
$this->profile->getBestName(),
$this->group->getBestName());
}