/[ludap]/ludap/ludap.lib.php
ViewVC logotype

Diff of /ludap/ludap.lib.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by mose, Sat Sep 13 10:39:08 2003 UTC revision 1.18 by mose, Sat Sep 13 12:29:40 2003 UTC
# Line 195  class ludap { Line 195  class ludap {
195                                  $_SESSION['me'] = $login;                                  $_SESSION['me'] = $login;
196                                  $_SESSION['pass'] = $pass;                                  $_SESSION['pass'] = $pass;
197                                  $_SESSION['gps'] = $gps;                                  $_SESSION['gps'] = $gps;
198                                  if (in_array($this->conf['admingrp'],$gps)) {                                  if (is_array($gps) and in_array($this->conf['admingrp'],$gps)) {
199                                          $this->admin = true;                                          $this->admin = true;
200                                          $_SESSION['admin'] = $this->admin;                                          $_SESSION['admin'] = $this->admin;
201                                  }                                  }
# Line 218  class ludap { Line 218  class ludap {
218  /** gets a list of users  /** gets a list of users
219   * \todo de-globalize $sort and $rsort to put them in arguments   * \todo de-globalize $sort and $rsort to put them in arguments
220   */   */
221          function get_users_list($heads,$search='',$limit=0,$start=0,$end=0) {          function get_users_list($heads,$search='',$match='',$limit=0,$start=0,$end=0) {
222                  global $sort, $rsort;                  global $sort, $rsort;
223                  $inf = array();                  $inf = array();
224                  if (!$search) $search = "*";                  if (!$search) $search = "*";
225                  $sr = @ldap_search($this->conn, $this->conf['basedn'], "(".$this->conf['baseattr']."=".$search.")", $heads);                  if (!$match) $match = $this->conf['baseattr'];
226                    $sr = @ldap_search($this->conn, $this->conf['basedn'], "(".$match."=".$search.")", $heads);
227                  $info = @ldap_get_entries($this->conn,$sr);                  $info = @ldap_get_entries($this->conn,$sr);
228                  for ($n = 0; $n < $info['count']; $n++) {                  for ($n = 0; $n < $info['count']; $n++) {
229                          foreach ($heads as $lt) {                          foreach ($heads as $lt) {
# Line 309  class ludap { Line 310  class ludap {
310          function get_id($id,$attrs='') {          function get_id($id,$attrs='') {
311                  $fres = array();                  $fres = array();
312                  if (is_array($attrs)) {                  if (is_array($attrs)) {
313                          $i = ldap_search($this->conn, $this->conf['basedn'], $this->conf['baseattr']."=".utf8_encode($id),$attrs);                          $i = ldap_search($this->conn, $this->conf['basedn'], $this->conf['baseattr']."=".$id,$attrs);
314                  } else {                  } else {
315                          $i = ldap_search($this->conn, $this->conf['basedn'], $this->conf['baseattr']."=".utf8_encode($id));                          $i = ldap_search($this->conn, $this->conf['basedn'], $this->conf['baseattr']."=".utf8_encode($id));
316                  }                  }
317                  $info = ldap_get_entries($this->conn, $i);                  $info = ldap_get_entries($this->conn, $i);
318                    //echo "<pre>"; print_r(get_defined_vars()); die("</pre>");
319    
320                  foreach ($this->schema_user as $clabel=>$cbuff) {                  foreach ($this->schema_user as $clabel=>$cbuff) {
321                          if ($cbuff['TYPE'] == 'multi') {                          if ($cbuff['TYPE'] == 'multi') {
322                                  if ($info[0][$clabel][count]) {                                  if ($info[0][$clabel][count]) {

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26