X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Ffunctions.inc;h=d5338a003c203fb266ec38686f8a28cbbc940e1c;hb=3a308e40188042fb56365af23190514a85621963;hp=7302cfdc7b7a6a11d0d99acfac117d4ecf9b0ca1;hpb=7d91fb5e49a03ff86feb758a77cad724964ecf0b;p=gosa.git diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 7302cfdc7..d5338a003 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -88,6 +88,7 @@ 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 */ @@ -599,7 +600,6 @@ function ldap_expired_account($config, $userdn, $username) function add_lock($object, $user) { global $config; - echo "$object
"; /* Remember which entries were opened as read only, because we don't need to remove any locks for them later. @@ -661,8 +661,6 @@ function del_lock ($object) { global $config; - echo "$object
"; - if(is_array($object)){ foreach($object as $obj){ del_lock($obj); @@ -1167,6 +1165,7 @@ function get_ou($name) global $config; $map = array( + "roleRDN" => "ou=roles,", "ogroupRDN" => "ou=groups,", "applicationRDN" => "ou=apps,", "systemRDN" => "ou=systems,", @@ -1752,7 +1751,8 @@ function gen_uids($rule, $attributes) /* 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); } } @@ -1983,40 +1983,7 @@ function compare_revision($revision_file, $revision) 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
"; - - $str.= "\n
"; - - if(($height >10)&&($showvalue)){ - $str.= "\n "; - $str.= "\n ".$percentage."% "; - $str.= "\n "; - } - - $str.= "\n
"; - $str.= "\n
"; - $str.= "\n
"; - $str.= "\n
"; - - return($str); + return(""); } @@ -2577,6 +2544,11 @@ function generate_smb_nt_hash($password) } 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"); @@ -2585,11 +2557,11 @@ function generate_smb_nt_hash($password) 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));