Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
ldap_user_group.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/users/user_group/user_group.inc';
19 
32 {
33 
39  var $_ldapid = 0;
40 
41 
49  function Ldap_User_Group($ldapid=0, $data=Array())
50  {
51  if (!$ldapid || empty($data)) {
52  return;
53  }
54 
55  $ldap = $GLOBALS['SQ_SYSTEM']->am->getAsset($ldapid, 'ldap_bridge');
56  if (is_null($ldap)) return;
57  $this->_ldapid = $ldapid;
58 
59  // the attribute mappings to the LDAP schemas
60  $attrs = $ldap->attr('attributes');
61 
62  // set general object properties
63  $this->id = $ldap->id.':'.$data['dn'];
64  unset($data['objectclass']['count']);
65  foreach ($data['objectclass'] as $class) {
66  $class = strtolower($class);
67  foreach ($ldap->_group_types as $key => $value) {
68  if ($class == $key) {
69  if (!isset($attrs[$value])) {
70  $attrs[$value] = $value;
71  }
72 
73 
74  if (isset($data[$attrs[$value]])) {
75  $this->name = $data[$attrs[$value]][0];
76  }
77  }
78  }
79  }
80 
81  $this->short_name = $this->name;
82  $this->status = $ldap->status;
83  $this->version = '0.1';
84 
85  foreach ($data as $key => $value) {
86  if (!is_array($value)) continue;
87  if (isset($value['count'])) unset($value['count']);
88  $this->vars[$key] = $value;
89  }
90 
91  // set the data paths
92  $this->_loadDataPaths();
93 
94  }//end constructor
95 
96 
103  function _getAllowedLinks()
104  {
105  return Array();
106 
107  }//end _getAllowedLinks()
108 
109 
110 
111 }//end class
112 
113 ?>