271 lines
13 KiB
PHP
271 lines
13 KiB
PHP
<?php
|
|
/// @file Config.inc.php
|
|
/// This page controls all configuration parameters, of which there are many.
|
|
///
|
|
/// Each configuration parameter is carefully described in detail in the comments as
|
|
/// an aid to the user that is configuring the application.
|
|
///
|
|
/// @note Since this file contains numerous settings, including security settings
|
|
/// documentation is turned off.
|
|
///
|
|
/// @attention This program is copyright (c) 2019 - 2024 by Smartware Computing, all
|
|
/// rights reserved.
|
|
///
|
|
/// This software, and/or material is the property of Smartware Computing. All
|
|
/// use, disclosure, and/or reproduction not specifically authorized by Smartware
|
|
/// Computing is prohibited.
|
|
///
|
|
/// @author David Smart, Smartware Computing
|
|
///
|
|
/// @cond DONT_DOXYGEN
|
|
|
|
// Start a timestamp for any db transactions
|
|
$time_start = microtime(true);
|
|
|
|
// Standard script protection for files that should not be directly accessed
|
|
if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
|
|
print "Web wanderer coming from IP " . $_SERVER["REMOTE_ADDR"] . ", you cannot access an include file directly.";
|
|
exit;
|
|
}
|
|
|
|
define("AppVersion", 0.1);
|
|
define("COPYRIGHT_AUTHOR", "Smartware Computing"); // do not change
|
|
|
|
define("TBL_BORDER", 0); // show borders on the tables
|
|
|
|
$allowedTypes = [
|
|
'image/jpeg' => '.jpg',
|
|
'image/jfif' => '.jpg',
|
|
'image/png' => '.png',
|
|
'image/gif' => '.gif',
|
|
'application/pdf' => '.pdf',
|
|
];
|
|
|
|
$Artifacts = "./Artifacts"; // no trailing slashes
|
|
$UploadPath = "./inc/Uploads";
|
|
$EventsPath = "./Artifacts/Events";
|
|
$PlacesPath = "./Artifacts/Places";
|
|
$HeadersPath = "./Artifacts/Headers";
|
|
$ProgChairPath = "./Artifacts/ProgChair";
|
|
|
|
$WritableFolders = array(
|
|
$Artifacts,$UploadPath, $EventsPath, $PlacesPath, $HeadersPath,
|
|
);
|
|
foreach ($WritableFolders as $folder) {
|
|
if (!is_dir($folder)) {
|
|
mkdir($folder, 0777, true);
|
|
}
|
|
}
|
|
|
|
$CK_EditorFieldIDs = array(); // holds the ids of the html edit fields
|
|
// bg: 1 = draw a separator before this item
|
|
// Attr:
|
|
$EventFormFields = [
|
|
'ProgramDate' => ['Label' => 'Program Date', 'FieldType' => 'date', 'RW' => 'R', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'ProgramTitle' => ['Label' => 'Program Title', 'FieldType' => 'text', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => 'What is this program about?', 'Default' => ''],
|
|
'ProgramDetails' => ['Label' => 'Program Details', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'ProgramPix' => ['Label' => 'Program Pictures', 'FieldType' => 'pix', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'ProgramTime' => ['Label' => 'Program Time', 'FieldType' => 'time', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => '19:00'],
|
|
'ProgramChair' => ['Label' => 'Program Chair', 'FieldType' => 'chair', 'RW' => 'W', 'bg' => '0', 'Addr' => '', 'Placeholder' => 'Chairman', 'Default' => ''],
|
|
'SpeakerName' => ['Label' => 'Speaker Name', 'FieldType' => 'text', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => 'Joe Speaker', 'Default' => ''],
|
|
'SpeakerBio' => ['Label' => 'Speaker Bio', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => 'Tell us about the speaker', 'Default' => ''],
|
|
'SpeakerPix' => ['Label' => 'Speaker Picture', 'FieldType' => 'pix' , 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'SocialFlag' => ['Label' => 'Social', 'FieldType' => 'bool', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => '1'],
|
|
'SocialTime' => ['Label' => 'Social Time', 'FieldType' => 'time', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => '17:30'],
|
|
'DinnerFlag' => ['Label' => 'Dinner', 'FieldType' => 'bool', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => '1'],
|
|
'DinnerTime' => ['Label' => 'Dinner Time', 'FieldType' => 'time', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => '18:00'],
|
|
'DinnerPlace' => ['Label' => 'Dinner Place', 'FieldType' => 'place', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'DinnerMenu' => ['Label' => 'Dinner Menu', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'TourFlag' => ['Label' => 'Tour', 'FieldType' => 'bool', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'TourTime' => ['Label' => 'Tour Time', 'FieldType' => 'time', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'TourLocationName' => ['Label' => 'Tour Location', 'FieldType' => 'text', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'TourAddress' => ['Label' => 'Tour Address', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'TourContact' => ['Label' => 'Tour Contact', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'SpecialNotes' => ['Label' => 'Special Notes', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
];
|
|
|
|
$PlaceFormFields = [
|
|
'PlaceName' => ['Label' => 'Place Name', 'FieldType' => 'text', 'RW' => 'R', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'PlaceAddress' => ['Label' => 'Place Address', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'PlacePix' => ['Label' => 'Place Picture', 'FieldType' => 'pix' , 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
];
|
|
|
|
$HeaderFormFields = [
|
|
'HeaderText' => ['Label' => 'Header Text', 'FieldType' => 'text', 'RW' => 'R', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => 'Waterloo Tech Soc.'],
|
|
'SubHeaderText' => ['Label' => 'Sub-Header Text', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '1', 'Attr' => '', 'Placeholder' => '', 'Default' => '112 Years'],
|
|
'PlacePix' => ['Label' => 'Place Picture', 'FieldType' => 'pix' , 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
];
|
|
|
|
$ProgChairFormFields = [
|
|
'ProgramChair' => ['Label' => 'Program Chair', 'FieldType' => 'text', 'RW' => 'R', 'bg' => '1', 'Attr' => '', 'Placeholder' => 'President', 'Default' => ''],
|
|
'ProgChairNotes' => ['Label' => 'Chair Notes', 'FieldType' => 'html', 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
'ProgChairPix' => ['Label' => 'Chair Picture', 'FieldType' => 'pix' , 'RW' => 'W', 'bg' => '0', 'Attr' => '', 'Placeholder' => '', 'Default' => ''],
|
|
];
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
// System Configuration settings start here
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
///////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// When there is a particularly difficult problem to unravel, typically causing server
|
|
// timeouts or web page crash-garbage, enable the tracelog.
|
|
//
|
|
// Note that this may slow performance quite a bit but will leave you the breadcrumbs you
|
|
// may need to solve the problem.
|
|
//
|
|
// When run on IIS, the following command shell item is helpful if you have tail.exe
|
|
// tail -f \\server\c$\Writable\Folder\tracelog.log
|
|
// or on linux
|
|
// tail -f /path/to/tracefile/filename.ext
|
|
//
|
|
define("TRACELOG", true);
|
|
define("TRACEPATH", __DIR__ . "/TraceLog"); // "/var/spool/php/"); /var/services/tmp
|
|
define("TRACEFILE", "trace.log");
|
|
|
|
|
|
|
|
// SECURITY SECURITY SECURITY SECURITY SECURITY SECURITY SECURITY SECURITY
|
|
// This should be set to false.
|
|
// For a brand new install, it may be set to true long enough to create your actual entry
|
|
// in the database, and configure yourself as the super user. Once you have done so, you
|
|
// should set this back to false.
|
|
//
|
|
#define("ROOTUSERENABLED", false); // false=Secure, true=Enable the following
|
|
#define("ROOTEMAIL", "root"); // please don't use root:root
|
|
#define("ROOTPASS", "root"); // and do not leave this enabled!
|
|
|
|
|
|
//
|
|
// Who to contact when things go wrong. This shows up on the login page.
|
|
//
|
|
define("CONTACT", "David@Smart-Family.net");
|
|
define("CONTACTNAME", "David Smart");
|
|
|
|
|
|
// Access the database
|
|
//
|
|
// it seems that if the computer has support for IPV6, then "localhost" may not work
|
|
// and you may want to substitute "127.0.0.1" instead.
|
|
#define("DB_SERVER", "localhost"); // Where is mySQL server from this web server
|
|
// Typical mySQL servers run on port 3306, but if you have more than one, or if you've
|
|
// changed it from the default, then 3307 is usually the next setting.
|
|
#define("DB_PORTNUM", "3307"); // Port number (typically 3306, sometimes 3307)
|
|
// This is the name of the db, and must be unique compared to any other db on your
|
|
// mysql server.
|
|
#define("DB_DBNAME", "PartsDB"); // And the name of the database to access
|
|
// This is the 'username' when the scripts access the database, not to be confused
|
|
// with the system administrator, or the expert (admin) user of the db.
|
|
#define("DB_APPNAME", "PartsDB"); // What is the username to access the db
|
|
// Similarly the script needs a password, which should be quite complex, and unlike
|
|
// any other password you may have.
|
|
#define("DB_PASSWORD", "DTM52qg0r%#WesfS7d"); // PartsDB
|
|
|
|
// Default domain for username entry, if any.
|
|
// You can probably leave this blank if you do not have a domain name.
|
|
//
|
|
#define("DEFAULT_DOMAIN", "Smart-Family.net");
|
|
|
|
// Session Name Prefix
|
|
//
|
|
// This is a text string that is unique for this implementation of the db
|
|
// application on a system. This is required because a single user that logs
|
|
// on to another instance of this tool on the same system may have differing
|
|
// access and reference information.
|
|
// This text is not seen by any user and would typically be the same as
|
|
// the "SiteFolder" (below) only without any extraneous characters (like slashes)
|
|
// and with a single trailing underscore (that is for the admin debugging things).
|
|
#$SessionName = "PartsDB";
|
|
|
|
// Create a catchy Application name to put in the header and title of web pages
|
|
$AppName = "Event Manager";
|
|
|
|
|
|
// Path to the site, which is case sensitive.
|
|
// Linux based servers are case-sensitive, so this must match
|
|
// the actual installation folder. For Windows Users, Google Map
|
|
// detects "http://domain/Path/To/Site" as a different
|
|
// site than "http://domain/path/TO/SiTe".
|
|
// For Windows systems, they all access the site correctly, but we'll redirect
|
|
// the user to the correct case-sensitive mapping so the Google Map Key
|
|
// will work properly.
|
|
#$SiteFolder = "/db/";
|
|
|
|
// SiteLogo
|
|
// If there is a graphic representing this site, it should be placed in the SiteFolder
|
|
// and the name of it identified here. Standard graphic file types are allowed.
|
|
//
|
|
#$SiteLogo = array("logo.png", "logoSmall.png");
|
|
|
|
|
|
// If guest mode is enabled, anyone may wander further into the system (read-only)
|
|
// and with limited access.
|
|
//
|
|
// FOR SECURITY, THIS OPTION SHOULD NOT BE ENABLED ON AN INTERNET FACING SERVER.
|
|
#define("GUEST_MODE_ENABLED", false); // True | False
|
|
|
|
|
|
// What's the biggest artifact we're willing to accept?
|
|
// pdf, image, zip file, whatever...
|
|
//
|
|
#define("MAXFILESIZE", 100000000);
|
|
|
|
// Allowed image types to upload. This is a bit weak in that it may
|
|
// only be inspecting them by their suffix, but that's better than not
|
|
// [Hint: Order them by most popular type first for modest speed boost]
|
|
// Use lower-case letters.
|
|
#$UploadImageExts = array("png", "jfif", "jpg", "jpeg", "bmp");
|
|
|
|
// Other filetypes that don't automatically render (like png's do).
|
|
// Other allowed filetypes that don't automatically render (like png's do).
|
|
// Each of the following should have a png icon named as in: inc/image/icon-pdf.png
|
|
#$UploadOtherExts = array("pdf","csv","xls","xlsx","stp","fcstd","lbr","zip","7z" );
|
|
|
|
|
|
// Target Path for uploads of various artifacts during normal usage (e.g. datasheet)
|
|
// or via the import operation of a compatible spreadsheet.
|
|
// This is relative to the calling page, which is probably up one
|
|
// folder from here. It can also be absolute, with respect to the file system.
|
|
//
|
|
// INCLUDE Trailing /
|
|
//
|
|
// REQUIRES: Server Write Access
|
|
$ImportPath = "./Events/";
|
|
|
|
|
|
// Formatted Description Field
|
|
//
|
|
// If you have ckEditor version 5 installed, the Description field will
|
|
// support formatted editing.
|
|
// If it cannot find this file, or if the setting is blank, it will be
|
|
// plain text.
|
|
//
|
|
$ckEditor_FQFN = "/inc/ckeditor5/ckeditor.js";
|
|
|
|
|
|
// The following enable the use of cookies for a "Remember Me" period of time.
|
|
// If the value is zero, then this feature is disabled.
|
|
// If the value is non-zero, this is the number of days to remember this user.
|
|
//
|
|
// The theory is that you close the browser (before the timeout shown below).
|
|
// Then if you come back before the remember me expiration, you're in!
|
|
#define("REMEMBER_ME_DAYS", 7);
|
|
|
|
// But, if you forget and leave a tab open, or the whole browser, and just walk
|
|
// away for this long, it will actively log you out...
|
|
#define("USER_TIMEOUT_SEC", 3600);
|
|
|
|
// Table Colorization
|
|
#$BoldBackColor = "#66CCFF"; // Header and other "bold" background
|
|
#$Alt1BackColor = "#DDEEFF"; // Pale, which alternates with Alt2
|
|
#$Alt2BackColor = "#BBDDFF"; // Pale, but a little darker#
|
|
|
|
// If PhpSpreadsheet is installed, set this.
|
|
#define("SPREADSHEET_ENABLE", true);
|
|
|
|
// Don't mess with this.
|
|
//require_once("inc/Config.php");
|
|
|
|
/// @endcond
|
|
|
|
?>
|