LDAP Sync: Error with Adding

Bug #1939359 reported by Ghada El-Zoghbi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Ghada El-Zoghbi
20.04
Fix Released
High
Unassigned
20.10
Fix Released
High
Unassigned
21.04
Fix Released
High
Unassigned

Bug Description

Mahara: 20.10.1
OS: Linux
DB: Postgres (or MySQL)
Browser: Any

I just discovered an error that I actually introduced!! I do beg your pardon.

In the LDAP sync - htdocs/auth/ldap/lib.php::sync_users(), the following query actually has a syntax error!! It results in this call stack:

Aug 8 00:05:04 08a80cd1bd91 ecs_mahara_prod: Call stack (most recent first):
Aug 8 00:05:04 08a80cd1bd91 ecs_mahara_prod: * get_recordset_sql(string(size 498)) at /var/www/site/auth/ldap/lib.php:1352
Aug 8 00:05:04 08a80cd1bd91 ecs_mahara_prod: * AuthLdap->sync_users() at /var/www/site/auth/ldap/lib.php:1692
Aug 8 00:05:04 08a80cd1bd91 ecs_mahara_prod: * PluginAuthLdap::auth_ldap_sync_cron() at /var/www/site/lib/mahara.php:1819
Aug 8 00:05:04 08a80cd1bd91 ecs_mahara_prod: * call_static_method(string(size 14), string(size 19)) at /var/www/site/lib/cron.php:119

The query in question is the following:

                $sql = '
                        SELECT
                            e.extusername,
                            e.firstname,
                            e.lastname,
                            e.email,
                            e.studentid,
                            e.preferredname
                        FROM
                            {auth_ldap_extusers_temp} e
                            " . $sjoinsql . "
                        WHERE u.id IS NULL
                        ORDER BY e.extusername';

The problem is that the string `$sjoinsql` doesn't exist and the quotes are all wrong.

I'm so sorry.. I'll get a fix soon.

Changed in mahara:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Ghada El-Zoghbi (ghada-z)
milestone: none → 21.10.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11911

Revision history for this message
Ghada El-Zoghbi (ghada-z) wrote :

Original commit: ea6baf488b9 from Bug # 1833495

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11911
Committed: https://git.mahara.org/mahara/mahara/commit/2c747ce3fbc902cf856caec7e3b5d5504364f011
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 2c747ce3fbc902cf856caec7e3b5d5504364f011
Author: Ghada El-Zoghbi <email address hidden>
Date: Tue Aug 10 13:44:47 2021 +1000

Bug #1939359: fix SQL syntax error in LDAP sync

behatnotneeded

Change-Id: I04ebc9d92e61938dd1282d115925208ca81e8704

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.04_STABLE" branch: https://reviews.mahara.org/11914

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "20.10_STABLE" branch: https://reviews.mahara.org/11915

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11916

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11914
Committed: https://git.mahara.org/mahara/mahara/commit/4529338b1a00a0bf63e6fc99741a5912e08aa49b
Submitter: Robert Lyon (<email address hidden>)
Branch: 21.04_STABLE

commit 4529338b1a00a0bf63e6fc99741a5912e08aa49b
Author: Ghada El-Zoghbi <email address hidden>
Date: Tue Aug 10 13:44:47 2021 +1000

Bug #1939359: fix SQL syntax error in LDAP sync

behatnotneeded

Change-Id: I04ebc9d92e61938dd1282d115925208ca81e8704
(cherry picked from commit 2c747ce3fbc902cf856caec7e3b5d5504364f011)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11915
Committed: https://git.mahara.org/mahara/mahara/commit/426489db28d93f2cce5a07deb3e41c0c3f0de71a
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.10_STABLE

commit 426489db28d93f2cce5a07deb3e41c0c3f0de71a
Author: Ghada El-Zoghbi <email address hidden>
Date: Tue Aug 10 13:44:47 2021 +1000

Bug #1939359: fix SQL syntax error in LDAP sync

behatnotneeded

Change-Id: I04ebc9d92e61938dd1282d115925208ca81e8704
(cherry picked from commit 2c747ce3fbc902cf856caec7e3b5d5504364f011)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11916
Committed: https://git.mahara.org/mahara/mahara/commit/a572320812bf640db045fdb2b3855b18604bf4d9
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit a572320812bf640db045fdb2b3855b18604bf4d9
Author: Ghada El-Zoghbi <email address hidden>
Date: Tue Aug 10 13:44:47 2021 +1000

Bug #1939359: fix SQL syntax error in LDAP sync

behatnotneeded

Change-Id: I04ebc9d92e61938dd1282d115925208ca81e8704
(cherry picked from commit 2c747ce3fbc902cf856caec7e3b5d5504364f011)

no longer affects: mahara/21.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.