Changeset 1135
- Timestamp:
- 11/23/06 10:11:15 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 4 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/classes/User.php (modified) (1 diff)
-
wifidog/login/index.php (modified) (3 diffs)
-
wifidog/node_list.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1133 r1135 1 2006-11-22 Benoit Grégoire <bock@step.polymtl.ca> 2 * Fix broken auth 1 3 2006-11-22 Benoit Grégoire <bock@step.polymtl.ca> 2 4 * Major schema update (this one is going to make your database grind for a while, sorry -
trunk/wifidog-auth/wifidog/classes/User.php
r1128 r1135 446 446 $node_ip = $db->escapeString($_SERVER['REMOTE_ADDR']); 447 447 } 448 449 if ($session && $node_ip && $session->get(SESS_GW_ID_VAR)) {450 $node_id = $db->escapeString($session->get(SESS_ GW_ID_VAR));448 if ($session && $node_ip && $session->get(SESS_NODE_ID_VAR)) { 449 //echo "$session && $node_ip && {$session->get(SESS_NODE_ID_VAR)}"; 450 $node_id = $db->escapeString($session->get(SESS_NODE_ID_VAR)); 451 451 $db->execSqlUpdate("INSERT INTO connections (user_id, token, token_status, timestamp_in, node_id, node_ip, last_updated) VALUES ('" . $this->getId() . "', '$token', '" . TOKEN_UNUSED . "', CURRENT_TIMESTAMP, '$node_id', '$node_ip', CURRENT_TIMESTAMP)", false); 452 452 $retval = $token; -
trunk/wifidog-auth/wifidog/login/index.php
r1133 r1135 140 140 $continueToAdmin = true; 141 141 } 142 143 142 /* 144 143 * Start general request parameter processing section … … 149 148 if($node) 150 149 { 151 $session->set(SESS_NODE_ID_VAR, $node->getId );150 $session->set(SESS_NODE_ID_VAR, $node->getId()); 152 151 } 153 152 } … … 205 204 // Login from a gateway, redirect to the gateway to activate the token 206 205 $token = $user->generateConnectionToken(); 207 206 if(!$token) 207 { 208 throw new exception(sprintf(_("Unable to generate token for user %s"),$user->getUsername())); 209 } 210 else 211 { 208 212 header("Location: http://" . $gw_address . ":" . $gw_port . "/wifidog/auth?token=" . $token); 213 } 209 214 } else { 210 215 // Virtual login, redirect to the auth server homepage -
trunk/wifidog-auth/wifidog/node_list.php
r1127 r1135 98 98 // Sort according to above instructions 99 99 if ($sort_by_using_sql === true) 100 $sql = "SELECT node_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY {$sort_by_param}";100 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY {$sort_by_param}"; 101 101 else 102 $sql = "SELECT node_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY ".DEFAULT_SORT_BY_PARAM;102 $sql = "SELECT node_id, gw_id, name, last_heartbeat_user_agent, (CURRENT_TIMESTAMP-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((CURRENT_TIMESTAMP-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS online, creation_date, node_deployment_status FROM nodes WHERE node_deployment_status != 'PERMANENTLY_CLOSED' ORDER BY ".DEFAULT_SORT_BY_PARAM; 103 103 $nodes_results = null; 104 104 $db->execSql($sql, $nodes_results, false);
