Added license headers to driver files, CS fixes
| | |
| | | <?php |
| | | |
| | | /** |
| | | * chpasswd Driver |
| | | * chpasswd driver |
| | | * |
| | | * Driver that adds functionality to change the systems user password via |
| | | * the 'chpasswd' command. |
| | |
| | | * |
| | | * @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 |
| | |
| | | * |
| | | * @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 |
| | |
| | | * 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 |
| | |
| | | * @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 |
| | |
| | | * @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 |
| | |
| | | } |
| | | |
| | | if ($ch = curl_init()) { |
| | | |
| | | // initial login |
| | | curl_setopt_array($ch, array( |
| | | CURLOPT_RETURNTRANSFER => true, |
| | |
| | | $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; |
| | |
| | | return array('code' => PASSWORD_ERROR, 'message' => $error_message); |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | } |
| | | else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |
| | | |
| | | } else { |
| | | } |
| | | else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |
| | | |
| | | } else { |
| | | } |
| | | else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |
| | | |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * expect Driver |
| | | * expect driver |
| | | * |
| | | * Driver that adds functionality to change the systems user password via |
| | | * the 'expect' command. |
| | |
| | | * see the password-expect file for details. This is probably |
| | | * 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 |
| | |
| | | * |
| | | * @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 |
| | |
| | | * |
| | | * @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 |
| | |
| | | * 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 |
| | |
| | | |
| | | return $str; |
| | | } |
| | | |
| | | } |
| | |
| | | * |
| | | * @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 |
| | |
| | | rcube::write_log('ldap', $str); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * |
| | | * @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 |
| | |
| | | <?php |
| | | |
| | | /** |
| | | * Roundcube Password Driver for Plesk-RPC. |
| | | * |
| | |
| | | * |
| | | * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> |
| | | * @copyright Adfinis SyGroup AG, 2014 |
| | | * @license GNU GPL v3 |
| | | * |
| | | * Config needed: |
| | | * $config['password_plesk_host'] = '10.0.0.5'; |
| | |
| | | * $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/. |
| | | */ |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> |
| | | */ |
| | | class rcube_plesk_password { |
| | | |
| | | 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 |
| | | * @param string $curpass Current password |
| | | * @param string $newpass New password |
| | | * @returns int PASSWORD_SUCCESS|PASSWORD_ERROR |
| | | */ |
| | | function save($currpass, $newpass) { |
| | | |
| | | function save($currpass, $newpass)\ |
| | | { |
| | | // get config |
| | | $rcmail = rcmail::get_instance(); |
| | | $host = $rcmail->config->get('password_plesk_host'); |
| | |
| | | |
| | | return PASSWORD_ERROR; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch> |
| | | */ |
| | | class plesk_rpc { |
| | | |
| | | 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 password |
| | | * @returns void |
| | | */ |
| | | function init($host, $port, $path, $user, $pass) { |
| | | 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_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) { |
| | | 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(){ |
| | | function get_request_obj() |
| | | { |
| | | $request = new SimpleXMLElement("<packet></packet>"); |
| | | $request->addAttribute("version", "1.6.3.0"); |
| | | |
| | |
| | | /** |
| | | * 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){ |
| | | function domain_info($domain) |
| | | { |
| | | // build xml |
| | | $request = $this->get_request_obj(); |
| | | $site = $request->addChild("site"); |
| | |
| | | /** |
| | | * 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){ |
| | | 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){ |
| | | |
| | | function change_mailbox_password($mailbox, $newpass) |
| | | { |
| | | list($user, $domain) = explode("@", $mailbox); |
| | | $domain_id = $this->get_domain_id($domain); |
| | | |
| | |
| | | return $res == "ok"; |
| | | } |
| | | } |
| | | |
| | |
| | | * @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 |
| | |
| | | { |
| | | 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) |
| | |
| | | $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; |
| | | } |
| | | } |
| | |
| | | * @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 |
| | |
| | | * |
| | | * @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 |
| | |
| | | * 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 |
| | |
| | | |
| | | return PASSWORD_ERROR; |
| | | } |
| | | |
| | | } |
| | |
| | | * @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 |
| | |
| | | { |
| | | $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 (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$'; |
| | |
| | | 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); |
| | |
| | | |
| | | 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; |
| | |
| | | * |
| | | * @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 |
| | |
| | | * @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 |
| | |
| | | $vpopmaild->writeLine("quit"); |
| | | $vpopmaild->disconnect(); |
| | | |
| | | if (!preg_match('/^\+OK/', $result)) |
| | | if (!preg_match('/^\+OK/', $result)) { |
| | | return PASSWORD_ERROR; |
| | | } |
| | | |
| | | return PASSWORD_SUCCESS; |
| | | } |
| | |
| | | * 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 |
| | |
| | | } //foreach |
| | | |
| | | return PASSWORD_SUCCESS; |
| | | |
| | | } |
| | | } |
| | |
| | | * $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 |
| | |
| | | socket_close($this->socket); |
| | | } |
| | | } |
| | | |
| | |
| | | 'sybase' => 'mssql', |
| | | 'dblib' => 'mssql', |
| | | 'mysqli' => 'mysql', |
| | | 'oci' => 'oracle', |
| | | ); |
| | | |
| | | $driver = isset($driver_map[$driver]) ? $driver_map[$driver] : $driver; |