Skip to content

Commit 5c87dfb

Browse files
[js, php] permsions fixes, date format
1 parent 0e0d6b6 commit 5c87dfb

File tree

14 files changed

+1346
-137
lines changed

14 files changed

+1346
-137
lines changed

web/js/__init__.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ App.Ajax.request('MAIN.about', {}, function(reply) {
66
App.Settings.VestaAbout.version_name = reply.data.version_name;
77
}
88
});
9+
10+
911
$('document').ready(function() {
1012
try {
1113
App.Utils.detectBrowser();

web/js/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ App.Actions.save_form = function(evt) {
378378
else { // OLD ITEM, UPDATING IT
379379
var source = $(elm).find('.source').val();
380380
var values = App.Helpers.getFormValues(elm);
381-
if(App.Validate.form(values, $('#'+elm_id))) {
382-
App.Model.update(values, source, elm);
381+
if(App.Validate.form(values, $('#'+elm_id))) {
382+
App.Model.update(values, source, elm);
383383
}
384384
}
385385
}

web/js/html.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ App.HTML.Build.user_form = function (options, id) {
112112
} else {
113113
tpl.set(':NS', '');
114114
}
115+
115116
tpl = App.HTML.setTplKeys(tpl, options, true);
116117
tpl = App.HTML.Build.user_selects(tpl, options);
117118
tpl = App.HTML.toggle_suspended_form(tpl, options);
118-
if (options.REPORTS_ENABLED == 'yes') {
119+
if (options.REPORTS_ENABLED == 'yes' || options.REPORTS_ENABLED == 'on') {
119120
tpl.set(':CHECKED', 'checked="checked"');
120121
} else {
121122
tpl.set(':CHECKED', '');
@@ -177,10 +178,13 @@ App.HTML.Build.web_domain_form = function (options, id) {
177178
tpl = App.HTML.setTplKeys(tpl, options, true);
178179
tpl = App.HTML.Build.web_domain_selects(tpl, options);
179180
tpl = App.HTML.toggle_suspended_form(tpl, options);
180-
if (options.CGI == 'yes' || !in_edit) {
181+
182+
if (options.CGI == 'yes' || options.CGI == 'on' || !in_edit) {
181183
tpl.set(':CHECKED_CGI', 'checked="checked"');
182184
}
183-
if (options.ELOG == 'yes') {
185+
186+
187+
if (options.ELOG == 'yes' || options.ELOG == 'on') {
184188
tpl.set(':CHECKED_ELOG', 'checked="checked"');
185189
}
186190
if (options.STATS_LOGIN.trim() != '') {
@@ -212,6 +216,9 @@ App.HTML.Build.web_domain_form = function (options, id) {
212216
tpl.set(':SSL_CA', '');
213217
}
214218

219+
tpl.set(':DNS_DOMAIN_ALSO', in_edit? 'hidden' : '');
220+
221+
215222
return tpl.finalize();
216223
}
217224

@@ -290,16 +297,12 @@ App.HTML.Build.ip_entry = function (o) {
290297

291298
return tpl.finalize();
292299
}
293-
App.HTML.Build.dns_entry = function (o, is_new) {
300+
App.HTML.Build.dns_entry = function (o) {
294301
var tpl = App.Templates.get('ENTRY', 'dns');
295302
tpl = App.HTML.setTplKeys(tpl, o);
296303
var ip = o.IP.split('.');
297304
tpl.set(':IP', ip.join('<span class="dot">.</span>'));
298305
tpl.set(':CHECKED', '');
299-
if (is_new) {
300-
var now = new Date();
301-
tpl.set(':DATE', now.format("d.mm.yyyy"));
302-
}
303306
tpl.set(':TPL_VAL', o.TPL);
304307
tpl = App.HTML.toggle_suspended_entry(tpl, o);
305308

@@ -354,7 +357,8 @@ App.HTML.Build.user_entry = function (o, key) {
354357
tpl.set(':NS', ns_custom.finalize());
355358
}
356359
tpl = App.HTML.Build.user_web_tpl(tpl, o);
357-
tpl.set(':REPORTS_ENABLED', o.REPORTS_ENABLED == 'yes' ? 'enabled' : 'DISABLED');
360+
361+
tpl.set(':REPORTS_ENABLED', o.REPORTS_ENABLED == 'yes' || o.REPORTS_ENABLED == 'on' ? 'enabled' : 'DISABLED');
358362
if (o.U_DISK_PERCENTAGE > 100) {
359363
var tpl_over = App.Templates.get('over_bar', 'general');
360364
var difference = parseInt(o.U_DISK_PERCENTAGE, 10) - 100;

web/js/pages.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,27 @@ App.Pages.init = function()
44
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
55
App.Env.initialParams = reply.data;
66
App.Helpers.updateInitial();
7-
if (!App.Env.initialParams.auth_user.admin) {
7+
});
8+
9+
10+
/*
11+
if (!App.Env.initialParams.auth_user.admin) {
812
var head= document.getElementsByTagName('head')[0];
913
var script= document.createElement('script');
1014
script.type= 'text/javascript';
1115
script.src= App.Helpers.generateUrl('js/user_templates.js?'+Math.random());
1216
head.appendChild(script);
13-
}
14-
});
17+
}
18+
else{
19+
var head= document.getElementsByTagName('head')[0];
20+
var script= document.createElement('script');
21+
script.type= 'text/javascript';
22+
script.src= App.Helpers.generateUrl('js/templates.js?'+Math.random());
23+
head.appendChild(script);
24+
}
25+
*/
26+
27+
1528
}
1629

1730
App.Pages.prepareHTML();
@@ -45,6 +58,8 @@ App.Pages.prepareHTML = function()
4558

4659
App.Pages.DNS.showSubform = function(ref)
4760
{
61+
fb.log('loading');
62+
return;
4863
App.Helpers.showLoading();
4964
var data = ref.find('.source:first').val();
5065
App.Ajax.request('DNS.getListRecords', {

web/js/templates.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ App.Templates.html = {
144144
</select>\
145145
<span class="context-settings do_action_view_dns_template_settings">View template settings</span>\
146146
</div>\
147-
<!-- div class="form-row cc">\
147+
<div class="form-row cc">\
148148
<label for="#" class="field-label">TTL:</label>\
149149
<input type="text" value="~!:TTL~!" name="TTL" class="text-field ttl-field rule-required rule-numeric">\
150150
</div>\
151151
<div class="form-row cc">\
152152
<label for="#" class="field-label">SOA:</label>\
153153
<input type="text" value="~!:SOA~!" name="SOA" class="text-field rule-required rule-ns">\
154-
</div -->\
154+
</div>\
155155
<div class="form-row suspended cc">\
156156
<label for="#" class="field-label">Suspended:</label>\
157157
<input type="checkbox" ~!:SUSPENDED_CHECKED~! value="~!:SUSPENDED_VALUE~!" class="styled do_action_toggle_suspend" name="SUSPEND" />\
@@ -474,9 +474,9 @@ App.Templates.html = {
474474
<span class="prop-value">~!:FULLNAME~!</span>\
475475
</span>\ </div>\
476476
<div class="user-details-box">\
477-
<!-- span class="prop-box prop-box_group-values cc user-details do_action_login_as">\
477+
<span class="prop-box prop-box_group-values cc user-details do_action_login_as">\
478478
<span class="prop-value login-as do_action_login_as">login as</span>\
479-
</span -->\
479+
</span>\
480480
<span class="prop-box prop-box_group-values cc user-details">\
481481
<span class="prop-title">email:</span>\
482482
<span class="group-values">\
@@ -650,10 +650,10 @@ App.Templates.html = {
650650
<select name="STAT" class="styled">~!:STAT_OPTIONS~!</select>\
651651
</div>\
652652
<div class="stats-settings">\
653-
<div class="form-row cc">\
653+
<!-- div class="form-row cc">\
654654
<label for="#" class="field-label">Password Protection:</label>\
655655
<input id="stats-auth-enable" type="checkbox" name="STATS_AUTH" ~!:stats_auth_checked~!="" value="~!:STATS_AUTH~!" class="styled do_action_toggle_stats_block">\
656-
</div>\
656+
</div -->\
657657
<div class="form-row stats-block ~!:ACTIVE_LOGIN~! cc">\
658658
<label for="#" class="field-label">stats login:</label>\
659659
<input type="text" class="text-field rule-statslogin" name="STATS_LOGIN" value="~!:STATS_LOGIN~!">\
@@ -715,7 +715,7 @@ App.Templates.html = {
715715
</div>\
716716
</div>\
717717
</div><!-- Mail options -->\
718-
<div class="form-row cc">\
718+
<div class="form-row cc ~!:DNS_DOMAIN_ALSO~!">\
719719
<label for="#" class="field-label">Create DNS domain also:</label>\
720720
<input type="checkbox" value="" name="DNS_DOMAIN" class="styled">\
721721
</div>\

0 commit comments

Comments
 (0)