From a041e0efbb9825a9c8d77cba989dcea27d0f825d Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sun, 29 Dec 2013 15:08:21 +0100 Subject: first api --- includes/model/User_model.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'includes/model/User_model.php') 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,5 +1,17 @@ 0) + return $user_source; + return null; +} + /** * Strip unwanted characters from a users nick. * @param string $nick @@ -22,6 +34,20 @@ function User($id) { return null; } +/** + * 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. * @@ -95,4 +121,4 @@ function User_generate_password_recovery_token(&$user) { return $user['password_recovery_token']; } -?> \ No newline at end of file +?> -- cgit v1.2.3-54-g00ecf