diff options
Diffstat (limited to 'plugins/new_user_dialog')
22 files changed, 532 insertions, 0 deletions
diff --git a/plugins/new_user_dialog/localization/bg_BG.inc b/plugins/new_user_dialog/localization/bg_BG.inc new file mode 100644 index 000000000..9575daa49 --- /dev/null +++ b/plugins/new_user_dialog/localization/bg_BG.inc @@ -0,0 +1,20 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/bg_BG/labels.inc | + | | + | Language file of the Roundcube Webmail client | + | Copyright (C) 2012, The Roundcube Dev Team | + | Licensed under the GNU General Public License | + | | + +-----------------------------------------------------------------------+ + | Author: Thomas <Unknown> | + +-----------------------------------------------------------------------+ + @version $Id$ +*/ + +$labels = array(); +$labels['identitydialogtitle'] = 'Моля попълнете Вашите данни.'; +$labels['identitydialoghint'] = 'Това съобщение се появява само при първото влизане.'; + diff --git a/plugins/new_user_dialog/localization/cs_CZ.inc b/plugins/new_user_dialog/localization/cs_CZ.inc new file mode 100644 index 000000000..fe05e6aae --- /dev/null +++ b/plugins/new_user_dialog/localization/cs_CZ.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Prosím doplňte své jméno a e-mail'; +$labels['identitydialoghint'] = 'Tento dialog se objeví pouze při prvním přihlášení.'; + +?> diff --git a/plugins/new_user_dialog/localization/de_CH.inc b/plugins/new_user_dialog/localization/de_CH.inc new file mode 100644 index 000000000..d2a1310d0 --- /dev/null +++ b/plugins/new_user_dialog/localization/de_CH.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Bitte vervollständigen Sie Ihre Absender-Informationen'; +$labels['identitydialoghint'] = 'Dieser Dialog erscheint nur einmal beim ersten Login.'; + +?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/de_DE.inc b/plugins/new_user_dialog/localization/de_DE.inc new file mode 100644 index 000000000..d2a1310d0 --- /dev/null +++ b/plugins/new_user_dialog/localization/de_DE.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Bitte vervollständigen Sie Ihre Absender-Informationen'; +$labels['identitydialoghint'] = 'Dieser Dialog erscheint nur einmal beim ersten Login.'; + +?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/en_US.inc b/plugins/new_user_dialog/localization/en_US.inc new file mode 100644 index 000000000..d9f531ba7 --- /dev/null +++ b/plugins/new_user_dialog/localization/en_US.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Please complete your sender identity'; +$labels['identitydialoghint'] = 'This box only appears once at the first login.'; + +?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/es_ES.inc b/plugins/new_user_dialog/localization/es_ES.inc new file mode 100644 index 000000000..2d2ccfe0a --- /dev/null +++ b/plugins/new_user_dialog/localization/es_ES.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Por favor, complete sus datos personales'; +$labels['identitydialoghint'] = 'Este diálogo sólo aparecerá la primera vez que se conecte al correo.'; + +?> diff --git a/plugins/new_user_dialog/localization/et_EE.inc b/plugins/new_user_dialog/localization/et_EE.inc new file mode 100644 index 000000000..7c6b3f20d --- /dev/null +++ b/plugins/new_user_dialog/localization/et_EE.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Palun täida oma saatja identiteet'; +$labels['identitydialoghint'] = 'See kast ilmub ainult esimesel sisselogimisel.'; + +?> diff --git a/plugins/new_user_dialog/localization/gl_ES.inc b/plugins/new_user_dialog/localization/gl_ES.inc new file mode 100644 index 000000000..e29993539 --- /dev/null +++ b/plugins/new_user_dialog/localization/gl_ES.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Por favor, complete os seus datos persoais'; +$labels['identitydialoghint'] = 'Este diálogo só aparecerá a primera vez que se conecte ao correo.'; + +?> diff --git a/plugins/new_user_dialog/localization/it_IT.inc b/plugins/new_user_dialog/localization/it_IT.inc new file mode 100644 index 000000000..6c834a9c8 --- /dev/null +++ b/plugins/new_user_dialog/localization/it_IT.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Per favore completa le informazioni riguardo la tua identità'; +$labels['identitydialoghint'] = 'Questa finestra comparirà una volta sola al primo accesso'; + +?> diff --git a/plugins/new_user_dialog/localization/ja_JP.inc b/plugins/new_user_dialog/localization/ja_JP.inc new file mode 100644 index 000000000..79b07c059 --- /dev/null +++ b/plugins/new_user_dialog/localization/ja_JP.inc @@ -0,0 +1,20 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/ja_JP/labels.inc | + | | + | Language file of the Roundcube Webmail client | + | Copyright (C) 2012, The Roundcube Dev Team | + | Licensed under the GNU General Public License | + | | + +-----------------------------------------------------------------------+ + | Author: Takahiro Kambe <Unknown> | + +-----------------------------------------------------------------------+ + @version $Id$ +*/ + +$labels = array(); +$labels['identitydialogtitle'] = '送信者情報の入力を完了してください。'; +$labels['identitydialoghint'] = 'このボックスは最初のログイン時に一度だけ表示されます。'; + diff --git a/plugins/new_user_dialog/localization/nl_NL.inc b/plugins/new_user_dialog/localization/nl_NL.inc new file mode 100644 index 000000000..3cc9cec68 --- /dev/null +++ b/plugins/new_user_dialog/localization/nl_NL.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Vul uw correcte identiteitgegevens in a.u.b.'; +$labels['identitydialoghint'] = 'Dit scherm verschijnt enkel bij uw eerste login.'; + +?> diff --git a/plugins/new_user_dialog/localization/pl_PL.inc b/plugins/new_user_dialog/localization/pl_PL.inc new file mode 100644 index 000000000..a385836a4 --- /dev/null +++ b/plugins/new_user_dialog/localization/pl_PL.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Uzupełnij tożsamość nadawcy'; +$labels['identitydialoghint'] = 'To okno pojawia się tylko przy pierwszym logowaniu.'; + +?> diff --git a/plugins/new_user_dialog/localization/pt_BR.inc b/plugins/new_user_dialog/localization/pt_BR.inc new file mode 100644 index 000000000..64e3e6a80 --- /dev/null +++ b/plugins/new_user_dialog/localization/pt_BR.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Por favor complete a sua identidade'; +$labels['identitydialoghint'] = 'Esta caixa aparece apenas uma vez no primeiro login.'; + +?> diff --git a/plugins/new_user_dialog/localization/pt_PT.inc b/plugins/new_user_dialog/localization/pt_PT.inc new file mode 100644 index 000000000..7b920a485 --- /dev/null +++ b/plugins/new_user_dialog/localization/pt_PT.inc @@ -0,0 +1,20 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/pt_PT/labels.inc | + | | + | Language file of the Roundcube Webmail client | + | Copyright (C) 2012, The Roundcube Dev Team | + | Licensed under the GNU General Public License | + | | + +-----------------------------------------------------------------------+ + | Author: David <Unknown> | + +-----------------------------------------------------------------------+ + @version $Id$ +*/ + +$labels = array(); +$labels['identitydialogtitle'] = 'Por favor, complete a sua identidade'; +$labels['identitydialoghint'] = 'Esta caixa aparece apenas uma vez no primeiro acesso.'; + diff --git a/plugins/new_user_dialog/localization/ru_RU.inc b/plugins/new_user_dialog/localization/ru_RU.inc new file mode 100644 index 000000000..723899602 --- /dev/null +++ b/plugins/new_user_dialog/localization/ru_RU.inc @@ -0,0 +1,20 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/ru_RU/labels.inc | + | | + | Language file of the Roundcube Webmail client | + | Copyright (C) 2012, The Roundcube Dev Team | + | Licensed under the GNU General Public License | + | | + +-----------------------------------------------------------------------+ + | Author: Thomas <Unknown> | + +-----------------------------------------------------------------------+ + @version $Id$ +*/ + +$labels = array(); +$labels['identitydialogtitle'] = 'Пожалуйста, укажите Ваше имя.'; +$labels['identitydialoghint'] = 'Данное сообщение отображается только при первом входе.'; + diff --git a/plugins/new_user_dialog/localization/sk_SK.inc b/plugins/new_user_dialog/localization/sk_SK.inc new file mode 100644 index 000000000..b7b841c4d --- /dev/null +++ b/plugins/new_user_dialog/localization/sk_SK.inc @@ -0,0 +1,16 @@ +<?php +/* + * + * Slovak translation for Roundcube new_user_dialog plugin + * + * @version 1.0 (2010-09-13) + * @author panda <admin@whistler.sk> + * +*/ + + +$labels = array(); +$labels['identitydialogtitle'] = 'Doplňte prosím Vašu identifikáciu odosielateľa'; +$labels['identitydialoghint'] = 'Toto okno sa objaví len pri prvom prihlásení.'; + +?> diff --git a/plugins/new_user_dialog/localization/sl_SI.inc b/plugins/new_user_dialog/localization/sl_SI.inc new file mode 100644 index 000000000..57f563806 --- /dev/null +++ b/plugins/new_user_dialog/localization/sl_SI.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Izberite identiteto za pošiljanje'; +$labels['identitydialoghint'] = 'To okno se prikaže le ob prvi prijavi v spletno pošto.'; + +?> diff --git a/plugins/new_user_dialog/localization/sv_SE.inc b/plugins/new_user_dialog/localization/sv_SE.inc new file mode 100644 index 000000000..b3e665ef1 --- /dev/null +++ b/plugins/new_user_dialog/localization/sv_SE.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = 'Vänligen fyll i namn och avsändaradress under personliga inställningar'; +$labels['identitydialoghint'] = 'Informationen visas endast vid första inloggningen.'; + +?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/zh_TW.inc b/plugins/new_user_dialog/localization/zh_TW.inc new file mode 100644 index 000000000..87261f9cd --- /dev/null +++ b/plugins/new_user_dialog/localization/zh_TW.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['identitydialogtitle'] = '請完成您的身份資訊'; +$labels['identitydialoghint'] = '此視窗只會於第一次登入時出現。'; + +?> diff --git a/plugins/new_user_dialog/new_user_dialog.php b/plugins/new_user_dialog/new_user_dialog.php new file mode 100644 index 000000000..9c9dcce1c --- /dev/null +++ b/plugins/new_user_dialog/new_user_dialog.php @@ -0,0 +1,145 @@ +<?php + +/** + * Present identities settings dialog to new users + * + * When a new user is created, this plugin checks the default identity + * and sets a session flag in case it is incomplete. An overlay box will appear + * on the screen until the user has reviewed/completed his identity. + * + * @version @package_version@ + * @license GNU GPLv3+ + * @author Thomas Bruederli + */ +class new_user_dialog extends rcube_plugin +{ + public $task = 'login|mail'; + + function init() + { + $this->add_hook('identity_create', array($this, 'create_identity')); + $this->register_action('plugin.newusersave', array($this, 'save_data')); + + // register additional hooks if session flag is set + if ($_SESSION['plugin.newuserdialog']) { + $this->add_hook('render_page', array($this, 'render_page')); + } + } + + /** + * Check newly created identity at first login + */ + function create_identity($p) + { + // set session flag when a new user was created and the default identity seems to be incomplete + if ($p['login'] && !$p['complete']) + $_SESSION['plugin.newuserdialog'] = true; + } + + /** + * Callback function when HTML page is rendered + * We'll add an overlay box here. + */ + function render_page($p) + { + 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', + 'name' => '_name', + 'value' => $identity['name'] + ))); + + $table->add('title', $this->gettext('email')); + $table->add(null, html::tag('input', array( + 'type' => 'text', + 'name' => '_email', + 'value' => rcube_idn_to_utf8($identity['email']), + 'disabled' => ($identities_level == 1 || $identities_level == 3) + ))); + + $table->add('title', $this->gettext('organization')); + $table->add(null, html::tag('input', array( + 'type' => 'text', + 'name' => '_organization', + 'value' => $identity['organization'] + ))); + + $table->add('title', $this->gettext('signature')); + $table->add(null, html::tag('textarea', array( + 'name' => '_signature', + 'rows' => '3', + ),$identity['signature'] + )); + + // add overlay input box to html page + $rcmail->output->add_footer(html::tag('form', array( + 'id' => 'newuserdialog', + 'action' => $rcmail->url('plugin.newusersave'), + 'method' => 'post'), + html::tag('h3', null, Q($this->gettext('identitydialogtitle'))) . + html::p('hint', Q($this->gettext('identitydialoghint'))) . + $table->show() . + html::p(array('class' => 'formbuttons'), + html::tag('input', array('type' => 'submit', + 'class' => 'button mainaction', 'value' => $this->gettext('save')))) + )); + + // disable keyboard events for messages list (#1486726) + $rcmail->output->add_script( + "rcmail.message_list.key_press = function(){}; + rcmail.message_list.key_down = function(){}; + $('#newuserdialog').show().dialog({ modal:true, resizable:false, closeOnEscape:false, width:420 }); + $('input[name=_name]').focus(); + ", 'docready'); + + $this->include_stylesheet('newuserdialog.css'); + } + } + + /** + * Handler for submitted form + * + * Check fields and save to default identity if valid. + * Afterwards the session flag is removed and we're done. + */ + function save_data() + { + $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), + 'organization' => get_input_value('_organization', RCUBE_INPUT_POST), + 'signature' => get_input_value('_signature', 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']; + else + $save_data['email'] = rcube_idn_to_ascii($save_data['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(''); + } + +} + +?> diff --git a/plugins/new_user_dialog/newuserdialog.css b/plugins/new_user_dialog/newuserdialog.css new file mode 100644 index 000000000..207604dd1 --- /dev/null +++ b/plugins/new_user_dialog/newuserdialog.css @@ -0,0 +1,39 @@ +/** Styles for the new-user-dialog box */ + +#newuserdialog { + display: none; +} + +#newuserdialog h3 { + color: #333; + font-size: normal; + margin-top: 0; + margin-bottom: 0; +} + +#newuserdialog p.hint { + margin-top: 0.5em; + margin-bottom: 1em; + font-style: italic; +} + +#newuserdialog table td.title { + color: #666; + text-align: right; + padding-right: 1em; + white-space: nowrap; +} + +#newuserdialog table td input, +#newuserdialog table td textarea { + width: 20em; +} + +#newuserdialog .formbuttons { + margin-top: 1.5em; + text-align: center; +} + +.ui-dialog-titlebar-close { + display: none; +}
\ No newline at end of file diff --git a/plugins/new_user_dialog/package.xml b/plugins/new_user_dialog/package.xml new file mode 100644 index 000000000..0bca1d9d4 --- /dev/null +++ b/plugins/new_user_dialog/package.xml @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>new_user_dialog</name> + <channel>pear.roundcube.net</channel> + <summary>Present identities settings dialog to new users</summary> + <description>When a new user is created, this plugin checks the default identity and sets a session flag in case it is incomplete. An overlay box will appear on the screen until the user has reviewed/completed his identity.</description> + <lead> + <name>Thomas Bruederli</name> + <user>thomasb</user> + <email>roundcube@gmail.com</email> + <active>yes</active> + </lead> + <date>2012-01-16</date> + <time>17:00</time> + <version> + <release>1.5</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> + <notes> +- Use jquery UI to render the dialog +- Fixed IDNA encoding/decoding of e-mail addresses (#1487909) + </notes> + <contents> + <dir baseinstalldir="/" name="/"> + <file name="new_user_dialog.php" role="php"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + <file name="newuserdialog.css" role="data"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + <dir name="localization"> + <file name="en_US.inc" role="data" /> + <file name="cs_CZ.inc" role="data" /> + <file name="de_CH.inc" role="data" /> + <file name="de_DE.inc" role="data" /> + <file name="es_ES.inc" role="data" /> + <file name="et_EE.inc" role="data" /> + <file name="gl_ES.inc" role="data" /> + <file name="it_IT.inc" role="data" /> + <file name="ja_JP.inc" role="data" /> + <file name="nl_NL.inc" role="data" /> + <file name="pl_PL.inc" role="data" /> + <file name="pt_BR.inc" role="data" /> + <file name="pt_PT.inc" role="data" /> + <file name="ru_RU.inc" role="data" /> + <file name="sl_SI.inc" role="data" /> + <file name="sv_DE.inc" role="data" /> + <file name="zh_TW.inc" role="data" /> + </dir> + </dir> + <!-- / --> + </contents> + <dependencies> + <required> + <php> + <min>5.2.1</min> + </php> + <pearinstaller> + <min>1.7.0</min> + </pearinstaller> + </required> + </dependencies> + <phprelease/> + <changelog> + <release> + <date>2010-03-29</date> + <time>13:20:00</time> + <version> + <release>1.0</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes></notes> + </release> + <release> + <date>2010-05-13</date> + <time>19:35:00</time> + <version> + <release>1.1</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes> +- Fix space bar and backspace buttons not working (#1486726) + </notes> + </release> + <release> + <date>2010-05-27</date> + <time>12:00:00</time> + <version> + <release>1.2</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes> +- Add overlay box only to mail task main template +- Fix possible error on form submission (#1486103) + </notes> + </release> + <release> + <date>2010-12-02</date> + <time>12:00:00</time> + <version> + <release>1.3</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes> +- Added setting of focus on name input +- Added gl_ES translation + </notes> + </release> + <release> + <date>2012-01-16</date> + <time>17:00:00</time> + <version> + <release>1.5</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes>- Use jquery UI to render the dialog</notes> + </release> + </changelog> +</package> |