Changeset 227
- Timestamp:
- 09/27/04 15:46:18 (9 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 3 added
- 14 modified
-
ChangeLog (modified) (1 diff)
-
sql/wifidog-postgres-schema.sql (modified) (4 diffs)
-
wifidog/admin/import_user_database.php (modified) (3 diffs)
-
wifidog/classes/SmartyWifidog.php (modified) (1 diff)
-
wifidog/classes/Style.php (modified) (2 diffs)
-
wifidog/include/common.php (modified) (1 diff)
-
wifidog/include/user_management_menu.php (modified) (1 diff)
-
wifidog/index.php (modified) (2 diffs)
-
wifidog/local_content/common/back.gif (added)
-
wifidog/local_content/common/h1_back.gif (added)
-
wifidog/local_content/common/head.gif (added)
-
wifidog/local_content/default/header.html (modified) (1 diff)
-
wifidog/local_content/default/login.html (modified) (1 diff)
-
wifidog/local_content/default/portal.html (modified) (2 diffs)
-
wifidog/local_content/default/stylesheet.css (modified) (2 diffs)
-
wifidog/node_list.php (modified) (2 diffs)
-
wifidog/user_management/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r226 r227 1 1 # $Header$ 2 2004-09-27 Benoit Gr�goire <bock@step.polymtl.ca> 3 * sql/wifidog-postgres-schema.sql: Fix layout for the node_owners table 4 * Begin integrating Patrick Tanguay's new layout and generate the css dynamically to allow for background images. 5 2 6 2004-09-22 Benoit Gr�goire <bock@step.polymtl.ca> 3 7 * portal/index.php: Fix users appearing online at every hotspot. -
trunk/wifidog-auth/sql/wifidog-postgres-schema.sql
r224 r227 111 111 112 112 CREATE TABLE node_owners ( 113 node_id information_schema.cardinal_numberNOT NULL,114 user_id information_schema.cardinal_numberNOT NULL113 node_id character varying(32) NOT NULL, 114 user_id character varying(45) NOT NULL 115 115 ) WITHOUT OIDS; 116 116 … … 178 178 179 179 -- 180 -- TOC entry 19 (OID 3 00990)181 -- Name: node_owner _pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog180 -- TOC entry 19 (OID 310107) 181 -- Name: node_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 182 182 -- 183 183 184 184 ALTER TABLE ONLY node_owners 185 ADD CONSTRAINT node_owner _pkey PRIMARY KEY (node_id, user_id);185 ADD CONSTRAINT node_owners_pkey PRIMARY KEY (node_id, user_id); 186 186 187 187 … … 223 223 224 224 -- 225 -- TOC entry 26 (OID 300993) 225 -- TOC entry 26 (OID 310097) 226 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 227 -- 228 229 ALTER TABLE ONLY node_owners 230 ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 231 232 233 -- 234 -- TOC entry 27 (OID 310101) 226 235 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 227 236 -- … … 232 241 233 242 -- 234 -- TOC entry 27 (OID 300997)235 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog236 --237 238 ALTER TABLE ONLY node_owners239 ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE;240 241 242 --243 243 -- TOC entry 2 (OID 2200) 244 244 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres -
trunk/wifidog-auth/wifidog/admin/import_user_database.php
r207 r227 40 40 echo "Erreurs au cours du transfert: ".$_FILES[$form_name_file]['error']."<br>"; 41 41 } 42 echo "<div class=content>\n";43 42 44 43 $style = new Style(); 45 44 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' Import NoCat passwd file'); 46 45 46 echo "<div id='head'><h1>"._('NoCat passwd file (user database) import')."</h1></div>\n"; 47 echo "<div id='content'>\n"; 48 47 49 if(empty($_REQUEST['action'])) 48 50 { 49 50 echo "<h1>"._('NoCat passwd file (user database) import')."</h1>\n";51 51 echo "<form name=upload_file enctype='multipart/form-data' action='' method='post'>\n"; 52 52 … … 198 198 199 199 200 echo "<h 1>"._('Report')."</h1>\n";200 echo "<h2>"._('Report')."</h2>\n"; 201 201 /* List rejected users */ 202 202 echo "<table class='spreadsheet'>\n"; … … 238 238 echo "</table>\n"; 239 239 240 echo "<h2>$count_success user(s) successfully imported ($count_mangled of them had their username modified), $count_reject user(s)rejected</h 1>\n";240 echo "<h2>$count_success user(s) successfully imported ($count_mangled of them had their username modified), $count_reject user(s)rejected</h2>\n"; 241 241 } 242 242 } -
trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php
r164 r227 72 72 } 73 73 74 $this->assign('stylesheet_url',STYLESHEET_URL); 74 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.STYLESHEET_NAME)) 75 { 76 $this->assign('stylesheet_file',NODE_CONTENT_SMARTY_PATH.STYLESHEET_NAME); 77 } 78 else 79 { 80 $this->assign('stylesheet_file',DEFAULT_CONTENT_SMARTY_PATH.STYLESHEET_NAME); 81 } 75 82 76 83 /* Common content */ -
trunk/wifidog-auth/wifidog/classes/Style.php
r226 r227 28 28 Header("Content-Type: text/html; charset=iso-8859-1"); 29 29 require_once BASEPATH.'include/common.php'; 30 require_once BASEPATH.'classes/SmartyWifidog.php'; 30 31 31 32 /** Style contains functions managing headers, footers, stylesheet, etc. … … 34 35 { 35 36 /**Display HTML headers 36 * @param $tit re Title of the page37 * @param $title Title of the page 37 38 * @param $stylesheet stylesheet to include. 38 39 * @param $prevent_cache Should the browsers and proxies be prevented from caching this content? 39 40 * @return string to display in the page. 40 41 */ 41 function GetHeader($tit re)42 function GetHeader($title) 42 43 { 43 $retval = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'."\n"; 44 $retval.= "<html>\n"; 45 $retval.= "<head>\n"; 46 $retval.= "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n"; 47 $retval.= "<meta http-equiv='Pragma' CONTENT='no-cache'>\n"; 48 $retval.= "<meta http-equiv='Expires' CONTENT='-1'>\n"; 49 $retval.= "<link rel='stylesheet' href='".STYLESHEET_URL."' type='text/css'>\n"; 50 $retval.= "<title>$titre</title>\n"; 51 $retval.= "</head>\n"; 52 $retval.= "<body>\n"; 44 $smarty = new SmartyWifidog; 45 $smarty->assign('title',$title); 46 $retval = $smarty->fetch(DEFAULT_CONTENT_SMARTY_PATH.PAGE_HEADER_NAME); 53 47 global $starttime; 54 48 $starttime = microtime(); -
trunk/wifidog-auth/wifidog/include/common.php
r216 r227 88 88 define('NODE_CONTENT_PHP_RELATIVE_PATH', BASEPATH.LOCAL_CONTENT_REL_PATH.CURRENT_NODE_ID.'/'); 89 89 90 if (is_file(NODE_CONTENT_PHP_RELATIVE_PATH.STYLESHEET_NAME))91 {92 define('STYLESHEET_URL',NODE_CONTENT_URL.STYLESHEET_NAME);93 }94 else95 {96 define('STYLESHEET_URL',DEFAULT_CONTENT_URL.STYLESHEET_NAME);97 }98 99 90 define('COMMON_CONTENT_URL', BASE_URL_PATH.LOCAL_CONTENT_REL_PATH.'common/'); 100 91 -
trunk/wifidog-auth/wifidog/include/user_management_menu.php
r222 r227 39 39 40 40 $retval .= "</ul>\n"; 41 $retval .= "<p class='sidenote'>Accounts on ".HOTSPOT_NETWORK_NAME." are <emp>totally free</emp>, use the left menu to create a new one or recover a lost username or password.</p>\n"; 41 42 //$retval .= "</div>\n"; 42 43 return $retval; -
trunk/wifidog-auth/wifidog/index.php
r224 r227 29 29 $style = new Style(); 30 30 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' authentication server'); 31 echo "<div class=content>\n"; 31 echo "<div id='head'><h1>Wifidog authentication server for ". HOTSPOT_NETWORK_NAME ."</h1></div>\n"; 32 echo "<div id='content'>\n"; 32 33 33 34 $row = null; … … 41 42 $num_online_users=$row['count']; 42 43 43 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"; 44 45 echo "<p>"._("The network currently has ").$num_valid_users._(" valid users.")." ".$num_online_users._(" user(s) are currently online")."</p>\n"; 46 46 echo "<ul>\n"; 47 47 echo "<li><a href='node_list.php'>List network nodes</a></li>\n"; -
trunk/wifidog-auth/wifidog/local_content/default/header.html
r152 r227 5 5 <meta http-equiv='Pragma' CONTENT='no-cache'> 6 6 <meta http-equiv='Expires' CONTENT='-1'> 7 <link rel='stylesheet' href='{$stylesheet_url}' type='text/css'> 8 <title></title> 7 <style type="text/css"> 8 {include file=$stylesheet_file} 9 </style> 10 <title>{$title}</title> 9 11 </head> 10 12 <body> -
trunk/wifidog-auth/wifidog/local_content/default/login.html
r222 r227 1 {include file=$header_file} 2 <div class='content'> 3 <h1>Greetings! Welcome to {$hotspot_name}, a {$hotspot_network_name} free HotSpot<br clear=all> 4 <table width=100%> 5 <tr> 6 <th align=center><img src='{$hotspot_logo_url}' alt='{$hotspot_name} logo'></th> 7 <th align=center><img src='{$network_logo_url}' alt='{$hotspot_network_name} logo'></th> 8 </tr> 9 </table> 10 1 {include file=$header_file title="WiFiDog login page"} 2 3 4 <div id='head'> 5 <h1>Greetings! Welcome to {$hotspot_name}, a {$hotspot_network_name} free HotSpot 11 6 </h1> 12 7 </div> 13 14 <div class='content'> 15 <form method="post"> 8 9 10 11 <div id="login"> 12 <form method="post"> 16 13 <input type="hidden" name="gw_address" value="{$gw_address}"> 17 14 <input type="hidden" name="gw_port" value="{$gw_port}"> 18 15 <input type="hidden" name="gw_id" value="{$gw_id}"> 19 <p class=warning>{$login_failed_message}</p> 20 <table> 21 <tr> 22 <td>Username (or email):</td> 23 <td><input type="text" name="user" value="{$previous_username}"></td> 24 <td rowspan=3><img src='{$wifidog_logo_url}' alt='WifiDog logo'></td> 25 </tr> 26 <tr> 27 <td>Password:</td> 28 <td><input type="password" name="pass" value="{$previous_password}"></td> 29 </tr> 30 <tr> 31 <td></td> 32 <td><input type="submit" value='Login'></td> 33 </tr> 34 </table> 35 <p>Accounts on {$hotspot_network_name} are <emp>totally free</emp>, use the left menu to create a new one or recover a lost username or password.</p> 36 </form> 16 <p><span class=warning>{$login_failed_message}</span> 17 Username (or email): 18 <input type="text" name="user" size='12' value="{$previous_username}"> 19 Password:<input type="password" name="pass" size='12' value="{$previous_password}"> 20 <input type="submit" value='Login'></p> 21 </form> 37 22 </div> 38 <div class='content'> 23 24 <div id='navLeft'> 25 {$user_management_menu} 26 </div> 27 <div id="content"> 28 29 <div class="logos"> 30 <img src='{$network_logo_url}' alt='{$hotspot_network_name} logo' /><br /> 31 <img src='{$wifidog_logo_url}' alt='WifiDog logo' /> 32 </div> 33 <img src='{$hotspot_logo_url}' alt='{$hotspot_name} logo' /> 34 39 35 <h2>Announcements</h2> 40 36 <dl> 41 37 <dt>31/9/2004: {$hotspot_network_name} is currently transitioning from NoCat to the brand new Wifidog captive portal. Please note that your previous username and password should still work.</dt> 42 38 </dl> 43 </div>39 </div> 44 40 45 <div id='navLeft'>46 {$user_management_menu}47 </div>48 41 {include file=$footer_file} -
trunk/wifidog-auth/wifidog/local_content/default/portal.html
r216 r227 1 2 {include file=$header_file} 3 4 5 6 <div class='content'> 7 <p>Site I originally requested: <a href='{$original_url_requested}'>{$original_url_requested}</a></p> 8 <p><a href='{$hotspot_network_url}'><img src='{$network_logo_banner_url}' alt='{$hotspot_network_name} logo'></a></p> 9 <p>Content from "<a href='{$hotspot_network_url}'>{$hotspot_network_name}</a>"</p> 10 {$network_rss_html} 11 </div> 12 <div class='content'> 13 <p><img src='{$hotspot_logo_banner_url}' alt='{$hotspot_name} logo'> 14 <p>Content from "{$hotspot_name}"</p> 15 {$hotspot_rss_html} 16 </div> 17 1 {include file=$header_file} 18 2 <div id='navLeft'> 19 3 <p>Online at this hotspot:</p> … … 25 9 {$user_management_menu} 26 10 </div> 11 <div id='head'> 12 13 </div> 14 <div id='login'> 15 <p>Go to the site I originally requested: <a href='{$original_url_requested}'>{$original_url_requested}</a></p> 16 </div> 17 <div id='content'> 18 19 <p><a href='{$hotspot_network_url}'><img src='{$network_logo_banner_url}' alt='{$hotspot_network_name} logo'></a></p> 20 <p>Content from "<a href='{$hotspot_network_url}'>{$hotspot_network_name}</a>"</p> 21 {$network_rss_html} 22 </div> 23 <div id='content'> 24 <p><img src='{$hotspot_logo_banner_url}' alt='{$hotspot_name} logo'> 25 <p>Content from "{$hotspot_name}"</p> 26 {$hotspot_rss_html} 27 </div> 28 29 27 30 {include file=$footer_file} 28 31 -
trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
r222 r227 1 BODY { background-color: white ; background-image: none } 1 {literal} 2 body { 3 {/literal} 4 background: #fff url({$common_content_url}back.gif) repeat-y; 5 {literal} 6 margin: 0; 7 font-family: helvetica; 8 font-size: 90%; 9 } 10 11 #head { 12 {/literal} 13 background: #CCE0C5 url({$common_content_url}h1_back.gif) repeat-x; 14 {literal} 15 } 16 17 h1 { 18 {/literal} 19 background: url({$common_content_url}head.gif) no-repeat top left; 20 {literal} 21 margin: 0; 22 padding: 7px 2px 2px 186px; 23 height: 50px; 24 font-weight: normal; 25 font-size: 1.5em; 26 text-align: center; 27 color: #fff; 28 } 29 30 h2 { 31 clear: both; 32 border-bottom: 1px solid #BFDCB5; 33 color: #628C53; 34 } 35 36 #login { 37 background: #CCE0C5; 38 padding: 2px 10px; 39 text-align: right; 40 font-size: 0.9em; 41 color: #628C53; 42 } 43 44 #login form, #login p { 45 margin: 0; 46 } 47 48 #login span { 49 padding-right: 20px; 50 font-weight: bold; 51 } 52 53 #content { 54 margin-left: 186px; 55 padding: 10px; 56 border-top: 1px solid #BFDCB5; 57 } 58 59 #navLeft { 60 float: left; 61 width: 186px; 62 color: #628C53; 63 } 64 65 #navLeft ul { 66 margin-left: 15px; 67 padding-left: 0; 68 list-style-type: none; 69 } 70 71 #navLeft ul li { 72 padding: 3px 0; 73 } 74 75 #navLeft a { 76 color: #35952A; 77 } 78 79 #navLeft a:hover { 80 color: #FB7F44; 81 } 82 83 #navLeft h3 { 84 margin-left: 15px; 85 font-size: 1.2em; 86 } 87 88 .logos { 89 float: right; 90 text-align: center; 91 } 92 93 p.sidenote { 94 margin: 20px 10px; 95 padding: 10px 5px; 96 border: 1px solid #BFDCB5; 97 } 98 99 .hotspot { 100 padding: 5px; 101 border: 1px solid #BFDCB5; 102 } 103 104 105 .warning { 106 color:red; 107 font:bold 14px/18px verdana, arial, helvetica, sans-serif; 108 margin:0px 0px 5px 10px; 109 padding:0px; 110 } 111 2 112 .spreadsheet { border: thin solid lightblue ; text-align:left} 3 113 TH.spreadsheet { background-color: lightgrey} 4 114 TABLE.spreadsheet { border: solid darkblue ; text-align:left} 5 115 TABLE.spreadsheet_user { border: thin solid lightblue ; padding:0px; margin:0px;} 6 /*.user>.spreadsheet{ border: none }*/7 116 TH.th_left { background-color: lightgrey ; text-align:left} 8 117 TH.th_section { background-color: silver ; text-align:center} … … 13 122 A:active { color: red; /* font-size: 125% */} 14 123 A:visited { font-size: 85% } 15 16 /* All the content boxes belong to the content class. */ 17 .user { 18 } 124 125 {/literal} 19 126 20 127 21 body {22 color:#333;23 background-color:white;24 margin:20px;25 padding:0px;26 /*font:11px verdana, arial, helvetica, sans-serif;*/27 }28 h1 {29 margin:0px 15px 15px 15px;30 padding:0px;31 font-size:24px;32 font-weight:900;33 color:darkblue;34 background-color: azure;35 text-align:center;36 37 }38 h2 {39 font:bold 14px/18px verdana, arial, helvetica, sans-serif;40 margin:0px 0px 5px 0px;41 padding:0px;42 }43 44 p {45 /* font:11px/20px verdana, arial, helvetica, sans-serif; */46 margin:0px 0px 16px 0px;47 padding:0px;48 }49 .Content>p {margin:0px;}50 .Content>p+p {text-indent:30px;}51 #navLeft>p {52 background-color: lightgrey;53 /*border: solid darkblue;*/54 }55 #navLeft>h2.warning {56 color:red;57 font:bold 14px/18px verdana, arial, helvetica, sans-serif;58 margin:0px 0px 5px 0px;59 padding:0px;60 }61 62 /* All the content boxes belong to the content class. */63 .content {64 position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */65 width:auto;66 min-width:120px;67 /* margin:0px 210px 20px 170px; */68 margin:0px 0px 20px 170px;69 border:1px solid black;70 background-color:white;71 padding:10px;72 z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */73 }74 75 #navLeft {76 position:absolute;77 width:150px;78 top:20px;79 left:20px;80 border:1px dashed black;81 background-color:#eee;82 padding:10px;83 z-index:2;84 85 /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.86 Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.87 IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style88 declaration. The incorrect IE5/Win value is above, while the correct value is89 below. See http://glish.com/css/hacks.asp for details. */90 voice-family: "\"}\"";91 voice-family:inherit;92 width:128px;93 }94 95 /* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct96 length values to user agents that exhibit the parsing error exploited above yet get97 the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include98 a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */99 body>#navLeft {width:128px;}100 101 #navRight {102 position:absolute;103 width:190px;104 top:20px;105 right:20px;106 border:1px dashed black;107 background-color:#eee;108 padding:10px;109 z-index:1;110 /* Again, the ugly brilliant hack. */111 voice-family: "\"}\"";112 voice-family:inherit;113 width:168px;114 }115 /* Again, "be nice to Opera 5". */116 body>#navRight {width:168px;}117 118 .warning {119 color:red;120 font:bold 14px/18px verdana, arial, helvetica, sans-serif;121 margin:0px 0px 5px 170px;122 padding:0px;123 }124 125 -
trunk/wifidog-auth/wifidog/node_list.php
r224 r227 31 31 $style = new Style(); 32 32 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' node list'); 33 echo "<div class=content>\n";34 35 36 37 echo "<h1>". HOTSPOT_NETWORK_NAME ." node list</h1>\n";38 33 echo "<div id='head'><h1>". HOTSPOT_NETWORK_NAME ." node list</h1></div>\n"; 34 echo "<div id='navLeft'>\n"; 35 echo get_user_management_menu(); 36 echo "</div>\n"; 37 38 echo "<div id='content'>\n"; 39 39 40 40 $db->ExecSql("SELECT node_id, name, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, … … 75 75 76 76 echo "</div>\n"; 77 echo "<div id='navLeft'>\n"; 78 echo get_user_management_menu(); 79 echo "</div>\n"; 77 80 78 echo $style->GetFooter(); 81 79 ?> -
trunk/wifidog-auth/wifidog/user_management/index.php
r225 r227 339 339 echo $style->GetHeader(HOTSPOT_NETWORK_NAME.' New account registration'); 340 340 $showform=true; 341 echo "<div id='navLeft'>\n"; 342 echo get_user_management_menu(); 343 echo "</div>\n"; 341 344 echo "<div class='content'>\n"; 342 345 … … 644 647 } 645 648 echo "</div>\n"; 646 echo "<div id='navLeft'>\n";647 echo get_user_management_menu();648 echo "</div>\n";649 649 echo $style->GetFooter(); 650 650 ?>
