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
9c124a8d
Commit
9c124a8d
authored
14 years ago
by
Aldo "xoen" Giambelluca
Browse files
Options
Downloads
Patches
Plain Diff
Reverted to self::$classType syntax and fixed the use of self in non-object
parent
42d603c5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
inc/User/database.php
+15
-16
15 additions, 16 deletions
inc/User/database.php
inc/User/ldap.php
+3
-4
3 additions, 4 deletions
inc/User/ldap.php
inc/User/mod_auth.php
+1
-1
1 addition, 1 deletion
inc/User/mod_auth.php
inc/lib_user.php
+38
-38
38 additions, 38 deletions
inc/lib_user.php
with
57 additions
and
59 deletions
inc/User/database.php
+
15
−
16
View file @
9c124a8d
...
...
@@ -28,7 +28,7 @@
*
*/
class
OC_USER_Database
extends
OC_USER
{
/**
* Check if the login button is pressed and logg the user in
*
...
...
@@ -54,8 +54,7 @@ class OC_USER_Database extends OC_USER {
return
(
''
);
}
/**
* Try to create a new user
*
...
...
@@ -76,7 +75,7 @@ class OC_USER_Database extends OC_USER {
return
(
$result
)
?
true
:
false
;
}
}
/**
* Try to login a user
*
...
...
@@ -100,7 +99,7 @@ class OC_USER_Database extends OC_USER {
return
false
;
}
}
/**
* Check if the logout button is pressed and logout the user
*
...
...
@@ -113,7 +112,7 @@ class OC_USER_Database extends OC_USER {
$_SESSION
[
'username_clean'
]
=
''
;
}
}
/**
* Check if a user is logged in
*
...
...
@@ -125,7 +124,7 @@ class OC_USER_Database extends OC_USER {
return
false
;
}
}
/**
* Try to create a new group
*
...
...
@@ -143,7 +142,7 @@ class OC_USER_Database extends OC_USER {
return
false
;
}
}
/**
* Get the ID of a user
*
...
...
@@ -169,7 +168,7 @@ class OC_USER_Database extends OC_USER {
return
0
;
}
}
/**
* Get the ID of a group
*
...
...
@@ -195,7 +194,7 @@ class OC_USER_Database extends OC_USER {
return
0
;
}
}
/**
* Get the name of a group
*
...
...
@@ -216,7 +215,7 @@ class OC_USER_Database extends OC_USER {
return
0
;
}
}
/**
* Check if a user belongs to a group
*
...
...
@@ -238,7 +237,7 @@ class OC_USER_Database extends OC_USER {
return
false
;
}
}
/**
* Add a user to a group
*
...
...
@@ -264,11 +263,11 @@ class OC_USER_Database extends OC_USER {
return
true
;
}
}
public
static
function
generatePassword
()
{
return
uniqId
();
}
/**
* Get all groups the user belongs to
*
...
...
@@ -289,7 +288,7 @@ class OC_USER_Database extends OC_USER {
return
$groups
;
}
/**
* Set the password of a user
*
...
...
@@ -304,7 +303,7 @@ class OC_USER_Database extends OC_USER {
return
$result
?
true
:
false
;
}
/**
* Check the password of a user
*
...
...
This diff is collapsed.
Click to expand it.
inc/User/ldap.php
+
3
−
4
View file @
9c124a8d
...
...
@@ -23,11 +23,10 @@
require_once
'mod_auth.php'
;
/**
* Class for usermanagement in a SQL Database
* eg mysql, sqlite
* Class for usermanagement in a SQL Database (e.g. MySql, SQLite)
*/
class
OC_USER_LDAP
extends
OC_USER_MOD_AUTH
{
}
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
inc/User/mod_auth.php
+
1
−
1
View file @
9c124a8d
...
...
@@ -67,7 +67,7 @@ class OC_USER_MOD_AUTH extends OC_USER {
*
*/
public
static
function
logoutLisener
()
{
if
(
isset
(
$_GET
[
'logoutbutton'
])
AND
isset
(
$_SESSION
[
'username'
])
)
{
if
(
isset
(
$_GET
[
'logoutbutton'
])
AND
isset
(
$_SESSION
[
'username'
])
)
{
header
(
'WWW-Authenticate: Basic realm="ownCloud"'
);
header
(
'HTTP/1.0 401 Unauthorized'
);
die
(
'401 Unauthorized'
);
...
...
This diff is collapsed.
Click to expand it.
inc/lib_user.php
+
38
−
38
View file @
9c124a8d
...
...
@@ -29,11 +29,11 @@ if ( !$CONFIG_INSTALLED ) {
$_SESSION
[
'username_clean'
]
=
''
;
}
//
c
ache the userid's an groupid's
//
C
ache the userid's an groupid's
if
(
!
isset
(
$_SESSION
[
'user_id_cache'
])
)
{
$_SESSION
[
'user_id_cache'
]
=
array
();
}
if
(
!
isset
(
$_SESSION
[
'group_id_cache'
])
)
{
if
(
!
isset
(
$_SESSION
[
'group_id_cache'
])
)
{
$_SESSION
[
'group_id_cache'
]
=
array
();
}
...
...
@@ -44,125 +44,125 @@ if( !isset($_SESSION['group_id_cache']) ) {
*
*/
class
OC_USER
{
public
static
$classType
;
/**
* Check if the login button is pressed and logg the user in
*
*/
public
static
function
loginLisener
()
{
return
self
::
classType
->
loginLisener
();
return
self
::
$
classType
->
loginLisener
();
}
/**
* Try to create a new user
*
*/
public
static
function
createUser
(
$username
,
$password
)
{
return
self
::
classType
->
createUser
(
$username
,
$password
);
return
self
::
$
classType
->
createUser
(
$username
,
$password
);
}
/**
* Try to login a user
*
*/
public
static
function
login
(
$username
,
$password
)
{
return
self
::
classType
->
login
(
$username
,
$password
);
return
self
::
$
classType
->
login
(
$username
,
$password
);
}
/**
* Check if the logout button is pressed and logout the user
*
*/
public
static
function
logoutLisener
()
{
return
self
::
classType
->
logoutLisener
();
return
self
::
$
classType
->
logoutLisener
();
}
/**
* Check if a user is logged in
*
*/
public
static
function
isLoggedIn
()
{
return
self
::
classType
->
isLoggedIn
();
return
self
::
$
classType
->
isLoggedIn
();
}
/**
* Try to create a new group
*
*/
public
static
function
createGroup
(
$groupName
)
{
return
self
::
classType
->
createGroup
(
$groupName
);
return
self
::
$
classType
->
createGroup
(
$groupName
);
}
/**
* Get the ID of a user
*
*/
public
static
function
getUserId
(
$username
,
$noCache
=
false
)
{
return
self
::
classType
->
getUserId
(
$username
,
$noCache
);
return
self
::
$
classType
->
getUserId
(
$username
,
$noCache
);
}
/**
* Get the ID of a group
*
*/
public
static
function
getGroupId
(
$groupName
,
$noCache
=
false
)
{
return
self
::
classType
->
getGroupId
(
$groupName
,
$noCache
);
return
self
::
$
classType
->
getGroupId
(
$groupName
,
$noCache
);
}
/**
* Get the name of a group
*
*/
public
static
function
getGroupName
(
$groupId
,
$noCache
=
false
)
{
return
self
::
classType
->
getGroupName
(
$groupId
,
$noCache
);
return
self
::
$
classType
->
getGroupName
(
$groupId
,
$noCache
);
}
/**
* Check if a user belongs to a group
*
*/
public
static
function
inGroup
(
$username
,
$groupName
)
{
return
self
::
classType
->
inGroup
(
$username
,
$groupName
);
return
self
::
$
classType
->
inGroup
(
$username
,
$groupName
);
}
/**
* Add a user to a group
*
*/
public
static
function
addToGroup
(
$username
,
$groupName
)
{
return
self
::
classType
->
addToGroup
(
$username
,
$groupName
);
return
self
::
$
classType
->
addToGroup
(
$username
,
$groupName
);
}
public
static
function
generatePassword
()
{
return
uniqId
();
}
/**
* Get all groups the user belongs to
*
*/
public
static
function
getUserGroups
(
$username
)
{
return
self
::
classType
->
getUserGroups
(
$username
);
return
self
::
$
classType
->
getUserGroups
(
$username
);
}
/**
* Set the password of a user
*
*/
public
static
function
setPassword
(
$username
,
$password
)
{
return
self
::
classType
->
setPassword
(
$username
,
$password
);
return
self
::
$
classType
->
setPassword
(
$username
,
$password
);
}
/**
* Check the password of a user
*
*/
public
static
function
checkPassword
(
$username
,
$password
)
{
return
self
::
classType
->
checkPassword
(
$username
,
$password
);
return
self
::
$
classType
->
checkPassword
(
$username
,
$password
);
}
}
...
...
@@ -174,24 +174,24 @@ function set_OC_USER() {
global
$CONFIG_BACKEND
;
if
(
isset
(
$CONFIG_BACKEND
)
)
{
switch
(
$CONFIG_BACKEND
)
{
switch
(
$CONFIG_BACKEND
)
{
case
'mysql'
:
case
'sqlite'
:
require_once
'User/database.php'
;
self
::
classType
=
new
OC_USER_Database
();
OC_USER
::
$
classType
=
new
OC_USER_Database
();
break
;
case
'ldap'
:
require_once
'User/ldap.php'
;
self
::
classType
=
new
OC_USER_LDAP
();
OC_USER
::
$
classType
=
new
OC_USER_LDAP
();
break
;
default
:
require_once
'User/database.php'
;
self
::
classType
=
new
OC_USER_Database
();
OC_USER
::
$
classType
=
new
OC_USER_Database
();
break
;
}
}
else
{
require_once
'User/database.php'
;
self
::
classType
=
new
OC_USER_Database
();
OC_USER
::
$
classType
=
new
OC_USER_Database
();
}
}
...
...
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