Skip to content

Commit c4a5bae

Browse files
author
Till Brehm
committed
Merge branch 'patch-2' into 'master'
Added possibility to set new aps to disabled by default 2 Update for https://git.ispconfig.org/ispconfig/ispconfig3/merge_requests/552 See merge request !558
2 parents ffbd9eb + ce8d5af commit c4a5bae

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

install/tpl/system.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ vhost_aliasdomains=n
3232
client_username_web_check_disabled=n
3333
backups_include_into_web_quota=n
3434
reseller_can_use_options=n
35+
asp_new_package_disabled=y
3536

3637

3738
[tools]

interface/lib/classes/aps_crawler.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ public function parseFolderToDB()
568568
//$pkg_url = $this->app_download_url_list[$pkg];
569569
$pkg_url = @file_get_contents($this->interface_pkg_dir.'/'.$pkg.'/PKG_URL');
570570

571+
//* Get global sites config
572+
$sites_config = $app->getconf->get_global_config('sites');
573+
571574
// Insert only if data is complete
572575
if($pkg != '' && $pkg_name != '' && $pkg_category != '' && $pkg_version != '' && $pkg_release != '' && $pkg_url){
573576
$insert_data = array(
@@ -577,7 +580,7 @@ public function parseFolderToDB()
577580
"version" => $pkg_version,
578581
"release" => $pkg_release,
579582
"package_url" => $pkg_url,
580-
"package_status" => PACKAGE_ENABLED
583+
"package_status" => $sites_config['asp_new_package_disabled'] == 'y' ? PACKAGE_LOCKED : PACKAGE_ENABLED
581584
);
582585
$app->db->datalogInsert('aps_packages', $insert_data, 'id');
583586
} else {

interface/web/admin/form/system_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@
160160
'default' => 'n',
161161
'value' => array(0 => 'n', 1 => 'y')
162162
),
163+
'asp_new_package_disabled' => array(
164+
'datatype' => 'VARCHAR',
165+
'formtype' => 'CHECKBOX',
166+
'default' => 'n',
167+
'value' => array(0 => 'n', 1 => 'y')
168+
),
163169
'client_username_web_check_disabled' => array (
164170
'datatype' => 'VARCHAR',
165171
'formtype' => 'CHECKBOX',

interface/web/admin/lib/lang/en_system_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
1717
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
1818
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
1919
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
20+
$wb["asp_new_package_disabled_txt"] = 'Disable new aps packages';
2021
$wb["dbname_prefix_error_regex"] = 'Char not allowed in database name prefix.';
2122
$wb["dbuser_prefix_error_regex"] = 'Char not allowed in database user prefix.';
2223
$wb["ftpuser_prefix_error_regex"] = 'Char not allowed in ftp user prefix.';

interface/web/admin/templates/system_config_sites_edit.htm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ <h1><tmpl_var name="list_head_txt"></h1>
4545
{tmpl_var name='vhost_aliasdomains'}&nbsp;{tmpl_var name='vhost_aliasdomains_note_txt'}
4646
</div>
4747
</div>
48+
<div class="form-group">
49+
<label class="col-sm-3 control-label">{tmpl_var name='asp_new_package_disabled_txt'}</label>
50+
<div class="col-sm-9">
51+
{tmpl_var name='asp_new_package_disabled'}
52+
</div>
53+
</div>
4854
<div class="form-group">
4955
<label class="col-sm-3 control-label">{tmpl_var name='client_username_web_check_disabled_txt'}</label>
5056
<div class="col-sm-9">

0 commit comments

Comments
 (0)