Code

Fix encoding of base
[gosa.git] / gosa-core / include / functions.inc
index 1234a6d44cf6090ad67c60779b3c0da574ae019b..621f74bc6b053c1b7b2cd74f67ab9707dc8cde50 100644 (file)
@@ -320,7 +320,7 @@ function get_template_path($filename= '', $plugin= FALSE, $path= "")
   /* Return plugin dir or root directory? */
   if ($plugin){
     if ($path == ""){
-      $nf= preg_replace("!^".$BASE_DIR."/!", "", session::global_get('plugin_dir'));
+      $nf= preg_replace("!^".$BASE_DIR."/!", "", preg_replace('/^\.\.\//', '', session::global_get('plugin_dir')));
     } else {
       $nf= preg_replace("!^".$BASE_DIR."/!", "", $path);
     }
@@ -2977,13 +2977,12 @@ function change_password ($dn, $password, $mode=0, $hash= "")
 
     // Not for groups
     if ($mode == 0){
+      // Create SMB Password
+      $attrs= generate_smb_nt_hash($password);
 
       if ($shadow != 0){
         $attrs['shadowLastChange']= $shadow;
       }
-
-      // Create SMB Password
-      $attrs= generate_smb_nt_hash($password);
     }
 
     $attrs['userPassword']= array();