Show
Ignore:
Timestamp:
02/04/10 16:20:28 (2 years ago)
Author:
gbastien
Message:

* First draft: nothing has changed so far, just the way tokens are generated from a template. Integration of the code by richard Jackson (#684). Not thoroughly tested though.

Files:
1 modified

Legend:

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

    r1435 r1445  
    7777require_once('classes/User.php'); 
    7878require_once('classes/Network.php'); 
     79require_once('classes/Token.php'); 
     80require_once('classes/TokenTemplate.php'); 
    7981require_once('classes/Authenticator.php'); 
    8082require_once('classes/MainUI.php'); 
     
    181183 */ 
    182184 
     185$templates = array(); 
     186if ($network != null) { 
     187     
     188} 
     189 
    183190/* 
    184191 * If this is a splash-only node, skip the login interface and log-in using 
     
    189196        // Login from a gateway, redirect to the gateway to activate the token 
    190197        $user = $network->getSplashOnlyUser(); 
    191         $token = $user->generateConnectionToken($mac); 
     198        //$token = $user->generateConnectionToken($mac); 
     199        $token = Token::generateConnectionToken($mac, $network, $user); 
    192200        User::setCurrentUser($user); 
    193201        header("Location: http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token); 
     
    213221        if (!empty($gw_address) && !empty($gw_port)) { 
    214222            // Login from a gateway, redirect to the gateway to activate the token 
    215             $token = $user->generateConnectionToken($mac); 
     223            // $token = $user->generateConnectionToken($mac); 
     224            $token = Token::generateConnectionToken($mac, $network, $user); 
    216225            if(!$token) 
    217226            {