Code

Updated generate_smb_nt_hash to use rpc
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 May 2010 14:41:02 +0000 (14:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 May 2010 14:41:02 +0000 (14:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18793 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_config.inc
gosa-core/include/functions.inc

index 0836bade54078c0a0005df402c88757dc8e8860d..bfa9ca32758cbf3ba5b749cd16ce7e99ab9760ff 100644 (file)
@@ -302,7 +302,7 @@ class config  {
       $passwd  =  $this->get_cfg_value('core','gosaRpcPassword');
 
       $handle = new jsonRPC($server);
-      $handle->login($user, $password);
+      $handle->login($user, $passwd);
 
       //Fixme  Add checks here - login successful aso.
       return($handle);
index 5e53623dab3b36a15f32f25f0fd77bdd4973bfa0..53bdee5f7a321fd3f110fdf0690c71a6d120d516 100644 (file)
@@ -3036,8 +3036,15 @@ function generate_smb_nt_hash($password)
 {
   global $config;
 
-  # Try to use gosa-si?
-  if ($config->get_cfg_value("core","gosaSupportURI") != ""){
+  // First try to retrieve values via RPC 
+  if ($config->get_cfg_value("core","gosaRpcServer") != ""){
+
+    $rpc = $config->getRpcHandle();
+    $hash = $rpc->mksmbhash($password);
+
+  }elseif ($config->get_cfg_value("core","gosaSupportURI") != ""){
+
+    // Try using gosa-si
        $res= gosaSupportDaemon::send("gosa_gen_smb_hash", "GOSA", array("password" => $password), TRUE);
     if (isset($res['XML']['HASH'])){
        $hash= $res['XML']['HASH'];