Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2011
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.05 KB | None | 0 0
  1. <?php
  2. /**
  3. * phpVMS - Virtual Airline Administration Software
  4. * Copyright (c) 2008 Nabeel Shahzad
  5. * For more information, visit www.phpvms.net
  6. * Forums: http://www.phpvms.net/forum
  7. * Documentation: http://www.phpvms.net/docs
  8. *
  9. * phpVMS is licenced under the following license:
  10. * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
  11. * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
  12. *
  13. * @author Nabeel Shahzad
  14. * @copyright Copyright (c) 2008, Nabeel Shahzad
  15. * @link http://www.phpvms.net
  16. * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
  17. */
  18.  
  19. /**
  20. * DO NOT MODIFY THESE SETTINGS HERE!!
  21. * They will get over-ridden in an update. These are just defaults
  22. * To change, copy-paste and change the line/option/setting into your
  23. * local.config.php file
  24. *
  25. * Most of these are in your local.config.php already
  26. *
  27. * View the docs for details about these settings
  28. */
  29.  
  30. # Debug mode is off by default
  31. Config::Set('DEBUG_MODE', false);
  32. Config::Set('DEBUG_LEVEL', 1); // 1 logs query errors, 2 logs all queries
  33. Config::Set('ERROR_LEVEL', E_ALL ^ E_NOTICE);
  34.  
  35. # Page encoding options
  36. Config::Set('PAGE_ENCODING', 'UTF-8');
  37. Config::Set('DB_CHARSET_NAME', 'utf8');
  38.  
  39. # Maintenance mode - this disables the site to non-admins
  40. Config::Set('MAINTENANCE_MODE', false);
  41. Config::Set('MAINTENANCE_MESSAGE', 'We are currently down for maintenance, please check back soon.');
  42.  
  43. # See more details about these in the docs
  44. Config::Set('PAGE_EXT', '.htm'); # .htm is fine. You can still run PHP
  45. Config::Set('PILOTID_OFFSET', 0); # What # to start pilot ID's from
  46. Config::Set('PILOTID_LENGTH', 4); # Length of the Pilot ID
  47. Config::Set('UNITS', 'nm'); # Your units: nm, mi or km
  48. Config::Set('LOAD_FACTOR', '82'); # %age load factor
  49. Config::Set('CARGO_UNITS', 'lbs');
  50. Config::Set('DEFAULT_MAX_CARGO_LOAD', 10000);
  51. Config::Set('DEFAULT_MAX_PAX_LOAD', 250);
  52.  
  53. # Number of routes to show in the route map
  54. Config::Set('ROUTE_MAP_SHOW_NUMBER', 25);
  55.  
  56. # After how long to mark a pilot inactive, in days
  57. Config::Set('PILOT_AUTO_RETIRE', true);
  58. Config::Set('PILOT_INACTIVE_TIME', 90);
  59.  
  60. # Automatically confirm pilots?
  61. Config::Set('PILOT_AUTO_CONFIRM', false);
  62.  
  63. # Automatically calculate ranks?
  64. Config::Set('RANKS_AUTOCALCULATE', true);
  65.  
  66. # For how many hours a pilot can edit their submitted PIREP (custom fields only)
  67. Config::Set('PIREP_CUSTOM_FIELD_EDIT', '48');
  68.  
  69. # The time to wait to be allowed to submit identical PIREPS
  70. Config::Set('PIREP_CHECK_DUPLICATE', true);
  71. Config::Set('PIREP_TIME_CHECK', '1'); # Minutes, to wait in between duplicate submits
  72.  
  73. # Whether to ignore any user-inputted load, and always calculate it
  74. Config::Set('PIREP_OVERRIDE_LOAD', false);
  75.  
  76. /* What to order schedules by. Use s.[column_name] [ASC/DESC],
  77. with the column name being from the schedules table */
  78. Config::Set('SCHEDULES_ORDER_BY', 's.flightnum ASC');
  79.  
  80. /* For PIREPS_ORDER_BY use p.[column_name] [ASC/DESC] */
  81. Config::Set('PIREPS_ORDER_BY', 'p.submitdate DESC');
  82.  
  83. # If someone places a bid, whether to disable that or not
  84. Config::Set('DISABLE_SCHED_ON_BID', true);
  85. Config::Set('DISABLE_BIDS_ON_BID', false);
  86.  
  87. # Whether to close any bids after a certain amount of time
  88. Config::Set('CLOSE_BIDS_AFTER_EXPIRE', false);
  89. Config::Set('BID_EXPIRE_TIME', '48'); # How many hours to hold bids for
  90.  
  91. # If you want to count transfer hours in rank calculations
  92. Config::Set('TRANSFER_HOURS_IN_RANKS', false);
  93.  
  94. # Pilot pilots to only fly aircraft they're ranked to
  95. Config::Set('RESTRICT_AIRCRAFT_RANKS', true);
  96.  
  97. # The StatsData::UserOnline() function - how many minutes to check
  98. Config::Set('USERS_ONLINE_TIME', 20);
  99.  
  100. # Google Map Options
  101. Config::Set('MAP_WIDTH', '800px');
  102. Config::Set('MAP_HEIGHT', '600px');
  103. Config::Set('MAP_TYPE', 'G_PHYSICAL_MAP');
  104. Config::Set('MAP_LINE_COLOR', '#ff0000');
  105. Config::Set('MAP_CENTER_LAT', '45.484400');
  106. Config::Set('MAP_CENTER_LNG', '-62.334821');
  107. Config::Set('MAP_ZOOM_LEVEL', 12);
  108.  
  109. # ACARS options
  110. # Minutes, flights to show on the ACARS
  111. # Default is 720 minutes (12 hours)
  112. Config::Set('ACARS_LIVE_TIME', 720);
  113. Config::Set('ACARS_DEBUG', false);
  114.  
  115. /*
  116. This is the unit of money. For non-dollars, use :
  117. Dollars ($), enter "$"
  118. Euro (�), enter "&#8364;"
  119. Yen (�), enter "&yen;"
  120. Pounds (�), enter "&pound;"
  121.  
  122. For example, to set EUROS:
  123. Config::Set('MONEY_UNIT', '&#8364;');
  124. */
  125.  
  126. Config::Set('MONEY_UNIT', '$');
  127.  
  128. /*
  129. To change the money format, look at:
  130. http://us3.php.net/money_format
  131.  
  132. However, I do not recommend changing this
  133. */
  134.  
  135. Config::Set('MONEY_FORMAT', '%(#10n');
  136.  
  137.  
  138. # Fuel info
  139. /* Default fuel price, for airports that don't have
  140. And the surcharge percentage. View the docs
  141. for more details about these
  142. */
  143. Config::Set('FUEL_GET_LIVE_PRICE', true);
  144. Config::Set('FUEL_DEFAULT_PRICE', '5.10');
  145. Config::Set('FUEL_SURCHARGE', '5');
  146.  
  147. # Units settings
  148. # These are global, also used for FSPAX
  149. Config::Set('WeightUnit', '1'); # 0=Kg 1=lbs
  150. Config::Set('DistanceUnit', '2'); # 0=KM 1= Miles 2=NMiles
  151. Config::Set('SpeedUnit', '1'); # 0=Km/H 1=Kts
  152. Config::Set('AltUnit', '1'); # 0=Meter 1=Feet
  153. Config::Set('LiquidUnit', '3'); # 0=liter 1=gal 2=kg 3=lbs
  154. Config::Set('WelcomeMessage', 'phpVMS/FSPAX ACARS'); # Welcome Message
  155. Config::Set('LIQUID_UNIT_NAMES', array('liter','gal','kg', 'lbs'));
  156.  
  157. /* FSFK Settings
  158. Your FTP Server, and path to the lib/images folder (from where the FTP connects from), IE
  159. ftp://phpvms.net/phpvms/lib/fsfk or ftp://phpvms.net/public_html/phpvms/lib/fsfk
  160.  
  161. You want the path from when you connect to the FTP down to where the /lib/fsfk folder is
  162. */
  163. Config::Set('FSFK_FTP_SERVER', '');
  164. Config::Set('FSFK_FTP_PORT', '21');
  165. Config::Set('FSFK_FTP_USER', '');
  166. Config::Set('FSFK_FTP_PASS', '');
  167. Config::Set('FSFK_FTP_PASSIVE_MODE', 'TRUE');
  168. Config::Set('FSFK_IMAGE_PATH', '/lib/fsfk'); // web path from SITE_ROOT
  169.  
  170. # Options for the signature that's generated
  171. Config::Set('SIGNATURE_TEXT_COLOR', '#000');
  172. Config::Set('SIGNATURE_USE_CUSTOM_FONT', true);
  173. Config::Set('SIGNATURE_FONT_PATH', SITE_ROOT.'/lib/fonts/tahoma.ttf');
  174. Config::Set('SIGNATURE_FONT_SIZE', '10');
  175. Config::Set('SIGNATURE_X_OFFSET', '10');
  176. Config::Set('SIGNATURE_Y_OFFSET', '17');
  177. Config::Set('SIGNATURE_FONT_PADDING', 4);
  178. Config::Set('SIGNATURE_SHOW_EARNINGS', true);
  179. Config::Set('SIGNATURE_SHOW_RANK_IMAGE', true);
  180. Config::Set('SIGNATURE_SHOW_COPYRIGHT', true);
  181.  
  182. # Avatar information
  183. Config::Set('AVATAR_FILE_SIZE', 50000); # Maximum file-size they can upload
  184. Config::Set('AVATAR_MAX_WIDTH', 80); # Resized width
  185. Config::Set('AVATAR_MAX_HEIGHT', 80); # Resized height
  186.  
  187. # Cookie information
  188. Config::Set('SESSION_LOGIN_TIME', (60*60*24*30)); # Expire after 30 days, in seconds
  189. Config::Set('SESSION_GUEST_EXPIRE', '30'); # Clear guest sessions 30 minutes
  190. //Config::Set('SESSION_COOKIE_NAME', 'VMS_AUTH_COOKIE');
  191.  
  192. # Email Settings
  193. Config::Set('EMAIL_FROM_NAME', '');
  194. Config::Set('EMAIL_FROM_ADDRESS', '');
  195.  
  196. Config::Set('EMAIL_USE_SMTP', false);
  197. # Add multiple SMTP servers by separating them with ;
  198. Config::Set('EMAIL_SMTP_SERVERS', '');
  199. Config::Set('EMAIL_SMTP_PORT', '25');
  200. Config::Set('EMAIL_SMTP_USE_AUTH', false);
  201. Config::Set('EMAIL_SMTP_USER', '');
  202. Config::Set('EMAIL_SMTP_PASS', '');
  203.  
  204. # Set specific email addresses to send notifications to
  205. Config::Set('EMAIL_NEW_REGISTRATIONS', '');
  206. Config::Set('EMAIL_NEW_PIREP', '');
  207.  
  208. # This is email to specifically send email sent error to, such
  209. # as failure notices with an invalid email or something
  210. # If blank, it'll default to the "from" email that's specified
  211. Config::Set('EMAIL_RETURN_PATH', '');
  212.  
  213.  
  214. /* Can be 'geonames' or 'phpvms'.
  215. Geonames will use the geonames.org server to look up the airport info
  216. phpvms will use the phpVMS API server
  217. */
  218.  
  219. Config::Set('AIRPORT_LOOKUP_SERVER', 'geonames');
  220. Config::Set('PHPVMS_API_SERVER', 'http://api.phpvms.net');
  221. Config::Set('PHPVMS_NEWS_FEED', 'http://feeds.feedburner.com/phpvms');
  222. Config::Set('VACENTRAL_NEWS_FEED', 'http://feeds.feedburner.com/vacentral');
  223. Config::Set('GEONAME_API_SERVER', 'http://ws.geonames.org');
  224.  
  225. /* Keys for recaptcha, you can change these if you want to your own but it's
  226. a global key so it should just work */
  227. Config::Set('RECAPTCHA_PUBLIC_KEY', '6LcklAsAAAAAAJqmghmMPOACeJrAxW3sJulSboxx');
  228. Config::Set('RECAPTCHA_PRIVATE_KEY', '6LcklAsAAAAAAMeQy5ZBoDu8JOMTP-UL7ek1GedO');
  229.  
  230. /* Whether you have the /admin/maintenance.php script added into cron.
  231. If you do, set this to true. This saves many DB calls since phpVMS will
  232. have to 'fake' a cron-job
  233. */
  234. Config::Set('USE_CRON', false);
  235.  
  236. Config::Set('CHECK_RELEASE_VERSION', true);
  237. Config::Set('CHECK_BETA_VERSION', false);
  238. Config::Set('URL_REWRITE', false);
  239.  
  240. /* Days of the Week
  241. The compacted view, and the full text
  242. */
  243. Config::Set('DAYS_COMPACT', array('Su', 'M', 'T', 'W', 'Th', 'F', 'S', 'Su'));
  244.  
  245. Config::Set('DAYS_LONG',
  246. array('Sunday',
  247. 'Monday',
  248. 'Tuesday',
  249. 'Wednesday',
  250. 'Thursday',
  251. 'Friday',
  252. 'Saturday',
  253. 'Sunday'
  254. )
  255. );
  256.  
  257. Config::Set('SITE_LANGUAGE', 'en');
  258. Config::Set('ADMIN_SKIN', 'layout');
  259.  
  260.  
  261. /**
  262. * *******************************************************
  263. *
  264. *
  265. *
  266. *
  267. *
  268. *
  269. * Advanced options, don't edit unless you
  270. * know what you're doing!!
  271. *
  272. * Actually, don't change them, at all. Please.
  273. * For your sake. And mine. :)
  274. *
  275. *
  276. *
  277. *
  278. *
  279. *
  280. *
  281. *
  282. *
  283. *
  284. *
  285. *
  286. *
  287. *
  288. *
  289. *
  290. *
  291. *
  292. *
  293. *
  294. *
  295. */
  296.  
  297. $revision = file_get_contents(CORE_PATH.'/version');
  298. define('PHPVMS_VERSION', '2.1.'.$revision);
  299.  
  300. Config::Set('TEMPLATE_USE_CACHE', false);
  301. Config::Set('TEMPLATE_CACHE_EXPIRE', '24');
  302. Config::Set('DBASE_USE_CACHE', false);
  303. Config::Set('CACHE_PATH', SITE_ROOT . '/core/cache');
  304. Config::Set('TPL_EXTENSION', '.tpl');
  305. Config::Set('BASE_TEMPLATE_PATH', SITE_ROOT.'/core/templates');
  306.  
  307. if(defined('ADMIN_PANEL') && ADMIN_PANEL === true)
  308. {
  309. Template::SetTemplatePath(SITE_ROOT.'/admin/templates');
  310.  
  311. define('CODON_MODULES_PATH', SITE_ROOT.'/admin/modules');
  312. define('CODON_DEFAULT_MODULE', 'Dashboard');
  313. }
  314. else
  315. {
  316. Template::SetTemplatePath(Config::Get('BASE_TEMPLATE_PATH'));
  317.  
  318. define('CODON_MODULES_PATH', SITE_ROOT.'/core/modules');
  319. define('CODON_DEFAULT_MODULE', 'Frontpage');
  320.  
  321. /*Config::Set('MODULES_PATH', SITE_ROOT.'/core/modules');
  322. Config::Set('DEFAULT_MODULE', 'Frontpage');
  323. Config::Set('MODULES_AUTOLOAD', true);*/
  324. }
  325.  
  326. /* Cache settings */
  327. $cache_settings = array(
  328. 'active' => true,
  329. 'engine' => 'file', /* "file" or "apc" */
  330. 'location' => CACHE_PATH, /* For the "file" engine type */
  331. 'prefix' => 'phpvms_', /* Specify a prefix for any entries */
  332. 'profiles' => array(
  333. 'default' => array(
  334. 'duration' => '+10 minutes',
  335. ),
  336.  
  337. 'short' => array(
  338. 'duration' => '+3 minutes',
  339. ),
  340.  
  341. '15minute' => array(
  342. 'duration' => '+15 minutes',
  343. ),
  344.  
  345. 'medium' => array(
  346. 'duration' => '+1 hour',
  347. ),
  348.  
  349. 'long' => array(
  350. 'duration' => '+6 hours'
  351. ),
  352. )
  353. );
  354.  
  355. Config::Set('CACHE_KEY_LIST', array(
  356. 'all_airline_active',
  357. 'all_airlines',
  358. 'start_date',
  359. 'months_since_start',
  360. 'years_since_start',
  361. 'stats_aircraft_usage',
  362. 'all_settings',
  363. 'total_flights',
  364. 'top_routes',
  365. 'users_online',
  366. 'guests_online',
  367. 'pilot_count',
  368. 'total_pax_carried',
  369. 'flights_today',
  370. 'fuel_burned',
  371. 'miles_flown',
  372. 'aircraft_in_fleet',
  373. 'total_news_items',
  374. 'total_schedules',
  375. 'all_groups',
  376. 'all_ranks',
  377. )
  378. );
  379.  
  380.  
  381. Config::Set('TABLE_LIST', array(
  382. 'acarsdata',
  383. 'adminlog',
  384. 'aircraft',
  385. 'airlines',
  386. 'airports',
  387. 'awards',
  388. 'awardsgranted',
  389. 'bids',
  390. 'customfields',
  391. 'downloads',
  392. 'expenselog',
  393. 'expenses',
  394. 'fieldvalues',
  395. 'financedata',
  396. 'fuelprices',
  397. 'groupmembers',
  398. 'groups',
  399. 'navdata',
  400. 'news',
  401. 'pages',
  402. 'pilots',
  403. 'pirepcomments',
  404. 'pirepfields',
  405. 'pireps',
  406. 'pirepvalues',
  407. 'ranks',
  408. 'schedules',
  409. 'sessions',
  410. 'settings',
  411. 'updates'
  412. )
  413. );
  414.  
  415. /* VACentral */
  416. Config::Set('VACENTRAL_ENABLED', false);
  417. Config::Set('VACENTRAL_DEBUG_MODE', false);
  418. Config::Set('VACENTRAL_DEBUG_DETAIL', 0);
  419. Config::Set('VACENTRAL_API_SERVER', 'http://api.phpvms.net');
  420. Config::Set('VACENTRAL_API_KEY', '');
  421.  
  422. /**
  423. * Constants
  424. * Do not modify these! All sorts of weird shit can happen
  425. */
  426. # Set the type of flights we have
  427. Config::Set(
  428. 'FLIGHT_TYPES', array(
  429. 'P'=>'Passenger',
  430. 'C'=>'Cargo',
  431. 'H'=>'Charter'
  432. )
  433. );
  434.  
  435. # Set the types of expenses we have
  436. Config::Set(
  437. 'EXPENSE_TYPES', array(
  438. 'M'=>'Monthly',
  439. 'F'=>'Per Flight',
  440. 'P'=>'Percent (month)',
  441. 'G'=>'Percent (per flight)'
  442. )
  443. );
  444.  
  445. define('SIGNATURE_PATH', '/lib/signatures');
  446. define('AVATAR_PATH', '/lib/avatars');
  447.  
  448. define('PIREP_PENDING', 0);
  449. define('PIREP_ACCEPTED', 1);
  450. define('PIREP_REJECTED', 2);
  451. define('PIREP_INPROGRESS', 3);
  452.  
  453. define('PILOT_PENDING', 0);
  454. define('PILOT_ACCEPTED', 1);
  455. define('PILOT_REJECTED', 2);
  456.  
  457. define('NAV_NDB', 2);
  458. define('NAV_VOR', 3);
  459. define('NAV_DME', 4);
  460. define('NAV_FIX', 5);
  461. define('NAV_TRACK', 6);
  462.  
  463. define('LOAD_VARIATION', 5);
  464. define('SECONDS_PER_DAY', 86400);
  465.  
  466. define('GEONAME_URL', 'http://ws.geonames.org');
  467.  
  468. define('VMS_AUTH_COOKIE', 'VMSAUTH');
  469.  
  470.  
  471.  
  472. /**
  473. * Library Includes (from 3rd Party)
  474. */
  475.  
  476. # Bit-masks for permission sets
  477. $permission_set = array
  478. (/*'NO_ADMIN_ACCESS' => 0,*/
  479. 'EDIT_NEWS' => 0x1,
  480. 'EDIT_PAGES' => 0x2,
  481. 'EDIT_DOWNLOADS' => 0x4,
  482. 'EMAIL_PILOTS' => 0x8,
  483. 'EDIT_AIRLINES' => 0x10,
  484. 'EDIT_FLEET' => 0x20,
  485. 'EDIT_SCHEDULES' => 0x80,
  486. 'IMPORT_SCHEDULES' => 0x100,
  487. 'MODERATE_REGISTRATIONS' => 0x200,
  488. 'EDIT_PILOTS' => 0x400,
  489. 'EDIT_GROUPS' => 0x800,
  490. 'EDIT_RANKS' => 0x1000,
  491. 'EDIT_AWARDS' => 0x2000,
  492. 'MODERATE_PIREPS' => 0x4000,
  493. 'VIEW_FINANCES' => 0x8000,
  494. 'EDIT_EXPENSES' => 0x10000,
  495. 'EDIT_SETTINGS' => 0x20000,
  496. 'EDIT_PIREPS_FIELDS' => 0x40000,
  497. 'EDIT_PROFILE_FIELDS' => 0x80000,
  498. 'EDIT_VACENTRAL' => 0x100000,
  499. 'ACCESS_ADMIN' => 0x2000000,
  500. 'FULL_ADMIN' => 35651519);
  501.  
  502. Config::Set('permission_set', $permission_set);
  503. define('NO_ADMIN_ACCESS', 0);
  504. foreach($permission_set as $key=>$value)
  505. {
  506. define($key, $value);
  507. }
  508.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement