|
|
@@ -22,15 +22,33 @@ function zimbraSingle_MetaData()
|
|
|
*/
|
|
|
function zimbraSingleGetAccess()
|
|
|
{
|
|
|
- global $packageid;
|
|
|
$accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
|
|
|
$whmcs = App::self();
|
|
|
- $productID = $whmcs->get_req_var('id');
|
|
|
+ $action = $whmcs->get_req_var('action');
|
|
|
+ switch ($action) {
|
|
|
+ case "module-settings":
|
|
|
+ $idSelector = 'packageid';
|
|
|
+ break;
|
|
|
+ case "productdetails":
|
|
|
+ $idSelector = 'id';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "Warning: unknown action",
|
|
|
+ $action
|
|
|
+ );
|
|
|
+ $idSelector = 'id';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $id = $whmcs->get_req_var('id');
|
|
|
$serverGroupID = $whmcs->get_req_var('servergroup');
|
|
|
- if($productID) {
|
|
|
+ if($id) {
|
|
|
$serverIDObj = Capsule::table('tblhosting')
|
|
|
->select('server')
|
|
|
- ->where('packageid', '=', $productID)
|
|
|
+ ->where($idSelector, '=', $id)
|
|
|
->get();
|
|
|
$serverID = $serverIDObj[0]->server;
|
|
|
} elseif($serverGroupID) {
|
|
|
@@ -50,7 +68,7 @@ function zimbraSingleGetAccess()
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- "Error: could not get accessdata 3",
|
|
|
+ "Error: could not get accessdata",
|
|
|
""
|
|
|
);
|
|
|
return false;
|