X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fimsettings.php;h=c3360fb12a5b16483428f118d10a9699b703e3d0;hb=1eeb23e1e3b77de056791a74cd3e4f5c02d68510;hp=edbd81b5786fcd111d4fffe9b991cac2097c6c13;hpb=d46c2cc8a70d83f7bf761ea8c778a8cd56d8e692;p=quix0rs-gnu-social.git diff --git a/actions/imsettings.php b/actions/imsettings.php index edbd81b578..c3360fb12a 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -1,6 +1,6 @@ . * * @category Settings - * @package Laconica - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @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,10 +38,10 @@ require_once INSTALLDIR.'/lib/jabber.php'; * Settings for Jabber/XMPP integration * * @category Settings - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @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 SettingsAction */ @@ -56,7 +56,7 @@ class ImsettingsAction extends ConnectSettingsAction function title() { - return _('IM Settings'); + return _('IM settings'); } /** @@ -84,6 +84,12 @@ class ImsettingsAction extends ConnectSettingsAction function showContent() { + if (!common_config('xmpp', 'enabled')) { + $this->element('div', array('class' => 'error'), + _('IM is not available.')); + return; + } + $user = common_current_user(); $this->elementStart('form', array('method' => 'post', 'id' => 'form_settings_im', @@ -113,9 +119,9 @@ class ImsettingsAction extends ConnectSettingsAction $this->hidden('jabber', $confirm->address); $this->submit('cancel', _('Cancel')); } else { - $this->elementStart('ul', 'form_datas'); + $this->elementStart('ul', 'form_data'); $this->elementStart('li'); - $this->input('jabber', _('IM Address'), + $this->input('jabber', _('IM address'), ($this->arg('jabber')) ? $this->arg('jabber') : null, sprintf(_('Jabber or GTalk address, '. 'like "UserName@example.org". '. @@ -131,7 +137,7 @@ class ImsettingsAction extends ConnectSettingsAction $this->elementStart('fieldset', array('id' => 'settings_im_preferences')); $this->element('legend', null, _('Preferences')); - $this->elementStart('ul', 'form_datas'); + $this->elementStart('ul', 'form_data'); $this->elementStart('li'); $this->checkbox('jabbernotify', _('Send me notices through Jabber/GTalk.'), @@ -286,7 +292,7 @@ class ImsettingsAction extends ConnectSettingsAction $this->showForm(_('Cannot normalize that Jabber ID')); return; } - if (!jabber_valid_base_jid($jabber)) { + if (!jabber_valid_base_jid($jabber, common_config('email', 'domain_check'))) { $this->showForm(_('Not a valid Jabber ID')); return; } else if ($user->jabber == $jabber) { @@ -303,6 +309,8 @@ class ImsettingsAction extends ConnectSettingsAction $confirm->address_type = 'jabber'; $confirm->user_id = $user->id; $confirm->code = common_confirmation_code(64); + $confirm->sent = common_sql_now(); + $confirm->claimed = common_sql_now(); $result = $confirm->insert(); @@ -312,11 +320,9 @@ class ImsettingsAction extends ConnectSettingsAction return; } - if (!common_config('queue', 'enabled')) { - jabber_confirm_address($confirm->code, - $user->nickname, - $jabber); - } + jabber_confirm_address($confirm->code, + $user->nickname, + $jabber); $msg = sprintf(_('A confirmation code was sent '. 'to the IM address you added. '.