diff options
author | Philip Häusler <msquare@notrademark.de> | 2013-12-29 15:08:21 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2013-12-29 15:08:21 +0100 |
commit | a041e0efbb9825a9c8d77cba989dcea27d0f825d (patch) | |
tree | 218552b88cc74b883b31729234d83a803ff3bf6b /includes/model/User_model.php | |
parent | 124cf64d4fc6a277838de491bc6f5bfd443e6019 (diff) |
first api
Diffstat (limited to 'includes/model/User_model.php')
-rw-r--r-- | includes/model/User_model.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php index a69c288c..6b23f74b 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -1,6 +1,18 @@ <?php /** + * Returns User id array + */ +function mUserList() { + $user_source = sql_select("SELECT `UID` FROM `User`"); + if ($user_source === false) + return false; + if (count($user_source) > 0) + return $user_source; + return null; +} + +/** * Strip unwanted characters from a users nick. * @param string $nick */ @@ -23,6 +35,20 @@ function User($id) { } /** + * Returns user by id (limit informations. + * + * @param $id UID + */ +function mUser_Limit($id) { + $user_source = sql_select("SELECT `UID`, `Nick`, `Name`, `Vorname`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Avatar` FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); + if ($user_source === false) + return false; + if (count($user_source) > 0) + return $user_source[0]; + return null; +} + +/** * Returns User by api_key. * * @param string $api_key @@ -95,4 +121,4 @@ function User_generate_password_recovery_token(&$user) { return $user['password_recovery_token']; } -?>
\ No newline at end of file +?> |