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
8aae606a
Commit
8aae606a
authored
4 years ago
by
Alexander Bias
Browse files
Options
Downloads
Patches
Plain Diff
Adopt code changes from Moodle 3.10 core auth_ldap.
parent
02304aef
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
CHANGES.md
+1
-0
1 addition, 0 deletions
CHANGES.md
auth.php
+5
-7
5 additions, 7 deletions
auth.php
settings.php
+3
-2
3 additions, 2 deletions
settings.php
with
9 additions
and
9 deletions
CHANGES.md
+
1
−
0
View file @
8aae606a
...
@@ -6,6 +6,7 @@ Changes
...
@@ -6,6 +6,7 @@ Changes
### Unreleased
### Unreleased
*
2020-12-11 - Adopt code changes from Moodle 3.10 core auth_ldap.
*
2020-12-11 - Prepare compatibility for Moodle 3.10.
*
2020-12-11 - Prepare compatibility for Moodle 3.10.
*
2020-12-10 - Change in Moodle release support:
*
2020-12-10 - Change in Moodle release support:
For the time being, this plugin is maintained for the most recent LTS release of Moodle as well as the most recent major release of Moodle.
For the time being, this plugin is maintained for the most recent LTS release of Moodle as well as the most recent major release of Moodle.
...
...
This diff is collapsed.
Click to expand it.
auth.php
+
5
−
7
View file @
8aae606a
...
@@ -118,7 +118,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
...
@@ -118,7 +118,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
do
{
do
{
if
(
$ldappagedresults
)
{
if
(
$ldappagedresults
)
{
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
4.
1).
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
3.1
1).
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
// Before 7.3, use this function that was deprecated in PHP 7.4.
// Before 7.3, use this function that was deprecated in PHP 7.4.
ldap_control_paged_result
(
$ldapconnection
,
$this
->
config
->
pagesize
,
true
,
$ldapcookie
);
ldap_control_paged_result
(
$ldapconnection
,
$this
->
config
->
pagesize
,
true
,
$ldapcookie
);
...
@@ -131,7 +131,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
...
@@ -131,7 +131,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
}
}
if
(
$this
->
config
->
search_sub
)
{
if
(
$this
->
config
->
search_sub
)
{
// Use ldap_search to find first user from subtree.
// Use ldap_search to find first user from subtree.
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
4.
1).
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
3.1
1).
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
$ldapresult
=
ldap_search
(
$ldapconnection
,
$context
,
$filter
,
array
(
$this
->
config
->
user_attribute
));
$ldapresult
=
ldap_search
(
$ldapconnection
,
$context
,
$filter
,
array
(
$this
->
config
->
user_attribute
));
}
else
{
}
else
{
...
@@ -140,7 +140,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
...
@@ -140,7 +140,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
}
}
}
else
{
}
else
{
// Search only in this context.
// Search only in this context.
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
4.
1).
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
3.1
1).
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
$ldapresult
=
ldap_list
(
$ldapconnection
,
$context
,
$filter
,
array
(
$this
->
config
->
user_attribute
));
$ldapresult
=
ldap_list
(
$ldapconnection
,
$context
,
$filter
,
array
(
$this
->
config
->
user_attribute
));
}
else
{
}
else
{
...
@@ -154,7 +154,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
...
@@ -154,7 +154,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
if
(
$ldappagedresults
)
{
if
(
$ldappagedresults
)
{
// Get next server cookie to know if we'll need to continue searching.
// Get next server cookie to know if we'll need to continue searching.
$ldapcookie
=
''
;
$ldapcookie
=
''
;
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
4.
1).
// TODO: Remove the old branch of code once PHP 7.3.0 becomes required (Moodle
3.1
1).
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
if
(
version_compare
(
PHP_VERSION
,
'7.3.0'
,
'<'
))
{
// Before 7.3, use this function that was deprecated in PHP 7.4.
// Before 7.3, use this function that was deprecated in PHP 7.4.
$pagedresp
=
ldap_control_paged_result_response
(
$ldapconnection
,
$ldapresult
,
$ldapcookie
);
$pagedresp
=
ldap_control_paged_result_response
(
$ldapconnection
,
$ldapresult
,
$ldapcookie
);
...
@@ -451,9 +451,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
...
@@ -451,9 +451,7 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
//
//
// The cast to int is a workaround for MDL-53959.
// The cast to int is a workaround for MDL-53959.
$user
->
suspended
=
(
int
)
$this
->
is_user_suspended
(
$user
);
$user
->
suspended
=
(
int
)
$this
->
is_user_suspended
(
$user
);
if
(
empty
(
$user
->
lang
))
{
$user
->
lang
=
$CFG
->
lang
;
}
if
(
empty
(
$user
->
calendartype
))
{
if
(
empty
(
$user
->
calendartype
))
{
$user
->
calendartype
=
$CFG
->
calendartype
;
$user
->
calendartype
=
$CFG
->
calendartype
;
}
}
...
...
This diff is collapsed.
Click to expand it.
settings.php
+
3
−
2
View file @
8aae606a
...
@@ -27,8 +27,9 @@ defined('MOODLE_INTERNAL') || die;
...
@@ -27,8 +27,9 @@ defined('MOODLE_INTERNAL') || die;
if
(
$ADMIN
->
fulltree
)
{
if
(
$ADMIN
->
fulltree
)
{
if
(
!
function_exists
(
'ldap_connect'
))
{
if
(
!
function_exists
(
'ldap_connect'
))
{
$settings
->
add
(
new
admin_setting_heading
(
'auth_ldap_syncplus_noextension'
,
''
,
$notify
=
new
\core\output\notification
(
get_string
(
'auth_ldap_noextension'
,
'auth_ldap'
),
get_string
(
'auth_ldap_noextension'
,
'auth_ldap'
)));
\core\output\notification
::
NOTIFY_WARNING
);
$settings
->
add
(
new
admin_setting_heading
(
'auth_ldap_noextension'
,
''
,
$OUTPUT
->
render
(
$notify
)));
}
else
{
}
else
{
// We use a couple of custom admin settings since we need to massage the data before it is inserted into the DB.
// We use a couple of custom admin settings since we need to massage the data before it is inserted into the 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