summaryrefslogtreecommitdiff
path: root/services/userservice.php
diff options
context:
space:
mode:
Diffstat (limited to 'services/userservice.php')
-rw-r--r--services/userservice.php16
1 files changed, 16 insertions, 0 deletions
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);