|
@@ -13,9 +13,8 @@
|
|
|
if (!defined("WHMCS")) {
|
|
if (!defined("WHMCS")) {
|
|
|
die("This file cannot be accessed directly");
|
|
die("This file cannot be accessed directly");
|
|
|
}
|
|
}
|
|
|
|
|
+use WHMCS\Database\Capsule;
|
|
|
require_once dirname(__FILE__) . '/zimbraSingle.inc';
|
|
require_once dirname(__FILE__) . '/zimbraSingle.inc';
|
|
|
-use WHMCS\User\Client;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
function zimbraSingle_TestConnection($params)
|
|
function zimbraSingle_TestConnection($params)
|
|
|
{
|
|
{
|
|
@@ -55,16 +54,21 @@ function zimbraSingle_ChangePassword($params)
|
|
|
if (defined('CLIENTAREA')) {
|
|
if (defined('CLIENTAREA')) {
|
|
|
$params['customfields']['password'] = $params['password'];
|
|
$params['customfields']['password'] = $params['password'];
|
|
|
$params['customfields']['pwrepeat'] = $params['password'];
|
|
$params['customfields']['pwrepeat'] = $params['password'];
|
|
|
- $clientFields = Client::find($userID)->customFieldValues;
|
|
|
|
|
|
|
+ $customFieldIDs = Capsule::table('tblcustomfields')
|
|
|
|
|
+ ->select('id')
|
|
|
|
|
+ ->where('relid', '=', $params['serviceid'])
|
|
|
|
|
+ ->where('fieldtype', '=', 'password')
|
|
|
|
|
+ ->get();
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
- $userID,
|
|
|
|
|
|
|
+ $customFieldIDs,
|
|
|
"Debug",
|
|
"Debug",
|
|
|
- $clientFields
|
|
|
|
|
|
|
+ ""
|
|
|
);
|
|
);
|
|
|
|
|
+
|
|
|
$customfields = array(
|
|
$customfields = array(
|
|
|
- 'password' => $params['password'],
|
|
|
|
|
|
|
+ '399' => $params['password'],
|
|
|
'400' => $params['password']
|
|
'400' => $params['password']
|
|
|
);
|
|
);
|
|
|
$postData = array(
|
|
$postData = array(
|
|
@@ -72,13 +76,6 @@ function zimbraSingle_ChangePassword($params)
|
|
|
'customfields' => base64_encode(serialize($customfields)),
|
|
'customfields' => base64_encode(serialize($customfields)),
|
|
|
);
|
|
);
|
|
|
$results = localAPI('UpdateClientProduct', $postData);
|
|
$results = localAPI('UpdateClientProduct', $postData);
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $postData,
|
|
|
|
|
- "Debug",
|
|
|
|
|
- $results
|
|
|
|
|
- );
|
|
|
|
|
$response = zimbraSingleChangePassword($params['customfields'], 'no');
|
|
$response = zimbraSingleChangePassword($params['customfields'], 'no');
|
|
|
} else {
|
|
} else {
|
|
|
$response = zimbraSingleChangePassword($params['customfields'], 'yes');
|
|
$response = zimbraSingleChangePassword($params['customfields'], 'yes');
|