aboutsummaryrefslogtreecommitdiff
path: root/include/settings.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 17:40:35 +0200
committerCamil Staps2016-07-27 17:40:35 +0200
commited16a89cf965c66415b792331fc403d5ecfabaa4 (patch)
tree0619c65d30bd414260619848d7a018ec7c592cd1 /include/settings.php
parentPayment: use Model (diff)
User: use Model
Diffstat (limited to 'include/settings.php')
-rw-r--r--include/settings.php20
1 files changed, 10 insertions, 10 deletions
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 "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->getUsername()}</i> has been removed.</div>";
+ echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->username}</i> has been removed.</div>";
} else {
- echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->getUsername()}</i> could not be removed.</div>";
+ echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->username}</i> could not be removed.</div>";
}
} catch (PDOException $e) {
- echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->getUsername()}</i> could not be removed due to a PDO error.</div>";
+ echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->username}</i> could not be removed due to a PDO error.</div>";
} catch (Exception $e) {
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with id {$_GET['delete_user']} could not be found.</div>";
}
@@ -65,7 +65,7 @@ require('./header.php');
echo '<div class="alert alert-danger">The current password was incorrect.</div>';
} else {
try {
- $_user->setPassword($_POST['password_update']);
+ $_user->password = $_POST['password_update'];
echo '<div class="alert alert-success">Password successfully changed.</div>';
} catch (PDOException $e) {
echo '<div class="alert alert-danger">An unknown error occurred.</div>';
@@ -106,18 +106,18 @@ require('./header.php');
$users = BusinessAdmin::getUsers($_pdo);
foreach ($users as $user) {
echo "<tr class='mix'
- data-mixer-order-id='{$user->getId()}'
- data-mixer-order-username='{$user->getUsername()}'>
- <td class='col-min-width'>{$user->getId()}</td>
- <td class='col-max-width'>{$user->getUsername()}</td>";
+ data-mixer-order-id='{$user->id}'
+ data-mixer-order-username='{$user->username}'>
+ <td class='col-min-width'>{$user->id}</td>
+ <td class='col-max-width'>{$user->username}</td>";
if ($_user->isAdmin()) {
- if ($user->getId() == $_user->getId()) {
+ if ($user->id == $_user->id) {
echo "<td class='col-min-width'>
<a title='Change password' href='#' onclick='$(\"#password-current\").focus();' class='btn btn-warning btn-circle fa fa-key'></a>
</td>";
} else {
echo "<td class='col-min-width'>
- <a title='Delete' href='?delete_user={$user->getId()}' class='btn btn-danger btn-circle fa fa-times'></a>
+ <a title='Delete' href='?delete_user={$user->id}' class='btn btn-danger btn-circle fa fa-times'></a>
</td>";
}
}