$trafficLimitBytes = $domainProperties['domain_traffic_limit'] * 1048576; $diskspaceLimitBytes = $domainProperties['domain_disk_limit'] * 1048576; // Get usages in percent $trafficUsagePercent = make_usage_vals($trafficUsageBytes, $trafficLimitBytes); $diskspaceUsagePercent = make_usage_vals($domainProperties['domain_disk_usage'], $diskspaceLimitBytes); // Get Email quota info list($quota, $quotaLimit) = reseller_gen_mail_quota_limit_mgs($domainAdminId); # Features $trEnabled = '<span style="color:green">' . tr('Enabled') . '</span>'; $trDisabled = '<span style="color:red">' . tr('Disabled') . '</span>'; $tpl->assign(array('DOMAIN_ID' => $domainId, 'VL_DOMAIN_NAME' => tohtml(decode_idna($domainProperties['domain_name'])), 'VL_DOMAIN_IP' => tohtml($domainIpAddr), 'VL_STATUS' => $domainStatus, 'VL_PHP_SUPP' => $domainProperties['domain_php'] == 'yes' ? $trEnabled : $trDisabled, 'VL_PHP_EDITOR_SUPP' => $domainProperties['phpini_perm_system'] == 'yes' ? $trEnabled : $trDisabled, 'VL_CGI_SUPP' => $domainProperties['domain_cgi'] == 'yes' ? $trEnabled : $trDisabled, 'VL_DNS_SUPP' => $domainProperties['domain_dns'] == 'yes' ? $trEnabled : $trDisabled, 'VL_EXT_MAIL_SUPP' => $domainProperties['domain_external_mail'] == 'yes' ? $trEnabled : $trDisabled, 'VL_SOFTWARE_SUPP' => $domainProperties['domain_software_allowed'] == 'yes' ? $trEnabled : $trDisabled, 'VL_BACKUP_SUP' => translate_limit_value($domainProperties['allowbackup']), 'VL_TRAFFIC_PERCENT' => $trafficUsagePercent, 'VL_TRAFFIC_USED' => bytesHuman($trafficUsageBytes), 'VL_TRAFFIC_LIMIT' => bytesHuman($trafficLimitBytes), 'VL_DISK_PERCENT' => $diskspaceUsagePercent, 'VL_DISK_USED' => bytesHuman($domainProperties['domain_disk_usage']), 'VL_DISK_LIMIT' => bytesHuman($diskspaceLimitBytes), 'VL_MAIL_ACCOUNTS_USED' => get_domain_running_mail_acc_cnt($domainId), 'VL_MAIL_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_mailacc_limit']), 'VL_MAIL_QUOTA_USED' => $quota, 'VL_MAIL_QUOTA_LIMIT' => $domainProperties['domain_mailacc_limit'] != '-1' ? $quotaLimit : tr('Disabled'), 'VL_FTP_ACCOUNTS_USED' => get_customer_running_ftp_acc_cnt($domainAdminId), 'VL_FTP_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_ftpacc_limit']), 'VL_SQL_DB_ACCOUNTS_USED' => get_domain_running_sqld_acc_cnt($domainId), 'VL_SQL_DB_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_sqld_limit']), 'VL_SQL_USER_ACCOUNTS_USED' => get_domain_running_sqlu_acc_cnt($domainId), 'VL_SQL_USER_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_sqlu_limit']), 'VL_SUBDOM_ACCOUNTS_USED' => get_domain_running_sub_cnt($domainId), 'VL_SUBDOM_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_subd_limit']), 'VL_DOMALIAS_ACCOUNTS_USED' => get_domain_running_als_cnt($domainId), 'VL_DOMALIAS_ACCOUNTS_LIMIT' => translate_limit_value($domainProperties['domain_alias_limit']))); } /*********************************************************************************************************************** * Main */ require 'imscp-lib.php'; iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart); check_login('reseller'); if (!isset($_GET['domain_id'])) { redirectTo('manage_users.php'); } $tpl = new iMSCP_pTemplate(); $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/domain_details.tpl', 'page_messages' => 'layout')); $tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Overview / Domain Details'), 'TR_DOMAIN_DETAILS' => tr('Domain details'), 'TR_DOMAIN_NAME' => tr('Domain name'), 'TR_DOMAIN_IP' => tr('Domain IP'), 'TR_STATUS' => tr('Status'), 'TR_PHP_SUPP' => tr('PHP'), 'TR_PHP_EDITOR_SUPP' => tr('PHP Editor'), 'TR_CGI_SUPP' => tr('CGI'), 'TR_DNS_SUPP' => tr('Custom DNS records'), 'TR_EXT_MAIL_SUPP' => tr('Ext. mail server'), 'TR_BACKUP_SUPP' => tr('Backup'), 'TR_TRAFFIC' => tr('Traffic'), 'TR_DISK' => tr('Disk'), 'TR_FEATURE' => tr('Feature'), 'TR_USED' => tr('Used'), 'TR_LIMIT' => tr('Limit'), 'TR_SUBDOM_ACCOUNTS' => tr('Subdomains'), 'TR_DOMALIAS_ACCOUNTS' => tr('Domain aliases'), 'TR_MAIL_ACCOUNTS' => tr('Email accounts'), 'TR_MAIL_QUOTA' => tr('Email quota'), 'TR_FTP_ACCOUNTS' => tr('FTP accounts'), 'TR_SQL_DB_ACCOUNTS' => tr('SQL databases'), 'TR_SQL_USER_ACCOUNTS' => tr('SQL users'), 'TR_UPDATE_DATA' => tr('Submit changes'), 'TR_SOFTWARE_SUPP' => tr('Software installer'), 'TR_EDIT' => tr('Edit'), 'TR_BACK' => tr('Back'))); generateNavigation($tpl); reseller_generatePage($tpl, $_GET['domain_id']); generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl)); $tpl->prnt(); unsetMessages();
} redirectTo('users.php'); } /*********************************************************************************************************************** * Main */ // Include core library require 'imscp-lib.php'; iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart); /** @var $cfg iMSCP_Config_Handler_File */ $cfg = iMSCP_Registry::get('config'); check_login('reseller'); if (isset($_REQUEST['edit_id'])) { $adminId = intval($_GET['edit_id']); $tpl = new iMSCP_pTemplate(); $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/user_edit.tpl', 'page_message' => 'layout', 'ip_entry' => 'page')); $tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Overview / Edit Customer'), 'TR_CORE_DATA' => tr('Core data'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_REP_PASSWORD' => tr('Repeat password'), 'TR_USREMAIL' => tr('Email'), 'TR_ADDITIONAL_DATA' => tr('Additional data'), 'TR_CUSTOMER_ID' => tr('Customer ID'), 'TR_FIRSTNAME' => tr('First name'), 'TR_LASTNAME' => tr('Last name'), 'TR_COMPANY' => tr('Company'), 'TR_POST_CODE' => tr('Zip'), 'TR_CITY' => tr('City'), 'TR_STATE' => tr('State/Province'), 'TR_COUNTRY' => tr('Country'), 'TR_STREET1' => tr('Street 1'), 'TR_STREET2' => tr('Street 2'), 'TR_PHONE' => tr('Phone'), 'TR_FAX' => tr('Fax'), 'TR_GENDER' => tr('Gender'), 'TR_MALE' => tr('Male'), 'TR_FEMALE' => tr('Female'), 'TR_UNKNOWN' => tr('Unknown'), 'EDIT_ID' => $adminId, 'TR_UPDATE' => tr('Update'), 'TR_SEND_DATA' => tr('Send new login data'))); reseller_loadUserData($adminId); if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_changes' && check_ruser_data(true)) { reseller_updateUserData($adminId); // Save data to db } generateNavigation($tpl); reseller_generatePage($tpl); generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl)); $tpl->prnt(); } else { showBadRequestErrorPage(); }