diff options
38 files changed, 658 insertions, 345 deletions
@@ -40,22 +40,26 @@ REQUIREMENTS or SQLite support in PHP * One of the above databases with permission to create tables * An SMTP server (recommended) or PHP configured for mail delivery +* Composer installed either locally or globally INSTALLATION ============ 1. Decompress and put this folder somewhere inside your document root -2. Make sure that the following directories (and the files within) +2. Install dependencies using composer: + - get composer from https://getcomposer.org/download/ + - rename the composer.json-dist file into composer.json + - run `php composer.phar install` +3. Make sure that the following directories (and the files within) are writable by the webserver - /temp - /logs -3. Create a new database and a database user for Roundcube (see DATABASE SETUP) -4. Point your browser to http://url-to-roundcube/installer/ -5. Follow the instructions of the install script (or see MANUAL CONFIGURATION) -6. After creating and testing the configuration, remove the installer directory -7. Check Known Issues section of this file -8. Done! +4. Create a new database and a database user for Roundcube (see DATABASE SETUP) +5. Point your browser to http://url-to-roundcube/installer/ +6. Follow the instructions of the install script (or see MANUAL CONFIGURATION) +7. After creating and testing the configuration, remove the installer directory +8. Check Known Issues section of this file CONFIGURATION HINTS diff --git a/bin/cleandb.sh b/bin/cleandb.sh index 3a3c2572e..165d33f38 100755 --- a/bin/cleandb.sh +++ b/bin/cleandb.sh @@ -30,7 +30,7 @@ $primary_keys = array( ); // connect to DB -$RCMAIL = rcmail::get_instance(); +$RCMAIL = rcube::get_instance(); $db = $RCMAIL->get_dbh(); $db->db_connect('w'); @@ -56,7 +56,7 @@ foreach (array('contacts','contactgroups','identities') as $table) { && ($table == 'contacts' || $table == 'contactgroups') ) { $pk = $primary_keys[$table]; - $memberstable = get_table_name('contactgroupmembers'); + $memberstable = $db->table_name('contactgroupmembers'); $db->query( "DELETE FROM $memberstable". diff --git a/bin/decrypt.sh b/bin/decrypt.sh index ff7c43038..7f83f3a7f 100755 --- a/bin/decrypt.sh +++ b/bin/decrypt.sh @@ -60,7 +60,7 @@ if ($argc < 2) { die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n"); } -$RCMAIL = rcmail::get_instance(); +$RCMAIL = rcube::get_instance(); for ($i = 1; $i < $argc; $i++) { printf("%s\n", $RCMAIL->decrypt($argv[$i])); diff --git a/bin/indexcontacts.sh b/bin/indexcontacts.sh index c85a535a7..df403807c 100755 --- a/bin/indexcontacts.sh +++ b/bin/indexcontacts.sh @@ -25,7 +25,7 @@ require_once INSTALL_PATH.'program/include/clisetup.php'; ini_set('memory_limit', -1); // connect to DB -$RCMAIL = rcmail::get_instance(); +$RCMAIL = rcube::get_instance(); $db = $RCMAIL->get_dbh(); $db->db_connect('w'); diff --git a/bin/moduserprefs.sh b/bin/moduserprefs.sh index 9bbc885a6..8a9725fa4 100755 --- a/bin/moduserprefs.sh +++ b/bin/moduserprefs.sh @@ -47,7 +47,7 @@ $pref_name = trim($args[0]); $pref_value = $args['delete'] ? null : trim($args[1]); // connect to DB -$rcmail = rcmail::get_instance(); +$rcmail = rcube::get_instance(); $db = $rcmail->get_dbh(); $db->db_connect('w'); diff --git a/composer.json-dist b/composer.json-dist index 273a6fc57..02dfa5847 100644 --- a/composer.json-dist +++ b/composer.json-dist @@ -13,10 +13,6 @@ }, { "type": "vcs", - "url": "git@github.com:roundcube/sample-plugin.git" - }, - { - "type": "vcs", "url": "git://git.kolab.org/git/pear/Net_LDAP3" }, { @@ -41,13 +37,15 @@ "pear-pear.php.net/auth_sasl": ">=1.0.6", "pear-pear.php.net/net_idna2": ">=0.1.1", "pear-pear.php.net/net_sieve": ">=1.3.2", - "pear-pear.php.net/net_ldap2": ">=2.0.12", - "kolab/Net_LDAP3": "dev-master", "patchwork/utf8": "1.2.x" }, "require-dev": { "pear-pear.php.net/crypt_gpg": "*", "phpunit/phpunit": "*" }, + "suggest": { + "pear-pear.php.net/net_ldap2": "Version >=2.0.12 required for connecting to LDAP address books", + "kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books" + }, "minimum-stability": "dev" } diff --git a/installer/check.php b/installer/check.php index 6974d3720..709a334b6 100644 --- a/installer/check.php +++ b/installer/check.php @@ -25,6 +25,7 @@ $optional_php_exts = array( 'Mcrypt' => 'mcrypt', 'Intl' => 'intl', 'Exif' => 'exif', + 'LDAP' => 'ldap', ); $required_libs = array( @@ -32,11 +33,14 @@ $required_libs = array( 'Auth_SASL' => 'pear.php.net', 'Net_SMTP' => 'pear.php.net', 'Net_IDNA2' => 'pear.php.net', - 'Net_LDAP3' => 'git.kolab.org', 'Mail_mime' => 'pear.php.net', 'Mail_mimeDecode' => 'pear.php.net', ); +$optional_libs = array( + 'Net_LDAP3' => 'git.kolab.org', +); + $ini_checks = array( 'file_uploads' => 1, 'session.auto_start' => 0, @@ -68,6 +72,7 @@ $source_urls = array( 'Intl' => 'http://www.php.net/manual/en/book.intl.php', 'Exif' => 'http://www.php.net/manual/en/book.exif.php', 'PDO' => 'http://www.php.net/manual/en/book.pdo.php', + 'LDAP' => 'http://www.php.net/manual/en/book.ldap.php', 'pdo_mysql' => 'http://www.php.net/manual/en/ref.pdo-mysql.php', 'pdo_pgsql' => 'http://www.php.net/manual/en/ref.pdo-pgsql.php', 'pdo_sqlite' => 'http://www.php.net/manual/en/ref.pdo-sqlite.php', @@ -77,7 +82,9 @@ $source_urls = array( 'PEAR' => 'http://pear.php.net', 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP', 'Mail_mime' => 'http://pear.php.net/package/Mail_mime', + 'Mail_mimeDecode' => 'http://pear.php.net/package/Mail_mimeDecode', 'Net_IDNA2' => 'http://pear.php.net/package/Net_IDNA2', + 'Net_LDAP3' => 'http://git.kolab.org/pear/Net_LDAP3', ); echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />'; @@ -164,7 +171,6 @@ if (empty($found_db_driver)) { <?php foreach ($required_libs as $classname => $vendor) { - @include_once $file; if (class_exists($classname)) { $RCI->pass($classname); } @@ -174,6 +180,15 @@ foreach ($required_libs as $classname => $vendor) { echo "<br />"; } +foreach ($optional_libs as $classname => $vendor) { + if (class_exists($classname)) { + $RCI->pass($classname); + } + else { + $RCI->na($classname, "Recommended to install $classname from $vendor", $source_urls[$classname]); + } + echo "<br />"; +} ?> diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 88526168e..334b1458f 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -2,6 +2,7 @@ - Fix missing css/js scripts in filter form in mail task - Fix default vacation status (#1490019) - Make possible to set vacation start/end date and time +- Fix compatibility with contextmenu plugin * version 8.0 [2014-07-16] ----------------------------------------------------------- diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index cd0d5f3ca..8340b179d 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -930,7 +930,7 @@ function sieve_form_init() rcube_webmail.prototype.managesieve_create = function(force) { - if (!force && this.env.action != 'show' && !$('#'+this.env.contentframe).is(':visible')) { + if (!force && this.env.action != 'show') { var uid = this.message_list.get_single_selection(), lock = this.set_busy(true, 'loading'); diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 478f26b00..7a307e1fe 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -51,7 +51,9 @@ class managesieve extends rcube_plugin } else if ($this->rc->task == 'mail') { // register message hook - $this->add_hook('message_headers_output', array($this, 'mail_headers')); + if ($this->rc->action == 'show') { + $this->add_hook('message_headers_output', array($this, 'mail_headers')); + } // inject Create Filter popup stuff if (empty($this->rc->action) || $this->rc->action == 'show' @@ -192,9 +194,10 @@ class managesieve extends rcube_plugin function managesieve_actions() { // handle fetching email headers for the new filter form - if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC)) { - $mailbox = $this->rc->get_storage()->get_folder(); - $message = new rcube_message($uid, $mailbox); + if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) { + $uids = rcmail::get_uids(); + $mailbox = key($uids); + $message = new rcube_message($uids[$mailbox][0], $mailbox); $headers = $this->parse_headers($message->headers); $this->rc->output->set_env('sieve_headers', $headers); diff --git a/plugins/password/drivers/chpasswd.php b/plugins/password/drivers/chpasswd.php index 137275e69..45c56dba3 100644 --- a/plugins/password/drivers/chpasswd.php +++ b/plugins/password/drivers/chpasswd.php @@ -1,7 +1,7 @@ <?php /** - * chpasswd Driver + * chpasswd driver * * Driver that adds functionality to change the systems user password via * the 'chpasswd' command. @@ -10,6 +10,21 @@ * * @version 2.0 * @author Alex Cartwright <acartwright@mutinydesign.co.uk> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_chpasswd_password diff --git a/plugins/password/drivers/cpanel.php b/plugins/password/drivers/cpanel.php index b71c33ec1..663c125ce 100644 --- a/plugins/password/drivers/cpanel.php +++ b/plugins/password/drivers/cpanel.php @@ -15,6 +15,21 @@ * * @version 3.0 * @author Christian Chech <christian@chech.fr> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_cpanel_password diff --git a/plugins/password/drivers/dbmail.php b/plugins/password/drivers/dbmail.php index 5cfe92cd7..d76486021 100644 --- a/plugins/password/drivers/dbmail.php +++ b/plugins/password/drivers/dbmail.php @@ -13,6 +13,21 @@ * For installation instructions please read the README file. * * @version 1.0 + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_dbmail_password diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index 44ecea406..08ade5130 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -8,6 +8,20 @@ * @version 2.1 * @author Victor Benincasa <vbenincasa@gmail.com> * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_directadmin_password diff --git a/plugins/password/drivers/domainfactory.php b/plugins/password/drivers/domainfactory.php index 62d9bfce2..95088e9dd 100644 --- a/plugins/password/drivers/domainfactory.php +++ b/plugins/password/drivers/domainfactory.php @@ -10,80 +10,91 @@ * @author Till Krüss <me@tillkruess.com> * @link http://tillkruess.com/projects/roundcube/ * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_domainfactory_password { - function save($curpass, $passwd) - { - $rcmail = rcmail::get_instance(); - - if (is_null($curpass)) { - $curpass = $rcmail->decrypt($_SESSION['password']); - } - - if ($ch = curl_init()) { - - // initial login - curl_setopt_array($ch, array( - CURLOPT_RETURNTRANSFER => true, - CURLOPT_URL => 'https://ssl.df.eu/chmail.php', - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => http_build_query(array( - 'login' => $rcmail->user->get_username(), - 'pwd' => $curpass, - 'action' => 'change' - )) - )); - - if ($result = curl_exec($ch)) { - // login successful, get token! - $postfields = array( - 'pwd1' => $passwd, - 'pwd2' => $passwd, - 'action[update]' => 'Speichern' - ); - - preg_match_all('~<input name="(.+?)" type="hidden" value="(.+?)">~i', $result, $fields); - foreach ($fields[1] as $field_key => $field_name) { - $postfields[$field_name] = $fields[2][$field_key]; - } - - // change password - $ch = curl_copy_handle($ch); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); - if ($result = curl_exec($ch)) { + function save($curpass, $passwd) + { + $rcmail = rcmail::get_instance(); - // has the password been changed? - if (strpos($result, 'Einstellungen erfolgreich') !== false) { - return PASSWORD_SUCCESS; - } + if (is_null($curpass)) { + $curpass = $rcmail->decrypt($_SESSION['password']); + } - // show error message(s) if possible - if (strpos($result, '<div class="d-msg-text">') !== false) { - preg_match_all('#<div class="d-msg-text">(.*?)</div>#s', $result, $errors); - if (isset($errors[1])) { - $error_message = ''; - foreach ( $errors[1] as $error ) { - $error_message .= trim(mb_convert_encoding( $error, 'UTF-8', 'ISO-8859-15' )).' '; - } - return array('code' => PASSWORD_ERROR, 'message' => $error_message); - } - } + if ($ch = curl_init()) { + // initial login + curl_setopt_array($ch, array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_URL => 'https://ssl.df.eu/chmail.php', + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => http_build_query(array( + 'login' => $rcmail->user->get_username(), + 'pwd' => $curpass, + 'action' => 'change' + )) + )); + if ($result = curl_exec($ch)) { + // login successful, get token! + $postfields = array( + 'pwd1' => $passwd, + 'pwd2' => $passwd, + 'action[update]' => 'Speichern' + ); - } else { - return PASSWORD_CONNECT_ERROR; - } + preg_match_all('~<input name="(.+?)" type="hidden" value="(.+?)">~i', $result, $fields); + foreach ($fields[1] as $field_key => $field_name) { + $postfields[$field_name] = $fields[2][$field_key]; + } - } else { - return PASSWORD_CONNECT_ERROR; - } + // change password + $ch = curl_copy_handle($ch); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); + if ($result = curl_exec($ch)) { + // has the password been changed? + if (strpos($result, 'Einstellungen erfolgreich') !== false) { + return PASSWORD_SUCCESS; + } - } else { - return PASSWORD_CONNECT_ERROR; - } + // show error message(s) if possible + if (strpos($result, '<div class="d-msg-text">') !== false) { + preg_match_all('#<div class="d-msg-text">(.*?)</div>#s', $result, $errors); + if (isset($errors[1])) { + $error_message = ''; + foreach ($errors[1] as $error) { + $error_message .= trim(mb_convert_encoding( $error, 'UTF-8', 'ISO-8859-15' )).' '; + } + return array('code' => PASSWORD_ERROR, 'message' => $error_message); + } + } + } + else { + return PASSWORD_CONNECT_ERROR; + } + } + else { + return PASSWORD_CONNECT_ERROR; + } + } + else { + return PASSWORD_CONNECT_ERROR; + } - return PASSWORD_ERROR; - } + return PASSWORD_ERROR; + } } diff --git a/plugins/password/drivers/expect.php b/plugins/password/drivers/expect.php index 1f68924df..57fe905ee 100644 --- a/plugins/password/drivers/expect.php +++ b/plugins/password/drivers/expect.php @@ -1,7 +1,7 @@ <?php /** - * expect Driver + * expect driver * * Driver that adds functionality to change the systems user password via * the 'expect' command. @@ -10,7 +10,7 @@ * * @version 2.0 * @author Andy Theuninck <gohanman@gmail.com) - * + * * Based on chpasswd roundcubemail password driver by * @author Alex Cartwright <acartwright@mutinydesign.co.uk) * and expect horde passwd driver by @@ -21,8 +21,23 @@ * password_expect_script => path to "password-expect" file * password_expect_params => arguments for the expect script * see the password-expect file for details. This is probably - * a good starting default: + * a good starting default: * -telent -host localhost -output /tmp/passwd.log -log /tmp/passwd.log + * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_expect_password diff --git a/plugins/password/drivers/gearman.php b/plugins/password/drivers/gearman.php index 36571a98f..983aee046 100644 --- a/plugins/password/drivers/gearman.php +++ b/plugins/password/drivers/gearman.php @@ -8,6 +8,21 @@ * * @version 1.0 * @author Mohammad Anwari <mdamt@mdamt.net> + * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_gearman_password diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php index 650434617..49f7f6cf4 100644 --- a/plugins/password/drivers/hmail.php +++ b/plugins/password/drivers/hmail.php @@ -5,6 +5,21 @@ * * @version 2.0 * @author Roland 'rosali' Liebl <myroundcube@mail4us.net> + * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_hmail_password diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index cc62595b5..0c932372d 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -12,6 +12,20 @@ * method hashPassword based on code from the phpLDAPadmin development team (http://phpldapadmin.sourceforge.net/). * method randomSalt based on code from the phpLDAPadmin development team (http://phpldapadmin.sourceforge.net/). * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_ldap_password @@ -301,5 +315,4 @@ class rcube_ldap_password return $str; } - } diff --git a/plugins/password/drivers/ldap_simple.php b/plugins/password/drivers/ldap_simple.php index 3c19ccde5..9123ea81f 100644 --- a/plugins/password/drivers/ldap_simple.php +++ b/plugins/password/drivers/ldap_simple.php @@ -9,6 +9,22 @@ * * @version 2.0 * @author Wout Decre <wout@canodus.be> + * @author Aleksander Machniak <machniak@kolabsys.com> + * + * Copyright (C) 2005-2014, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_ldap_simple_password @@ -219,5 +235,4 @@ class rcube_ldap_simple_password rcube::write_log('ldap', $str); } } - } diff --git a/plugins/password/drivers/pam.php b/plugins/password/drivers/pam.php index 4d0ba1656..cd5a92f49 100644 --- a/plugins/password/drivers/pam.php +++ b/plugins/password/drivers/pam.php @@ -5,6 +5,21 @@ * * @version 2.0 * @author Aleksander Machniak + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_pam_password diff --git a/plugins/password/drivers/plesk.php b/plugins/password/drivers/plesk.php index 6f646d229..d0a511fbe 100644 --- a/plugins/password/drivers/plesk.php +++ b/plugins/password/drivers/plesk.php @@ -1,21 +1,33 @@ <?php + /** * Roundcube Password Driver for Plesk-RPC. * * This driver changes a E-Mail-Password via Plesk-RPC * Deps: PHP-Curl, SimpleXML * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @copyright Adfinis SyGroup AG, 2014 - * @license GNU GPL v3 + * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> + * @copyright Adfinis SyGroup AG, 2014 * * Config needed: - * $config['password_plesk_host'] = '10.0.0.5'; - * $config['password_plesk_user'] = 'admin'; - * $config['password_plesk_pass'] = 'pass'; - * $config['password_plesk_rpc_port'] = 8443; - * $config['password_plesk_rpc_path'] = enterprise/control/agent.php; + * $config['password_plesk_host'] = '10.0.0.5'; + * $config['password_plesk_user'] = 'admin'; + * $config['password_plesk_pass'] = 'pass'; + * $config['password_plesk_rpc_port'] = 8443; + * $config['password_plesk_rpc_path'] = enterprise/control/agent.php; + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ /** @@ -23,45 +35,44 @@ * * See {ROUNDCUBE_ROOT}/plugins/password/README for API description * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> + * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> */ -class rcube_plesk_password { - - /** - * this method is called from roundcube to change the password - * - * roundcube allready validated the old password so we just need to change it at this point - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $curpass current password - * @param string $newpass new password - * @returns PASSWORD_SUCCESS|PASSWORD_ERROR - */ - function save($currpass, $newpass) { - - // get config - $rcmail = rcmail::get_instance(); - $host = $rcmail->config->get('password_plesk_host'); - $user = $rcmail->config->get('password_plesk_user'); - $pass = $rcmail->config->get('password_plesk_pass'); - $port = $rcmail->config->get('password_plesk_rpc_port'); - $path = $rcmail->config->get('password_plesk_rpc_path'); - - // create plesk-object - $plesk = new plesk_rpc; - $plesk->init($host, $port, $path, $user, $pass); - - // try to change password and return the status - $result = $plesk->change_mailbox_password($_SESSION['username'], $newpass); - //$plesk->destroy(); - - if ($result) { - return PASSWORD_SUCCESS; - } - - return PASSWORD_ERROR; - } - +class rcube_plesk_password +{ + /** + * this method is called from roundcube to change the password + * + * roundcube allready validated the old password so we just need to change it at this point + * + * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> + * @param string $curpass Current password + * @param string $newpass New password + * @returns int PASSWORD_SUCCESS|PASSWORD_ERROR + */ + function save($currpass, $newpass)\ + { + // get config + $rcmail = rcmail::get_instance(); + $host = $rcmail->config->get('password_plesk_host'); + $user = $rcmail->config->get('password_plesk_user'); + $pass = $rcmail->config->get('password_plesk_pass'); + $port = $rcmail->config->get('password_plesk_rpc_port'); + $path = $rcmail->config->get('password_plesk_rpc_path'); + + // create plesk-object + $plesk = new plesk_rpc; + $plesk->init($host, $port, $path, $user, $pass); + + // try to change password and return the status + $result = $plesk->change_mailbox_password($_SESSION['username'], $newpass); + //$plesk->destroy(); + + if ($result) { + return PASSWORD_SUCCESS; + } + + return PASSWORD_ERROR; + } } @@ -73,162 +84,158 @@ class rcube_plesk_password { * * Documentation of Plesk RPC-API: http://download1.parallels.com/Plesk/PP11/11.0/Doc/en-US/online/plesk-api-rpc/ * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> + * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> */ -class plesk_rpc { - - /** - * init plesk-rpc via curl - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $host plesk host - * @param string $port plesk rpc port - * @param string $path plesk rpc path - * @param string $user plesk user - * @param string $user plesk password - * @returns void - */ - function init($host, $port, $path, $user, $pass) { - $headers = array( - sprintf("HTTP_AUTH_LOGIN: %s", $user), - sprintf("HTTP_AUTH_PASSWD: %s", $pass), - "Content-Type: text/xml" - ); - $url = sprintf("https://%s:%s/%s", $host, $port, $path); - $this->curl = curl_init(); - curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT , 5); - curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST , 0); - curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER , false); - curl_setopt($this->curl, CURLOPT_HTTPHEADER , $headers); - curl_setopt($this->curl, CURLOPT_URL , $url); - } - - - /** - * send a request to the plesk - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $packet XML-Packet to send to Plesk - * @returns bool request was successfull or not - */ - function send_request($packet) { - curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($this->curl, CURLOPT_POSTFIELDS, $packet); - $retval = curl_exec($this->curl); - - return $retval; - } - - - /** - * close curl - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @returns void - */ - function destroy(){ - curl_close($this->curl); - } - - - /** - * Creates an Initial SimpleXML-Object for Plesk-RPC - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @returns object SimpleXML object - */ - function get_request_obj(){ - $request = new SimpleXMLElement("<packet></packet>"); - $request->addAttribute("version", "1.6.3.0"); - - return $request; - } - - /** - * Get all hosting-informations of a domain - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $domain domain-name - * @returns object SimpleXML object - */ - function domain_info($domain){ - // build xml - $request = $this->get_request_obj(); - $site = $request->addChild("site"); - $get = $site->addChild("get"); - $filter = $get->addChild("filter"); - - $filter->addChild("name", utf8_encode($domain)); - $dataset = $get->addChild("dataset"); - - $dataset->addChild("hosting"); - $packet = $request->asXML(); - - // send the request - $res = $this->send_request($packet); - - // make it to simple-xml-object - $xml = new SimpleXMLElement($res); - - return $xml; - } - - /** - * Get psa-id of a domain - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $domain domain-name - * @returns bool|int false if failed and integer if successed - */ - function get_domain_id($domain){ - $xml = $this->domain_info($domain); - $id = intval($xml->site->get->result->id); - $id = (is_int($id)) ? $id : false; - return $id; - } - - - /** - * Change Password of a mailbox - * - * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> - * @param string $mailbox full email-adress (user@domain.tld) - * @param string $newpass new password of mailbox - * @returns bool - */ - function change_mailbox_password($mailbox, $newpass){ - - list($user, $domain) = explode("@", $mailbox); - $domain_id = $this->get_domain_id($domain); - - // if domain cannot be resolved to an id, do not continue - if (!$domain_id) { - return false; - } - - // build xml-packet - $request = $this -> get_request_obj(); - $mail = $request -> addChild("mail"); - $update = $mail -> addChild("update"); - $add = $update -> addChild("set"); - $filter = $add -> addChild("filter"); - $filter->addChild("site-id", $domain_id); - - $mailname = $filter->addChild("mailname"); - $mailname->addChild("name", $user); - - $password = $mailname->addChild("password"); - $password->addChild("value", $newpass); - $password->addChild("type", "plain"); - - $packet = $request->asXML(); - - // send the request to plesk - $res = $this->send_request($packet); - $xml = new SimpleXMLElement($res); - $res = strval($xml->mail->update->set->result->status); - - return $res == "ok"; - } +class plesk_rpc +{ + /** + * init plesk-rpc via curl + * + * @param string $host plesk host + * @param string $port plesk rpc port + * @param string $path plesk rpc path + * @param string $user plesk user + * @param string $user plesk password + * @returns void + */ + function init($host, $port, $path, $user, $pass) + { + $headers = array( + sprintf("HTTP_AUTH_LOGIN: %s", $user), + sprintf("HTTP_AUTH_PASSWD: %s", $pass), + "Content-Type: text/xml" + ); + + $url = sprintf("https://%s:%s/%s", $host, $port, $path); + $this->curl = curl_init(); + + curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT , 5); + curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST , 0); + curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER , false); + curl_setopt($this->curl, CURLOPT_HTTPHEADER , $headers); + curl_setopt($this->curl, CURLOPT_URL , $url); + } + + /** + * send a request to the plesk + * + * @param string $packet XML-Packet to send to Plesk + * @returns bool request was successfull or not + */ + function send_request($packet) + { + curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($this->curl, CURLOPT_POSTFIELDS, $packet); + $retval = curl_exec($this->curl); + + return $retval; + } + + /** + * close curl + */ + function destroy(){ + curl_close($this->curl); + } + + /** + * Creates an Initial SimpleXML-Object for Plesk-RPC + * + * @returns object SimpleXML object + */ + function get_request_obj() + { + $request = new SimpleXMLElement("<packet></packet>"); + $request->addAttribute("version", "1.6.3.0"); + + return $request; + } + + /** + * Get all hosting-informations of a domain + * + * @param string $domain domain-name + * @returns object SimpleXML object + */ + function domain_info($domain) + { + // build xml + $request = $this->get_request_obj(); + $site = $request->addChild("site"); + $get = $site->addChild("get"); + $filter = $get->addChild("filter"); + + $filter->addChild("name", utf8_encode($domain)); + $dataset = $get->addChild("dataset"); + + $dataset->addChild("hosting"); + $packet = $request->asXML(); + + // send the request + $res = $this->send_request($packet); + + // make it to simple-xml-object + $xml = new SimpleXMLElement($res); + + return $xml; + } + + /** + * Get psa-id of a domain + * + * @param string $domain domain-name + * + * @returns bool|int false if failed and integer if successed + */ + function get_domain_id($domain) + { + $xml = $this->domain_info($domain); + $id = intval($xml->site->get->result->id); + $id = (is_int($id)) ? $id : false; + + return $id; + } + + /** + * Change Password of a mailbox + * + * @param string $mailbox full email-adress (user@domain.tld) + * @param string $newpass new password of mailbox + * + * @returns bool + */ + function change_mailbox_password($mailbox, $newpass) + { + list($user, $domain) = explode("@", $mailbox); + $domain_id = $this->get_domain_id($domain); + + // if domain cannot be resolved to an id, do not continue + if (!$domain_id) { + return false; + } + + // build xml-packet + $request = $this -> get_request_obj(); + $mail = $request -> addChild("mail"); + $update = $mail -> addChild("update"); + $add = $update -> addChild("set"); + $filter = $add -> addChild("filter"); + $filter->addChild("site-id", $domain_id); + + $mailname = $filter->addChild("mailname"); + $mailname->addChild("name", $user); + + $password = $mailname->addChild("password"); + $password->addChild("value", $newpass); + $password->addChild("type", "plain"); + + $packet = $request->asXML(); + + // send the request to plesk + $res = $this->send_request($packet); + $xml = new SimpleXMLElement($res); + $res = strval($xml->mail->update->set->result->status); + + return $res == "ok"; + } } - diff --git a/plugins/password/drivers/poppassd.php b/plugins/password/drivers/poppassd.php index e18ec2660..8ddbef5d3 100644 --- a/plugins/password/drivers/poppassd.php +++ b/plugins/password/drivers/poppassd.php @@ -8,6 +8,20 @@ * @version 2.0 * @author Philip Weir * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_poppassd_password @@ -16,9 +30,9 @@ class rcube_poppassd_password { if (preg_match('/^\d\d\d\s+(\S.*)\s*$/', $line, $matches)) { return array('code' => $code, 'message' => $matches[1]); - } else { - return $code; } + + return $code; } function save($curpass, $passwd) @@ -40,14 +54,14 @@ class rcube_poppassd_password else { $poppassd->writeLine("user ". $_SESSION['username']); $result = $poppassd->readLine(); - if(!preg_match('/^[23]\d\d/', $result) ) { + if (!preg_match('/^[23]\d\d/', $result) ) { $poppassd->disconnect(); return $this->format_error_result(PASSWORD_CONNECT_ERROR, $result); } else { $poppassd->writeLine("pass ". $curpass); $result = $poppassd->readLine(); - if(!preg_match('/^[23]\d\d/', $result) ) { + if (!preg_match('/^[23]\d\d/', $result) ) { $poppassd->disconnect(); return $this->format_error_result(PASSWORD_ERROR, $result); } @@ -55,10 +69,11 @@ class rcube_poppassd_password $poppassd->writeLine("newpass ". $passwd); $result = $poppassd->readLine(); $poppassd->disconnect(); - if (!preg_match('/^2\d\d/', $result)) + if (!preg_match('/^2\d\d/', $result)) { return $this->format_error_result(PASSWORD_ERROR, $result); - else - return PASSWORD_SUCCESS; + } + + return PASSWORD_SUCCESS; } } } diff --git a/plugins/password/drivers/pw_usermod.php b/plugins/password/drivers/pw_usermod.php index 237e275a7..c519bf4a4 100644 --- a/plugins/password/drivers/pw_usermod.php +++ b/plugins/password/drivers/pw_usermod.php @@ -11,6 +11,21 @@ * @version 2.0 * @author Alex Cartwright <acartwright@mutinydesign.co.uk> * @author Adamson Huang <adomputer@gmail.com> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_pw_usermod_password diff --git a/plugins/password/drivers/sasl.php b/plugins/password/drivers/sasl.php index 8776eff2e..f3baef557 100644 --- a/plugins/password/drivers/sasl.php +++ b/plugins/password/drivers/sasl.php @@ -14,6 +14,21 @@ * * @version 2.0 * @author Thomas Bruederli + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_sasl_password diff --git a/plugins/password/drivers/smb.php b/plugins/password/drivers/smb.php index 9f2b96afa..3e34c79a1 100644 --- a/plugins/password/drivers/smb.php +++ b/plugins/password/drivers/smb.php @@ -19,6 +19,21 @@ * Configuration settings: * password_smb_host => samba host (default: localhost) * password_smb_cmd => smbpasswd binary (default: /usr/bin/smbpasswd) + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_smb_password @@ -56,5 +71,4 @@ class rcube_smb_password return PASSWORD_ERROR; } - } diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php index 7a51dfe44..ab348ddac 100644 --- a/plugins/password/drivers/sql.php +++ b/plugins/password/drivers/sql.php @@ -8,6 +8,20 @@ * @version 2.0 * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_sql_password @@ -16,19 +30,13 @@ class rcube_sql_password { $rcmail = rcmail::get_instance(); - if (!($sql = $rcmail->config->get('password_query'))) + if (!($sql = $rcmail->config->get('password_query'))) { $sql = 'SELECT update_passwd(%c, %u)'; + } if ($dsn = $rcmail->config->get('password_db_dsn')) { - // #1486067: enable new_link option - if (is_array($dsn) && empty($dsn['new_link'])) - $dsn['new_link'] = true; - else if (!is_array($dsn) && !preg_match('/\?new_link=true/', $dsn)) - $dsn .= '?new_link=true'; - $db = rcube_db::factory($dsn, '', false); $db->set_debug((bool)$rcmail->config->get('sql_debug')); - $db->db_connect('w'); } else { $db = $rcmail->get_dbh(); @@ -42,16 +50,14 @@ class rcube_sql_password if (strpos($sql, '%c') !== FALSE) { $salt = ''; - if (!($crypt_hash = $rcmail->config->get('password_crypt_hash'))) - { + if (!($crypt_hash = $rcmail->config->get('password_crypt_hash'))) { if (CRYPT_MD5) $crypt_hash = 'md5'; else if (CRYPT_STD_DES) $crypt_hash = 'des'; } - switch ($crypt_hash) - { + switch ($crypt_hash) { case 'md5': $len = 8; $salt_hashindicator = '$1$'; @@ -128,8 +134,9 @@ class rcube_sql_password return PASSWORD_ERROR; } - if (!($hash_algo = strtolower($rcmail->config->get('password_hash_algorithm')))) + if (!($hash_algo = strtolower($rcmail->config->get('password_hash_algorithm')))) { $hash_algo = 'sha1'; + } $hash_passwd = hash($hash_algo, $passwd); $hash_curpass = hash($hash_algo, $curpass); @@ -185,9 +192,11 @@ class rcube_sql_password if (!$db->is_error()) { if (strtolower(substr(trim($sql),0,6)) == 'select') { - if ($db->fetch_array($res)) + if ($db->fetch_array($res)) { return PASSWORD_SUCCESS; - } else { + } + } + else { // This is the good case: 1 row updated if ($db->affected_rows($res) == 1) return PASSWORD_SUCCESS; diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php index 36c54664b..3001ad9d0 100644 --- a/plugins/password/drivers/virtualmin.php +++ b/plugins/password/drivers/virtualmin.php @@ -12,6 +12,21 @@ * * @version 3.0 * @author Martijn de Munnik + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_virtualmin_password diff --git a/plugins/password/drivers/vpopmaild.php b/plugins/password/drivers/vpopmaild.php index 40731206a..a7644fc21 100644 --- a/plugins/password/drivers/vpopmaild.php +++ b/plugins/password/drivers/vpopmaild.php @@ -8,6 +8,20 @@ * @version 2.0 * @author Johannes Hessellund * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_vpopmaild_password @@ -22,7 +36,7 @@ class rcube_vpopmaild_password $rcmail->config->get('password_vpopmaild_port'), null))) { return PASSWORD_CONNECT_ERROR; } - + $vpopmaild->setTimeout($rcmail->config->get('password_vpopmaild_timeout'),0); $result = $vpopmaild->readLine(); @@ -47,8 +61,9 @@ class rcube_vpopmaild_password $vpopmaild->writeLine("quit"); $vpopmaild->disconnect(); - if (!preg_match('/^\+OK/', $result)) + if (!preg_match('/^\+OK/', $result)) { return PASSWORD_ERROR; + } return PASSWORD_SUCCESS; } diff --git a/plugins/password/drivers/ximss.php b/plugins/password/drivers/ximss.php index 3b5286a27..54477f730 100644 --- a/plugins/password/drivers/ximss.php +++ b/plugins/password/drivers/ximss.php @@ -8,12 +8,26 @@ * password_ximss_host - Host name of Communigate server * password_ximss_port - XIMSS port on Communigate server * - * * References: * http://www.communigate.com/WebGuide/XMLAPI.html * * @version 2.0 * @author Erik Meitner <erik wanderings.us> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_ximss_password @@ -71,6 +85,5 @@ class rcube_ximss_password } //foreach return PASSWORD_SUCCESS; - } } diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php index 47beb2178..a7d00a279 100644 --- a/plugins/password/drivers/xmail.php +++ b/plugins/password/drivers/xmail.php @@ -15,6 +15,20 @@ * $config['xmail_pass'] = 'YourXmailControlPass'; * $config['xmail_port'] = 6017; * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_xmail_password @@ -103,4 +117,3 @@ class XMail { socket_close($this->socket); } } - diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ece0606ae..e1a62767d 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -116,11 +116,13 @@ class rcmail extends rcube $_SESSION['task'] = $this->task; } - // init output class - if (!empty($_REQUEST['_remote'])) + // init output class (not in CLI mode) + if (!empty($_REQUEST['_remote'])) { $GLOBALS['OUTPUT'] = $this->json_init(); - else + } + else if ($_SERVER['REMOTE_ADDR']) { $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); + } // load plugins $this->plugins->init($this, $this->task); diff --git a/program/js/app.js b/program/js/app.js index e5a70c9f1..3ace0b0b0 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1660,7 +1660,7 @@ function rcube_webmail() } skip = obj.data('parent'); } - }, 10); + }, 10, e); }; // global keypress event handler @@ -6902,7 +6902,7 @@ function rcube_webmail() // truncate stack down to the one containing the ref link for (var i = this.menu_stack.length - 1; stack && i >= 0; i--) { if (!$(ref).parents('#'+this.menu_stack[i]).length) - this.hide_menu(this.menu_stack[i]); + this.hide_menu(this.menu_stack[i], event); } if (stack && this.menu_stack.length) { obj.data('parent', $.last(this.menu_stack)); diff --git a/program/js/treelist.js b/program/js/treelist.js index a7cd7cd43..c034f77b8 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -458,6 +458,10 @@ function rcube_treelist_widget(node, p) node.deleted = true; delete indexbyid[id]; + if (search_active) { + id2dom(id, false).remove(); + } + return true; } @@ -477,7 +481,7 @@ function rcube_treelist_widget(node, p) */ function update_dom(node) { - var li = id2dom(node.id); + var li = id2dom(node.id, true); li.attr('aria-expanded', node.collapsed ? 'false' : 'true'); li.children('ul').first()[(node.collapsed ? 'hide' : 'show')](); li.children('div.treetoggle').removeClass('collapsed expanded').addClass(node.collapsed ? 'collapsed' : 'expanded'); @@ -698,7 +702,8 @@ function rcube_treelist_widget(node, p) node.childlistclass = sublist.attr('class'); } if (node.children.length) { - node.collapsed = sublist.css('display') == 'none'; + if (node.collapsed === undefined) + node.collapsed = sublist.css('display') == 'none'; // apply saved state state = get_state(node.id, node.collapsed); diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index eedc46c7a..3ab650cb1 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -1280,6 +1280,9 @@ class rcube exit(1); } + else if ($cli) { + fwrite(STDERR, 'ERROR: ' . $arg['message']); + } } diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php index a46df97d3..100afd530 100644 --- a/program/lib/Roundcube/rcube_db.php +++ b/program/lib/Roundcube/rcube_db.php @@ -68,6 +68,7 @@ class rcube_db 'sybase' => 'mssql', 'dblib' => 'mssql', 'mysqli' => 'mysql', + 'oci' => 'oracle', ); $driver = isset($driver_map[$driver]) ? $driver_map[$driver] : $driver; diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 44a79c8e6..a1fd87442 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -1384,7 +1384,7 @@ class rcube_imap extends rcube_storage public function index_direct($folder, $sort_field = null, $sort_order = null, $search = null) { if (!empty($search)) { - $search = $this->search_set->get_compressed(); + $search = $search->get_compressed(); } // use message index sort as default sorting @@ -3952,8 +3952,8 @@ class rcube_imap extends rcube_storage // @TODO: Honor MAXSIZE and DEPTH options foreach ($queries as $attrib => $entry) { if ($result = $this->conn->getAnnotation($folder, $entry, $attrib)) { - foreach ($result as $folder => $data) { - $res[$folder] = array_merge((array) $res[$folder], $data); + foreach ($result as $fldr => $data) { + $res[$fldr] = array_merge((array) $res[$fldr], $data); } } } diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 25f2e3175..cbeeb05fb 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -652,14 +652,6 @@ function rcmail_messagecontent_frame($attrib) if (empty($attrib['id'])) $attrib['id'] = 'rcmailcontentwindow'; - $attrib['name'] = $attrib['id']; - - if ($RCMAIL->config->get('preview_pane')) { - $OUTPUT->set_env('contentframe', $attrib['id']); - } - - $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - return $OUTPUT->frame($attrib, true); } |