/[dtapublic]/to_be_filed/webprojs/php_libraries/php_library/fboprime/config.inc
ViewVC logotype

Contents of /to_be_filed/webprojs/php_libraries/php_library/fboprime/config.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 35 - (show annotations) (download)
Sat Oct 8 23:35:33 2016 UTC (7 years, 11 months ago) by dashley
File size: 28598 byte(s)
Initial commit.
1 <?php
2 //$Header: /hl/cvsroots/gpl01/gpl01/webprojs/fboprime/sw/phplib/config.inc,v 1.29 2006/10/29 16:48:32 dashley Exp $
3 //********************************************************************************
4 //config.inc--FboPrime FBO Configuration
5 //Copyright (C) 2006 David T. Ashley
6 //
7 //This program is free software; you can redistribute it and/or
8 //modify it under the terms of the GNU General Public License
9 //as published by the Free Software Foundation; either version 2
10 //of the License, or (at your option) any later version.
11 //
12 //This program is distributed in the hope that it will be useful,
13 //but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 //GNU General Public License for more details.
16 //
17 //You should have received a copy of the GNU General Public License
18 //along with this program; if not, write to the Free Software
19 //Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 //********************************************************************************
21 //This file must be customized for each FBO. The following information is
22 //customizable:
23 //
24 // o MySQL database information (which host to connect to, which database to use,
25 // and the password to use for the database).
26 //
27 // o FBO name, address, phone numbers, and e-mail contact information.
28 //
29 // o Scheduling behavior parameters, such as how long information should be
30 // retained, how close to a reservation time a reservation may be made or
31 // canceled without contacting the FBO, how standby reservations are
32 // handled, etc.
33 //
34 // o Colors.
35 //
36 //==============================================================================================================
37 //==============================================================================================================
38 //==== MySQL Information ======================================================================================
39 //==============================================================================================================
40 //==============================================================================================================
41 //MySQL connection configuration. This information must be kept absolutely
42 //private (i.e. with this information, an attack could potentially be mounted).
43 //
44 define("CONFIG_MYSQL_SERVER", "localhost");
45 define("CONFIG_MYSQL_DATABASE", "fboprimedevel");
46 define("CONFIG_MYSQL_USERNAME", "fboprimedevel");
47 define("CONFIG_MYSQL_PASSWORD", "quelle0");
48 //
49 //Prefix to use in the system logs when there is a database problem and a system log entry must be
50 //made.
51 //
52 define("CONFIG_MYSQL_ERR_SYSLOG_PREFIX", "FBO-PRIME");
53 //
54 //==============================================================================================================
55 //==============================================================================================================
56 //==== Web Location/URL/Cookie Options =======================================================================
57 //==============================================================================================================
58 //==============================================================================================================
59 //These options control how certain URLs are formed, how cookies are issued, etc. It is important to get
60 //these right, or logins won't work (among other things).
61 //
62 define("CONFIG_URL_DOMAIN", "fboprimedevel.e3ft.com" ); //The server name as used in the URL. This is
63 //used for cookies and to create some URLs.
64 define("CONFIG_URL_FSPATH", "/flightschedule" ); //The path within the base URL where the flight
65 //scheduler is. This is used for cookies and
66 //to create some URLs.
67
68 //==============================================================================================================
69 //==============================================================================================================
70 //==== FBO Name, Address, and Other Information ==============================================================
71 //==============================================================================================================
72 //==============================================================================================================
73 //FBO name and identity information.
74 //
75 define("CONFIG_FBO_NAME_LONG", "Acme Aviation, LLC"); //Long name.
76 define("CONFIG_FBO_NAME_MEDIUM", "Acme Aviation"); //Medium name.
77 define("CONFIG_FBO_NAME_SHORT", "Acme"); //Short name.
78 define("CONFIG_FBO_NAME_TINY", "AA"); //Tiny name, typically an acronym.
79 //--------------------------------------------------------------------------------------------------------------
80 //FBO physical address information. The physical address is where a person would visit the FBO.
81 //
82 define("CONFIG_FBO_VADDRESS_COUNTRY", "U.S.A."); //Country. Not normally displayed, so separated
83 //out.
84 define("CONFIG_FBO_VADDRESS_01", "123 Anywhere Lane");
85 define("CONFIG_FBO_VADDRESS_02", "Pleasantville IA 12345-6789");
86 define("CONFIG_FBO_VADDRESS", CONFIG_FBO_VADDRESS_01 . "//" . CONFIG_FBO_VADDRESS_02 );
87 //--------------------------------------------------------------------------------------------------------------
88 //FBO correspondence address information. For most FBOs, this will be the same as the physical
89 //address.
90 //
91 define("CONFIG_FBO_CADDRESS_COUNTRY", CONFIG_FBO_VADDRESS_COUNTRY);
92 define("CONFIG_FBO_CADDRESS", CONFIG_FBO_VADDRESS_01 . "//" . CONFIG_FBO_VADDRESS_02 );
93 //--------------------------------------------------------------------------------------------------------------
94 //FBO package delivery address information. For most FBOs, this will be the same as the physical
95 //address.
96 //
97 define("CONFIG_FBO_PADDRESS_COUNTRY", CONFIG_FBO_VADDRESS_COUNTRY);
98 define("CONFIG_FBO_PADDRESS", CONFIG_FBO_VADDRESS_01 . "//" . CONFIG_FBO_VADDRESS_02 );
99 //--------------------------------------------------------------------------------------------------------------
100 //FBO phone numbers.
101 //
102 define("CONFIG_FBO_OPHONE", "123-456-7890" ); //The general office phone number.
103 define("CONFIG_FBO_SPHONE", CONFIG_FBO_OPHONE); //The phone number to use for scheduling matters.
104 define("CONFIG_FBO_FPHONE", CONFIG_FBO_OPHONE); //The FAX number.
105 define("CONFIG_FBO_PPHONE", CONFIG_FBO_OPHONE); //The phone number to use for package delivery.
106 //
107 //--------------------------------------------------------------------------------------------------------------
108 //Automatically-generated e-mail options.
109 //
110 define("CONFIG_FBO_AUTOMAIL_FROM", "automailer@acmeaviation.com"); //Address that e-mail should be from.
111 define("CONFIG_FBO_AUTOMAIL_LINELENGTH", 69 ); //Line length of automatically-generated
112 //e-mail. 69 should not be exceeded
113 //due to documentation of mail() function.
114 //
115 //Returns the footer text to be used in automatically-generated e-mails. Has to be defined
116 //as a function to prevent evaluation of global variables before they have been set.
117 //
118 function CONFIG_fbo_automail_footer_text()
119 {
120 global $GLOBAL_stime_year;
121 global $GLOBAL_stime_month;
122 global $GLOBAL_stime_day;
123 global $GLOBAL_stime_hour;
124 global $GLOBAL_stime_minute;
125
126 $hyphen_line = "";
127 for ($i=0; $i<(CONFIG_FBO_AUTOMAIL_LINELENGTH + 1); $i++)
128 $hyphen_line .= "-";
129
130 return(
131 $hyphen_line
132 .
133 " "
134 .
135 "This e-mail was automatically generated by the server on "
136 .
137 DATEFUNC_stdlongdate_w_dow($GLOBAL_stime_year, $GLOBAL_stime_month, $GLOBAL_stime_day)
138 .
139 " at "
140 .
141 DATEFUNC_stdtimenosec($GLOBAL_stime_hour, $GLOBAL_stime_minute)
142 .
143 " "
144 .
145 "Please contact "
146 .
147 CONFIG_FBO_NAME_LONG
148 .
149 " at "
150 .
151 CONFIG_FBO_OPHONE
152 .
153 " if you have any questions or concerns about this e-mail. "
154 .
155 "Please do not reply to this e-mail, as it is "
156 .
157 "automatically generated and replies are not processed."
158 );
159 }
160 //
161 //
162 //==============================================================================================================
163 //==============================================================================================================
164 //==== Time Locale ===========================================================================================
165 //==============================================================================================================
166 //==============================================================================================================
167 //Time locale is tricky because of U.S. daylight savings time, which is sometimes problematic because of
168 //local legislation and pending legislation being inconsistent with the Linux code base. For that reason,
169 //the translation between the server's time and the client local time used for scheduling is handled with a
170 //function in the CONFIG file--that gives the option of making very sophisticated mappings if it ever becomes
171 //necessary.
172 //
173 //This mapping is provided because the server's time may be different than the time at the FBO. It would be
174 //possible, for example, to have an FBO in Los Angeles, California, USA served by a server in Paris, France.
175 //
176 //If you use FBO-Prime and have developed alternate mappings, please e-mail them to the authors so they
177 //can be included in the documentation.
178 //
179 function CONFIG_unix_sched_time_map( $unix_seconds, //Input, Unix server seconds, string (string to
180 //deal with the 2037 A.D. Unix epoch issue).
181 $unix_nanoseconds, //Input, Unix server nanoseconds, integer, 0-999,999,999.
182 &$sched_year, //Output, client locale year, integer, 2,000-2,099.
183 &$sched_month, //Output, client locale month, integer, 1-12.
184 &$sched_day, //Output, client locale day of month, integer, 1-31.
185 &$sched_hour, //Output, client locale hour, integer, 0-23.
186 &$sched_minute, //Output, client locale minute, integer, 0-59.
187 &$sched_second, //Output, client locale second, integer, 0-59.
188 &$sched_microsecond, //Output, client locale microsecond, integer, 0-999,999.
189 &$sched_dow //Output, day of week, integer, 0-6, 0=Sunday.
190 )
191 {
192 //At the present time, should use the built-in PHP functions to convert from integer seconds to
193 //the time and so on. Later on, may do it another way. The built-in PHP functions will probably
194 //not work for anything over 2037. Probably want to use bcmath, subtract out the GMT seconds
195 //at midnight on Jan 1, 2000, etc.
196
197 //Integer Unix seconds for use with PHP date() function--simple typecast should work until 2037 A.D.
198 $unix_seconds_int = (int)$unix_seconds;
199
200 //Integer year in locale.
201 $sched_year = (int) date("Y", $unix_seconds_int);
202
203 //Integer month in locale.
204 $sched_month = (int) date("n", $unix_seconds_int);
205
206 //Integer day in locale.
207 $sched_day = (int) date("j", $unix_seconds_int);
208
209 //Integer hour in locale.
210 $sched_hour = (int) date("G", $unix_seconds_int);
211
212 //Integer minute in locale.
213 $sched_minute_string
214 = date("i", $unix_seconds_int);
215 if (SubStr($sched_minute_string, 0, 1) == "0")
216 $sched_minute_string = SubStr($sched_minute_string, 1, 1);
217 $sched_minute = (int)$sched_minute_string;
218
219 //Integer second in locale.
220 $sched_second_string
221 = date("s", $unix_seconds_int);
222 if (SubStr($sched_second_string, 0, 1) == "0")
223 $sched_second_string = SubStr($sched_second_string, 1, 1);
224 $sched_second = (int)$sched_second_string;
225
226 //Integer microseconds in locale. Since any locale can only adjust by
227 //integer seconds, the fractional time is carried through.
228 $sched_microsecond = $unix_nanoseconds / 1000;
229
230 //Integer day of week in locale.
231 $sched_dow = (int) date("w", $unix_seconds_int);
232 }
233 //
234 //==============================================================================================================
235 //==============================================================================================================
236 //==== Miscellaneous Global Options ==========================================================================
237 //==============================================================================================================
238 //==============================================================================================================
239 //Time format.
240 //
241 define("CONFIG_TIME_FORMAT_24HR", FALSE); //Change to TRUE for military time.
242 //
243 //Date format.
244 //
245 define("CONFIG_DATE_FORMAT_EUROPEAN", FALSE); //Change to TRUE to get European dates (DD/MM/YY).
246 //
247 //==============================================================================================================
248 //==============================================================================================================
249 //==== Global Appearance Options =============================================================================
250 //==============================================================================================================
251 //==============================================================================================================
252 //Default color used for most backgrounds, etc. to give a consistent color scheme.
253 define("CONFIG_GLOBAL_COLOR_BACKGROUND", "AAAACC");
254 //
255 //Default colors used for small banner bars, such as appear in the scheduling
256 //mini-calendar.
257 define("CONFIG_GLOBAL_BANNERBAR_MINI_A", "ADD8E6");
258 define("CONFIG_GLOBAL_BANNERBAR_MINI_B", "888888");
259 //
260 //Color used for unvisited, visited, and active links.
261 define("CONFIG_GLOBAL_COLOR_LINK", "4040C0" );
262 define("CONFIG_GLOBAL_COLOR_UVLINK", CONFIG_GLOBAL_COLOR_LINK );
263 define("CONFIG_GLOBAL_COLOR_VLINK", CONFIG_GLOBAL_COLOR_LINK );
264 define("CONFIG_GLOBAL_COLOR_ALINK", CONFIG_GLOBAL_COLOR_LINK );
265 //
266 //Colors used for serious error notices.
267 define("CONFIG_GLOBAL_COLOR_ERROR_BG", "FF8080" );
268 define("CONFIG_GLOBAL_COLOR_ERROR_TEXT", "000000" );
269 //
270 //Whether to generate pretty HTML (pretty = formatted for human viewing). Pretty
271 //HTML is good for human viewing and useful in debugging, but takes longer for the browser to load,
272 //especially over a slow communication channel.
273 define("CONFIG_HTML_PRETTY", TRUE);
274 //
275 //==============================================================================================================
276 //==============================================================================================================
277 //==== Scheduling Day View Appearance Options ================================================================
278 //==============================================================================================================
279 //==============================================================================================================
280 //Color used for the background of the login box, choices, mini-calendars.
281 define("CONFIG_SCHED_COLOR_BACKGROUND", CONFIG_GLOBAL_COLOR_BACKGROUND);
282 //
283 //Color used for the table cells displaying time.
284 define("CONFIG_SCHED_COLOR_TABLE_TIME_CELL", CONFIG_GLOBAL_COLOR_BACKGROUND);
285 //
286 //Colors used for calendar dates in the mini-calendar when the day is both the current
287 //day and the one being viewed, the calendar day only, and the day being viewed only.
288 define("CONFIG_SCHED_COLOR_MINICAL_CURVIEW", "FFFFFF" );
289 define("CONFIG_SCHED_COLOR_MINICAL_CURONLY", "5F9EA0" );
290 define("CONFIG_SCHED_COLOR_MINICAL_VIEWONLY", "3CB371" );
291 //
292 //Colors used for cells in the scheduling matrix.
293 define("CONFIG_SCHED_COLOR_DSMAT_THEAD", "AAAAAA" ); //Top/bot column headings.
294 define("CONFIG_SCHED_COLOR_DSMAT_LHEAD", "AAAAAA" ); //Left row headings.
295 define("CONFIG_SCHED_COLOR_DSMAT_RIDLE", "FFFFFF" ); //Idle reservation cells.
296 define("CONFIG_SCHED_COLOR_DSMAT_RBANN", "80FF80" ); //Banner reservation cells.
297 define("CONFIG_SCHED_COLOR_DSMAT_RACTV", "8080FF" ); //Active reservation cells.
298 define("CONFIG_SCHED_COLOR_DSMAT_RSTBY", "B0B0B0" ); //Standby reservation cells.
299 //
300 //==============================================================================================================
301 //==============================================================================================================
302 //==== Scheduling Behavior Options ===========================================================================
303 //==============================================================================================================
304 //==============================================================================================================
305 //The number of months before and after the current date where a user is able to view and (in the future
306 //only) change the schedule. The limit works in a whole month sense, i.e. either an entire month is or is
307 //not viewable and schedulable. Both of these limits work in a <= or >= sense. For the lower limit,
308 // PRES - PAST <= PAST_LIMIT
309 //and for the upper limit,
310 // FUTU - PRES <= FUTURE_LIMIT
311 //So, for example, a limit of one for both would allow one to view the past month and the next month.
312 //
313 define("CONFIG_SCHED_SCHEDACC_PREV_MO", 4 );
314 define("CONFIG_SCHED_SCHEDACC_FUTU_MO", 7 );
315 //
316 //The lockout period where a user can't make reservations any fewer than this many hours before the
317 //scheduled time.
318 define("CONFIG_SCHED_RESV_BUFF_HRS", 12 );
319 //
320 //The number of hours days that a reservation purely in the past can be modified by _anyone_. After some
321 //period of time it becomes a historical record and should not be modified.
322 define("CONFIG_SCHED_RESV_PAST_LOCK_DAYS", 2 );
323 //
324 //The layout of the scheduling day view in terms of the hours of the day displayed. The hours of the day
325 //are divided into panels, not necessarily non-overlapping. This array defines the panels.
326 //The upper limits on the panels are "closed", i.e. 0,9 means midnight through 9:59 a.m.
327 //The paneling scheme may not have a panel that crosses midnight (reservations may cross midnight,
328 //of course, but one of the assumptions made in the reservation display code is that panels do not
329 //cross midnight).
330 $CONFIG_SCHED_DAY_PANELS = array( 0, 9,
331 7, 18,
332 14, 23 );
333 //
334 //==============================================================================================================
335 //==============================================================================================================
336 //==== Logging Options =======================================================================================
337 //==============================================================================================================
338 //==============================================================================================================
339 //The number of log entries that should be retained in the log. 500,000 seems like a reasonable number. For
340 //an FBO that gets 2,000 log entries per day, this gives a history of the better part of a year--seems good
341 //enough. Disk space consumption has not been estimated.
342 //
343 define("CONFIG_LOG_MAX_ENTRIES", 500000);
344 //
345 //==============================================================================================================
346 //==============================================================================================================
347 //==== Login Recovery Options ================================================================================
348 //==============================================================================================================
349 //==============================================================================================================
350 //The number of minutes for which temporary passwords are valid.
351 //
352 define("CONFIG_LOGIN_REC_TEMP_PW_LIFETIME", 30);
353 //
354 //==============================================================================================================
355 //==============================================================================================================
356 //==== User Creation and Privilege Options ===================================================================
357 //==============================================================================================================
358 //==============================================================================================================
359 //The array below represents the pecking order at the typical FBO. For each category of user, the array
360 //contains, in order:
361 // a)The security level of the category. (A smaller integer corresponds to more privilege.)
362 // b)The text description of the category of user. This is suitable for drop-down lists in web forms.
363 // c)A shorter text tag of the category of user. This must contain no spaces.
364 // d)The privilege string to use when creating this category of user.
365 //
366 //Note that the integer index of the category of user is implied by its location in the table.
367 //
368 $CONFIG_FBO_USER_CATEGORIES = array(
369 //--------------------------------------------------------------------------------
370 //The database administrator has even more privileges than the owner/operator of the FBO.
371 //There may be technical changes to the database and so on that the DB admin may make but which
372 //would be dangerous for non-technical users to make.
373 0,
374 "Database Administrator",
375 "CONFIG_FBO_USR_CAT_DBADMIN",
376 "",
377 //--------------------------------------------------------------------------------
378 //The owner/partner of the FBO has every non-technical privilege. Additionally, because
379 //they have a security level with more privilege than any other category of user, nobody at
380 //the business may alter their privileges.
381 1,
382 "Owner/Partner",
383 "CONFIG_FBO_USR_CAT_OWNERPARTNER",
384 "\\canviewlogentries=\"\"" . //Can view logs.
385 "\\canresetpasswords=\"\"" . //Can reset passwords.
386 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
387 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
388 //--------------------------------------------------------------------------------
389 //The manager of the FBO is/are the individual(s) who run the FBO on a day-to-day
390 //basis.
391 2,
392 "Manager",
393 "CONFIG_FBO_USR_CAT_MANAGER",
394 "\\canviewlogentries=\"\"" . //Can view logs.
395 "\\canresetpasswords=\"\"" . //Can reset passwords.
396 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
397 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
398 //--------------------------------------------------------------------------------
399 //The office manager is typically below the manager. Just to prevent accidents,
400 //this is probably the lowest-ranking employee that should be able to modify
401 //resources. Other employees are certainly trustworthy, but human curiousity
402 //is what it is, and computers are what they are.
403 3,
404 "Office Manager",
405 "CONFIG_FBO_USR_CAT_OFFICEMANAGER",
406 "\\canviewlogentries=\"\"" . //Can view logs.
407 "\\canresetpasswords=\"\"" . //Can reset passwords.
408 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
409 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
410 //--------------------------------------------------------------------------------
411 //The flight instructors, office employees, and mechanics have quite liberal
412 //privileges, but less than the office manager (to prevent accidents).
413 4,
414 "Flight Instructor",
415 "CONFIG_FBO_USR_CAT_FLIGHTINSTRUCTOR",
416 "\\canviewlogentries=\"\"" . //Can view logs.
417 "\\canresetpasswords=\"\"" . //Can reset passwords.
418 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
419 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
420 //--------------------------------------------------------------------------------
421 //Office employee
422 4,
423 "Office Employee",
424 "CONFIG_FBO_USR_CAT_OFFICEEMPLOYEE",
425 "\\canviewlogentries=\"\"" . //Can view logs.
426 "\\canresetpasswords=\"\"" . //Can reset passwords.
427 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
428 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
429 //--------------------------------------------------------------------------------
430 //Mechanic
431 4,
432 "Mechanic",
433 "CONFIG_FBO_USR_CAT_MECHANIC",
434 "\\canviewlogentries=\"\"" . //Can view logs.
435 "\\canresetpasswords=\"\"" . //Can reset passwords.
436 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
437 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
438 //--------------------------------------------------------------------------------
439 //Line Employee: Fewer privileges than flight instructors and others.
440 5,
441 "Line Employee",
442 "CONFIG_FBO_USR_CAT_LINEEMPLOYEE",
443 "\\canviewlogentries=\"\"" . //Can view logs.
444 "\\canresetpasswords=\"\"" . //Can reset passwords.
445 "\\canviewreservationdetails=\"\"" . //Can view reservation details.
446 "\\sesslifetimedefault=\"900\"", //15 minutes default logout time.
447 //--------------------------------------------------------------------------------
448 //Customer: fewest privileges of all.
449 20,
450 "Customer",
451 "CONFIG_FBO_USR_CAT_CUSTOMER",
452 "\\sesslifetimedefault=\"1800\"", //30 minutes default logout time.
453 );
454 //The session lifetime (seconds) to use if the user who logs in does not have the necessary
455 //information in the permission string.
456 define("CONFIG_SESS_LIFETIME_DEFAULT", 1200); //20 minutes
457 //
458 //--------------------------------------------------------------------------------------------------------------
459 //End of $RCSfile: config.inc,v $.
460 //--------------------------------------------------------------------------------------------------------------
461 ?>

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25