X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Femailsettings.php;h=bfef2970dabbe1bc4a352220009bc8976077de13;hb=7ef6c9da437b504f949dc3d7d8c05f8abe36baae;hp=634388fdddbdf41acae10d679719d45148c5d869;hpb=34a61b40f47a52d1fdcf7cd907f3ac53b96b038e;p=quix0rs-gnu-social.git diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 634388fddd..bfef2970da 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -1,6 +1,6 @@ . * * @category Settings - * @package Laconica - * @author Evan Prodromou - * @author Zach Copley - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Zach Copley + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php'; * Settings for email * * @category Settings - * @package Laconica - * @author Evan Prodromou - * @author Zach Copley + * @package StatusNet + * @author Evan Prodromou + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ @@ -57,7 +57,7 @@ class EmailsettingsAction extends AccountSettingsAction function title() { - return _('Email Settings'); + return _('Email settings'); } /** @@ -71,6 +71,12 @@ class EmailsettingsAction extends AccountSettingsAction return _('Manage how you get email from %%site.name%%.'); } + function showScripts() + { + parent::showScripts(); + $this->autofocus('email'); + } + /** * Content area of the page * @@ -89,7 +95,7 @@ class EmailsettingsAction extends AccountSettingsAction 'class' => 'form_settings', 'action' => common_local_url('emailsettings'))); - + $this->elementStart('fieldset'); $this->elementStart('fieldset', array('id' => 'settings_email_address')); $this->element('legend', null, _('Address')); $this->hidden('token', common_session_token()); @@ -112,7 +118,7 @@ class EmailsettingsAction extends AccountSettingsAction } else { $this->elementStart('ul', 'form_data'); $this->elementStart('li'); - $this->input('email', _('Email Address'), + $this->input('email', _('Email address'), ($this->arg('email')) ? $this->arg('email') : null, _('Email address, like "UserName@example.org"')); $this->elementEnd('li'); @@ -122,7 +128,7 @@ class EmailsettingsAction extends AccountSettingsAction } $this->elementEnd('fieldset'); - if ($user->email) { + if (common_config('emailpost', 'enabled') && $user->email) { $this->elementStart('fieldset', array('id' => 'settings_email_incoming')); $this->element('legend',_('Incoming email')); if ($user->incomingemail) { @@ -173,11 +179,13 @@ class EmailsettingsAction extends AccountSettingsAction _('Allow friends to nudge me and send me an email.'), $user->emailnotifynudge); $this->elementEnd('li'); - $this->elementStart('li'); - $this->checkbox('emailpost', - _('I want to post notices by email.'), - $user->emailpost); - $this->elementEnd('li'); + if (common_config('emailpost', 'enabled')) { + $this->elementStart('li'); + $this->checkbox('emailpost', + _('I want to post notices by email.'), + $user->emailpost); + $this->elementEnd('li'); + } $this->elementStart('li'); $this->checkbox('emailmicroid', _('Publish a MicroID for my email address.'), @@ -186,6 +194,7 @@ class EmailsettingsAction extends AccountSettingsAction $this->elementEnd('ul'); $this->submit('save', _('Save')); $this->elementEnd('fieldset'); + $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -318,8 +327,8 @@ class EmailsettingsAction extends AccountSettingsAction $this->showForm(_('Cannot normalize that email address')); return; } - if (!Validate::email($email, true)) { - $this->showForm(_('Not a valid email address')); + if (!Validate::email($email, common_config('email', 'check_domain'))) { + $this->showForm(_('Not a valid email address.')); return; } else if ($user->email == $email) { $this->showForm(_('That is already your email address.'));