Skip to content

Commit

Permalink
Fixed: Client domain management page must not be hidden even if custo…
Browse files Browse the repository at this point in the history
…mer cannot add domain aliases and subdomains

Typo
  • Loading branch information
nuxwin committed Apr 28, 2015
1 parent 2d4beee commit a06a174
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -48,6 +48,7 @@ DISTRIBUTIONS
FRONTEND
Added Custom DNS items in debugger interface ( admin level )
Changed: Stores the Github payload as json file instead of PHP file ( iMSCP_Update_Version::getUpdateInfo() )
Fixed: Client domain management page must not be hidden even if customer cannot add domain aliases and subdomains
Fixed: Do not fetch more data than needed from GitHub ( iMSCP_Update_Version::getUpdateInfo() )
Fixed: Force reload of newest mail body footprint file ( iMSCP_Exception_Writer_Mail::onUncaughtException() )
Fixed: Html in title attribute must not be auto-escaped by jQueryUI tooltip
Expand Down
13 changes: 4 additions & 9 deletions autoinstaller/Adapter/DebianAdapter.pm
Expand Up @@ -68,9 +68,7 @@ sub installPreRequiredPackages
my $command = 'apt-get';
my $preseed = iMSCP::Getopt->preseed;

unless(iMSCP::ProgramFinder::find($command)) {
fatal('Not a Debian like system');
}
fatal('Not a Debian like system') unless iMSCP::ProgramFinder::find($command);

# Ensure packages index is up to date
my $rs = $self->_updatePackagesIndex();
Expand Down Expand Up @@ -171,12 +169,9 @@ if [ "\$action" = "start" ] && { [ "\$initscript" = "apache2" ] || [ "\$initscri
fi
exit 0
EOF
return $rs if $rs;

$rs = $file->save();
return $rs if $rs;

$rs = $file->mode(0755);
$rs ||= $file->save();
$rs ||= $file->mode(0755);
return $rs if $rs;

my $preseed = iMSCP::Getopt->preseed;
Expand Down Expand Up @@ -219,7 +214,7 @@ EOF
Uninstall Debian packages
Param \@packages OPTIONAL List of packages to uninstall ( default is list from the packagesToUninstall attribute )
Param array \@packages OPTIONAL List of packages to uninstall ( default is list from the packagesToUninstall attribute )
Return int 0 on success, other on failure
=cut
Expand Down
22 changes: 12 additions & 10 deletions gui/library/Functions/Client.php
Expand Up @@ -280,15 +280,16 @@ function customerHasFeature($featureNames, $forceReload = false)
if (null === $availableFeatures || $forceReload) {
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$debug = (bool)$cfg->DEBUG;
$debug = (bool)$cfg['DEBUG'];
$dmnProps = get_domain_default_props($_SESSION['user_id']);

$availableFeatures = array(
'domain' => ($dmnProps['domain_alias_limit'] != '-1'
/*'domain' => ($dmnProps['domain_alias_limit'] != '-1'
|| $dmnProps['domain_subd_limit'] != '-1'
|| $dmnProps['domain_dns'] == 'yes'
|| $dmnProps['phpini_perm_system'] == 'yes'
|| $cfg['ENABLE_SSL']) ? true : false,
*/
'external_mail' => ($dmnProps['domain_external_mail'] == 'yes') ? true : false,
'php' => ($dmnProps['domain_php'] == 'yes') ? true : false,
'php_editor' => ($dmnProps['phpini_perm_system'] == 'yes' &&
Expand All @@ -303,19 +304,20 @@ function customerHasFeature($featureNames, $forceReload = false)
'domain_aliases' => ($dmnProps['domain_alias_limit'] != '-1') ? true : false,
'custom_dns_records' =>
($dmnProps['domain_dns'] != 'no' && $cfg['NAMED_SERVER'] != 'external_server') ? true : false,
'webstats' => ($cfg->WEBSTATS_PACKAGES != 'No') ? true : false,
'backup' => ($cfg->BACKUP_DOMAINS != 'no' && $dmnProps['allowbackup'] != 'no') ? true : false,
'webstats' => ($cfg['WEBSTATS_PACKAGES'] != 'No') ? true : false,
'backup' => ($cfg['BACKUP_DOMAINS'] != 'no' && $dmnProps['allowbackup'] != 'no') ? true : false,
'protected_areas' => true,
'custom_error_pages' => true,
'aps' => ($dmnProps['domain_software_allowed'] != 'no' && $dmnProps['domain_ftpacc_limit'] != '-1')
? true : false,
'aps' => ($dmnProps['domain_software_allowed'] != 'no' && $dmnProps['domain_ftpacc_limit'] != '-1') ? true : false,
'ssl' => ($cfg['ENABLE_SSL']) ? true : false
);

if (($cfg->IMSCP_SUPPORT_SYSTEM)) {
$query = "SELECT support_system FROM reseller_props WHERE reseller_id = ?";
$stmt = exec_query($query, $_SESSION['user_created_by']);
$availableFeatures['support'] = ($stmt->fields['support_system'] == 'yes') ? true : false;
if (($cfg['IMSCP_SUPPORT_SYSTEM'])) {
$stmt = exec_query(
'SELECT support_system FROM reseller_props WHERE reseller_id = ?', $_SESSION['user_created_by']
);
$row = $stmt->fetchRow(PDO::FETCH_ASSOC);
$availableFeatures['support'] = ($row['support_system'] == 'yes') ? true : false;
} else {
$availableFeatures['support'] = false;
}
Expand Down
2 changes: 1 addition & 1 deletion gui/public/client/domains_manage.php
Expand Up @@ -658,7 +658,7 @@ function _client_generateCustomDnsRecordAction($action, $id, $status, $ownedBy =
check_login('user');

// If the feature is disabled, redirects in silent way
customerHasFeature('domain') or showBadRequestErrorPage();
//customerHasFeature('domain') or showBadRequestErrorPage();

$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(
Expand Down
21 changes: 11 additions & 10 deletions gui/public/client/index.php
Expand Up @@ -179,16 +179,17 @@ function client_generateFeatureStatus($tpl)

$tpl->assign(
array(
'DOMAIN_FEATURE_STATUS' => customerHasFeature('domain') ? $trYes : $trNo,
'PHP_FEATURE_STATUS' => customerHasFeature('php') ? $trYes : $trNo,
'PHP_DIRECTIVES_EDITOR_STATUS' => customerHasFeature('php_editor') ? $trYes : $trNo,
'CGI_FEATURE_STATUS' => customerHasFeature('cgi') ? $trYes : $trNo,
'CUSTOM_DNS_RECORDS_FEATURE_STATUS' => customerHasFeature('custom_dns_records') ? $trYes : $trNo,
'EXTERNAL_MAIL_SERVERS_FEATURE_STATUS' => customerHasFeature('external_mail') ? $trYes : $trNo,
'APP_INSTALLER_FEATURE_STATUS' => customerHasFeature('aps') ? $trYes : $trNo,
'WEBSTATS_FEATURE_STATUS' => customerHasFeature('webstats') ? $trYes : $trNo
)
);
//'DOMAIN_FEATURE_STATUS' => customerHasFeature('domain') ? $trYes : $trNo,
'DOMAIN_FEATURE_STATUS' => $trYes,
'PHP_FEATURE_STATUS' => customerHasFeature('php') ? $trYes : $trNo,
'PHP_DIRECTIVES_EDITOR_STATUS' => customerHasFeature('php_editor') ? $trYes : $trNo,
'CGI_FEATURE_STATUS' => customerHasFeature('cgi') ? $trYes : $trNo,
'CUSTOM_DNS_RECORDS_FEATURE_STATUS' => customerHasFeature('custom_dns_records') ? $trYes : $trNo,
'EXTERNAL_MAIL_SERVERS_FEATURE_STATUS' => customerHasFeature('external_mail') ? $trYes : $trNo,
'APP_INSTALLER_FEATURE_STATUS' => customerHasFeature('aps') ? $trYes : $trNo,
'WEBSTATS_FEATURE_STATUS' => customerHasFeature('webstats') ? $trYes : $trNo
)
);

if (customerHasFeature('backup')) {
$domainProperties = get_domain_default_props($_SESSION['user_id']);
Expand Down
2 changes: 1 addition & 1 deletion gui/themes/default/client/navigation.xml
Expand Up @@ -46,7 +46,7 @@
<label>Domains</label>
<uri>/client/domains_manage.php</uri>
<class>domains</class>
<privilege_callback name="customerHasFeature" param="domain"/>
<!--<privilege_callback name="customerHasFeature" param="domain"/>-->
<pages>
<overview>
<label>Overview</label>
Expand Down

0 comments on commit a06a174

Please sign in to comment.