summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2025-05-09 23:22:47 +0000
committerJohn Klug <john.klug@multitech.com>2025-05-09 23:22:47 +0000
commitd33e698296fd633d2f2d2cb6cbc45b5543fca468 (patch)
tree797cc50965a8413e21a29d4d4207e2af7b6011be
parentac8b036b7c15ef5b0b0f0abd84ee64ccc0a1510f (diff)
downloadcommissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.tar.gz
commissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.tar.bz2
commissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.zip
Fix uninitialized variable issues which fails in modern PHP1.0.4
-rw-r--r--www/commission/index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/www/commission/index.php b/www/commission/index.php
index ae5e2ee..c4fdb65 100644
--- a/www/commission/index.php
+++ b/www/commission/index.php
@@ -50,7 +50,11 @@ function chk_username($userid) {
if($_SERVER["REQUEST_METHOD"] == "POST"){
$mismatch = 1; // We have two different passwords
- $reset = trim($_POST["reset"]);
+ if (!array_key_exists("reset",$_POST)) {
+ $reset = "";
+ } else {
+ $reset = trim($_POST["reset"]);
+ }
syslog(LOG_ALERT, "Reset: $reset");
if ($reset === "Reset") {
$save_password = "";
@@ -149,6 +153,9 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
$handle = popen($cmd, 'r');
$username_err = trim(fread($handle, 4192));
$status = pclose($handle);
+ if(! isset($result)) {
+ $result = "";
+ }
syslog(LOG_ALERT, "useradd: status: $status result: $result");
$uid = chk_username($username);
if ($uid === -1) {