/** * description: Returns an array with the given user's info, except for the password * * @param username: The user to retrieve the info of * @return array: The user's info in an array */ public function getUserInfo($username) { $id = parent::getUserID($username); $resourceid = $this->_dbConnection->selectFromTable("RoboUsers", "UserID", $id); $arrInfo = $this->_dbConnection->formatQuery($resourceid); unset($arrInfo[0]["UserPassword"]); // removes the user's password from the array of info for security, because it will not be needed when calling this method return $arrInfo[0]; }
/** * Sets a user's type as "Admin" * * @param username: The username to give admin access to * @return void */ public function setAdmin($username) { $id = parent::getUserID($username); $arrVals = array("UserType" => "Admin"); $this->_dbConnection->updateTable("RoboUsers", "RoboUsers", "UserID", $id, "UserID", $arrVals, "UserID = {$id}"); }