From: maxious Date: Tue, 22 Feb 2011 02:49:20 +0000 Subject: Add analytics X-Git-Url: https://maxious.lambdacomplex.org/git/?p=bus.git&a=commitdiff&h=f14b32c832da7346ef1103a9b6449c2daba0135f --- Add analytics --- --- a/busui/about.php +++ b/busui/about.php @@ -1,6 +1,6 @@

Busness Time - An ACT bus timetable webapp
--- a/busui/common.inc.php +++ b/busui/common.inc.php @@ -30,20 +30,26 @@ return $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || !$_SERVER['SERVER_NAME']; } +function isMetricsOn() +{ + return true; +} + function debug($msg) { if (isDebug()) echo ""; } function isFastDevice() { + $fastDevices = Array("Mozilla/5.0 (X11;", "Mozilla/5.0 (Windows;", "Mozilla/5.0 (iP", "Mozilla/5.0 (Linux; U; Android", "Mozilla/4.0 (compatible; MSIE"); + $slowDevices = Array("J2ME","MIDP","Opera/","Mozilla/2.0 (compatible;","Mozilla/3.0 (compatible;"); return true; } -function include_header($pageTitle, $opendiv = true, $geolocate = false) { +function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false) { echo ' - busness time - '.$pageTitle.' - '; + '.$pageTitle.''; if (isDebug()) echo ' '; @@ -104,19 +110,34 @@ "; } -echo ' - +echo ' + '; + if (isMetricsOn()) { + require_once('owa/owa_env.php'); + require_once(OWA_DIR.'owa_php.php'); + $owa = new owa_php(); + $owa->setSiteId('bus.lambdacomplex.org'); + $owa->setPageTitle($pageTitle); + $owa->setPageType($pageType); + $owa->trackPageView(); + $owa->placeHelperPageTags(); + } + if ($opendiv) { echo '

- +

'.$pageTitle.'

'; } } - function include_footer() { if ($geolocate && isset($_SESSION['lat'])) { --- a/busui/feedback.php +++ b/busui/feedback.php @@ -1,6 +1,6 @@

Add/Move/Delete a Bus Stop Location

StopID: --- a/busui/index.php +++ b/busui/index.php @@ -1,6 +1,6 @@
--- a/busui/layar_api.php +++ b/busui/layar_api.php @@ -4,16 +4,10 @@ $output['hotspots'] = Array(); $output['layer'] = "canberrabusstops"; +$max_page = 10; +$max_results = 50; $page_start = 0+$_REQUEST['pageKey']; -$page_end = 10+$_REQUEST['pageKey']; -$max_results = 50; -if ($page_end >= $max_results) { - $output["morePages"] = false; - $output["nextPageKey"] = null; -} else { - $output["morePages"] = true; - $output["nextPageKey"] = $page_end; -} +$page_end = $max_page+$_REQUEST['pageKey']; $url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=50"; $contents = json_decode(getPage($url)); @@ -22,7 +16,7 @@ foreach ($contents as $row) { $stopNum++; - if ($stopNum > $page_start && $stopNum < $page_end) { + if ($stopNum > $page_start && $stopNum <= $page_end) { $hotspot = Array(); $hotspot['id'] = $row[0]; $hotspot['title'] = $row[1]; @@ -31,7 +25,7 @@ $hotspot['lon'] = floor($row[3]*1000000); $hotspot['distance'] = distance($row[2], $row[3], $_REQUEST['lat'], $_REQUEST['lon']); if (!isset($_REQUEST['radius']) || $hotspot['distance'] < $_REQUEST['radius']) { - $hotspot['actions'] = Array(Array("label" => 'Visit Webpage', 'uri' => 'http://bus.lambdacomplex.org/'.'stop.php?stopid='.$row[0])); + $hotspot['actions'] = Array(Array("label" => 'View more trips/information', 'uri' => 'http://bus.lambdacomplex.org/'.'stop.php?stopid='.$row[0])); $url = $APIurl."/json/stoptrips?stop=".$row[0]."&time=".midnight_seconds()."&service_period=".service_period(); $trips = json_decode(getPage($url)); debug(print_r($trips,true)); @@ -53,5 +47,12 @@ $output['errorString'] = 'no results, try increasing range'; $output['errorCode'] = 21; } +if ($page_end >= $max_results || sizeof($hotspot) < $max_page) { + $output["morePages"] = false; + $output["nextPageKey"] = null; +} else { + $output["morePages"] = true; + $output["nextPageKey"] = $page_end; +} echo json_encode($output); ?> --- /dev/null +++ b/busui/owa/Callbacks.inc @@ -1,1 +1,10 @@ + --- /dev/null +++ b/busui/owa/action.php @@ -1,1 +1,48 @@ + + * @copyright Copyright © 2006 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision$ + * @since owa 1.0.0 + * @depricated + */ + +$owa = new owa_php; + +$owa->e->debug('Special action request received by action.php...'); + +if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) { + + // run controller or view and echo page content + echo $owa->handleRequestFromURL(); +} else { + // unload owa + $owa->restInPeace(); +} + +?> --- /dev/null +++ b/busui/owa/api.php @@ -1,1 +1,49 @@ + + * @copyright Copyright © 2010 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision$ + * @since owa 1.3.0 + * @link http://wiki.openwebanalytics.com/index.php?title=REST_API + */ + +// define entry point cnstant +define('OWA_API', true); +// invoke OWA +$owa = new owa_php; + +if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) { + + // run api command and echo page content + echo $owa->handleRequest('', 'base.apiRequest'); +} else { + // unload owa + $owa->restInPeace(); +} + +?> --- /dev/null +++ b/busui/owa/cli.php @@ -1,1 +1,92 @@ + + * @copyright Copyright © 2010 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision$ + * @since owa 1.2.1 + */ + +define('OWA_CLI', true); + +if (!empty($_POST)) { + exit(); +} elseif (!empty($_GET)) { + exit(); +} elseif (!empty($argv)) { + $params = array(); + // get params from the command line args + // $argv is a php super global variable + + for ($i=1; $iisEndpointEnabled( basename( __FILE__ ) ) ) { + + // setting CLI mode to true + $owa->setSetting('base', 'cli_mode', true); + // setting user auth + $owa->setCurrentUser('admin', 'cli-user'); + // run controller or view and echo page content + $s = owa_coreAPI::serviceSingleton(); + $s->loadCliCommands(); + + if (array_key_exists('cmd', $params)) { + + $cmd = $s->getCliCommandClass($params['cmd']); + + if ($cmd) { + $params['do'] = $cmd; + echo $owa->handleRequest($params); + } else { + echo "Invalid command name."; + } + + } else { + echo "Missing a command argument."; + } + +} else { + // unload owa + $owa->restInPeace(); +} + +?> --- /dev/null +++ b/busui/owa/conf/countryCodes2Names.php @@ -1,1 +1,253 @@ - + 'Afghanistan', + 'AX' => 'Åland Islands', + 'AL' => 'Albania', + 'DZ' => 'Algeria', + 'AS' => 'American Samoa', + 'AD' => 'Andorra', + 'AO' => 'Angola', + 'AI' => 'Anguilla', + 'AQ' => 'Antarctica', + 'AG' => 'Antigua and Barbuda', + 'AR' => 'Argentina', + 'AM' => 'Armenia', + 'AW' => 'Aruba', + 'AU' => 'Australia', + 'AT' => 'Austria', + 'AZ' => 'Azerbaijan', + 'BS' => 'Bahamas', + 'BH' => 'Bahrain', + 'BD' => 'Bangladesh', + 'BB' => 'Barbados', + 'BY' => 'Belarus', + 'BE' => 'Belgium', + 'BZ' => 'Belize', + 'BJ' => 'Benin', + 'BM' => 'Bermuda', + 'BT' => 'Bhutan', + 'BO' => 'Bolivia, Plurinational State of', + 'BA' => 'Bosnia and Herzegovina', + 'BW' => 'Botswana', + 'BV' => 'Bouvet Island', + 'BR' => 'Brazil', + 'IO' => 'British Indian Ocean Territory', + 'BN' => 'Brunei Darussalam', + 'BG' => 'Bulgaria', + 'BF' => 'Burkina Faso', + 'BI' => 'Burundi', + 'KH' => 'Cambodia', + 'CM' => 'Cameroon', + 'CA' => 'Canada', + 'CV' => 'Cape Verde', + 'KY' => 'Cayman Islands', + 'CF' => 'Central African Republic', + 'TD' => 'Chad', + 'CL' => 'Chile', + 'CN' => 'China', + 'CX' => 'Christmas Island', + 'CC' => 'Cocos (Keeling) Islands', + 'CO' => 'Colombia', + 'KM' => 'Comoros', + 'CG' => 'Congo', + 'CD' => 'Congo, the Democratic Republic of the', + 'CK' => 'Cook Islands', + 'CR' => 'Costa Rica', + 'CI' => "Côte d'Ivoire", + 'HR' => 'Croatia', + 'CU' => 'Cuba', + 'CY' => 'Cyprus', + 'CZ' => 'Czech Republic', + 'DK' => 'Denmark', + 'DJ' => 'Djibouti', + 'DM' => 'Dominica', + 'DO' => 'Dominican Republic', + 'EC' => 'Ecuador', + 'EG' => 'Egypt', + 'SV' => 'El Salvador', + 'GQ' => 'Equatorial Guinea', + 'ER' => 'Eritrea', + 'EE' => 'Estonia', + 'ET' => 'Ethiopia', + 'FK' => 'Falkland Islands (Malvinas)', + 'FO' => 'Faroe Islands', + 'FJ' => 'Fiji', + 'FI' => 'Finland', + 'FR' => 'France', + 'GF' => 'French Guiana', + 'PF' => 'French Polynesia', + 'TF' => 'French Southern Territories', + 'GA' => 'Gabon', + 'GM' => 'Gambia', + 'GE' => 'Georgia', + 'DE' => 'Germany', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GR' => 'Greece', + 'GL' => 'Greenland', + 'GD' => 'Grenada', + 'GP' => 'Guadeloupe', + 'GU' => 'Guam', + 'GT' => 'Guatemala', + 'GG' => 'Guernsey', + 'GN' => 'Guinea', + 'GW' => 'Guinea-Bissau', + 'GY' => 'Guyana', + 'HT' => 'Haiti', + 'HM' => 'Heard Island and McDonald Islands', + 'VA' => 'Holy See (Vatican City State)', + 'HN' => 'Honduras', + 'HK' => 'Hong Kong', + 'HU' => 'Hungary', + 'IS' => 'Iceland', + 'IN' => 'India', + 'ID' => 'Indonesia', + 'IR' => 'Iran, Islamic Republic of', + 'IQ' => 'Iraq', + 'IE' => 'Ireland', + 'IM' => 'Isle of Man', + 'IL' => 'Israel', + 'IT' => 'Italy', + 'JM' => 'Jamaica', + 'JP' => 'Japan', + 'JE' => 'Jersey', + 'JO' => 'Jordan', + 'KZ' => 'Kazakhstan', + 'KE' => 'Kenya', + 'KI' => 'Kiribati', + 'KP' => "Korea, Democratic People's Republic of", + 'KR' => 'Korea, Republic of', + 'KW' => 'Kuwait', + 'KG' => 'Kyrgyzstan', + 'LA' => "Lao People's Democratic Republic", + 'LV' => 'Latvia', + 'LB' => 'Lebanon', + 'LS' => 'Lesotho', + 'LR' => 'Liberia', + 'LY' => 'Libyan Arab Jamahiriya', + 'LI' => 'Liechtenstein', + 'LT' => 'Lithuania', + 'LU' => 'Luxembourg', + 'MO' => 'Macao', + 'MK' => 'Macedonia, the former Yugoslav Republic of', + 'MG' => 'Madagascar', + 'MW' => 'Malawi', + 'MY' => 'Malaysia', + 'MV' => 'Maldives', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MH' => 'Marshall Islands', + 'MQ' => 'Martinique', + 'MR' => 'Mauritania', + 'MU' => 'Mauritius', + 'YT' => 'Mayotte', + 'MX' => 'Mexico', + 'FM' => 'Micronesia, Federated States of', + 'MD' => 'Moldova, Republic of', + 'MC' => 'Monaco', + 'MN' => 'Mongolia', + 'ME' => 'Montenegro', + 'MS' => 'Montserrat', + 'MA' => 'Morocco', + 'MZ' => 'Mozambique', + 'MM' => 'Myanmar', + 'NA' => 'Namibia', + 'NR' => 'Nauru', + 'NP' => 'Nepal', + 'NL' => 'Netherlands', + 'AN' => 'Netherlands Antilles', + 'NC' => 'New Caledonia', + 'NZ' => 'New Zealand', + 'NI' => 'Nicaragua', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NU' => 'Niue', + 'NF' => 'Norfolk Island', + 'MP' => 'Northern Mariana Islands', + 'NO' => 'Norway', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PW' => 'Palau', + 'PS' => 'Palestinian Territory, Occupied', + 'PA' => 'Panama', + 'PG' => 'Papua New Guinea', + 'PY' => 'Paraguay', + 'PE' => 'Peru', + 'PH' => 'Philippines', + 'PN' => 'Pitcairn', + 'PL' => 'Poland', + 'PT' => 'Portugal', + 'PR' => 'Puerto Rico', + 'QA' => 'Qatar', + 'RE' => 'Réunion', + 'RO' => 'Romania', + 'RU' => 'Russian Federation', + 'RW' => 'Rwanda', + 'BL' => 'Saint Barthélemy', + 'SH' => 'Saint Helena', + 'KN' => 'Saint Kitts and Nevis', + 'LC' => 'Saint Lucia', + 'MF' => 'Saint Martin (French part)', + 'PM' => 'Saint Pierre and Miquelon', + 'VC' => 'Saint Vincent and the Grenadines', + 'WS' => 'Samoa', + 'SM' => 'San Marino', + 'ST' => 'Sao Tome and Principe', + 'SA' => 'Saudi Arabia', + 'SN' => 'Senegal', + 'RS' => 'Serbia', + 'SC' => 'Seychelles', + 'SL' => 'Sierra Leone', + 'SG' => 'Singapore', + 'SK' => 'Slovakia', + 'SI' => 'Slovenia', + 'SB' => 'Solomon Islands', + 'SO' => 'Somalia', + 'ZA' => 'South Africa', + 'GS' => 'South Georgia and the South Sandwich Islands', + 'ES' => 'Spain', + 'LK' => 'Sri Lanka', + 'SD' => 'Sudan', + 'SR' => 'Suriname', + 'SJ' => 'Svalbard and Jan Mayen', + 'SZ' => 'Swaziland', + 'SE' => 'Sweden', + 'CH' => 'Switzerland', + 'SY' => 'Syrian Arab Republic', + 'TW' => 'Taiwan, Province of China', + 'TJ' => 'Tajikistan', + 'TZ' => 'Tanzania, United Republic of', + 'TH' => 'Thailand', + 'TL' => 'Timor-Leste', + 'TG' => 'Togo', + 'TK' => 'Tokelau', + 'TO' => 'Tonga', + 'TT' => 'Trinidad and Tobago', + 'TN' => 'Tunisia', + 'TR' => 'Turkey', + 'TM' => 'Turkmenistan', + 'TC' => 'Turks and Caicos Islands', + 'TV' => 'Tuvalu', + 'UG' => 'Uganda', + 'UA' => 'Ukraine', + 'AE' => 'United Arab Emirates', + 'GB' => 'United Kingdom', + 'US' => 'United States', + 'UM' => 'United States Minor Outlying Islands', + 'UY' => 'Uruguay', + 'UZ' => 'Uzbekistan', + 'VU' => 'Vanuatu', + 'VE' => 'Venezuela, Bolivarian Republic of', + 'VN' => 'Viet Nam', + 'VG' => 'Virgin Islands, British', + 'VI' => 'Virgin Islands, U.S.', + 'WF' => 'Wallis and Futuna', + 'EH' => 'Western Sahara', + 'YE' => 'Yemen', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe' +); +?> --- /dev/null +++ b/busui/owa/conf/countryNames2Codes.php @@ -1,1 +1,250 @@ - + 'AF', + "Åland islands" => 'AX', + "albania" => 'AL', + "algeria" => 'DZ', + "american samoa" => 'AS', + "andorra" => 'AD', + "angola" => 'AO', + "anguilla" => 'AI', + "antarctica" => 'AQ', + "antigua and barbuda" => 'AG', + "argentina" => 'AR', + "armenia" => 'AM', + "aruba" => 'AW', + "australia" => 'AU', + "austria" => 'AT', + "azerbaijan" => 'AZ', + "bahamas" => 'BS', + "bahrain" => 'BH', + "bangladesh" => 'BD', + "barbados" => 'BB', + "belarus" => 'BY', + "belgium" => 'BE', + "belize" => 'BZ', + "benin" => 'BJ', + "bermuda" => 'BM', + "bhutan" => 'BT', + "bolivia, plurinational state of" => 'BO', + "bosnia and herzegovina" => 'BA', + "botswana" => 'BW', + "bouvet island" => 'BV', + "brazil" => 'BR', + "british indian ocean territory" => 'IO', + "brunei darussalam" => 'BN', + "bulgaria" => 'BG', + "burkina faso" => 'BF', + "burundi" => 'BI', + "cambodia" => 'KH', + "cameroon" => 'CM', + "canada" => 'CA', + "cape verde" => 'CV', + "cayman islands" => 'KY', + "central african republic" => 'CF', + "chad" => 'TD', + "chile" => 'CL', + "china" => 'CN', + "christmas island" => 'CX', + "cocos (keeling) islands" => 'CC', + "colombia" => 'CO', + "comoros" => 'KM', + "congo" => 'CG', + "congo, the democratic republic of the" => 'CD', + "cook islands" => 'CK', + "costa rica" => 'CR', + "côte d'ivoire" => 'CI', + "croatia" => 'HR', + "cuba" => 'CU', + "cyprus" => 'CY', + "czech republic" => 'CZ', + "denmark" => 'DK', + "djibouti" => 'DJ', + "dominica" => 'DM', + "dominican republic" => 'DO', + "ecuador" => 'EC', + "egypt" => 'EG', + "el salvador" => 'SV', + "equatorial guinea" => 'GQ', + "eritrea" => 'ER', + "estonia" => 'EE', + "ethiopia" => 'ET', + "falkland islands (malvinas)" => 'FK', + "faroe islands" => 'FO', + "fiji" => 'FJ', + "finland" => 'FI', + "france" => 'FR', + "french guiana" => 'GF', + "french polynesia" => 'PF', + "french southern territories" => 'TF', + "gabon" => 'GA', + "gambia" => 'GM', + "georgia" => 'GE', + "germany" => 'DE', + "ghana" => 'GH', + "gibraltar" => 'GI', + "greece" => 'GR', + "greenland" => 'GL', + "grenada" => 'GD', + "guadeloupe" => 'GP', + "guam" => 'GU', + "guatemala" => 'GT', + "guernsey" => 'GG', + "guinea" => 'GN', + "guinea-bissau" => 'GW', + "guyana" => 'GY', + "haiti" => 'HT', + "heard island and mcdonald islands" => 'HM', + "holy see (vatican city state)" => 'VA', + "honduras" => 'HN', + "hong kong" => 'HK', + "hungary" => 'HU', + "iceland" => 'IS', + "india" => 'IN', + "indonesia" => 'ID', + "iran, islamic republic of" => 'IR', + "iraq" => 'IQ', + "ireland" => 'IE', + "isle of man" => 'IM', + "israel" => 'IL', + "italy" => 'IT', + "jamaica" => 'JM', + "japan" => 'JP', + "jersey" => 'JE', + "jordan" => 'JO', + "kazakhstan" => 'KZ', + "kenya" => 'KE', + "kiribati" => 'KI', + "korea, democratic people's republic of" => 'KP', + "korea, republic of" => 'KR', + "kuwait" => 'KW', + "kyrgyzstan" => 'KG', + "lao people's democratic republic" => 'LA', + "latvia" => 'LV', + "lebanon" => 'LB', + "lesotho" => 'LS', + "liberia" => 'LR', + "libyan arab jamahiriya" => 'LY', + "liechtenstein" => 'LI', + "lithuania" => 'LT', + "luxembourg" => 'LU', + "macao" => 'MO', + "macedonia, the former yugoslav republic of" => 'MK', + "madagascar" => 'MG', + "malawi" => 'MW', + "malaysia" => 'MY', + "maldives" => 'MV', + "mali" => 'ML', + "malta" => 'MT', + "marshall islands" => 'MH', + "martinique" => 'MQ', + "mauritania" => 'MR', + "mauritius" => 'MU', + "mayotte" => 'YT', + "mexico" => 'MX', + "micronesia, federated states of" => 'FM', + "moldova, republic of" => 'MD', + "monaco" => 'MC', + "mongolia" => 'MN', + "montenegro" => 'ME', + "montserrat" => 'MS', + "morocco" => 'MA', + "mozambique" => 'MZ', + "myanmar" => 'MM', + "namibia" => 'NA', + "nauru" => 'NR', + "nepal" => 'NP', + "netherlands" => 'NL', + "netherlands antilles" => 'AN', + "new caledonia" => 'NC', + "new zealand" => 'NZ', + "nicaragua" => 'NI', + "niger" => 'NE', + "nigeria" => 'NG', + "niue" => 'NU', + "norfolk island" => 'NF', + "northern mariana islands" => 'MP', + "norway" => 'NO', + "oman" => 'OM', + "pakistan" => 'PK', + "palau" => 'PW', + "palestinian territory, occupied" => 'PS', + "panama" => 'PA', + "papua new guinea" => 'PG', + "paraguay" => 'PY', + "peru" => 'PE', + "philippines" => 'PH', + "pitcairn" => 'PN', + "poland" => 'PL', + "portugal" => 'PT', + "puerto rico" => 'PR', + "qatar" => 'QA', + "réunion" => 'RE', + "romania" => 'RO', + "russian federation" => 'RU', + "rwanda" => 'RW', + "saint barthélemy" => 'BL', + "saint helena" => 'SH', + "saint kitts and nevis" => 'KN', + "saint lucia" => 'LC', + "saint martin (french part)" => 'MF', + "saint pierre and miquelon" => 'PM', + "saint vincent and the grenadines" => 'VC', + "samoa" => 'WS', + "san marino" => 'SM', + "sao tome and principe" => 'ST', + "saudi arabia" => 'SA', + "senegal" => 'SN', + "serbia" => 'RS', + "seychelles" => 'SC', + "sierra leone" => 'SL', + "singapore" => 'SG', + "slovakia" => 'SK', + "slovenia" => 'SI', + "solomon islands" => 'SB', + "somalia" => 'SO', + "south africa" => 'ZA', + "south georgia and the south sandwich islands" => 'GS', + "spain" => 'ES', + "sri lanka" => 'LK', + "sudan" => 'SD', + "suriname" => 'SR', + "svalbard and jan mayen" => 'SJ', + "swaziland" => 'SZ', + "sweden" => 'SE', + "switzerland" => 'CH', + "syrian arab republic" => 'SY', + "taiwan, province of china" => 'TW', + "tajikistan" => 'TJ', + "tanzania, united republic of" => 'TZ', + "thailand" => 'TH', + "timor-leste" => 'TL', + "togo" => 'TG', + "tokelau" => 'TK', + "tonga" => 'TO', + "trinidad and tobago" => 'TT', + "tunisia" => 'TN', + "turkey" => 'TR', + "turkmenistan" => 'TM', + "turks and caicos islands" => 'TC', + "tuvalu" => 'TV', + "uganda" => 'UG', + "ukraine" => 'UA', + "united arab emirates" => 'AE', + "united kingdom" => 'GB', + "united states" => 'US', + "united states minor outlying islands" => 'UM', + "uruguay" => 'UY', + "uzbekistan" => 'UZ', + "vanuatu" => 'VU', + "venezuela, bolivarian republic of" => 'VE', + "viet nam" => 'VN', + "virgin islands, british" => 'VG', + "virgin islands, u.s." => 'VI', + "wallis and futuna" => 'WF', + "western sahara" => 'EH', + "yemen" => 'YE', + "zambia" => 'ZM', + "zimbabwe" => 'ZW', +); +?> --- /dev/null +++ b/busui/owa/conf/index.php @@ -1,1 +1,3 @@ - + --- /dev/null +++ b/busui/owa/conf/messages.php @@ -1,1 +1,100 @@ - + + * @copyright Copyright © 2006 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision: 1051 $ + * @since owa 1.0.0 + */ + +$_owa_messages = array( + +2000 => array("An e-mail containing instructions on how to complete the password reset process has been sent to %s",1), +2001 => array("The e-mail %s was not found in our database. Please check the address and try again.",1), +2002 => array("Login Failed. Your user name or password did not match.",0), +2003 => array("Your Account lacks the necessary privileges to access the requested resource.",0), +2004 => array("You must login to access the requested resource.",0), +2010 => array("Success. Logout Complete.",0), +2011 => array("Error. Can't find your temporary passkey in the db.",0), + +// Options/Configuration related +2500 => array("Options Saved.",0), +2501 => array("The module was activated successfully.",0), +2502 => array("The module was deactivated successfully.",0), +2503 => array("Options reset to Default Values.",0), +2504 => array("Entity %s Schema Created.",1), +2504 => array("Goal Saved.",0), + + +//User managment +3000 => array("Success. User Added.", 0), +3001 => array("Error. That user name is already taken.",0), +3002 => array("The form data that you entered contained one or more errors. Please check the data and submit the from again."), +3003 => array("Success. User profile saved.",0), +3004 => array("Success. User acount deleted."), +3005 => array("Enter Your New Password", 0), +3006 => array("Success. Please login with your new password.",0), +3007 => array("Error. Your passwords must match.",0), +3008 => array("Error. Your password must be %s characters long.", 1), +3009 => array("Error. A user with that email address already exists.", 0), +3010 => array("A user with that email address does not exist.", 0), +3011 => array("Could not update user profile."), +3012 => array("Could not connect the database. Check your settings and try again.",0), + +//sites management +3200 => array("Error. Please fill in all required fields.",0), +3201 => array("Success. Site Profile Updated.",0), +3202 => array("Success. Site Added.",0), +3203 => array("Error. Site Could not be added",0), +3204 => array("Success. Site Deleted.",0), +3206 => array("Error. A site with that domain already exists.",0), +3207 => array("Error. You must enter a domain when adding a web site.",0), +3208 => array("Error. That site does not exist.",0), +3208 => array("Please remove the http:// from your beginning of your domain.",0), + + +//install +3300 => array("Could not connect to the database. Please check the database connection settings in your configuration file and try again.",0), +3301 => array("This version of OWA requires PHP 5.2.x or higher.",0), +3302 => array("Database Schema Installation failed. Please check the error log file for more details.",0), +3303 => array("Success. Default Site Added.",0), +3304 => array("Success. Admin User Added.",0), +3305 => array("Success. Base Database Schema Installed.",0), +3306 => array("Error. User id already exists for some reason.",0), +3307 => array("Updates failed. Check OWA's error log file for more details and try again.",0), +3308 => array("Success. Updates were applied.",0), +3309 => array("Site Domain is required.",0), +3310 => array("E-mail Address is required.",0), +3311 => array("These updates must be applied using the command line interface (CLI). Run '/path/to/php cli.php cmd=update' from your server's command shell to apply these updates. For more information on updating see the install/update page on the wiki.",0), +// Graph related +3500 => array("There is no data for\nthis time period.",0), + +// Report Related +3600 => array("Unknown",0) + +); + + +?> --- /dev/null +++ b/busui/owa/conf/os.ini @@ -1,1 +1,73 @@ +;;; Operating Systems +[info] +name="2006-03-30" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Windows + +[Win.*NT 5.1] +name="Windows XP" + +[Win.*NT 5\.0] +name="Windows 2000" + +[Win.*(Vista|XP|2000|ME|NT|9.?)] +name="Windows $1" + +[Windows .*(3\.11|NT)] +name="Windows $1" + +[Win32] +name="Windows [prior to 1995" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UNIX + +[Linux 2\.(.?)\.] +name="Linux 2.$1.x" + +[Linux] +name="Linux [unknown version]" + +[FreeBSD .*-CURRENT$] +name="FreeBSD -CURRENT" + +[FreeBSD (.?)\.] +name="FreeBSD $1.x" + +[NetBSD 1\.(.?)\.] +name="NetBSD 1.$1.x" + +[(Free|Net|Open)BSD] +name="$1BSD [unknown]" + +[HP-UX B\.(10|11)\.] +name="HP-UX B.$1.x" + +[IRIX(64)? 6\.] +name="IRIX 6.x" + +[SunOS 4\.1] +name="SunOS 4.1.x" + +[SunOS 5\.([4-6])] +name="Solaris 2.$1.x" + +[SunOS 5\.([78])] +name="Solaris $1.x" + +[X11] +name="UNIX [unknown]" + +[Unix] +name="UNIX [unknown]" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Macintosh + +[Mac_PowerPC] +name="Mac OS [PowerPC]" + +[Mac OS X] +name="Mac OS X" + +[*] +name="Unknown OS" --- /dev/null +++ b/busui/owa/conf/query_strings.ini @@ -1,1 +1,29 @@ - +[\?(?:.+&|)q=(.+?)(?:&|$)] +[search\?(?:.+&|)p=(.+?)(?:&|$)] +[\?(?:.+&|)Keywords=(.+?)(?:&|$)] +[\?(?:.+&|)MT=(.+?)(?:&|$)] +[\?(?:.+&|)Q=(.+?)(?:&|$)] +[\?(?:.+&|)QUERY=(.+?)(?:&|$)] +[\?(?:.+&|)Suchwort=(.+?)(?:&|$)] +[\?(?:.+&|)ask=(.+?)(?:&|$)] +[\?(?:.+&|)eingabe=(.+?)(?:&|$)] +[\?(?:.+&|)in=(.+?)(?:&|$)] +[\?(?:.+&|)keyword=(.+?)(?:&|$)] +[\?(?:.+&|)keywords=(.+?)(?:&|$)] +[\?(?:.+&|)kw=(.+?)(?:&|$)] +[\?(?:.+&|)mots=(.+?)(?:&|$)] +[\?(?:.+&|)motscles=(.+?)(?:&|$)] +[\?(?:.+&|)query=(.+?)(?:&|$)] +[\?(?:.+&|)query2=(.+?)(?:&|$)] +[\?(?:.+&|)queryterm=(.+?)(?:&|$)] +[\?(?:.+&|)sTerm=(.+?)(?:&|$)] +[\?(?:.+&|)sc=(.+?)(?:&|$)] +[\?(?:.+&|)search=(.+?)(?:&|$)] +[\?(?:.+&|)search2=(.+?)(?:&|$)] +[\?(?:.+&|)searchfor=(.+?)(?:&|$)] +[\?(?:.+&|)searchText=(.+?)(?:&|$)] +[\?(?:.+&|)srch=(.+?)(?:&|$)] +[\?(?:.+&|)su=(.+?)(?:&|$)] +[\?(?:.+&|)such=(.+?)(?:&|$)] +[\?(?:.+&|)suche=(.+?)(?:&|$)] +[\?(?:.+&|)szukaj=(.+?)(?:&|$)] --- /dev/null +++ b/busui/owa/conf/robots.ini @@ -1,1 +1,14 @@ - +#bot# +#crawl# +#spider# +#curl# +#host# +#localhost# +#java# +#libcurl# +#libwww# +#lwp# +#perl# +#php# +#wget# +#search# --- /dev/null +++ b/busui/owa/conf/search_engines.ini @@ -1,1 +1,418 @@ +;;; Search Engines + +[info] +name="2006-02-22" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Google +[Google] +name="Google" + +[google\.co\.uk/custom\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[groups\.google\.(?:com|fr)/groups\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[go(?:[ogle]{4})\.[a-z.]+(?::80|)/(?:search|linux|de|ie|url|custom|cobrand|bsd|mac|netscape|uk|redhat|webhp)\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[google\.com/u/[A-Za-z0-9]*\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[images\.google\.[a-z]*/imgres\?(?:.+&|)imgurl=(.+?)(?:&|$)] +parent=Google + +[images\.google\.[a-z]*/images\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[google\.netscape\.com/(?:netscape|search)\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[216\.239\.[0-9]+\.100/search\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[free\.fr/google\.pl\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Google + +[google\.com/search\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Google + +[google\.netscape\.com/netscape\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Google + +[google\.com/netscape\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Google + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OVERTURE + +[Overture] +name="Overture" + +[overture\.com/d/search[^?]*\?(?:.+&|)Keywords=(.+?)(?:&|$)] +parent=Overture + +[search\.as\.orientation\.com/cgi-bin/gotosearch\.cgi\?(?:.+&|)Keywords=(.+?)(?:&|$)] +parent=Overture + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HOTBOT + +[Hotbot] +name="HotBot" + +[hotbot\?(?:.+&|)MT=(.+?)(?:&|$)] +parent=Hotbot + +[hotbot\.lycos\.com/?\?(?:.+&|)MT=(.+?)(?:&|$)] +parent=Hotbot + +[hotbot\.lycos\.com\/text/default\.asp\?(?:.+&|)MT=(.+?)(?:&|$)] +parent=Hotbot + +[hotbot\.lycos\.com/director\.asp\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Hotbot + +[hotbot\.lycos\.com/include/nc_frameset_ink_highend\.asp\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Hotbot + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MSN + +[MSN] +name="MSN search" + +[search\..*msn\..+/spbasic\.htm\?(?:.+&|)MT=(.+?)(?:&|$)] +parent=MSN + +[search\..*msn\..+/(?:sp)?results\.asp\?(?:.+&|)MT=(.+?)(?:&|$)] +parent=MSN + +[search\.[a-z.]*msn\.[a-z.]+/(?:sp)?(?:results\.asp|basic\.htm|results\.aspx)\?(?:.+&|)q=(.+?)(?:&|$)] +parent=MSN + +[search\.[a-z.]*msn\.[a-z.]+/autosearch/as_(?:pane)?results\.asp\?(?:.+&|)q=(.+?)(?:&|$)] +parent=MSN + +[msn\.[^/]+/[^?]+?default\.asp\?(?:.+&|)s=(.+?)(?:&|$)] +parent=MSN + +[encarta\.msn\.com/(?:encarta|find)/search\.asp\?(?:.+&|)search=(.+?)(?:&|$)] +name="MSN Encarta" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Random Engines + +[goo\.ne\.jp/[^?]+\.asp\?(?:.+&|)MT=(.+?)(?:&|$)] +name="Goo Japan" + +[search\.icq\.com/default\.asp\?(?:.+&|)MT=(.+?)(?:&|$)] +name="ICQ Directory" + +[nomade\.(?:tiscali\.)?fr/(?:ink|[_a-zA-Z0-9]*recherche[_a-zA-Z0-9]*)\.asp\?(?:.+&|)MT=(.+?)(?:&|$)] +name="Nomade" + +[yahoo\.co\.jp/bin/search\?(?:.+&|)p=(.+?)(?:&|$)] +name="Yahoo Japan" + +[metacrawler\.com(?:/crawler|)\?(?:.+&|)general=(.+?)(?:&|$)] +name="MetaCrawler" + +[chello\.[^/]+/utilities/search[^?]*\?(?:.+&|)keywords=(.+?)(?:&|$)] +name="Chello" + +[Voila] +name"Viola" + +[voila\.[^/]+/(?:S/)?(?:ns|www|msie_fr|quiquoiou|voilang|voila|search|wanadoo[a-z_]*|r?msie4[a-z_]*)\?(?:.+&|)kw=(.+?)(?:&|$)] +parent=Voila + +[voila\.fr/voila\?(?:.+&|)kw=(.+?)(?:&|$)] +parent=Voila + +[voila\.fr/(?:quiquoiou|voilang|voila|search|wanadoo[a-z_]*|r?msie4[a-z_]*)/?\?(?:.+&|)mots=(.+?)(?:&|$)] +parent=Voila + +[search\.ke\.wanadoo\.fr/S/wanadoo\?(?:.+&|)kw=(.+?)(?:&|$)] +name="Wanadoo.fr" + +[freshmeat\.net/search/?\?(?:.+&|)q=(.+?)(?:&|$)] +name="Freshmeat" + +[Vivisimo] +name="Vivisimo" + +[vivisimo.com/search\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Vivisimo + +[vivisimo\.com/cgi-bin/xml2html\.sh\?(?:.+&|)s=(.+?)(?:&|$)] +parent=Vivisimo + +[vivisimo\.com/cgi-bin/treeHtmlMain\?(?:.+&|)s=(.+?)(?:&|$)] +parent=Vivisimo + +[webcrawler.com/cgi-bin/WebQuery\?(?:.+&|)searchText=(.+?)(?:&|$)] +name="WebCrawler" + +[findology\.com/(?:ce/|)search\.pl\?(?:.+&|)search=(.+?)(?:&|$)] +name="Findology" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Search.com + +[Search.com] +name="Search.com" + +[search\.cnet\.com/Infoseek/\?(?:.+&|)QUERY=(.+?)(?:&|$)] +parent=Search.com + +[search\.com/Infoseek/\?(?:.+&|)QUERY=(.+?)(?:&|$)] +parent=Search.com + +[search\.com/search\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Search.com + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ask Jeeves + +[Ask_Jeeves] +name="Ask Jeeves" + + +[(?:askjeeves|aj|ask)\..+/main/meta[aA]nswer\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[(?:askjeeves|aj|ask)\..+/main/[aA]sk[jJ]eeves\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[(?:askjeeves|aj|ask)\..+/main/followup\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[(?:askjeeves|aj|ask)\..+/main/Links\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[(?:askjeeves|aj|ask)\..+/main/moreResults\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[tm\.ask\.com/r\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +[ask\.co\.uk/main/followup40\.asp\?(?:.+&|)ask=(.+?)(?:&|$)] +parent=Ask_Jeeves + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LookSmart + +[Looksmart] +name="Looksmart" + +[looksmart\.com\?(?:.+&|)key=(.+?)(?:&|$)] +parent=Looksmart + +[looksmart\.(?:co\.uk|com)/r_search\?(?:.+&|)key=(.+?)(?:&|$)] +parent=Looksmart + +[surfy\.com/cgi-bin/search\?(?:.+&|)key=(.+?)(?:&|$)] +parent=Looksmart + +[synd(?:-[a-z]+)?\.looksmart\.co\.uk/synd-[a-z]*/Search[a-z]*\.jsp\?(?:.+&|)key=(.+?)(?:&|$)] +parent=Looksmart + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Alltheweb + +[alltheweb\.(?:com|net)/search\?(?:.+&|)q=(.+?)(?:&|$)] +name="Alltheweb" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AltaVista + +[Altavista] +name="AltaVista" + +[altavista\.com/(?:query|q|)\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/iepane\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/sites/search/res_text\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/sites/listings/GT_av\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/web\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/iepane\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.com/sites/search/res_text\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Altavista + +[altavista\.digital\.com/sites/search/web\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Altavista + +[[-a-z]+\.altavista\.com/q\?(?:.+&|)what=(.+?)(?:&|$)] +parent=Altavista + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CompuServe + +[CompuServe] +name="Compuserve" + +[compuserve(?:office)*\.de/suche/suche\.jsp\?(?:.+&|)q=(.+?)(?:&|$)] +parent=CompuServe + +[cissearch\.compuserve\.com/search/cssearch/cssearch-(?:frameset|results)\.adp\?(?:.+&|)sTerm=(.+?)(?:&|$)] +parent=CompuServe + +[search\.cs\.com/search/cssearch/cssearch-frameset\.adp\?(?:.+&|)sTerm=(.+?)(?:&|$)] +parent=CompuServe + +[websearch\.cs\.com/cs/results/cssearch-(?:banner|frameset)\.adp\?(?:.+&|)sTerm=(.+?)(?:&|$)] +parent=CompuServe + +[websearch\.cs\.com/gateway/results/gateway-(?:cat|frameset|results|banner)\.adp\?(?:.+&|)sTerm=(.+?)(?:&|$)] +parent=CompuServe + +[search\.compuserve\.co\.uk/results\.adp\?(?:.+&|)query=(.+?)(?:&|$)] +parent=CompuServe + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dogpile + +[Dogpile] +name="Dogpile" + +[dogpile\.com/texis/search\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Dogpile + +[dogpile\.com/info.dogpl/search/web/(?:.+&|)] +parent=Dogpile + +[catalog\.dogpile\.com/texis/catalog\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Dogpile + +[catalog\.dogpile\.com/texis/redir/main\.bin\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Dogpile + +[opendir\.dogpile\.com/texis/dpdir/search\.html\?(?:.+&|)q=(.+?)(?:&|$)] +parent=Dogpile + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AOL + +[AOL] +name="AOL" + +[(?:search|suchen|recherche|aolrecherches)\.aol\.(?:co\.)?[a-z.]+/(?:search|minisearch|itemsearch|results|web|cat|dirsearch|advncd|redirect)(?:_[a-z]+)?\.adp\?(?:.+&|)query=(.+?)(?:&|$)] +parent=AOL + +[uk-nf01\.web\.aol\.com/cgi-bin/pursuit\?(?:.+&|)query=(.+?)(?:&|$)] +parent=AOL + +[americaonline\.com\.br/cgi-bin\?(?:.+&|)query=(.+?)(?:&|$)] +parent=AOL + +[shopping\.aol\.de/scripts/ao/results\.php\?(?:.+&|)query=(.+?)(?:&|$)] +parent=AOL + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LYCOS + +[Lycos] +name="Lycos" + +[(?:richmedia|multimedia|search)\.lycos\.com/default.asp\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[lycosuk\.co\.uk/cgi-bin/pursuit\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[lycos\.com(?:\.)*/srch(?:/setup\.html|/more\.html)*\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[search\.lycos\.com/main(?:/|/default.asp|)\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[lycos\.com/srch/\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[lycos\.com/srch/index\.html\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +[search\.lycos\.com/main\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Lycos + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAMA + +[Mamma] +name="Mamma" + +[mamma\.com/Mamma\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Mamma + +[mamma[0-9]+\.mamma\.com/Mamma\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Mamma + +[partners\.mamma\.com/(?:Altavista|Askjeeves1|Beaucoup|Botbot|Cb_12c4|HotSheet|Hotbar|Pages)\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Mamma + +[mamma\.com/Mamma_pictures\?(?:.+&|)query=(.+?)(?:&|$)] +parent=Mamma + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EXCITE + +[Excite] +name="Excite" + +[search\.excite\.com\?(?:.+&|)s=(.+?)(?:&|$)] +parent=Excite + +[excite\.[a-z.]+/search\search.dcg\?(?:.+&|)s=(.+?)(?:&|$)] +parent=Excite + +[\.excite(?:\.[a-z]+|)\.[a-z]+/[^?]+\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Excite + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; YAHOO + +[Yahoo] +name="Yahoo!" + +[de\.finance\.yahoo\.com/q\?(?:.+&|)s=(.+?)(?:&|$)] +parent=Yahoo + +[(?:[a-z]+\.)?search\.yahoo\.[^/]+/(?:[a-z]+/)?search/?[^?]*\?(?:.+&|)p=(.+?)(?:&|$)] +parent=Yahoo + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DMOZ + +[dmoz] +name="The Open Directory Project (DMOZ)" + +[search\.dmoz\.org\?(?:.+&|)search=(.+?)(?:&|$)] +parent=dmoz + +[directory\.wwwresources\.com/directory.cgi\?(?:.+&|)search2=(.+?)(?:&|$)] +parent=dmoz + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; NETSCAPE + +[Netscape] +name="Netscape" + +[(?:search|search-intl|directory)\.netscape\.com/(?:[a-z]*/)?google\.tmpl\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +[search\.netscape\.com/search.psp\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +[search\.netscape\.com\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +[directory\.netscape\.com/cgi-bin/search\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +[directory\.netscape\.com/search\.tmpl\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +[search-intl\.netscape\.com/(?:de|fr|uk)/search(?:[0-9]|)\.tmpl\?(?:.+&|)search=(.+?)(?:&|$)] +parent=Netscape + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Default + +;;; [*] +;;; name="Unknown Referer" --- /dev/null +++ b/busui/owa/daemon.php @@ -1,1 +1,53 @@ + + * @copyright Copyright © 2006-2011 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision$ + * @since owa 1.4.0 + */ +require_once('owa_env.php'); +require_once(OWA_DIR.'owa_php.php'); +require_once(OWA_BASE_CLASS_DIR.'daemon.php'); + +define('OWA_DAEMON', true); + +if (!empty($_POST)) { + exit(); +} elseif (!empty($_GET)) { + exit(); +} + +$owa = new owa_php(); + +if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) { + // start daemon + $daemon = new owa_daemon(); + $daemon->start(); + +} else { + // unload owa + $owa->restInPeace(); +} + +?> --- /dev/null +++ b/busui/owa/eventQueue.php @@ -1,1 +1,366 @@ - + + * @copyright Copyright © 2006 Peter Adams + * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 + * @category owa + * @package owa + * @version $Revision$ + * @since owa 1.0.0 + */ +class eventQueue { + + /** + * Stores listeners + * + */ + var $listeners = array(); + + /** + * Stores listener IDs by event type + * + */ + var $listenersByEventType = array(); + + /** + * Stores listener IDs by event type + * + */ + var $listenersByFilterType = array(); + + /** + * Constructor + * + */ + function __construct() { + + } + + /** + * Attach + * + * Attaches observers by event type. + * Takes a valid user defined callback function for use by PHP's call_user_func_array + * + * @param $event_name string + * @param $observer mixed can be a function name or function array + * @return bool + */ + + function attach($event_name, $observer) { + + $id = md5(microtime()); + + // Register event names for this handler + if(is_array($event_name)) { + + foreach ($event_name as $k => $name) { + + $this->listenersByEventType[$name][] = $id; + } + + } else { + + $this->listenersByEventType[$event_name][] = $id; + } + + $this->listeners[$id] = $observer; + + return true; + } + + /** + * Attach + * + * Attaches observers by filter type. + * Takes a valid user defined callback function for use by PHP's call_user_func_array + * + * @param $filter_name string + * @param $observer mixed can be a function name or function array + * @return bool + */ + + function attachFilter($filter_name, $observer, $priority = 10) { + + $id = md5(microtime()); + + $this->listenersByFilterType[$filter_name][$priority][] = $id; + + $this->listeners[$id] = $observer; + + } + + /** + * Notify + * + * Notifies all handlers of events in order that they were registered + * + * @param $event_type string + * @param $event array + * @return bool + */ + function notify($event) { + + $responses = array(); + owa_coreAPI::debug("Notifying listeners of ".$event->getEventType()); + //print_r($this->listenersByEventType[$event_type] ); + //print $event->getEventType(); + if (array_key_exists($event->getEventType(), $this->listenersByEventType)) { + $list = $this->listenersByEventType[$event->getEventType()]; + //print_r($list); + if (!empty($list)) { + foreach ($this->listenersByEventType[$event->getEventType()] as $k => $observer_id) { + //print_r($list); + $class = get_class( $this->listeners[$observer_id][0] ); + $responses[ $class ] = call_user_func_array($this->listeners[$observer_id], array($event)); + //owa_coreAPI::debug(print_r($event, true)); + owa_coreAPI::debug(sprintf("%s event handled by %s.",$event->getEventType(), get_class($this->listeners[$observer_id][0]))); + } + } + } else { + owa_coreAPI::debug("no listeners registered for this event type."); + } + + owa_coreAPI::debug('EHS: Responses - '.print_r($responses, true)); + + if ( in_array( OWA_EHS_EVENT_FAILED, $responses, true ) ) { + owa_coreAPI::debug("EHS: Event was not handled successfully by some handlers."); + //$q = $this->getAsyncEventQueue(owa_coreAPI::getSetting('base', 'event_queue_type')); + //$q->addToQueue($event); + return OWA_EHS_EVENT_FAILED; + } else { + owa_coreAPI::debug("EHS: Event was handled successfully by all handlers."); + return OWA_EHS_EVENT_HANDLED; + } + + } + + /** + * Notify Untill + * + * Notifies all handlers of events in order that they were registered + * Stops notifying after first handler returns true + * + * @param $event_type string + * @param $event array + * @return bool + */ + + function notifyUntill() { + owa_coreAPI::debug("Notifying Until listener for $event_type answers"); + } + + /** + * Filter + * + * Filters event by handlers in order that they were registered + * + * @param $filter_name string + * @param $value array + * @return $new_value mixed + */ + function filter($filter_name, $value = '') { + owa_coreAPI::debug("Filtering $filter_name"); + + if (array_key_exists($filter_name, $this->listenersByFilterType)) { + // sort the filter list by priority + ksort($this->listenersByFilterType[$filter_name]); + //get the function arguments + $args = func_get_args(); + // outer priority loop + foreach ($this->listenersByFilterType[$filter_name] as $priority) { + // inner filter class/function loop + foreach ($priority as $observer_id) { + // pass args to filter + owa_coreAPI::debug(sprintf("Filter: %s::%s. Value passed: %s", get_class($this->listeners[$observer_id][0]),$this->listeners[$observer_id][1], print_r($value, true))); + $value = call_user_func_array($this->listeners[$observer_id], array_slice($args,1)); + owa_coreAPI::debug(sprintf("Filter: %s::%s. Value returned: %s", get_class($this->listeners[$observer_id][0]),$this->listeners[$observer_id][1], print_r($value, true))); + // set filterred value as value in args for next filter + $args[1] = $value; + // debug whats going on + owa_coreAPI::debug(sprintf("%s filtered by %s.", $filter_name, get_class($this->listeners[$observer_id][0]))); + } + } + } + + return $value; + } + + /** + * Log + * + * Notifies handlers of tracking events + * Provides switch for async notification + * + * @param $event_params array + * @param $event_type string + */ + function log($event_params, $event_type = '') { + //owa_coreAPI::debug("Notifying listeners of tracking event type: $event_type"); + + if (!is_a($event_params,'owa_event')) { + $event = owa_coreAPI::supportClassFactory('base', 'event'); + $event->setProperties($event_params); + $event->setEventType($event_type); + } else { + $event = $event_params; + } + + $this->asyncNotify($event); + + } + + /** + * Async Notify + * + * Adds event to async notiication queue for notification by another process. + * + * @param $event array + * @return bool + */ + function asyncNotify($event) { + + // check config to see if async mode is enabled, if not fall back to realtime notification + if (owa_coreAPI::getSetting('base', 'queue_events')) { + owa_coreAPI::debug(sprintf("Adding event of %s to async %s queue.", $event->getEventType(), owa_coreAPI::getSetting('base', 'event_queue_type'))); + // check to see first if OWA is not already acting as a remote event queue, + // then check to see if we are configured to use a remote or local event queue + // then see if we have an endpoint + if (!owa_coreAPI::getSetting('base', 'is_remote_event_queue') && + owa_coreAPI::getSetting('base', 'use_remote_event_queue') && + owa_coreAPI::getSetting('base', 'remote_event_queue_type') && + owa_coreAPI::getSetting('base', 'remote_event_queue_endpoint')) { + // get a network queue + $q = $this->getAsyncEventQueue(owa_coreAPI::getSetting('base', 'remote_event_queue_type')); + // use a local event queue + } else { + // get a local event queue + $q = $this->getAsyncEventQueue(owa_coreAPI::getSetting('base', 'event_queue_type')); + } + + // if an event queue is returned then pass it the event + if ($q) { + + return $q->addToQueue($event); + // otherwise skip the queue and just notify the listeners immeadiately. + } else { + return $this->notify($event); + } + + // otherwise skip the queue and just notify the listeners immeadiately. + } else { + return $this->notify($event); + } + } + + function getAsyncEventQueue($type) { + + static $q = array(); + + if ( ! array_key_exists( $type, $q ) ) { + + switch( $type ) { + + case 'http': + $q['http'] = owa_coreAPI::supportClassFactory( 'base', 'httpEventQueue' ); + break; + case 'database': + $q['database'] = owa_coreAPI::supportClassFactory( 'base', 'dbEventQueue' ); + break; + case 'file': + $q['file'] = owa_coreAPI::supportClassFactory( 'base', 'fileEventQueue' ); + break; + } + } + + if ( array_key_exists( $type, $q ) ) { + return $q[$type]; + } else { + owa_coreAPI::debug('No event queue of that type exists.'); + return false; + } + } + + function eventFactory() { + + return owa_coreAPI::supportClassFactory('base', 'event'); + } + + function makeEvent($type = '') { + + $event = $this->eventFactory(); + + if ($type) { + $event->setEventType($type); + } + + return $event; + } + +/* + function processEventQueue($processing_queue_type = '') { + + // get the primary async queue + + // get an item from the queue + + // send to the notify method + + // check return status + + // mark item accordingly + } +*/ + + /** + * Singleton + * + * @static + * @return object + * @access public + */ + public static function &get_instance() { + + static $eq; + + if (empty($eq)) { + $eq = new eventQueue(); + } + + return $eq; + } + +} + +?> --- /dev/null +++ b/busui/owa/includes/CronParser.php @@ -1,1 +1,604 @@ - +calcLastRan($cron_str0); +// $cron->getLastRanUnix() returns an Unix timestamp +echo "Cron '$cron_str0' last due at: " . date('r', $cron->getLastRanUnix()) . "

"; +// $cron->getLastRan() returns last due time in an array +print_r($cron->getLastRan()); +echo "Debug:
" . nl2br($cron->getDebug()); + +$cron_str1 = "3 12 * * *"; +if ($cron->calcLastRan($cron_str1)) +{ + echo "

Cron '$cron_str1' last due at: " . date('r', $cron->getLastRanUnix()) . "

"; + print_r($cron->getLastRan()); +} +else +{ + echo "Error parsing"; +} +echo "Debug:
" . nl2br($cron->getDebug()); + + *####################################################################################################### + */ + +class CronParser +{ + + var $bits = Array(); //exploded String like 0 1 * * * + var $now = Array(); //Array of cron-style entries for time() + var $lastRan; //Timestamp of last ran time. + var $taken; + var $debug; + var $year; + var $month; + var $day; + var $hour; + var $minute; + var $minutes_arr = array(); //minutes array based on cron string + var $hours_arr = array(); //hours array based on cron string + var $months_arr = array(); //months array based on cron string + + function getLastRan() + { + return explode(",", strftime("%M,%H,%d,%m,%w,%Y", $this->lastRan)); //Get the values for now in a format we can use + } + + function getLastRanUnix() + { + return $this->lastRan; + } + + function getDebug() + { + return $this->debug; + } + + function debug($str) + { + if (is_array($str)) + { + $this->debug .= "\nArray: "; + foreach($str as $k=>$v) + { + $this->debug .= "$k=>$v, "; + } + + } + else + { + $this->debug .= "\n$str"; + } + //echo nl2br($this->debug); + } + + /** + * Assumes that value is not *, and creates an array of valid numbers that + * the string represents. Returns an array. + */ + function expand_ranges($str) + { + if (strstr($str, ",")) + { + $arParts = explode(',', $str); + foreach ($arParts AS $part) + { + if (strstr($part, '-')) + { + $arRange = explode('-', $part); + for ($i = $arRange[0]; $i <= $arRange[1]; $i++) + { + $ret[] = $i; + } + } + else + { + $ret[] = $part; + } + } + } + elseif (strstr($str, '-')) + { + $arRange = explode('-', $str); + for ($i = $arRange[0]; $i <= $arRange[1]; $i++) + { + $ret[] = $i; + } + } + else + { + $ret[] = $str; + } + $ret = array_unique($ret); + sort($ret); + return $ret; + } + + function daysinmonth($month, $year) + { + return date('t', mktime(0, 0, 0, $month, 1, $year)); + } + + /** + * Calculate the last due time before this moment + */ + function calcLastRan($string) + { + + $tstart = microtime(); + $this->debug = ""; + $this->lastRan = 0; + $this->year = NULL; + $this->month = NULL; + $this->day = NULL; + $this->hour = NULL; + $this->minute = NULL; + $this->hours_arr = array(); + $this->minutes_arr = array(); + $this->months_arr = array(); + + $string = preg_replace('/[\s]{2,}/', ' ', $string); + + if (preg_match('/[^-,* \\d]/', $string) !== 0) + { + $this->debug("Cron String contains invalid character"); + return false; + } + + $this->debug("Working on cron schedule: $string"); + $this->bits = @explode(" ", $string); + + if (count($this->bits) != 5) + { + $this->debug("Cron string is invalid. Too many or too little sections after explode"); + return false; + } + + //put the current time into an array + $t = strftime("%M,%H,%d,%m,%w,%Y", time()); + $this->now = explode(",", $t); + + $this->year = $this->now[5]; + + $arMonths = $this->_getMonthsArray(); + + do + { + $this->month = array_pop($arMonths); + } + while ($this->month > $this->now[3]); + + if ($this->month === NULL) + { + $this->year = $this->year - 1; + $this->debug("Not due within this year. So checking the previous year " . $this->year); + $arMonths = $this->_getMonthsArray(); + $this->_prevMonth($arMonths); + } + elseif ($this->month == $this->now[3]) //now Sep, month = array(7,9,12) + { + $this->debug("Cron is due this month, getting days array."); + $arDays = $this->_getDaysArray($this->month, $this->year); + + do + { + $this->day = array_pop($arDays); + } + while ($this->day > $this->now[2]); + + if ($this->day === NULL) + { + $this->debug("Smallest day is even greater than today"); + $this->_prevMonth($arMonths); + } + elseif ($this->day == $this->now[2]) + { + $this->debug("Due to run today"); + $arHours = $this->_getHoursArray(); + + do + { + $this->hour = array_pop($arHours); + } + while ($this->hour > $this->now[1]); + + if ($this->hour === NULL) // now =2, arHours = array(3,5,7) + { + $this->debug("Not due this hour and some earlier hours, so go for previous day"); + $this->_prevDay($arDays, $arMonths); + } + elseif ($this->hour < $this->now[1]) //now =2, arHours = array(1,3,5) + { + $this->minute = $this->_getLastMinute(); + } + else // now =2, arHours = array(1,2,5) + { + $this->debug("Due this hour"); + $arMinutes = $this->_getMinutesArray(); + do + { + $this->minute = array_pop($arMinutes); + } + while ($this->minute > $this->now[0]); + + if ($this->minute === NULL) + { + $this->debug("Not due this minute, so go for previous hour."); + $this->_prevHour($arHours, $arDays, $arMonths); + } + else + { + $this->debug("Due this very minute or some earlier minutes before this moment within this hour."); + } + } + } + else + { + $this->debug("Cron was due on " . $this->day . " of this month"); + $this->hour = $this->_getLastHour(); + $this->minute = $this->_getLastMinute(); + } + } + else //now Sep, arrMonths=array(7, 10) + { + $this->debug("Cron was due before this month. Previous month is: " . $this->year . '-' . $this->month); + $this->day = $this->_getLastDay($this->month, $this->year); + if ($this->day === NULL) + { + //No scheduled date within this month. So we will try the previous month in the month array + $this->_prevMonth($arMonths); + } + else + { + $this->hour = $this->_getLastHour(); + $this->minute = $this->_getLastMinute(); + } + } + + $tend = microtime(); + $this->taken = $tend - $tstart; + $this->debug("Parsing $string taken " . $this->taken . " seconds"); + + //if the last due is beyond 1970 + if ($this->minute === NULL) + { + $this->debug("Error calculating last due time"); + return false; + } + else + { + $this->debug("LAST DUE: " . $this->hour . ":" . $this->minute . " on " . $this->day . "/" . $this->month . "/" . $this->year); + $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year); + return true; + } + } + + //get the due time before current month + function _prevMonth($arMonths) + { + $this->month = array_pop($arMonths); + if ($this->month === NULL) + { + $this->year = $this->year -1; + if ($this->year <= 1970) + { + $this->debug("Can not calculate last due time. At least not before 1970.."); + } + else + { + $this->debug("Have to go for previous year " . $this->year); + $arMonths = $this->_getMonthsArray(); + $this->_prevMonth($arMonths); + } + } + else + { + $this->debug("Getting the last day for previous month: " . $this->year . '-' . $this->month); + $this->day = $this->_getLastDay($this->month, $this->year); + + if ($this->day === NULL) + { + //no available date schedule in this month + $this->_prevMonth($arMonths); + } + else + { + $this->hour = $this->_getLastHour(); + $this->minute = $this->_getLastMinute(); + } + } + + } + + //get the due time before current day + function _prevDay($arDays, $arMonths) + { + $this->debug("Go for the previous day"); + $this->day = array_pop($arDays); + if ($this->day === NULL) + { + $this->debug("Have to go for previous month"); + $this->_prevMonth($arMonths); + } + else + { + $this->hour = $this->_getLastHour(); + $this->minute = $this->_getLastMinute(); + } + } + + //get the due time before current hour + function _prevHour($arHours, $arDays, $arMonths) + { + $this->debug("Going for previous hour"); + $this->hour = array_pop($arHours); + if ($this->hour === NULL) + { + $this->debug("Have to go for previous day"); + $this->_prevDay($arDays, $arMonths); + } + else + { + $this->minute = $this->_getLastMinute(); + } + } + + //not used at the moment + function _getLastMonth() + { + $months = $this->_getMonthsArray(); + $month = array_pop($months); + + return $month; + } + + function _getLastDay($month, $year) + { + //put the available days for that month into an array + $days = $this->_getDaysArray($month, $year); + $day = array_pop($days); + + return $day; + } + + function _getLastHour() + { + $hours = $this->_getHoursArray(); + $hour = array_pop($hours); + + return $hour; + } + + function _getLastMinute() + { + $minutes = $this->_getMinutesArray(); + $minute = array_pop($minutes); + + return $minute; + } + + //remove the out of range array elements. $arr should be sorted already and does not contain duplicates + function _sanitize ($arr, $low, $high) + { + $count = count($arr); + for ($i = 0; $i <= ($coun