diff --git a/web/js/__init__.js b/web/js/__init__.js
index 0926352f8..719c90eda 100644
--- a/web/js/__init__.js
+++ b/web/js/__init__.js
@@ -6,6 +6,8 @@ App.Ajax.request('MAIN.about', {}, function(reply) {
App.Settings.VestaAbout.version_name = reply.data.version_name;
}
});
+
+
$('document').ready(function() {
try {
App.Utils.detectBrowser();
diff --git a/web/js/actions.js b/web/js/actions.js
index dd5bbe4c7..cff0d88d9 100644
--- a/web/js/actions.js
+++ b/web/js/actions.js
@@ -378,8 +378,8 @@ App.Actions.save_form = function(evt) {
else { // OLD ITEM, UPDATING IT
var source = $(elm).find('.source').val();
var values = App.Helpers.getFormValues(elm);
- if(App.Validate.form(values, $('#'+elm_id))) {
- App.Model.update(values, source, elm);
+ if(App.Validate.form(values, $('#'+elm_id))) {
+ App.Model.update(values, source, elm);
}
}
}
diff --git a/web/js/html.js b/web/js/html.js
index f8c5d94d0..2616bf36c 100644
--- a/web/js/html.js
+++ b/web/js/html.js
@@ -112,10 +112,11 @@ App.HTML.Build.user_form = function (options, id) {
} else {
tpl.set(':NS', '');
}
+
tpl = App.HTML.setTplKeys(tpl, options, true);
tpl = App.HTML.Build.user_selects(tpl, options);
tpl = App.HTML.toggle_suspended_form(tpl, options);
- if (options.REPORTS_ENABLED == 'yes') {
+ if (options.REPORTS_ENABLED == 'yes' || options.REPORTS_ENABLED == 'on') {
tpl.set(':CHECKED', 'checked="checked"');
} else {
tpl.set(':CHECKED', '');
@@ -177,10 +178,13 @@ App.HTML.Build.web_domain_form = function (options, id) {
tpl = App.HTML.setTplKeys(tpl, options, true);
tpl = App.HTML.Build.web_domain_selects(tpl, options);
tpl = App.HTML.toggle_suspended_form(tpl, options);
- if (options.CGI == 'yes' || !in_edit) {
+
+ if (options.CGI == 'yes' || options.CGI == 'on' || !in_edit) {
tpl.set(':CHECKED_CGI', 'checked="checked"');
}
- if (options.ELOG == 'yes') {
+
+
+ if (options.ELOG == 'yes' || options.ELOG == 'on') {
tpl.set(':CHECKED_ELOG', 'checked="checked"');
}
if (options.STATS_LOGIN.trim() != '') {
@@ -212,6 +216,9 @@ App.HTML.Build.web_domain_form = function (options, id) {
tpl.set(':SSL_CA', '');
}
+ tpl.set(':DNS_DOMAIN_ALSO', in_edit? 'hidden' : '');
+
+
return tpl.finalize();
}
@@ -290,16 +297,12 @@ App.HTML.Build.ip_entry = function (o) {
return tpl.finalize();
}
-App.HTML.Build.dns_entry = function (o, is_new) {
+App.HTML.Build.dns_entry = function (o) {
var tpl = App.Templates.get('ENTRY', 'dns');
tpl = App.HTML.setTplKeys(tpl, o);
var ip = o.IP.split('.');
tpl.set(':IP', ip.join('. '));
tpl.set(':CHECKED', '');
- if (is_new) {
- var now = new Date();
- tpl.set(':DATE', now.format("d.mm.yyyy"));
- }
tpl.set(':TPL_VAL', o.TPL);
tpl = App.HTML.toggle_suspended_entry(tpl, o);
@@ -354,7 +357,8 @@ App.HTML.Build.user_entry = function (o, key) {
tpl.set(':NS', ns_custom.finalize());
}
tpl = App.HTML.Build.user_web_tpl(tpl, o);
- tpl.set(':REPORTS_ENABLED', o.REPORTS_ENABLED == 'yes' ? 'enabled' : 'DISABLED');
+
+ tpl.set(':REPORTS_ENABLED', o.REPORTS_ENABLED == 'yes' || o.REPORTS_ENABLED == 'on' ? 'enabled' : 'DISABLED');
if (o.U_DISK_PERCENTAGE > 100) {
var tpl_over = App.Templates.get('over_bar', 'general');
var difference = parseInt(o.U_DISK_PERCENTAGE, 10) - 100;
diff --git a/web/js/pages.js b/web/js/pages.js
index 1343e4496..e5d465ead 100644
--- a/web/js/pages.js
+++ b/web/js/pages.js
@@ -4,14 +4,27 @@ App.Pages.init = function()
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
App.Env.initialParams = reply.data;
App.Helpers.updateInitial();
- if (!App.Env.initialParams.auth_user.admin) {
+ });
+
+
+/*
+ if (!App.Env.initialParams.auth_user.admin) {
var head= document.getElementsByTagName('head')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= App.Helpers.generateUrl('js/user_templates.js?'+Math.random());
head.appendChild(script);
- }
- });
+ }
+ else{
+ var head= document.getElementsByTagName('head')[0];
+ var script= document.createElement('script');
+ script.type= 'text/javascript';
+ script.src= App.Helpers.generateUrl('js/templates.js?'+Math.random());
+ head.appendChild(script);
+ }
+*/
+
+
}
App.Pages.prepareHTML();
@@ -45,6 +58,8 @@ App.Pages.prepareHTML = function()
App.Pages.DNS.showSubform = function(ref)
{
+ fb.log('loading');
+ return;
App.Helpers.showLoading();
var data = ref.find('.source:first').val();
App.Ajax.request('DNS.getListRecords', {
diff --git a/web/js/templates.js b/web/js/templates.js
index 42d64f20b..bfc39d4d7 100644
--- a/web/js/templates.js
+++ b/web/js/templates.js
@@ -144,14 +144,14 @@ App.Templates.html = {
\
View template settings \
\
- \
+ \
\
Suspended: \
\
@@ -474,9 +474,9 @@ App.Templates.html = {
~!:FULLNAME~! \
\
\
\
- \
+ \
\
email: \
\
@@ -650,10 +650,10 @@ App.Templates.html = {
~!:STAT_OPTIONS~! \
\
\
- ']
},
ip: {
@@ -286,14 +286,14 @@ App.Templates.html = {
Associated DNS Name: \
\
\
- \
'],
@@ -303,7 +303,7 @@ App.Templates.html = {
\
\
\
-
\
+
\
\
~!:SUSPENDED_TPL~!\
\
@@ -320,14 +320,14 @@ App.Templates.html = {
netmask: \
~!:NETMASK~! \
\
-
\
- interface: \
- ~!:INTERFACE~! \
- \
\
name: \
~!:NAME~! \
\
+
\
+ interface: \
+ ~!:INTERFACE~! \
+ \
\
\
\
@@ -341,7 +341,7 @@ App.Templates.html = {
\
\
\
- sys users: \
+ users: \
~!:U_SYS_USERS~! \
\
\
@@ -362,7 +362,7 @@ App.Templates.html = {
user: {
WEB_TPL_MINIMIZED: ['~!:WEB_TPL_MINI~!\
\
- ~!:MORE_NUMBER~! more \
+ ~!:MORE_NUMBER~! more \
~!:WEB_TPL_FULL~! '],
WEB_TPL: ['~!:NAME~! '],
NS_MINIMIZED: ['~!:NS_MINI~!\
@@ -378,7 +378,7 @@ App.Templates.html = {
PLUS_ONE_NS: [''],
ENTRIES_WRAPPER: ['~!:content~!
'],
@@ -403,7 +403,7 @@ App.Templates.html = {
~!:PACKAGE_OPTIONS~!\
\
\
- '],
ENTRY: ['\
@@ -470,16 +470,13 @@ App.Templates.html = {
~!:LOGIN_NAME~! \
\
\
- \
- package: \
- ~!:PACKAGE~! \
- \
-
\
- \
\
- name: \
~!:FULLNAME~! \
- \
+ \
\
+ \
+ \
\
email: \
\
@@ -487,9 +484,14 @@ App.Templates.html = {
(reports ~!:REPORTS_ENABLED~!) \
\
\
+ \
+ package: \
+ ~!:PACKAGE~! \
+ \
\
\
- \
+ \
+ \
\
\
stats
\
@@ -507,24 +509,27 @@ App.Templates.html = {
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\
\
\
- \
- \
- \
-
bandwidth: \
-
\
-
\
-
\
-
~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!) \
-
\
- ~!:OVER_BAR_2~!\
+
\
+
bandwidth: \
+
\
+
\
+
\
+ ~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!) \
+ \
+ ~!:OVER_BAR_2~!\
+
\
\
+
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\
\
-
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\
\
-
\
+
\
\
\
\
+ \
+ web domains: \
+ ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!) \
+ \
\
web ssl: \
~!:U_WEB_SSL~! (~!:WEB_SSL~!) \
@@ -543,6 +548,37 @@ App.Templates.html = {
databases: \
~!:U_DATABASES~! (~!:DATABASES~!) \
\
+ \
+ Dedicated IP\'s: \
+ ~!:IP_OWNED~! \
+ \
+ \
+ cron jobs: \
+ ~!:U_CRON_JOBS~! \
+ \
+
\
+
\
+ \
+ mail domains: \
+ ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!) \
+ \
+ \
+ mail accounts: \
+ ~!:MAIL_BOXES~! per domain \
+ \
+ \
+ mail forwarders: \
+ ~!:MAIL_FORWARDERS~! per domain \
+ \
+ \
+ dns domains: \
+ ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!) \
+ \
+ \
+ name servers: \
+ \
+ ~!:NS~! \
+ \
\
shell: \
~!:SHELL~! \
@@ -550,35 +586,7 @@ App.Templates.html = {
\
backups: \
retention ~!:BACKUPS~! \
- \
-
\
-
\
- \
- mailboxes: \
- ~!:U_MAIL_BOXES~! (~!:MAIL_BOXES~!) \
- \
- \
- mail forwarders: \
- ~!:U_MAIL_FORWARDERS~! (~!:MAIL_FORWARDERS~!) \
- \
- \
- mail domains: \
- ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!) \
- \
- \
- web domains: \
- ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!) \
- \
- \
- dns domains: \
- ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!) \
- \
- \
- ns list: \
- \
- ~!:NS~! \
- \
-
\
+ \
\
\
']
},
@@ -633,6 +641,10 @@ App.Templates.html = {
Domain Aliases: \
\
\
+ \
\
Statistics: \
~!:STAT_OPTIONS~! \
@@ -652,13 +664,18 @@ App.Templates.html = {
Generate \
\
\
- \
\
- SSL Document Root: \
- \
+ SSL Support: \
+ \
+
\
+ \
+ SSL Shared DocRoot: \
+ \
+
\
+ \
+ SSL Crtificate: \
+ ... \
+ \
\
\
SSL Certificate Key: \
@@ -666,9 +683,9 @@ App.Templates.html = {
\
\
\
- SSL Crtificate: \
- ... \
- \
+ SSL Certificate CA: \
+ ... \
+ \
\
\
\
@@ -680,7 +697,7 @@ App.Templates.html = {
\
\
\
- create dns domain: \
+ create DNS domain: \
\
\
\
@@ -698,10 +715,14 @@ App.Templates.html = {
\
\
\
+ \
+ Create DNS domain also: \
+ \
+
\
\
\
Cancel \
- Delete \
+ ~!:DELETE_ACTION~!\
\
'],
ENTRIES_WRAPPER: ['~!:content~!
'],
@@ -720,7 +741,6 @@ App.Templates.html = {
\
\
~!:DOMAIN~! \
- Alias: \
~!:ALIAS~!\
\
\
@@ -731,6 +751,8 @@ App.Templates.html = {
~!:TPL~! \
\
\
+ \
+ \
\
stats
\
\
@@ -747,9 +769,8 @@ App.Templates.html = {
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\
\
\
- \
- \
- \
+ \
+
\
bandwidth: \
\
\
@@ -761,7 +782,9 @@ App.Templates.html = {
\
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\
\
-
\
+
\
+ \
+ \
\
\
\
@@ -792,9 +815,9 @@ App.Templates.html = {
\
nginx: \
~!:NGINX~! \
- extension list \
+ extension list \
\
-
\
+ \
\
']
},
@@ -823,12 +846,12 @@ App.Templates.html = {
~!:TYPE_OPTIONS~! \
\
\
- Name: \
+ DB name: \
\
\
\
\
- Username \
+ Username: \
\
\
\
@@ -837,10 +860,14 @@ App.Templates.html = {
Generate \
\
\
- \
+
\
Host: \
~!:HOST_OPTIONS~! \
\
+
\
+ Character Set: \
+ ~!:CHARSET_OPTIONS~! \
+
\
'],
ENTRY: ['
\
@@ -884,7 +911,11 @@ App.Templates.html = {
Add user \
\
\
-
backup \
+ \
+
\
+ Character Set: \
+ ~!:CHARSET~! \
+ \
\
\
\
@@ -958,7 +989,7 @@ App.Templates.html = {
\
\
Cancel \
- Delete \
+ ~!:DELETE_ACTION~!\
\
'],
ENTRIES_WRAPPER: ['
~!:content~!
'],
@@ -1044,13 +1075,13 @@ App.Templates.html = {
download \
\
\
']
diff --git a/web/js/user_templates_old.js b/web/js/user_templates_old.js
new file mode 100644
index 000000000..beefbc05d
--- /dev/null
+++ b/web/js/user_templates_old.js
@@ -0,0 +1,1151 @@
+alert('User templates loaded');
+App.Templates.html = {
+ help: {
+ DNS_form: ['
Some Things You Just Can\'t Explain \
+ A farmer was sitting in the neighborhood bar getting drunk. A man came in and asked the farmer, "Hey, why are you sitting here on this beautiful day, getting drunk?" The farmer shook his head and replied, "Some things you just can\'t explain."\
+ "So what happened that\'s so horrible?" the man asked as he sat down next to the farmer.\
+ "Well," the farmer said, "today I was sitting by my cow, milking her. Just as I got the bucket full, she lifted her left leg and kicked over the bucket."\
+ "Okay," said the man, "but that\'s not so bad." "Some things you just can\'t explain," the farmer replied. "So what happened then?" the man asked. The farmer said, "I took her left leg and tied it to the post on the left."\
+ "And then?"\
+ "Well, I sat back down and continued to milk her. Just as I got the bucket full, she took her right leg and kicked over the bucket."\
+ The man laughed and said, "Again?" The farmer replied, "Some things you just can\'t explain." "So, what did you do then?" the man asked.\
+ "I took her right leg this time and tied it to the post on the right."\
+ "And then?"\
+ "Well, I sat back down and began milking her again. Just as I got the bucket full, the stupid cow knocked over the bucket with her tail."\
+ "Hmmm," the man said and nodded his head. "Some things you just can\'t explain," the farmer said.\
+ "So, what did you do?" the man asked.\
+ "Well," the farmer said, "I didn\'t have anymore rope, so I took off my belt and tied her tail to the rafter. In that moment, my pants fell down and my wife walked in ... Some things you just can\'t explain."']
+ },
+ general: {
+ logged_as: ['
You (~!:YOU_ARE~! ) are viewing ~!:USER~! interface. Exit it to return to your own.
'],
+ over_bar: ['
'],
+ loading: ['
\
+
\
+
'],
+ popup: ['\
+ '],
+ inner_popup: [''],
+ select_option: ['~!:TEXT~! '],
+ error_elm: ['~!:ERROR~!
'],
+ SUSPENDED_TPL_NOT_SUSPENDED : ['enabled '],
+ SUSPENDED_TPL_SUSPENDED : ['suspended ']
+ },
+ popup: {
+ error: ['Important: An Error Has Occured. Something went wrong and some of your actions can be not saved in system. Mostly, it happens when you have network connection errors.
, However, please notify us about the situation. It would be helpfull if you will write us approximate time the error occured and last actions you were performing. You send your petition on
this email: BLABLA ,
Sorry for inconvinience. (We recommend you to reload the page) '],
+ change_psw: [
+ ''
+ ],
+ login: ['']
+ },
+ dates: {
+ 'lock_plan_date' : ['Lock plan dates Lock plan dates '],
+ 'save_forecasted_date' : ['save forecasted dates ']
+ },
+ dns: {
+ FORM: [
+ '\
+
\
+
\
+ \
+
\
+
\
+
\
+ \
+ Domain: \
+ \
+
\
+
\
+
\
+ Template: \
+ ~!:TPL_DEFAULT_VALUE~! \
+ \
+ ~!:TPL~!\
+ \
+ View template settings \
+
\
+
\
+ TTL: \
+ \
+
\
+
\
+ SOA: \
+ \
+
\
+
\
+ Suspended: \
+ \
+
\
+
\
+ \
+ Cancel \
+ Delete \
+
\
+
'
+ ],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ ENTRY: ['\
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+
\
+ ~!:DNS_DOMAIN~! \
+
\
+
Show records
\
+
\
+
\
+
\
+ ~!:IP~! \
+ \
+ template: \
+ \
+ ~!:TPL~! \
+ \
+
\
+
\
+
\
+ \
+ ttl: \
+ ~!:TTL~! \
+ \
+ \
+ soa: \
+ ~!:SOA~! \
+ \
+
\
+
\
+
'],
+ SUBFORM: ['\
+ \
+
\
+
\
+
\
+ ~!:SUBRECORDS~!\
+
\
+ \
+ Cancel \
+ \
+
\
+
'],
+ SUBENTRY: ['']
+ },
+ ip: {
+ FORM: ['\
+ \
+
\
+
\
+ \
+
\
+
\
+
\
+ IP Address: \
+ \
+
\
+
\
+
\
+ Interface: \
+ \
+ \
+ ~!:interface_options~!\
+ \
+
\
+
\
+ Owner: \
+ \
+ ~!:owner_options~!\
+ \
+
\
+
\
+ Status: \
+ \
+ \
+ ~!:status_options~!\
+ \
+
\
+
\
+ Associated DNS Name: \
+ \
+
\
+
\
+ Suspended: \
+ \
+
\
+
\
+ \
+ Cancel \
+ Delete \
+
\
+
\
+ '],
+ DOT: ['. '],
+ ENTRY: ['\
+ \
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+
\
+ ~!:IP_ADDRESS~! \
+
\
+
\
+ netmask: \
+ ~!:NETMASK~! \
+ \
+
\
+ interface: \
+ ~!:INTERFACE~! \
+ \
+
\
+ name: \
+ ~!:NAME~! \
+ \
+
\
+
\
+ \
+ owner: \
+ ~!:OWNER~! \
+ \
+ \
+ status: \
+ ~!:STATUS~! \
+ \
+
\
+
\
+ \
+ sys users: \
+ ~!:U_SYS_USERS~! \
+ \
+ \
+ web domains: \
+ ~!:U_WEB_DOMAINS~! \
+ \
+
\
+
\
+
\
+ '],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ SUSPENDED_TPL_ENABLED : ['enabled \
+ delete '],
+ SUSPENDED_TPL_DISABLED : ['suspended ']
+ },
+
+
+ user: {
+ WEB_TPL_MINIMIZED: ['~!:WEB_TPL_MINI~!\
+ \
+ ~!:MORE_NUMBER~! more \
+ ~!:WEB_TPL_FULL~! '],
+ WEB_TPL: ['~!:NAME~! '],
+ NS_MINIMIZED: ['~!:NS_MINI~!\
+ \
+ ~!:MORE_NUMBER~! more \
+ ~!:NS_FULL~! '],
+ NS_RECORD: ['~!:NAME~! '],
+ NS_INPUT: ['\
+ ~!:NS_LABEL~!: \
+ \
+ \
+
'],
+ PLUS_ONE_NS: [''],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ FORM: [''],
+ ENTRY: ['\
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+ \
+ ~!:LOGIN_NAME~! \
+ \
+ \
+ \
+ package: \
+ ~!:PACKAGE~! \
+ \
+
\
+
\
+ \
+ name: \
+ ~!:FULLNAME~! \
+ \
+ \
+ email: \
+ \
+ ~!:CONTACT~! \
+ (reports ~!:REPORTS_ENABLED~!) \
+ \
+ \
+
\
+
\
+ \
+ \
+
\
+
stats
\
+ \
+
\
+
disk usage: \
+
\
+
\
+
\
+ ~!:U_DISK_PERCENTAGE~!% (~!:U_DISK~! ~!:DISK_QUOTA_MEASURE~!) \
+ \
+ ~!:OVER_BAR~!\
+
\
+
\
+
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\
+
\
+
\
+
\
+ \
+
\
+
bandwidth: \
+
\
+
\
+
\
+ ~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!) \
+ \
+ ~!:OVER_BAR_2~!\
+
\
+
\
+
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\
+
\
+
\
+ \
+
\
+
\
+ \
+ web ssl: \
+ ~!:U_WEB_SSL~! (~!:WEB_SSL~!) \
+ \
+ \
+ web alias: \
+ ~!:WEB_ALIASES~! per domain \
+ \
+ \
+ web templates: \
+ \
+ ~!:WEB_TPL~!\
+ \
+ \
+ \
+ databases: \
+ ~!:U_DATABASES~! (~!:DATABASES~!) \
+ \
+ \
+ shell: \
+ ~!:SHELL~! \
+ \
+ \
+ backups: \
+ retention ~!:BACKUPS~! \
+ \
+
\
+
\
+ \
+ mailboxes: \
+ ~!:U_MAIL_BOXES~! (~!:MAIL_BOXES~!) \
+ \
+ \
+ mail forwarders: \
+ ~!:U_MAIL_FORWARDERS~! (~!:MAIL_FORWARDERS~!) \
+ \
+ \
+ mail domains: \
+ ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!) \
+ \
+ \
+ web domains: \
+ ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!) \
+ \
+ \
+ dns domains: \
+ ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!) \
+ \
+ \
+ ns list: \
+ \
+ ~!:NS~! \
+ \
+
\
+
\
+
']
+ },
+ web_domain: {
+ FORM: ['\
+
\
+
\
+ \
+
\
+
\
+
\
+ Domain: \
+ \
+
\
+
\
+
\
+ Template: \
+ \
+ ~!:TPL_OPTIONS~!\
+ \
+
\
+
\
+ Suspended: \
+ \
+
\
+ \
+
\
+
\
+
\
+ \
+ Cancel \
+ Delete \
+
\
+
'],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ ENTRY: ['\
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+ ~!:DOMAIN~! \
+ Alias: \
+ ~!:ALIAS~!\
+
\
+
\
+
\
+ ~!:IP~! \
+ \
+ template: \
+ ~!:TPL~! \
+ \
+
\
+
\
+
stats
\
+ \
+
\
+
disk usage: \
+
\
+
\
+
\
+ ~!:U_DISK_PERCENTAGE~!% (~!:U_DISK~! ~!:DISK_QUOTA_MEASURE~!) \
+ \
+ ~!:OVER_BAR~!\
+
\
+
\
+
~!:DISK_QUOTA~! ~!:DISK_QUOTA_MEASURE_2~!
\
+
\
+
\
+
\
+ \
+
\
+
bandwidth: \
+
\
+
\
+
\
+ ~!:U_BANDWIDTH_PERCENTAGE~!% (~!:U_BANDWIDTH~! ~!:BANDWIDTH_MEASURE~!) \
+ \
+ ~!:OVER_BAR_2~!\
+
\
+
\
+
~!:BANDWIDTH~! ~!:BANDWIDTH_MEASURE_2~!
\
+
\
+
\
+
\
+
\
+ \
+ php: \
+ ~!:PHP~! \
+ \
+ \
+ cgi: \
+ ~!:CGI~! \
+ \
+ \
+ elog: \
+ ~!:ELOG~! \
+ \
+ \
+ stats: \
+ ~!:STAT~! \
+ \
+ ~!:STATS_AUTH~! \
+ \
+ \
+
\
+
\
+ \
+ ssl: \
+ ~!:SSL~! \
+ \
+ \
+ nginx: \
+ ~!:NGINX~! \
+ extension list \
+ \
+
\
+
\
+
']
+ },
+ db: {
+ USER_ITEMS_WRAPPER: ['~!:CONTENT~!
'],
+ USER_ITEM: ['\
+ ~!:NAME~! \
+ \
+ change password '],
+ DIVIDER: ['\
+ \
+ \
+ ~!:TYPE~! \
+ \
+ \
+
'],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ FORM: ['\
+
\
+
\
+ \
+
\
+
\
+
\
+ Type: \
+ ~!:TYPE_OPTIONS~! \
+
\
+
\
+ Name: \
+ \
+
\
+
\
+
\
+ Host: \
+ ~!:HOST_OPTIONS~! \
+
\
+
\
+ Suspended: \
+ \
+
\
+
\
+ \
+ Cancel \
+ Delete \
+
\
+
'],
+ ENTRY: ['\
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+ \
+ \
+
\
+
Add user \
+
\
+
\
+
backup \
+ \
+
\
+
\
+
\
+
~!:U_DISK~! Mb \
+
\
+ \
+
\
+
\
+
~!:DISK~! ~!:DISK_MEASURE~!
\
+
\
+
\
+
\
+
\
+
']
+ },
+ cron: {
+ FORM: ['\
+
\
+
\
+ \
+
\
+
\
+
\
+ Command: \
+ \
+
\
+
\
+ report to: \
+ \
+
\
+
\
+ Suspended: \
+ \
+
\
+
\
+ \
+ Cancel \
+ Delete \
+
\
+
'],
+ ENTRIES_WRAPPER: ['~!:content~!
'],
+ ENTRY: ['\
+
\
+
\
+
\
+
\
+
\
+ ~!:SUSPENDED_TPL~!\
+
\
+
\
+
\
+
\
+
\
+ \
+ min \
+ ~!:MIN~! \
+ \
+ \
+ hour \
+ ~!:HOUR~! \
+ \
+ \
+ day of Month \
+ ~!:DAY~! \
+ \
+ \
+ Month \
+ ~!:MONTH~! \
+ \
+ \
+ day of Week \
+ ~!:WDAY~! \
+ \
+
\
+
\
+ ~!:CMD~! \
+
\
+
\
+ \
+ reported to: \
+ naumov.socolov@gmail.com, \
+ naumov.socolov@gmail.com, \
+ \
+
\
+
\
+
']
+ },
+ backup: {
+ WRAPPER: ['~!:CONTENT~!
'],
+ ENTRY: ['\
+ \
+
\
+
\
+
\
+
\
+ \
+ \
+ ~!:CREATED_AT~! \
+ ~!:CREATED_AT_TIME~! \
+ \
+ ~!:CREATED_AT_WDAY~! \
+ \
+ \
+ Generation time: \
+ ~!:GENERATION_TIME~! \
+ \
+
\
+
\
+
\
+
\
+
']
+ },
+ stats: {
+ WRAPPER: ['
~!:CONTENT~!
'],
+ ENTRY: ['
\
+ \
+
\
+
\
+
\
+
'],
+ SUBMENU: ['
today \
+ week \
+ month \
+ year ']
+ }
+}
+
+
+// Internals
+var Tpl = App.Templates;
+var Templator = function()
+{
+ var init = function() {
+ fb.info('Templator work');
+ Templator.splitThemAll();
+ Templator.freezeTplIndexes();
+ };
+
+ /**
+ * Split the tpl strings into arrays
+ */
+ Templator.splitThemAll = function()
+ {
+ fb.info('splitting tpls');
+ $.each(App.Templates.html, function(o) {
+ var tpls = App.Templates.html[o];
+ $.each(tpls, function(t) {
+ tpls[t] = tpls[t][0].split('~!');
+ });
+ });
+ },
+
+ /**
+ * Iterates tpls
+ */
+ Templator.freezeTplIndexes = function()
+ {
+ fb.info('freezing tpl keys');
+ $.each(App.Templates.html, Templator.cacheTplIndexes);
+ },
+
+ /**
+ * Grab the tpl group key and process it
+ */
+ Templator.cacheTplIndexes = function(key)
+ {
+ var tpls = App.Templates.html[key];
+ $.each(tpls, function(o) {
+ var tpl = tpls[o];
+ Templator.catchIndex(key, o, tpl);
+ });
+ },
+
+ /**
+ * Set the indexes
+ */
+ Templator.catchIndex = function(key, ref_key, tpl)
+ {
+ 'undefined' == typeof App.Templates._indexes[key] ? App.Templates._indexes[key] = {} : false;
+ 'undefined' == typeof App.Templates._indexes[key][ref_key] ? App.Templates._indexes[key][ref_key] = {} : false;
+ $(tpl).each(function(index, o) {
+ if(':' == o.charAt(0)){
+ App.Templates._indexes[key][ref_key][o.toString()] = index;
+ }
+ });
+ }
+
+ /**
+ * Get concrete templates
+ */
+ init();
+ return Templator;
+};
+Templator.getTemplate = function(ns, key)
+{
+ return [
+ App.Templates._indexes[ns][key],
+ App.Templates.html[ns][key].slice(0)
+ ];
+}
+// init templator
+Tpl.Templator = Templator();
+Tpl.get = function(key, group)
+{
+ return Tpl.Templator.getTemplate(group, key);
+}
diff --git a/web/vesta/api/CRON.class.php b/web/vesta/api/CRON.class.php
index 94c2ed744..793c99708 100644
--- a/web/vesta/api/CRON.class.php
+++ b/web/vesta/api/CRON.class.php
@@ -31,7 +31,7 @@ class CRON extends AjaxHandler
'MONTH' => $record['MONTH'],
'WDAY' => $record['WDAY'],
'SUSPEND' => $record['SUSPEND'],
- 'DATE' => date(Config::get('ui_date_format', strtotime($record['DATE']))),
+ 'DATE' => $record['DATE'], //date(Config::get('ui_date_format', strtotime($record['DATE']))),
'JOB' => $id
);
}
diff --git a/web/vesta/api/DB.class.php b/web/vesta/api/DB.class.php
index 142c44b26..64bbde7c0 100644
--- a/web/vesta/api/DB.class.php
+++ b/web/vesta/api/DB.class.php
@@ -40,7 +40,7 @@ class DB extends AjaxHandler
'DISK' => 2024,
'CHARSET' => strtolower($record['CHARSET']),
'SUSPEND' => $record['SUSPEND'],
- 'DATE' => date(Config::get('ui_date_format', strtotime($record['DATE'])))
+ 'DATE' => $record['DATE']// date(Config::get('ui_date_format', strtotime($record['DATE'])))
);
}
diff --git a/web/vesta/api/DNS.class.php b/web/vesta/api/DNS.class.php
index 85bf3d548..5d3823e7a 100644
--- a/web/vesta/api/DNS.class.php
+++ b/web/vesta/api/DNS.class.php
@@ -34,7 +34,7 @@ class DNS extends AjaxHandler
'EXP' => $details['EXP'],
'SOA' => $details['SOA'],
'SUSPEND' => $details['SUSPEND'],
- 'DATE' => date(Config::get('ui_date_format', strtotime($details['DATE'])))
+ 'DATE' => $details['DATE'] // date(Config::get('ui_date_format', strtotime($details['DATE'])))
);
}
diff --git a/web/vesta/api/IP.class.php b/web/vesta/api/IP.class.php
index 43e248081..f45363adc 100644
--- a/web/vesta/api/IP.class.php
+++ b/web/vesta/api/IP.class.php
@@ -29,7 +29,7 @@ class IP extends AjaxHandler
$reply[] = array_merge(
array(
'IP_ADDRESS' => $ip,
- 'DATE' => date(Config::get('ui_date_format', strtotime($details['DATE'])))
+ 'DATE' => $details['DATE'] //date(Config::get('ui_date_format', strtotime($details['DATE'])))
), $details);
}
diff --git a/web/vesta/api/USER.class.php b/web/vesta/api/USER.class.php
index bd5529ffd..6f9821b03 100644
--- a/web/vesta/api/USER.class.php
+++ b/web/vesta/api/USER.class.php
@@ -23,12 +23,10 @@ class USER extends AjaxHandler
return self::getUserExecute($request);
}
-
$reply = array();
$result = Vesta::execute(Vesta::V_LIST_SYS_USERS, array(Config::get('response_type')));
foreach ($result['data'] as $user => $details) {
- $nses = $this->getNS($user, $details);
$user_details = array(
"FNAME" => $details['FNAME'],
"LNAME" => $details['LNAME'],
@@ -50,7 +48,7 @@ class USER extends AjaxHandler
"WEB_TPL" => $details['WEB_TPL'],
"SUSPEND" => $details['SUSPENDED'],
"CONTACT" => $details['CONTACT'],
- "REPORTS" => $details['REPORTS'],
+ // "REPORTS" => $details['REPORTS'],
"REPORTS_ENABLED" => $details['REPORTS'],
"IP_OWNED" => $details['IP_OWNED'],
"U_DIR_DISK" => $details['U_DIR_DISK'],
@@ -68,6 +66,7 @@ class USER extends AjaxHandler
"IP_OWNED" => $details['IP_OWNED'],
"NGINX_EXT" => $details['"NGINX_EXT']
);
+ $nses = $this->getNS($user, $details);
$reply[$user] = array_merge($user_details, $nses);
// $reply[$user] = $user_details;
}
@@ -119,7 +118,9 @@ class USER extends AjaxHandler
"IP_OWNED" => $details['IP_OWNED'],
"DATE" => $details['DATE']
);
- $reply[$user] = $user_details;
+ $nses = $this->getNS($user, $details);
+ $reply[$user] = array_merge($user_details, $nses);
+ // $reply[$user] = $user_details;
}
return $this->reply(TRUE, $reply);
@@ -230,8 +231,6 @@ class USER extends AjaxHandler
}
}
- $reports_result = $this->setUserReports($_USER, $_new['REPORTS_ENABLED']);
-
if (!empty($_new['PASSWORD']) && $_new['PASSWORD'] != Vesta::SAME_PASSWORD) {
$result = array();
$result = Vesta::execute(Vesta::V_CHANGE_SYS_USER_PASSWORD, array('USER' => $_USER, 'PASSWORD' => $_new['PASSWORD']));
@@ -265,7 +264,7 @@ class USER extends AjaxHandler
$result = Vesta::execute(Vesta::V_ADD_SYS_USER_REPORTS, array('USER' => $_USER));
}
else{
- $result = Vesta::execute(Vesta::V_ADD_SYS_USER_REPORTS, array('USER' => $_USER));
+ $result = Vesta::execute(Vesta::V_DEL_SYS_USER_REPORTS, array('USER' => $_USER));
}
if (!$result['status']) {
$this->status = FALSE;
@@ -274,27 +273,34 @@ class USER extends AjaxHandler
}
// Set SHELL
- $this->setShell($_USER, $_new['SHELL']);
+ if($_new['SHELL'] != $_old['SHELL']){
+ $this->setShell($_USER, $_new['SHELL']);
+ }
- $this->setNSentries($_USER, $_new);
+ if($_new[NS1].' '.$_new[NS2].' '.$_new[NS3].' '.$_new[NS4].' '.$_new[NS5].' '.$_new[NS6].' '.$_new[NS7].' '.$_new[NS8] !=
+ $_old[NS1].' '.$_old[NS2].' '.$_old[NS3].' '.$_old[NS4].' '.$_old[NS5].' '.$_old[NS6].' '.$_old[NS7].' '.$_old[NS8]){
+ $this->setNSentries($_USER, $_new);
+ }
- $names = array(
- 'USER' => $_USER,
- 'FNAME' => $_new['FNAME'],
- 'LNAME' => $_new['LNAME']
- );
+ if($_new['FNAME'] != $_old['FNAME'] || $_new['LNAME'] != $_old['LNAME']){
+ $names = array(
+ 'USER' => $_USER,
+ 'FNAME' => $_new['FNAME'],
+ 'LNAME' => $_new['LNAME']
+ );
- $result = Vesta::execute(Vesta::V_CHANGE_SYS_USER_NAME, $names);
- if (!$result['status']) {
- $this->status = FALSE;
- $this->errors['NAMES'] = array($result['error_code'] => $result['error_message']);
- }
+ $result = Vesta::execute(Vesta::V_CHANGE_SYS_USER_NAME, $names);
+ if (!$result['status']) {
+ $this->status = FALSE;
+ $this->errors['NAMES'] = array($result['error_code'] => $result['error_message']);
+ }
+ }
if (!$this->status) {
Vesta::execute(Vesta::V_CHANGE_SYS_USER_PASSWORD, array('USER' => $_USER, 'PASSWORD' => $_old['PASSWORD']));
Vesta::execute(Vesta::V_CHANGE_SYS_USER_PACKAGE, array('USER' => $_USER, 'PACKAGE' => $_old['PACKAGE']));
Vesta::execute(Vesta::V_CHANGE_SYS_USER_CONTACT, array('USER' => $_USER, 'EMAIL' => $_old['EMAIL']));
- Vesta::execute(Vesta::V_CHANGE_SYS_USER_NS, array('USER' => $_USER, 'NS1' => $_old['NS1'], 'NS2' => $_old['NS2']));
+ // Vesta::execute(Vesta::V_CHANGE_SYS_USER_NS, array('USER' => $_USER, 'NS1' => $_old['NS1'], 'NS2' => $_old['NS2']));
Vesta::execute(Vesta::V_CHANGE_SYS_USER_SHELL, array('USER' => $_USER, 'SHELL' => $_old['SHELL']));
}
diff --git a/web/vesta/api/WEB_DOMAIN.class.php b/web/vesta/api/WEB_DOMAIN.class.php
index 498d53b51..6ba8c9328 100644
--- a/web/vesta/api/WEB_DOMAIN.class.php
+++ b/web/vesta/api/WEB_DOMAIN.class.php
@@ -44,7 +44,7 @@ class WEB_DOMAIN extends AjaxHandler
'NGINX' => $record['NGINX'],
'NGINX_EXT' => $record['NGINX_EXT'],
'SUSPEND' => $record['SUSPEND'], // == 'yes' ? 'on' : 'off',
- 'DATE' => date(Config::get('ui_date_format', strtotime($record['DATE'])))
+ 'DATE' => $record['DATE'] //date(Config::get('ui_date_format', strtotime($record['DATE'])))
);
$web_details['STAT'] == '' ? $web_details['STAT'] = 'none' : true;
diff --git a/web/vesta/config/vesta_config.ini b/web/vesta/config/vesta_config.ini
index 83e8d8ae3..ebc1fb75f 100644
--- a/web/vesta/config/vesta_config.ini
+++ b/web/vesta/config/vesta_config.ini
@@ -7,6 +7,6 @@ sudo_path = /usr/bin/sudo
vesta_functions_path = /usr/local/vesta/bin/
; common
-ui_date_format = 'd.m.Y'
+ui_date_format = 'Y-m-d'
; session
session_dirname = 'vesta_sessions'