summaryrefslogtreecommitdiffstats
path: root/code/user.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'code/user.inc.php')
-rw-r--r--code/user.inc.php68
1 files changed, 34 insertions, 34 deletions
diff --git a/code/user.inc.php b/code/user.inc.php
index f945245..b9cab2d 100644
--- a/code/user.inc.php
+++ b/code/user.inc.php
@@ -75,66 +75,66 @@
}
function IsAdmin($id = -1) {
- if($id < 0) return ($this->uid != 0 && $this->gid == 0);
+ if($id < 0) return ($this->uid != 0 && $this->gid == 0);
return ($id != 0 && $this->GetGid($id) == 0);
}
function GetGid($id = -1) {
- if($id < 0) return $this->gid;
-
- $res = $GLOBALS['db']->Execute('SELECT gid FROM users WHERE id = ?', $id);
-
- return $res->fields[0];
+ if($id < 0) return $this->gid;
+
+ $res = $GLOBALS['db']->Execute('SELECT gid FROM users WHERE id = ?', $id);
+
+ return $res->fields[0];
}
function GetName($id = -1) {
- if($id < 0) return $this->name;
-
- $res = $GLOBALS['db']->Execute('SELECT user FROM users WHERE id = ?', $id);
-
- return $res->fields[0];
+ if($id < 0) return $this->name;
+
+ $res = $GLOBALS['db']->Execute('SELECT user FROM users WHERE id = ?', $id);
+
+ return $res->fields[0];
}
function Exists($name) {
- $res = $GLOBALS['db']->Execute('SELECT id FROM users WHERE user = ?', $name);
-
- return ($res->RecordCount() > 0);
+ $res = $GLOBALS['db']->Execute('SELECT id FROM users WHERE user = ?', $name);
+
+ return ($res->RecordCount() > 0);
}
function Add($name, $gid, $pass) {
- if($this->Exists($name)) return 0;
-
- $GLOBALS['db']->Execute('INSERT INTO users (user, gid, password) VALUES (?, ?, ?)',
- array($name, $gid, $pass));
-
- return $GLOBALS['db']->Insert_ID();
+ if($this->Exists($name)) return 0;
+
+ $GLOBALS['db']->Execute('INSERT INTO users (user, gid, password) VALUES (?, ?, ?)',
+ array($name, $gid, $pass));
+
+ return $GLOBALS['db']->Insert_ID();
}
function ChangePassword($id = -1, $new_pass) {
- if($id < 0) $id = $this->uid;
-
- $GLOBALS['db']->Execute('UPDATE users SET password = ? WHERE id = ?', array($new_pass, $id));
-
- return ($GLOBALS['db']->Affected_Rows() > 0);
+ if($id < 0) $id = $this->uid;
+
+ $GLOBALS['db']->Execute('UPDATE users SET password = ? WHERE id = ?', array($new_pass, $id));
+
+ return ($GLOBALS['db']->Affected_Rows() > 0);
}
function ChangeGroup($id, $gid) {
- $GLOBALS['db']->Execute('UPDATE users SET gid = ? WHERE id = ?', array($gid, $id));
-
- return ($GLOBALS['db']->Affected_Rows() > 0);
+ $GLOBALS['db']->Execute('UPDATE users SET gid = ? WHERE id = ?', array($gid, $id));
+
+ return ($GLOBALS['db']->Affected_Rows() > 0);
}
function Rename($id, $new_name) {
- $GLOBALS['db']->Execute('UPDATE users SET user = ? WHERE id = ?', array($new_name, $id));
-
- return ($GLOBALS['db']->Affected_Rows() > 0);
+ $GLOBALS['db']->Execute('UPDATE users SET user = ? WHERE id = ?', array($new_name, $id));
+
+ return ($GLOBALS['db']->Affected_Rows() > 0);
}
function Delete($id) {
- $GLOBALS['db']->Execute('DELETE FROM users WHERE id = ?', $id);
-
- return ($GLOBALS['db']->Affected_Rows() > 0);
+ $GLOBALS['db']->Execute('DELETE FROM users WHERE id = ?', $id);
+
+ return ($GLOBALS['db']->Affected_Rows() > 0);
}
}