Separate scripts from html & New rendering function

This commit is contained in:
Flat 2016-07-02 19:51:56 +09:00
commit e16e92278b
84 changed files with 848 additions and 1280 deletions

View file

@ -32,26 +32,7 @@
<form id="vstobjects" name="v_add_db" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_db.v_password.value = randomstring;
}
</script>
<table class="data mode-add">
<tr class="data-add">
<td class="data-dotted">
@ -68,7 +49,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Database');?>
<?php print __('Database');?>
</td>
</tr>
<tr>
@ -79,7 +60,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('User');?>
<?php print __('User');?>
</td>
</tr>
<tr>
@ -100,7 +81,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Type');?>
<?php print __('Type');?>
</td>
</tr>
<tr>
@ -112,13 +93,13 @@
if ((!empty($v_type)) && ( $value == $v_type )) echo ' selected';
echo ">".htmlentities($value)."</option>";
}
?>
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Host');?>
<?php print __('Host');?>
</td>
</tr>
<tr>
@ -130,14 +111,14 @@
if ((!empty($v_host)) && ( $key == $v_host )) echo ' selected';
echo ">".htmlentities($key)."</option>";
}
?>
?>
</select>
</td>
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Charset');?>
<?php print __('Charset');?>
</td>
</tr>
<tr>
@ -183,7 +164,7 @@
</td>
<tr>
<td class="vst-text input-label">
<?php print __('Send login credentials to email address') ?>
<?php print __('Send login credentials to email address') ?>
</td>
</tr>
<tr>
@ -207,9 +188,3 @@
</table>
</form>
</div>
<script type="text/javascript">
GLOBAL.DB_USER_PREFIX = '<?php echo $user; ?>_';
GLOBAL.DB_DBNAME_PREFIX = '<?php echo $user; ?>_';
</script>
<script type="text/javascript" src="/js/pages/add.db.js"></script>

View file

@ -0,0 +1,21 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_db.v_password.value = randomstring;
}
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
</script>
<script src="/js/pages/add.db.js"></script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_add_dns" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script language="javascript">
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">
@ -190,33 +180,3 @@
</table>
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>

View file

@ -0,0 +1,35 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>

View file

@ -121,8 +121,3 @@
</table>
</form>
</div>
<script type="text/javascript">
GLOBAL.DNS_REC_PREFIX = '<?php echo $_GET['domain']; ?>';
</script>
<script type="text/javascript" src="/js/pages/add.dns.record.js"></script>

View file

@ -0,0 +1,4 @@
<script>
GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
</script>
<script src="/js/pages/add.dns.record.js"></script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">
@ -54,7 +44,7 @@
<table class="data-col2" width="600px">
<tr>
<td class="vst-text step-top">
<?php print __('Action') ?>
<?php print __('Action') ?>
</td>
</tr>
<tr>
@ -67,7 +57,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Protocol') ?>
<?php print __('Protocol') ?>
</td>
</tr>
<tr>
@ -128,4 +118,4 @@
</table>
</from>
</div>
</div>

View file

@ -0,0 +1,6 @@
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">
@ -54,7 +44,7 @@
<table class="data-col2" width="600px">
<tr>
<td class="vst-text step-top">
<?php print __('Banlist') ?>
<?php print __('Banlist') ?>
</td>
</tr>
<tr>
@ -95,4 +85,4 @@
</tr>
</table>
</from>
</div>
</div>

View file

@ -0,0 +1,6 @@
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_add_ip" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">

View file

@ -0,0 +1,6 @@
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -32,53 +32,6 @@
<form id="vstobjects" name="v_add_mail_acc" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok_acc" value="add" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_mail_acc.v_password.value = randomstring;
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text(randomstring);
else
$('#v_password').text(Array(randomstring.length+1).join('*'));
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});
</script>
<table class="data mode-add">
<tr class="data-add">
@ -229,4 +182,3 @@
</table>
</form>
</div>
<script type="text/javascript" src="/js/pages/edit.package.js"></script>

View file

@ -0,0 +1,46 @@
<script>
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_mail_acc.v_password.value = randomstring;
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text(randomstring);
else
$('#v_password').text(Array(randomstring.length+1).join('*'));
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});
</script>
<script src="/js/pages/edit.package.js"></script>

View file

@ -72,11 +72,11 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Backend Template') . "<span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']). "</span>" ;?>
@ -96,13 +96,13 @@
}
echo ">".$value."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Proxy Template') . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>" ;?>
@ -123,11 +123,11 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php echo ""; }?>
<tr>
<td class="vst-text input-label">
<?php print __('DNS Template') . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>" ;?>
@ -147,7 +147,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -170,7 +170,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -380,34 +380,3 @@
</table>
</form>
</div>
<script type="text/javascript" src="/js/pages/add.package.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>

View file

@ -0,0 +1,30 @@
<script>
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});
</script>
<script src="/js/pages/add.package.js"></script>

View file

@ -34,24 +34,6 @@
<form id="vstobjects" name="v_add_user" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
$(function() {
$("#v_email").change(function() {
document.getElementById('v_notify').value = document.getElementById('v_email').value;
});
});
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_add_user.v_password.value = randomstring;
}
</script>
<table class="data mode-add">
<tr class="data-add">
@ -112,7 +94,7 @@
}
echo ">".htmlentities($key)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -188,4 +170,4 @@
</tr>
</table>
</form>
</div>
</div>

View file

@ -0,0 +1,18 @@
<script>
$(function() {
$('#v_email').change(function() {
document.getElementById('v_notify').value = document.getElementById('v_email').value;
});
});
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_user.v_password.value = randomstring;
}
</script>

View file

@ -33,44 +33,6 @@
<form id="vstobjects" name="v_add_web" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="Add" />
<script type="text/javascript">
$(function() {
$("#v_domain").change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var webrandom = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substring(rnum,rnum+1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var ftprandomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substring(rnum,rnum+1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">
@ -142,7 +104,7 @@
<textarea size="20" class="vst-textinput" name="v_aliases" id="v_aliases" ><?php if (!empty($v_aliases)) echo htmlentities($v_aliases); ?></textarea>
</td>
</tr>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text step-top" >
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if ($v_proxy !== 'off') echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');"> <?php print __('Proxy Support');?></label>
@ -164,7 +126,7 @@
</table>
</td>
</tr>
<?php echo ""; }?>
<?php echo ""; }?>
<tr>
<td class="step-top vst-text">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if($v_ssl == 'yes' || $v_ssl == 'on') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
@ -242,7 +204,7 @@
}
echo ">" . htmlentities(__($value)) . "</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -428,15 +390,3 @@
</table>
</div>
</div>
<script type="text/javascript">
GLOBAL.FTP_USER_PREFIX = '<?php echo $user; ?>_';
GLOBAL.FTP_USER_PREPATH = '<?php echo $v_ftp_user_prepath; ?>';
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
$(elm).removeAttr('disabled');
});
});
</script>
<script type="text/javascript" src="/js/pages/add.web.js"></script>

View file

@ -0,0 +1,45 @@
<script>
$(function() {
$('#v_domain').change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
$(elm).removeAttr('disabled');
});
});
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user)?>;
GLOBAL.FTP_USER_PREPATH = <?=json_encode($v_ftp_user_prepath)?>;
</script>
<script src="/js/pages/add.web.js"></script>

View file

@ -32,26 +32,6 @@
<form id="vstobjects" name="v_edit_db" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_db.v_password.value = randomstring;
}
</script>
<table class='data'>
<tr class="data-add">
@ -146,8 +126,3 @@
</table>
</form>
</div>
<script type="text/javascript">
GLOBAL.DB_USER_PREFIX = '<?php echo $user; ?>_';
GLOBAL.DB_DBNAME_PREFIX = '<?php echo $user; ?>_';
</script>
<script type="text/javascript" src="/js/pages/edit.db.js"></script>

View file

@ -0,0 +1,21 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_db.v_password.value = randomstring;
}
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
</script>
<script src="/js/pages/edit.db.js"></script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_edit_firewall" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'>
<tr class="data-add">
@ -60,7 +50,7 @@
<table class="data-col2" width="600px">
<tr>
<td class="vst-text step-top">
<?php print __('Action'); ?>
<?php print __('Action'); ?>
</td>
</tr>
<tr>
@ -73,7 +63,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Protocol') ?>
<?php print __('Protocol') ?>
</td>
</tr>
<tr>
@ -130,4 +120,4 @@
</tr>
</table>
</form>
</div>
</div>

View file

@ -0,0 +1,6 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -32,16 +32,6 @@
<form id="vstobjects" name="v_edit_ip" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'>
<tr class="data-add">
@ -60,7 +50,7 @@
<table class="data-col2" width="600px">
<tr>
<td class="vst-text step-top">
<?php print __('IP address'); ?>
<?php print __('IP address'); ?>
</td>
</tr>
<tr>
@ -70,7 +60,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Netmask');?>
<?php print __('Netmask');?>
</td>
</tr>
<tr>
@ -80,7 +70,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('Interface'); ?>
<?php print __('Interface'); ?>
</td>
</tr>
<tr>
@ -153,4 +143,4 @@
</tr>
</table>
</form>
</div>
</div>

View file

@ -0,0 +1,6 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>

View file

@ -32,26 +32,6 @@
<form id="vstobjects" name="v_edit_mail_acc" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_mail_acc.v_password.value = randomstring;
}
</script>
<table class='data'>
<tr class="data-add">
@ -163,4 +143,3 @@
</table>
</form>
</div>
<script type="text/javascript" src="/js/pages/edit.mail_acc.js"></script>

View file

@ -0,0 +1,18 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_mail_acc.v_password.value = randomstring;
}
</script>
<script src="/js/pages/edit.mail_acc.js"></script>

View file

@ -72,11 +72,11 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Backend Template') . "<span class='optional'>" .strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
@ -96,12 +96,12 @@
}
echo ">".$value."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Proxy Template') . "<span class='optional'>" .strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?>
@ -121,11 +121,11 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php echo ""; }?>
<tr>
<td class="vst-text input-label">
<?php print __('DNS Template') . "<span class='optional'>" .strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
@ -145,7 +145,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -381,34 +381,3 @@
</table>
</form>
</div>
<script type="text/javascript" src="/js/pages/edit.package.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>

View file

@ -0,0 +1,31 @@
<script>
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});
</script>
<script src="/js/pages/edit.package.js"></script>

View file

@ -33,16 +33,7 @@
<form id="vstobjects" name="v_configure_server" method="post">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function elementHideShow(elementToHideOrShow) {
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class="data mode-add">
<tr class="data-add">
<td class="data-dotted">
@ -54,7 +45,7 @@
<table class="data-col2" width="600px">
<tr>
<td class="vst-text step-top">
<?php print __('Hostname') ?>
<?php print __('Hostname') ?>
</td>
</tr>
<tr>
@ -82,7 +73,7 @@
}
echo ">".$value."</option>\n";
}
?>
?>
</select>
<br><br>
</td>
@ -106,7 +97,7 @@
}
echo ">".$value."</option>\n";
}
?>
?>
</select>
<br><br>
</td>
@ -121,10 +112,10 @@
<tr>
<td class="vst-text input-label step-left">
<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="web">
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { ?>
<tr>
<td class="vst-text">
<?php print __('Proxy Server') ?>
<?php print __('Proxy Server') ?>
</td>
</tr>
<tr>
@ -133,10 +124,10 @@
<br><br>
</td>
</tr>
<?php } ?>
<?php } ?>
<tr>
<td class="vst-text">
<?php print __('Web Server') ?>
<?php print __('Web Server') ?>
</td>
</tr>
<tr>
@ -145,10 +136,10 @@
<br><br>
</td>
</tr>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { ?>
<tr>
<td class="vst-text">
<?php print __('Backend Server') ?>
<?php print __('Backend Server') ?>
</td>
</tr>
<tr>
@ -159,7 +150,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Backend Pool Mode') ?>
<?php print __('Backend Pool Mode') ?>
</td>
</tr>
<tr>
@ -169,7 +160,7 @@
</td>
</tr>
<?php } ?>
<?php } ?>
</table>
</td>
</tr>
@ -187,7 +178,7 @@
<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="dns">
<tr>
<td class="vst-text">
<?php print __('DNS Server') ?>
<?php print __('DNS Server') ?>
</td>
</tr>
<tr>
@ -215,10 +206,10 @@
$i = 0;
foreach ($dns_cluster as $key => $value) {
$i++;
?>
?>
<tr>
<td class="vst-text step-left">
<?php print __('Host'). ' #'.$i ?>
<?php print __('Host'). ' #'.$i ?>
</td>
</tr>
<tr>
@ -227,7 +218,7 @@
<br><br>
</td>
</tr>
<?php }} ?>
<?php }} ?>
</table>
</td>
</tr>
@ -245,7 +236,7 @@
<table style="display:<?php if (empty($v_mail_adv)) echo 'none';?> ;" id="mail">
<tr>
<td class="vst-text">
<?php print __('MAIL Server') ?>
<?php print __('MAIL Server') ?>
</td>
</tr>
<tr>
@ -254,10 +245,10 @@
<br><br>
</td>
</tr>
<?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) { ?>
<?php if (!empty($_SESSION['ANTIVIRUS_SYSTEM'])) { ?>
<tr>
<td class="vst-text">
<?php print __('Antivirus') ?>
<?php print __('Antivirus') ?>
</td>
</tr>
<tr>
@ -266,11 +257,11 @@
<br><br>
</td>
</tr>
<?php } ?>
<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) { ?>
<?php } ?>
<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) { ?>
<tr>
<td class="vst-text">
<?php print __('AntiSpam') ?>
<?php print __('AntiSpam') ?>
</td>
</tr>
<tr>
@ -279,10 +270,10 @@
<br><br>
</td>
</tr>
<?php } ?>
<?php } ?>
<tr>
<td class="vst-text">
<?php print __('Webmail URL') ?>
<?php print __('Webmail URL') ?>
</td>
</tr>
<tr>
@ -324,7 +315,7 @@
<?php if ($v_mysql == 'yes') { ?>
<tr>
<td class="vst-text">
<?php print __('phpMyAdmin URL') ?>
<?php print __('phpMyAdmin URL') ?>
</td>
</tr>
<tr>
@ -338,10 +329,10 @@
$i = 0;
foreach ($v_mysql_hosts as $key => $value) {
$i++;
?>
?>
<tr>
<td class="vst-text step-left">
<?php print __('Host'). ' #'.$i ?>
<?php print __('Host'). ' #'.$i ?>
</td>
</tr>
<tr>
@ -352,7 +343,7 @@
</tr>
<tr>
<td class="vst-text step-left">
<?php print __('Password') ?>
<?php print __('Password') ?>
</td>
</tr>
<tr>
@ -364,7 +355,7 @@
<tr>
<td class="vst-text step-left">
<?php print __('Maximum Number Of Databases') ?>
<?php print __('Maximum Number Of Databases') ?>
</td>
</tr>
<tr>
@ -375,7 +366,7 @@
</tr>
<tr>
<td class="vst-text step-left">
<?php print __('Current Number Of Databases') ?>
<?php print __('Current Number Of Databases') ?>
</td>
</tr>
<tr>
@ -384,7 +375,7 @@
<br><br><br><br>
</td>
</tr>
<?php }} ?>
<?php }} ?>
<tr>
@ -404,7 +395,7 @@
<?php if ($v_pgsql == 'yes') { ?>
<tr>
<td class="vst-text">
<?php print __('phpPgAdmin URL') ?>
<?php print __('phpPgAdmin URL') ?>
</td>
</tr>
<tr>
@ -418,10 +409,10 @@
$i = 0;
foreach ($v_pgsql_hosts as $key => $value) {
$i++;
?>
?>
<tr>
<td class="vst-text step-left">
<?php print __('Host'). ' #'.$i ?>
<?php print __('Host'). ' #'.$i ?>
</td>
</tr>
<tr>
@ -432,7 +423,7 @@
</tr>
<tr>
<td class="vst-text step-left">
<?php print __('Maximum Number Of Databases') ?>
<?php print __('Maximum Number Of Databases') ?>
</td>
</tr>
<tr>
@ -443,7 +434,7 @@
</tr>
<tr>
<td class="vst-text step-left">
<?php print __('Current Number Of Databases') ?>
<?php print __('Current Number Of Databases') ?>
</td>
</tr>
<tr>
@ -452,7 +443,7 @@
<br><br><br><br>
</td>
</tr>
<?php }} ?>
<?php }} ?>
</table>
</td>
</tr>
@ -470,7 +461,7 @@
<table style="display:<?php if (empty($v_backup_adv)) echo 'none';?> ;" id="backup">
<tr>
<td class="vst-text">
<?php print __('Local backup') ?>
<?php print __('Local backup') ?>
</td>
</tr>
<tr>
@ -484,7 +475,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Compression level') ?>
<?php print __('Compression level') ?>
</td>
</tr>
<tr>
@ -505,7 +496,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Directory') ?>
<?php print __('Directory') ?>
</td>
</tr>
<tr>
@ -524,7 +515,7 @@
<td class="vst-text input-label step-left">
<table style="display:<?php if (empty($v_backup_remote_adv)) echo 'none';?> ;" id="remote_backup">
<td class="vst-text">
<?php print __('Protocol') ?>
<?php print __('Protocol') ?>
</td>
</tr>
<tr>
@ -538,7 +529,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Host') ?>
<?php print __('Host') ?>
</td>
</tr>
<tr>
@ -549,7 +540,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Username') ?>
<?php print __('Username') ?>
</td>
</tr>
<tr>
@ -560,7 +551,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Password') ?>
<?php print __('Password') ?>
</td>
</tr>
<tr>
@ -571,7 +562,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Directory') ?>
<?php print __('Directory') ?>
</td>
</tr>
<tr>
@ -599,7 +590,7 @@
<table style="display:<?php if (empty($v_adv) && $_GET['lead'] != 'filemanager' && $_GET['lead'] != 'sftp') echo 'none';?> ;" id="vesta">
<tr>
<td class="vst-text">
<?php print __('Version') ?>
<?php print __('Version') ?>
</td>
</tr>
<tr>
@ -638,7 +629,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Reseller Role') ?>
<?php print __('Reseller Role') ?>
</td>
</tr>
<tr>
@ -651,7 +642,7 @@
</tr>
<tr>
<td class="vst-text">
<?php print __('Backup Migration Manager') ?>
<?php print __('Backup Migration Manager') ?>
</td>
</tr>
<tr>
@ -690,7 +681,7 @@
'.__('Licence Key').': <input type="text" class="vst-input" name="v_sftp_licence" value="'.$licence_key.'" /><br>
</div>';
} else {
echo
echo
__('Restrict users so that they cannot use SSH and access only their home directory.').' '.__('This is a commercial module, you would need to purchace license key to enable it.').
'<div class="licence">
'.__('Enter License Key').': <input type="text" class="vst-input" name="v_sftp_licence" /><br>
@ -712,7 +703,7 @@
<tr>
<td class="vst-text" id="module-filemanager">
<?php print __('File Manager') ?>
<?php print __('File Manager') ?>
</td>
</tr>
<tr>
@ -778,23 +769,3 @@
</table>
</form>
</div>
<script>
$(document).ready(function(){
$('select[name=v_filemanager]').change(function(){
if($(this).val() == 'yes'){
$('.filemanager.description').show();
} else {
$('.filemanager.description').hide();
}
});
$('select[name=v_sftp]').change(function(){
if($(this).val() == 'yes'){
$('.sftp.description').show();
} else {
$('.sftp.description').hide();
}
});
});
</script>

View file

@ -0,0 +1,24 @@
<script>
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$(document).ready(function(){
$('select[name=v_filemanager]').change(function(){
if($(this).val() == 'yes'){
$('.filemanager.description').show();
} else {
$('.filemanager.description').hide();
}
});
$('select[name=v_sftp]').change(function(){
if($(this).val() == 'yes'){
$('.sftp.description').show();
} else {
$('.sftp.description').hide();
}
});
});
</script>

View file

@ -32,18 +32,7 @@
<form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script type="text/javascript">
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.v_edit_user.v_password.value = randomstring;
}
</script>
<table class='data'>
<tr class="data-add">
<td class="data-dotted">
@ -106,7 +95,7 @@
}
echo ">".htmlentities($key)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -130,7 +119,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -171,7 +160,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -264,33 +253,3 @@
</table>
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
})
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
});
</script>

View file

@ -0,0 +1,41 @@
<script>
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_user.v_password.value = randomstring;
}
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $("input[name^=v_ns]").length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});
</script>

View file

@ -32,40 +32,7 @@
<form id="vstobjects" name="v_edit_web" method="post" class="<?=$v_status?>">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="save" value="save" />
<script language="javascript">
function WEBrandom() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var webrandom = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substring(rnum,rnum+1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 10;
var ftprandomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substring(rnum,rnum+1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
if (el.style.display == "block") {
el.style.display = "none";
} else {
el.style.display = "block";
}
}
</script>
<table class='data'>
<tr class="data-add">
<td class="data-dotted">
@ -141,11 +108,11 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<?php if (!empty($_SESSION['WEB_BACKEND'])) { echo ""; ?>
<tr>
<td class="vst-text input-label">
<?php print __('Backend Template') . " <span class='optional'>" . strtoupper($_SESSION['WEB_BACKEND']) . "</span>";?>
@ -166,12 +133,12 @@
}
echo ">".$value."</option>\n";
}
?>
?>
</select>
</td>
</tr>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<?php echo ""; }?>
<?php if (!empty($_SESSION['PROXY_SYSTEM'])) { echo ""; ?>
<tr>
<td class="vst-text step-top">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_proxy" <?php if (!empty($v_proxy)) echo "checked=yes" ?> onclick="javascript:elementHideShow('proxytable');"> <?php print __('Proxy Support') . "<span class='optional'>" . strtoupper($_SESSION['PROXY_SYSTEM']) . "</span>";?></label>
@ -200,7 +167,7 @@
}
echo ">".htmlentities($value)."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -217,7 +184,7 @@
</table>
</td>
</tr>
<?php echo ""; }?>
<?php echo ""; }?>
<tr>
<td class="vst-text step-top">
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
@ -247,7 +214,7 @@
</tr>
<tr>
<td class="vst-text input-label">
<?php print __('SSL Certificate');?>
<?php print __('SSL Certificate');?>
</td>
</tr>
<tr>
@ -296,7 +263,7 @@
}
echo ">". htmlentities(__($value)) ."</option>\n";
}
?>
?>
</select>
</td>
</tr>
@ -430,7 +397,7 @@
<div id="templates" class="hidden">
<table class="ftptable ftptable-nrm" name="v_add_domain_ftp">
<tr>
<tr>
<td class="vst-text input-label">
<?php print __('FTP') ?> #<span class="ftp-user-number"></span> <a class="ftp-remove-user additional-control" onCLick="App.Actions.WEB.remove_ftp_user(this)">(<?=__('delete')?>)</a>
<input type="hidden" class="v-ftp-user-deleted" name="v_ftp_user[%INDEX%][delete]" value="0" />
@ -485,16 +452,3 @@
</table>
</div>
</div>
<script type="text/javascript">
GLOBAL.FTP_USER_PREFIX = '<?php echo $user; ?>_';
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
var copy_elm = $(elm).clone(true);
$(copy_elm).attr('type', 'hidden');
$(copy_elm).removeAttr('disabled');
$(elm).after(copy_elm);
});
});
</script>
<script type="text/javascript" src="/js/pages/edit.web.js"></script>

View file

@ -0,0 +1,42 @@
<script>
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
var copy_elm = $(elm).clone(true);
$(copy_elm).attr('type', 'hidden');
$(copy_elm).removeAttr('disabled');
$(elm).after(copy_elm);
});
});
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user.'_')?>;
</script>
<script src="/js/pages/edit.web.js"></script>