Changeset 207
- Timestamp:
- 08/28/04 17:12:54 (9 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 2 added
- 5 modified
-
ChangeLog (modified) (1 diff)
-
wifidog/admin/import_user_database.php (modified) (3 diffs)
-
wifidog/admin/user_log.php (modified) (1 diff)
-
wifidog/classes/Security.php (added)
-
wifidog/classes/Session.php (added)
-
wifidog/index.php (modified) (2 diffs)
-
wifidog/login/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r206 r207 1 1 # $Header$ 2 2004-08-28 Benoit Gr�goire <bock@step.polymtl.ca> 3 * Primitive network status available form the index page 4 * Administrative security is implemented. 5 2 6 2004-08-28 Benoit Gr�goire <bock@step.polymtl.ca> 3 7 * Fix big gaping security hole in login page (password would be ignored if the username was used to login) -
trunk/wifidog-auth/wifidog/admin/import_user_database.php
r206 r207 26 26 require_once BASEPATH.'include/common.php'; 27 27 require_once BASEPATH.'classes/Style.php'; 28 require_once BASEPATH.'classes/Security.php'; 29 $security=new Security(); 30 $security->requireAdmin(); 28 31 29 32 /** Affiche les informations sur le fichier envoy� par le client … … 105 108 } 106 109 107 echo "<p class=info>Generating temporary user from: $original_username; Checking duplicates</p>\n";110 echo "<p class=info>Generating temporary user from: $original_username; Checking internal duplicates</p>\n"; 108 111 $username_modified_because_of=null; 109 112 $username=$original_username; … … 160 163 $import_user[$username]['reject_reason'] .= "<p class=error>"._('Sorry, the user must have a email adress.')."</p>\n";null; 161 164 } 162 163 $username_str = $db->EscapeString($username); 164 $db->ExecSqlUniqueRes("SELECT user_id FROM users WHERE user_id='$username_str'", $user_info_username, false); 165 if($user_info_username!=null) 166 { 167 $import_user[$username]['is_rejected']=true; 168 $import_user[$username]['reject_reason'] .= "<p class=error>"._('Sorry, a user account already exists with the username: ')."$username</p>\n"; 165 else 166 { 167 $username_str = $db->EscapeString($username); 168 $db->ExecSqlUniqueRes("SELECT user_id FROM users WHERE user_id='$username_str'", $user_info_username, false); 169 if($user_info_username!=null) 170 { 171 $import_user[$username]['is_rejected']=true; 172 $import_user[$username]['reject_reason'] .= "<p class=error>"._('Sorry, a user account already exists with the username: ')."$username</p>\n"; 173 } 169 174 } 170 175 -
trunk/wifidog-auth/wifidog/admin/user_log.php
r194 r207 26 26 require_once BASEPATH.'include/common.php'; 27 27 require_once BASEPATH.'classes/SmartyWifidog.php'; 28 require_once BASEPATH.'classes/Security.php'; 29 $security=new Security(); 30 $security->requireAdmin(); 28 31 29 32 $smarty = new SmartyWifidog; -
trunk/wifidog-auth/wifidog/index.php
r204 r207 29 29 $style = new Style(); 30 30 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' authentication server'); 31 echo "<div class=content>\n"; 31 32 33 $row = null; 34 //$db->ExecSqlUniqueRes("SELECT COUNT(user_id), account_status FROM users GROUP BY account_status", $row, true); 35 $db->ExecSqlUniqueRes("SELECT COUNT(user_id) FROM users WHERE account_status = ".ACCOUNT_STATUS_ALLOWED, $row, false); 36 $num_valid_users=$row['count']; 37 $row = null; 38 $db->ExecSqlUniqueRes("SELECT COUNT(user_id) FROM ( SELECT DISTINCT user_id FROM connections " . 39 "WHERE token_status='" . TOKEN_INUSE . "') AS online_users" 40 ,$row, false); 41 $num_online_users=$row['count']; 42 43 32 44 echo "<h1>Wifidog authentication server for ". HOTSPOT_NETWORK_NAME ."</h1>\n"; 45 echo "<p>"._("The network currently has ").$num_valid_users._(" valid users.")." ".$num_online_users._(" user are currently online")."</p>\n"; 33 46 echo "<ul>\n"; 34 47 echo "<li><a href='".BASE_SSL_PATH."login/index.php?gw_id=default&gw_address=127.0.0.1&gw_port=80'>Login (demo)</a></li>\n"; … … 37 50 echo "<li><a href='".BASE_SSL_PATH."admin/index.php'>Administration</a></li>\n"; 38 51 echo "</ul>\n"; 52 echo "</div>\n"; 39 53 40 54 echo $style->GetFooter(); -
trunk/wifidog-auth/wifidog/login/index.php
r206 r207 28 28 require_once BASEPATH.'classes/SmartyWifidog.php'; 29 29 require_once (BASEPATH.'include/user_management_menu.php'); 30 require_once BASEPATH.'classes/Security.php'; 30 31 31 32 $login_successfull = false; … … 36 37 if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) 37 38 { 39 $security = new Security(); 38 40 $previous_username = $db->EscapeString($_REQUEST['user']); 39 $previous_password = $_REQUEST['pass'];41 $previous_password = $_REQUEST['pass']; 40 42 $user = $db->EscapeString($_REQUEST['user']); 41 43 $password_hash = get_password_hash($_REQUEST['pass']); … … 56 58 57 59 $login_successfull=true; 60 $security->login($user, $password_hash); 58 61 header("Location: http://" . $_REQUEST['gw_address'] . ":" . $_REQUEST['gw_port'] . "/wifidog/auth?token=$token"); 59 62 }
