From 62b4377611ae19efe404f8d692ccf4254be7c599 Mon Sep 17 00:00:00 2001 From: Laurent Declercq Date: Tue, 9 Feb 2016 20:24:49 +0100 Subject: [PATCH] Several fixes (Client creation, Hosting plans) [ci skip] --- gui/public/reseller/hosting_plan_add.php | 46 +- gui/public/reseller/hosting_plan_edit.php | 60 +- gui/public/reseller/user_add2.php | 743 ++++++++++------------ gui/public/reseller/user_add3.php | 160 ++--- gui/themes/default/reseller/user_add2.tpl | 80 ++- gui/themes/default/reseller/user_add3.tpl | 214 +++---- 6 files changed, 619 insertions(+), 684 deletions(-) diff --git a/gui/public/reseller/hosting_plan_add.php b/gui/public/reseller/hosting_plan_add.php index d6a8990465..dfefc09ed5 100644 --- a/gui/public/reseller/hosting_plan_add.php +++ b/gui/public/reseller/hosting_plan_add.php @@ -154,23 +154,23 @@ function generatePage($tpl) $backup, $dns, $aps, $extMail, $webFolderProtection, $status; $tpl->assign(array( - 'NAME_VALUE' => tohtml($name), + 'NAME_VALUE' => tohtml($name, 'htmlAttr'), 'DESCRIPTION_VALUE' => tohtml($description), - 'MAX_SUB_LIMITS' => tohtml($sub), - 'MAX_ALS_VALUES' => tohtml($als), - 'MAIL_VALUE' => tohtml($mail), - 'MAIL_QUOTA_VALUE' => tohtml($mailQuota), - 'FTP_VALUE' => tohtml($ftp), - 'SQL_DB_VALUE' => tohtml($sqld), - 'SQL_USER_VALUE' => tohtml($sqlu), - 'TRAFF_VALUE' => tohtml($traffic), - 'DISK_VALUE' => tohtml($diskSpace), + 'MAX_SUB_LIMITS' => tohtml($sub, 'htmlAttr'), + 'MAX_ALS_VALUES' => tohtml($als, 'htmlAttr'), + 'MAIL_VALUE' => tohtml($mail, 'htmlAttr'), + 'MAIL_QUOTA_VALUE' => tohtml($mailQuota, 'htmlAttr'), + 'FTP_VALUE' => tohtml($ftp, 'htmlAttr'), + 'SQL_DB_VALUE' => tohtml($sqld, 'htmlAttr'), + 'SQL_USER_VALUE' => tohtml($sqlu, 'htmlAttr'), + 'TRAFF_VALUE' => tohtml($traffic, 'htmlAttr'), + 'DISK_VALUE' => tohtml($diskSpace, 'htmlAttr'), 'TR_PHP_YES' => $php == '_yes_' ? ' checked' : '', 'TR_PHP_NO' => $php == '_yes_' ? '' : 'checked', 'TR_CGI_YES' => $cgi == '_yes_' ? ' checked' : '', 'TR_CGI_NO' => $cgi == '_yes_' ? '' : ' checked', - 'TR_DNS_YES' => $dns == '_yes' ? ' checked' : '', - 'TR_DNS_NO' => $dns == '_yes' ? '' : ' checked', + 'TR_DNS_YES' => $dns == '_yes_' ? ' checked' : '', + 'TR_DNS_NO' => $dns == '_yes_' ? '' : ' checked', 'TR_SOFTWARE_YES' => $aps == '_yes_' ? ' checked' : '', 'TR_SOFTWARE_NO' => $aps == '_yes_' ? '' : ' checked', 'TR_EXTMAIL_YES' => $extMail == '_yes_' ? ' checked' : '', @@ -278,7 +278,7 @@ function checkInputData() $php = $php === '_yes_' ? '_yes_' : '_no_'; $cgi = $cgi === '_yes_' ? '_yes_' : '_no_'; - $dns = $dns === '_yes_' ? '_yes_' : '_no_'; + $dns = resellerHasFeature('custom_dns_records') && $dns === '_yes_' ? '_yes_' : '_no_'; $backup = resellerHasFeature('backup') ? array_intersect($backup, array('_dmn_', '_sql_', '_mail_')) : array(); $aps = resellerHasFeature('aps') && $aps === '_yes_' ? '_yes_' : '_no_'; $extMail = $extMail === '_yes_' ? '_yes_' : '_no_'; @@ -360,17 +360,15 @@ function checkInputData() $errFieldsStack[] = 'disk'; } - if (isset($_POST['mail_quota'])) { - if (!imscp_limit_check($mailQuota, null)) { - set_page_message(tr('Wrong syntax for the mail quota value.'), 'error'); - $errFieldsStack[] = 'mail_quota'; - } elseif ($diskSpace != 0 && $mailQuota > $diskSpace) { - set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); - $errFieldsStack[] = 'mail_quota'; - } elseif ($diskSpace != 0 && $mailQuota == 0) { - set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error'); - $errFieldsStack[] = 'mail_quota'; - } + if (!imscp_limit_check($mailQuota, null)) { + set_page_message(tr('Wrong syntax for the mail quota value.'), 'error'); + $errFieldsStack[] = 'mail_quota'; + } elseif ($diskSpace != 0 && $mailQuota > $diskSpace) { + set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); + $errFieldsStack[] = 'mail_quota'; + } elseif ($diskSpace != 0 && $mailQuota == 0) { + set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error'); + $errFieldsStack[] = 'mail_quota'; } $phpini = iMSCP_PHPini::getInstance(); diff --git a/gui/public/reseller/hosting_plan_edit.php b/gui/public/reseller/hosting_plan_edit.php index b6a4f711b2..91db3be372 100644 --- a/gui/public/reseller/hosting_plan_edit.php +++ b/gui/public/reseller/hosting_plan_edit.php @@ -202,35 +202,35 @@ function generatePage($tpl) $backup, $dns, $aps, $extMail, $webFolderProtection, $status; $tpl->assign(array( - 'ID' => tohtml($id), - 'NAME' => tohtml($name), + 'ID' => tohtml($id, 'htmlAttr'), + 'NAME' => tohtml($name, 'htmlAttr'), 'DESCRIPTION' => tohtml($description), - 'MAX_SUB' => tohtml($sub), - 'MAX_ALS' => tohtml($als), - 'MAX_MAIL' => tohtml($mail), - 'MAIL_QUOTA' => tohtml($mailQuota), - 'MAX_FTP' => tohtml($ftp), - 'MAX_SQLD' => tohtml($sqld), - 'MAX_SQLU' => tohtml($sqlu), - 'MONTHLY_TRAFFIC' => tohtml($traffic), - 'MAX_DISKSPACE' => tohtml($diskSpace), + 'MAX_SUB' => tohtml($sub, 'htmlAttr'), + 'MAX_ALS' => tohtml($als, 'htmlAttr'), + 'MAX_MAIL' => tohtml($mail, 'htmlAttr'), + 'MAIL_QUOTA' => tohtml($mailQuota, 'htmlAttr'), + 'MAX_FTP' => tohtml($ftp, 'htmlAttr'), + 'MAX_SQLD' => tohtml($sqld, 'htmlAttr'), + 'MAX_SQLU' => tohtml($sqlu, 'htmlAttr'), + 'MONTHLY_TRAFFIC' => tohtml($traffic, 'htmlAttr'), + 'MAX_DISKSPACE' => tohtml($diskSpace, 'htmlAttr'), 'PHP_YES' => $php == '_yes_' ? ' checked' : '', - 'PHP_NO' => $php == '_no_' ? ' checked' : '', + 'PHP_NO' => $php == '_yes_' ? '' : ' checked', 'CGI_YES' => $cgi == '_yes_' ? ' checked' : '', - 'CGI_NO' => $cgi == '_no_' ? ' checked' : '', + 'CGI_NO' => $cgi == '_yes_' ? '' : ' checked', 'DNS_YES' => $dns == '_yes_' ? ' checked' : '', - 'DNS_NO' => $dns == '_no_' ? ' checked' : '', + 'DNS_NO' => $dns == '_yes_' ? '' : ' checked', 'TR_SOFTWARE_YES' => $aps == '_yes_' ? ' checked' : '', 'TR_SOFTWARE_NO' => $aps == '_yes_' ? '' : ' checked', 'SOFTWARE_YES' => $aps == '_yes_' ? ' checked' : '', - 'SOFTWARE_NO' => $aps == '_no_' ? ' checked' : '', + 'SOFTWARE_NO' => $aps == '_yes_' ? '' : ' checked', 'EXTMAIL_YES' => $extMail == '_yes_' ? ' checked' : '', - 'EXTMAIL_NO' => $extMail == '_no_' ? ' checked' : '', + 'EXTMAIL_NO' => $extMail == '_yes_' ? '' : ' checked', 'BACKUPD' => in_array('_dmn_', $backup) ? ' checked' : '', 'BACKUPS' => in_array('_sql_', $backup) ? ' checked' : '', 'BACKUPM' => in_array('_mail_', $backup) ? ' checked' : '', 'PROTECT_WEB_FOLDERS_YES' => $webFolderProtection == '_yes_' ? ' checked' : '', - 'PROTECT_WEB_FOLDERS_NO' => $webFolderProtection == '_no_' ? ' checked' : '', + 'PROTECT_WEB_FOLDERS_NO' => $webFolderProtection == '_yes_' ? '' : ' checked', 'STATUS_YES' => $status ? ' checked' : '', 'STATUS_NO' => !$status ? ' checked' : '' )); @@ -329,7 +329,7 @@ function checkInputData() $php = $php === '_yes_' ? '_yes_' : '_no_'; $cgi = $cgi === '_yes_' ? '_yes_' : '_no_'; - $dns = $dns === '_yes_' ? '_yes_' : '_no_'; + $dns = resellerHasFeature('custom_dns_records') && $dns === '_yes_' ? '_yes_' : '_no_'; $backup = resellerHasFeature('backup') ? array_intersect($backup, array('_dmn_', '_sql_', '_mail_')) : array(); $aps = resellerHasFeature('aps') && $aps === '_yes_' ? '_yes_' : '_no_'; $extMail = $extMail === '_yes_' ? '_yes_' : '_no_'; @@ -411,17 +411,15 @@ function checkInputData() $errFieldsStack[] = 'disk'; } - if (isset($_POST['mail_quota'])) { - if (!imscp_limit_check($mailQuota, null)) { - set_page_message(tr('Wrong syntax for the mail quota value.'), 'error'); - $errFieldsStack[] = 'mail_quota'; - } elseif ($diskSpace != 0 && $mailQuota > $diskSpace) { - set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); - $errFieldsStack[] = 'mail_quota'; - } elseif ($diskSpace != 0 && $mailQuota == 0) { - set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error'); - $errFieldsStack[] = 'mail_quota'; - } + if (!imscp_limit_check($mailQuota, null)) { + set_page_message(tr('Wrong syntax for the mail quota value.'), 'error'); + $errFieldsStack[] = 'mail_quota'; + } elseif ($diskSpace != 0 && $mailQuota > $diskSpace) { + set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); + $errFieldsStack[] = 'mail_quota'; + } elseif ($diskSpace != 0 && $mailQuota == 0) { + set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error'); + $errFieldsStack[] = 'mail_quota'; } $phpini = iMSCP_PHPini::getInstance(); @@ -466,11 +464,11 @@ function checkInputData() $phpini->setDomainIni('phpiniMaxInputTime', clean_input($_POST['max_input_time'])); } } else { - $phpini->loadClientPermissions(); // Reset client permissions to default values + $phpini->loadClientPermissions(); // Reset client PHP permissions to default values $phpini->loadDomainIni(); // Reset domain PHP configuration options to default values } } else { - $phpini->loadClientPermissions(); // Reset client permissions to default values + $phpini->loadClientPermissions(); // Reset client PHP permissions to default values $phpini->loadDomainIni(); // Reset domain PHP configuration options to default values } diff --git a/gui/public/reseller/user_add2.php b/gui/public/reseller/user_add2.php index 5c396fa5b8..67497b40e5 100644 --- a/gui/public/reseller/user_add2.php +++ b/gui/public/reseller/user_add2.php @@ -1,28 +1,21 @@ * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * The Original Code is "VHCS - Virtual Hosting Control System". - * - * The Initial Developer of the Original Code is moleSoftware GmbH. - * Portions created by Initial Developer are Copyright (C) 2001-2006 - * by moleSoftware GmbH. All Rights Reserved. - * - * Portions created by the ispCP Team are Copyright (C) 2006-2010 by - * isp Control Panel. All Rights Reserved. - * - * Portions created by the i-MSCP Team are Copyright (C) 2010-2016 by - * i-MSCP - internet Multi Server Control Panel. All Rights Reserved. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*********************************************************************************************************************** @@ -30,11 +23,11 @@ */ /** - * Get parameters from previous page. + * Get first step data * - * @return bool TRUE if parameters from previous page are found, FALSE otherwise + * @return bool TRUE if parameters from first step are found, FALSE otherwise */ -function get_pageone_param() +function getFirstStepData() { global $dmnName, $dmnExpire, $hpId; @@ -49,54 +42,79 @@ function get_pageone_param() } /** - * Show page with initial data fields + * Generate page * * @param iMSCP_pTemplate $tpl Template engine - * @param iMSCP_PHPini $phpini * @return void */ -function get_init_au2_page($tpl, $phpini) +function generatePage($tpl) { - global $hpName, $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqlDb, $sqlUser, $traffic, $diskSpace, $backup, - $dns, $aps, $extMailServer, $webFolderProtection; + global $hpName, $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqld, $sqlu, $traffic, $diskspace, $backup, $dns, + $aps, $extMail, $webFolderProtection; $cfg = iMSCP_Registry::get('config'); $tpl->assign(array( - 'VL_TEMPLATE_NAME' => tohtml($hpName), - 'MAX_DMN_CNT' => '', - 'MAX_SUBDMN_CNT' => tohtml($sub), - 'MAX_DMN_ALIAS_CNT' => tohtml($als), - 'MAX_MAIL_CNT' => tohtml($mail), - 'MAIL_QUOTA' => tohtml($mailQuota), - 'MAX_FTP_CNT' => tohtml($ftp), - 'MAX_SQL_CNT' => tohtml($sqlDb), - 'VL_MAX_SQL_USERS' => tohtml($sqlUser), - 'VL_MAX_TRAFFIC' => tohtml($traffic), - 'VL_MAX_DISK_USAGE' => tohtml($diskSpace), - 'VL_EXTMAILY' => $extMailServer == '_yes_' ? ' checked' : '', - 'VL_EXTMAILN' => $extMailServer == '_no_' ? ' checked' : '', + 'VL_TEMPLATE_NAME' => tohtml($hpName, 'htmlAttr'), + 'MAX_SUBDMN_CNT' => tohtml($sub, 'htmlAttr'), + 'MAX_DMN_ALIAS_CNT' => tohtml($als, 'htmlAttr'), + 'MAX_MAIL_CNT' => tohtml($mail, 'htmlAttr'), + 'MAIL_QUOTA' => tohtml($mailQuota, 'htmlAttr'), + 'MAX_FTP_CNT' => tohtml($ftp, 'htmlAttr'), + 'MAX_SQL_CNT' => tohtml($sqld, 'htmlAttr'), + 'VL_MAX_SQL_USERS' => tohtml($sqlu, 'htmlAttr'), + 'VL_MAX_TRAFFIC' => tohtml($traffic, 'htmlAttr'), + 'VL_MAX_DISK_USAGE' => tohtml($diskspace, 'htmlAttr'), + 'VL_EXTMAILY' => $extMail == '_yes_' ? ' checked' : '', + 'VL_EXTMAILN' => $extMail == '_yes_' ? '' : ' checked', 'VL_PHPY' => $php == '_yes_' ? ' checked' : '', - 'VL_PHPN' => $php == '_no_' ? ' checked' : '', + 'VL_PHPN' => $php == '_yes_' ? '' : ' checked', 'VL_CGIY' => $cgi == '_yes_' ? ' checked' : '', - 'VL_CGIN' => $cgi == '_no_' ? ' checked' : '' + 'VL_CGIN' => $cgi == '_yes_' ? '' : ' checked' )); - if (resellerHasFeature('custom_dns_records')) { + if (!resellerHasFeature('subdomains')) { + $tpl->assign('SUBDOMAIN_FEATURE', ''); + } + + if (!resellerHasFeature('domain_aliases')) { + $tpl->assign('ALIAS_FEATURE', ''); + } + + if (!resellerHasFeature('custom_dns_records')) { + $tpl->assign('CUSTOM_DNS_RECORDS_FEATURE', ''); + } else { $tpl->assign(array( 'VL_DNSY' => $dns == '_yes_' ? ' checked' : '', - 'VL_DNSN' => $dns == '_no_' ? ' checked' : '' + 'VL_DNSN' => $dns == '_yes_' ? '' : ' checked' )); } - if (resellerHasFeature('aps')) { + if (!resellerHasFeature('mail')) { + $tpl->assign('MAIL_FEATURE', ''); + $tpl->assign('EXT_MAIL_FEATURE', ''); + } + + if (!resellerHasFeature('ftp')) { + $tpl->assign('FTP_FEATURE', ''); + } + + if (!resellerHasFeature('sql')) { + $tpl->assign('SQL_FEATURE', ''); + } + + if (!resellerHasFeature('aps')) { + $tpl->assign('APS_FEATURE', ''); + } else { $tpl->assign(array( 'VL_SOFTWAREY' => $aps == '_yes_' ? ' checked' : '', - 'VL_SOFTWAREN' => $aps == '_no_' ? ' checked' : '' + 'VL_SOFTWAREN' => $aps == '_yes_' ? '' : ' checked' )); } - if (resellerHasFeature('backup')) { + if (!resellerHasFeature('backup')) { + $tpl->assign('BACKUP_FEATURE', ''); + } else { $tpl->assign(array( 'VL_BACKUPD' => in_array('_dmn_', $backup) ? ' checked' : '', 'VL_BACKUPS' => in_array('_sql_', $backup) ? ' checked' : '', @@ -106,389 +124,349 @@ function get_init_au2_page($tpl, $phpini) $tpl->assign(array( 'VL_WEB_FOLDER_PROTECTION_YES' => $webFolderProtection == '_yes_' ? ' checked' : '', - 'VL_WEB_FOLDER_PROTECTION_NO' => $webFolderProtection == '_no_' ? ' checked' : '' + 'VL_WEB_FOLDER_PROTECTION_NO' => $webFolderProtection == '_yes_' ? '' : 'checked' + )); + + $phpini = iMSCP_PHPini::getInstance(); + + if (!$phpini->resellerHasPermission('phpiniSystem')) { + $tpl->assign('PHP_EDITOR_BLOCK', ''); + return; + } + + $tpl->assign(array( + 'PHP_EDITOR_YES' => $phpini->clientHasPermission('phpiniSystem') ? ' checked' : '', + 'PHP_EDITOR_NO' => $phpini->clientHasPermission('phpiniSystem') ? '' : ' checked', + 'TR_PHP_EDITOR' => tr('PHP Editor'), + 'TR_PHP_EDITOR_SETTINGS' => tr('PHP Settings'), + 'TR_SETTINGS' => tr('PHP Settings'), + 'TR_DIRECTIVES_VALUES' => tr('PHP Configuration options'), + 'TR_FIELDS_OK' => tr('All fields are valid.'), + 'TR_MIB' => tr('MiB'), + 'TR_SEC' => tr('Sec.') )); - if ($phpini->resellerHasPermission('phpiniSystem')) { + iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) { + /** @var iMSCP_Events_Event $e */ + $translations = $e->getParam('translations'); + $translations['core']['close'] = tr('Close'); + $translations['core']['fields_ok'] = tr('All fields are valid.'); + $translations['core']['out_of_range_value_error'] = tr('Value for the PHP %%s directive must be in range %%d to %%d.'); + $translations['core']['lower_value_expected_error'] = tr('%%s must be lower than %%s.'); + $translations['core']['error_field_stack'] = iMSCP_Registry::isRegistered('errFieldsStack') + ? iMSCP_Registry::get('errFieldsStack') : array(); + }); + + $permissionsBlock = false; + + if (!$phpini->resellerHasPermission('phpiniAllowUrlFopen')) { + $tpl->assign('PHP_EDITOR_ALLOW_URL_FOPEN_BLOCK', ''); + } else { $tpl->assign(array( - 'PHP_EDITOR_YES' => $phpini->clientHasPermission('phpiniSystem') ? ' checked' : '', - 'PHP_EDITOR_NO' => $phpini->clientHasPermission('phpiniSystem') ? '' : ' checked', - 'TR_PHP_EDITOR' => tr('PHP Editor'), - 'TR_PHP_EDITOR_SETTINGS' => tr('PHP Editor Settings'), - 'TR_SETTINGS' => tr('Settings'), - 'TR_DIRECTIVES_VALUES' => tr('Directive values'), - 'TR_FIELDS_OK' => tr('All fields are valid.'), - 'TR_MIB' => tr('MiB'), - 'TR_SEC' => tr('Sec.') + 'TR_CAN_EDIT_ALLOW_URL_FOPEN' => tr('Can edit the PHP %s configuration option', 'allow_url_fopen'), + 'ALLOW_URL_FOPEN_YES' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? ' checked' : '', + 'ALLOW_URL_FOPEN_NO' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? '' : ' checked' )); + $permissionsBlock = true; + } - iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) { - /** @var iMSCP_Events_Event $e */ - $translations = $e->getParam('translations'); - $translations['core']['close'] = tr('Close'); - $translations['core']['fields_ok'] = tr('All fields are valid.'); - $translations['core']['out_of_range_value_error'] = tr('Value for the PHP %%s directive must be in range %%d to %%d.'); - $translations['core']['lower_value_expected_error'] = tr('%%s must be lower than %%s.'); - $translations['core']['error_field_stack'] = iMSCP_Registry::isRegistered('errFieldsStack') - ? iMSCP_Registry::get('errFieldsStack') : array(); - }); - - $permissionsBlock = false; - - if (!$phpini->resellerHasPermission('phpiniAllowUrlFopen')) { - $tpl->assign('PHP_EDITOR_ALLOW_URL_FOPEN_BLOCK', ''); - } else { - $tpl->assign(array( - 'TR_CAN_EDIT_ALLOW_URL_FOPEN' => tr('Can edit the PHP %s directive', 'allow_url_fopen'), - 'ALLOW_URL_FOPEN_YES' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? ' checked' : '', - 'ALLOW_URL_FOPEN_NO' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? '' : ' checked' - )); - $permissionsBlock = true; - } + if (!$phpini->resellerHasPermission('phpiniDisplayErrors')) { + $tpl->assign('PHP_EDITOR_DISPLAY_ERRORS_BLOCK', ''); + } else { + $tpl->assign(array( + 'TR_CAN_EDIT_DISPLAY_ERRORS' => tr('Can edit the PHP %s configuration option', 'display_errors'), + 'DISPLAY_ERRORS_YES' => $phpini->clientHasPermission('phpiniDisplayErrors') ? ' checked' : '', + 'DISPLAY_ERRORS_NO' => $phpini->clientHasPermission('phpiniDisplayErrors') ? '' : ' checked' + )); + $permissionsBlock = true; + } - if (!$phpini->resellerHasPermission('phpiniDisplayErrors')) { - $tpl->assign('PHP_EDITOR_DISPLAY_ERRORS_BLOCK', ''); - } else { + if ($cfg['HTTPD_SERVER'] == 'apache_itk') { + $tpl->assign(array( + 'PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK' => '', + 'PHP_EDITOR_MAIL_FUNCTION_BLOCK' => '' + )); + } else { + if ($phpini->resellerHasPermission('phpiniDisableFunctions')) { $tpl->assign(array( - 'TR_CAN_EDIT_DISPLAY_ERRORS' => tr('Can edit the PHP %s directive', 'display_errors'), - 'DISPLAY_ERRORS_YES' => $phpini->clientHasPermission('phpiniDisplayErrors') ? ' checked' : '', - 'DISPLAY_ERRORS_NO' => $phpini->clientHasPermission('phpiniDisplayErrors') ? '' : ' checked' + 'TR_CAN_EDIT_DISABLE_FUNCTIONS' => tr('Can edit the PHP %s configuration option', 'disable_functions'), + 'DISABLE_FUNCTIONS_YES' => $phpini->getClientPermission('phpiniDisableFunctions') == 'yes' ? ' checked' : '', + 'DISABLE_FUNCTIONS_NO' => $phpini->getClientPermission('phpiniDisableFunctions') == 'no' ? ' checked' : '', + 'DISABLE_FUNCTIONS_EXEC' => $phpini->getClientPermission('phpiniDisableFunctions') == 'exec' ? ' checked' : '', + 'TR_ONLY_EXEC' => tr('Only exec') )); - $permissionsBlock = true; + } else { + $tpl->assign('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK', ''); } - if ($cfg['HTTPD_SERVER'] == 'apache_itk') { + if ($phpini->resellerHasPermission('phpiniMailFunction')) { $tpl->assign(array( - 'PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK' => '', - 'PHP_EDITOR_MAIL_FUNCTION_BLOCK' => '' + 'TR_CAN_USE_MAIL_FUNCTION' => tr('Can use the PHP %s function', 'mail'), + 'MAIL_FUNCTION_YES' => $phpini->clientHasPermission('phpiniMailFunction') ? ' checked' : '', + 'MAIL_FUNCTION_NO' => $phpini->clientHasPermission('phpiniMailFunction') ? '' : ' checked' )); } else { - if ($phpini->resellerHasPermission('phpiniDisableFunctions')) { - $tpl->assign(array( - 'TR_CAN_EDIT_DISABLE_FUNCTIONS' => tr('Can edit the PHP %s directive', 'disable_functions'), - 'DISABLE_FUNCTIONS_YES' => $phpini->getClientPermission('phpiniDisableFunctions') == 'yes' ? ' checked' : '', - 'DISABLE_FUNCTIONS_NO' => $phpini->getClientPermission('phpiniDisableFunctions') == 'no' ? ' checked' : '', - 'DISABLE_FUNCTIONS_EXEC' => $phpini->getClientPermission('phpiniDisableFunctions') == 'exec' ? ' checked' : '', - 'TR_ONLY_EXEC' => tr('Only exec') - )); - } else { - $tpl->assign('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK', ''); - } - - if ($phpini->resellerHasPermission('phpiniMailFunction')) { - $tpl->assign(array( - 'TR_CAN_USE_MAIL_FUNCTION' => tr('Can use the PHP %s function', 'mail'), - 'MAIL_FUNCTION_YES' => $phpini->clientHasPermission('phpiniMailFunction') ? ' checked' : '', - 'MAIL_FUNCTION_NO' => $phpini->clientHasPermission('phpiniMailFunction') ? '' : ' checked' - )); - } else { - $tpl->assign('PHP_EDITOR_MAIL_FUNCTION_BLOCK', ''); - } - - $permissionsBlock = true; + $tpl->assign('PHP_EDITOR_MAIL_FUNCTION_BLOCK', ''); } - if (!$permissionsBlock) { - $tpl->assign('PHP_EDITOR_PERMISSIONS_BLOCK', ''); - } else { - $tpl->assign(array( - 'TR_PERMISSIONS' => tr('Permissions'), - 'TR_ONLY_EXEC' => tr("Only exec") - )); - } + $permissionsBlock = true; + } + if (!$permissionsBlock) { + $tpl->assign('PHP_EDITOR_PERMISSIONS_BLOCK', ''); + } else { $tpl->assign(array( - 'TR_POST_MAX_SIZE' => tr('PHP %s directive', 'post_max_size'), - 'POST_MAX_SIZE' => tohtml($phpini->getDomainIni('phpiniPostMaxSize')), - 'TR_UPLOAD_MAX_FILEZISE' => tr('PHP %s directive', 'upload_max_filesize'), - 'UPLOAD_MAX_FILESIZE' => tohtml($phpini->getDomainIni('phpiniUploadMaxFileSize')), - 'TR_MAX_EXECUTION_TIME' => tr('PHP %s directive', 'max_execution_time'), - 'MAX_EXECUTION_TIME' => tohtml($phpini->getDomainIni('phpiniMaxExecutionTime')), - 'TR_MAX_INPUT_TIME' => tr('PHP %s directive', 'max_input_time'), - 'MAX_INPUT_TIME' => tohtml($phpini->getDomainIni('phpiniMaxInputTime')), - 'TR_MEMORY_LIMIT' => tr('PHP %s directive', 'memory_limit'), - 'MEMORY_LIMIT' => tohtml($phpini->getDomainIni('phpiniMemoryLimit')), - - 'POST_MAX_SIZE_LIMIT' => $phpini->getResellerPermission('phpiniPostMaxSize'), - 'UPLOAD_MAX_FILESIZE_LIMIT' => $phpini->getResellerPermission('phpiniUploadMaxFileSize'), - 'MAX_EXECUTION_TIME_LIMIT' => $phpini->getResellerPermission('phpiniMaxExecutionTime'), - 'MAX_INPUT_TIME_LIMIT' => $phpini->getResellerPermission('phpiniMaxInputTime'), - 'MEMORY_LIMIT_LIMIT' => $phpini->getResellerPermission('phpiniMemoryLimit') + 'TR_PERMISSIONS' => tr('Permissions'), + 'TR_ONLY_EXEC' => tr("Only exec") )); - return; } - $tpl->assign('PHP_EDITOR_BLOCK', ''); - + $tpl->assign(array( + 'TR_POST_MAX_SIZE' => tr('PHP %s configuration option', 'post_max_size'), + 'POST_MAX_SIZE' => tohtml($phpini->getDomainIni('phpiniPostMaxSize'), 'htmlAttr'), + 'TR_UPLOAD_MAX_FILEZISE' => tr('PHP %s configuration option', 'upload_max_filesize'), + 'UPLOAD_MAX_FILESIZE' => tohtml($phpini->getDomainIni('phpiniUploadMaxFileSize'), 'htmlAttr'), + 'TR_MAX_EXECUTION_TIME' => tr('PHP %s configuration option', 'max_execution_time'), + 'MAX_EXECUTION_TIME' => tohtml($phpini->getDomainIni('phpiniMaxExecutionTime'), 'htmlAttr'), + 'TR_MAX_INPUT_TIME' => tr('PHP %s configuration option', 'max_input_time'), + 'MAX_INPUT_TIME' => tohtml($phpini->getDomainIni('phpiniMaxInputTime'), 'htmlAttr'), + 'TR_MEMORY_LIMIT' => tr('PHP %s configuration option', 'memory_limit'), + 'MEMORY_LIMIT' => tohtml($phpini->getDomainIni('phpiniMemoryLimit'), 'htmlAttr'), + 'POST_MAX_SIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniPostMaxSize'), 'htmlAttr'), + 'UPLOAD_MAX_FILESIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniUploadMaxFileSize'), 'htmlAttr'), + 'MAX_EXECUTION_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxExecutionTime'), 'htmlAttr'), + 'MAX_INPUT_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxInputTime'), 'htmlAttr'), + 'MEMORY_LIMIT_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMemoryLimit'), 'htmlAttr') + )); } /** - * Get hosting plan data. + * Get hosting plan data * - * @param int $hpid Hosting plan unique identifier - * @param int $resellerId Reseller unique identifier - * @param iMSCP_PHPini $phpini * @return void */ -function reseller_getHostingPlanData($hpid, $resellerId, $phpini) +function getHostingPlanData() { - global $hpName, $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqlDb, $sqlUser, $traffic, $diskSpace, $backup, - $dns, $aps, $extMailServer, $webFolderProtection; - - if ($hpid != 0) { - $stmt = exec_query('SELECT name, props FROM hosting_plans WHERE reseller_id = ? AND id = ?', array( - $resellerId, $hpid - )); - - if (!$stmt->rowCount()) { - showBadRequestErrorPage(); - } + global $hpId, $hpName, $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqld, $sqlu, $traffic, $diskspace, $backup, + $dns, $aps, $extMail, $webFolderProtection; - $data = $stmt->fetchRow(); - - list( - $php, $cgi, $sub, $als, $mail, $ftp, $sqlDb, $sqlUser, $traffic, $diskSpace, $backup, $dns, $aps, - $phpEditor, $phpiniAllowUrlFopen, $phpiniDisplayErrors, $phpiniDisableFunctions, $phpiniMailFunction, - $phpiniPostMaxSize, $phpiniUploadMaxFileSize, $phpiniMaxExecutionTime, $phpiniMaxInputTime, - $phpiniMemoryLimit, $extMailServer, $webFolderProtection, $mailQuota - ) = explode(';', $data['props']); - - $backup = explode('|', $backup); - $mailQuota = ($mailQuota != '0') ? $mailQuota / 1048576 : '0'; - $hpName = $data['name']; - - $phpini->setClientPermission('phpiniSystem', $phpEditor); - $phpini->setClientPermission('phpiniAllowUrlFopen', $phpiniAllowUrlFopen); - $phpini->setClientPermission('phpiniDisplayErrors', $phpiniDisplayErrors); - $phpini->setClientPermission('phpiniDisableFunctions', $phpiniDisableFunctions); - $phpini->setClientPermission('phpiniMailFunction', $phpiniMailFunction); - - $phpini->setDomainIni('phpiniPostMaxSize', $phpiniPostMaxSize); - $phpini->setDomainIni('phpiniUploadMaxFileSize', $phpiniUploadMaxFileSize); - $phpini->setDomainIni('phpiniMaxExecutionTime', $phpiniMaxExecutionTime); - $phpini->setDomainIni('phpiniMaxInputTime', $phpiniMaxInputTime); - $phpini->setDomainIni('phpiniMemoryLimit', $phpiniMemoryLimit); + if ($hpId == 0) { return; } - $hpName = 'Custom'; - $sub = $als = $mail = $mailQuota = $ftp = $sqlDb = $sqlUser = $traffic = $diskSpace = '0'; - $php = $cgi = $dns = $aps = $extMailServer = '_no_'; - $backup = array(); - $webFolderProtection = '_yes_'; + $stmt = exec_query('SELECT name, props FROM hosting_plans WHERE reseller_id = ? AND id = ?', array( + $_SESSION['user_id'], $hpId + )); + + if (!$stmt->rowCount()) { + showBadRequestErrorPage(); + } + + $data = $stmt->fetchRow(); + + list( + $php, $cgi, $sub, $als, $mail, $ftp, $sqld, $sqlu, $traffic, $diskspace, $backup, $dns, $aps, $phpEditor, + $phpiniAllowUrlFopen, $phpiniDisplayErrors, $phpiniDisableFunctions, $phpiniMailFunction, $phpiniPostMaxSize, + $phpiniUploadMaxFileSize, $phpiniMaxExecutionTime, $phpiniMaxInputTime, $phpiniMemoryLimit, $extMail, + $webFolderProtection, $mailQuota + ) = explode(';', $data['props']); + + $backup = explode('|', $backup); + $mailQuota = ($mailQuota != '0') ? $mailQuota / 1048576 : '0'; + $hpName = $data['name']; + + $phpini = iMSCP_PHPini::getInstance(); + $phpini->setClientPermission('phpiniSystem', $phpEditor); + $phpini->setClientPermission('phpiniAllowUrlFopen', $phpiniAllowUrlFopen); + $phpini->setClientPermission('phpiniDisplayErrors', $phpiniDisplayErrors); + $phpini->setClientPermission('phpiniDisableFunctions', $phpiniDisableFunctions); + $phpini->setClientPermission('phpiniMailFunction', $phpiniMailFunction); + $phpini->setDomainIni('phpiniPostMaxSize', $phpiniPostMaxSize); + $phpini->setDomainIni('phpiniUploadMaxFileSize', $phpiniUploadMaxFileSize); + $phpini->setDomainIni('phpiniMaxExecutionTime', $phpiniMaxExecutionTime); + $phpini->setDomainIni('phpiniMaxInputTime', $phpiniMaxInputTime); + $phpini->setDomainIni('phpiniMemoryLimit', $phpiniMemoryLimit); } /** - * Check validity of input data + * Check input data * - * @param iMSCP_PHPini $phpini * @return bool TRUE if all data are valid, FALSE otherwise */ -function check_user_data($phpini) +function checkInputData() { - global $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqlDb, $sqlUser, $traffic, $diskSpace, $backup, $dns, $aps, - $extMailServer, $webFolderProtection; + global $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqld, $sqlu, $traffic, $diskspace, $backup, $dns, $aps, + $extMail, $webFolderProtection; + + $sub = isset($_POST['nreseller_max_subdomain_cnt']) ? clean_input($_POST['nreseller_max_subdomain_cnt']) : $sub; + $als = isset($_POST['nreseller_max_alias_cnt']) ? clean_input($_POST['nreseller_max_alias_cnt']) : $als; + $mail = isset($_POST['nreseller_max_mail_cnt']) ? clean_input($_POST['nreseller_max_mail_cnt']) : $mail; + $mailQuota = isset($_POST['nreseller_mail_quota']) ? clean_input($_POST['nreseller_mail_quota']) : $mailQuota; + $ftp = isset($_POST['nreseller_max_ftp_cnt']) ? clean_input($_POST['nreseller_max_ftp_cnt']) : $ftp; + $sqld = isset($_POST['nreseller_max_sql_db_cnt']) ? clean_input($_POST['nreseller_max_sql_db_cnt']) : $sqld; + $sqlu = isset($_POST['nreseller_max_sql_user_cnt']) ? clean_input($_POST['nreseller_max_sql_user_cnt']) : $sqlu; + $traffic = isset($_POST['nreseller_max_traffic']) ? clean_input($_POST['nreseller_max_traffic']) : $traffic; + $diskspace = isset($_POST['nreseller_max_disk']) ? clean_input($_POST['nreseller_max_disk']) : $diskspace; + $php = isset($_POST['php']) ? clean_input($_POST['php']) : $php; + $cgi = isset($_POST['cgi']) ? clean_input($_POST['cgi']) : $cgi; + $dns = isset($_POST['dns']) ? clean_input($_POST['dns']) : $dns; + $backup = isset($_POST['backup']) && is_array($_POST['backup']) ? $_POST['backup'] : $backup; + $aps = isset($_POST['software_allowed']) ? clean_input($_POST['software_allowed']) : $aps; + $extMail = isset($_POST['external_mail']) ? clean_input($_POST['external_mail']) : $extMail; + $webFolderProtection = isset($_POST['web_folder_protection']) ? clean_input($_POST['web_folder_protection']) : $webFolderProtection; + + $php = $php === '_yes_' ? '_yes_' : '_no_'; + $cgi = $cgi === '_yes_' ? '_yes_' : '_no_'; + $dns = resellerHasFeature('custom_dns_records') && $dns === '_yes_' ? '_yes_' : '_no_'; + $backup = resellerHasFeature('backup') ? array_intersect($backup, array('_dmn_', '_sql_', '_mail_')) : array(); + $aps = resellerHasFeature('aps') && $aps === '_yes_' ? '_yes_' : '_no_'; + $extMail = $extMail === '_yes_' ? '_yes_' : '_no_'; + $webFolderProtection = $webFolderProtection === '_yes_' ? '_yes_' : '_no_'; + + if ($aps == '_yes_') { // Ensure that PHP is enabled when software installer is enabled + $php = '_yes_'; + } + + $errFieldsStack = array(); // Subdomains limit - if (isset($_POST['nreseller_max_subdomain_cnt'])) { - $sub = clean_input($_POST['nreseller_max_subdomain_cnt']); - } - if (!resellerHasFeature('subdomains')) { $sub = '-1'; } elseif (!imscp_limit_check($sub, -1)) { set_page_message(tr('Incorrect subdomain limit.'), 'error'); - } - - // Domain aliases limit - if (isset($_POST['nreseller_max_alias_cnt'])) { - $als = clean_input($_POST['nreseller_max_alias_cnt']); + $errFieldsStack[] = 'nreseller_max_subdomain_cnt'; } if (!resellerHasFeature('domain_aliases')) { $als = '-1'; } elseif (!imscp_limit_check($als, -1)) { set_page_message(tr('Incorrect alias limit.'), 'error'); + $errFieldsStack[] = 'nreseller_max_alias_cnt'; } // Mail accounts limit - if (isset($_POST['nreseller_max_mail_cnt'])) { - $mail = clean_input($_POST['nreseller_max_mail_cnt']); - } - if (!resellerHasFeature('mail')) { $mail = '-1'; } elseif (!imscp_limit_check($mail, -1)) { set_page_message(tr('Incorrect email account limit.'), 'error'); + $errFieldsStack[] = 'nreseller_max_mail_cnt'; } - // Ftp accounts limit - if (isset($_POST['nreseller_max_ftp_cnt']) || $ftp == -1) { - $ftp = clean_input($_POST['nreseller_max_ftp_cnt']); + // Mail quota limit + if (!imscp_limit_check($mailQuota, null)) { + set_page_message(tr('Incorrect Email quota'), 'error'); + $errFieldsStack[] = 'nreseller_mail_quota'; + } elseif ($diskspace != '0' && $mailQuota > $diskspace) { + set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); + $errFieldsStack[] = 'nreseller_mail_quota'; + } elseif ($diskspace != '0' && $mailQuota == '0') { + set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskspace), 'error'); + $errFieldsStack[] = 'nreseller_mail_quota'; } + // Ftp accounts limit if (!resellerHasFeature('ftp')) { $ftp = '-1'; } elseif (!imscp_limit_check($ftp, -1)) { set_page_message(tr('Incorrect FTP account limit.'), 'error'); + $errFieldsStack[] = 'nreseller_max_ftp_cnt'; } // SQL database limit - if (isset($_POST['nreseller_max_sql_db_cnt'])) { - $sqlDb = clean_input($_POST['nreseller_max_sql_db_cnt']); - } - if (!resellerHasFeature('sql_db')) { - $sqlDb = -1; - } elseif (!imscp_limit_check($sqlDb, -1)) { + $sqld = -1; + } elseif (!imscp_limit_check($sqld, -1)) { set_page_message(tr('Incorrect SQL database limit.'), 'error'); - } elseif ($sqlDb != -1 && $sqlUser == -1) { + $errFieldsStack[] = 'nreseller_max_sql_db_cnt'; + } elseif ($sqld != -1 && $sqlu == -1) { set_page_message(tr('SQL user limit is disabled.'), 'error'); + $errFieldsStack[] = 'nreseller_max_sql_db_cnt'; + $errFieldsStack[] = 'nreseller_max_sql_user_cnt'; } // SQL users limit - if (isset($_POST['nreseller_max_sql_user_cnt'])) { - $sqlUser = clean_input($_POST['nreseller_max_sql_user_cnt']); - } - if (!resellerHasFeature('sql_user')) { - $sqlUser = -1; - } elseif (!imscp_limit_check($sqlUser, -1)) { + $sqlu = -1; + } elseif (!imscp_limit_check($sqlu, -1)) { set_page_message(tr('Incorrect SQL user limit.'), 'error'); - } elseif ($sqlUser != -1 && $sqlDb == -1) { + $errFieldsStack[] = 'nreseller_max_sql_user_cnt'; + } elseif ($sqlu != -1 && $sqld == -1) { set_page_message(tr("SQL database limit is disabled."), 'error'); + $errFieldsStack[] = 'nreseller_max_sql_user_cnt'; + $errFieldsStack[] = 'nreseller_max_sql_db_cnt'; } // Monthly traffic limit - if (isset($_POST['nreseller_max_traffic'])) { - $traffic = clean_input($_POST['nreseller_max_traffic']); - } - if (!imscp_limit_check($traffic, null)) { set_page_message(tr('Incorrect monthly traffic limit.'), 'error'); + $errFieldsStack[] = 'nreseller_max_traffic'; } // Disk space limit - if (isset($_POST['nreseller_max_disk'])) { - $diskSpace = clean_input($_POST['nreseller_max_disk']); - } - - if (!imscp_limit_check($diskSpace, null)) { + if (!imscp_limit_check($diskspace, null)) { set_page_message(tr('Incorrect disk space limit.'), 'error'); - } - - if (isset($_POST['nreseller_mail_quota'])) { - $mailQuota = clean_input($_POST['nreseller_mail_quota']); - - if (!imscp_limit_check($mailQuota, null)) { - set_page_message(tr('Incorrect Email quota'), 'error'); - } elseif ($diskSpace != '0' && $mailQuota > $diskSpace) { - set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error'); - } elseif ($diskSpace != '0' && $mailQuota == '0') { - set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error'); - } - } - - // PHP feature - if (isset($_POST['php'])) { - $php = $_POST['php']; + $errFieldsStack[] = 'nreseller_max_disk'; } // PHP Editor feature - if (isset($_POST['phpiniSystem']) && $phpini->resellerHasPermission('phpiniSystem')) { - $phpini->setClientPermission('phpiniSystem', clean_input($_POST['phpiniSystem'])); + $phpini = iMSCP_PHPini::getInstance(); - if (isset($_POST['phpini_perm_allow_url_fopen'])) { - $phpini->setClientPermission('phpiniAllowUrlFopen', clean_input($_POST['phpini_perm_allow_url_fopen'])); - } - - if (isset($_POST['phpini_perm_display_errors'])) { - $phpini->setClientPermission('phpiniDisplayErrors', clean_input($_POST['phpini_perm_display_errors'])); - } + if (isset($_POST['php_ini_system']) && $php != '_no_' && $phpini->resellerHasPermission('phpiniSystem')) { + $phpini->setClientPermission('phpiniSystem', clean_input($_POST['php_ini_system'])); - if (isset($_POST['phpini_perm_disable_functions'])) { - $phpini->setClientPermission('phpiniDisableFunctions', clean_input($_POST['phpini_perm_disable_functions'])); - } + if ($phpini->clientHasPermission('phpiniSystem')) { + if (isset($_POST['phpini_perm_allow_url_fopen'])) { + $phpini->setClientPermission('phpiniAllowUrlFopen', clean_input($_POST['phpini_perm_allow_url_fopen'])); + } - if (isset($_POST['phpini_perm_mail_function'])) { - $phpini->setClientPermission('phpiniMailFunction', clean_input($_POST['phpini_perm_mail_function'])); - } + if (isset($_POST['phpini_perm_display_errors'])) { + $phpini->setClientPermission('phpiniDisplayErrors', clean_input($_POST['phpini_perm_display_errors'])); + } - if (!isset($_POST['post_max_size'])) { - $phpini->setDomainIni('phpiniPostMaxSize', clean_input($_POST['post_max_size'])); - } + if (isset($_POST['phpini_perm_disable_functions'])) { + $phpini->setClientPermission('phpiniDisableFunctions', clean_input($_POST['phpini_perm_disable_functions'])); + } - if (isset($_POST['upload_max_filesize'])) { - $phpini->setDomainIni('phpiniUploadMaxFileSize', clean_input($_POST['upload_max_filesize'])); - } + if (isset($_POST['phpini_perm_mail_function'])) { + $phpini->setClientPermission('phpiniMailFunction', clean_input($_POST['phpini_perm_mail_function'])); + } - if (isset($_POST['max_execution_time'])) { - $phpini->setDomainIni('phpiniMaxExecutionTime', clean_input($_POST['max_execution_time'])); - } + if (isset($_POST['memory_limit'])) { // Must be set before phpiniPostMaxSize + $phpini->setDomainIni('phpiniMemoryLimit', clean_input($_POST['memory_limit'])); + } - if (isset($_POST['max_input_time'])) { - $phpini->setDomainIni('phpiniMaxInputTime', clean_input($_POST['max_input_time'])); - } + if (!isset($_POST['post_max_size'])) { // Must be set before phpiniUploadMaxFileSize + $phpini->setDomainIni('phpiniPostMaxSize', clean_input($_POST['post_max_size'])); + } - if (isset($_POST['memory_limit'])) { - $phpini->setDomainIni('phpiniMemoryLimit', clean_input($_POST['memory_limit'])); - } - } + if (isset($_POST['upload_max_filesize'])) { + $phpini->setDomainIni('phpiniUploadMaxFileSize', clean_input($_POST['upload_max_filesize'])); + } - // CGI feature - if (isset($_POST['cgi'])) { - $cgi = $_POST['cgi']; - } else { - $cgi = '_no_'; - } + if (isset($_POST['max_execution_time'])) { + $phpini->setDomainIni('phpiniMaxExecutionTime', clean_input($_POST['max_execution_time'])); + } - // Custom DNS records feature - if (resellerHasFeature('custom_dns_records')) { - if (isset($_POST['dns'])) { - $dns = $_POST['dns']; + if (isset($_POST['max_input_time'])) { + $phpini->setDomainIni('phpiniMaxInputTime', clean_input($_POST['max_input_time'])); + } } else { - $dns = '_no_'; + $phpini->loadClientPermissions(); // Reset client PHP permissions to default values + $phpini->loadDomainIni(); // Reset domain PHP configuration options to default values } } else { - $dns = '_no_'; - } - - // External mail server feature - if (resellerHasFeature('external_mail') && isset($_POST['external_mail'])) { - $extMailServer = clean_input($_POST['external_mail']); - } else { - $extMailServer = '_no_'; - } - - // Backup feature - if (resellerHasFeature('backup')) { - $backup = isset($_POST['backup']) && is_array($_POST['backup']) ? array_intersect($_POST['backup'], array('_dmn_', '_sql_', '_mail_')) : array(); - } else { - $backup = array(); - } - - // APS feature - if (isset($_POST['software_allowed']) && resellerHasFeature('aps')) { - $aps = $_POST['software_allowed']; - } else { - $aps = '_no_'; - } - - if ($php == '_no_' && $aps == '_yes_') { - set_page_message(tr('The software installer feature requires PHP.'), 'error'); - } - - // Web folders protection - if (isset($_POST['web_folder_protection'])) { - $webFolderProtection = $_POST['web_folder_protection']; - } else { - $webFolderProtection = '_yes_'; + $phpini->loadClientPermissions(); // Reset client PHP permissions to default values + $phpini->loadDomainIni(); // Reset domain PHP configuration options to default values } if (!Zend_Session::namespaceIsset('pageMessages')) { return true; } + if (!empty($errFieldsStack)) { + iMSCP_Registry::set('errFieldsStack', $errFieldsStack); + } + return false; } @@ -501,10 +479,50 @@ function check_user_data($phpini) iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart); check_login('reseller'); +// Initialize global variables +global $dmnName, $dmnExpire, $hpId; +$hpName = 'Custom'; +$sub = $als = $mail = $mailQuota = $ftp = $sqld = $sqlu = $traffic = $diskspace = '0'; +$php = $cgi = $dns = $aps = $extMail = '_no_'; +$webFolderProtection = '_yes_'; +$backup = array(); + +if (!getFirstStepData()) { + set_page_message(tr('Domain data were altered. Please try again.'), 'error'); + unsetMessages(); + redirectTo('user_add1.php'); +} + $phpini = iMSCP_PHPini::getInstance(); -$phpini->loadResellerPermissions($_SESSION['user_id']); -$phpini->loadClientPermissions(); -$phpini->loadDomainIni(); +$phpini->loadResellerPermissions($_SESSION['user_id']); // Load reseller PHP permissions +$phpini->loadClientPermissions(); // Load client default PHP permissions +$phpini->loadDomainIni(); // Load domain default PHP configuration options + +if (isset($_POST['uaction']) && 'user_add2_nxt' == $_POST['uaction'] && !isset($_SESSION['step_one'])) { + if (checkInputData()) { + $_SESSION['step_two_data'] = "$dmnName;0"; + $_SESSION['ch_hpprops'] = + "$php;$cgi;$sub;$als;$mail;$ftp;$sqld;$sqlu;$traffic;$diskspace;" . implode('|', $backup) . ";$dns;$aps;" . + $phpini->getClientPermission('phpiniSystem') . ';' . + $phpini->getClientPermission('phpiniAllowUrlFopen') . ';' . + $phpini->getClientPermission('phpiniDisplayErrors') . ';' . + $phpini->getClientPermission('phpiniDisableFunctions') . ';' . + $phpini->getClientPermission('phpiniMailFunction') . ';' . + $phpini->getDomainIni('phpiniPostMaxSize') . ';' . + $phpini->getDomainIni('phpiniUploadMaxFileSize') . ';' . + $phpini->getDomainIni('phpiniMaxExecutionTime') . ';' . + $phpini->getDomainIni('phpiniMaxInputTime') . ';' . + $phpini->getDomainIni('phpiniMemoryLimit') . ';' . + $extMail . ';' . $webFolderProtection . ';' . $mailQuota * 1048576; + + if (reseller_limits_check($_SESSION['user_id'], $_SESSION['ch_hpprops'])) { + redirectTo('user_add3.php'); + } + } +} else { + unset($_SESSION['step_one']); + getHostingPlanData(); +} $tpl = new iMSCP_pTemplate(); $tpl->define_dynamic(array( @@ -558,83 +576,12 @@ function check_user_data($phpini) 'TR_FEATURES' => tr('Features'), 'TR_LIMITS' => tr('Limits'), 'TR_WEB_FOLDER_PROTECTION' => tr('Web folder protection'), - 'TR_WEB_FOLDER_PROTECTION_HELP' => tr("If set to 'yes', Web folders as provisioned by i-MSCP will be protected against deletion using the immutable flag (only if supported by the file system)."), + 'TR_WEB_FOLDER_PROTECTION_HELP' => tr('If set to `yes`, Web folders will be protected against deletion.'), 'TR_SOFTWARE_SUPP' => tr('Software installer') )); generateNavigation($tpl); - -global $dmnName, $dmnExpire, $php, $cgi, $sub, $als, $mail, $mailQuota, $ftp, $sqlDb, $sqlUser, $traffic, $diskSpace, - $backup, $dns, $aps, $extMailServer, $webFolderProtection; - -if (!get_pageone_param()) { - set_page_message(tr('Domain data were been altered. Please try again.'), 'error'); - unsetMessages(); - redirectTo('user_add1.php'); -} - -if (isset($_POST['uaction']) && ('user_add2_nxt' == $_POST['uaction']) && (!isset($_SESSION['step_one']))) { - if (check_user_data($phpini)) { - $_SESSION['step_two_data'] = "$dmnName;0"; - $_SESSION['ch_hpprops'] = - "$php;$cgi;$sub;$als;$mail;$ftp;$sqlDb;$sqlUser;$traffic;$diskSpace;" . implode('|', $backup) . ";$dns;$aps;" . - $phpini->getClientPermission('phpiniSystem') . ';' . - $phpini->getClientPermission('phpiniAllowUrlFopen') . ';' . - $phpini->getClientPermission('phpiniDisplayErrors') . ';' . - $phpini->getClientPermission('phpiniDisableFunctions') . ';' . - $phpini->getClientPermission('phpiniMailFunction') . ';' . - $phpini->getDomainIni('phpiniPostMaxSize') . ";" . - $phpini->getDomainIni('phpiniUploadMaxFileSize') . ';' . - $phpini->getDomainIni('phpiniMaxExecutionTime') . ';' . - $phpini->getDomainIni('phpiniMaxInputTime') . ';' . - $phpini->getDomainIni('phpiniMemoryLimit') . ';' . - $extMailServer . ';' . $webFolderProtection . ';' . $mailQuota * 1048576; - - if (reseller_limits_check($_SESSION['user_id'], $_SESSION['ch_hpprops'])) { - redirectTo('user_add3.php'); - } - } -} else { - unset($_SESSION['step_one']); - global $hpId; - reseller_getHostingPlanData($hpId, $_SESSION['user_id'], $phpini); -} - -get_init_au2_page($tpl, $phpini); - -if (!resellerHasFeature('subdomains')) { - $tpl->assign('SUBDOMAIN_FEATURE', ''); -} - -if (!resellerHasFeature('domain_aliases')) { - $tpl->assign('ALIAS_FEATURE', ''); -} - -if (!resellerHasFeature('custom_dns_records')) { - $tpl->assign('CUSTOM_DNS_RECORDS_FEATURE', ''); -} - -if (!resellerHasFeature('mail')) { - $tpl->assign('MAIL_FEATURE', ''); - $tpl->assign('EXT_MAIL_FEATURE', ''); -} - -if (!resellerHasFeature('ftp')) { - $tpl->assign('FTP_FEATURE', ''); -} - -if (!resellerHasFeature('sql')) { - $tpl->assign('SQL_FEATURE', ''); -} - -if (!resellerHasFeature('aps')) { - $tpl->assign('APS_FEATURE', ''); -} - -if (!resellerHasFeature('backup')) { - $tpl->assign('BACKUP_FEATURE', ''); -} - +generatePage($tpl); generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); diff --git a/gui/public/reseller/user_add3.php b/gui/public/reseller/user_add3.php index 4479efa073..45576bee1f 100644 --- a/gui/public/reseller/user_add3.php +++ b/gui/public/reseller/user_add3.php @@ -1,28 +1,21 @@ * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * The Original Code is "VHCS - Virtual Hosting Control System". - * - * The Initial Developer of the Original Code is moleSoftware GmbH. - * Portions created by Initial Developer are Copyright (C) 2001-2006 - * by moleSoftware GmbH. All Rights Reserved. - * - * Portions created by the ispCP Team are Copyright (C) 2006-2010 by - * isp Control Panel. All Rights Reserved. - * - * Portions created by the i-MSCP Team are Copyright (C) 2010-2016 by - * i-MSCP - internet Multi Server Control Panel. All Rights Reserved. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*********************************************************************************************************************** @@ -30,11 +23,11 @@ */ /** - * Get data from previous page + * Get data from previous step * * @return bool */ -function getPreviousPageData() +function getPreviousStepData() { global $hpId, $dmnName, $adminName, $dmnExpire; @@ -69,52 +62,37 @@ function getPreviousPageData() return true; } -/** - * Init global value with empty values - * - * @return void - */ -function reseller_generateEmptyPage() -{ - global $email, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, $state, $country, $street1, - $street2, $phone, $fax, $domainIp; - - $email = $customerId = $firstName = $lastName = $firm = $zip = $city = $state = $country = $street1 = $street2 = - $phone = $mail = $fax = $domainIp = ''; - $gender = 'U'; -} - /** * Generates page * * @param iMSCP_pTemplate $tpl Template engine * @return void */ -function reseller_generatePage($tpl) +function generatePage($tpl) { - global $hpId, $dmnName, $adminName, $email, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, - $state, $country, $street1, $street2, $phone, $fax, $domainIp; + global $hpId, $dmnName, $adminName, $email, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, $state, + $country, $street1, $street2, $phone, $fax, $domainIp; - $cfg = iMSCP_Registry::get('config'); $adminName = decode_idna($adminName); + $tpl->assign(array( - 'VL_USERNAME' => tohtml($adminName), - 'VL_MAIL' => tohtml($email), - 'VL_USR_ID' => $customerId, - 'VL_USR_NAME' => tohtml($firstName), - 'VL_LAST_USRNAME' => tohtml($lastName), - 'VL_USR_FIRM' => tohtml($firm), - 'VL_USR_POSTCODE' => tohtml($zip), - 'VL_USRCITY' => tohtml($city), - 'VL_USRSTATE' => tohtml($state), - 'VL_MALE' => $gender == 'M' ? $cfg['HTML_SELECTED'] : '', - 'VL_FEMALE' => $gender == 'F' ? $cfg['HTML_SELECTED'] : '', - 'VL_UNKNOWN' => $gender == 'U' ? $cfg['HTML_SELECTED'] : '', - 'VL_COUNTRY' => tohtml($country), - 'VL_STREET1' => tohtml($street1), - 'VL_STREET2' => tohtml($street2), - 'VL_PHONE' => tohtml($phone), - 'VL_FAX' => tohtml($fax) + 'VL_USERNAME' => tohtml($adminName, 'htmlAttr'), + 'VL_MAIL' => tohtml($email, 'htmlAttr'), + 'VL_USR_ID' => tohtml($customerId, 'htmlAttr'), + 'VL_USR_NAME' => tohtml($firstName, 'htmlAttr'), + 'VL_LAST_USRNAME' => tohtml($lastName, 'htmlAttr'), + 'VL_USR_FIRM' => tohtml($firm, 'htmlAttr'), + 'VL_USR_POSTCODE' => tohtml($zip, 'htmlAttr'), + 'VL_USRCITY' => tohtml($city, 'htmlAttr'), + 'VL_USRSTATE' => tohtml($state, 'htmlAttr'), + 'VL_MALE' => $gender == 'M' ? ' selected' : '', + 'VL_FEMALE' => $gender == 'F' ? ' selected' : '', + 'VL_UNKNOWN' => $gender == 'U' ? ' selected' : '', + 'VL_COUNTRY' => tohtml($country, 'htmlAttr'), + 'VL_STREET1' => tohtml($street1, 'htmlAttr'), + 'VL_STREET2' => tohtml($street2, 'htmlAttr'), + 'VL_PHONE' => tohtml($phone, 'htmlAttr'), + 'VL_FAX' => tohtml($fax, 'htmlAttr') )); reseller_generate_ip_list($tpl, $_SESSION['user_id'], $domainIp); @@ -127,12 +105,11 @@ function reseller_generatePage($tpl) * @throws iMSCP_Exception_Database * @return void */ -function reseller_addCustomer() +function addCustomer() { global $hpId, $dmnName, $dmnExpire, $domainIp, $adminName, $email, $password, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, $state, $country, $phone, $fax, $street1, $street2; - $resellerId = intval($_SESSION['user_id']); $cfg = iMSCP_Registry::get('config'); if (isset($_SESSION['ch_hpprops'])) { @@ -140,9 +117,8 @@ function reseller_addCustomer() unset($_SESSION['ch_hpprops']); } else { $stmt = exec_query('SELECT props FROM hosting_plans WHERE reseller_id = ? AND id = ?', array( - $resellerId, $hpId + $_SESSION['user_id'], $hpId )); - $data = $stmt->fetchRow(); $props = $data['props']; } @@ -152,7 +128,7 @@ function reseller_addCustomer() $phpiniAllowUrlFopen, $phpiniDisplayErrors, $phpiniDisableFunctions, $phpMailFunction, $phpiniPostMaxSize, $phpiniUploadMaxFileSize, $phpiniMaxExecutionTime, $phpiniMaxInputTime, $phpiniMemoryLimit, $extMailServer, $webFolderProtection, $mailQuota - ) = explode(';', $props); + ) = explode(';', $props); $php = str_replace('_', '', $php); $cgi = str_replace('_', '', $cgi); @@ -168,7 +144,7 @@ function reseller_addCustomer() try { iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onBeforeAddDomain, array( 'domainName' => $dmnName, - 'createdBy' => $resellerId, + 'createdBy' => $_SESSION['user_id'], 'customerId' => $customerId, 'customerEmail' => $email )); @@ -176,24 +152,24 @@ function reseller_addCustomer() $db->beginTransaction(); exec_query( - " + ' INSERT INTO admin ( admin_name, admin_pass, admin_type, domain_created, created_by, fname, lname, firm, zip, city, state, country, email, phone, fax, street1, street2, customer_id, gender, admin_status ) VALUES ( - ?, ?, 'user', unix_timestamp(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? + ?, ?, ?, unix_timestamp(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) - ", + ', array( - $adminName, $encryptedPassword, $resellerId, $firstName, $lastName, $firm, $zip, $city, $state, - $country, $email, $phone, $fax, $street1, $street2, $customerId, $gender, 'toadd' + $adminName, $encryptedPassword, 'user', $_SESSION['user_id'], $firstName, $lastName, $firm, $zip, $city, + $state, $country, $email, $phone, $fax, $street1, $street2, $customerId, $gender, 'toadd' ) ); $adminId = $db->insertId(); exec_query( - " + ' INSERT INTO domain ( domain_name, domain_admin_id, domain_created, domain_expires, domain_mailacc_limit, domain_ftpacc_limit, domain_traffic_limit, domain_sqld_limit, domain_sqlu_limit, domain_status, @@ -204,7 +180,7 @@ function reseller_addCustomer() ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) - ", + ', array( $dmnName, $adminId, time(), $dmnExpire, $mail, $ftp, $traff, $sql_db, $sql_user, 'toadd', $als, $sub, $domainIp, $disk, 0, $php, $cgi, $backup, $dns, $aps, $phpEditor, $phpiniAllowUrlFopen, @@ -217,45 +193,36 @@ function reseller_addCustomer() if ($phpEditor == 'yes') { $phpini = iMSCP_PHPini::getInstance(); - - // fill it with the custom values - other take from default - $phpini->setDomainIni('phpiniPostMaxSize', $phpiniPostMaxSize); + $phpini->setDomainIni('phpiniMemoryLimit', $phpiniMemoryLimit); // Must be set before phpiniPostMaxSize + $phpini->setDomainIni('phpiniPostMaxSize', $phpiniPostMaxSize); // Must be set before phpiniUploadMaxFileSize $phpini->setDomainIni('phpiniUploadMaxFileSize', $phpiniUploadMaxFileSize); $phpini->setDomainIni('phpiniMaxExecutionTime', $phpiniMaxExecutionTime); $phpini->setDomainIni('phpiniMaxInputTime', $phpiniMaxInputTime); - $phpini->setDomainIni('phpiniMemoryLimit', $phpiniMemoryLimit); $phpini->saveDomainIni($adminId, $dmnId, 'dmn'); } exec_query('INSERT INTO htaccess_users (dmn_id, uname, upass, status) VALUES (?, ?, ?, ?)', array( $dmnId, $dmnName, $encryptedPassword, 'toadd' )); - - $user_id = $db->insertId(); - exec_query('INSERT INTO htaccess_groups (dmn_id, ugroup, members, status) VALUES (?, ?, ?, ?)', array( - $dmnId, 'statistics', $user_id, 'toadd' + $dmnId, 'statistics', $db->insertId(), 'toadd' )); - // Create default addresses if needed if ($cfg['CREATE_DEFAULT_EMAIL_ADDRESSES']) { client_mail_add_default_accounts($dmnId, $email, $dmnName); } - // let's send mail to user - send_add_user_auto_msg($resellerId, $adminName, $password, $email, $firstName, $lastName, tr('Customer')); - + send_add_user_auto_msg($_SESSION['user_id'], $adminName, $password, $email, $firstName, $lastName, tr('Customer')); exec_query('INSERT INTO user_gui_props (user_id, lang, layout) VALUES (?, ?, ?)', array( $adminId, $cfg['USER_INITIAL_LANG'], $cfg['USER_INITIAL_THEME'] )); - - update_reseller_c_props($resellerId); + update_reseller_c_props($_SESSION['user_id']); $db->commit(); iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAfterAddDomain, array( 'domainName' => $dmnName, - 'createdBy' => $resellerId, + 'createdBy' => $_SESSION['user_id'], 'customerId' => $adminId, 'customerEmail' => $email, 'domainId' => $dmnId @@ -280,19 +247,28 @@ function reseller_addCustomer() iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart); check_login('reseller'); -if (!getPreviousPageData()) { +// Initialize global variables +$email = $customerId = $firstName = $lastName = $firm = $zip = $city = $state = $country = $street1 = $street2 = ''; +$phone = $mail = $fax = $domainIp = ''; +$gender = 'U'; + +$phpini = iMSCP_PHPini::getInstance(); +$phpini->loadResellerPermissions($_SESSION['user_id']); // Load reseller PHP permissions +$phpini->loadClientPermissions(); // Load client default PHP permissions +$phpini->loadDomainIni(); // Load domain default PHP configuration options + +if (!getPreviousStepData()) { set_page_message(tr('Data were been altered. Please try again.'), 'error'); unsetMessages(); redirectTo('user_add1.php'); } -if (isset($_POST['uaction']) && ($_POST['uaction'] === 'user_add3_nxt') && !isset($_SESSION['step_two_data'])) { +if (isset($_POST['uaction']) && 'user_add3_nxt' == $_POST['uaction'] && !isset($_SESSION['step_two_data'])) { if (check_ruser_data()) { - reseller_addCustomer(); + addCustomer(); } } else { unset($_SESSION['step_two_data']); - reseller_generateEmptyPage(); } $tpl = new iMSCP_pTemplate(); @@ -334,12 +310,8 @@ function reseller_addCustomer() 'TR_BTN_ADD_USER' => tr('Add user') )); -if (!resellerHasFeature('domain_aliases')) { - $tpl->assign('ALIAS_FEATURE', ''); -} - generateNavigation($tpl); -reseller_generatePage($tpl); +generatePage($tpl); generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); diff --git a/gui/themes/default/reseller/user_add2.tpl b/gui/themes/default/reseller/user_add2.tpl index 43cdc5c68b..7f631d706d 100644 --- a/gui/themes/default/reseller/user_add2.tpl +++ b/gui/themes/default/reseller/user_add2.tpl @@ -1,6 +1,30 @@ - -
+ + + @@ -10,7 +34,7 @@ - +
{TR_NAME}{VL_TEMPLATE_NAME}{VL_TEMPLATE_NAME}
@@ -25,48 +49,48 @@ - + - + - + - + - + - + - + - + - + @@ -82,9 +106,9 @@ {TR_PHP}
- + - +
@@ -92,7 +116,7 @@ - +
@@ -100,12 +124,12 @@
-
+
{TR_FIELDS_OK}
- +
@@ -170,22 +194,13 @@
{TR_PERMISSIONS}
- +
- - - - - - - - @@ -198,6 +213,14 @@ + + + + + + + +
{TR_DIRECTIVES_VALUES}
{TR_MIB} -
{TR_MIB}
{TR_SEC} {TR_MIB}
{TR_MIB}
{TR_MIB}
@@ -273,7 +296,7 @@ - +
@@ -291,4 +314,3 @@
- diff --git a/gui/themes/default/reseller/user_add3.tpl b/gui/themes/default/reseller/user_add3.tpl index f54f9757ee..28d27e5c7e 100644 --- a/gui/themes/default/reseller/user_add3.tpl +++ b/gui/themes/default/reseller/user_add3.tpl @@ -1,111 +1,109 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{TR_CORE_DATA}
{TR_USERNAME}{VL_USERNAME}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{TR_ADDITIONAL_DATA}
- -
-
- - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{TR_CORE_DATA}
{TR_USERNAME}{VL_USERNAME}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{TR_ADDITIONAL_DATA}
+ +
+
+ + +
-