Changeset 1455 for branches/newtoken/wifidog/classes/Token.php
- Timestamp:
- 03/03/10 19:27:35 (2 years ago)
- Files:
-
- 1 modified
-
branches/newtoken/wifidog/classes/Token.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newtoken/wifidog/classes/Token.php
r1446 r1455 96 96 * Delete all unused tokens for this user, so we don't fill the database 97 97 * with them 98 * But make sure the unused token is not associated with previous successful connections, so when the incoming field is null 98 99 */ 99 $sql = "DELETE FROM connections USING tokens "."WHERE tokens.token_id=connections.token_id AND token_status='".TOKEN_UNUSED."' AND user_id = '".$user->getId()."';\n";100 $sql = "DELETE FROM connections USING tokens "."WHERE tokens.token_id=connections.token_id AND token_status='".TOKEN_UNUSED."' AND incoming is null AND user_id = '".$user->getId()."';\n"; 100 101 $db->execSqlUpdate($sql, false); 101 102 … … 116 117 // look for an existing token that can be reused 117 118 // get all unexpired tokens ordered by first used time 119 // TODO: The token may be owned by someone but be unused and have no connection associated with it 118 120 $sql = "SELECT t.token_id, tt.token_max_total_data, tt.token_max_incoming_data, tt.token_max_outgoing_data, 119 121 LEAST((c.first_used_time + tt.token_max_usage_duration - c.total_connection_duration),
