[owncloud-devel] [ 6.0.2] Question on user ID

Arthur Schiwon blizzz at owncloud.com
Fri Apr 11 08:11:04 GMT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10.04.2014 21:03, Steve Robinson wrote:
> 
> 
> The use case is as follows:
> 
> Use the Externals app to point to another web page within the 
> ownCloud webUI. It is desired to be able to have access to certain 
> data files for the given user within the ownCloud data directory.
> 
> Question:
> 
> Is there any way to determine what the userid of the logged in
> user is? In other words, User A logs into ownCloud. They want to be
> able to obtain the User A user ID somehow after User A has logged
> in.

sure:

$userid = \OCP\User::getUser();

Cheers
Arthur

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQIcBAEBAgAGBQJTR6OUAAoJEHQk8YdIVN8jxbIP/iCU91HdCDa1cEWUSB3/ApTK
52vTo9RbocpNuE5dCFRx2U+NRNFZ2okYtqFUMM1Xrz5595nw4ZCCmW4tmRGipsGK
IF6KXMe4npWUWL2B64i4V4xCoLCX64vx9E9LYTSds5/zOcK+T2zAl2WirYzB4x57
3UsPyVHhf/pZ3jWqCY8qQvEHKk84+MzEKWo7DJGtKrqpesQbSDZu5dm6gTR3TM+y
gskW/Z1QOl0+040HVbPDa5YmeBGfExCxyCStp8qPz6aVfyhLyvX5fb7FziqErpys
YYp7Q97WBH6d03mUW+DY098g1rnzKsmvYh8hkd/aiwBfApNezygjwlEvnwvYSClE
53OXaiedkhqBoFxypw6qx+TXnhwffecN+4iimzkFm5cRxHVQWBDzEcwCKDvbbXFg
vQfS/20Hn+Wv0QZFjbDVBr6Rs2oAaxjW7RnU71RNgU/+HSl6EPWix5DC9e4r1Air
Rf20fYNywuCf8CeWHPqVFt9i86ghO/q2L+vgeRGTP/5alRWTpXrsLKRSlxpWsUvI
4+8dYVdlcxRtfeDA1nZQ/Sg1jvomNBZ2UjGWHLcXoYgIIAwJEvv+nJ9d7G2DQR2j
qqDkIGKTg7HGjvm+V1XYByP93PRheh6QQIcjUzuTaIp1lkP1ToNnqSeK3FvCGysl
Ru/e2ciRbhuV4ZC9anfk
=IMN5
-----END PGP SIGNATURE-----


More information about the Devel mailing list