* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
+ *
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
* @author Sarven Capadisli <csarven@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/
*/
function title()
{
- return _('User');
+ // TRANS: User admin panel title
+ return _m('TITLE', 'User');
}
/**
function getInstructions()
{
- return _('User settings for this StatusNet site.');
+ return _('User settings for this StatusNet site');
}
/**
);
static $booleans = array(
- 'sessions' => array('handle', 'debug'),
'invite' => array('enabled')
);
function validate(&$values)
{
+ // Validate biolimit
+
+ if (!Validate::number($values['profile']['biolimit'])) {
+ $this->clientError(_("Invalid bio limit. Must be numeric."));
+ }
+
+ // Validate welcome text
+
+ if (mb_strlen($values['newuser']['welcome']) > 255) {
+ $this->clientError(_("Invalid welcome text. Max length is 255 characters."));
+ }
+
+ // Validate default subscription
+
+ if (!empty($values['newuser']['default'])) {
+ $defuser = User::staticGet('nickname', trim($values['newuser']['default']));
+ if (empty($defuser)) {
+ $this->clientError(
+ sprintf(
+ _('Invalid default subscripton: \'%1$s\' is not user.'),
+ $values['newuser']['default']
+ )
+ );
+ }
+ }
}
}
$this->li();
$this->input('welcome', _('New user welcome'),
- _('Welcome text for new users.'),
+ _('Welcome text for new users (Max 255 chars).'),
'newuser');
$this->unli();
$this->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
- $this->out->elementStart('fieldset', array('id' => 'settings_user_sessions'));
- $this->out->element('legend', null, _('Sessions'));
-
- $this->out->elementStart('ul');
- $this->li();
- $this->out->checkbox('sessions-handle', _('Handle sessions'),
- (bool) $this->value('handle', 'sessions'),
- _('Whether to handle sessions ourselves.'));
- $this->unli();
-
- $this->li();
- $this->out->checkbox('sessions-debug', _('Session debugging'),
- (bool) $this->value('debug', 'sessions'),
- _('Turn on debugging output for sessions.'));
- $this->unli();
-
- $this->out->elementEnd('ul');
-
- $this->out->elementEnd('fieldset');
}
function formActions()
{
- $this->out->submit('submit', _('Save'), 'submit', null, _('Save site settings'));
+ $this->out->submit('submit', _('Save'), 'submit', null, _('Save user settings'));
}
}