Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
eb2a1e0f
Commit
eb2a1e0f
authored
12 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
move phpdoc comments
parent
1a4021a0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/user/manager.php
+19
-1
19 additions, 1 deletion
lib/user/manager.php
lib/user/session.php
+13
-1
13 additions, 1 deletion
lib/user/session.php
lib/user/user.php
+20
-0
20 additions, 0 deletions
lib/user/user.php
with
52 additions
and
2 deletions
lib/user/manager.php
+
19
−
1
View file @
eb2a1e0f
...
...
@@ -43,6 +43,8 @@ class Manager extends PublicEmitter {
}
/**
* register a user backend
*
* @param \OC_User_Backend $backend
*/
public
function
registerBackend
(
$backend
)
{
...
...
@@ -50,6 +52,8 @@ class Manager extends PublicEmitter {
}
/**
* remove a user backend
*
* @param \OC_User_Backend $backend
*/
public
function
removeBackend
(
$backend
)
{
...
...
@@ -58,16 +62,21 @@ class Manager extends PublicEmitter {
}
}
/**
* remove all user backends
*/
public
function
clearBackends
()
{
$this
->
backends
=
array
();
}
/**
* get a user by user id
*
* @param string $uid
* @return \OC\User\User
*/
public
function
get
(
$uid
)
{
if
(
isset
(
$this
->
cachedUsers
[
$uid
]))
{
if
(
isset
(
$this
->
cachedUsers
[
$uid
]))
{
//check the cache first to prevent having to loop over the backends
return
$this
->
cachedUsers
[
$uid
];
}
foreach
(
$this
->
backends
as
$backend
)
{
...
...
@@ -78,6 +87,13 @@ class Manager extends PublicEmitter {
return
null
;
}
/**
* get or construct the user object
*
* @param string $uid
* @param \OC_User_Backend $backend
* @return \OC\User\User
*/
protected
function
getUserObject
(
$uid
,
$backend
)
{
if
(
isset
(
$this
->
cachedUsers
[
$uid
]))
{
return
$this
->
cachedUsers
[
$uid
];
...
...
@@ -87,6 +103,8 @@ class Manager extends PublicEmitter {
}
/**
* check if a user exists
*
* @param string $uid
* @return bool
*/
...
...
This diff is collapsed.
Click to expand it.
lib/user/session.php
+
13
−
1
View file @
eb2a1e0f
...
...
@@ -71,6 +71,8 @@ class Session implements Emitter {
}
/**
* get the manager object
*
* @return \OC\User\Manager
*/
public
function
getManager
()
{
...
...
@@ -110,6 +112,13 @@ class Session implements Emitter {
}
}
/**
* try to login with the provided credentials
*
* @param string $uid
* @param string $password
* @return bool
*/
public
function
login
(
$uid
,
$password
)
{
$this
->
manager
->
emit
(
'\OC\User'
,
'preLogin'
,
array
(
$uid
,
$password
));
$user
=
$this
->
manager
->
get
(
$uid
);
...
...
@@ -127,6 +136,9 @@ class Session implements Emitter {
}
}
/**
* logout the user from the session
*/
public
function
logout
()
{
$this
->
manager
->
emit
(
'\OC\User'
,
'logout'
);
$this
->
setUser
(
null
);
...
...
@@ -148,7 +160,7 @@ class Session implements Emitter {
}
/**
*
@brief
Remove cookie for "remember username"
* Remove cookie for "remember username"
*/
public
function
unsetMagicInCookie
()
{
unset
(
$_COOKIE
[
"oc_username"
]);
//TODO: DI
...
...
This diff is collapsed.
Click to expand it.
lib/user/user.php
+
20
−
0
View file @
eb2a1e0f
...
...
@@ -56,6 +56,8 @@ class User {
}
/**
* get the user id
*
* @return string
*/
public
function
getUID
()
{
...
...
@@ -63,6 +65,8 @@ class User {
}
/**
* get the displayname for the user, if no specific displayname is set it will fallback to the user id
*
* @return string
*/
public
function
getDisplayName
()
{
...
...
@@ -70,6 +74,8 @@ class User {
}
/**
* set the displayname for the user
*
* @param string $displayName
* @return bool
*/
...
...
@@ -83,6 +89,8 @@ class User {
}
/**
* Delete the user
*
* @return bool
*/
public
function
delete
()
{
...
...
@@ -97,6 +105,8 @@ class User {
}
/**
* Check if the password is valid for the user
*
* @param $password
* @return bool
*/
...
...
@@ -113,6 +123,8 @@ class User {
}
/**
* Set the password of the user
*
* @param string $password
* @param string $recoveryPassword for the encryption app to reset encryption keys
* @return bool
...
...
@@ -145,6 +157,8 @@ class User {
}
/**
* check if the backend supports changing passwords
*
* @return bool
*/
public
function
canChangePassword
()
{
...
...
@@ -152,6 +166,8 @@ class User {
}
/**
* check if the backend supports changing display names
*
* @return bool
*/
public
function
canChangeDisplayName
()
{
...
...
@@ -159,6 +175,8 @@ class User {
}
/**
* check if the user is enabled
*
* @return bool
*/
public
function
isEnabled
()
{
...
...
@@ -166,6 +184,8 @@ class User {
}
/**
* set the enabled status for the user
*
* @param bool $enabled
*/
public
function
setEnabled
(
$enabled
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment