diff --git a/install/0.9.7/rhel/roundcube-driver.php b/install/0.9.7/rhel/roundcube-driver.php new file mode 100644 index 00000000..22877047 --- /dev/null +++ b/install/0.9.7/rhel/roundcube-driver.php @@ -0,0 +1,54 @@ + + */ + +class rcube_vesta_password +{ + function save($curpass, $passwd) + { + $rcmail = rcmail::get_instance(); + $vesta_host = $rcmail->config->get('password_vesta_host'); + + if (empty($vesta_host)) + { + $vesta_host = 'localhost'; + } + + $vesta_port = $rcmail->config->get('password_vesta_port'); + if (empty($vesta_port)) + { + $vesta_port = '8083'; + } + + $request = 'email='.$_SESSION['username'].'&'; + $request .= 'password='.$curpass.'&'; + $request .= 'new='.$passwd.'&'; + + + $context = stream_context_create(array( + '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; + } + else { + return PASSWORD_ERROR; + } + + } +}