Commit f5780123 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) add support to system_usermanager.php for edit/add new using GET in...

(legacy)  add support to system_usermanager.php for edit/add new using GET in addition to POST, needed for other modules to link to this page in a more natural way.

Page need proper cleaning.
parent c85a9b0b
...@@ -84,6 +84,8 @@ $input_errors = array(); ...@@ -84,6 +84,8 @@ $input_errors = array();
if (isset($_POST['userid']) && is_numericint($_POST['userid'])) { if (isset($_POST['userid']) && is_numericint($_POST['userid'])) {
$id = $_POST['userid']; $id = $_POST['userid'];
} elseif (isset($_GET['userid']) && is_numericint($_GET['userid'])) {
$id = $_GET['userid'];
} }
if (!isset($config['system']['user']) || !is_array($config['system']['user'])) { if (!isset($config['system']['user']) || !is_array($config['system']['user'])) {
...@@ -98,7 +100,7 @@ if (isset($_SERVER['HTTP_REFERER'])) { ...@@ -98,7 +100,7 @@ if (isset($_SERVER['HTTP_REFERER'])) {
$referer = '/system_usermanager.php'; $referer = '/system_usermanager.php';
} }
if (isset($id) && $a_user[$id]) { if (isset($id) && isset($a_user[$id])) {
$pconfig['usernamefld'] = $a_user[$id]['name']; $pconfig['usernamefld'] = $a_user[$id]['name'];
$pconfig['user_dn'] = isset($a_user[$id]['user_dn']) ? $a_user[$id]['user_dn'] : null; $pconfig['user_dn'] = isset($a_user[$id]['user_dn']) ? $a_user[$id]['user_dn'] : null;
$pconfig['descr'] = $a_user[$id]['descr']; $pconfig['descr'] = $a_user[$id]['descr'];
...@@ -503,7 +505,7 @@ function import_ldap_users() { ...@@ -503,7 +505,7 @@ function import_ldap_users() {
<div class="tab-content content-box col-xs-12 table-responsive"> <div class="tab-content content-box col-xs-12 table-responsive">
<?php <?php
if ($_POST['act'] == "new" || $_POST['act'] == "edit" || count($input_errors) > 0 ) : if ($_POST['act'] == "new" || $_POST['act'] == "edit" || $_GET['act'] == "new" || $_GET['act'] == "edit" || count($input_errors) > 0 ) :
?> ?>
<form action="system_usermanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()"> <form action="system_usermanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment