add new header ident.h
[freeradius.git] / dialup_admin / lib / ldap / attrmap.php3
1 <?php
2 #Read ldap attribute map
3 unset($attrmap);
4 if (isset($_SESSION['attrmap']))
5         $attrmap = $_SESSION['attrmap'];
6 if (!isset($attrmap)){
7         $ARR = file("$config[general_ldap_attrmap]");
8         foreach($ARR as $val){
9                 $val=chop($val);
10                 if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
11                         continue;
12                 list(,$key,$v,$g)=split('[[:space:]]+',$val);
13                 $v = strtolower($v);
14                 $attrmap["$key"]=$v;
15                 $attrmap[generic]["$key"]=$g;
16         }
17         $ARR = file("$config[general_extra_ldap_attrmap]");
18         foreach($ARR as $val){
19                 $val=chop($val);
20                 if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
21                         continue;
22                 list(,$key,$v,$g)=split('[[:space:]]+',$val);
23                 $v = strtolower($v);
24                 $attrmap["$key"]=$v;
25                 $attrmap[generic]["$key"]=$g;
26         }
27         if ($config[general_use_session] == 'yes')
28                 session_register('attrmap');
29 }
30 ?>