Merge pull request #1282 from Nexus633/master

Add Keyfile select option in Voicemaster and App/Game Master Add/Edit View
This commit is contained in:
Andre Rohlf 2020-07-26 22:48:26 +02:00 committed by GitHub
commit 636f85db2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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->smallletters('action', 2, 'post')) {
if ($ui->st('d', 'get') == 'ad' and $reseller_id == 0) { 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'; $template_file = 'admin_roots_add.tpl';
} else if ($ui->st('d', 'get') == 'md' and $id) { } 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']; $configFiles = $row['config_files'];
$configBadFiles = $row['config_bad_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'; $template_file = ($query->rowCount() > 0) ? 'admin_roots_md.tpl' : 'admin_404.tpl';
} else { } else {
@ -321,6 +323,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} }
} else { } else {
unset($header, $text); 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'; $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->w('action', 3, 'post') and $ui->st('d', 'get') != 'ri') {
if ($ui->st('d', 'get') == 'ad') { if ($ui->st('d', 'get') == 'ad') {
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = 'admin_voicemasterserver_add.tpl'; $template_file = 'admin_voicemasterserver_add.tpl';
} else if ($ui->st('d', 'get') == 'md' and $id) { } else if ($ui->st('d', 'get') == 'md' and $id) {
@ -240,7 +240,7 @@ virtualserver_weblist_enabled 0 = Off';
$root = $query2->fetchColumn(); $root = $query2->fetchColumn();
} }
} }
$ssh2keys = array_diff(scandir(EASYWIDIR . '/keys/'), array('..', '.', "empty.txt"));
$template_file = ($query->rowCount() > 0) ? 'admin_voicemasterserver_md.tpl' : 'admin_404.tpl'; $template_file = ($query->rowCount() > 0) ? 'admin_voicemasterserver_md.tpl' : 'admin_404.tpl';
} else { } else {

View File

@ -124,7 +124,14 @@
<div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>"> <div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputSSH2Key"><?php echo $sprache->keyname;?></label> <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>
<div class="form-group<?php if(isset($errors['os'])) echo ' has-error';?>"> <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';?>"> <div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputSSH2Key"><?php echo $sprache->keyname;?></label> <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>
<div class="form-group<?php if(isset($errors['os'])) echo ' has-error';?>"> <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';?>"> <div class="control-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputKeyName"><?php echo $sprache->keyname;?></label> <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>
<div class="control-group<?php if(isset($errors['bit'])) echo ' has-error';?>"> <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';?>"> <div class="form-group<?php if(isset($errors['keyname'])) echo ' has-error';?>">
<label for="inputKeyName"><?php echo $sprache->keyname;?></label> <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>
<div class="form-group<?php if(isset($errors['bit'])) echo ' has-error';?>"> <div class="form-group<?php if(isset($errors['bit'])) echo ' has-error';?>">