From c2f7394d9ed8408f824008a6a2ed5a57f03af51e Mon Sep 17 00:00:00 2001
From: Laurence Sebastian Bowes <elbows@sucs.org>
Date: Sat, 13 Feb 2016 03:44:17 +0000
Subject: [PATCH] Minor fixes. Happy with this code now.

---
 lib/member_functions.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/member_functions.php b/lib/member_functions.php
index ff41a26..f5f4d7b 100644
--- a/lib/member_functions.php
+++ b/lib/member_functions.php
@@ -41,14 +41,14 @@ function generateUid()
     while ($ok == false) {
 
         //generate random number between 00000 and 99999
-        $uid = sprintf("%06d", mt_rand(0, 99999));
+        $uid = sprintf("%05d", mt_rand(0, 99999));
 
-        // id return 1 for error (safe to take). 0 for sucess (taken) not safe
-        shell_exec("id ".$prefix.$uid, $output, $returnVal);
+        //id return 1 for error (safe to take). 0 for success (taken) not safe
+        exec("id ".$prefix.$uid, $output, $returnVal);
 
         //check the result of id
         if ($returnVal == 1) {
-            // We have a unused one!
+            // We have an unused one!
             $ok = true;
             $safeuid = $prefix.$uid;
         }
-- 
GitLab