Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-auth_ldap_syncplus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-auth_ldap_syncplus
Commits
4f08d2b5
Commit
4f08d2b5
authored
10 years ago
by
Alexander Bias
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix: Fetching user details from LDAP on manual user creation didn't work in some circumstances
parent
9ae2e15b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
auth.php
+1
-1
1 addition, 1 deletion
auth.php
eventhandler.php
+21
-8
21 additions, 8 deletions
eventhandler.php
with
23 additions
and
9 deletions
README.md
+
1
−
0
View file @
4f08d2b5
...
...
@@ -16,6 +16,7 @@ This plugin requires Moodle 2.7+
Changes
-------
*
2014-09-12 - Bugfix: Fetching user details from LDAP on manual user creation didn't work in some circumstances
*
2014-09-02 - Bugfix: Check if LDAP auth is really used on manual user creation
*
2014-08-29 - Support login via email for first-time LDAP logins (MDL-46638)
*
2014-08-29 - Update version.php
...
...
This diff is collapsed.
Click to expand it.
auth.php
+
1
−
1
View file @
4f08d2b5
...
...
@@ -354,7 +354,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
$maxxcount
=
100
;
foreach
(
$users
as
$user
)
{
if
(
!
$this
->
update_user_record
(
$user
->
username
,
$updatekeys
))
{
// user_updated event is fired hereby
if
(
!
$this
->
update_user_record
(
$user
->
username
,
$updatekeys
))
{
$skipped
=
' - '
.
get_string
(
'skipped'
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
eventhandler.php
+
21
−
8
View file @
4f08d2b5
...
...
@@ -26,13 +26,26 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
function
update_user_onevent
(
$eventdata
)
{
// Do only if user has ldap_syncplus authentication and
// do only if username is enclosed in $eventdata - this event handler might be called twice when creating an user, so we have to handle this fact
if
(
isset
(
$eventdata
->
auth
)
&&
$eventdata
->
auth
==
'ldap_syncplus'
&&
isset
(
$eventdata
->
username
)
&&
is_string
(
$eventdata
->
username
))
{
global
$DB
;
// do only if user id is enclosed in $eventdata
if
(
!
empty
(
$eventdata
->
relateduserid
))
{
// Get user data
$user
=
$DB
->
get_record
(
'user'
,
array
(
'id'
=>
$eventdata
->
relateduserid
));
// Do if user was found
if
(
!
empty
(
$user
->
username
))
{
// Do only if user has ldap_syncplus authentication
if
(
isset
(
$user
->
auth
)
&&
$user
->
auth
==
'ldap_syncplus'
)
{
// Get LDAP Plugin
$authplugin
=
get_auth_plugin
(
'ldap_syncplus'
);
// Update user
$authplugin
->
update_user_record
(
$eventdata
->
username
);
$authplugin
->
update_user_record
(
$user
->
username
);
}
}
}
}
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