From ef2e7b3f9d264ec146d4dae257b1e295ab3b462a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 21 Apr 2015 12:45:58 +0200 Subject: updates - plugins as a separate git folder --- plugins/password/drivers/ximss.php | 89 -------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 plugins/password/drivers/ximss.php (limited to 'plugins/password/drivers/ximss.php') diff --git a/plugins/password/drivers/ximss.php b/plugins/password/drivers/ximss.php deleted file mode 100644 index 54477f730..000000000 --- a/plugins/password/drivers/ximss.php +++ /dev/null @@ -1,89 +0,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_ximss_password -{ - function save($pass, $newpass) - { - $rcmail = rcmail::get_instance(); - - $host = $rcmail->config->get('password_ximss_host'); - $port = $rcmail->config->get('password_ximss_port'); - $sock = stream_socket_client("tcp://$host:$port", $errno, $errstr, 30); - - if ($sock === FALSE) { - return PASSWORD_CONNECT_ERROR; - } - - // send all requests at once(pipelined) - fwrite( $sock, ''."\0"); - fwrite( $sock, ''."\0"); - fwrite( $sock, ''."\0"); - - //example responses - // \0 - // \0 - // \0 - // \0 - // or an error: - // \0 - - $responseblob = ''; - while (!feof($sock)) { - $responseblob .= fgets($sock, 1024); - } - - fclose($sock); - - foreach( explode( "\0",$responseblob) as $response ) { - $resp = simplexml_load_string("".$response.""); - - if( $resp->response[0]['id'] == 'A001' ) { - if( isset( $resp->response[0]['errorNum'] ) ) { - return PASSWORD_CONNECT_ERROR; - } - } - else if( $resp->response[0]['id'] == 'A002' ) { - if( isset( $resp->response[0]['errorNum'] )) { - return PASSWORD_ERROR; - } - } - else if( $resp->response[0]['id'] == 'A003' ) { - if( isset($resp->response[0]['errorNum'] )) { - //There was a problem during logout(This is probably harmless) - } - } - } //foreach - - return PASSWORD_SUCCESS; - } -} -- cgit v1.2.3