Permalink
Browse files

Updating to 2.1

  • Loading branch information...
justinanderson committed Oct 21, 2010
1 parent 1d4d4c2 commit 97707b40d46d73f379f2e74374cf86a381ffff78
Showing 726 changed files with 4,749 additions and 6,875 deletions.
View
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Massachusetts Institute of Technology
+Copyright (c) 2009 - 2010 Massachusetts Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -1,6 +1,6 @@
-MIT Mobile Web 2.0
+MIT Mobile Web 2.1
-This is the same as the MIT Mobile Web 2.0 code available at http://sourceforge.net/projects/mitmobileweb/, minus the mobile device detection server. That will have its own repository on GitHub.
+This is the MIT Mobile Web 2.1 code running on http://m.mit.edu/ as of February 2010, minus the mobile device detection server. That will have its own repository on GitHub.
The MIT Mobile Web is an open source project released under the MIT License, detailed in the file named LICENSE.
View
@@ -1,8 +0,0 @@
-<?php
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-header('Location: ./mobi-web/index.php');
-?>
File renamed without changes.
@@ -1,6 +1,7 @@
<?
+$docRoot = getenv("DOCUMENT_ROOT");
-require_once('config.php');
+require_once($docRoot . '/mobi-config/mobi_lib_config.php');
/*
* use this file for storing constants that are used in multiple files
@@ -11,8 +12,8 @@
// file/directory locations
if (version_compare(phpversion(), '5.3') == -1) {
- define("CACHE_DIR", '/var/lib/trunk/cache/');
- define("LIBDIR", '/var/lib/trunk/');
+ define("CACHE_DIR", '/var/www/html/mobi-lib/cache/');
+ define("LIBDIR", '/var/www/html/mobi-lib/');
} else {
define("CACHE_DIR", __DIR__ . '/cache/');
define("LIBDIR", __DIR__);
@@ -42,6 +43,7 @@ function debug($mesg) {
define("NEXTBUS_AGENCY", 'mit');
define("NEXTBUS_ROUTE_CACHE_TIMEOUT", 86400); // max age, routeConfig data
define("NEXTBUS_PREDICTION_CACHE_TIMEOUT", 20); // max age, predictions
+define("NEXTBUS_VEHICLE_CACHE_TIMEOUT", 10); // max age, vehicle locations
define("NEXTBUS_CACHE_MAX_TOLERANCE", 90); // when to revert to pub schedule
define("NEXTBUS_DAEMON_PID_FILE", CACHE_DIR . 'NEXTBUS_DAEMON_PID');
@@ -51,21 +53,35 @@ function debug($mesg) {
define("STELLAR_FEED_DIR", CACHE_DIR . 'STELLAR_FEEDS/'); // dir for cached rss data
define("STELLAR_FEED_CACHE_TIMEOUT", 10); // how long to keep cached rss files
define("STELLAR_SUBSCRIPTIONS_FILE", CACHE_DIR . 'STELLAR_SUBSCRIPTIONS');
+define("STELLAR_USE_PRODUCTION", True);
+if(STELLAR_USE_PRODUCTION) {
+ define("STELLAR_BASE_URL", "http://stellar.mit.edu/courseguide/course/");
+ define("STELLAR_RSS_URL", "http://stellar.mit.edu/SRSS/rss");
+} else {
+ define("STELLAR_BASE_URL", "http://stellar-dev.mit.edu/courseguide/course/");
+ define("STELLAR_RSS_URL", "http://stellar-dev.mit.edu/SRSS/rss");
+}
/* LIBRARIES */
define("ICS_CACHE_LIFESPAN", 900);
+// EMERGENCY
+define("EMERGENCY_USE_PRODUCTION", True);
+if(EMERGENCY_USE_PRODUCTION) {
+ define("EMERGENCY_RSS_URL", 'http://emergency.mit.net/emergency/mobirss');
+} else {
+ define("EMERGENCY_RSS_URL", 'http://emergency.mit.net/emtest/mobirss');
+}
+
+// 3DOWN
+define("THREEDOWN_RSS_URL", 'http://3down.mit.edu/3down/index.php?rss=1');
+
/*
// these aren't being used, just keeping a record of what may
// PEOPLE DIRECTORY
define("LDAP_SERVER", 'ldap.mit.edu');
-// EMERGENCY
-define("EMERGENCY_RSS_URL", 'http://emergency.mit.edu/emergency/rss.php');
-
-// 3DOWN
-define("THREEDOWN_RSS_URL", 'http://3down.mit.edu/3down/index.php?rss=1');
*/
@@ -1,7 +1,6 @@
<?
-$docRoot = getenv("DOCUMENT_ROOT");
-require_once $docRoot . "/mobi-config/mobi_lib_constants.php";
+require_once('config.php');
/*
* use this file for storing constants that are used in multiple files
@@ -1,53 +1,142 @@
-<?
-
-/*
- * DEVELOPER_EMAIL is a comma-separated string
- * of the people the server should email when something
- * goes wrong
- */
-define("DEVELOPER_EMAIL", "nobody@mit.edu");
-
-/*************** directory locations **************
- *
- * make sure there is a trailing slash at the end of
- * all the directory locations
- *
- *
- * LIBDIR is the location of required files
- * that are shared between the Mobile Web and
- * SMS services.
- */
-define("LIBDIR", '/var/lib/trunk/');
-
-/*
- * WEBROOT specifies the root directory of the Mobile Web
- * in relation to THIS COMPUTER.
- * on red hat machines this is usually somewhere in /var/www/
- */
-define("WEBROOT", '/var/www/html/');
-
-/*
- * HTTPROOT specifies the root directory of the Mobile Web
- * seen by BROWSER CLIENTS in relation to YOUR DOMAIN.
- * usually this is /
- * but if the website is hosted on (for example)
- * http://yourdomain.com/foo
- * then you should assign it to /foo/
- */
-define("HTTPROOT", '/');
-
-/*********** url locations ***************/
-
-/*
- * MOBI_SERVICE_URL is the URL that can be called via HTTP
- * with a user agent string to get information about
- * device characteristics
- */
-define("MOBI_SERVICE_URL", 'http://localhost/mobi-service/');
-
-// cookie expire times
-define("MODULE_ORDER_COOKIE_LIFESPAN", 160 * 86400);
-define("LAYOUT_COOKIE_LIFESPAN", 16 * 86400);
-define("CERTS_COOKIE_LIFESPAN", 86400);
-
-?>
+<?
+/*
+ * the prodction error handler has a pretty html page dispalying a brief error message
+ * it also emails detailed information to the developer email address
+ */
+define("USE_PRODUCTION_ERROR_HANDLER", True);
+
+/*
+ * DEVELOPER_EMAIL is a comma-separated string
+ * of the people the server should email when something
+ * goes wrong
+ */
+define("DEVELOPER_EMAIL", "nobody@mit.edu");
+
+/** log file locations
+ *
+ */
+define("API_LOG_FILE", "/usr/local/etc/was/logs/mobi_api_log");
+define("API_CURRENT_LOG_FILE", "/usr/local/etc/was/tmp/mobi_api_log");
+define("WEB_LOG_FILE", "/usr/local/etc/was/logs/mobi_web_log");
+define("WEB_CURRENT_LOG_FILE", "/usr/local/etc/was/tmp/mobi_web_log");
+define("LOG_DATE_FORMAT", '[D m d H:i:s Y]');
+define("LOG_DATE_PATTERN", '/^.{5}(\d{2}) (\d{2}).{10}(\d{4})/');
+
+/* mysql table names */
+define("PAGE_VIEWS_TABLE", 'mobi_web_page_views');
+define("API_STATS_TABLE", 'mobi_api_requests');
+
+/*************** LDAP server, filters and mappings **************
+ *
+ */
+define("LDAP_SERVER", "ldap-staging.mit.edu");
+define("SEARCH_TIMELIMIT", 30);
+define("READ_TIMELIMIT", 30);
+define("TELEPHONE_FILTER", "(telephonenumber=*%s*)");
+define("TELEPHONE_SEARCH_FILTER", "(&(objectClass=person)%s)");
+define("EMAIL_FILTER", "(mail=*%s*)");
+define("EMAIL_SEARCH_FILTER", "(&(objectClass=person)%s)");
+define("NAME_SINGLE_CHARACTER_FILTER", "(|(cn=%s*)(cn=* %s*)(cn=*-%s*))");
+define("NAME_MULTI_CHARACTER_FILTER", "(|(cn=*%s*)(mail=*%s*))");
+define("NAME_SEARCH_FILTER", "(&(objectClass=person)%s)");
+define("UID_FILTER", "(uid=%s)");
+define("UID_SEARCH_FILTER", "(&(objectClass=person)%s)");
+/* for the $personDisplayMapping array:
+ * index 0: display title,
+ * index 1: ldap attribute,
+ * index 2: href,
+ * index 3: class,
+ * index 4: set to TRUE if to be displayed on the mobile device, otherwise FALSE,
+ * index 5: group,
+ * index 6: has_link are for Touch,
+ * index 7: set to TRUE if needed for processing (non display), otherwise FALSE
+*/
+$appError = 0;
+$personDisplayMapping = array(array("surname", "sn", null, null, FALSE, FALSE, FALSE, TRUE),
+ array("givenname", "givenname", null, null, FALSE, FALSE, FALSE, TRUE),
+ array("name", "cn", null, null, TRUE, TRUE, FALSE, FALSE),
+ array("title", "title", null, null, TRUE, TRUE, FALSE, FALSE),
+ array("dept", "ou", null, null, TRUE, TRUE, FALSE, FALSE),
+ array("affiliation", "edupersonaffiliation", null, null, FALSE, FALSE, FALSE, FALSE),
+ array("address", "street", null, null, FALSE, FALSE, FALSE, FALSE),
+ array("homephone", "homephone", "phoneHREF", "phone", FALSE, TRUE, TRUE, FALSE),
+ array("room", "roomnumber", "mapURL", "map", FALSE, FALSE, TRUE, TRUE),
+ array("initials", "initials", null, null, FALSE, FALSE, TRUE, TRUE),
+ array("id", "uid", null, null, FALSE, FALSE, FALSE, TRUE),
+ array("phone", "telephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
+ array("fax", "facsimiletelephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
+ array("email", "mail", "mailHREF", "email", TRUE, FALSE, TRUE, FALSE),
+ array("office", "physicaldeliveryofficename", "mapURL", "map", TRUE, FALSE, TRUE, FALSE),
+ );
+
+/*************** exception loggin **************
+ *
+ */
+define("LOG_ALL_ERRORS", FALSE);
+define("LOG_PEOPLE_DIRECTORY_ERRORS", TRUE);
+define("ERROR_LOGFILE", "/usr/local/etc/was/logs/mobile_error_log");
+
+/*************** directory locations **************
+ *
+ * make sure there is a trailing slash at the end of
+ * all the directory locations
+ *
+ *
+ * LIBDIR is the location of required files
+ * that are shared between the Mobile Web and
+ * SMS services.
+ */
+define("LIBDIR", '/var/www/html/mobi-lib/');
+
+/*
+ * WEBROOT specifies the root directory of the Mobile Web
+ * in relation to THIS COMPUTER.
+ * on red hat machines this is usually somewhere in /var/www/
+ */
+define("WEBROOT", '/var/www/html/mobi-web/');
+
+/*
+ * HTTPROOT specifies the root directory of the Mobile Web
+ * seen by BROWSER CLIENTS in relation to YOUR DOMAIN.
+ * usually this is /
+ * but if the website is hosted on (for example)
+ * http://yourdomain.com/foo
+ * then you should assign it to /foo/
+ */
+define("HTTPROOT", '/');
+
+/*********** url locations ***************/
+
+/*
+ * MOBI_SERVICE_URL is the URL that can be called via HTTP
+ * with a user agent string to get information about
+ * device characteristics
+ */
+define("MOBI_SERVICE_URL", 'http://mobile-service-dev.mit.edu/mobi-service/');
+
+/* mqp searchserver */
+define("MAP_SEARCH_URL", 'http://whereis.mit.edu/search');
+
+/* news office */
+define("NEWSOFFICE_FEED_URL", 'http://web.mit.edu/newsoffice/feeds/iphone.php');
+
+// cookie expire times
+define("MODULE_ORDER_COOKIE_LIFESPAN", 160 * 86400);
+define("LAYOUT_COOKIE_LIFESPAN", 16 * 86400);
+define("CERTS_COOKIE_LIFESPAN", 86400);
+
+// show device detection info
+define("SHOW_DEVICE_DETECTION", False);
+
+/* Apple Push Notifications Service */
+// are these sensitive? (not sure)
+// Judged them as being non-sensitive since they can't be used without a valid certificate
+define("APNS_CERTIFICATE_DEV", '/usr/local/etc/was/certs/apns_dev.pem');
+define("APNS_CERTIFICATE_DEV_PASSWORD", '');
+define("APNS_CERTIFICATE_PROD", '/usr/local/etc/was/certs/apns_prod.pem');
+define("APNS_CERTIFICATE_PROD_PASSWORD", '');
+define("APNS_SANDBOX", True);
+define("APPLE_RELEASE_APP_ID", "edu.mit.mitmobile");
+define("APNS_CONNECTIONS_LIMIT", 100);
+
+?>
Oops, something went wrong.

0 comments on commit 97707b4

Please sign in to comment.