index b604e7c1ba43afe8edf8addbf2e7b94991250ef3..d5338a003c203fb266ec38686f8a28cbbc940e1c 100644 (file)
define ("DEBUG_ACL", 128);
define ("DEBUG_SI", 256);
define ("DEBUG_MAIL", 512); // mailAccounts, imap, sieve etc.
define ("DEBUG_ACL", 128);
define ("DEBUG_SI", 256);
define ("DEBUG_MAIL", 512); // mailAccounts, imap, sieve etc.
+define ("DEBUG_FAI", 1024); // FAI (incomplete)
/* Rewrite german 'umlauts' and spanish 'accents'
to get better results */
/* Rewrite german 'umlauts' and spanish 'accents'
to get better results */
global $config;
$map = array(
global $config;
$map = array(
+ "roleRDN" => "ou=roles,",
"ogroupRDN" => "ou=groups,",
"applicationRDN" => "ou=apps,",
"systemRDN" => "ou=systems,",
"ogroupRDN" => "ou=groups,",
"applicationRDN" => "ou=apps,",
"systemRDN" => "ou=systems,",
/* Don't assign used ones */
if (!in_array($uid, $used)){
/* Don't assign used ones */
if (!in_array($uid, $used)){
- $ret[]= $uid;
+ /* Add uid, but remove {} first. These are invalid anyway. */
+ $ret[]= preg_replace('/[{}]/', '', $uid);
}
}
}
}
function progressbar($percentage,$width=100,$height=15,$showvalue=false)
{
function progressbar($percentage,$width=100,$height=15,$showvalue=false)
{
- $str = ""; // Our return value will be saved in this var
-
- $color = dechex($percentage+150);
- $color2 = dechex(150 - $percentage);
- $bgcolor= $showvalue?"FFFFFF":"DDDDDD";
-
- $progress = (int)(($percentage /100)*$width);
-
- /* If theres a better solution for this, use it... */
- $str = "\n <div style=\" width:".($width)."px; ";
- $str.= "\n height:".($height)."px; ";
- $str.= "\n background-color:#000000; ";
- $str.= "\n padding:1px;\" > ";
-
- $str.= "\n <div style=\" width:".($width)."px; ";
- $str.= "\n background-color:#$bgcolor; ";
- $str.= "\n height:".($height)."px;\" > ";
-
- if(($height >10)&&($showvalue)){
- $str.= "\n <font style=\"font-size:".($height-2)."px; ";
- $str.= "\n color:#FF0000; align:middle; ";
- $str.= "\n padding-left:".((int)(($width*0.4)))."px; \"> ";
- $str.= "\n <b>".$percentage."%</b> ";
- $str.= "\n </font> ";
- }
-
- $str.= "\n <div style=\" width:".$progress."px; ";
- $str.= "\n height:".$height."px; ";
- $str.= "\n background-color:#".$color2.$color2.$color."; \" >";
- $str.= "\n </div>";
- $str.= "\n </div>";
- $str.= "\n </div>";
-
- return($str);
+ return("<img src='progress.php?x=$width&y=$height&p=$percentage'>");
}
}
} else {
$hash= "";
}
} else {
$hash= "";
}
+
+ if ($hash == "") {
+ msg_dialog::display(_("Configuration error"), _("Cannot generate samba hash!"), ERROR_DIALOG);
+ return ("");
+ }
} else {
$tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute");
} else {
$tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute");
flush();
reset($ar);
$hash= current($ar);
flush();
reset($ar);
$hash= current($ar);
- }
- if ($hash == "") {
- msg_dialog::display(_("Configuration error"), _("Cannot generate samba hash!"), ERROR_DIALOG);
- return ("");
+ if ($hash == "") {
+ msg_dialog::display(_("Configuration error"), sprintf(_("Cannot generate samba hash: running '%s' failed, check the 'sambaHashHook'!"),$config->get_cfg_value('sambaHashHook')), ERROR_DIALOG);
+ return ("");
+ }
}
list($lm,$nt)= split (":", trim($hash));
}
list($lm,$nt)= split (":", trim($hash));