Skip to content

Commit eed784b

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1782 from jaapmarcus/fix/prefix-user-name
Fix issues where prefix db / ftp users
2 parents f91d9a3 + 99f7a28 commit eed784b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

web/templates/header.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
// GLOBAL SETTINGS
1111
//
1212
var GLOBAL = {};
13-
GLOBAL.FTP_USER_PREFIX = 'admin_';
14-
GLOBAL.DB_USER_PREFIX = 'admin_';
15-
GLOBAL.DB_DBNAME_PREFIX = 'admin_';
13+
GLOBAL.FTP_USER_PREFIX = '';
14+
GLOBAL.DB_USER_PREFIX = '';
15+
GLOBAL.DB_DBNAME_PREFIX = '';
1616
GLOBAL.AJAX_URL = '';
1717
</script>
1818
</head>

web/templates/pages/add_db.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,6 @@
240240
</div>
241241

242242
<script>
243-
GLOBAL.DB_USER_PREFIX = <?php json_encode($user.'_') ?>;
244-
GLOBAL.DB_DBNAME_PREFIX = <?php json_encode($user.'_') ?>;
243+
GLOBAL.DB_USER_PREFIX = "<?php echo htmlentities($user.'_');?>";
244+
GLOBAL.DB_DBNAME_PREFIX = "<?php echo htmlentities($user.'_')?>";
245245
</script>

web/templates/pages/edit_db.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@
139139
</div>
140140
<?php if ($v_type == 'pgsql'){ $user=strtolower($user); } ?>
141141
<script>
142-
GLOBAL.DB_USER_PREFIX = <?php json_encode($user.'_') ?>;
143-
GLOBAL.DB_DBNAME_PREFIX = <?php json_encode($user.'_') ?>;
142+
GLOBAL.DB_USER_PREFIX = "<?php echo htmlentities($user.'_');?>";
143+
GLOBAL.DB_DBNAME_PREFIX = "<?php echo htmlentities($user.'_')?>";
144144
</script>

web/templates/pages/edit_web.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,5 +680,5 @@
680680
</div>
681681
</div>
682682
<script>
683-
GLOBAL.FTP_USER_PREFIX = <?php json_encode($user.'_') ?>;
683+
GLOBAL.FTP_USER_PREFIX = "<?php echo htmlentities($user.'_') ?>";
684684
</script>

0 commit comments

Comments
 (0)