| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | * File version: $Id$ |
|---|
| 5 | * |
|---|
| 6 | * Log history: |
|---|
| 7 | * |
|---|
| 8 | * $Log$ |
|---|
| 9 | * Revision 1.42 2005/05/02 01:22:02 fproulx |
|---|
| 10 | * 2005-04-30 Francois Proulx <francois.proulx@gmail.com> |
|---|
| 11 | * * Logout button will now destroy session AND render token USED |
|---|
| 12 | * |
|---|
| 13 | * Revision 1.41 2005/04/28 03:14:48 fproulx |
|---|
| 14 | * *** empty log message *** |
|---|
| 15 | * |
|---|
| 16 | * Revision 1.40 2005/04/25 17:13:14 benoitg |
|---|
| 17 | * |
|---|
| 18 | * 2005-04-25 Benoit Gr�goire <bock@step.polymtl.ca> |
|---|
| 19 | * * UI fully functionnal |
|---|
| 20 | * |
|---|
| 21 | * Revision 1.39 2005/04/25 17:07:47 fproulx |
|---|
| 22 | * 2005-04-25 Fran�ois Proulx <francois.proulx@gmail.com |
|---|
| 23 | * * More interface work |
|---|
| 24 | * |
|---|
| 25 | * Revision 1.38 2005/04/25 16:17:54 fproulx |
|---|
| 26 | * 2005-04-25 Fran�ois Proulx <francois.proulx@gmail.com |
|---|
| 27 | * * Completed integration of new interface with new objects |
|---|
| 28 | * |
|---|
| 29 | * Revision 1.37 2005/04/25 13:16:06 benoitg |
|---|
| 30 | * 2005-04-25 Benoit Gr�goire <bock@step.polymtl.ca> |
|---|
| 31 | * * Integration merge, should work, but there will be display problems everywhere. Expect further commits today. |
|---|
| 32 | * * Almost 100% complete Network abstraction |
|---|
| 33 | * * Much better object encapsulation. Deprecated methods not removed yet. |
|---|
| 34 | * * Add MainUI class. Used to display the interface. Inner workings still need work. |
|---|
| 35 | * |
|---|
| 36 | * Revision 1.36 2005/04/23 22:11:17 fproulx |
|---|
| 37 | * 2005-04-23 François Proulx <francois.proulx@gmail.com> |
|---|
| 38 | * * Fixed bugs in File and EmbeddedContent |
|---|
| 39 | * * Completed first iteration of EmbeddedContent |
|---|
| 40 | * * Can now play multimedia content |
|---|
| 41 | * * Could not test fallback with my browser ( Safari and Firefox ) |
|---|
| 42 | * * Need help to test content in different browser to see how it reacts... |
|---|
| 43 | * |
|---|
| 44 | * Revision 1.35 2005/04/23 16:05:45 fproulx |
|---|
| 45 | * 2005-04-22 François Proulx <francois.proulx@gmail.com> |
|---|
| 46 | * * Fixed bug in FlickrPhotostream.php |
|---|
| 47 | * * Params did not match new methods requirements ( getUserByEmail ) |
|---|
| 48 | * * Changed stylesheet class name for Flickr to match new changes |
|---|
| 49 | * * Fixed bugs in File |
|---|
| 50 | * * Wrote part of EmbeddedContent ( partially working ) |
|---|
| 51 | * * add support for parameters and attributes in EmbeddedContent |
|---|
| 52 | * |
|---|
| 53 | * Revision 1.34 2005/04/21 14:58:29 fproulx |
|---|
| 54 | * 2005-04-21 Fran�ois Proulx <francois.proulx@gmail.com> |
|---|
| 55 | * * Added explicit admin UI exceptions support for Flickr |
|---|
| 56 | * * Completed File and Picture objects |
|---|
| 57 | * |
|---|
| 58 | * Revision 1.33 2005/04/19 21:17:01 fproulx |
|---|
| 59 | * 2005-04-18 Fran�ois Proulx <francois.proulx@gmail.com> |
|---|
| 60 | * * Added Flickr content support |
|---|
| 61 | * * Part of File object is done |
|---|
| 62 | * |
|---|
| 63 | * Revision 1.32 2005/04/19 21:02:40 benoitg |
|---|
| 64 | * 2005-04-19 Benoit Gr�goire <bock@step.polymtl.ca> |
|---|
| 65 | * * Working (beta...) content manager and portal. |
|---|
| 66 | * * Add content preview mode |
|---|
| 67 | * |
|---|
| 68 | * Revision 1.31 2005/04/14 15:12:35 benoitg |
|---|
| 69 | * 2005-04-14 Benoit Gr�goire <bock@step.polymtl.ca> |
|---|
| 70 | * * First part of the future content delivery infrastructure. Many files added. |
|---|
| 71 | * |
|---|
| 72 | * Revision 1.30 2005/04/01 21:38:23 fproulx |
|---|
| 73 | * 2005-04-01 Francois Proulx <francois.proulx@gmail.com> |
|---|
| 74 | * * EVERYTHING IS NOW UTF-8 YOU MUST EDIT YOUR FILES WITH AN UTF-8 COMPLIANT EDITOR |
|---|
| 75 | * * The database will be converted to UTF-8 (version 5) |
|---|
| 76 | * * Added select boxes ( or hidden ) html form elements to choose the network for signup, lost password, username |
|---|
| 77 | * |
|---|
| 78 | * Revision 1.29 2005/04/01 20:58:28 benoitg |
|---|
| 79 | * 2005-04-01 Benoit Gr�goire <bock@step.polymtl.ca> |
|---|
| 80 | * * Add constraints to account_origin to detect errors on inserts. |
|---|
| 81 | * * Remove IDRC test server |
|---|
| 82 | * |
|---|
| 83 | * Revision 1.28 2005/04/01 02:17:40 benoitg |
|---|
| 84 | * 2005-02-14 Philippe April <philippe@ilesansfil.org> |
|---|
| 85 | * * User.php: Add reference to $db global variable. |
|---|
| 86 | * |
|---|
| 87 | * Revision 1.27 2005/04/01 02:05:32 benoitg |
|---|
| 88 | * 2005-03-31 Benoit Grégoire <bock@step.polymtl.ca> |
|---|
| 89 | * * Remove spaces after php blocks in various files. |
|---|
| 90 | * * Temporarely fix single authentication source not present bug in login smarty template. All other places where we select the network will be fixed tommorow. |
|---|
| 91 | * * Fix initial schema errors. |
|---|
| 92 | * |
|---|
| 93 | * Revision 1.26 2005/03/31 18:35:23 benoitg |
|---|
| 94 | * 2005-03-31 Benoit Grégoire <bock@step.polymtl.ca> |
|---|
| 95 | * * More RADIUS install documentation. |
|---|
| 96 | * * Fix schema_validate.php |
|---|
| 97 | * |
|---|
| 98 | * Revision 1.25 2005/03/31 17:54:45 fproulx |
|---|
| 99 | * Missing files |
|---|
| 100 | * |
|---|
| 101 | * Revision 1.24 2005/03/30 20:04:42 fproulx |
|---|
| 102 | * 2005-03-30 Fran?ois Proulx <francois.proulx@gmail.com> |
|---|
| 103 | * * Finished RADIUS authentication and accounting |
|---|
| 104 | * * Accounting Unique session ID is now based on the same token we use |
|---|
| 105 | * * Fixed all issues with lost_username, lost_password etc... |
|---|
| 106 | * * User class has new static function getUsersByEmail and getUsersByUsername |
|---|
| 107 | * * Added translations for new features |
|---|
| 108 | * * Translated the validation, lost password, username e-mails |
|---|
| 109 | * * Tested quite a bit, this version is considered stable |
|---|
| 110 | * * A few examples on how set different RADIUS or local authenticators can be found in the config.php |
|---|
| 111 | * |
|---|
| 112 | * Revision 1.23 2005/03/29 22:13:27 fproulx |
|---|
| 113 | * 2005-03-28 Fran?ois Proulx <francois.proulx@gmail.com> |
|---|
| 114 | * * schema_validate.php : Modified schema : dropped e-mail + account unique index, dropped email not empty constraint |
|---|
| 115 | * * Schema is now at version 3 |
|---|
| 116 | * * Coded RADIUS authentication |
|---|
| 117 | * * Modified templates to show a select box when more than one server is configured |
|---|
| 118 | * * Coded RADIUS accounting and backward compatibility accounting |
|---|
| 119 | * * Modified many statistics SQL queries to match new Users table |
|---|
| 120 | * * modified statistics templates to match user_id and account_origin |
|---|
| 121 | * * TODO : Fix lost_username and lost_password ( issue since we dropped the unique constraint on emails... ) |
|---|
| 122 | * * TODO : Heavy testing possibly with remote RADIUS servers |
|---|
| 123 | * |
|---|
| 124 | * Revision 1.22 2005/03/28 19:49:52 benoitg |
|---|
| 125 | * 2005-03-28 Benoit Gr?goire <bock@step.polymtl.ca> |
|---|
| 126 | * * common.php: Add get_guid() function |
|---|
| 127 | * * validate_schema.php: New auto-upgrade script to allow autaumatic schema upgrade. Note that you must still update dump_initial_data_postgres.sh and use sync_sql_for_cvs.sh so new users aren't left in the cold. |
|---|
| 128 | * * New class Authenticator (and subclasses): Begin virtualizing the login process. |
|---|
| 129 | * |
|---|
| 130 | * Revision 1.21 2005/03/17 03:57:39 masham |
|---|
| 131 | * * use __FILE__ to resolve location of local.config |
|---|
| 132 | * |
|---|
| 133 | * Revision 1.20 2005/03/17 00:36:21 masham |
|---|
| 134 | * * config.php will use "local.config.php" instead, if present. avoid cvs over-writing. |
|---|
| 135 | * * if CUSTOM_SIGNUP_URL is defined, signup.php will re-direct. For integration with existing auth systems. |
|---|
| 136 | * |
|---|
| 137 | * Revision 1.19 2005/01/26 03:46:30 benoitg |
|---|
| 138 | * 2005-01-25 Benoit Gr?goire <bock@step.polymtl.ca> |
|---|
| 139 | * * classes/Node.php: New file, untested code example |
|---|
| 140 | * * wifidog/admin/admin_common.php: Remove double-defined BASEPATH |
|---|
| 141 | * |
|---|
| 142 | * Revision 1.18 2005/01/19 00:05:37 aprilp |
|---|
| 143 | * Removed references to user_management pages that don't exist anymore |
|---|
| 144 | * |
|---|
| 145 | * Revision 1.17 2005/01/18 14:36:50 aprilp |
|---|
| 146 | * Changed default language to fr_FR instead of fr, it wasn't working on some platforms |
|---|
| 147 | * |
|---|
| 148 | * Revision 1.16 2005/01/16 21:21:55 aprilp |
|---|
| 149 | * *** empty log message *** |
|---|
| 150 | * |
|---|
| 151 | * Revision 1.15 2005/01/12 15:52:36 aprilp |
|---|
| 152 | * *** empty log message *** |
|---|
| 153 | * |
|---|
| 154 | * Revision 1.14 2005/01/12 00:57:42 benoitg |
|---|
| 155 | * 2004-01-10 Benoit Gr?goire <bock@step.polymtl.ca> |
|---|
| 156 | * * wifidog/config.php: Add list of hotspot to network rss feed list (not yet functionnal) |
|---|
| 157 | * * wifidog/hotspot_status.php: Allow RSS export of the list of deployed HotSpots. |
|---|
| 158 | * * wifidog/admin/incoming_outgoing_swap.php: Script to swap incoming and outgoing in your data. only use this if you had gateways before 1.0.2 and wish to correct your logs before you upgrade. |
|---|
| 159 | * * wifidog/classes/RssPressReview.inc: Missing file from previous commit. |
|---|
| 160 | * * wifidog/portal/index.php: Preliminary work to enable smart press review of multiple RSS feeds. |
|---|
| 161 | * |
|---|
| 162 | * Revision 1.13 2004/12/03 19:42:32 benoitg |
|---|
| 163 | * 2004-12-03 Benoit Gr?goire <bock@step.polymtl.ca> |
|---|
| 164 | * * wifidog/admin/user_stats.php, wifidog/classes/Statistics.php: Embryonic aggregate user stats. Currently allows you to find out the rate at which your users subscribe. |
|---|
| 165 | * * wifidog/config.php, wifidog/local_content/default/login.html, wifidog/include/user_management_menu.php: Add hotspot status page to login page. |
|---|
| 166 | * * wifidog/hotspot_status.php: Cosmetic |
|---|
| 167 | * * wifidog/admin/hotspot_log.php: Stats now need admin privileges |
|---|
| 168 | * * wifidog/index.php: Cosmetic. |
|---|
| 169 | * |
|---|
| 170 | * Revision 1.12 2004/11/20 03:28:25 benoitg |
|---|
| 171 | * 2004-11-19 Benoit Gr?goire <bock@step.polymtl.ca> |
|---|
| 172 | * * TODO: Add email domains to blacklist |
|---|
| 173 | * * wifidog/config.php, wifidog/include/user_management_menu.php: Add tech support email address |
|---|
| 174 | * * wifidog/hotspot_status.php: List of HotSpots that are open with summary of information. Designed to be included as part of another page. |
|---|
| 175 | * * wifidog/local_content/common/wifidog_logo_banner.gif: Add wifidog logo |
|---|
| 176 | * * wifidog/local_content/default/hotspot_logo_banner.jpg: Shrink the logo and write unknown hotspot, however this is still really ugly |
|---|
| 177 | * * wifidog/local_content/default/login.html, portal.html, stylesheet.css: Cosmetic fixes |
|---|
| 178 | * * wifidog/local_content/default/login.html.fr, portal.html.fr: Delete the files, this isn't the approach we will use for translation. |
|---|
| 179 | * * sql/wifidog-postgres-initial-data.sql, wifidog-postgres-schema.sql: Update with new node information structures. |
|---|
| 180 | * |
|---|
| 181 | * Revision 1.11 2004/09/28 20:46:40 yanik_crepeau |
|---|
| 182 | * Added experimental (and commented) code for next developpments |
|---|
| 183 | * regarding the language/localization issues. |
|---|
| 184 | * |
|---|
| 185 | * Revision 1.10 2004/09/28 20:44:08 yanik_crepeau |
|---|
| 186 | * Added commented hearder with Id and Log cvs keywords. |
|---|
| 187 | * |
|---|
| 188 | * |
|---|
| 189 | */ |
|---|
| 190 | |
|---|
| 191 | if(file_exists(dirname(__FILE__)."/local.config.php")) { |
|---|
| 192 | // use a local copy of the configuration if found instead of the distro's. |
|---|
| 193 | require dirname(__FILE__)."/local.config.php"; |
|---|
| 194 | } else { |
|---|
| 195 | |
|---|
| 196 | /* Used by AbstractDb */ |
|---|
| 197 | define('CONF_DATABASE_HOST', 'localhost'); |
|---|
| 198 | define('CONF_DATABASE_NAME', 'wifidog'); |
|---|
| 199 | define('CONF_DATABASE_USER', 'wifidog'); |
|---|
| 200 | define('CONF_DATABASE_PASSWORD', 'wifidogtest'); |
|---|
| 201 | |
|---|
| 202 | /*************************** Common setup option. Adjust to suit your environment *******************************/ |
|---|
| 203 | |
|---|
| 204 | /* The SYSTEM_PATH, must be set to the url path needed to reach the wifidog directory. Normally '/' or '/wifidog/', depending on where configure your document root. Gateway configuration must match this as well */ |
|---|
| 205 | define('SYSTEM_PATH', '/'); |
|---|
| 206 | /**< Set this to true if your server has SSL available, otherwise, passwords will be transmitted in clear text over the air */ |
|---|
| 207 | define('SSL_AVAILABLE', true); |
|---|
| 208 | /** @deprecated version - 2005-04-19 */ |
|---|
| 209 | define('HOTSPOT_NETWORK_NAME', 'Île sans fil'); |
|---|
| 210 | define('HOTSPOT_NETWORK_URL', 'http://www.ilesansfil.org/'); |
|---|
| 211 | define('TECH_SUPPORT_EMAIL', 'tech@ilesansfil.org'); |
|---|
| 212 | define('UNKNOWN_HOSTPOT_NAME', 'Unknown HotSpot'); |
|---|
| 213 | |
|---|
| 214 | define('VALIDATION_GRACE_TIME', 20); /**< Number of minutes after new account creation during which internet access is available to validate your account. Once elapsed, you have to validate from home... */ |
|---|
| 215 | define('VALIDATION_EMAIL_FROM_ADDRESS', 'validation@ilesansfil.org'); |
|---|
| 216 | /* RSS support. If set to true, MAGPIERSS must be installed in MAGPIE_REL_PATH */ |
|---|
| 217 | define('RSS_SUPPORT', true); |
|---|
| 218 | /* Flickr Photostream content support. If set to true, Phlickr must be installed in PHLICKR_REL_PATH */ |
|---|
| 219 | define('PHLICKR_SUPPORT', false); |
|---|
| 220 | /* Normally, the database cleanup routines will be called everytime a portal page is displayed. If you set this to true, you must set a cron job on the server which will execute the script cron/cleanup.php. */ |
|---|
| 221 | define('CONF_USE_CRON_FOR_DB_CLEANUP', false); |
|---|
| 222 | |
|---|
| 223 | |
|---|
| 224 | /* Use a custom signup system instead of the built in signup page. */ |
|---|
| 225 | //define("CUSTOM_SIGNUP_URL","https://www.bcwireless.net/hotspot/signup.php"); |
|---|
| 226 | |
|---|
| 227 | /** The next two items are constants, do not edit */ |
|---|
| 228 | define('DBMS_MYSQL','AbstractDbMySql.php'); |
|---|
| 229 | define('DBMS_POSTGRES','AbstractDbPostgres.php'); |
|---|
| 230 | |
|---|
| 231 | /** Defines which Database management software you want to use */ |
|---|
| 232 | define('CONF_DBMS',DBMS_POSTGRES); |
|---|
| 233 | |
|---|
| 234 | /* Available Locales (Languages) */ |
|---|
| 235 | $AVAIL_LOCALE_ARRAY=array('fr'=>'Français', |
|---|
| 236 | 'en'=>'English'); |
|---|
| 237 | |
|---|
| 238 | /***** You should normally not have to edit anything below this ******/ |
|---|
| 239 | define('WIFIDOG_NAME', 'WiFiDog Authentication server'); |
|---|
| 240 | define('WIFIDOG_VERSION', 'CVS'); |
|---|
| 241 | |
|---|
| 242 | define('MAGPIE_REL_PATH', 'lib/magpie/'); |
|---|
| 243 | define('SMARTY_REL_PATH', 'lib/smarty/'); |
|---|
| 244 | define('PHLICKR_REL_PATH', 'lib/'); |
|---|
| 245 | //define('NETWORK_RSS_URL', 'http://wifinetnews.com/index.rdf'); |
|---|
| 246 | define('NETWORK_RSS_URL', 'http://patricktanguay.com/isf/atom.xml, http://auth.ilesansfil.org/hotspot_status.php?format=RSS'); |
|---|
| 247 | define('UNKNOWN_HOTSPOT_RSS_URL', ''); |
|---|
| 248 | |
|---|
| 249 | define('LOCAL_CONTENT_REL_PATH', 'local_content/');//Path to the directory containing the different node specific directories. Relative to BASE_URL_PATH |
|---|
| 250 | |
|---|
| 251 | // Authentication sources section |
|---|
| 252 | /* The array index for the source must match the account_origin in the user table */ |
|---|
| 253 | |
|---|
| 254 | // Local User authenticators |
|---|
| 255 | require_once BASEPATH.'classes/AuthenticatorLocalUser.php'; |
|---|
| 256 | |
|---|
| 257 | /********************************************** |
|---|
| 258 | * BIG FAT WARNING |
|---|
| 259 | * DO NOT remove this authenticator under any circumstance |
|---|
| 260 | * you SHOULD NOT change its name either |
|---|
| 261 | * The system relies heavily on its main authenticator to do |
|---|
| 262 | * multiple tasks with users... |
|---|
| 263 | * ******************************************** |
|---|
| 264 | */ |
|---|
| 265 | define('LOCAL_USER_ACCOUNT_ORIGIN', 'LOCAL_USER'); |
|---|
| 266 | $AUTH_SOURCE_ARRAY[LOCAL_USER_ACCOUNT_ORIGIN]=array( |
|---|
| 267 | 'name'=>HOTSPOT_NETWORK_NAME, |
|---|
| 268 | 'authenticator'=>new AuthenticatorLocalUser(LOCAL_USER_ACCOUNT_ORIGIN)); |
|---|
| 269 | |
|---|
| 270 | // RADIUS authenticators ( see AuthenticatorRadius constuctor doc for details ) |
|---|
| 271 | /* |
|---|
| 272 | require_once BASEPATH.'classes/AuthenticatorRadius.php'; |
|---|
| 273 | |
|---|
| 274 | define('IDRC_ACCOUNT_ORIGIN', 'IDRC_RADIUS_USER'); |
|---|
| 275 | $AUTH_SOURCE_ARRAY[IDRC_ACCOUNT_ORIGIN]=array( |
|---|
| 276 | 'name'=>"IDRC RADIUS Server", |
|---|
| 277 | 'authenticator'=>new AuthenticatorRadius(IDRC_ACCOUNT_ORIGIN, "192.168.0.11", 1812, 1813, "secret_key", "CHAP_MD5")); |
|---|
| 278 | */ |
|---|
| 279 | |
|---|
| 280 | /*These are the file names of the different templates that can be put in the CONTENT_PATH/(node_id)/ folders */ |
|---|
| 281 | define('STYLESHEET_NAME', 'stylesheet.css'); |
|---|
| 282 | define('LOGIN_PAGE_NAME', 'login.html'); |
|---|
| 283 | define('PORTAL_PAGE_NAME', 'portal.html');/**< @deprecated version - 19-Apr-2005*/ |
|---|
| 284 | define('PAGE_HEADER_NAME', 'header.html');/**< @deprecated version - 19-Apr-2005*/ |
|---|
| 285 | define('PAGE_FOOTER_NAME', 'footer.html');/**< @deprecated version - 19-Apr-2005*/ |
|---|
| 286 | define('HOTSPOT_STATUS_PAGE', 'hotspot_status.php'); |
|---|
| 287 | define('HOTSPOT_LOGO_NAME', 'hotspot_logo.jpg'); |
|---|
| 288 | define('HOTSPOT_LOGO_BANNER_NAME', 'hotspot_logo_banner.jpg'); |
|---|
| 289 | |
|---|
| 290 | /* Path for files in LOCAL_CONTENT_REL_PATH/common/ */ |
|---|
| 291 | define('NETWORK_LOGO_NAME', 'network_logo.png'); |
|---|
| 292 | define('NETWORK_LOGO_BANNER_NAME', 'network_logo_banner.png'); |
|---|
| 293 | define('WIFIDOG_LOGO_NAME', 'wifidog_logo_banner.png'); |
|---|
| 294 | define('WIFIDOG_LOGO_BANNER_NAME', 'wifidog_logo_banner.png'); |
|---|
| 295 | |
|---|
| 296 | define('DEFAULT_NODE_ID', 'default'); |
|---|
| 297 | define('DEFAULT_LANG', 'fr'); |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | } |
|---|
| 301 | ?> |
|---|