aboutsummaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-22 12:50:57 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-06-22 12:50:57 +0200
commit83958ebd4be58c64b23a3e9535f4246faeff8f4a (patch)
tree169321f7bb32e315c6a33ce139b799efdc224da4 /lib/user.php
parentc0af177223f5ebd74614b775121ea7f3497d25a5 (diff)
downloadnextcloud-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.php13
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
*