diff options
| author | Horus3 | 2014-03-12 22:11:50 +0100 |
|---|---|---|
| committer | Horus3 | 2014-03-12 22:11:50 +0100 |
| commit | 2f0f4ca056f92ffd2bbf80e7b7c49b489d6e7ed4 (patch) | |
| tree | b14d63c782c3088d904858140d947492d946e29f /www/functions/func_user.php | |
| parent | 478a6dbc03c1ed65f5a187a6752bc130d3b82ac3 (diff) | |
| download | files.iamfabulous.de-2f0f4ca056f92ffd2bbf80e7b7c49b489d6e7ed4.tar.gz | |
more modular for greater flexibility
Diffstat (limited to 'www/functions/func_user.php')
| -rw-r--r-- | www/functions/func_user.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/www/functions/func_user.php b/www/functions/func_user.php index 2e49651..59e6dda 100644 --- a/www/functions/func_user.php +++ b/www/functions/func_user.php @@ -1,5 +1,5 @@ <? -function user($db){ +function account($db){ echo "loged in as: " . $_SESSION["username"]; $safe_name=SQLite3::escapeString("$_SESSION[username]"); $invite_db = $db->query("SELECT invites FROM user WHERE name='" . $safe_name . "';"); @@ -11,3 +11,14 @@ function user($db){ return true; } +function user($db, $user){ + + $owner_db = $db->query("SELECT id FROM user WHERE name='" . SQLite3::escapeString($user) . "';"); + $owner_ar = $owner_db->fetchArray(SQLITE3_NUM); + if(empty($owner_ar)){ + return false; + } + + $owner = $owner_ar[0]; + return $owner; +} |
