[11-Mar-2015 19:48:43 -0600]: <jo61r1eg> Response:HTTP/1.1 401 Access DeniedSet-Cookie: cprelogin=no; HttpOnly; path=/; port=2083; secureSet-Cookie: cpsession=%3ai2Ld9CTSzlcDYHYY9rX_NbQBs6PoqE74an8sLc_FOvn9NfpVncx36a4fER4AHTUN%2cf5eb6d560110054f39353ceb1df9e16941e3a06678cb19b189be71013fc25d81; HttpOnly; path=/; port=2083; secureServer: cpsrvd/11.44.2.4Content-type: text/html; charset="utf-8"Connection: closeDate: Thu, 12 Mar 2015 01:48:43 GMTContent-Length: 2572<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="shortcut icon" href="/cPanel_magic_revision_1263758030/unprotected/cpanel/favicon.ico" type="image/x-icon" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cPanel® 11</title><link rel="stylesheet" href="/cPanel_magic_revision_1355099890/unprotected/cpanel/style_optimized.css" type="text/css" /><!--[if IE]><style type="text/css">#mid{ height:300px;}</style><![endif]--><meta name="robots" content="noindex, nofollow" /></head><body><div id="wrap"> <div id="top"></div> <div id="mid"> <div id="content-wrap" align="center"> <script type="text/javascript"> var url = "https://my.bluehost.com/cgi/account/cpanel"; var query = window.location.search; var c = query.indexOf("failurl="); if (c >= 0) { var s = query.substring(c + ; if (s.indexOf("&") >= 1) s = s.substring(0, s.indexOf("&")); url = unescape(s); } else { url = url + "?goto_uri=" + window.location.pathname; } window.location.href = url;</script><noscript> <meta http-equiv="refresh" content="0;url=https://my.bluehost.com/cgi/account/cpanel"></noscript><form action="/login/" method="post" > <input type="hidden" name="login_theme" value="cpanel" /> <table width="200px" class="login" cellpadding="0" cellspacing="0"> <tr> <td align="left" colspan="2"><strong>Login</strong></td> </tr> <tr> <td class="login_lines">Username </td> <td class="login_lines"><input autofocus="autofocus" id="user" type="text" name="user" size="16" tabindex="1" /></td> </tr> <tr class="row2"> <td class="login_lines">Password </td> <td class="login_lines"><input id="pass" type="password" name="pass" size="16" tabindex="2" /></td> </tr> <tr> <td colspan="2" style="text-align: center"><input type="submit" value="Login" class="input-button" tabindex="3" /></td> </tr> </table> <input type="hidden" name="goto_uri" value="/frontend/rsx3/mail/dopasswdpop.html?email=bryan&domain=aaz-univ.com&password=bryanbulan123456789" /></form><script type="text/javascript">//<![CDATA[/* Must not include external javascript -jnk 06.20.09 */ document.getElementById("user").focus();//]]></script></div></div><div id="bot"></div>© cPanel, Inc. 2011</div></body></html>
$response = $this->HTTP->getData('mail/dopasswdpop.html', $data);
<?php/** * cPanel Password Driver * * Driver that adds functionality to change the users cPanel password. * Originally written by Fulvio Venturelli <fulvio@venturelli.org> * * Completely rewritten using the cPanel API2 call Email::passwdpop * as opposed to the original coding against the UI, which is a fragile method that * makes the driver to always return a failure message for any language other than English * see http://trac.roundcube.net/ticket/1487015 * * This driver has been tested with o2switch hosting and seems to work fine. * * @version 3.0 * @author Christian Chech <christian@chech.fr> * * 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_cpanel_password{ public function save($curpas, $newpass) { require_once 'xmlapi.php'; $rcmail = rcmail::get_instance(); $this->cuser = $rcmail->config->get('password_cpanel_username'); // Setup the xmlapi connection $this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host')); $this->xmlapi->set_port($rcmail->config->get('password_cpanel_port')); $this->xmlapi->password_auth($this->cuser, $rcmail->config->get('password_cpanel_password')); $this->xmlapi->set_output('json'); $this->xmlapi->set_debug(0); if ($this->setPassword($_SESSION['username'], $newpass)) { return PASSWORD_SUCCESS; } else { return PASSWORD_ERROR; } } /** * Change email account password * * Returns true on success or false on failure. * @param string $password email account password * @return bool */ function setPassword($address, $password) { if (strpos($address, '@')) { list($data['email'], $data['domain']) = explode('@', $address); } else { list($data['email'], $data['domain']) = array($address, ''); } $data['password'] = $password; $query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data); $query = json_decode($query, true); if ($query['cpanelresult']['data'][0]['result'] == 1) { return true; } return false; }}
$query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data);