X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Femailsettings.php;h=67b991cdc8b3d09afffe2349c3f9d925d2719898;hb=0e5cf9b3b4002d4da092633150e0faf35b166dcf;hp=0a86aa66d182aed98e58d6328ea5c05ad40dbe8d;hpb=616bdd43a921b2554d21b80af28ddb0fb6cb3c16;p=quix0rs-gnu-social.git diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 0a86aa66d1..67b991cdc8 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 */ @@ -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 * @@ -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) { @@ -164,15 +170,22 @@ class EmailsettingsAction extends AccountSettingsAction $user->emailnotifymsg); $this->elementEnd('li'); $this->elementStart('li'); + $this->checkbox('emailnotifyattn', + _('Send me email when someone sends me an "@-reply".'), + $user->emailnotifyattn); + $this->elementEnd('li'); + $this->elementStart('li'); $this->checkbox('emailnotifynudge', _('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.'), @@ -255,6 +268,7 @@ class EmailsettingsAction extends AccountSettingsAction $emailnotifyfav = $this->boolean('emailnotifyfav'); $emailnotifymsg = $this->boolean('emailnotifymsg'); $emailnotifynudge = $this->boolean('emailnotifynudge'); + $emailnotifyattn = $this->boolean('emailnotifyattn'); $emailmicroid = $this->boolean('emailmicroid'); $emailpost = $this->boolean('emailpost'); @@ -270,6 +284,7 @@ class EmailsettingsAction extends AccountSettingsAction $user->emailnotifyfav = $emailnotifyfav; $user->emailnotifymsg = $emailnotifymsg; $user->emailnotifynudge = $emailnotifynudge; + $user->emailnotifyattn = $emailnotifyattn; $user->emailmicroid = $emailmicroid; $user->emailpost = $emailpost; @@ -311,7 +326,7 @@ class EmailsettingsAction extends AccountSettingsAction $this->showForm(_('Cannot normalize that email address')); return; } - if (!Validate::email($email, true)) { + if (!Validate::email($email, common_config('email', 'check_domain'))) { $this->showForm(_('Not a valid email address')); return; } else if ($user->email == $email) { @@ -487,26 +502,4 @@ class EmailsettingsAction extends AccountSettingsAction return $other->id != $user->id; } } - - /** - * Handle old fashioned PEAR_Error msgs coming from DB_DataObject - * - * In this case email don't exist in the DB yet, so DB_DataObject - * throws an error. Overrided from Action. - * - * @param PEAR_Error - * - * @return nothing - */ - - function handleError($error) { - if ($error->getCode() == DB_DATAOBJECT_ERROR_NODATA) { - - // Do nothing. - - } else { - parent::handleError($error); - } - } - }