<?php

/**
 * @category        modules
 * @package         preferences
 * @author          WBCE Project
 * @copyright       Norbert Heimsath
 * @license         GPLv2
 */
// no direct file access
if (count(get_included_files()) == 1) {
    die(header("Location: ../index.php", TRUE, 301));
}
// Register Class to autoloader
WbAuto::AddFile("Preferences", "/modules/preferences/classes/preferences.php");
 /**
     @brief Adds a new search template to the list of search templates.
 Templates are used to look for matching files in the directory search.
 @code
     //  %s is the classname.
     WbAuto::AddType("class.%s.inc.php");
     WbAuto::AddType("%s.php");
     WbAuto::AddType("%s.class.php");
     @endcode 
 @param string $Type
         The search pattern/template to add.
 @retval boolean/string
         Returns false on success, and an error message on failure.     
 */
 public static function AddType($Type)
 {
     // Add Search template
     WbAuto::$Types[] = $Type;
     //avoid double entries
     WbAuto::$Types = array_unique(WbAuto::$Types);
     return false;
 }
<?php

/**
@file
@brief This file registers the date and time picker to the WBCE autoloader.
Initialize is loaded in frontend and backend. 

@category        modules
@author          Norbert Heimsath
@copyright       GPL v2
*/
//no direct file access
if (count(get_included_files()) == 1) {
    die(header("Location: ../index.php", TRUE, 301));
}
// Register Class to autoloader
WbAuto::AddFile("DateTimePicker", "/modules/date_time_picker/classes/datetimepicker.php");
    $protocoll = "https";
}
define("WB_PROTOCOLL", $protocoll);
// SELECTED AND CHECKED
// are needed in so many forms that i decided to lazy define them here
if (!defined('WB_SELECT')) {
    define('WB_SELECT', ' selected="selected" ');
}
if (!defined('WB_CHECK')) {
    define('WB_CHECK', ' checked="checked" ');
}
// AUTOLOADERS
// register WB Autoloader
WbAuto::AddFile("idna_convert", "/include/idna_convert/idna_convert.class.php");
WbAuto::AddFile("SecureForm", "/framework/classes/SecureForm.php");
WbAuto::AddFile("PclZip", "/include/pclzip/pclzip.lib.php");
// register PHPMailer autoloader ---
require WB_PATH . '/include/phpmailer/PHPMailerAutoload.php';
// GLOBAL SETTINGS
// Get all global settings as constants from DB Settings
Settings::Setup();
// RESULTING CONSTANTS
// some resulting constants need to be set manually
// DO_NOT_TRACK (deprecated, not used and we remove this soon)
define('DO_NOT_TRACK', isset($_SERVER['HTTP_DNT']));
// Filemodes
$string_file_mode = STRING_FILE_MODE;
define('OCTAL_FILE_MODE', (int) octdec($string_file_mode));
define('WB_OCTAL_FILE_MODE', (int) octdec($string_file_mode));
//Dirmodes
$string_dir_mode = STRING_DIR_MODE;
}
if (isset($_SERVER['SERVER_PORT']) and $_SERVER['SERVER_PORT'] == 443) {
    $protocoll = "https";
}
if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] and $_SERVER['HTTPS'] != "off") {
    $protocoll = "https";
}
define("WB_PROTOCOLL", $protocoll);
// sanitize $_SERVER['HTTP_REFERER']
SanitizeHttpReferer();
date_default_timezone_set('UTC');
// register WB Autoloader
require WB_PATH . "/framework/class.autoload.php";
WbAuto::AddDir("/framework/");
WbAuto::AddFile("idna_convert", "/include/idna_convert/idna_convert.class.php");
WbAuto::AddFile("SecureForm", "/framework/SecureForm.php");
// register TWIG autoloader ---
require WB_PATH . '/include/Sensio/Twig/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
// register PHPMailer autoloader ---
require WB_PATH . '/include/phpmailer/PHPMailerAutoload.php';
// Create database class
$database = new database();
// get all settings as constants
Settings::Setup();
// some resulting constants need to be set manually
define('DO_NOT_TRACK', isset($_SERVER['HTTP_DNT']));
$string_file_mode = STRING_FILE_MODE;
define('OCTAL_FILE_MODE', (int) octdec($string_file_mode));
$string_dir_mode = STRING_DIR_MODE;
define('OCTAL_DIR_MODE', (int) octdec($string_dir_mode));
<?php

//no direct file access
if (count(get_included_files()) == 1) {
    die(header("Location: ../index.php", TRUE, 301));
}
// Register Class to autoloader
WbAuto::AddFile("upload", "/modules/phplib/classes/src/class.upload.php");