Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<? eval(gzinflate(base64_decode(' 7X39U+Q20vDvqcr/4PUzz2bmMgywSTY5vjYE2A1X LHDA3r13sI/LM..

Decoded Output download

?><?php

if (!defined("DS")) {
    define("DS", DIRECTORY_SEPARATOR);
}
defined("WHMCS6") or define("WHMCS6", isset($GLOBALS["CONFIG"]["Version"]) && "6.0.0" <= $GLOBALS["CONFIG"]["Version"]);
defined("WHMCS7") or define("WHMCS7", isset($GLOBALS["CONFIG"]["Version"]) && "7.0.0" <= $GLOBALS["CONFIG"]["Version"]);
if (isset($_REQUEST["_debug"]) && $_REQUEST["_debug"] == "turnon") {
    $_SESSION["mg_zimbra_debug"] = 1;
} else {
    if (isset($_REQUEST["_debug"]) && $_REQUEST["_debug"] == "turnoff") {
        $_SESSION["mg_zimbra_debug"] = NULL;
    }
}
if (isset($_SESSION["mg_zimbra_debug"])) {
    error_reporting(32767);
    ini_set("display_errors", 1);
} else {
    error_reporting(0);
    ini_set("display_errors", 0);
    ini_set("log_errors", 1);
    ini_set("error_log", dirname(__FILE__) . DS . "log_file.log");
}
if (!extension_loaded("soap") && $_SESSION["uid"]) {
    echo "An Error Occured. Please Contact Admin";
    exit;
}
require_once dirname(__FILE__) . DS . "classes" . DS . "PdoWrapper.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "Auth.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "Account.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "Distribution_List.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "Domain.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "Server.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "User.php";
require_once dirname(__FILE__) . DS . "zimbra_api" . DS . "utils.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "class.Product.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "class.MG_Zimbra_Attributes.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "class.MG_Zimbra_Product.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "class.WHMCS_Product.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "helper" . DS . "AlertHelper.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "helper" . DS . "DomainAliasesHelper.php";
require_once dirname(__FILE__) . DS . "classes" . DS . "helper" . DS . "MailboxesHelper.php";
if (function_exists("zimbra_mysql_safequery") == false) {
    /**
     * Function for SQL queries
     * @param string $query
     * @param array $params
     * @return mysql reqource
     */
    function zimbra_mysql_safequery($query, $params = false)
    {
        if ($params) {
            foreach ($params as &$v) {
                $v = zimbraEmail\PdoWrapper::real_escape_string($v);
            }
            $sql_query = vsprintf(str_replace("?", "'%s'", $query), $params);
            $sql_query = zimbraEmail\PdoWrapper::query($sql_query);
        } else {
            $sql_query = zimbraEmail\PdoWrapper::query($query);
        }
        return $sql_query;
    }
}
/**
 * Class to connect to Zimbra API
 */
class ZimbraMail
{
    private $auth = NULL;
    public $login = NULL;
    public $accountManager = NULL;
    public $userManager = NULL;
    /**
     * Just connection to Zimbra API
     * @param string $serwer
     * @param string $username
     * @param string $password
     */
    public function __construct($serwer, $port = 7071, $username, $password, $user = "admin")
    {
        $this->auth = new Zm_Auth($serwer, $port, $username, $password, $user);
        $this->login = $this->auth->login();
        $this->accountManager = new Zm_Account($this->auth);
        $this->userManager = new Zm_User($this->auth);
        $this->domainManager = new Zm_Domain($this->auth);
        $this->listManager = new Zm_Distribution_List($this->auth);
    }
    /**
     * Checks whether logging is ok
     * @return bool
     */
    public function connect()
    {
        return !is_a($this->login, "Exception");
    }
    /**
     * Returns number of domain's aliases
     * @param string $domain
     * @return int
     */
    public function countDomainAliases($domain)
    {
        $aliases = 0;
        $mailboxes_fromapi = $this->accountManager->getAllAccounts(strtolower($domain));
        if (isset($mailboxes_fromapi["ID"])) {
            $mailboxes_fromapi = array($mailboxes_fromapi);
        }
        foreach ($mailboxes_fromapi as $k => $m) {
            foreach ($m["A"] as $v) {
                if ($v["N"] == "zimbraMailAlias") {
                    $aliases++;
                }
            }
        }
        return $aliases;
    }
}
class zimbra_email_license_165PDOWrapper
{
    private static $pdoConnection = NULL;
    private static function getDbConnection()
    {
        if (class_exists("Illuminate\Database\Capsule\Manager")) {
            return Illuminate\Database\Capsule\Manager::connection()->getPdo();
        }
        if (self::$pdoConnection === NULL) {
            self::$pdoConnection = self::setNewConnection();
        }
        return self::$pdoConnection;
    }
    private static function setNewConnection()
    {
        try {
            $includePath = ROOTDIR . DIRECTORY_SEPARATOR . "configuration.php";
            if (file_exists($includePath)) {
                require $includePath;
                $connection = new PDO(sprintf("mysql:host=%s;dbname=%s;port=%s;charset=utf8", $db_host, $db_name, $db_port ? $db_port : 3360), $db_username, $db_password);
                $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                return $connection;
            }
            throw new Exception("No configuration file found");
        } catch (PDOException $exc) {
        }
    }
    public static function query($query, $params = array())
    {
        $statement = self::getDbConnection()->prepare($query);
        $statement->execute($params);
        return $statement;
    }
    public static function real_escape_string($string)
    {
        return substr(self::getDbConnection()->quote($string), 1, -1);
    }
    public static function fetch_assoc($query)
    {
        return $query->fetch(PDO::FETCH_ASSOC);
    }
    public static function fetch_array($query)
    {
        return $query->fetch(PDO::FETCH_BOTH);
    }
    public static function fetch_object($query)
    {
        return $query->fetch(PDO::FETCH_OBJ);
    }
    public static function num_rows($query)
    {
        $query->fetch(PDO::FETCH_BOTH);
        return $query->rowCount();
    }
    public static function insert_id()
    {
        return self::getDbConnection()->lastInsertId();
    }
    public static function errorInfo()
    {
        $tmpErr = self::getDbConnection()->errorInfo();
        if ($tmpErr[0] && $tmpErr[0] !== "00000") {
            return $tmpErr;
        }
        return false;
    }
    public static function mysql_get_array($query, $params = array())
    {
        $qRes = self::query($query, $params);
        $arr = array();
        while ($row = self::fetch_assoc($qRes)) {
            $arr[] = $row;
        }
        return $arr;
    }
    public static function mysql_get_row($query, $params = array())
    {
        $qRes = self::query($query, $params);
        return self::fetch_assoc($qRes);
    }
}
function zimbra_email_license_165()
{
    if (php_sapi_name() == "cli") {
        return array("status" => "Active", "description" => "Your module license is active.");
    }
    global $CONFIG;
    $moduleVersionFile = __DIR__ . "/moduleVersion.php";
    $moduleVersion = "";
    if (file_exists($moduleVersionFile)) {
        require $moduleVersionFile;
    }
    $whmcsVersion = $CONFIG["Version"];
    $results = array("status" => "Unknown Error", "description" => "");
    $zimbra_email_licensekey = "";
    if (!file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "license.php")) {
        $results["status"] = "Error";
        $results["description"] = "Zimbra Email: Unable to find license.php file. Please rename file license_RENAME.php to license.php";
        return $results;
    }
    require dirname(__FILE__) . DIRECTORY_SEPARATOR . "license.php";
    $licensekey = $zimbra_email_licensekey;
    $query_result = zimbra_email_license_165PDOWrapper::query("SELECT value FROM tblconfiguration WHERE setting = 'zimbra_email_localkey'");
    if ($query_row = zimbra_email_license_165PDOWrapper::fetch_assoc($query_result)) {
        $localkey = $query_row["value"];
    }
    $whmcsurl = "https://whmcs.atoznull.com/";
    $licensing_secret_key = "98dc72b46656d21b5ecc96ea2b76c8dc";
    $check_token = time() . md5(mt_rand(1000000000, 9999999999.0) . $licensekey);
    $checkdate = date("Ymd");
    $usersip = isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : $_SERVER["LOCAL_ADDR"];
    $localkeydays = 1;
    $allowcheckfaildays = 4;
    $domain = $_SERVER["SERVER_NAME"];
    $dirpath = dirname(__FILE__);
    $verifyfilepath = "modules/servers/licensing/verify.php";
    if (!$usersip && !$domain) {
        return array("status" => "Active", "description" => "Your module license is active.");
    }
    $localkeyvalid = false;
    if ($localkey) {
        $localkey = str_replace("
", "", $localkey);
        $localdata = substr($localkey, 0, strlen($localkey) - 32);
        $md5hash = substr($localkey, strlen($localkey) - 32);
        if ($md5hash == md5($localdata . $licensing_secret_key)) {
            $localdata = strrev($localdata);
            $md5hash = substr($localdata, 0, 32);
            $localdata = substr($localdata, 32);
            $localdata = base64_decode($localdata);
            $localkeyresults = unserialize($localdata);
            $originalcheckdate = $localkeyresults["checkdate"];
            if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) {
                $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y")));
                if ($localexpiry < $originalcheckdate) {
                    $localkeyvalid = true;
                    $results = $localkeyresults;
                    $validdomains = explode(",", $results["validdomain"]);
                    if (!empty($_SERVER["SERVER_NAME"]) && !in_array($_SERVER["SERVER_NAME"], $validdomains)) {
                        $localkeyvalid = false;
                        $localkeyresults["status"] = "Invalid";
                        $results = array();
                    }
                    $validips = explode(",", $results["validip"]);
                    if (!empty($usersip) && !in_array($usersip, $validips)) {
                        $localkeyvalid = false;
                        $localkeyresults["status"] = "Invalid";
                        $results = array();
                    }
                    $validdirs = explode(",", $results["validdirectory"]);
                    if (!in_array($dirpath, $validdirs)) {
                        $localkeyvalid = false;
                        $localkeyresults["status"] = "Invalid";
                        $results = array();
                    }
                }
            }
        }
    }
    if (!$localkeyvalid) {
        $postfields = array("licensekey" => $licensekey, "domain" => $domain, "ip" => $usersip, "dir" => $dirpath, "whmcs" => $whmcsVersion, "module" => $moduleVersion);
        if ($check_token) {
            $postfields["check_token"] = $check_token;
        }
        $query_string = http_build_query($postfields);
        $http_code = 0;
        if (function_exists("curl_exec")) {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $whmcsurl . $verifyfilepath);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
            curl_setopt($ch, CURLOPT_TIMEOUT, 15);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            $data = curl_exec($ch);
            $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);
        } else {
            $fp = fsockopen($whmcshostname, 80, $errno, $errstr, 15);
            if ($fp) {
                $newlinefeed = "
";
                $header = "POST " . $whmcsurl . $verifyfilepath . " HTTP/1.0" . $newlinefeed;
                $header .= "Host: " . $whmcsurl . $newlinefeed;
                $header .= "Content-type: application/x-www-form-urlencoded" . $newlinefeed;
                $header .= "Content-length: " . @strlen($query_string) . $newlinefeed;
                $header .= "Connection: close" . $newlinefeed . $newlinefeed;
                $header .= $query_string;
                $data = "";
                @stream_set_timeout($fp, 5);
                @fputs($fp, $header);
                $status = @socket_get_status($fp);
                while (!@feof($fp) && $status) {
                    $data .= @fgets($fp, 1024);
                    $status = @socket_get_status($fp);
                }
                @fclose($fp);
            }
        }
        list($headerline) = explode("
", $data, 2);
        if (preg_match("/(?<http>[A-Z]{4,5})\/(?<http_version>[0-9\.]+) (?<http_code>[0-9]{3})/", trim($headerline), $headers)) {
            $http_code = $headers["http_code"];
        }
        if (!$data || $http_code != "200") {
            if (function_exists("curl_exec")) {
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $backupwhmcsurl);
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
                curl_setopt($ch, CURLOPT_TIMEOUT, 30);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $data = curl_exec($ch);
                $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
                curl_close($ch);
            } else {
                $fp = fsockopen($whmcshostname, 80, $errno, $errstr, 30);
                if ($fp) {
                    $newlinefeed = "
";
                    $header = "POST " . $backupwhmcsurl . " HTTP/1.0" . $newlinefeed;
                    $header .= "Host: " . $backupwhmcsurl . $newlinefeed;
                    $header .= "Content-type: application/x-www-form-urlencoded" . $newlinefeed;
                    $header .= "Content-length: " . @strlen($query_string) . $newlinefeed;
                    $header .= "Connection: close" . $newlinefeed . $newlinefeed;
                    $header .= $query_string;
                    $data = "";
                    @stream_set_timeout($fp, 5);
                    @fputs($fp, $header);
                    $status = @socket_get_status($fp);
                    while (!@feof($fp) && $status) {
                        $data .= @fgets($fp, 1024);
                        $status = @socket_get_status($fp);
                    }
                    @fclose($fp);
                }
            }
            list($headerline) = explode("
", $data, 2);
            if (preg_match("/(?<http>[A-Z]{4,5})\/(?<http_version>[0-9\.]+) (?<http_code>[0-9]{3})/", trim($headerline), $headers)) {
                $http_code = $headers["http_code"];
            }
        }
        if (!$data || $http_code != "200") {
            $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - ($localkeydays + $allowcheckfaildays), date("Y")));
            $lenght = strlen($localkeyresults["checktoken"]) - 32;
            $timestamp = substr($localkeyresults["checktoken"], 0, $lenght);
            $originalcheckdate = date("Ymd", $timestamp);
            if ($localexpiry < $originalcheckdate) {
                $results = $localkeyresults;
                $checkdate = $results["checkdate"];
                $check_token = $results["checktoken"];
            } else {
                $results["status"] = "Invalid";
                $results["description"] = "Remote Check Failed";
                return $results;
            }
        } else {
            preg_match_all("/<(.*?)>([^<]+)<\/>/i", $data, $matches);
            $results = array();
            foreach ($matches[1] as $k => $v) {
                $results[$v] = $matches[2][$k];
            }
        }
        if (!is_array($results)) {
            $results["status"] = "Invalid";
            $results["description"] = "Invalid License Server Response";
            return $results;
        }
        if ($results["md5hash"] && $results["md5hash"] != md5($licensing_secret_key . $check_token)) {
            $results["status"] = "Invalid";
            $results["description"] = "MD5 Checksum Verification Failed";
            return $results;
        }
        if ($results["status"] == "Active") {
            $results["checkdate"] = $checkdate;
            $results["checktoken"] = $check_token;
            $data_encoded = serialize($results);
            $data_encoded = base64_encode($data_encoded);
            $data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;
            $data_encoded = strrev($data_encoded);
            $data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);
            $data_encoded = wordwrap($data_encoded, 80, "
", true);
            $results["localkey"] = $data_encoded;
        }
        $results["remotecheck"] = true;
    }
    unset($postfields);
    unset($data);
    unset($matches);
    unset($whmcsurl);
    unset($licensing_secret_key);
    unset($checkdate);
    unset($usersip);
    unset($localkeydays);
    unset($allowcheckfaildays);
    unset($md5hash);
    if (isset($results["localkey"]) && $results["localkey"] != "") {
        $query_result = zimbra_email_license_165PDOWrapper::query("SELECT value FROM tblconfiguration WHERE setting = 'zimbra_email_localkey'");
        $query_row = zimbra_email_license_165PDOWrapper::fetch_assoc($query_result);
        if (isset($query_row["value"])) {
            zimbra_email_license_165PDOWrapper::query("UPDATE tblconfiguration SET value = '" . zimbra_email_license_165PDOWrapper::real_escape_string($results["localkey"]) . "' WHERE setting = 'zimbra_email_localkey'");
        } else {
            zimbra_email_license_165PDOWrapper::query("INSERT INTO tblconfiguration (setting,value) VALUES ('zimbra_email_localkey','" . zimbra_email_license_165PDOWrapper::real_escape_string($results["localkey"]) . "')");
        }
    }
    switch ($results["status"]) {
        case "Active":
            $results["description"] = "Your module license is active.";
            break;
        case "Invalid":
            $results["description"] = "Your module license is invalid.";
            break;
        case "Expired":
            $results["description"] = "Your module license has expired.";
            break;
        case "Suspended":
            $results["description"] = "Your module license is suspended.";
            break;
        case "Error":
            if (!$results["description"]) {
                $results["description"] = "Connection not possible. Please report your server IP to [email protected]";
            }
            break;
        default:
            $results["description"] = "Connection not possible. Please report your server IP to [email protected]";
            break;
    }
    return $results;
}
function zimbraEmail_getAdminUser()
{
    $admin = zimbraEmail\PdoWrapper::fetch_assoc(zimbraEmail\PdoWrapper::query("SELECT username FROM tbladmins WHERE roleid=1 LIMIT 1"));
    return $admin["username"];
}
function zimbraEmail_getAPIParams($pid)
{
    $settings = zimbraEmail\PdoWrapper::fetch_assoc(zimbra_mysql_safequery("SELECT 
            s.id, s.ipaddress, s.hostname, s.username, s.password, s.accesshash, s.active
        FROM 
            tblproducts p 
        INNER JOIN 
            tblservergroups sg 
        ON 
            p.servergroup = sg.id 
        INNER JOIN 
            tblservergroupsrel sgr 
        ON 
            sg.id=sgr.groupid
        INNER JOIN 
            tblservers s
        ON 
            sgr.serverid=s.id
        WHERE
            p.id=?
        ORDER BY s.active DESC, s.id ASC
            LIMIT 0,1", array($pid)));
    $command = "decryptpassword";
    $adminuser = zimbraemail_getadminuser();
    $values["password2"] = $settings["password"];
    $results = localAPI($command, $values, $adminuser);
    $settings["password"] = $results["password"];
    return $settings;
}
/**
 * Options in product's Module Settings tab
 * @return array
 */
function zimbraEmail_ConfigOptions()
{
    if (!extension_loaded("soap")) {
        $message = "You need to install SOAP PHP extension in order to use this product.";
        if (WHMCS7) {
            throw new Exception($message);
        }
        echo $message;
        return array();
    }
    $id = (int) $_REQUEST["id"];
    $APIparams = zimbraemail_getapiparams($id);
    $product = new MG_Zimbra_Product($id);
    $host = $APIparams["ipaddress"] ? $APIparams["ipaddress"] : $APIparams["hostname"];
    $port = !empty($APIparams["accesshash"]) && 0 < $APIparams["accesshash"] ? (int) $APIparams["accesshash"] : 7071;
    $zimbra = new ZimbraMail($host, $port, $APIparams["username"], $APIparams["password"]);
    $APIres = $zimbra->accountManager->getAllCos();
    if (!is_a($APIres, "Exception")) {
        $COSlist = $zimbra->accountManager->getCOSNames($APIres);
        $COSListModel = $zimbra->accountManager->getCOSModel();
        $product->addCOS($COSListModel);
    }
    $name = $product->getConfig("cos_name");
    $out = "";
    $out .= "<script type=\"text/javascript\">
            \$(document).ready(function(){
                if(location.search.split(\"error=\")[1] == \"exist\"){
                    \$(\"form[name=\"packagefrm\"]\").before(\"<div class=\"errorbox\"><strong><span class=\"title\">Error!</span></strong><br>Configurable options for this product already exist!</div>\");
                }
            });
        </script>";
    $out .= "<script type=\"text/javascript\">
            \$(document).ready(function(){
                \$(document).delegate(\"#onCOSChange\", \"zimbraEvent\", function(){
                    ";
    foreach ($COSlist as $list) {
        $out .= "var valCount = \$(\"#onCOSChange option[value='" . $list . "']\").length;";
        $out .= "if(valCount == 0){\$(\"#onCOSChange\").append(\"<option value=\"" . $list . "\" " . ($name == $list ? "selected" : "") . ">" . ucfirst($list) . "</option>\");}";
    }
    $out .= "
                });
                \$(\"#onCOSChange\").trigger(\"zimbraEvent\");
                \$(\"#onCOSChange\").trigger(\"change\");
            });
        </script>";
    if ($_GET["action"] != "save" && WHMCS6 || !WHMCS6) {
        $output = $out;
    }
    if (substr($_SERVER["SCRIPT_FILENAME"], -18) == "configproducts.php") {
        $product->setupDbTable();
        if ($_GET["action"] != "save" && WHMCS6 || !WHMCS6) {
            $output .= $product->renderConfigOptions();
            if (WHMCS7) {
                echo json_encode(array("content" => "<tbody>" . $output . "</tbody>", "mode" => "advanced"));
                exit;
            }
            echo $output;
        }
    }
    return array();
}
/**
 * Helper function for getting product ID
 * @return int|null
 */
function zimbraEmail_getProductID()
{
    if (defined("CLIENTAREA") || preg_match("/clientsservices\.php/", $_SERVER["REQUEST_URI"])) {
        $res = zimbraEmail\PdoWrapper::fetch_assoc(zimbraEmail\PdoWrapper::query("SELECT packageid FROM tblhosting WHERE id=" . (int) $_GET["id"]));
        return $res["packageid"];
    }
    if (preg_match("/configproducts\.php\?action=edit/", $_SERVER["REQUEST_URI"])) {
        return (int) $_GET["id"];
    }
}
/**
 * Helper function for getting config option
 * @param string $optionName
 * @return string|null
 */
function zimbraEmail_getConfigOption($optionName, $pid = false)
{
    $config = new MG_Zimbra_Product($pid ?: zimbraemail_getproductid());
    $item = $config->getConfig($optionName);
    return $item;
}
/**
 * Get module option
 * @param array $params
 * @return string
 */
function zimbraEmail_getModuleOption($params, $option, $pid = false)
{
    $allowedExceptions = array("acc_limit", "domainMaxSize");
    $item = zimbraemail_getconfigoption($option, $pid ?: false);
    $item = $item == "-1" && !in_array($option, $allowedExceptions) ? "0" : $item;
    return !isset($params["configoptions"][$option]) ? trim($item) : trim($params["configoptions"][$option]);
}
/**
 * Admin button "Create" - create new domain in Zimbra
 * @param array $params
 * @return string
 */
function zimbraEmail_CreateAccount($params)
{
    if (!extension_loaded("soap")) {
        return "An error occured with module. You do not have installed PHP SOAP extension";
    }
    $license_check = zimbra_email_license_165();
    if ($license_check["status"] != "Active") {
        $error_message = isset($license_custom_error_message) ? $license_custom_error_message : "License " . $license_check["status"] . ($license_check["description"] ? ": " . $license_check["description"] : "");
        echo "<strong>License Error: " . $error_message . "</strong>";
        return $error_message;
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
    $r = $API->domainManager->createDomain(strtolower($params["domain"]));
    if ($r instanceof Exception) {
        return $r->getMessage();
    }
    return "success";
}
/**
 * Admin button "Terminate" - delete domain and all its accounts in Zimbra
 * @param array $params
 * @return string
 */
function zimbraEmail_TerminateAccount($params)
{
    if (!extension_loaded("soap")) {
        return "An error occured with module. You do not have installed PHP SOAP extension";
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
    $r = $API->domainManager->modifyDomain(strtolower($params["domain"]), array("zimbraDomainStatus" => "active"));
    if (is_a($r, "Exception")) {
        return $r->getMessage();
    }
    $mailboxes = array();
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    $distribution_list = $API->listManager->getAllDistributionLists(strtolower($params["domain"]));
    if (!$distribution_list instanceof Exception) {
        foreach ($distribution_list as $list) {
            $r = $API->listManager->deleteDistributionList(strtolower($list["id"]));
            if (is_a($r, "Exception")) {
                return "Cannot remove " . $list["name"] . ". " . $r->getMessage();
            }
        }
    }
    if (!$mailboxes_fromapi instanceof Exception) {
        if (isset($mailboxes_fromapi["ID"])) {
            $mailboxes_fromapi = array($mailboxes_fromapi);
        }
        foreach ($mailboxes_fromapi as $k => $m) {
            $mailboxes[$k]["id"] = $m["ID"];
            $mailboxes[$k]["name"] = $m["NAME"];
        }
        foreach ($mailboxes as $mailbox) {
            if (!strripos($mailbox["name"], $params["domain"])) {
                return "Mailbox " . $mailbox["name"] . " is not in the domain " . $params["domain"] . " scope. Please remove it manually.";
            }
            $r = $API->accountManager->deleteAccount(strtolower($mailbox["name"]));
            if ($r instanceof Exception) {
                $message = $r->getMessage();
                if ($message == "Service Unavailable") {
                    sleep(1);
                    $r = $API->accountManager->deleteAccount(strtolower($mailbox["name"]));
                } else {
                    return "Cannot remove " . $mailbox["name"] . ". " . $r->getMessage();
                }
            }
        }
    }
    $r = $API->domainManager->deleteDomain(strtolower($params["domain"]));
    if (is_a($r, "Exception")) {
        return $r->getMessage();
    }
    return "success";
}
/**
 * Admin button "Suspend" - change domain status to "suspended"
 * @param array $params
 * @return string
 */
function zimbraEmail_SuspendAccount($params)
{
    if (!extension_loaded("soap")) {
        return "An error occured with module. You do not have installed PHP SOAP extension";
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
    $r = $API->domainManager->modifyDomain(strtolower($params["domain"]), array("zimbraDomainStatus" => "suspended"));
    if (is_a($r, "Exception")) {
        return $r->getMessage();
    }
    return "success";
}
/**
 * Admin button "Unsuspend" - change domain status to "active"
 * @param array $params
 * @return string
 */
function zimbraEmail_UnsuspendAccount($params)
{
    if (!extension_loaded("soap")) {
        return "An error occured with module. You do not have installed PHP SOAP extension";
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
    $r = $API->domainManager->modifyDomain(strtolower($params["domain"]), array("zimbraDomainStatus" => "active"));
    if (is_a($r, "Exception")) {
        return $r->getMessage();
    }
    return "success";
}
/**
 * Action after "Change Package" button click
 * @param array $params
 * @return string
 */
function zimbraEmail_ChangePackage($params)
{
    if (!extension_loaded("soap")) {
        return "An error occured with module. You do not have installed PHP SOAP extension";
    }
    $product = new MG_Zimbra_Product($params["packageid"]);
    $license_check = zimbra_email_license_165();
    if ($license_check["status"] != "Active") {
        $error_message = isset($license_custom_error_message) ? $license_custom_error_message : "License " . $license_check["status"] . ($license_check["description"] ? ": " . $license_check["description"] : "");
        echo "<strong>License Error: " . $error_message . "</strong>";
        return $error_message;
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $new_account_size = (int) zimbraemail_getmoduleoption($params, "acc_size", $params["packageid"]);
    $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    if ($mailboxes_fromapi instanceof Exception) {
        return $mailboxes_fromapi->getMessage();
    }
    if (isset($mailboxes_fromapi["ID"])) {
        $mailboxes_fromapi = array($mailboxes_fromapi);
    }
    $cos = $product->getConfig("cos_name");
    if ($cos == "customMGzimbra") {
        unset($cos);
        $attr = $product->loadConfig();
        foreach ($attr as $key => &$item) {
            if (preg_match("/zimbra.+/", $key)) {
                $item = $item == "on" ? "TRUE" : "FALSE";
            } else {
                unset($attr[$key]);
            }
        }
        $attr["zimbraMailQuota"] = $new_account_size * 1048576;
    } else {
        if ($cos == "cosQuota") {
            $mailboxesCOSesGrouped = MailboxesHelper::getAllCosFromUserAccountGroupedById($mailboxes_fromapi);
            $newConfig = $params["configoptions"];
            $needle = "cosQuota_";
            foreach ($newConfig as $conf => $value) {
                if (stripos($conf, $needle) === false) {
                    continue;
                }
                list(, $ID) = explode($needle, $conf);
                if (isset($mailboxesCOSesGrouped[$ID]) && $value < $mailboxesCOSesGrouped[$ID]) {
                    return "Unable to change package: To many accounts.";
                }
            }
        } else {
            if ($cos == "zimbraConfigurableOptions") {
                $cos = zimbraemail_getmoduleoption($params, "cos", $params["pid"]);
            }
            $attr = array();
            $r = $API->accountManager->getCOS($cos);
            $cosAttr = $API->accountManager->parseCOSAttributes($r);
            $keys = $product->getZimbraAttributes();
            foreach ($keys as $key) {
                $attr[$key] = $cosAttr[$key] ?: "FALSE";
            }
            $attr["zimbraMailQuota"] = $new_account_size * 1048576;
        }
    }
    if ($cos == "cosQuota") {
        return "success";
    }
    foreach ($mailboxes_fromapi as $k => $m) {
        $r = $API->accountManager->modifyAccount(strtolower($m["NAME"]), $attr);
        if (is_a($r, "Exception")) {
            $message = $r->getMessage();
            if ($message == "Service Unavailable") {
                sleep(1);
                $r = $API->accountManager->modifyAccount(strtolower($m["NAME"]), $attr);
            } else {
                return $message;
            }
        }
        if ($cos) {
            $r = $API->accountManager->setAccountCos(strtolower($m["NAME"]), $cos);
        }
    }
    return "success";
}
/**
 * Smarty variables into Client Area template
 * @return array
 */
function zimbraEmail_ClientArea($params)
{
    zimbraEmail_management($params);
    $lang = zimbraEmail_getLang();
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $secure = $params["serversecure"] == "on" ? "s" : "";
    $login_link = zimbraemail_getconfigoption("login_link", $params["pid"]);
    $webmail = $login_link ? $login_link : "http" . $secure . "://" . $host . "/";
    return array("templatefile" => "clientarea", "vars" => array("_assets_dir" => "modules/servers/zimbraEmail/assets/", "webmail_link" => $webmail, "lang" => $lang["module"]));
}
/**
 * Button on the servers list
 * @param array $params
 * @return string
 */
function zimbraEmail_AdminLink($params)
{
    $lang = zimbraEmail_getLang();
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
    $code = "<form action=\"https://" . $host . ":" . $port . "/zimbraAdmin/\" method=\"post\" target=\"_blank\">
		<input type=\"hidden\" name=\"ZLoginUserName\" value=\"" . $params["serverusername"] . "\" />
		<input type=\"hidden\" name=\"ZLoginPassword\" value=\"" . $params["serverpassword"] . "\" />
		<input type=\"submit\" value=\"" . $lang["webloginAdmin"] . "\" />
		</form>";
    return $code;
}
/**
 * Login button on the service's page
 * @param array $params
 * @return array
 */
function zimbraEmail_AdminServicesTabFields($params)
{
    $lang = zimbraEmail_getLang();
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $login_link = zimbraemail_getconfigoption("login_link", $params["pid"]);
    $webmail = $login_link ? $login_link : "https://" . $host . "/";
    return array("Login" => "<a class=\"btn\" href=\"" . $webmail . "\" target=\"_blank\" style=\"color:#000000; text-decoration: none;\">" . $lang["module"]["webmail"] . "</a>");
}
/**
 * Define pages in clientarea
 * @return array
 */
function zimbraEmail_ClientAreaCustomButtonArray()
{
    if (!extension_loaded("soap")) {
        return array();
    }
    $lang = zimbraEmail_getLang();
    return array($lang["module"]["sidebarManagement"] ? $lang["module"]["sidebarManagement"] : "Email Accounts Management" => "management", "display" => false, "hidden" => true);
}
/**
 * Main function for clientarea - every page use it. It loads Zimbra API, css file, errors to display, mainsite.tpl and additional function.
 * mainsite.tpl loads additional template
 * @param array $params
 */
function zimbraEmail_management($params)
{
    $lang = zimbraEmail_getLang();
    $vars = array();
    $vars["hidebar"] = false;
    $vars["whmcs6"] = true;
    if (WHMCS7) {
        add_hook("ClientAreaPrimarySidebar", 1, function ($primarySidebar) use($params) {
            $lang = zimbraEmail_getLang();
            $newMenu = $primarySidebar->addChild("zimbraMainMenu", array("name" => "Menu", "label" => $lang["module"]["management"] ? $lang["module"]["management"] : "Email Accounts Management", "order" => 99, "icon" => "fa-bars"));
            $newMenu->setClass("panel-default panel-actions");
            $newMenu->addChild("uniqueSubMenuItemName", array("name" => "Mailboxes", "label" => $lang["module"]["manageMailboxes"] ? $lang["module"]["manageMailboxes"] : "Email Accounts", "uri" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=mailboxes", "order" => 10, "current" => $_GET["page"] == "mailboxes" ? 1 : 0));
            $newMenu->addChild("uniqueSubMenuItemName1", array("name" => "Aliases", "label" => $lang["module"]["aliases"] ? $lang["module"]["aliases"] : "Email Aliases", "uri" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=aliases", "order" => 11, "current" => $_GET["page"] == "aliases" ? 1 : 0));
            $newMenu->addChild("uniqueSubMenuItemName2", array("name" => "Distribution Lists", "label" => $lang["module"]["distribution_lists"] ? $lang["module"]["distribution_lists"] : "Distribution Lists", "uri" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=distribution_lists", "order" => 12, "current" => $_GET["page"] == "distribution_lists" ? 1 : 0));
            $newMenu->addChild("uniqueSubMenuItemName4", array("name" => "Domain Aliases", "label" => $lang["module"]["domain_aliases"] ? $lang["module"]["domain_aliases"] : "Domain Aliases", "uri" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=domain_aliases", "order" => 13, "current" => $_GET["page"] == "domain_aliases" ? 1 : 0));
            $url = zimbraemail_getconfigoption("login_link") == "" ? $params["serverhttpprefix"] . "://" . $params["serverip"] : zimbraemail_getconfigoption("login_link");
            $newMenu->addChild("uniqueSubMenuItemName3", array("name" => "Log In To Webmail", "label" => $lang["module"]["webmail"] ? $lang["module"]["webmail"] : "Go To Webmail", "uri" => $url, "order" => 14));
            $child = $newMenu->getChild("uniqueSubMenuItemName3");
            $child->setAttribute("target", "_blank");
            $overviewNav = $primarySidebar->getChild("Service Details Overview");
            if (is_object($overviewNav)) {
                $informationNav = $overviewNav->getChild("Information");
                if (is_object($informationNav)) {
                    $informationNav->setUri("clientarea.php?action=productdetails&id=" . $params["serviceid"]);
                    $informationNav->setAttribute("dataToggleTab", 0);
                }
            }
            $actionsNav = $primarySidebar->getChild("Service Details Actions");
            if (is_object($actionsNav)) {
                $actionsNav->removeChild("Custom Module Button Email Accounts Management");
            }
        });
        $vars["hidebar"] = true;
    }
    try {
        $license_check = zimbra_email_license_165();
        if ($license_check["status"] != "Active") {
            $error_message = isset($license_custom_error_message) ? $license_custom_error_message : "License " . $license_check["status"] . ($license_check["description"] ? ": " . $license_check["description"] : "");
            throw new Exception($error_message);
        }
    } catch (Exception $e) {
        $vars = $params;
        $vars["_assets_dir"] = "modules/servers/zimbraEmail/assets/";
        $vars["lang"] = $lang;
        $vars["_current_page"] = $_GET["page"];
        $vars["serviceid"] = $params["serviceid"];
        $vars["page_errors"] = $lang["license_check_error"];
        $array = array("templatefile" => "templates/mainsite", "breadcrumb" => " > <a href=\"#\">" . $lang["module"]["emailAccountsManagement"] . "</a>", "vars" => $vars);
        if (WHMCS6) {
            $array["templatefile"] = "templates/error";
        }
        return $array;
    }
    $GLOBALS["zimbra_params"] = $params;
    $vars = $vars + $params;
    $vars["link"] = "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management";
    $maindir = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "modules" . DS . "servers"));
    $page = empty($_REQUEST["page"]) ? "mailboxes" : $_REQUEST["page"];
    $function_name = "zimbraEmail_" . $page;
    if (extension_loaded("soap")) {
        $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
        $port = !empty($params["serveraccesshash"]) && 0 < $params["serveraccesshash"] ? (int) $params["serveraccesshash"] : 7071;
        $API = new ZimbraMail($host, $port, $params["serverusername"], $params["serverpassword"]);
        if (!$API->connect()) {
            $vars["page_errors"][] = $lang["module"]["errNoConnection"] . $host;
        }
        if (function_exists($function_name)) {
            $vars_ = call_user_func($function_name, $params, $API, $lang);
            foreach ($vars_ as $k => $v) {
                $vars[$k] = $v;
            }
            $vars["pagefile"] = dirname(__FILE__) . "/templates/" . $page . ".tpl";
        } else {
            $vars["page_errors"][] = $lang["module"]["errNoPage"] ? $lang["module"]["errNoPage"] : "No page";
        }
    } else {
        $vars["page_errors"][] = $lang["module"]["errNoSoap"] ? $lang["module"]["errNoSoap"] : "You do not have PHP SOAP extension installed";
    }
    $errors = isset($_GET["err"]) && $_GET["err"] ? explode(";;;", $_GET["err"]) : array();
    foreach ($errors as $err) {
        $vars["page_errors"][] = $err;
    }
    isset($_GET["err"]) && $_GET["err"] == "" ? $vars["infos"] : "";
    $css_filename = $maindir . "modules" . DS . "servers" . DS . "zimbraEmail" . DS . "style.css";
    if (file_exists($css_filename)) {
        $vars["css"] = file_get_contents($css_filename);
    } else {
        $vars["page_errors"][] = $lang["module"]["errNoCss"] ? $lang["module"]["errNoCss"] : "No CSS file";
    }
    $vars["_assets_dir"] = "modules/servers/zimbraEmail/assets/";
    $vars["lang"] = $lang;
    $vars["_current_page"] = $_GET["page"];
    $vars["serviceid"] = $params["serviceid"];
    $vars["webmail_link"] = zimbraemail_getconfigoption("login_link");
    $vars["product_details"] = zimbraEmail\PdoWrapper::fetch_assoc(zimbra_mysql_safequery("
        SELECT 
            pg.name as product_group, p.name as product_name, h.id as product_id, h.domain as domain
        FROM 
            tblproductgroups pg
        INNER JOIN
            tblproducts p
        ON
            pg.id=p.gid
        INNER JOIN
            tblhosting h
        ON 
            p.id=h.packageid
        WHERE
            h.id=?
        ", array($params["serviceid"])));
    return array("templatefile" => "templates/mainsite", "breadcrumb" => "<a href=\"#\">" . $lang["module"]["emailAccountsManagement"] . "</a>", "vars" => $vars);
}
/**
 * Clientarea - list mailboxes
 * @param array $params
 * @param ZimbraMail $API
 * @return array
 */
function zimbraEmail_mailboxes($params, $API, $lang)
{
    $product = new MG_Zimbra_Product($params["packageid"]);
    $name = $product->getConfig("cos_name");
    $useCoses = $name == "cosQuota" ? true : false;
    if ($useCoses) {
        $cosesModelsArray = $API->accountManager->getCOSModel($product->getAllCOSIdsList());
    } else {
        $filterbyCOS = $product->getConfig("filterAccountsByCOS");
        $cosName = $product->getConfig("cos_name");
    }
    if ($cosName == "zimbraConfigurableOptions") {
        $cosName = zimbraemail_getmoduleoption($params, "cos", $params["pid"]);
    }
    $errors = array();
    if (isset($_POST["username"])) {
        $max_mailboxes = (int) zimbraemail_getmoduleoption($params, "acc_limit", $params["pid"]);
        if (0 < $max_mailboxes) {
            $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
            $mailboxes = zimbraEmail_getMailboxes($mailboxes_fromapi);
            if ($cosName && $cosName != "customMGzimbra" && $filterbyCOS === "on") {
                $cosId = $API->accountManager->getCosId($cosName);
                $mailboxes = array_filter($mailboxes, function ($row) use($cosId) {
                    return $row["zimbraCOSId"] == $cosId;
                });
            }
        }
        $maxDomainQuota = (int) zimbraemail_getmoduleoption($params, "domainMaxSize", $params["pid"]);
        $limitMessage = false;
        if ($maxDomainQuota != -1 && $maxDomainQuota < zimbraGetDomainQuota($params["domain"], $API)) {
            $limitMessage = $lang["mailboxes"]["domainQuotaExided"] ? $lang["mailboxes"]["domainQuotaExided"] : "The domain quota has been exceeded";
        }
        if ($max_mailboxes <= count($mailboxes) && $max_mailboxes != -1) {
            $limitMessage = $lang["mailboxes"]["too_many_mailboxes"] ? $lang["mailboxes"]["too_many_mailboxes"] : "There are too many mailboxes";
        }
        $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
        $mailboxesCOSesGrouped = MailboxesHelper::getAllCosFromUserAccountGroupedById($mailboxes_fromapi);
        $cosId = $_POST["COSId"];
        $coreCosesConfig = $product->getAllCOSes();
        $max = isset($params["configoptions"]["cosQuota_" . $cosId]) ? $params["configoptions"]["cosQuota_" . $cosId] : $coreCosesConfig[$cosId];
        if ($useCoses && $max <= $mailboxesCOSesGrouped[$cosId] && $max != -1) {
            $limitMessage = $lang["mailboxes"]["cosLimitReached"] ? $lang["mailboxes"]["cosLimitReached"] : "There are too many mailboxes with selected quota limit";
        }
        if ($useCoses && !array_key_exists($cosId, $coreCosesConfig)) {
            $limitMessage = $lang["mailboxes"]["noQuotaLeft"] ? $lang["mailboxes"]["noQuotaLeft"] : "There is no quota available to use";
        }
        if ($limitMessage) {
            zimbraEmail_setMessage($limitMessage, false);
        } else {
            $mailbox_name = $_POST["username"] . "@" . $params["domain"];
            $new_account_size = (int) zimbraemail_getmoduleoption($params, "acc_size", $params["pid"]);
            if (strlen($_POST["password"]) < 8) {
                zimbraEmail_setMessage(sprintf($lang["mailboxes"]["errPasswordLength"], 8), false, "mailboxes");
            }
            if ($_POST["password"] && $_POST["password"] == $_POST["password2"]) {
                $mailboxAccountParams = array("givenName" => $_POST["firstname"], "sn" => $_POST["lastname"], "telephoneNumber" => $_POST["phone"] ? "+" . $_POST["country-calling-code-phone"] . "." . $_POST["phone"] : "", "mobile" => $_POST["mobile"], "facsimileTelephoneNumber" => $_POST["fax"], "pager" => $_POST["pager"], "homePhone" => $_POST["homePhone"], "co" => $_POST["country"], "st" => $_POST["st"], "postalCode" => $_POST["postalCode"], "l" => $_POST["city"], "street" => $_POST["street"], "company" => $_POST["company"], "title" => $_POST["title"], "zimbraAccountStatus" => $_POST["status"], "displayName" => $_POST["displayName"], "zimbraMailQuota" => $new_account_size * 1048576);
                $cosId = $_POST["COSId"];
                if ($useCoses && $cosId) {
                    $mailboxAccountParams["zimbraMailQuota"] = $cosesModelsArray[$cosId]["CONFIG"]["zimbraMailQuota"] * 1048576;
                }
                $r = $API->accountManager->createAccount(strtolower($mailbox_name), $_POST["password"], $mailboxAccountParams);
                if (is_a($r, "Exception")) {
                    $message = AlertHelper::alertErrorConverter($r->getMessage(), $lang);
                    zimbraEmail_setMessage("Zimbra Email: " . $message, false);
                } else {
                    $product = new MG_Zimbra_Product($params["packageid"]);
                    $cos = $product->getConfig("cos_name");
                    if ($useCoses && $cosId) {
                        $cos = $cosesModelsArray[$cosId]["NAME"];
                        $attr = array();
                        $res = $API->accountManager->getCOS($cos);
                        $cosAttr = $API->accountManager->parseCOSAttributes($res);
                        $keys = $product->getZimbraAttributes();
                        foreach ($keys as $key) {
                            $attr[$key] = $cosAttr[$key] ? $cosAttr[$key] : "FALSE";
                        }
                        $attr["zimbraMailQuota"] = $cosesModelsArray[$cosId]["CONFIG"]["zimbraMailQuota"] * 1048576;
                    } else {
                        if ($cos == "customMGzimbra") {
                            unset($cos);
                            $attr = $product->loadConfig();
                            foreach ($attr as $key => &$item) {
                                if (preg_match("/zimbra.+/", $key)) {
                                    $item = $item == "on" ? "TRUE" : "FALSE";
                                } else {
                                    unset($attr[$key]);
                                }
                            }
                            $attr["zimbraMailQuota"] = $new_account_size * 1048576;
                        } else {
                            if ($cos == "zimbraConfigurableOptions") {
                                $cos = zimbraemail_getmoduleoption($params, "cos", $params["pid"]);
                            }
                            $attr = array();
                            $r = $API->accountManager->getCOS($cos);
                            $cosAttr = $API->accountManager->parseCOSAttributes($r);
                            $keys = $product->getZimbraAttributes();
                            foreach ($keys as $key) {
                                $attr[$key] = $cosAttr[$key] ?: "FALSE";
                            }
                            $attr["zimbraMailQuota"] = $new_account_size * 1048576;
                        }
                    }
                    if ($cos && $cos != "customMGzimbra") {
                        $cos = $cosesModelsArray[$cos]["NAME"];
                        $API->accountManager->setAccountCos(strtolower($mailbox_name), $cos);
                    }
                    $r = $API->accountManager->modifyAccount(strtolower($mailbox_name), $attr);
                    if (is_a($r, "Exception")) {
                        $message = $r->getMessage();
                        if ($message == "Service Unavailable") {
                            sleep(1);
                            $r = $API->accountManager->modifyAccount(strtolower($mailbox_name), $attr);
                        } else {
                            zimbraEmail_setMessage($message, false);
                        }
                    }
                    zimbraEmail_setMessage($lang["mailboxes"]["success"]);
                }
            } else {
                zimbraEmail_setMessage($lang["mailboxes"]["errPasswordsNotTheSame"], false);
            }
        }
    }
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    $langValidator = $lang["validator"];
    if ($mailboxes_fromapi instanceof Exception) {
        return array("page_errors" => array($mailboxes_fromapi->getMessage()), "lang" => $lang, "langValidator" => $langValidator);
    }
    $mailboxes = zimbraEmail_getMailboxes($mailboxes_fromapi);
    if ($useCoses) {
        $mailboxes = zimbraEmail_getMailboxes($mailboxes_fromapi, $cosesModelsArray);
    }
    if ($cosName && $cosName != "customMGzimbra" && $filterbyCOS === "on") {
        $cosId = $API->accountManager->getCosId($cosName);
        $mailboxes = array_filter($mailboxes, function ($row) use($cosId) {
            return $row["zimbraCOSId"] == $cosId;
        });
    }
    $max_mailboxes = (int) zimbraemail_getmoduleoption($params, "acc_limit");
    $disableAdding = false;
    if (0 < $max_mailboxes && $max_mailboxes <= count($mailboxes)) {
        $disableAdding = true;
    }
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $webmail = empty($params["configoption8"]) ? "https://" . $host . "/zimbra" : $params["configoption8"];
    $vars = array();
    if ($useCoses) {
        $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
        $mailboxesCOSesGrouped = MailboxesHelper::getAllCosFromUserAccountGroupedById($mailboxes_fromapi);
        $coreCosesConfig = $product->getAllCOSes();
        unset($coreCosesConfig["name"]);
        foreach ($coreCosesConfig as $cosId => $value) {
            $chosen = isset($params["configoptions"]["cosQuota_" . $cosId]) ? $params["configoptions"]["cosQuota_" . $cosId] : $coreCosesConfig[$cosId];
            if ($chosen == 0) {
                unset($cosesModelsArray[$cosId]);
            }
            if ($chosen <= $mailboxesCOSesGrouped[$cosId] && $chosen != -1) {
                unset($cosesModelsArray[$cosId]);
            }
        }
        $vars = array("cosuse" => $useCoses, "coses" => $cosesModelsArray);
    }
    return array("mailboxes" => $mailboxes, "main_header_name" => $lang["module"]["manageMailboxes"] ? $lang["module"]["manageMailboxes"] : "Email Accounts", "disableAdding" => $disableAdding, "webmail" => $webmail, "lang" => $lang, "mailboxes_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=mailboxes", "page_errors" => $errors, "infos" => $infos, "vars" => $vars);
}
/**
 * Clientarea - actions on mailboxes - delete and change status
 * @param array $params
 * @param ZimbraMail $API
 * @return array
 */
function zimbraEmail_mailbox_actions($params, $API, $lang)
{
    $mailboxes = array();
    $errors = array();
    if (isset($_POST["mact"])) {
        foreach ($_POST["mailboxes_name"] as $mailbox) {
            $mailboxes[] = $mailbox;
        }
    } else {
        ob_start();
        ob_clean();
        header("location: clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=mailboxes&err=" . $lang["mailboxes"]["noMailboxes"]);
    }
    $act = $_REQUEST["mact"];
    if ($mailboxes || $_POST["account"]) {
        switch ($act) {
            case "delete":
                foreach ($mailboxes as $mailbox) {
                    if (!strripos($mailbox, $params["domain"])) {
                        exit;
                    }
                    $r = $API->accountManager->deleteAccount(strtolower($mailbox));
                    if (is_a($r, "Exception")) {
                        zimbraEmail_setMessage($lang["mailboxes"]["errAccountNotDeleted"] . $mailbox, false, "mailboxes");
                    }
                }
                zimbraEmail_setMessage($lang["mailboxes"]["mailbox_deleted"], true, "mailboxes");
                break;
            case "active":
            case "locked":
            case "maintenance":
            case "closed":
            case "lockout":
            case "pending":
                foreach ($mailboxes as $mailbox) {
                    if (!strripos($mailbox, $params["domain"])) {
                        exit;
                    }
                    $r = $API->accountManager->setAccountStatus(strtolower($mailbox), $act);
                    if (is_a($r, "Exception")) {
                        zimbraEmail_setMessage($lang["mailboxes"]["errCannotChangeStatus"] . $act, false, "mailboxes");
                    }
                }
                zimbraEmail_setMessage($lang["mailboxes"]["action_success"], true, "mailboxes");
                break;
            case "chgpw":
                if (!strripos($_POST["account"], $params["domain"])) {
                    exit;
                }
                if (strlen($_POST["newpass"]) < 8) {
                    zimbraEmail_setMessage(sprintf($lang["mailboxes"]["errPasswordLength"], 8), false, "mailboxes");
                }
                if ($_POST["newpass"] !== $_POST["renewpass"]) {
                    zimbraEmail_setMessage($lang["password_should_match"], false, "mailboxes");
                }
                $r = $API->accountManager->setAccountPassword(strtolower($_POST["account"]), $_POST["newpass"]);
                if (is_a($r, "Exception")) {
                    zimbraEmail_setMessage($lang["mailboxes"]["errCannotChangePassword"], false, "mailboxes");
                }
                zimbraEmail_setMessage($lang["mailboxes"]["pw_change_success"], true, "mailboxes");
                break;
        }
    }
    zimbraEmail_setMessage($lang["mailboxes"]["no_act_selected"], false, "mailboxes");
}
/**
 * Clientarea - edit mailbox, display form and for POST
 * @param array $params
 * @param ZimbraMail $API
 * @return array
 */
function zimbraEmail_edit_mailbox($params, $API, $lang)
{
    $mailbox_name = $_GET["mailbox_name"] ? $_GET["mailbox_name"] : $_POST["mailbox_name"];
    if (!strripos($mailbox_name, $params["domain"])) {
        exit;
    }
    $product = new MG_Zimbra_Product($params["packageid"]);
    $name = $product->getConfig("cos_name");
    $useCoses = $name == "cosQuota" ? true : false;
    $errors = array();
    if (isset($_POST["mailbox_username"])) {
        if ($useCoses) {
            $info = $API->accountManager->getAccountOptions(strtolower($mailbox_name));
            $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
            $mailboxesCOSesGrouped = MailboxesHelper::getAllCosFromUserAccountGroupedById($mailboxes_fromapi);
            $cosId = $_POST["COSId"];
            $coreCosesConfig = $product->getAllCOSes();
            $max = isset($params["configoptions"]["cosQuota_" . $cosId]) ? $params["configoptions"]["cosQuota_" . $cosId] : $coreCosesConfig[$cosId];
            if ($max <= $mailboxesCOSesGrouped[$cosId] && $max != -1 && $info["zimbraCOSId"] != $cosId && $cosId != $info["zimbraCOSId"]) {
                $limitMessage = $lang["mailboxes"]["cosLimitReached"] ? $lang["mailboxes"]["cosLimitReached"] : "There are too many mailboxes with selected quota limit";
            }
        }
        if ($useCoses && !array_key_exists($cosId, $coreCosesConfig)) {
            $limitMessage = $lang["mailboxes"]["noQuotaLeft"] ? $lang["mailboxes"]["noQuotaLeft"] : "There is no quota available to use";
        }
        if ($limitMessage) {
            zimbraEmail_setMessage($limitMessage, false);
        } else {
            $modifyAccountParams = array("givenName" => $_POST["firstname"], "sn" => $_POST["lastname"], "telephoneNumber" => $_POST["phone"] ? "+" . $_POST["country-calling-code-phone"] . "." . $_POST["phone"] : "", "mobile" => $_POST["mobile"], "facsimileTelephoneNumber" => $_POST["fax"], "pager" => $_POST["pager"], "homePhone" => $_POST["homePhone"], "co" => $_POST["area"], "st" => $_POST["st"], "postalCode" => $_POST["postalCode"], "l" => $_POST["city"], "street" => $_POST["street"], "company" => $_POST["company"], "title" => $_POST["title"], "displayName" => $_POST["displayName"]);
            $cosId = $_POST["COSId"];
            if ($useCoses && $cosId) {
                $cosesModelsArray = $API->accountManager->getCOSModel($product->getAllCOSIdsList());
                $modifyAccountParams["zimbraMailQuota"] = $cosesModelsArray[$cosId]["CONFIG"]["zimbraMailQuota"] * 1048576;
            }
            $r = $API->accountManager->modifyAccount(strtolower($mailbox_name), $modifyAccountParams);
            if (is_a($r, "Exception")) {
                $errors[] = $lang["mailboxes"]["errErrorEditingAccount"] . $mailbox_name;
            } else {
                if ($cosId && $useCoses) {
                    $cos = $cosesModelsArray[$cosId]["NAME"];
                    $r = $API->accountManager->getCOS($cos);
                    $cosAttr = $API->accountManager->parseCOSAttributes($r);
                    $keys = $product->getZimbraAttributes();
                    foreach ($keys as $key) {
                        $attr[$key] = $cosAttr[$key] ? $cosAttr[$key] : "FALSE";
                    }
                    $attr["zimbraMailQuota"] = $cosesModelsArray[$cosId]["CONFIG"]["zimbraMailQuota"] * 1048576;
                    $API->accountManager->setAccountCos(strtolower($mailbox_name), $cosesModelsArray[$cosId]["NAME"]);
                    $API->accountManager->modifyAccount(strtolower($mailbox_name), $attr);
                }
            }
            if ($_POST["password"] && $_POST["password"] == $_POST["confirm"]) {
                $r = $API->accountManager->setAccountPassword(strtolower($mailbox_name), $_POST["password"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            if ($errors) {
                $zResult = $lang["mailboxes"]["savingFalied"] ? $lang["mailboxes"]["savingFalied"] : "An error has occurred. Changes cannot be saved";
            } else {
                $zResult = $lang["mailboxes"]["savedSucces"] ? $lang["mailboxes"]["savedSucces"] : "Changes have been saved successfully";
            }
            $zType = $errors ? false : true;
            zimbraEmail_setMessage($zResult, $zType, "mailboxes");
            exit;
        }
    }
    $info = $API->accountManager->getAccountOptions(strtolower($mailbox_name));
    $vars = array();
    if ($useCoses) {
        $usedCosId = $info["zimbraCOSId"];
        $cosesModelsArray = $API->accountManager->getCOSModel($product->getAllCOSIdsList());
        $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
        $mailboxesCOSesGrouped = MailboxesHelper::getAllCosFromUserAccountGroupedById($mailboxes_fromapi);
        $coreCosesConfig = $product->getAllCOSes();
        unset($coreCosesConfig["name"]);
        foreach ($coreCosesConfig as $cosId => $value) {
            $chosen = isset($params["configoptions"]["cosQuota_" . $cosId]) ? $params["configoptions"]["cosQuota_" . $cosId] : $coreCosesConfig[$cosId];
            if ($cosId == $usedCosId) {
                $chosen += 1;
            }
            if ($chosen == 0) {
                unset($cosesModelsArray[$cosId]);
            }
            if ($chosen <= $mailboxesCOSesGrouped[$cosId] && $chosen != -1) {
                unset($cosesModelsArray[$cosId]);
            }
        }
        $vars = array("cosuse" => $useCoses, "coses" => $cosesModelsArray);
    }
    $mailbox_info = array("mailbox" => substr($mailbox_name, 0, strrpos($mailbox_name, "@")), "firstname" => $info["givenName"], "lastname" => $info["sn"], "status" => $info["zimbraAccountStatus"], "quota" => $info["zimbraMailQuota"], "cosQuota" => $info["zimbraMailQuota"] / 1024 / 1024, "phone" => $info["telephoneNumber"], "mobile" => $info["mobile"], "fax" => $info["facsimileTelephoneNumber"], "pager" => $info["pager"], "homePhone" => $info["homePhone"], "country" => $info["co"], "st" => $info["st"], "postalCode" => $info["postalCode"], "city" => $info["l"], "street" => $info["street"], "company" => $info["company"], "title" => $info["title"], "displayName" => $info["displayName"]);
    $host = $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
    $webmail = empty($params["configoption8"]) ? "https://" . $host . "/zimbra?username=" . $mailbox_name : $params["configoption8"] . "?username=" . $mailbox_name;
    return array("mailbox" => $mailbox_info, "page_errors" => $errors, "main_header_name" => $lang["module"]["manageMailboxes"] ? $lang["module"]["manageMailboxes"] : "Email Accounts", "webmail" => $webmail, "lang" => $lang, "vars" => $vars);
}
/**
 * Clientarea - list mailboxes and aliases. When there is POST request it removes aliases
 * @param array $params
 * @param ZimbraMail $API
 * @return array
 */
function zimbraEmail_aliases($params, $API, $lang)
{
    $errors = array();
    $max_aliases = (int) zimbraemail_getmoduleoption($params, "alias_limit", $params["pid"]);
    if ($_GET["aliasdel"] == "success") {
        $infos[] = $lang["aliases"]["alias_del_success"] ? $lang["aliases"]["alias_del_success"] : "Email alias has been deleted successfully";
    }
    $mailboxes = array();
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    if ($mailboxes_fromapi instanceof Exception) {
        return array("page_errors" => array($mailboxes_fromapi->getMessage()), "lang" => $lang);
    }
    if (isset($mailboxes_fromapi["ID"])) {
        $mailboxes_fromapi = array($mailboxes_fromapi);
    }
    foreach ($mailboxes_fromapi as $mailbox) {
        $mailboxes[] = $mailbox["NAME"];
    }
    if (isset($_POST["alias_name"]) && $_POST["alias_name"] && isset($_POST["mailbox"]) && in_array($_POST["mailbox"], $mailboxes)) {
        if (0 < $max_aliases && $max_aliases <= $API->countDomainAliases($params["domain"]) || $max_aliases == 0) {
            zimbraEmail_setMessage($lang["aliases"]["too_many"], false);
        } else {
            $r = $API->accountManager->addAccountAlias(strtolower($_POST["mailbox"]), strtolower($_POST["alias_name"] . "@" . $params["domain"]));
            if (is_a($r, "Exception")) {
                $message = AlertHelper::alertErrorConverter($r->getMessage(), $lang);
                zimbraEmail_setMessage($message, false);
            } else {
                zimbraEmail_setMessage($lang["aliases"]["add_alias_success"]);
            }
        }
    }
    $aliases = array();
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    if ($mailboxes_fromapi instanceof Exception) {
        return array("page_errors" => array($mailboxes_fromapi->getMessage()), "lang" => $lang);
    }
    if (isset($mailboxes_fromapi["ID"])) {
        $mailboxes_fromapi = array($mailboxes_fromapi);
    }
    foreach ($mailboxes_fromapi as $k => $m) {
        foreach ($m["A"] as $v) {
            if ($v["N"] == "zimbraMailAlias") {
                $aliases[] = array("name" => $m["NAME"], "alias" => $v["DATA"]);
            }
        }
    }
    if (!empty($_POST["alias"])) {
        foreach ($aliases as $al) {
            if ($al["alias"] == $_POST["alias"]) {
                $r = $API->accountManager->removeAccountAlias(strtolower($al["name"]), strtolower($_POST["alias"]));
                if (is_a($r, "Exception")) {
                    zimbraEmail_setMessage($r->getMessage(), false);
                } else {
                    zimbraEmail_setMessage($lang["aliases"]["alias_del_success"]);
                }
            }
        }
        zimbraEmail_setMessage($lang["aliases"]["alias_del_error"], false);
    }
    return array("aliases" => $aliases, "main_header_name" => $lang["module"]["aliases"] ? $lang["module"]["aliases"] : "Email Aliases", "lang" => $lang, "aliases_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=aliases", "page_errors" => $errors, "infos" => $infos, "mailboxes" => $mailboxes, "product_id" => $params["serviceid"]);
}
/**
 * Helper function for language array
 * @return array
 */
function zimbraEmail_getLang()
{
    $maindir = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "modules" . DS . "servers"));
    $language_dir = $maindir . "modules" . DS . "servers" . DS . "zimbraEmail" . DS . "lang" . DS;
    $language = "";
    if (isset($_SESSION["language"])) {
        $language = strtolower($_SESSION["language"]);
    } else {
        if (isset($_SESSION["Language"])) {
            $language = strtolower($_SESSION["Language"]);
        } else {
            if (isset($_SESSION["uid"])) {
                $res = zimbraEmail\PdoWrapper::fetch_assoc(zimbra_mysql_safequery("SELECT language FROM tblclients WHERE id=?", array($_SESSION["uid"])));
                $language = $res["language"];
            } else {
                if (isset($_SESSION["adminid"])) {
                    $res = zimbraEmail\PdoWrapper::fetch_assoc(zimbra_mysql_safequery("SELECT language FROM tbladmins WHERE id=?", array($_SESSION["adminid"])));
                    $language = $res["language"];
                }
            }
        }
    }
    if (!$language) {
        $res = zimbraEmail\PdoWrapper::fetch_assoc(zimbra_mysql_safequery("SELECT value FROM tblconfiguration WHERE setting=\"language\""));
        $language = $res["value"];
    }
    if (!$language) {
        $language = "english";
    }
    if (file_exists($language_dir . strtolower($language) . ".php")) {
        include $language_dir . strtolower($language) . ".php";
    } else {
        include $language_dir . "english.php";
    }
    return $lang;
}
/**
 * Returns hostname or IP address
 * @param array $params
 * @return string
 */
function zimbraEmail_getHost($params)
{
    return $params["serverip"] ? $params["serverip"] : $params["serverhostname"];
}
function zimbraEmail_distribution_lists($params, $API, $lang)
{
    if ($_GET["edit"] == "success") {
        $infos[] = $lang["distribution_lists"]["list_edited"] ? $lang["distribution_lists"]["list_edited"] : "Distribution list has been edited successfully";
    }
    $distribution_lists = array();
    $dist_list_limit = (int) zimbraemail_getmoduleoption($params, "dist_list_limit", $params["pid"]);
    $r = $API->listManager->getAllDistributionLists(strtolower($params["domain"]));
    if (is_a($r, "Exception")) {
        zimbraEmail_setMessage($r->getMessage(), false);
    } else {
        $dist_list_current = count($r);
    }
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    if ($mailboxes_fromapi instanceof Exception) {
        zimbraEmail_setMessage($mailboxes_fromapi->getMessage());
        return array("page_errors" => array($mailboxes_fromapi->getMessage()), "lang" => $lang);
    }
    $mailboxes = zimbraEmail_getMailboxes($mailboxes_fromapi);
    $errors = array();
    if (isset($_POST["add_dist_list"])) {
        if ($dist_list_current < $dist_list_limit) {
            $r = $API->listManager->createDistributionList(strtolower($_POST["email_address"] . "@" . $params["domain"]), $_POST["dynamic_group"] == "on" ? 1 : 0, array("displayName" => $_POST["display_name"], "description" => $_POST["description"], "zimbraDistributionListSubscriptionPolicy" => $_POST["subscription_requests"], "zimbraDistributionListUnsubscriptionPolicy" => $_POST["unsubscription_requests"], "zimbraDistributionListSendShareMessageToNewMembers" => $_POST["notify_about_shares"] == "on" ? "TRUE" : "FALSE", "zimbraHideInGal" => $_POST["hide_in_GAL"] == "on" ? "TRUE" : "FALSE", "zimbraMailStatus" => $_POST["can_receive_mail"] == "on" ? "enabled" : "disabled", "zimbraPrefReplyToEnabled" => $_POST["set_reply_to_field"] == "on" ? "TRUE" : "FALSE", "zimbraPrefReplyToDisplay" => $_POST["reply_to_display_name"], "zimbraPrefReplyToAddress" => $_POST["reply_to_address"]));
            if (is_a($r, "Exception")) {
                zimbraEmail_setMessage($r->getMessage(), false);
            }
            $list_id = $API->listManager->getLastAddedListID();
            if ($_POST["member"]) {
                foreach ($_POST["member"] as $key => $val) {
                    $_POST["member"][$key] = strtolower($val);
                }
                $r = $API->listManager->addDistributionListMember(strtolower($list_id), $_POST["member"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            $owners = array_filter($_POST["owners"]);
            foreach ($_POST["owners"] as $key => $val) {
                $_POST["owners"][$key] = strtolower($val);
            }
            if (!empty($owners)) {
                $r = $API->listManager->addDistributionListOwners(strtolower($list_id), $_POST["owners"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            $aliases = array_filter($_POST["aliases"]);
            if (!empty($aliases)) {
                foreach ($_POST["aliases"] as $alias) {
                    $r = $API->listManager->addDistributionListAlias(strtolower($list_id), strtolower($alias));
                    if (is_a($r, "Exception")) {
                        $errors[] = $r->getMessage();
                    }
                }
            }
            if (!empty($errors)) {
                zimbraEmail_setMessage($lang["distribution_lists"]["list_added_w_errors"] . implode("<br>", $errors));
            }
            zimbraEmail_setMessage($lang["distribution_lists"]["list_added"]);
        } else {
            zimbraEmail_setMessage($lang["distribution_lists"]["limit"], false);
        }
    }
    if (!0) {
        if (isset($_POST["list_to_delete"])) {
            $r = $API->listManager->deleteDistributionList(strtolower($_POST["list_to_delete"]));
            if (is_a($r, "Exception")) {
                zimbraEmail_setMessage($r->getMessage(), false);
            }
            zimbraEmail_setMessage($lang["distribution_lists"]["list_deleted"]);
        }
        $r = $API->listManager->getAllDistributionLists(strtolower($params["domain"]));
        if (is_a($r, "Exception")) {
            zimbraEmail_setMessage($r->getMessage(), false);
        } else {
            foreach ($r as $list) {
                $distribution_lists[] = array("ID" => $list["id"], "name" => $list["name"], "display_name" => $list["displayName"], "status" => ucfirst($list["zimbraMailStatus"]));
            }
        }
        return array("distribution_lists" => $distribution_lists, "main_header_name" => $lang["module"]["distribution_lists"] ? $lang["module"]["distribution_lists"] : "Distribution Lists", "lang" => $lang, "distribution_lists_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=distribution_lists", "page_errors" => $errors, "infos" => $infos, "mailboxes" => $mailboxes, "serviceid" => $params["serviceid"]);
    }
}
function zimbraEmail_distribution_list_edit($params, $API, $lang)
{
    $list = $_GET["list"];
    $mailboxes_fromapi = $API->accountManager->getAllAccounts(strtolower($params["domain"]));
    $dist_lists = $API->listManager->getAllDistributionLists(strtolower($params["domain"]));
    $current_list = $API->listManager->getDistributionList(strtolower($list));
    $accounts = zimbraEmail_getMailboxes($mailboxes_fromapi);
    $mailbox_items = $mailbox_to = $mailbox_from = $mailbox_to_external = $owners = array();
    $ids = array();
    foreach ($dist_lists as $item) {
        $ids[] = $item["id"];
    }
    if (!in_array($list, $ids)) {
        exit;
    }
    foreach ($accounts as $m_item) {
        $mailbox_items[] = $m_item["name"];
    }
    foreach ($mailbox_items as $from_or_to) {
        if (in_array($from_or_to, $current_list["members"])) {
            $mailbox_to[] = $from_or_to;
        } else {
            $mailbox_from[] = $from_or_to;
        }
    }
    foreach ($current_list["members"] as $imember) {
        if (!in_array($imember, $mailbox_items)) {
            $mailbox_to_external[] = $imember;
        }
    }
    foreach ($current_list["owners"] as $one) {
        $owners[] = $one["NAME"];
    }
    $aliases = $current_list["zimbraMailAlias"];
    $listname = explode("@", $current_list["name"]);
    $first_owner = $current_list["owners"][0];
    unset($current_list["owners"][0]);
    $first_alias = $current_list["zimbraMailAlias"][0];
    unset($current_list["zimbraMailAlias"][0]);
    do {
        if (isset($_POST["edit_dist_list"])) {
            $datas = array("displayName" => $_POST["display_name"], "description" => $_POST["description"], "zimbraDistributionListSubscriptionPolicy" => $_POST["subscription_requests"], "zimbraDistributionListUnsubscriptionPolicy" => $_POST["unsubscription_requests"], "zimbraDistributionListSendShareMessageToNewMembers" => $_POST["notify_about_shares"] == "on" ? "TRUE" : "FALSE", "zimbraHideInGal" => $_POST["hide_in_GAL"] == "on" ? "TRUE" : "FALSE", "zimbraMailStatus" => $_POST["can_receive_mail"] == "on" ? "enabled" : "disabled", "zimbraPrefReplyToEnabled" => $_POST["set_reply_to_field"] == "on" ? "TRUE" : "FALSE", "zimbraPrefReplyToDisplay" => $_POST["reply_to_display_name"], "zimbraPrefReplyToAddress" => $_POST["reply_to_address"]);
            if ($_POST["dynamic_group"]) {
                unset($datas["zimbraDistributionListSendShareMessageToNewMembers"]);
            }
            $r = $API->listManager->modifyDistributionList(strtolower($list), $datas);
            if (is_a($r, "Exception")) {
                $errors[] = $r->getMessage();
                break;
            }
            $array_members = array_filter($_POST["member"]);
            $array_owners = array_filter($_POST["owners"]);
            $array_aliases = array_filter($_POST["aliases"]);
            $action_members = zimbraEmail_getDifferences($array_members, (array) $current_list["members"]);
            $action_owners = zimbraEmail_getDifferences($array_owners, (array) $owners);
            $action_aliases = zimbraEmail_getDifferences($array_aliases, (array) $aliases);
            if (!empty($action_members["add"])) {
                foreach ($action_members["add"] as $key => $val) {
                    $action_members["add"][$key] = strtolower($val);
                }
                $r = $API->listManager->addDistributionListMember(strtolower($list), $action_members["add"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            if (!empty($action_members["rem"])) {
                foreach ($action_members["rem"] as $key => $val) {
                    $action_members["rem"][$key] = strtolower($val);
                }
                $r = $API->listManager->removeDistributionListMember(strtolower($list), $action_members["rem"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            if (!empty($action_owners["add"])) {
                foreach ($action_owners["add"] as $key => $val) {
                    $action_owners["add"][$key] = strtolower($val);
                }
                $r = $API->listManager->addDistributionListOwners(strtolower($list), $action_owners["add"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            if (!empty($action_owners["rem"])) {
                foreach ($action_owners["rem"] as $key => $val) {
                    $action_owners["rem"][$key] = strtolower($val);
                }
                $r = $API->listManager->removeDistributionListOwners(strtolower($list), $action_owners["rem"]);
                if (is_a($r, "Exception")) {
                    $errors[] = $r->getMessage();
                }
            }
            if (!empty($action_aliases["add"])) {
                foreach ($action_aliases["add"] as $alias) {
                    $r = $API->listManager->addDistributionListAlias(strtolower($list), strtolower($alias));
                    if (is_a($r, "Exception")) {
                        $errors[] = $r->getMessage();
                    }
                }
            }
            if (!empty($action_aliases["rem"])) {
                foreach ($action_aliases["rem"] as $alias) {
                    $r = $API->listManager->removeDistributionListAlias(strtolower($list), strtolower($alias));
                    if (is_a($r, "Exception")) {
                        $errors[] = $r->getMessage();
                    }
                }
            }
            if (empty($errors)) {
                header("Location: clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=distribution_lists&edit=success");
                exit;
            }
            $infos[] = $lang["distribution_lists"]["list_edited_w_errors"] . implode("<br>", $errors);
            unset($errors);
        }
    } while (0);
    return array("distribution_lists_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=distribution_lists", "page_errors" => $errors, "infos" => $infos, "mailbox_from" => $mailbox_from, "mailbox_to" => $mailbox_to, "mailbox_to_external" => $mailbox_to_external, "dist_list_edit_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=distribution_list_edit&list=" . $list, "owners" => $current_list["owners"], "list" => $current_list, "list_name" => $listname[0], "members" => $current_list["members"], "first_alias" => $first_alias, "first_owner" => $first_owner);
}
function zimbraEmail_getMailboxes($mailboxes_fromapi, $cosesModelsArray = false)
{
    $mailboxes = array();
    if (isset($mailboxes_fromapi["ID"])) {
        $mailboxes_fromapi = array($mailboxes_fromapi);
    }
    foreach ($mailboxes_fromapi as $k => $m) {
        if (strpos($m["NAME"], "galsync@") !== false) {
            continue;
        }
        $mailboxes[$k]["id"] = $m["ID"];
        $mailboxes[$k]["name"] = $m["NAME"];
        foreach ($m["A"] as $v) {
            if ($v["N"] == "zimbraCreateTimestamp") {
                $tmpDate = strstr($v["DATA"], ".", true);
                $mailboxes[$k]["zimbraCreateTimestamp"] = isset($v["DATA"]) ? date("d/m/Y", strtotime($tmpDate ? $tmpDate : substr($v["DATA"], 0, 8))) : NULL;
            }
            if ($v["N"] == "zimbraLastLogonTimestamp") {
                $tmpDate = strstr($v["DATA"], ".", true);
                $mailboxes[$k]["zimbraLastLogonTimestamp"] = isset($v["DATA"]) ? date("d/m/Y", strtotime($tmpDate ? $tmpDate : substr($v["DATA"], 0, 8))) : NULL;
            }
            if ($v["N"] == "zimbraMailQuota") {
                $mailboxes[$k]["zimbraMailQuota"] = isset($v["DATA"]) ? $v["DATA"] / 1048576 . " MB" : "unlimited";
            }
            if ($v["N"] == "zimbraAccountStatus") {
                $mailboxes[$k]["zimbraAccountStatus"] = ucfirst($v["DATA"]);
            }
            if ($v["N"] == "zimbraCOSId") {
                $mailboxes[$k]["zimbraCOSId"] = $v["DATA"];
                if ($cosesModelsArray) {
                    $quota = $cosesModelsArray[$mailboxes[$k]["zimbraCOSId"]]["CONFIG"]["zimbraMailQuota"];
                    $mailboxes[$k]["zimbraMailQuota"] = isset($quota) ? $quota . " MB" : $mailboxes[$k]["zimbraMailQuota"];
                }
            }
        }
    }
    return $mailboxes;
}
function zimbraEmail_getDifferences($new, $old)
{
    $ret = array();
    $ret["add"] = array_diff($new, $old);
    $ret["rem"] = array_diff($old, $new);
    return $ret;
}
function zimbraEmail_setMessage($message, $success = true, $page = "", $output = array())
{
    if ($_REQUEST["ajax"] == 1) {
        ob_start();
        ob_clean();
        $json_array = array("result" => 1, "action" => array("info" => $success ? zimbraEmail_getInfoHTML($message) : "", "error" => !$success ? zimbraEmail_getErrorHTML($message) : "", "output" => $output));
        if (isset($_POST["_refresh"]) && $success) {
            $page = $page ?: $_REQUEST["page"];
            $_GET = $_REQUEST = $_POST = array("action" => "productdetails", "id" => $GLOBALS["zimbra_params"]["serviceid"], "modop" => "custom", "a" => "management", "page" => $page);
            $result = zimbraemail_management($GLOBALS["zimbra_params"]);
            include dirname(__FILE__) . DS . "classes" . DS . "class.CustomPage.php";
            $page = new MG_CP_CustomPage(dirname(__FILE__) . DS . "templates");
            $json_array["action"]["refreshhtml"] = $page->build($_REQUEST["page"] . ".tpl", $result["vars"]);
        }
        echo json_encode($json_array);
        exit;
    }
}
function zimbraEmail_getInfoHTML($info)
{
    return "<div class=\"alert alert-success\" role=\"alert\">" . "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\"></span></button>" . "<p>" . $info . "</p>" . "</div>";
}
function zimbraEmail_getErrorHTML($error)
{
    return "<div class=\"alert alert-danger\" role=\"alert\">" . "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\"></span></button>" . "<p>" . $error . "</p>" . "</div>";
}
function zimbraGetDomainQuota($name, &$API)
{
    $accounts = $API->domainManager->getDomainQuota($name);
    $sumary = 0;
    foreach ($accounts as $value) {
        $sumary += (double) $value["USED"];
    }
    return round($sumary / 1048576, 2);
}
/**
 * Clientarea - list mailboxes and aliases. When there is POST request it removes aliases
 * @param array $params
 * @param ZimbraMail $API
 * @return array
 */
function zimbraEmail_domain_aliases($params, $API, $lang)
{
    $domainId = $API->domainManager->getDomainId($params["domain"]);
    if (isset($_POST["alias_name"])) {
        $max_domains_aliases = (int) zimbraemail_getmoduleoption($params, "domain_alias_limit", $params["pid"]);
        $aliasesCount = DomainAliasesHelper::countExistingAliasesInDomains($domainId, $API->domainManager->getAllDomains());
        if ($max_domains_aliases <= $aliasesCount && $max_domains_aliases != -1) {
            zimbraemail_setmessage($lang["domain_aliases"]["maximum_aliases"], false);
        }
        $attr = array("zimbraDomainAliasTargetId" => $domainId, "zimbraDomainType" => "alias", "description" => $_POST["alias_description"] == "" ? $lang["domain_aliases"]["descriptionToApi"] . " " . $params["domain"] : $_POST["alias_description"]);
        $r = $API->domainManager->createDomain($_POST["alias_name"], $attr);
        if (is_a($r, "Exception")) {
            zimbraemail_setmessage($r->getMessage(), false);
        }
        zimbraemail_setmessage($lang["domain_aliases"]["add_alias_success"]);
    }
    if (isset($_POST["alias"])) {
        $id = $API->domainManager->getDomainId($_POST["alias"]);
        $r = $API->domainManager->deleteDomain($id);
        if (is_a($r, "Exception")) {
            zimbraemail_setmessage($r->getMessage(), false);
        } else {
            zimbraemail_setmessage($lang["domain_aliases"]["alias_del_success"]);
        }
        zimbraemail_setmessage($lang["domain_aliases"]["alias_del_error"], false);
    }
    $domainAliases = DomainAliasesHelper::convertDomainsAliasesToDisplay($domainId, $API->domainManager->getAllDomains());
    return array("domain_aliases" => $domainAliases, "main_header_name" => $lang["module"]["domain_aliases"] ? $lang["module"]["domain_aliases"] : "Domain Aliases", "lang" => $lang, "domain_aliases_link" => "clientarea.php?action=productdetails&id=" . $params["serviceid"] . "&modop=custom&a=management&page=domain_aliases", "product_id" => $params["serviceid"]);
}

?><?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
7X39U+Q20vDvqcr/4PUzz2bmMgywSTY5vjYE2A1X
LHDA3r13sI/LMzbg7Iw9sT2w5I7//e1uSbZkS/4Y
BrJJberqlrGkVqvVarVa3a1XWxuvptfTL7/48ovg
0uo+8/zLIPS9rr17avd61n++/MKC/9hX+ti3dvdP
9nbOjk7+5ZzuHW+fbMOfvfUvv7j/8ous8T9/frtz
+tLuWVGcteXf+laQJH7a7bw5OPpp++D03N45Ony9
/8Z+f27/w4+TIArt9z3r+XPLfjlYGazY1samVV15
vdjz95qev2/T8/fNe0aqcbjOyd7f3+2dnp3bjucP
Z1ccmua7tblp2eksDgFKRuQO0PP0dP/o8NyeXDm/
BZNh7OYNrFWkseWPE180eGDXl5d53w36P3x3cLDO
at/TbMvdm1vmTOTHcRQ7sT+N4jQIr7rfvPj+5fc9
DjIIAwdB2V6QTMfunUO1E5i01V5p4EVIK/VQylXG
0VWhE6WY9QGVoNQL4tCd+F3Heb1/sOc4PWtg7Z7C
/xGQy2DsD7AiXwW0jvyPqR8ilwAI10POTCJ3avNZ
ycg1CzycKjGu0XVk2duhtYedW0ej0Sz2vYF1PPZd
GP1OFKbuKLW2vUkQ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xbZkeVgxBxC14hR6ZaEx86WEhpkGQZGYzdJ
5MQE9GGwQ/gfQ4dyeG1xLvgrSzvHTl6/a+4rhVP6
GPbh8qlXYnTxGB+Sl7PGdToZMzGP/S5tDWfB2OuW
5p9CidPpGBcpo+A5ywBo8jj1R9eRRT2DxMLTsISG
3ER1M6oQf/mywjVYCvu1N7zgxiICb17YlEnKov9f
4kx/YVtxNPZF4YW9hfMCZ/RZmkJv6d0Uy9gvqCsg
0eOY8BuvYZfgEDcJ8g4AxkYydfFEHrhL14Hn+SGU
oVyDoueoKiXrG8tYhVcUUJN4KQrHdwiAFy+znjlS
U/qXJanG38tTXrAMo9yyqzcKSYKQxGlBKw/zfMd/
RFKxXOpNafXG54neaBfvdlg63Odo85M2VMlNkFkD
mWei4nRYhJLtpsls4sa4taysV7rPlRNFi6Zfb1pd
L5oNx1DMqp3b7073doveVHxWY4AJK5c3zrTavvXi
T5Kck1G/aY5OVnvfq508zChecj1db5TLsGhR+Mhx
TObMAiqPsCb4XXaj20Fugq6U3IUiqR6x2h5mnsAX
WljZfsiqAhEFmfpGKqHfLq9dUje0Y8aEigpmIuNi
saI+AbdMKqD8pBAEoTABy2v7MZjMJvkncyxK9iJJ
rqVwp5+ccmdujLsNV09y8ig18fEBpnswO1mFu5zI
nCU5zdG5zJbyNpTGJFU/i7anAduALW2wtvQOpKYv
hV9i02LgMeT0UcvqmgdK2oZ+lGe0QehHMc9Ac7ao
SMpYnai0tK6DZjKkAKMR3XnYEqd74D05fSviwFqQ
ujoj3UMmsVnaOb5MtzOha5CElFSUCzNemHkqzisK
C5cy6hAkGbLdMv9dkRjaSJxiHYzCoW+V6fDUZk99
EaLi3Cqp3ZdfvNraePX/AQ==
'))); ?>

Function Calls

gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 cb24a28e244812d3a06363dd99a851e8
Eval Count 1
Decode Time 134 ms