diff options
author | Yuchen Pei <hi@ypei.me> | 2021-10-14 15:16:42 +1100 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2021-10-14 15:16:42 +1100 |
commit | 07f5140771388c9e0c8a99b0dd2e5d950bdb173b (patch) | |
tree | 323c00faef1edc7dea2e88ff581cc2258b2b6432 /Config | |
parent | e119be145500700f3c465e12664403a07530a421 (diff) |
moving h-source subdir out.
Diffstat (limited to 'Config')
-rw-r--r-- | Config/Autoload.php | 44 | ||||
-rwxr-xr-x | Config/Config.php | 58 | ||||
-rwxr-xr-x | Config/Reporting.php | 41 | ||||
-rwxr-xr-x | Config/Restricted.php | 94 | ||||
-rw-r--r-- | Config/Route.php | 280 |
5 files changed, 517 insertions, 0 deletions
diff --git a/Config/Autoload.php b/Config/Autoload.php new file mode 100644 index 0000000..ee43c13 --- /dev/null +++ b/Config/Autoload.php @@ -0,0 +1,44 @@ +<?php + +// EasyGiant is a PHP framework for creating and managing dynamic content +// +// Copyright (C) 2009 - 2011 Antonio Gallo +// See COPYRIGHT.txt and LICENSE.txt. +// +// This file is part of EasyGiant +// +// EasyGiant is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// EasyGiant is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with EasyGiant. If not, see <http://www.gnu.org/licenses/>. + +if (!defined('EG')) die('Direct access not allowed!'); + + +//class containing all the PHP files that have to be loaded at the beginning of the EasyGiant execution +//the files have to be saved in Application/Include +//all the files have to be PHP files!! +class Autoload +{ + + public static $files = array( + 'params.php', + 'distributions.php', + 'myFunctions.php', + 'hardware.php', + 'languages.php', + 'license.php', + 'vendorTranslations.php', + 'wikiFormatting.php', + 'version.php', + ); + +}
\ No newline at end of file diff --git a/Config/Config.php b/Config/Config.php new file mode 100755 index 0000000..1290751 --- /dev/null +++ b/Config/Config.php @@ -0,0 +1,58 @@ +<?php + +// EasyGiant is a PHP framework for creating and managing dynamic content +// +// Copyright (C) 2009 - 2011 Antonio Gallo +// See COPYRIGHT.txt and LICENSE.txt. +// +// This file is part of EasyGiant +// +// EasyGiant is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// EasyGiant is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with EasyGiant. If not, see <http://www.gnu.org/licenses/>. + +if (!defined('EG')) die('Direct access not allowed!'); + + +define('DB', 'hnode'); +define('USER', 'root'); +define('PWD', ''); +define('HOST', 'localhost'); + +/*default controller name*/ +define('DEFAULT_CONTROLLER','home'); + +/*default action*/ +define('DEFAULT_ACTION','index'); + +/*website parameters*/ +define('DOMAIN_NAME','localhost'); + +/*type of database.*/ +//it can be: Mysql, Mysqli or None (first letter in uppercase) +define('DATABASE_TYPE','Mysqli'); + +/*error controller*/ +/*if you set ERROR_CONTROLLER to false, than EasyGiant will set ERROR_CONTROLLER equal to DEFAULT_CONTROLLER*/ +define('ERROR_CONTROLLER','home'); + +/*error action*/ +/*if you set ERROR_ACTION to false, than EasyGiant will set ERROR_ACTION equal to DEFAULT_ACTION*/ +define('ERROR_ACTION','index'); + +/*charset*/ +// set the charset used by all the functions that manage multi byte strings (mb_string functions, htmlentitites, etc) +define('DEFAULT_CHARSET','UTF-8'); + +/*rewrite settings*/ +//set MOD_REWRITE_MODULE to true if you have installed the mod_rewrite module of the server, otherwise MOD_REWRITE_MODULE to false +define('MOD_REWRITE_MODULE',true); diff --git a/Config/Reporting.php b/Config/Reporting.php new file mode 100755 index 0000000..5a2405f --- /dev/null +++ b/Config/Reporting.php @@ -0,0 +1,41 @@ +<?php + +// All EasyGiant code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +// See COPYRIGHT.txt and LICENSE.txt. + +if (!defined('EG')) die('Direct access not allowed!'); + + +//ERROR REPORTING DIRECTIVES + +//set RUNTIME_CONFIGURATION to true if you can't access the php.ini file of your PHP installation and you need to modify some PHP directives +//set RUNTIME_CONFIGURATION to false if you can access the php.ini file. In this case, modify the PHP directives in the php.ini file. +define ('RUNTIME_CONFIGURATION',true); + +// !!! the following four directives will be applied only if RUNTIME_CONFIGURATION has been set to true !!! + +//set the php.ini error_reporting directive +define ('ERROR_REPORTING_DIRECTIVE','E_ALL & ~E_DEPRECATED & ~E_STRICT'); + +//set the php.ini display_errors directive +//set to On or Off +define ('DISPLAY_ERRORS','Off'); + +//set if the error file (see the next directive) has to be created or not +//set ERROR_REPORTING_FILE to true if you want that EasyGiant saves the errors in the LOG_ERROR_FILE (next), otherwise set ERROR_REPORTING_FILE to false +define ('ERROR_REPORTING_FILE',false); + +//only if ERROR_REPORTING_FILE has been set to true +//set the file where the errors will be saved +//default: EasyGiant_root/Logs/Errors.log +//check that the LOG_ERROR_FILE is writeble (by the apache user if you are using mod_apache) +define ('LOG_ERROR_FILE','default'); + + +//max length of each $_POST element +//set MAX_POST_LENGTH equal to 0 if you don't want any checks upon the $_POST elements +define ('MAX_POST_LENGTH',100000); + +//max length of the REQUEST_URI +//set MAX_REQUEST_URI_LENGTH equal to 0 if you don't want to set an upper limit in the length of the REQUEST_URI +define ('MAX_REQUEST_URI_LENGTH',400); diff --git a/Config/Restricted.php b/Config/Restricted.php new file mode 100755 index 0000000..4008967 --- /dev/null +++ b/Config/Restricted.php @@ -0,0 +1,94 @@ +<?php + +// All EasyGiant code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +// See COPYRIGHT.txt and LICENSE.txt. + +if (!defined('EG')) die('Direct access not allowed!'); + + + +//RESRICTED ACCESS PARAMETERS + +//define the hash algoritm to be used in order to protect your password +//only md5 and sha1 are supported +define('PASSWORD_HASH','sha1'); + + + +//ADMINISTRATOR USERS LOGIN DIRECTIVES: + +//time that has to pass after a login failure before the user is allowed to try to login another time (in seconds) +define('ADMIN_TIME_AFTER_FAILURE','5'); + +//redirect to panel when successfully logged in: +define('ADMIN_PANEL_CONTROLLER', 'panel'); +define('ADMIN_PANEL_MAIN_ACTION', 'main'); + +//redirect to login form if access not allowed: +define('ADMIN_USERS_CONTROLLER', 'adminusers'); +define('ADMIN_USERS_LOGIN_ACTION', 'login'); + +//admin cookie: +define('ADMIN_COOKIE_NAME','uid'); +define('ADMIN_SESSION_EXPIRE', '3600'); +define('ADMIN_COOKIE_PATH', '/'); +define('ADMIN_COOKIE_DOMAIN', ''); +define('ADMIN_COOKIE_SECURE', false); + +//tables: +define('ADMIN_USERS_TABLE','adminusers'); +define('ADMIN_GROUPS_TABLE','admingroups'); +define('ADMIN_SESSIONS_TABLE','adminsessions'); +define('ADMIN_MANYTOMANY_TABLE','adminusers_groups'); +define('ADMIN_ACCESSES_TABLE','accesses'); + +//hijacking checks +define('ADMIN_HIJACKING_CHECK',true); //can be true or false +//session hijacking +//set ADMIN_ON_HIJACKING_EVENT equal to 'forceout' if you want to cause the logout of the user if there is the suspect of a session hijacking +//set ADMIN_ON_HIJACKING_EVENT equal to 'redirect' if you want to redirect the user to the ADMIN_HIJACKING_ACTION (see later) if there is the suspect of a session hijacking +define('ADMIN_ON_HIJACKING_EVENT','forceout'); //it can be 'forceout' or 'redirect' +//only if ADMIN_ON_HIJACKING_EVENT = 'redirect' +//redirect the user to ADMIN_USERS_CONTROLLER/ADMIN_HIJACKING_ACTION if there is the suspect of a session hijacking +define('ADMIN_HIJACKING_ACTION','retype'); + + + + +//REGISTERED USERS LOGIN DIRECTIVES: + +//time that has to pass after a login failure before the user is allowed to try to login another time (in seconds) +define('REG_TIME_AFTER_FAILURE','5'); + +//redirect to home when successfully logged in: +define('REG_PANEL_CONTROLLER', 'home'); +define('REG_PANEL_MAIN_ACTION', 'index'); + +//redirect to login form if access not allowed: +define('REG_USERS_CONTROLLER', 'users'); +define('REG_USERS_LOGIN_ACTION', 'login'); + +//registered cookie: +//NB: REG_COOKIE_NAME must be different from ADMIN_COOKIE_NAME!!! +define('REG_COOKIE_NAME','uidr'); +define('REG_SESSION_EXPIRE', '86400'); +define('REG_COOKIE_PATH', '/'); +define('REG_COOKIE_DOMAIN', ''); +define('REG_COOKIE_SECURE', false); + +//tables: +define('REG_USERS_TABLE','regusers'); +define('REG_GROUPS_TABLE','reggroups'); +define('REG_SESSIONS_TABLE','regsessions'); +define('REG_MANYTOMANY_TABLE','regusers_groups'); +define('REG_ACCESSES_TABLE','regaccesses'); + +//hijacking checks +define('REG_HIJACKING_CHECK',true); //can be true or false +//session hijacking +//set ADMIN_ON_HIJACKING_EVENT equal to 'forceout' if you want to cause the logout of the user if there is the suspect of a session hijacking +//set ADMIN_ON_HIJACKING_EVENT equal to 'redirect' if you want to redirect the user to the ADMIN_HIJACKING_ACTION (see later) if there is the suspect of a session hijacking +define('REG_ON_HIJACKING_EVENT','forceout'); //it can be 'forceout' or 'redirect' +//only if ADMIN_ON_HIJACKING_EVENT = 'redirect' +//redirect the user to ADMIN_USERS_CONTROLLER/ADMIN_HIJACKING_ACTION if there is the suspect of a session hijacking +define('REG_HIJACKING_ACTION','retype'); diff --git a/Config/Route.php b/Config/Route.php new file mode 100644 index 0000000..9086b08 --- /dev/null +++ b/Config/Route.php @@ -0,0 +1,280 @@ +<?php + +// EasyGiant is a PHP framework for creating and managing dynamic content +// +// Copyright (C) 2009 - 2011 Antonio Gallo +// See COPYRIGHT.txt and LICENSE.txt. +// +// This file is part of EasyGiant +// +// EasyGiant is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// EasyGiant is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with EasyGiant. If not, see <http://www.gnu.org/licenses/>. + +if (!defined('EG')) die('Direct access not allowed!'); + +class Route +{ + + //controller,action couples that can be reached by the browser + //set 'all' if you want that all the controller,action couples can be reached by the browser + public static $allowed = array( + 'contact,index', + 'credits,index', + 'hardware,catalogue', + 'help,page', + 'faq,page', + 'home,index', + 'image,captcha', + 'issues,viewall', + 'issues,view', + 'my,home', + 'my,password', + 'my,email', + 'my,profile', + 'my,goodbye', + 'notebooks,catalogue', + 'notebooks,view', + 'notebooks,history', + 'notebooks,revision', + 'notebooks,insert', + 'notebooks,update', + 'notebooks,differences', + 'notebooks,climb', + 'notebooks,talk', + 'project,index', + 'users,login', + 'users,logout', + 'users,add', + 'users,confirm', + 'users,change', + 'users,forgot', + 'users,notice', + 'meet,user', + 'meet,contributions', + 'meet,hardware', + 'meet,issues', + 'meet,messages', + 'meet,talk', + 'meet,wiki', + 'meet,wikitalk', + 'wifi,catalogue', + 'wifi,view', + 'wifi,history', + 'wifi,revision', + 'wifi,insert', + 'wifi,update', + 'wifi,differences', + 'wifi,climb', + 'wifi,talk', + 'videocards,catalogue', + 'videocards,view', + 'videocards,history', + 'videocards,revision', + 'videocards,insert', + 'videocards,update', + 'videocards,differences', + 'videocards,climb', + 'videocards,talk', + 'printers,catalogue', + 'printers,view', + 'printers,history', + 'printers,revision', + 'printers,insert', + 'printers,update', + 'printers,differences', + 'printers,climb', + 'printers,talk', + 'scanners,catalogue', + 'scanners,view', + 'scanners,history', + 'scanners,revision', + 'scanners,insert', + 'scanners,update', + 'scanners,differences', + 'scanners,climb', + 'scanners,talk', + 'search,form', + 'search,results', + 'search,pciid', + 'search,lspci', + 'generic,del', + 'generic,cleared', + 'news,index', + 'download,index', + 'download,all', + 'download,notebooks', + 'download,wifi', + 'download,videocards', + 'download,printers', + 'download,scanners', + 'download,threegcards', + 'download,soundcards', + 'download,webcams', + 'download,bluetooth', + 'download,acquisitioncards', + 'download,fingerprintreaders', + 'download,ethernetcards', + 'download,sdcardreaders', + 'download,modems', + 'download,raidadapters', + 'download,hostcontrollers', + 'history,hide', + 'history,show', + 'history,block', + 'history,unblock', + 'history,open', + 'history,close', + 'history,pageblock', + 'history,pageunblock', + 'history,viewall', + 'history,pagehide', + 'history,pageshow', + 'history,devicehide', + 'history,deviceshow', + 'history,deviceapprove', + 'history,deviceclear', + 'history,issuehide', + 'history,issueshow', + 'threegcards,catalogue', + 'threegcards,view', + 'threegcards,history', + 'threegcards,revision', + 'threegcards,insert', + 'threegcards,update', + 'threegcards,differences', + 'threegcards,climb', + 'threegcards,talk', + 'soundcards,catalogue', + 'soundcards,view', + 'soundcards,history', + 'soundcards,revision', + 'soundcards,insert', + 'soundcards,update', + 'soundcards,differences', + 'soundcards,climb', + 'soundcards,talk', + 'webcams,catalogue', + 'webcams,view', + 'webcams,history', + 'webcams,revision', + 'webcams,insert', + 'webcams,update', + 'webcams,differences', + 'webcams,climb', + 'webcams,talk', + 'rss,modifications', + 'rss,statusnet', + 'rss,notapproved', + 'special,modifications', + 'special,modactions', + 'special,adminactions', + 'special,usersactions', + 'special,deleted', + 'special,notapproved', + 'wiki,insert', + 'wiki,update', + 'wiki,page', + 'wiki,history', + 'wiki,revision', + 'wiki,differences', + 'wiki,climb', + 'wiki,talk', + 'wiki,modifications', + 'wiki,pages', + 'wiki,deleted', + 'wiki,blocked', + 'bluetooth,catalogue', + 'bluetooth,view', + 'bluetooth,history', + 'bluetooth,revision', + 'bluetooth,insert', + 'bluetooth,update', + 'bluetooth,differences', + 'bluetooth,climb', + 'bluetooth,talk', + 'client,licenseinfo', + 'client,userinfo', + 'acquisitioncards,catalogue', + 'acquisitioncards,view', + 'acquisitioncards,history', + 'acquisitioncards,revision', + 'acquisitioncards,insert', + 'acquisitioncards,update', + 'acquisitioncards,differences', + 'acquisitioncards,climb', + 'acquisitioncards,talk', + 'fingerprintreaders,catalogue', + 'fingerprintreaders,view', + 'fingerprintreaders,history', + 'fingerprintreaders,revision', + 'fingerprintreaders,insert', + 'fingerprintreaders,update', + 'fingerprintreaders,differences', + 'fingerprintreaders,climb', + 'fingerprintreaders,talk', + 'ethernetcards,catalogue', + 'ethernetcards,view', + 'ethernetcards,history', + 'ethernetcards,revision', + 'ethernetcards,insert', + 'ethernetcards,update', + 'ethernetcards,differences', + 'ethernetcards,climb', + 'ethernetcards,talk', + 'sdcardreaders,catalogue', + 'sdcardreaders,view', + 'sdcardreaders,history', + 'sdcardreaders,revision', + 'sdcardreaders,insert', + 'sdcardreaders,update', + 'sdcardreaders,differences', + 'sdcardreaders,climb', + 'sdcardreaders,talk', + 'modems,catalogue', + 'modems,view', + 'modems,history', + 'modems,revision', + 'modems,insert', + 'modems,update', + 'modems,differences', + 'modems,climb', + 'modems,talk', + 'raidadapters,catalogue', + 'raidadapters,view', + 'raidadapters,history', + 'raidadapters,revision', + 'raidadapters,insert', + 'raidadapters,update', + 'raidadapters,differences', + 'raidadapters,climb', + 'raidadapters,talk', + 'hostcontrollers,catalogue', + 'hostcontrollers,view', + 'hostcontrollers,history', + 'hostcontrollers,revision', + 'hostcontrollers,insert', + 'hostcontrollers,update', + 'hostcontrollers,differences', + 'hostcontrollers,climb', + 'hostcontrollers,talk', + ); + + //it can be 'yes' or 'no' + //set $rewrite to 'yes' if you want that EasyGiant rewrites the URLs according to what specified in $map + public static $rewrite = 'no'; + + //define the urls of your website + //you have to set $rewrite to 'yes' + public static $map = array(); + +}
\ No newline at end of file |