index c9c9eb5b7123a51c09e0d64fb9d5e9e9c6813153..d5338a003c203fb266ec38686f8a28cbbc940e1c 100644 (file)
define ("DEBUG_CONFIG", 64);
define ("DEBUG_ACL", 128);
define ("DEBUG_SI", 256);
define ("DEBUG_CONFIG", 64);
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 */
/* Debug level action */
function DEBUG($level, $line, $function, $file, $data, $info="")
{
/* Debug level action */
function DEBUG($level, $line, $function, $file, $data, $info="")
{
- if (session::get('DEBUGLEVEL') & $level){
+ if (session::global_get('DEBUGLEVEL') & $level){
$output= "DEBUG[$level] ";
if ($function != ""){
$output.= "($file:$function():$line) - $info: ";
$output= "DEBUG[$level] ";
if ($function != ""){
$output.= "($file:$function():$line) - $info: ";
/* Rewrite ui object to another dn */
function change_ui_dn($dn, $newdn)
{
/* Rewrite ui object to another dn */
function change_ui_dn($dn, $newdn)
{
- $ui= session::get('ui');
+ $ui= session::global_get('ui');
if ($ui->dn == $dn){
$ui->dn= $newdn;
if ($ui->dn == $dn){
$ui->dn= $newdn;
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
}
}
}
}
/* Return plugin dir or root directory? */
if ($plugin){
if ($path == ""){
/* Return plugin dir or root directory? */
if ($plugin){
if ($path == ""){
- $nf= preg_replace("!^".$BASE_DIR."/!", "", session::get('plugin_dir'));
+ $nf= preg_replace("!^".$BASE_DIR."/!", "", session::global_get('plugin_dir'));
} else {
$nf= preg_replace("!^".$BASE_DIR."/!", "", $path);
}
} else {
$nf= preg_replace("!^".$BASE_DIR."/!", "", $path);
}
return ("$BASE_DIR/ihtml/themes/default/$nf/$filename");
}
if ($path == ""){
return ("$BASE_DIR/ihtml/themes/default/$nf/$filename");
}
if ($path == ""){
- return (session::get('plugin_dir')."/$filename");
+ return (session::global_get('plugin_dir')."/$filename");
} else {
return ($path."/$filename");
}
} else {
return ($path."/$filename");
}
$ui->loadACL();
/* TODO: check java script for htaccess authentication */
$ui->loadACL();
/* TODO: check java script for htaccess authentication */
- session::set('js',true);
+ session::global_set('js',true);
return ($ui);
}
return ($ui);
}
/* Remember which entries were opened as read only, because we
don't need to remove any locks for them later.
*/
/* Remember which entries were opened as read only, because we
don't need to remove any locks for them later.
*/
- if(!session::is_set("LOCK_CACHE")){
- session::set("LOCK_CACHE",array(""));
+ if(!session::global_is_set("LOCK_CACHE")){
+ session::global_set("LOCK_CACHE",array(""));
}
}
- $cache = &session::get("LOCK_CACHE");
+ $cache = &session::global_get("LOCK_CACHE");
if(isset($_POST['open_readonly'])){
$cache['READ_ONLY'][$object] = TRUE;
return;
if(isset($_POST['open_readonly'])){
$cache['READ_ONLY'][$object] = TRUE;
return;
/* If this object was opened in read only mode then
skip removing the lock entry, there wasn't any lock created.
*/
/* If this object was opened in read only mode then
skip removing the lock entry, there wasn't any lock created.
*/
- if(session::is_set("LOCK_CACHE")){
- $cache = &session::get("LOCK_CACHE");
+ if(session::global_is_set("LOCK_CACHE")){
+ $cache = &session::global_get("LOCK_CACHE");
if(isset($cache['READ_ONLY'][$object])){
unset($cache['READ_ONLY'][$object]);
return;
if(isset($cache['READ_ONLY'][$object])){
unset($cache['READ_ONLY'][$object]);
return;
@@ -1024,7 +1026,7 @@ function get_list($filter, $category, $base= "", $attributes= array(), $flags= G
function check_sizelimit()
{
/* Ignore dialog? */
function check_sizelimit()
{
/* Ignore dialog? */
- if (session::is_set('size_ignore') && session::get('size_ignore')){
+ if (session::global_is_set('size_ignore') && session::global_get('size_ignore')){
return ("");
}
return ("");
}
if (session::is_set('limit_exceeded') && session::get('limit_exceeded')){
$smarty= get_smarty();
$smarty->assign('warning', sprintf(_("The size limit of %d entries is exceed!"),
if (session::is_set('limit_exceeded') && session::get('limit_exceeded')){
$smarty= get_smarty();
$smarty->assign('warning', sprintf(_("The size limit of %d entries is exceed!"),
- session::get('size_limit')));
- $smarty->assign('limit_message', sprintf(_("Set the new size limit to %s and show me this message if the limit still exceeds"), '<input type="text" name="new_limit" maxlength="10" size="5" value="'.(session::get('size_limit') +100).'">'));
+ session::global_get('size_limit')));
+ $smarty->assign('limit_message', sprintf(_("Set the new size limit to %s and show me this message if the limit still exceeds"), '<input type="text" name="new_limit" maxlength="10" size="5" value="'.(session::global_get('size_limit') +100).'">'));
return($smarty->fetch(get_template_path('sizelimit.tpl')));
}
return($smarty->fetch(get_template_path('sizelimit.tpl')));
}
function print_sizelimit_warning()
{
function print_sizelimit_warning()
{
- if (session::is_set('size_limit') && session::get('size_limit') >= 10000000 ||
+ if (session::global_is_set('size_limit') && session::global_get('size_limit') >= 10000000 ||
(session::is_set('limit_exceeded') && session::get('limit_exceeded'))){
$config= "<input type='submit' name='edit_sizelimit' value="._("Configure").">";
} else {
(session::is_set('limit_exceeded') && session::get('limit_exceeded'))){
$config= "<input type='submit' name='edit_sizelimit' value="._("Configure").">";
} else {
if (tests::is_id($_POST['new_limit']) &&
isset($_POST['action']) && $_POST['action']=="newlimit"){
if (tests::is_id($_POST['new_limit']) &&
isset($_POST['action']) && $_POST['action']=="newlimit"){
- session::set('size_limit', validate($_POST['new_limit']));
+ session::global_set('size_limit', validate($_POST['new_limit']));
session::set('size_ignore', FALSE);
}
/* User wants no limits? */
if (isset($_POST['action']) && $_POST['action']=="ignore"){
session::set('size_ignore', FALSE);
}
/* User wants no limits? */
if (isset($_POST['action']) && $_POST['action']=="ignore"){
- session::set('size_limit', 0);
- session::set('size_ignore', TRUE);
+ session::global_set('size_limit', 0);
+ session::global_set('size_ignore', TRUE);
}
/* User wants incomplete results */
if (isset($_POST['action']) && $_POST['action']=="limited"){
}
/* User wants incomplete results */
if (isset($_POST['action']) && $_POST['action']=="limited"){
- session::set('size_ignore', TRUE);
+ session::global_set('size_ignore', TRUE);
}
}
getMenuCache();
/* Allow fallback to dialog */
if (isset($_POST['edit_sizelimit'])){
}
}
getMenuCache();
/* Allow fallback to dialog */
if (isset($_POST['edit_sizelimit'])){
- session::set('size_ignore',FALSE);
+ session::global_set('size_ignore',FALSE);
}
}
}
}
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));
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:
?>