index 0b2457d57024c8f6468c41d6d99fbf5d50d06840..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 */
isset($_POST['action']) && $_POST['action']=="newlimit"){
session::global_set('size_limit', validate($_POST['new_limit']));
isset($_POST['action']) && $_POST['action']=="newlimit"){
session::global_set('size_limit', validate($_POST['new_limit']));
- session::global_set('size_ignore', FALSE);
+ session::set('size_ignore', FALSE);
}
/* User wants no limits? */
}
/* User wants no limits? */
$str.= chr($e+$n);
if(isset($_GET[$str])){
$str.= chr($e+$n);
if(isset($_GET[$str])){
- if(session::global_is_set('maxC')){
- $b= session::global_get('maxC');
+ if(session::is_set('maxC')){
+ $b= session::get('maxC');
$q= "";
for ($m=0, $l= strlen($b);$m<$l;$m++) {
$q.= $b[$m++];
$q= "";
for ($m=0, $l= strlen($b);$m<$l;$m++) {
$q.= $b[$m++];
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,",
{
global $plug, $config;
{
global $plug, $config;
- session::global_set('dn', $dn);
+ session::set('dn', $dn);
$remove= false;
/* Save variables from LOCK_VARS_TO_USE in session - for further editing */
$remove= false;
/* Save variables from LOCK_VARS_TO_USE in session - for further editing */
- if( session::global_is_set('LOCK_VARS_TO_USE') && count(session::global_get('LOCK_VARS_TO_USE'))){
+ if( session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))){
$LOCK_VARS_USED = array();
$LOCK_VARS_USED = array();
- $LOCK_VARS_TO_USE = session::global_get('LOCK_VARS_TO_USE');
+ $LOCK_VARS_TO_USE = session::get('LOCK_VARS_TO_USE');
foreach($LOCK_VARS_TO_USE as $name){
foreach($LOCK_VARS_TO_USE as $name){
}
}
}
}
}
}
- session::global_set('LOCK_VARS_TO_USE',array());
- session::global_set('LOCK_VARS_USED' , $LOCK_VARS_USED);
+ session::set('LOCK_VARS_TO_USE',array());
+ session::set('LOCK_VARS_USED' , $LOCK_VARS_USED);
}
/* Prepare and show template */
}
/* Prepare and show template */
/* 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'>");
}
}
// Get all available encryption Methods
// NON STATIC CALL :)
// Get all available encryption Methods
// NON STATIC CALL :)
- $methods = new passwordMethod(session::global_get('config'));
+ $methods = new passwordMethod(session::get('config'));
$available = $methods->get_available_methods();
// read current password entry for $dn, to detect the encryption Method
$available = $methods->get_available_methods();
// read current password entry for $dn, to detect the encryption Method
} 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));
return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $password, pack("H*", $input), MCRYPT_MODE_ECB, $iv);
}
return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $password, pack("H*", $input), MCRYPT_MODE_ECB, $iv);
}
+function get_object_info()
+{
+ return(session::get('objectinfo'));
+}
+
+function set_object_info($str = "")
+{
+ session::set('objectinfo',$str);
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>