ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLDAPServer.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 define('IL_LDAP_BIND_ANONYMOUS',0);
6 define('IL_LDAP_BIND_USER',1);
7 
8 define('IL_LDAP_SCOPE_SUB',0);
9 define('IL_LDAP_SCOPE_ONE',1);
10 define('IL_LDAP_SCOPE_BASE',2);
11 
25 {
26  private static $instances = array();
27 
28  const DEBUG = false;
29  const DEFAULT_VERSION = 3;
30 
31  private $role_bind_dn = '';
32  private $role_bind_pass = '';
33  private $role_sync_active = 0;
34 
35  private $server_id = null;
36  private $fallback_urls = array();
37 
38  private $enabled_authentication = true;
40 
41  public function __construct($a_server_id = 0)
42  {
43  global $ilDB,$lng;
44 
45  $this->db = $ilDB;
46  $this->lng = $lng;
47  $this->server_id = $a_server_id;
48 
49  $this->read();
50  }
51 
52  public static function getInstanceByServerId($a_server_id)
53  {
54  if(isset(self::$instances[$a_server_id]))
55  {
56  return self::$instances[$a_server_id];
57  }
58  return self::$instances[$a_server_id] = new ilLDAPServer($a_server_id);
59  }
60 
65  public static function checkLDAPLib()
66  {
67  return function_exists('ldap_bind');
68  }
69 
75  public static function _getActiveServerList()
76  {
77  global $ilDB;
78 
79  $query = "SELECT server_id FROM ldap_server_settings ".
80  "WHERE active = 1 AND authentication = 1 ".
81  "ORDER BY name ";
82  $res = $ilDB->query($query);
83  $server_ids = array();
84  while($row = $ilDB->fetchObject($res))
85  {
86  $server_ids[] = $row->server_id;
87  }
88  return $server_ids;
89  }
90 
96  public static function _getCronServerIds()
97  {
98  global $ilDB;
99 
100  $query = "SELECT server_id FROM ldap_server_settings ".
101  "WHERE active = 1 ".
102  "AND sync_per_cron = 1 ".
103  "ORDER BY name";
104 
105  $res = $ilDB->query($query);
106  while($row = $ilDB->fetchObject($res))
107  {
108  $server_ids[] = $row->server_id;
109  }
110  return $server_ids ? $server_ids : array();
111  }
112 
120  public static function _getRoleSyncServerIds()
121  {
122  global $ilDB;
123 
124  $query = "SELECT server_id FROM ldap_server_settings ".
125  "WHERE active = 1 ".
126  "AND role_sync_active = 1 ";
127 
128  $res = $ilDB->query($query);
129  $server_ids = array();
130  while($row = $ilDB->fetchObject($res))
131  {
132  $server_ids[] = $row->server_id;
133  }
134  return $server_ids;
135  }
136 
144  public static function _getPasswordServers()
145  {
147  }
148 
149 
155  public static function _getFirstActiveServer()
156  {
158  if(count($servers))
159  {
160  return $servers[0];
161  }
162  return 0;
163  }
164 
170  public static function _getServerList()
171  {
172  global $ilDB;
173 
174  $query = "SELECT server_id FROM ldap_server_settings ORDER BY name";
175 
176  $res = $ilDB->query($query);
177  while($row = $ilDB->fetchObject($res))
178  {
179  $server_ids[] = $row->server_id;
180  }
181  return $server_ids ? $server_ids : array();
182  }
183 
184  /*
185  * Get first server id
186  *
187  * @return integer server_id
188  */
189  public static function _getFirstServer()
190  {
191  $servers = ilLDAPServer::_getServerList();
192 
193  if(count($servers))
194  {
195  return $servers[0];
196  }
197  return 0;
198  }
199 
200 
201  public static function getAvailableDataSources($a_auth_mode)
202  {
203  global $ilDB;
204 
205  $query = "SELECT server_id FROM ldap_server_settings ".
206  "WHERE active = ".$ilDB->quote(1,'integer')." ".
207  "AND authentication = ".$ilDB->quote(0,'integer')." ".
208  "AND ( authentication_type = ".$ilDB->quote($a_auth_mode,'integer')." ".
209  "OR authentication_type = ".$ilDB->quote(0,'integer').")";
210  $res = $ilDB->query($query);
211 
212  $server_ids = array();
213  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
214  {
215  $server_ids[] = $row->server_id;
216  }
217  return $server_ids;
218  }
219 
226  public static function isDataSourceActive($a_auth_mode)
227  {
228  global $ilDB;
229 
230  $query = "SELECT server_id FROM ldap_server_settings ".
231  "WHERE authentication_type = ".$ilDB->quote($a_auth_mode,'integer')." ".
232  "AND authentication = ".$ilDB->quote(0,'integer');
233  $res = $ilDB->query($query);
234  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
235  {
236  return true;
237  }
238  return false;
239  }
240 
241  public static function getDataSource($a_auth_mode)
242  {
243  global $ilDB;
244 
245  $query = "SELECT server_id FROM ldap_server_settings ".
246  "WHERE authentication_type = ".$ilDB->quote($a_auth_mode,'integer')." ".
247  "AND authentication = ".$ilDB->quote(0,'integer');
248  $res = $ilDB->query($query);
249  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
250  {
251  return $row->server_id;
252  }
253  return 0;
254  }
255 
262  public static function toggleDataSource($a_auth_mode,$a_status)
263  {
264  global $ilDB;
265 
266  if($a_status)
267  {
268  $query = "UPDATE ldap_server_settings ".
269  "SET authentication_type = ".$ilDB->quote($a_auth_mode,'integer')." ".
270  "WHERE authentication = ".$ilDB->quote(0,'integer');
271  $ilDB->query($query);
272  }
273  else
274  {
275  $query = "UPDATE ldap_server_settings ".
276  "SET authentication_type = ".$ilDB->quote(0,'integer')." ".
277  "WHERE authentication = ".$ilDB->quote(0,'integer');
278  $ilDB->query($query);
279  }
280  return true;
281  }
282 
283  // Set/Get
284  public function getServerId()
285  {
286  return $this->server_id;
287  }
288 
293  public function enableAuthentication($a_status)
294  {
295  $this->enabled_authentication = (bool) $a_status;
296  }
297 
302  public function isAuthenticationEnabled()
303  {
304  return (bool) $this->enabled_authentication;
305  }
306 
311  public function setAuthenticationMapping($a_map)
312  {
313  $this->authentication_mapping = $a_map;
314  }
315 
320  public function getAuthenticationMapping()
321  {
323  }
324 
330  public function getAuthenticationMappingKey()
331  {
332  if($this->isAuthenticationEnabled() or !$this->getAuthenticationMapping())
333  {
334  return 'ldap';
335  }
337  }
338 
339  public function toggleActive($a_status)
340  {
341  $this->active = $a_status;
342  }
343  public function isActive()
344  {
345  return $this->active;
346  }
347  public function getUrl()
348  {
349  return $this->url;
350  }
351  public function setUrl($a_url)
352  {
353  $this->url_string = $a_url;
354 
355  // Maybe there are more than one url's (comma seperated).
356  $urls = explode(',',$a_url);
357 
358  $counter = 0;
359  foreach($urls as $url)
360  {
361  $url = trim($url);
362  if(!$counter++)
363  {
364  $this->url = $url;
365  }
366  else
367  {
368  $this->fallback_urls[] = $url;
369  }
370  }
371  }
372  public function getUrlString()
373  {
374  return $this->url_string;
375  }
376 
384  public function doConnectionCheck()
385  {
386  global $ilLog;
387 
388  include_once('Services/LDAP/classes/class.ilLDAPQuery.php');
389 
390  foreach(array_merge(array(0 => $this->url),$this->fallback_urls) as $url)
391  {
392  try
393  {
394  // Need to do a full bind, since openldap return valid connection links for invalid hosts
395  $query = new ilLDAPQuery($this,$url);
396  $query->bind();
397  $this->url = $url;
398  $ilLog->write(__METHOD__.': Using url: '.$url.'.');
399  return true;
400  }
401  catch(ilLDAPQueryException $exc)
402  {
403  $ilLog->write(__METHOD__.': Cannot connect to LDAP server: '.$url.'. Trying fallback...');
404  }
405  }
406  $ilLog->write(__METHOD__.': No valid LDAP server found.');
407  return false;
408  }
409 
410 
411  public function getName()
412  {
413  return $this->name;
414  }
415  public function setName($a_name)
416  {
417  $this->name = $a_name;
418  }
419  public function getVersion()
420  {
421  return $this->version ? $this->version : self::DEFAULT_VERSION;
422  }
423  public function setVersion($a_version)
424  {
425  $this->version = $a_version;
426  }
427  public function getBaseDN()
428  {
429  return $this->base_dn;
430  }
431  public function setBaseDN($a_base_dn)
432  {
433  $this->base_dn = $a_base_dn;
434  }
435  public function isActiveReferrer()
436  {
437  return $this->referrals ? true : false;
438  }
439  public function toggleReferrer($a_status)
440  {
441  $this->referrals = $a_status;
442  }
443  public function isActiveTLS()
444  {
445  return $this->tls ? true : false;
446  }
447  public function toggleTLS($a_status)
448  {
449  $this->tls = $a_status;
450  }
451  public function getBindingType()
452  {
453  return $this->binding_type;
454  }
455  public function setBindingType($a_type)
456  {
457  if($a_type == IL_LDAP_BIND_USER)
458  {
459  $this->binding_type = IL_LDAP_BIND_USER;
460  }
461  else
462  {
463  $this->binding_type = IL_LDAP_BIND_ANONYMOUS;
464  }
465  }
466  public function getBindUser()
467  {
468  return $this->bind_user;
469  }
470  public function setBindUser($a_user)
471  {
472  $this->bind_user = $a_user;
473  }
474  public function getBindPassword()
475  {
476  return $this->bind_password;
477  }
478  public function setBindPassword($a_password)
479  {
480  $this->bind_password = $a_password;
481  }
482  public function getSearchBase()
483  {
484  return $this->search_base;
485  }
486  public function setSearchBase($a_search_base)
487  {
488  $this->search_base = $a_search_base;
489  }
490  public function getUserAttribute()
491  {
492  return $this->user_attribute;
493  }
494  public function setUserAttribute($a_user_attr)
495  {
496  $this->user_attribute = $a_user_attr;
497  }
498  public function getFilter()
499  {
500  return $this->prepareFilter($this->filter);
501  }
502  public function setFilter($a_filter)
503  {
504  $this->filter = $a_filter;
505  }
506  public function getGroupDN()
507  {
508  return $this->group_dn;
509  }
510  public function setGroupDN($a_value)
511  {
512  $this->group_dn = $a_value;
513  }
514  public function getGroupFilter()
515  {
516  return $this->prepareFilter($this->group_filter);
517  }
518  public function setGroupFilter($a_value)
519  {
520  $this->group_filter = $a_value;
521  }
522  public function getGroupMember()
523  {
524  return $this->group_member;
525  }
526  public function setGroupMember($a_value)
527  {
528  $this->group_member = $a_value;
529  }
530  public function getGroupName()
531  {
532  return $this->group_name;
533  }
534  public function setGroupName($a_value)
535  {
536  $this->group_name = $a_value;
537  }
545  public function getGroupNames()
546  {
547  $names = explode(',',$this->getGroupName());
548 
549  if(!is_array($names))
550  {
551  return array();
552  }
553  foreach($names as $name)
554  {
555  $new_names[] = trim($name);
556  }
557  return $new_names;
558  }
559 
560 
561  public function getGroupAttribute()
562  {
563  return $this->group_attribute;
564  }
565  public function setGroupAttribute($a_value)
566  {
567  $this->group_attribute = $a_value;
568  }
569 
570  public function toggleMembershipOptional($a_status)
571  {
572  $this->group_optional = (bool) $a_status;
573  }
574  public function isMembershipOptional()
575  {
576  return (bool) $this->group_optional;
577  }
578  public function setGroupUserFilter($a_filter)
579  {
580  $this->group_user_filter = $a_filter;
581  }
582  public function getGroupUserFilter()
583  {
584  return $this->group_user_filter;
585  }
586 
587  public function enabledGroupMemberIsDN()
588  {
589  return (bool) $this->memberisdn;
590  }
591  public function enableGroupMemberIsDN($a_value)
592  {
593  $this->memberisdn = (bool) $a_value;
594  }
595  public function setGroupScope($a_value)
596  {
597  $this->group_scope = $a_value;
598  }
599  public function getGroupScope()
600  {
601  return $this->group_scope;
602  }
603  public function setUserScope($a_value)
604  {
605  $this->user_scope = $a_value;
606  }
607  public function getUserScope()
608  {
609  return $this->user_scope;
610  }
611  public function enabledSyncOnLogin()
612  {
613  return $this->sync_on_login;
614  }
615  public function enableSyncOnLogin($a_value)
616  {
617  $this->sync_on_login = (int) $a_value;
618  }
619  public function enabledSyncPerCron()
620  {
621  return $this->sync_per_cron;
622  }
623  public function enableSyncPerCron($a_value)
624  {
625  $this->sync_per_cron = (int) $a_value;
626  }
627  public function setGlobalRole($a_role)
628  {
629  $this->global_role = $a_role;
630  }
631  public function getRoleBindDN()
632  {
633  return $this->role_bind_dn;
634  }
635  public function setRoleBindDN($a_value)
636  {
637  $this->role_bind_dn = $a_value;
638  }
639  public function getRoleBindPassword()
640  {
641  return $this->role_bind_pass;
642  }
643  public function setRoleBindPassword($a_value)
644  {
645  $this->role_bind_pass = $a_value;
646  }
647  public function enabledRoleSynchronization()
648  {
650  }
651  public function enableRoleSynchronization($a_value)
652  {
653  $this->role_sync_active = $a_value;
654  }
655 
663  public function enableAccountMigration($a_status)
664  {
665  $this->account_migration = $a_status;
666  }
667 
674  public function isAccountMigrationEnabled()
675  {
676  return $this->account_migration ? true : false;
677  }
678 
679 
685  public function validate()
686  {
687  global $ilErr;
688 
689  $ilErr->setMessage('');
690  if(!strlen($this->getName()) ||
691  !strlen($this->getUrl()) ||
692  !strlen($this->getBaseDN()) ||
693  !strlen($this->getUserAttribute()))
694  {
695  $ilErr->setMessage($this->lng->txt('fill_out_all_required_fields'));
696  }
697 
698  if($this->getBindingType() == IL_LDAP_BIND_USER
699  && (!strlen($this->getBindUser()) || !strlen($this->getBindPassword())))
700  {
701  $ilErr->appendMessage($this->lng->txt('ldap_missing_bind_user'));
702  }
703 
704  if(($this->enabledSyncPerCron() or $this->enabledSyncOnLogin()) and !$this->global_role)
705  {
706  $ilErr->appendMessage($this->lng->txt('ldap_missing_role_assignment'));
707  }
708  if($this->getVersion() == 2 and $this->isActiveTLS())
709  {
710  $ilErr->appendMessage($this->lng->txt('ldap_tls_conflict'));
711  }
712 
713  return strlen($ilErr->getMessage()) ? false : true;
714  }
715 
716  public function create()
717  {
718  global $ilDB;
719 
720  $next_id = $ilDB->nextId('ldap_server_settings');
721 
722  $query = 'INSERT INTO ldap_server_settings (server_id,active,name,url,version,base_dn,referrals,tls,bind_type,bind_user,bind_pass,'.
723  'search_base,user_scope,user_attribute,filter,group_dn,group_scope,group_filter,group_member,group_memberisdn,group_name,'.
724  'group_attribute,group_optional,group_user_filter,sync_on_login,sync_per_cron,role_sync_active,role_bind_dn,role_bind_pass,migration, '.
725  'authentication,authentication_type) '.
726  'VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)';
727  $res = $ilDB->queryF($query,
728  array(
729  'integer','integer','text','text','integer','text','integer','integer','integer','text','text','text','integer',
730  'text','text','text','integer','text','text','integer','text','text','integer','text','integer','integer','integer',
731  'text','text', 'integer','integer','integer'),
732  array(
733  $next_id,
734  $this->isActive(),
735  $this->getName(),
736  $this->getUrlString(),
737  $this->getVersion(),
738  $this->getBaseDN(),
739  $this->isActiveReferrer(),
740  $this->isActiveTLS(),
741  $this->getBindingType(),
742  $this->getBindUser(),
743  $this->getBindPassword(),
744  $this->getSearchBase(),
745  $this->getUserScope(),
746  $this->getUserAttribute(),
747  $this->getFilter(),
748  $this->getGroupDN(),
749  $this->getGroupScope(),
750  $this->getGroupFilter(),
751  $this->getGroupMember(),
752  $this->enabledGroupMemberIsDN(),
753  $this->getGroupName(),
754  $this->getGroupAttribute(),
755  $this->isMembershipOptional(),
756  $this->getGroupUserFilter(),
757  $this->enabledSyncOnLogin(),
758  $this->enabledSyncPerCron(),
760  $this->getRoleBindDN(),
761  $this->getRoleBindPassword(),
762  $this->isAccountMigrationEnabled(),
763  $this->isAuthenticationEnabled(),
764  $this->getAuthenticationMapping()
765  ));
766 
767  return $next_id;
768  }
769 
770  public function update()
771  {
772  global $ilDB;
773 
774  $query = "UPDATE ldap_server_settings SET ".
775  "active = ".$this->db->quote($this->isActive(),'integer').", ".
776  "name = ".$this->db->quote($this->getName(),'text').", ".
777  "url = ".$this->db->quote($this->getUrlString(),'text').", ".
778  "version = ".$this->db->quote($this->getVersion(),'integer').", ".
779  "base_dn = ".$this->db->quote($this->getBaseDN(),'text').", ".
780  "referrals = ".$this->db->quote($this->isActiveReferrer(),'integer').", ".
781  "tls = ".$this->db->quote($this->isActiveTLS(),'integer').", ".
782  "bind_type = ".$this->db->quote($this->getBindingType(),'integer').", ".
783  "bind_user = ".$this->db->quote($this->getBindUser(),'text').", ".
784  "bind_pass = ".$this->db->quote($this->getBindPassword(),'text').", ".
785  "search_base = ".$this->db->quote($this->getSearchBase(),'text').", ".
786  "user_scope = ".$this->db->quote($this->getUserScope(),'integer').", ".
787  "user_attribute = ".$this->db->quote($this->getUserAttribute(),'text').", ".
788  "filter = ".$this->db->quote($this->getFilter(),'text').", ".
789  "group_dn = ".$this->db->quote($this->getGroupDN(),'text').", ".
790  "group_scope = ".$this->db->quote($this->getGroupScope(),'integer').", ".
791  "group_filter = ".$this->db->quote($this->getGroupFilter(),'text').", ".
792  "group_member = ".$this->db->quote($this->getGroupMember(),'text').", ".
793  "group_memberisdn =".$this->db->quote((int) $this->enabledGroupMemberIsDN(),'integer').", ".
794  "group_name = ".$this->db->quote($this->getGroupName(),'text').", ".
795  "group_attribute = ".$this->db->quote($this->getGroupAttribute(),'text').", ".
796  "group_optional = ".$this->db->quote((int) $this->isMembershipOptional(),'integer').", ".
797  "group_user_filter = ".$this->db->quote($this->getGroupUserFilter(),'text').", ".
798  "sync_on_login = ".$this->db->quote(($this->enabledSyncOnLogin() ? 1 : 0),'integer').", ".
799  "sync_per_cron = ".$this->db->quote(($this->enabledSyncPerCron() ? 1 : 0),'integer').", ".
800  "role_sync_active = ".$this->db->quote($this->enabledRoleSynchronization(),'integer').", ".
801  "role_bind_dn = ".$this->db->quote($this->getRoleBindDN(),'text').", ".
802  "role_bind_pass = ".$this->db->quote($this->getRoleBindPassword(),'text').", ".
803  "migration = ".$this->db->quote((int)$this->isAccountMigrationEnabled(),'integer').", ".
804  'authentication = '.$this->db->quote((int) $this->isAuthenticationEnabled(),'integer').', '.
805  'authentication_type = '.$this->db->quote((int) $this->getAuthenticationMapping(),'integer').' '.
806  "WHERE server_id = ".$this->db->quote($this->getServerId(),'integer');
807 
808  $res = $ilDB->manipulate($query);
809  return true;
810  }
811 
817  public function toPearAuthArray()
818  {
819  $options = array(
820  'url' => $this->getUrl(),
821  'version' => (int) $this->getVersion(),
822  'referrals' => (bool) $this->isActiveReferrer());
823 
824  if($this->getBindingType() == IL_LDAP_BIND_USER)
825  {
826  $options['binddn'] = $this->getBindUser();
827  $options['bindpw'] = $this->getBindPassword();
828  }
829  $options['basedn'] = $this->getBaseDN();
830  $options['start_tls'] = (bool) $this->isActiveTLS();
831  $options['userdn'] = $this->getSearchBase();
832  switch($this->getUserScope())
833  {
834  case IL_LDAP_SCOPE_ONE:
835  $options['userscope'] = 'one';
836  break;
837  default:
838  $options['userscope'] = 'sub';
839  break;
840  }
841 
842  $options['userattr'] = $this->getUserAttribute();
843  $options['userfilter'] = $this->getFilter();
844  $options['attributes'] = $this->getPearAtributeArray();
845  $options['debug'] = self::DEBUG;
846 
847  if(@include_once('Log.php'))
848  {
849  if(@include_once('Log/observer.php'))
850  {
851  $options['enableLogging'] = true;
852  }
853  }
854  switch($this->getGroupScope())
855  {
856  case IL_LDAP_SCOPE_BASE:
857  $options['groupscope'] = 'base';
858  break;
859  case IL_LDAP_SCOPE_ONE:
860  $options['groupscope'] = 'one';
861  break;
862  default:
863  $options['groupscope'] = 'sub';
864  break;
865  }
866  $options['groupdn'] = $this->getGroupDN();
867  $options['groupattr'] = $this->getGroupAttribute();
868  $options['groupfilter'] = $this->getGroupFilter();
869  $options['memberattr'] = $this->getGroupMember();
870  $options['memberisdn'] = $this->enabledGroupMemberIsDN();
871  $options['group'] = $this->getGroupName();
872 
873 
874  return $options;
875  }
876 
884  private function prepareFilter($a_filter)
885  {
886  $filter = trim($a_filter);
887 
888  if(!strlen($filter))
889  {
890  return $filter;
891  }
892 
893  if(strpos($filter,'(') !== 0)
894  {
895  $filter = ('('.$filter);
896  }
897  if(substr($filter,-1) != ')')
898  {
899  $filter = ($filter.')');
900  }
901  return $filter;
902  }
903 
911  private function getPearAtributeArray()
912  {
913  if($this->enabledSyncOnLogin())
914  {
915  include_once('Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
916  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRules.php');
918  return array_merge(
919  array($this->getUserAttribute()),
920  $mapping->getFields(),
921  array('dn'),
923  );
924  }
925  else
926  {
927  return array($this->getUserAttribute());
928  }
929  }
930 
931 
932 
937  private function read()
938  {
939  if(!$this->server_id)
940  {
941  return true;
942  }
943  $query = "SELECT * FROM ldap_server_settings WHERE server_id = ".$this->db->quote($this->server_id)."";
944 
945  $res = $this->db->query($query);
946  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
947  {
948  $this->toggleActive($row->active);
949  $this->setName($row->name);
950  $this->setUrl($row->url);
951  $this->setVersion($row->version);
952  $this->setBaseDN($row->base_dn);
953  $this->toggleReferrer($row->referrals);
954  $this->toggleTLS($row->tls);
955  $this->setBindingType($row->bind_type);
956  $this->setBindUser($row->bind_user);
957  $this->setBindPassword($row->bind_pass);
958  $this->setSearchBase($row->search_base);
959  $this->setUserScope($row->user_scope);
960  $this->setUserAttribute($row->user_attribute);
961  $this->setFilter($row->filter);
962  $this->setGroupDN($row->group_dn);
963  $this->setGroupScope($row->group_scope);
964  $this->setGroupFilter($row->group_filter);
965  $this->setGroupMember($row->group_member);
966  $this->setGroupAttribute($row->group_attribute);
967  $this->toggleMembershipOptional($row->group_optional);
968  $this->setGroupUserFilter($row->group_user_filter);
969  $this->enableGroupMemberIsDN($row->group_memberisdn);
970  $this->setGroupName($row->group_name);
971  $this->enableSyncOnLogin($row->sync_on_login);
972  $this->enableSyncPerCron($row->sync_per_cron);
973  $this->enableRoleSynchronization($row->role_sync_active);
974  $this->setRoleBindDN($row->role_bind_dn);
975  $this->setRoleBindPassword($row->role_bind_pass);
976  $this->enableAccountMigration($row->migration);
977  $this->enableAuthentication($row->authentication);
978  $this->setAuthenticationMapping($row->authentication_type);
979  }
980  }
981 }
982 ?>