X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Ffunctions.inc;h=d5338a003c203fb266ec38686f8a28cbbc940e1c;hb=62c2547a71af33f8815bf3627822599c95153527;hp=2f137ba65dcbc4e3b3ed96f804345417c1c015f7;hpb=434959652679c3a0bccca42ce9e858b4d595be30;p=gosa.git diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 2f137ba65..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 */ @@ -1164,6 +1165,7 @@ function get_ou($name) global $config; $map = array( + "roleRDN" => "ou=roles,", "ogroupRDN" => "ou=groups,", "applicationRDN" => "ou=apps,", "systemRDN" => "ou=systems,", @@ -1749,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); } } @@ -1980,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(""); } @@ -2574,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"); @@ -2582,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)); @@ -2808,6 +2783,16 @@ function cred_decrypt($input,$password) { 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: ?>