Add Keyfile select option in Voicemaster and App/Game Master Add/Edit View

This commit is contained in:
Nexus633 2020-07-26 22:44:21 +02:00
parent c7620dc4e8
commit 94c11b41ef
6 changed files with 38 additions and 7 deletions

View File

@ -136,7 +136,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
if (!$ui->smallletters('action', 2, 'post')) {
if ($ui->st('d', 'get') == 'ad' and $reseller_id == 0) {
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = 'admin_roots_add.tpl';
} else if ($ui->st('d', 'get') == 'md' and $id) {
@ -205,7 +205,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$configFiles = $row['config_files'];
$configBadFiles = $row['config_bad_files'];
}
;
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = ($query->rowCount() > 0) ? 'admin_roots_md.tpl' : 'admin_404.tpl';
} else {
@ -321,6 +323,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
}
} else {
unset($header, $text);
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = ($ui->st('d', 'get') == 'ad') ? 'admin_roots_add.tpl' : 'admin_roots_md.tpl';
}
}

View File

@ -183,7 +183,7 @@ virtualserver_weblist_enabled 0 = Off';
if (!$ui->w('action', 3, 'post') and $ui->st('d', 'get') != 'ri') {
if ($ui->st('d', 'get') == 'ad') {
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = 'admin_voicemasterserver_add.tpl';
} else if ($ui->st('d', 'get') == 'md' and $id) {
@ -240,7 +240,7 @@ virtualserver_weblist_enabled 0 = Off';
$root = $query2->fetchColumn();
}
}
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = ($query->rowCount() > 0) ? 'admin_voicemasterserver_md.tpl' : 'admin_404.tpl';
} else {

View File

@ -124,7 +124,14 @@
<div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputSSH2Key"><?php echo $sprache->keyname;?></label>
<div class="controls"><input class="form-control" id="inputSSH2Key" type="text" name="keyname" maxlength="20" value="<?php echo $keyname;?>"/></div>
<div class="controls">
<select class="form-control" id="inputSSH2Key" name="keyname">
<option value=""></option>
<?php foreach ($ssh2keys as $ssh2key) { ?>
<option value="<?php echo $ssh2key; ?>" <?php if ($ssh2key==$keyname) echo 'selected="selected"'; ?>><?php echo $ssh2key;?></option>
<?php }?>
</select>
</div>
</div>
<div class="form-group<?php if(isset($errors['os'])) echo ' has-error';?>">

View File

@ -126,7 +126,14 @@
<div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputSSH2Key"><?php echo $sprache->keyname;?></label>
<div class="controls"><input class="form-control" id="inputSSH2Key" type="text" name="keyname" maxlength="20" value="<?php echo $keyname;?>"/></div>
<div class="controls">
<select class="form-control" id="inputSSH2Key" name="keyname">
<option value=""></option>
<?php foreach ($ssh2keys as $ssh2key) { ?>
<option value="<?php echo $ssh2key; ?>" <?php if ($ssh2key==$keyname) echo 'selected="selected"'; ?>><?php echo $ssh2key;?></option>
<?php }?>
</select>
</div>
</div>
<div class="form-group<?php if(isset($errors['os'])) echo ' has-error';?>">

View File

@ -287,7 +287,14 @@
<div class="control-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputKeyName"><?php echo $sprache->keyname;?></label>
<div class="controls"><input class="form-control" id="inputKeyName" type="text" name="keyname" maxlength="20" value="<?php echo $keyname;?>"/></div>
<div class="controls">
<select class="form-control" id="inputSSH2Key" name="keyname">
<option value=""></option>
<?php foreach ($ssh2keys as $ssh2key) { ?>
<option value="<?php echo $ssh2key; ?>" <?php if ($ssh2key==$keyname) echo 'selected="selected"'; ?>><?php echo $ssh2key;?></option>
<?php }?>
</select>
</div>
</div>
<div class="control-group<?php if(isset($errors['bit'])) echo ' has-error';?>">

View File

@ -261,7 +261,14 @@
<div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputKeyName"><?php echo $sprache->keyname;?></label>
<div class="controls"><input class="form-control" id="inputKeyName" type="text" name="keyname" maxlength="20" value="<?php echo $keyname;?>"/></div>
<div class="controls">
<select class="form-control" id="inputSSH2Key" name="keyname">
<option value=""></option>
<?php foreach ($ssh2keys as $ssh2key) { ?>
<option value="<?php echo $ssh2key; ?>" <?php if ($ssh2key==$keyname) echo 'selected="selected"'; ?>><?php echo $ssh2key;?></option>
<?php }?>
</select>
</div>
</div>
<div class="form-group<?php if(isset($errors['bit'])) echo ' has-error';?>">