switched roundcube driver to sockets

This commit is contained in:
Serghey Rodin 2012-12-31 12:58:57 +02:00
commit 22274b2b11

View file

@ -25,25 +25,31 @@ class rcube_vesta_password
$vesta_port = '8083'; $vesta_port = '8083';
} }
$request = 'email='.$_SESSION['username'].'&'; $postvars = array(
$request .= 'password='.$curpass.'&'; 'email' => $_SESSION['username'],
$request .= 'new='.$passwd.'&'; 'password' => $curpass,
'new' => $passwd
);
$postdata = http_build_query($postvars);
$send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
$send .= 'Host: ' . $vesta_host . PHP_EOL;
$send .= 'User-Agent: PHP Script' . PHP_EOL;
$send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
$send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
$send .= 'Connection: close' . PHP_EOL;
$send .= PHP_EOL;
$send .= $postdata . PHP_EOL . PHP_EOL;
$fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
fputs($fp, $send);
$result = fread($fp, 2048);
fclose($fp);
$context = stream_context_create(array( if(strpos($result, 'ok') && !strpos($html, 'error'))
'http' => array( {
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL,
'content' => $request,
),
));
$result = file_get_contents(
$file = "https://".$vesta_host.":".$vesta_port."/reset/mail/?",
$use_include_path = false,
$context);
if ($result == 'ok'){
return PASSWORD_SUCCESS; return PASSWORD_SUCCESS;
} }
else { else {