| | |
| | | * domainFACTORY Password Driver |
| | | * |
| | | * Driver to change passwords with the hosting provider domainFACTORY. |
| | | * See: http://www.df.eu/ |
| | | * http://www.df.eu/ |
| | | * |
| | | * @version 2.0 |
| | | * @version 2.1 |
| | | * @author Till Krüss <me@tillkruess.com> |
| | | * @link http://tillkruess.com/projects/roundcube/ |
| | | * |
| | |
| | | } |
| | | |
| | | if ($ch = curl_init()) { |
| | | |
| | | // initial login |
| | | curl_setopt_array($ch, array( |
| | | CURLOPT_RETURNTRANSFER => true, |
| | |
| | | $ch = curl_copy_handle($ch); |
| | | curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); |
| | | if ($result = curl_exec($ch)) { |
| | | |
| | | // has the password been changed? |
| | | if (strpos($result, 'Einstellungen erfolgreich') !== false) { |
| | | return PASSWORD_SUCCESS; |
| | | } |
| | | |
| | | // show error message(s) if possible |
| | | if (strpos($result, '<div class="d-msg-text">') !== false) { |
| | | preg_match_all('#<div class="d-msg-text">(.*?)</div>#s', $result, $errors); |
| | | if (isset($errors[1])) { |
| | | $error_message = ''; |
| | | foreach ( $errors[1] as $error ) { |
| | | $error_message .= trim(mb_convert_encoding( $error, 'UTF-8', 'ISO-8859-15' )).' '; |
| | | } |
| | | return array('code' => PASSWORD_ERROR, 'message' => $error_message); |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |
| | | |
| | | } else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |
| | | |
| | | } else { |
| | | return PASSWORD_CONNECT_ERROR; |
| | | } |