From 3265b349197a07152dd0650444c205a267697228 Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 11 Jan 2008 12:55:10 +0000 Subject: new feature: creation of a page listing all users and a user block on the front page git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@12 b3834d28-1941-0410-a4f8-b48e95affb8f --- services/userservice.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'services') diff --git a/services/userservice.php b/services/userservice.php index 4a7cd4f..381ae51 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -62,6 +62,22 @@ class UserService { return false; } + function & getUsers($nb=0) { + $query = 'SELECT * FROM '. $this->getTableName() .' ORDER BY `uId` DESC'; + if($nb>0) { + $query .= ' LIMIT 0, '.$nb; + } + if (! ($dbresult =& $this->db->sql_query($query)) ) { + message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db); + return false; + } + + while ($row = & $this->db->sql_fetchrow($dbresult)) { + $users[] = $row; + } + return $users; + } + function _randompassword() { $seed = (integer) md5(microtime()); mt_srand($seed); -- cgit v1.2.3