Fixes agent config pages

main
Yasen Pramatarov 2024-09-21 12:21:46 +03:00
parent 88e77f71ef
commit 72b1442b77
4 changed files with 11 additions and 8 deletions

View File

@ -107,7 +107,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
include '../app/templates/config-list-interfaceconfigjs.php'; include '../app/templates/config-list-interfaceconfigjs.php';
break; break;
// if there is no $item, we work on the local config file // if there is no $item, we work on the local config DB
default: default:
switch ($action) { switch ($action) {
case 'add-agent': case 'add-agent':
@ -125,12 +125,15 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
} }
break; break;
case 'delete': case 'delete':
include '../app/templates/config-delete-platform.php'; if (isset($_GET['agent'])) {
$agentDetails = $agentObject->getAgentDetails($platform_id, $agent);
include '../app/templates/config-delete-agent.php';
} else {
include '../app/templates/config-delete-platform.php';
}
break; break;
default: default:
if ($userObject->hasRight($user_id, 'view config file')) { if ($userObject->hasRight($user_id, 'view config file')) {
// require '../app/classes/agent.php';
// $agentObject = new Agent($dbWeb);
include '../app/templates/config-list.php'; include '../app/templates/config-list.php';
} else { } else {
include '../app/templates/unauthorized.php'; include '../app/templates/unauthorized.php';

View File

@ -42,7 +42,7 @@
<input type="hidden" name="new" value="true" /> <input type="hidden" name="new" value="true" />
<br /> <br />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a> <a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-primary" value="Save" /> <input type="submit" class="btn btn-primary" value="Save" />
</form> </form>
</div> </div>

View File

@ -24,7 +24,7 @@ foreach ($agentDetails[0] as $key => $value) {
<input type="hidden" name="delete" value="true" /> <input type="hidden" name="delete" value="true" />
<p class="h5 text-danger">Are you sure you want to delete this agent?</p> <p class="h5 text-danger">Are you sure you want to delete this agent?</p>
<br /> <br />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a> <a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-danger" value="Delete" /> <input type="submit" class="btn btn-danger" value="Delete" />
</form> </form>
</div> </div>

View File

@ -12,7 +12,7 @@
<span class="text-danger" style="margin-right: -12px;">*</span> <span class="text-danger" style="margin-right: -12px;">*</span>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<input class="form-control" type="text" name="type_id" value="<?= htmlspecialchars($agentDetails[0]['type_id'])?>" required autofocus /> <input class="form-control" type="text" name="type_id" value="<?= htmlspecialchars($agentDetails[0]['agent_type_id'])?>" required autofocus />
<p class="text-start"><small>type of agent (meet, jvb, jibri, all)</small></p> <p class="text-start"><small>type of agent (meet, jvb, jibri, all)</small></p>
</div> </div>
</div> </div>
@ -42,7 +42,7 @@
<br /> <br />
<input type="hidden" name="agent" value="<?= htmlspecialchars($agentDetails[0]['id']) ?>" /> <input type="hidden" name="agent" value="<?= htmlspecialchars($agentDetails[0]['id']) ?>" />
<a class="btn btn-secondary" href="<?= $app_root ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=agents" />Cancel</a> <a class="btn btn-secondary" href="<?= $app_root ?>?page=config" />Cancel</a>
<input type="submit" class="btn btn-primary" value="Save" /> <input type="submit" class="btn btn-primary" value="Save" />
</form> </form>
</div> </div>