Show
Ignore:
Timestamp:
02/11/10 17:34:27 (2 years ago)
Author:
gbastien
Message:

* Merged recent changes in the trunk into this branch
* New token architecture not yet fully functional, nor tested, but ...

  • can now edit token templates for different context of tokens (from the edit netork interface at the bottom of page)
  • Users connected through a wifidog gateway can view their connection token information
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newtoken/wifidog/auth/index.php

    r1419 r1446  
    5252require_once('classes/Network.php'); 
    5353require_once('classes/User.php'); 
     54require_once('classes/Connection.php'); 
    5455$db = AbstractDb::getObject(); 
    5556$auth_response = ACCOUNT_STATUS_DENIED; 
     
    6061{ 
    6162    $token = $db->escapeString($_REQUEST['token']); 
    62     $dbRetval = $db->execSqlUniqueRes("SELECT CURRENT_TIMESTAMP, *, CASE WHEN ((CURRENT_TIMESTAMP - reg_date) > networks.validation_grace_time) THEN true ELSE false END AS validation_grace_time_expired FROM connections JOIN tokens USING (token_id) JOIN users ON (users.user_id=connections.user_id) JOIN networks ON (users.account_origin = networks.network_id) WHERE connections.token_id='$token'", $info, false); 
     63    try { 
     64        $connection  = Connection::getObject($token); 
     65        $info = $connection->getRow(); 
     66    } catch (Exception $e) { 
     67        $auth_message .= "| Error: couldn't retrieve the requested token: $token because of a SQL error. "; 
     68        $auth_response = ACCOUNT_STATUS_ERROR; 
     69    } 
     70    /* $dbRetval = $db->execSqlUniqueRes("SELECT CURRENT_TIMESTAMP, *, CASE WHEN ((CURRENT_TIMESTAMP - reg_date) > networks.validation_grace_time) THEN true ELSE false END AS validation_grace_time_expired  
     71                FROM connections  
     72                JOIN tokens USING (token_id)  
     73                JOIN users ON (users.user_id=connections.user_id)  
     74                JOIN networks ON (users.account_origin = networks.network_id)  
     75                WHERE connections.token_id='$token' ORDER BY conn_id DESC LIMIT 1", $info, false); 
     76     
    6377    if($dbRetval==false){ 
    6478        $auth_message .= "| Error: couldn't retrieve the requested token: $token because of a SQL error. "; 
    6579        $auth_response = ACCOUNT_STATUS_ERROR; 
    66     } 
     80    }*/ 
    6781} 
    6882else {