includes/sessions.php
changeset 725 b64f2618ef25
parent 711 f70d764aab33
child 731 8e6dbf6882c2
equal deleted inserted replaced
724:af6a618e5c94 725:b64f2618ef25
  3398    * Backend code for the JSON login interface. Basically a frontend to the session API that takes all parameters in one huge array.
  3398    * Backend code for the JSON login interface. Basically a frontend to the session API that takes all parameters in one huge array.
  3399    * @param array LoginAPI request
  3399    * @param array LoginAPI request
  3400    * @return array LoginAPI response
  3400    * @return array LoginAPI response
  3401    */
  3401    */
  3402   
  3402   
  3403   function process_login_request($req)
  3403   function process_login_request($req, $_dbgtmp = false)
  3404   {
  3404   {
  3405     global $db, $session, $paths, $template, $plugins; // Common objects
  3405     global $db, $session, $paths, $template, $plugins; // Common objects
  3406     
  3406     
  3407     // Setup EnanoMath and Diffie-Hellman
  3407     // Setup EnanoMath and Diffie-Hellman
  3408     require_once(ENANO_ROOT.'/includes/math.php');
       
  3409     
       
  3410     global $dh_supported;
  3408     global $dh_supported;
  3411     $dh_supported = true;
  3409     if ( !function_exists('dh_gen_private') )
  3412     try
  3410     {
  3413     {
  3411       require_once(ENANO_ROOT.'/includes/math.php');
  3414       require_once(ENANO_ROOT . '/includes/diffiehellman.php');
  3412       
  3415     }
  3413       $dh_supported = true;
  3416     catch ( Exception $e )
  3414       try
  3417     {
  3415       {
  3418       $dh_supported = false;
  3416         require_once(ENANO_ROOT . '/includes/diffiehellman.php');
       
  3417       }
       
  3418       catch ( Exception $e )
       
  3419       {
       
  3420         $dh_supported = false;
       
  3421       }
  3419     }
  3422     }
  3420     global $_math;
  3423     global $_math;
  3421     
  3424     
  3422     // Check for the mode
  3425     // Check for the mode
  3423     if ( !isset($req['mode']) )
  3426     if ( !isset($req['mode']) )