Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
188b87e0
Commit
188b87e0
authored
7 years ago
by
Morris Jobke
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup legacy user class from unused methods
Signed-off-by:
Morris Jobke
<
hey@morrisjobke.de
>
parent
989614f9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/Controller/LostController.php
+1
-1
1 addition, 1 deletion
core/Controller/LostController.php
lib/private/legacy/user.php
+1
-67
1 addition, 67 deletions
lib/private/legacy/user.php
with
2 additions
and
68 deletions
core/Controller/LostController.php
+
1
−
1
View file @
188b87e0
...
...
@@ -267,7 +267,7 @@ class LostController extends Controller {
\OC_Hook
::
emit
(
'\OC\Core\LostPassword\Controller\LostController'
,
'post_passwordReset'
,
array
(
'uid'
=>
$userId
,
'password'
=>
$password
));
$this
->
config
->
deleteUserValue
(
$userId
,
'core'
,
'lostpassword'
);
@
\OC
_User
::
unsetMagicInCookie
();
@
\OC
::
$server
->
getUserSession
()
->
unsetMagicInCookie
();
}
catch
(
\Exception
$e
){
return
$this
->
error
(
$e
->
getMessage
());
}
...
...
This diff is collapsed.
Click to expand it.
lib/private/legacy/user.php
+
1
−
67
View file @
188b87e0
...
...
@@ -155,20 +155,6 @@ class OC_User {
}
}
/**
* Try to login a user using the magic cookie (remember login)
*
* @deprecated use \OCP\IUserSession::loginWithCookie()
* @param string $uid The username of the user to log in
* @param string $token
* @param string $oldSessionId
* @return bool
*/
public
static
function
loginWithCookie
(
$uid
,
$token
,
$oldSessionId
)
{
return
self
::
getUserSession
()
->
loginWithCookie
(
$uid
,
$token
,
$oldSessionId
);
}
/**
* Try to login a user, assuming authentication
* has already happened (e.g. via Single Sign On).
...
...
@@ -233,7 +219,7 @@ class OC_User {
//setup extra user backends
self
::
setupBackends
();
self
::
unsetMagicInCookie
();
self
::
getUserSession
()
->
unsetMagicInCookie
();
return
self
::
loginWithApache
(
$backend
);
}
...
...
@@ -381,17 +367,6 @@ class OC_User {
}
}
/**
* Autogenerate a password
*
* @return string
*
* generates a password
*/
public
static
function
generatePassword
()
{
return
\OC
::
$server
->
getSecureRandom
()
->
generate
(
30
);
}
/**
* Set password
*
...
...
@@ -546,30 +521,6 @@ class OC_User {
return
\OC
::
$server
->
getUserManager
()
->
userExists
(
$uid
);
}
/**
* disables a user
*
* @param string $uid the user to disable
*/
public
static
function
disableUser
(
$uid
)
{
$user
=
\OC
::
$server
->
getUserManager
()
->
get
(
$uid
);
if
(
$user
)
{
$user
->
setEnabled
(
false
);
}
}
/**
* enable a user
*
* @param string $uid
*/
public
static
function
enableUser
(
$uid
)
{
$user
=
\OC
::
$server
->
getUserManager
()
->
get
(
$uid
);
if
(
$user
)
{
$user
->
setEnabled
(
true
);
}
}
/**
* checks if a user is enabled
*
...
...
@@ -585,23 +536,6 @@ class OC_User {
}
}
/**
* Set cookie value to use in next page load
*
* @param string $username username to be set
* @param string $token
*/
public
static
function
setMagicInCookie
(
$username
,
$token
)
{
self
::
getUserSession
()
->
setMagicInCookie
(
$username
,
$token
);
}
/**
* Remove cookie for "remember username"
*/
public
static
function
unsetMagicInCookie
()
{
self
::
getUserSession
()
->
unsetMagicInCookie
();
}
/**
* Returns the first active backend from self::$_usedBackends.
*
...
...
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