mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 13:54:28 -07:00
Merge pull request #619 from dpeca/patch-1
Update for Roundcube Password driver for Vesta
This commit is contained in:
commit
c9e586d9eb
1 changed files with 13 additions and 3 deletions
|
@ -6,8 +6,8 @@
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author Serghey Rodin <skid@vestacp.com>
|
* @author Serghey Rodin <skid@vestacp.com>
|
||||||
*/
|
*/
|
||||||
|
class rcube_vesta_password {
|
||||||
function password_save($curpass, $passwd)
|
function save($curpass, $passwd)
|
||||||
{
|
{
|
||||||
$rcmail = rcmail::get_instance();
|
$rcmail = rcmail::get_instance();
|
||||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||||
|
@ -40,7 +40,16 @@
|
||||||
$send .= PHP_EOL;
|
$send .= PHP_EOL;
|
||||||
$send .= $postdata . PHP_EOL . PHP_EOL;
|
$send .= $postdata . PHP_EOL . PHP_EOL;
|
||||||
|
|
||||||
$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
|
//$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
|
||||||
|
$errno = "";
|
||||||
|
$errstr = "";
|
||||||
|
$context = stream_context_create();
|
||||||
|
|
||||||
|
$result = stream_context_set_option($context, 'ssl', 'verify_peer', false);
|
||||||
|
$result = stream_context_set_option($context, 'ssl', 'verify_host', false);
|
||||||
|
$result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
|
||||||
|
|
||||||
|
$fp = stream_socket_client('ssl://' . $vesta_host . ':'.$vesta_port, $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);
|
||||||
fputs($fp, $send);
|
fputs($fp, $send);
|
||||||
$result = fread($fp, 2048);
|
$result = fread($fp, 2048);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
@ -60,3 +69,4 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue