From ed16a89cf965c66415b792331fc403d5ecfabaa4 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 27 Jul 2016 17:40:35 +0200 Subject: User: use Model --- include/settings.php | 20 ++++++++++---------- include/users-new.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/settings.php b/include/settings.php index bd4c0d0..23d6371 100644 --- a/include/settings.php +++ b/include/settings.php @@ -40,12 +40,12 @@ require('./header.php'); try { $user = new User($_pdo, $_GET['delete_user']); if ($user->delete()) { - echo "
The user with username {$user->getUsername()} has been removed.
"; + echo "
The user with username {$user->username} has been removed.
"; } else { - echo "
The user with username {$user->getUsername()} could not be removed.
"; + echo "
The user with username {$user->username} could not be removed.
"; } } catch (PDOException $e) { - echo "
The user with username {$user->getUsername()} could not be removed due to a PDO error.
"; + echo "
The user with username {$user->username} could not be removed due to a PDO error.
"; } catch (Exception $e) { echo "
The user with id {$_GET['delete_user']} could not be found.
"; } @@ -65,7 +65,7 @@ require('./header.php'); echo '
The current password was incorrect.
'; } else { try { - $_user->setPassword($_POST['password_update']); + $_user->password = $_POST['password_update']; echo '
Password successfully changed.
'; } catch (PDOException $e) { echo '
An unknown error occurred.
'; @@ -106,18 +106,18 @@ require('./header.php'); $users = BusinessAdmin::getUsers($_pdo); foreach ($users as $user) { echo " - {$user->getId()} - {$user->getUsername()}"; + data-mixer-order-id='{$user->id}' + data-mixer-order-username='{$user->username}'> + {$user->id} + {$user->username}"; if ($_user->isAdmin()) { - if ($user->getId() == $_user->getId()) { + if ($user->id == $_user->id) { echo " "; } else { echo " - + "; } } diff --git a/include/users-new.php b/include/users-new.php index 5b4bd7f..0582134 100644 --- a/include/users-new.php +++ b/include/users-new.php @@ -33,7 +33,7 @@ try { $response->message = "The user could not be created due to an error."; } else { $response->success = true; - $response->message = "User '{$user->getUsername()}' has been created with password $pass. Refresh the page."; + $response->message = "User '{$user->username}' has been created with password $pass. Refresh the page."; } } catch (PDOException $e) { $response->success = false; -- cgit v1.2.3