Forums | Mahara Community

Support /
Create groups with linux ldap


jonathan roche's profile picture
Posts: 10

14 November 2018, 1:36 AM

Hi, i use a LDAP from a linux server.

No problem to create users from it into Mahara.

 

But when i want to create automatic groups, i've this log :

 

[WAR] c4 (lib/group.php:419) Undefined variable: USER
 
Call stack (most recent first):
  • log_message("Undefined variable: USER", 8, true, true, "/home/www/mahara/lib/group.php", 419) at /home/www/mahara/lib/errors.php:520
  • error(8, "Undefined variable: USER", "/home/www/mahara/lib/group.php", 419, array(size 3)) at /home/www/mahara/lib/group.php:419
  • group_create(array(size 15)) at /home/www/mahara/auth/ldap/lib.php:1498
  • AuthLdap->sync_groups() at /home/www/mahara/auth/ldap/lib.php:1646
  • PluginAuthLdap::auth_ldap_sync_cron() at /home/www/mahara/lib/mahara.php:1813
  • call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /home/www/mahara/lib/cron.php:115
[WAR] c4 (lib/errors.php:535) [Error]: Call to a member function get() on null
Call stack (most recent first):
  • exception(object(Error)) at Unknown:0

 

 

Here are my settings
---------------------------------

Synchronise LDAP Object : yes

Classe Group : PosixGroup

Group attribute  : CN

Member group attribute : memberUid

 

What is the problem ?

 

Thanks.

 

Robert Lyon's profile picture
Posts: 488

14 November 2018, 10:55 AM

Hi Jonathan

Thank you for reporting this bug - I've filed a report for it and have added a patch

https://reviews.mahara.org/#/c/9308/2

Are you able to edit your site / apply the change to see if that fixes the problem?

Cheers

Robert

 

 

jonathan roche's profile picture
Posts: 10

14 November 2018, 11:39 AM

it seems to have another problem now

Here are the logs :

[WAR] bc (lib/group.php:1161) group_update_members: no group admins listed for group mahara : profs (id 4)
 
Call stack (most recent first):
  • group_update_members(4, array(size 102)) at /home/www/mahara/auth/ldap/lib.php:1532
  • AuthLdap->sync_groups() at /home/www/mahara/auth/ldap/lib.php:1646
  • PluginAuthLdap::auth_ldap_sync_cron() at /home/www/mahara/lib/mahara.php:1813
  • call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /home/www/mahara/lib/cron.php:115
jonathan roche's profile picture
Posts: 10

16 November 2018, 12:55 PM

Hi something new about it ?

Robert Lyon's profile picture
Posts: 488

16 November 2018, 1:48 PM

Hi Jonathan,

On line 1518 of htdocs/auth/ldap/lib.php there is the line:
 $members = array('1' => 'admin'); //must be set otherwise fatal error group_update_members: no group admins listed for group

- that is the error you are getting


Then on line 1523 it has
 $members[$id] = 'member';

So if $id = 1 it will set the 'admin' to 'member'

Are you able to check the array of $members just before line 1532 to see what it contains and to see if that is what is happening?

Adding a:

 log_debug($members);

should help - the output should end up in error logs

If it is I'll see if I can create a patch to fix this problem

Cheers

Robert

jonathan roche's profile picture
Posts: 10

16 November 2018, 7:20 PM

Hi,

my logs now :

[DBG] 00 (auth/ldap/lib.php:1531) Array


(
    [1] => member
    [4275] => member
    [4276] => member
    [4277] => member
    [4278] => member
    [4279] => member
    [4281] => member

........

jonathan roche's profile picture
Posts: 10

20 November 2018, 9:35 PM

Hi Robert, have you found a solution ?

Thanks.

Robert Lyon's profile picture
Posts: 488

25 November 2018, 8:52 AM

Hi Jonathan

I've created a patch that makes sure at least 1 member is the group admin

https://reviews.mahara.org/#/c/9333/1

Are you able to edit your site / apply the change to see if that fixes the problem?

Cheers

Robert

jonathan roche's profile picture
Posts: 10

25 November 2018, 10:12 AM

Great Robert ! It works ! Many thanks.

Now i have an other error in https://mahara.kerplouz.com/, can you see it ?

Robert Lyon's profile picture
Posts: 488

25 November 2018, 1:00 PM

I can see the logged out homepage for the site but no error messages?

What is the error?

11 results