diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-06-22 12:50:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-06-22 12:50:57 +0200 |
commit | 83958ebd4be58c64b23a3e9535f4246faeff8f4a (patch) | |
tree | 169321f7bb32e315c6a33ce139b799efdc224da4 /lib/user.php | |
parent | c0af177223f5ebd74614b775121ea7f3497d25a5 (diff) | |
download | nextcloud-server-83958ebd4be58c64b23a3e9535f4246faeff8f4a.tar.gz nextcloud-server-83958ebd4be58c64b23a3e9535f4246faeff8f4a.zip |
add oc_user::getUser to get the user id of the loggedin user
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/user.php b/lib/user.php index 2e11a30e85e..7eafef924a8 100644 --- a/lib/user.php +++ b/lib/user.php @@ -232,6 +232,19 @@ class OC_USER { } /** + * @brief get the user idea of the user currently logged in. + * @return string uid or false + */ + public static function getUser(){ + if( isset($_SESSION['user_id']) AND $_SESSION['user_id'] ){ + return $_SESSION['user_id']; + } + else{ + return false; + } + } + + /** * @brief Autogenerate a password * @returns string * |