summaryrefslogtreecommitdiff
path: root/includes/pages/user_messages.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-11 01:26:34 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commit4e09ee3eb255160c88a378375d69123a3e000497 (patch)
treee4a03ff40c939473cc1278f8286675cfa31e4556 /includes/pages/user_messages.php
parent7c6afc2bfe3263b91ecabf5530da57fe1162ea0b (diff)
Replaced more user related stuff
(Contains some buggy stuff too...)
Diffstat (limited to 'includes/pages/user_messages.php')
-rw-r--r--includes/pages/user_messages.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php
index 4431133e..9b587343 100644
--- a/includes/pages/user_messages.php
+++ b/includes/pages/user_messages.php
@@ -39,17 +39,18 @@ function user_messages()
$request = request();
if (!$request->has('action')) {
- $users = DB::select(
- 'SELECT `UID`, `Nick` FROM `User` WHERE NOT `UID`=? ORDER BY `Nick`',
- [$user->id]
- );
+ /** @var User[] $users */
+ $users = User::query()
+ ->whereKeyNot($user->id)
+ ->orderBy('name')
+ ->get(['id', 'name']);
$to_select_data = [
'' => __('Select recipient...')
];
foreach ($users as $u) {
- $to_select_data[$u['UID']] = $u['Nick'];
+ $to_select_data[$u->id] = $u->name;
}
$to_select = html_select_key('to', 'to', $to_select_data, '');