Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Curriculum-Request
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Tim Steiner
Curriculum-Request
Commits
9e86e454
Commit
9e86e454
authored
16 years ago
by
Tim Steiner
Browse files
Options
Downloads
Patches
Plain Diff
Handle ::find(NULL) on Group and User models.
parent
d30c551f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
application/modules/auth/models/GroupModel.php
+21
-1
21 additions, 1 deletion
application/modules/auth/models/GroupModel.php
application/modules/auth/models/UserModel.php
+11
-6
11 additions, 6 deletions
application/modules/auth/models/UserModel.php
with
32 additions
and
7 deletions
application/modules/auth/models/GroupModel.php
+
21
−
1
View file @
9e86e454
...
...
@@ -5,7 +5,9 @@ class Auth_GroupModel extends Unl_Model
public
static
function
find
(
$id
)
{
if
(
Unl_Util
::
isArray
(
$id
)
&&
count
(
$id
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$id
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
...
...
@@ -62,6 +64,12 @@ class Auth_GroupModel extends Unl_Model
*/
static
public
function
findByUser
(
$user
,
$implicitMemberships
=
true
)
{
if
(
Unl_Util
::
isArray
(
$user
)
&&
count
(
$user
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$user
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
$select
=
new
Zend_Db_Select
(
$db
);
...
...
@@ -139,6 +147,12 @@ class Auth_GroupModel extends Unl_Model
*/
static
public
function
findByChildGroup
(
$group
,
$impliedMemberships
=
true
)
{
if
(
Unl_Util
::
isArray
(
$group
)
&&
count
(
$group
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$group
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
$select
=
new
Zend_Db_Select
(
$db
);
...
...
@@ -193,6 +207,12 @@ class Auth_GroupModel extends Unl_Model
*/
static
public
function
findByParentGroup
(
$group
,
$impliedMemberships
=
true
,
$primaryGroups
=
false
)
{
if
(
Unl_Util
::
isArray
(
$group
)
&&
count
(
$group
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$group
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
$select
=
new
Zend_Db_Select
(
$db
);
...
...
This diff is collapsed.
Click to expand it.
application/modules/auth/models/UserModel.php
+
11
−
6
View file @
9e86e454
...
...
@@ -11,12 +11,11 @@ class Auth_UserModel extends Unl_Model {
static
public
function
find
(
$id
)
{
if
(
Unl_Util
::
isArray
(
$id
)
&&
count
(
$id
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
if
(
$id
===
null
)
{
return
null
;
}
if
(
Unl_Util
::
isArray
(
$id
)
&&
count
(
$id
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$id
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
...
...
@@ -108,6 +107,12 @@ class Auth_UserModel extends Unl_Model {
*/
static
public
function
findByParentGroup
(
$group
,
$impliedMemberships
=
true
)
{
if
(
Unl_Util
::
isArray
(
$group
)
&&
count
(
$group
)
==
0
)
{
return
new
Unl_Model_Collection
(
__CLASS__
);
}
else
if
(
$group
===
NULL
)
{
return
null
;
}
$db
=
Zend_Registry
::
get
(
'db'
);
$select
=
new
Zend_Db_Select
(
$db
);
...
...
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