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