summaryrefslogtreecommitdiff
path: root/services/userservice.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-09-11 16:51:00 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-09-11 16:51:00 +0000
commit1d059dc06d24e02c858c43d70eaa70453d51cdff (patch)
treed29378c81ec8a9498a33ed7276722031c1f12981 /services/userservice.php
parentbfdc6bd7380fda2d5d8ca78a462047069c4020bc (diff)
downloadsemanticscuttle-1d059dc06d24e02c858c43d70eaa70453d51cdff.tar.gz
semanticscuttle-1d059dc06d24e02c858c43d70eaa70453d51cdff.tar.bz2
New Feature: add users admin page with delete function
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@146 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/userservice.php')
-rw-r--r--services/userservice.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/services/userservice.php b/services/userservice.php
index 3d2058f..f620735 100644
--- a/services/userservice.php
+++ b/services/userservice.php
@@ -336,6 +336,35 @@ class UserService {
return true;
}
+ function getAllUsers ( ) {
+ $query = 'SELECT * FROM '. $this->getTableName();
+
+ if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ message_die(GENERAL_ERROR, 'Could not get users', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ $rows = array();
+
+ while ( $row = $this->db->sql_fetchrow($dbresult) ) {
+ $rows[] = $row;
+ }
+
+ return $rows;
+ }
+
+ function deleteUser($uId) {
+ $query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);
+
+ if (!($dbresult = & $this->db->sql_query($query))) {
+ message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ return true;
+ }
+
+
function sanitisePassword($password) {
return sha1(trim($password));
}