mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-07 00:47:00 +03:00
Moved a few functions to misc, moved where permissions is included as it's needed everywhere.
This commit is contained in:
parent
6033bc12aa
commit
a57af479b8
4 changed files with 46 additions and 45 deletions
|
@ -31,40 +31,6 @@ define('PERM_UPDATE',0x02);
|
|||
define('PERM_UPDATESPECIAL',0x04);
|
||||
define('PERM_ADMIN',0x08);
|
||||
|
||||
|
||||
// move to misc?
|
||||
function get_zone_id($zone) {
|
||||
$db = get_db();
|
||||
|
||||
$q = $db->prepare('SELECT id FROM zones WHERE zone=?');
|
||||
$q->bindValue(1, $zone, SQLITE3_TEXT);
|
||||
$r = $q->execute();
|
||||
$ret = $r->fetchArray(SQLITE3_NUM);
|
||||
|
||||
if($ret) {
|
||||
return $ret[0];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// move to misc?
|
||||
function get_user_name($userid) {
|
||||
$db = get_db();
|
||||
|
||||
$q = $db->prepare('SELECT emailAddress FROM users WHERE id = ?');
|
||||
$q->bindValue(1, $userid, SQLITE3_INTEGER);
|
||||
$r = $q->execute();
|
||||
$ret = $r->fetchArray(SQLITE3_NUM);
|
||||
|
||||
if($ret) {
|
||||
return $ret[0];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Interface function - Return an array of permissions for the zone
|
||||
function get_zone_permissions($zone) {
|
||||
$db = get_db();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue