mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
User Manager Class Tweaks
This commit is contained in:
1 parent
db3ab9dd95
commit
2dd2b3c6f7
1 file changed
+2
-3
@@ -102,10 +102,9 @@ class UserManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getUserData ($type, $userId = '') {
|
public static function getUserData ($type, $userId = '') {
|
||||||
if (isset($_SESSION['user']['id'])) {
|
if ($userId == '') {
|
||||||
$userId = $_SESSION['user']['id'];
|
$userId = $_SESSION['user']['id'];
|
||||||
} else {
|
echo 'no user id';
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
$user = Db::loadOne ('SELECT ' . $type . ' FROM users WHERE user_id=?', array ($userId));
|
$user = Db::loadOne ('SELECT ' . $type . ' FROM users WHERE user_id=?', array ($userId));
|
||||||
return $user[$type];
|
return $user[$type];
|
||||||
|
|||||||
Reference in new issue
Block a user