Fixed DiffieHellman being included twice when not supported and login fails
authorDan
Sat, 08 Nov 2008 22:35:59 -0500
changeset 725 b64f2618ef25
parent 724 af6a618e5c94
child 726 17e8c93b4729
Fixed DiffieHellman being included twice when not supported and login fails
includes/sessions.php
--- a/includes/sessions.php	Sat Nov 08 22:35:05 2008 -0500
+++ b/includes/sessions.php	Sat Nov 08 22:35:59 2008 -0500
@@ -3400,22 +3400,25 @@
    * @return array LoginAPI response
    */
   
-  function process_login_request($req)
+  function process_login_request($req, $_dbgtmp = false)
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
     
     // Setup EnanoMath and Diffie-Hellman
-    require_once(ENANO_ROOT.'/includes/math.php');
-    
     global $dh_supported;
-    $dh_supported = true;
-    try
+    if ( !function_exists('dh_gen_private') )
     {
-      require_once(ENANO_ROOT . '/includes/diffiehellman.php');
-    }
-    catch ( Exception $e )
-    {
-      $dh_supported = false;
+      require_once(ENANO_ROOT.'/includes/math.php');
+      
+      $dh_supported = true;
+      try
+      {
+        require_once(ENANO_ROOT . '/includes/diffiehellman.php');
+      }
+      catch ( Exception $e )
+      {
+        $dh_supported = false;
+      }
     }
     global $_math;