diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-05-19 13:57:37 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-05-19 13:57:37 +0000 |
| commit | 57d3ccd32fe4091f2a733aad99b6c52f4f5fadfb (patch) | |
| tree | 4f9f6a5a079d454e130b0bccf2173c4469f4e4a3 /plugins/new_user_dialog/new_user_dialog.php | |
| parent | 01b5c10408596b28cba02a7040c91e2eefab1762 (diff) | |
- Display overlay only on main template of mail task
git-svn-id: https://svn.roundcube.net/trunk@3638 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/new_user_dialog/new_user_dialog.php')
| -rw-r--r-- | plugins/new_user_dialog/new_user_dialog.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/new_user_dialog/new_user_dialog.php b/plugins/new_user_dialog/new_user_dialog.php index 828e66b51..57ceba76d 100644 --- a/plugins/new_user_dialog/new_user_dialog.php +++ b/plugins/new_user_dialog/new_user_dialog.php @@ -13,18 +13,18 @@ class new_user_dialog extends rcube_plugin { public $task = 'login|mail'; - + function init() { $this->add_hook('create_identity', array($this, 'create_identity')); - + // register additional hooks if session flag is set if ($_SESSION['plugin.newuserdialog']) { $this->add_hook('render_page', array($this, 'render_page')); $this->register_action('plugin.newusersave', array($this, 'save_data')); } } - + /** * Check newly created identity at first login */ @@ -41,16 +41,16 @@ class new_user_dialog extends rcube_plugin */ function render_page($p) { - if ($_SESSION['plugin.newuserdialog']) { + if ($_SESSION['plugin.newuserdialog'] && $p['template'] == 'mail') { $this->add_texts('localization'); - + $rcmail = rcmail::get_instance(); $identity = $rcmail->user->get_identity(); $identities_level = intval($rcmail->config->get('identities_level', 0)); - + // compose user-identity dialog $table = new html_table(array('cols' => 2)); - + $table->add('title', $this->gettext('name')); $table->add(null, html::tag('input', array( 'type' => 'text', @@ -65,7 +65,7 @@ class new_user_dialog extends rcube_plugin 'value' => $identity['email'], 'disabled' => ($identities_level == 1 || $identities_level == 3) ))); - + // add overlay input box to html page $rcmail->output->add_footer(html::div(array('id' => 'newuseroverlay'), html::tag('form', array( @@ -102,25 +102,25 @@ class new_user_dialog extends rcube_plugin $rcmail = rcmail::get_instance(); $identity = $rcmail->user->get_identity(); $identities_level = intval($rcmail->config->get('identities_level', 0)); - + $save_data = array( 'name' => get_input_value('_name', RCUBE_INPUT_POST), 'email' => get_input_value('_email', RCUBE_INPUT_POST), ); - + // don't let the user alter the e-mail address if disabled by config if ($identities_level == 1 || $identities_level == 3) $save_data['email'] = $identity['email']; - + // save data if not empty if (!empty($save_data['name']) && !empty($save_data['email'])) { $rcmail->user->update_identity($identity['identity_id'], $save_data); $rcmail->session->remove('plugin.newuserdialog'); } - + $rcmail->output->redirect(''); } - + } ?>
\ No newline at end of file |
