Adding bugxies to scaffolding that should have been included in Ginsburg release master origin/master
authorJohnnie Lamar Odom II <jlodom00@alumni.amherst.edu>
Sun, 20 Sep 2020 22:36:52 +0000 (17:36 -0500)
committerJohnnie Lamar Odom II <jlodom00@alumni.amherst.edu>
Sun, 20 Sep 2020 22:36:52 +0000 (17:36 -0500)
code/scaffolding/adduser.php
code/scaffolding/getusers.php

index afa8037..2814b05 100644 (file)
@@ -15,7 +15,7 @@
                if(!ctype_alnum($username)){
                        $message = "Usernames for this test site must be alphanumeric";
                }
-               else if(Planworld::isUser($username)){
+               else if(intval(Planworld::isUser($username)) > 0){
                        $message = 'User ' . $username . ' already exists.';
                }
                else{
@@ -23,7 +23,7 @@
                        $newby->create();
                        $userExists = new User($username);
                        $userId = $userExists->userID;
-                       $pass = str_replace('.', '',(str_replace('/', '', crypt($stringLoginUser, ((int)$intLoginUser + 45678)))));
+                       $pass = str_replace('.', '',(str_replace('/', '', crypt($username, ((int)$userId + 45678)))));
                        $message = 'User ' . $username . ' created with password ' . $pass;
                }
        }
index d94ce98..3146d70 100644 (file)
@@ -19,7 +19,7 @@ if((isset($_POST['loginusername'])) && (isset($_POST['loginpassword']))){
        else{
                $userExists = new User($username);
                $userId = $userExists->userID;
-               $comparepass = crypt($username, ((int)$userId + 45678));
+               $comparepass = str_replace('.', '',(str_replace('/', '', crypt($username, ((int)$userId + 45678)))));
                if(strcmp($password, $comparepass) == 0){
                        $pw = new Planworld();
                        $arrayUsers = $pw->getAllUsers();