/labs/tiles/12 | /labs/tiles/12 |
/labs/tiles/13 | /labs/tiles/13 |
/labs/tiles/14 | /labs/tiles/14 |
/labs/tiles/15 | /labs/tiles/15 |
/labs/tiles/16 | /labs/tiles/16 |
/labs/tiles/17 | /labs/tiles/17 |
/labs/tiles/19 | /labs/tiles/19 |
/nbproject/private/ |
cp /root/aws.php /tmp/ | cp /root/aws.php /tmp/ |
chmod 777 /var/cache/lighttpd/compress/ | |
mkdir /var/www/lib/staticmaplite/cache | mkdir /var/www/lib/staticmaplite/cache |
chcon -h system_u:object_r:httpd_sys_content_t /var/www | chcon -h system_u:object_r:httpd_sys_content_t /var/www |
chcon -R -h root:object_r:httpd_sys_content_t /var/www/* | chcon -R -h root:object_r:httpd_sys_content_t /var/www/* |
chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache | chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache |
chmod -R 777 /var/www/lib/staticmaplite/cache | chmod -R 777 /var/www/lib/staticmaplite/cache |
chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles | chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles |
chmod -R 777 /var/www/labs/tiles | chmod -R 777 /var/www/labs/tiles |
mkdir /var/www/lib/openid-php/oid_store | |
chcon -R -t httpd_sys_content_rw_t /var/www/lib/openid-php/oid_store | chcon -R -t httpd_sys_content_rw_t /var/www/lib/openid-php/oid_store |
chmod -R 777 /var/www/lib/openid-php/oid_store | chmod -R 777 /var/www/lib/openid-php/oid_store |
wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ | wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ |
-O /var/www/cbrfeed.zip | -O /var/www/cbrfeed.zip |
<?php | <?php |
require $basePath.'lib/openid.php'; | |
$openid = new LightOpenID($_SERVER['HTTP_HOST']); | |
function login() | |
{ | |
global $openid; | |
if(!$openid->mode) { | |
$openid->required = array('contact/email'); | |
$openid->identity = 'https://www.google.com/accounts/o8/id'; | |
header('Location: ' . $openid->authUrl()); | |
} | |
} | |
/* | |
* Copyright 2010,2011 Alexander Sadleir | |
Licensed under the Apache License, Version 2.0 (the "License"); | function auth() |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | { |
if ($_SESSION['authed'] == true) return true; | |
Unless required by applicable law or agreed to in writing, software | global $openid; |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | if($openid->mode) { |
See the License for the specific language governing permissions and | $attr = $openid->getAttributes(); |
limitations under the License. | if ($attr["contact/email"] != "maxious@gmail.com") { |
*/ | |
function getScheme() { | |
$scheme = 'http'; | |
if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { | |
$scheme .= 's'; | |
} | |
return $scheme; | |
} | |
function getTrustRoot() { | |
return sprintf("%s://%s:%s%s/", getScheme(), $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); | |
} | |
// Includes required files | |
set_include_path(get_include_path() . PATH_SEPARATOR . $basePath . "lib/openid-php/"); | |
require_once "Auth/OpenID/Consumer.php"; | |
require_once "Auth/OpenID/FileStore.php"; | |
require_once "Auth/OpenID/AX.php"; | |
function login() { | |
global $basePath; | |
// Just tested this with/for Google, needs trying with others ... | |
$oid_identifier = 'https://www.google.com/accounts/o8/id'; | |
// Create file storage area for OpenID data | |
$store = new Auth_OpenID_FileStore(realpath($basePath) . '/lib/openid-php/oid_store'); | |
// Create OpenID consumer | |
$consumer = new Auth_OpenID_Consumer($store); | |
// Create an authentication request to the OpenID provider | |
$auth = $consumer->begin($oid_identifier); | |
// Create attribute request object | |
// See http://code.google.com/apis/accounts/docs/OpenID.html#Parameters for parameters | |
// Usage: make($type_uri, $count=1, $required=false, $alias=null) | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/contact/email', 2, 1, 'email'); | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/first', 1, 1, 'firstname'); | |
$attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/last', 1, 1, 'lastname'); | |
// Create AX fetch request | |
$ax = new Auth_OpenID_AX_FetchRequest; | |
// Add attributes to AX fetch request | |
foreach ($attribute as $attr) { | |
$ax->add($attr); | |
} | |
// Add AX fetch request to authentication request | |
$auth->addExtension($ax); | |
$_SESSION['returnURL'] = curPageURL(); | |
// Redirect to OpenID provider for authentication | |
$url = $auth->redirectURL(getTrustRoot(), $_SESSION['returnURL']); | |
header('Location: ' . $url); | |
} | |
function auth() { | |
global $basePath; | |
if ($_SESSION['authed'] == true) | |
return true; | |
// Create file storage area for OpenID data | |
$store = new Auth_OpenID_FileStore(realpath($basePath) . '/lib/openid-php/oid_store'); | |
// Create OpenID consumer | |
$consumer = new Auth_OpenID_Consumer($store); | |
// Create an authentication request to the OpenID provider | |
$response = $consumer->complete($_SESSION['returnURL']); | |
if ($response->status == Auth_OpenID_SUCCESS) { | |
// Get registration informations | |
$ax = new Auth_OpenID_AX_FetchResponse(); | |
$obj = $ax->fromSuccessResponse($response); | |
$email = $obj->data['http://axschema.org/contact/email'][0]; | |
var_dump($email); | |
if ($email != "maxious@gmail.com") { | |
die("Access Denied"); | die("Access Denied"); |
} else { | |
$_SESSION['authed'] = true; | |
} | |
} else { | } else { |
$_SESSION['authed'] = true; | |
} | |
} else { | |
login(); | login(); |
} | } |
} | } |
if ($_REQUEST['janrain_nonce']) | |
auth(); | |
?> | ?> |
<?php | <?php |
/* | /* |
* Copyright 2010,2011 Alexander Sadleir | * Copyright 2010,2011 Alexander Sadleir |
Licensed under the Apache License, Version 2.0 (the "License"); | Licensed under the Apache License, Version 2.0 (the "License"); |
you may not use this file except in compliance with the License. | you may not use this file except in compliance with the License. |
You may obtain a copy of the License at | You may obtain a copy of the License at |
http://www.apache.org/licenses/LICENSE-2.0 | http://www.apache.org/licenses/LICENSE-2.0 |
Unless required by applicable law or agreed to in writing, software | Unless required by applicable law or agreed to in writing, software |
distributed under the License is distributed on an "AS IS" BASIS, | distributed under the License is distributed on an "AS IS" BASIS, |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
See the License for the specific language governing permissions and | See the License for the specific language governing permissions and |
limitations under the License. | limitations under the License. |
*/ | */ |
if (isset($_REQUEST['firstLetter'])) { | if (isset($_REQUEST['firstLetter'])) { |
$firstLetter = filter_var($_REQUEST['firstLetter'], FILTER_SANITIZE_STRING); | $firstLetter = filter_var($_REQUEST['firstLetter'], FILTER_SANITIZE_STRING); |
} | } |
if (isset($_REQUEST['bysuburbs'])) { | if (isset($_REQUEST['bysuburbs'])) { |
$bysuburbs = true; | $bysuburbs = true; |
} | } |
if (isset($_REQUEST['bynumber'])) { | if (isset($_REQUEST['bynumber'])) { |
$bynumber = true; | $bynumber = true; |
} | } |
if (isset($_REQUEST['allstops'])) { | if (isset($_REQUEST['allstops'])) { |
$allstops = true; | $allstops = true; |
} | } |
if (isset($_REQUEST['nearby'])) { | if (isset($_REQUEST['nearby'])) { |
$nearby = true; | $nearby = true; |
} | } |
if (isset($_REQUEST['suburb'])) { | if (isset($_REQUEST['suburb'])) { |
$suburb = $_REQUEST['suburb']; | $suburb = $_REQUEST['suburb']; |
} | } |
$pageKey = filter_var($_REQUEST['pageKey'], FILTER_SANITIZE_NUMBER_INT); | if (isset($_REQUEST['pageKey'])) { |
$lat = filter_var($_REQUEST['lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); | $pageKey = filter_var($_REQUEST['pageKey'], FILTER_SANITIZE_NUMBER_INT); |
$lon = filter_var($_REQUEST['lon'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); | } |
$max_distance = filter_var($_REQUEST['radius'], FILTER_SANITIZE_NUMBER_INT); | if (isset($_REQUEST['lat'])) { |
$lat = filter_var($_REQUEST['lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); | |
} | |
if (isset($_REQUEST['lon'])) { | |
$lon = filter_var($_REQUEST['lon'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); | |
} | |
if (isset($_REQUEST['radius'])) { | |
$max_distance = filter_var($_REQUEST['radius'], FILTER_SANITIZE_NUMBER_INT); | |
} | |
if (isset($_REQUEST['numberSeries'])) { | if (isset($_REQUEST['numberSeries'])) { |
$numberSeries = filter_var($_REQUEST['numberSeries'], FILTER_SANITIZE_NUMBER_INT); | $numberSeries = filter_var($_REQUEST['numberSeries'], FILTER_SANITIZE_NUMBER_INT); |
} | } |
if (isset($_REQUEST['routeDestination'])) { | if (isset($_REQUEST['routeDestination'])) { |
$routeDestination = urldecode(filter_var($_REQUEST['routeDestination'], FILTER_SANITIZE_ENCODED)); | $routeDestination = urldecode(filter_var($_REQUEST['routeDestination'], FILTER_SANITIZE_ENCODED)); |
} | } |
if (isset($_REQUEST['stopcode'])) { | if (isset($_REQUEST['stopcode'])) { |
$stopcode = filter_var($_REQUEST['stopcode'], FILTER_SANITIZE_STRING); | $stopcode = filter_var($_REQUEST['stopcode'], FILTER_SANITIZE_STRING); |
} | } |
if (isset($_REQUEST['stopids'])) { | if (isset($_REQUEST['stopids'])) { |
$stopids = explode(",", filter_var($_REQUEST['stopids'], FILTER_SANITIZE_STRING)); | $stopids = explode(",", filter_var($_REQUEST['stopids'], FILTER_SANITIZE_STRING)); |
} | } |
if (isset($_REQUEST['tripid'])) { | if (isset($_REQUEST['tripid'])) { |
$tripid = filter_var($_REQUEST['tripid'], FILTER_SANITIZE_NUMBER_INT); | $tripid = filter_var($_REQUEST['tripid'], FILTER_SANITIZE_NUMBER_INT); |
} | } |
if (isset($_REQUEST['stopid'])) { | if (isset($_REQUEST['stopid'])) { |
$stopid = filter_var($_REQUEST['stopid'], FILTER_SANITIZE_NUMBER_INT); | $stopid = filter_var($_REQUEST['stopid'], FILTER_SANITIZE_NUMBER_INT); |
} | } |
if (isset($_REQUEST['routeid'])) { | if (isset($_REQUEST['routeid'])) { |
$routeid = filter_var($_REQUEST['routeid'], FILTER_SANITIZE_NUMBER_INT); | $routeid = filter_var($_REQUEST['routeid'], FILTER_SANITIZE_NUMBER_INT); |
} | } |
if (isset($_REQUEST['geolocate'])) { | if (isset($_REQUEST['geolocate'])) { |
$geolocate = filter_var($_REQUEST['geolocate'], FILTER_SANITIZE_URL); | $geolocate = filter_var($_REQUEST['geolocate'], FILTER_SANITIZE_URL); |
} | } |
?> | ?> |
<?php | <?php |
/* | /* |
* Copyright 2010,2011 Alexander Sadleir | * Copyright 2010,2011 Alexander Sadleir |
Licensed under the Apache License, Version 2.0 (the "License"); | Licensed under the Apache License, Version 2.0 (the "License"); |
you may not use this file except in compliance with the License. | you may not use this file except in compliance with the License. |
You may obtain a copy of the License at | You may obtain a copy of the License at |
http://www.apache.org/licenses/LICENSE-2.0 | http://www.apache.org/licenses/LICENSE-2.0 |
Unless required by applicable law or agreed to in writing, software | Unless required by applicable law or agreed to in writing, software |
distributed under the License is distributed on an "AS IS" BASIS, | distributed under the License is distributed on an "AS IS" BASIS, |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
See the License for the specific language governing permissions and | See the License for the specific language governing permissions and |
limitations under the License. | limitations under the License. |
*/ | */ |
// Copyright 2009 Google Inc. All Rights Reserved. | // Copyright 2009 Google Inc. All Rights Reserved. |
$GA_ACCOUNT = "MO-22173039-1"; | $GA_ACCOUNT = "MO-22173039-1"; |
$GA_PIXEL = "/lib/ga.php"; | $GA_PIXEL = "/lib/ga.php"; |
function googleAnalyticsGetImageUrl() { | function googleAnalyticsGetImageUrl() { |
global $GA_ACCOUNT, $GA_PIXEL; | global $GA_ACCOUNT, $GA_PIXEL; |
//if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; | //if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; |
$url = ""; | $url = ""; |
$url.= $GA_PIXEL . "?"; | $url.= $GA_PIXEL . "?"; |
$url.= "utmac=" . $GA_ACCOUNT; | $url.= "utmac=" . $GA_ACCOUNT; |
$url.= "&utmn=" . rand(0, 0x7fffffff); | $url.= "&utmn=" . rand(0, 0x7fffffff); |
$referer = $_SERVER["HTTP_REFERER"]; | $referer = $_SERVER["HTTP_REFERER"]; |
$query = $_SERVER["QUERY_STRING"]; | $query = $_SERVER["QUERY_STRING"]; |
$path = $_SERVER["REQUEST_URI"]; | $path = $_SERVER["REQUEST_URI"]; |
if (empty($referer)) { | if (empty($referer)) { |
$referer = "-"; | $referer = "-"; |
} | } |
$url.= "&utmr=" . urlencode($referer); | $url.= "&utmr=" . urlencode($referer); |
if (!empty($path)) { | if (!empty($path)) { |
$url.= "&utmp=" . urlencode($path); | $url.= "&utmp=" . urlencode($path); |
} | } |
$url.= "&guid=ON"; | $url.= "&guid=ON"; |
return str_replace("&", "&", $url); | return str_replace("&", "&", $url); |
} | } |
function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) { | function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) { |
global $basePath, $serviceAlertsEnabled; | global $basePath, $GTFSREnabled; |
echo ' | echo ' |
<!DOCTYPE html> | <!DOCTYPE html> |
<html lang="en"> | <html lang="en"> |
<head> | <head> |
<meta charset="UTF-8"> | <meta charset="UTF-8"> |
<meta name="viewport" content="width=device-width, initial-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1"> |
<title>' . $pageTitle . ' - Canberra Bus Timetable</title> | <title>' . $pageTitle . ' - Canberra Bus Timetable</title> |
<meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" /> | <meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" /> |
<link rel="dns-prefetch" href="//code.jquery.com"> | <link rel="dns-prefetch" href="//code.jquery.com"> |
<link rel="dns-prefetch" href="//ajax.googleapis.com"> | <link rel="dns-prefetch" href="//ajax.googleapis.com"> |
<link rel="stylesheet" href="' . $basePath . 'css/jquery-ui-1.8.12.custom.css" />'; | <link rel="stylesheet" href="' . $basePath . 'css/jquery-ui-1.8.12.custom.css" />'; |
if (isDebugServer()) { | if (isDebugServer()) { |
$jqmcss = $basePath . 'css/jquery.mobile-1.0b3.css'; | $jqmcss = $basePath . 'css/jquery.mobile-1.0b3.css'; |
$jqjs = $basePath . 'js/jquery- |