From: Roland Häder Date: Mon, 9 Jun 2008 14:09:31 +0000 (+0000) Subject: createUniqueID -> generateUniqueId renamed, dataset criteria added, registration... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b44e5e7347f9a1dbd49b5b47d506a4f6526caf2f;p=shipsimu.git createUniqueID -> generateUniqueId renamed, dataset criteria added, registration stub finished, local database does now select and insert data --- diff --git a/.gitattributes b/.gitattributes index f4d95f2..64cbe6f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -131,6 +131,7 @@ application/ship-simu/templates/de/html/.htaccess -text application/ship-simu/templates/de/html/nav_advert.tpl -text application/ship-simu/templates/de/html/selector_ship-simu.tpl -text db/.htaccess -text +db/user/.htaccess -text devel/.htaccess -text devel/class_Debug.php -text docs/COPYING -text @@ -277,6 +278,10 @@ inc/classes/interfaces/template/view/class_ViewHelper.php -text inc/classes/interfaces/user/.htaccess -text inc/classes/interfaces/user/class_ManageableUser.php -text inc/classes/main/.htaccess -text +inc/classes/main/actions/.htaccess -text +inc/classes/main/actions/class_ -text +inc/classes/main/actions/class_BaseAction.php -text +inc/classes/main/actions/post_registration/.htaccess -text inc/classes/main/cache/.htaccess -text inc/classes/main/cache/class_MemoryCache.php -text inc/classes/main/class_ -text diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index 3452f96..d2e4c91 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -78,7 +78,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $this->setObjectDescription("Application-Helper"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Tidy up a little $this->removeSystemArray(); diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index ac5f1ad..fffdd3d 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -63,7 +63,7 @@ class ApplicationSelector extends BaseFrameworkSystem { $this->setObjectDescription("Applikationswechsler"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Remove system array and thousand seperator $this->removeSystemArray(); diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index abe7536..87a4e30 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -82,7 +82,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $this->setObjectDescription("Application-Helper"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Tidy up a little $this->removeSystemArray(); diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index c1d4890..1b3b1a2 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -73,5 +73,8 @@ $cfg->setConfigEntry('command_parameter', "page"); // CFG: USER-REGISTRATION $cfg->setConfigEntry('user_registration', "ShipSimuRegistration"); +// CFG: USER-STATUS-REGISTER +$cfg->setConfigEntry('user_status_register', "UNCONFIRMED"); + // [EOF] ?> diff --git a/application/ship-simu/main/class_Merchant.php b/application/ship-simu/main/class_Merchant.php index b483968..1f0b3c1 100644 --- a/application/ship-simu/main/class_Merchant.php +++ b/application/ship-simu/main/class_Merchant.php @@ -40,7 +40,7 @@ class Merchant extends BaseFrameworkSystem { $this->setObjectDescription("Händler"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 96ce70d..d1cf574 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -49,7 +49,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $this->setObjectDescription("Bauvertrag"); // Unique-ID generieren - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index 4fbfdcc..0940b79 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -35,7 +35,7 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { $this->setObjectDescription("Registration handling command for Ship-Simu"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index f7616b3..4b73bcc 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -75,7 +75,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $this->setObjectDescription("Reederei"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/constructions/berths/class_Berth.php b/application/ship-simu/main/constructions/berths/class_Berth.php index 7d46833..512cf74 100644 --- a/application/ship-simu/main/constructions/berths/class_Berth.php +++ b/application/ship-simu/main/constructions/berths/class_Berth.php @@ -37,7 +37,7 @@ class Berth extends BaseConstruction { $this->setObjectDescription("Liegeplatz"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/docks/class_DryDock.php b/application/ship-simu/main/constructions/docks/class_DryDock.php index b69692a..44efd03 100644 --- a/application/ship-simu/main/constructions/docks/class_DryDock.php +++ b/application/ship-simu/main/constructions/docks/class_DryDock.php @@ -34,7 +34,7 @@ class DryDock extends BaseConstruction { $this->setObjectDescription("Trockendock"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/harbors/class_Harbor.php b/application/ship-simu/main/constructions/harbors/class_Harbor.php index eb2f6f3..6509f45 100644 --- a/application/ship-simu/main/constructions/harbors/class_Harbor.php +++ b/application/ship-simu/main/constructions/harbors/class_Harbor.php @@ -43,7 +43,7 @@ class Harbor extends BaseConstruction { $this->setObjectDescription("Hafen"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/constructions/terminals/class_Terminal.php b/application/ship-simu/main/constructions/terminals/class_Terminal.php index d8fa8a0..3d922fb 100644 --- a/application/ship-simu/main/constructions/terminals/class_Terminal.php +++ b/application/ship-simu/main/constructions/terminals/class_Terminal.php @@ -34,7 +34,7 @@ class Terminal extends BaseConstruction { $this->setObjectDescription("Anlegebrücke"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } } diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php index 3fdb10a..9b9540b 100644 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php @@ -57,7 +57,7 @@ class Shipyard extends BaseConstruction { $this->createShipTypeList(); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } // Create a shipyard and notify it about it's owner diff --git a/application/ship-simu/main/drives/motor/class_Motor.php b/application/ship-simu/main/drives/motor/class_Motor.php index b8f5377..4287d02 100644 --- a/application/ship-simu/main/drives/motor/class_Motor.php +++ b/application/ship-simu/main/drives/motor/class_Motor.php @@ -31,7 +31,7 @@ class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { $this->setObjectDescription("Namenloser Motor"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php b/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php index 760cbaa..1a59cc5 100644 --- a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php +++ b/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php @@ -35,7 +35,7 @@ class ShipSimuWebNewsFactory extends BaseFrameworkSystem { $this->setObjectDescription("News-Objektefabrik für Ship-Simu"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php index 78ae998..4a45e33 100644 --- a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php +++ b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php @@ -31,7 +31,7 @@ class MaschineRoom extends BaseShipPart { $this->setObjectDescription("Maschinenraum"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php index a089ae6..735f65d 100644 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ b/application/ship-simu/main/personell/class_SimulatorPersonell.php @@ -44,7 +44,7 @@ class SimulatorPersonell extends BasePersonell { $this->setObjectDescription("Simulationspersonal"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean-up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/personell/company/class_CompanyEmployee.php b/application/ship-simu/main/personell/company/class_CompanyEmployee.php index 36b97c4..53c1ab4 100644 --- a/application/ship-simu/main/personell/company/class_CompanyEmployee.php +++ b/application/ship-simu/main/personell/company/class_CompanyEmployee.php @@ -34,7 +34,7 @@ class CompanyEmployee extends SimulatorPersonell { $this->setObjectDescription("Firmenangestellte(r)"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/registration/class_ShipSimuRegistration.php b/application/ship-simu/main/registration/class_ShipSimuRegistration.php index 9909c3d..01235f7 100644 --- a/application/ship-simu/main/registration/class_ShipSimuRegistration.php +++ b/application/ship-simu/main/registration/class_ShipSimuRegistration.php @@ -27,6 +27,25 @@ class ShipSimuRegistration extends BaseRegistration { */ private $hashedPassword = ""; + /** + * Elements for criteria + */ + private $criteriaElements = array( + 'username', + 'pass_hash', + 'email' => 'email1', + 'surname', + 'family', + 'street', + 'zip', + 'city', + 'icq', + 'jabber', + 'yahoo', + 'aol', + 'msn' + ); + /** * Protected constructor * @@ -40,7 +59,7 @@ class ShipSimuRegistration extends BaseRegistration { $this->setObjectDescription("Ship-Simu registration class"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** @@ -125,6 +144,32 @@ class ShipSimuRegistration extends BaseRegistration { public function doPostAction () { $this->partialStub(); } + + /** + * Adds registration elements to a given dataset instance + * + * @param $criteriaInstance An instance of a storeable criteria + * @return void + */ + public function addElementsToDataSet (StoreableCriteria $criteriaInstance) { + // Add a lot elements to the dataset criteria + foreach ($this->criteriaElements as $alias=>$element) { + // Do we have an alias? + if (is_string($alias)) { + // Yes, so use it + $criteriaInstance->addCriteria($alias, $this->getRequestInstance()->getRequestElement($element)); + } else { + // No, default entry + $criteriaInstance->addCriteria($element, $this->getRequestInstance()->getRequestElement($element)); + } + } // END - foreach + + // Mark the username as unique key + $criteriaInstance->setUniqueKey('username'); + + // Add account status as configured + $criteriaInstance->addConfiguredCriteria('user_status', 'user_status_register'); + } } // diff --git a/application/ship-simu/main/ships/passenger/class_PassengerShip.php b/application/ship-simu/main/ships/passenger/class_PassengerShip.php index 4e0dd19..52a227a 100644 --- a/application/ship-simu/main/ships/passenger/class_PassengerShip.php +++ b/application/ship-simu/main/ships/passenger/class_PassengerShip.php @@ -32,7 +32,7 @@ class PassengerShip extends BaseShip implements ConstructableShip, LimitableObje $this->setObjectDescription("Passagier-Schiff"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php index 66927fb..ffd77b6 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php @@ -31,7 +31,7 @@ class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShip $this->setObjectDescription("Economy-Class-Kabine"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php index 4875e4f..25a7b4a 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php @@ -31,7 +31,7 @@ class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart $this->setObjectDescription("2Star-Class-Kabine"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php index 19f8495..1711563 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php @@ -31,7 +31,7 @@ class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipP $this->setObjectDescription("Luxuskabine"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php index ea9e14a..df76e31 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php @@ -31,7 +31,7 @@ class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShip $this->setObjectDescription("Premier-Class-Kabine"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php index 89bdc27..33faadc 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php @@ -31,7 +31,7 @@ class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { $this->setObjectDescription("Autodeck"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php index 209b072..acd5946 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php @@ -31,7 +31,7 @@ class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart $this->setObjectDescription("Zug-Deck"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php index 64c4b57..bc710ef 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php @@ -32,7 +32,7 @@ class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart $this->setObjectDescription("LKW-Deck"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/application/ship-simu/main/structures/extended/upper/class_Bridge.php b/application/ship-simu/main/structures/extended/upper/class_Bridge.php index b0841d2..203bb03 100644 --- a/application/ship-simu/main/structures/extended/upper/class_Bridge.php +++ b/application/ship-simu/main/structures/extended/upper/class_Bridge.php @@ -31,7 +31,7 @@ class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableS $this->setObjectDescription("Brücke"); // Generate unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/db/user/.htaccess b/db/user/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/db/user/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/criteria/class_Criteria.php b/inc/classes/interfaces/criteria/class_Criteria.php index d69efad..35b51f3 100644 --- a/inc/classes/interfaces/criteria/class_Criteria.php +++ b/inc/classes/interfaces/criteria/class_Criteria.php @@ -23,13 +23,22 @@ */ interface Criteria extends FrameworkInterface { /** - * Add extra criteria + * Add criteria * * @param $criteriaKey Criteria key * @param $criteriaValue Criteria value * @return void */ function addCriteria ($criteriaKey, $criteriaValue); + + /** + * Add configured criteria + * + * @param $criteriaKey Criteria key + * @param $configEntry Configuration entry + * @return void + */ + function addConfiguredCriteria ($criteriaKey, $configEntry); } // diff --git a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php index 6c2b998..f61df07 100644 --- a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php +++ b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php @@ -63,6 +63,7 @@ interface DatabaseFrontendInterface extends FrameworkDatabaseInterface { * * @param $dataSetInstance A storeable data set * @return void + * @throws SqlException If an SQL error occurs */ function insertDataSet (StoreableCriteria $dataSetInstance); } diff --git a/inc/classes/interfaces/registration/class_UserRegister.php b/inc/classes/interfaces/registration/class_UserRegister.php index cb83c18..9fbf2ff 100644 --- a/inc/classes/interfaces/registration/class_UserRegister.php +++ b/inc/classes/interfaces/registration/class_UserRegister.php @@ -62,6 +62,14 @@ interface UserRegister extends FrameworkInterface { * @return void */ function doPostAction (); + + /** + * Adds registration elements to a given dataset instance + * + * @param $criteriaInstance An instance of a storeable criteria + * @return void + */ + function addElementsToDataSet (StoreableCriteria $criteriaInstance); } // diff --git a/inc/classes/main/actions/.htaccess b/inc/classes/main/actions/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/actions/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/actions/class_ b/inc/classes/main/actions/class_ new file mode 100644 index 0000000..797b770 --- /dev/null +++ b/inc/classes/main/actions/class_ @@ -0,0 +1,67 @@ + + * @version 0.3.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.mxchange.org + * + * This program 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. + * + * This program 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 this program. If not, see . + */ +class ???Action extends BaseAction implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set description + $this->setObjectDescription(""); + + // Generate unique key + $this->createUniqueID(); + } + + /** + * Creates an instance of this action + * + * @return $actionInstance An instance of this action class + */ + public final static function create???Action () { + // Get a new instance + $actionInstance = new ???Action(); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + $this->partialStub("You have to implement me."); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/actions/class_BaseAction.php b/inc/classes/main/actions/class_BaseAction.php new file mode 100644 index 0000000..9b2df36 --- /dev/null +++ b/inc/classes/main/actions/class_BaseAction.php @@ -0,0 +1,42 @@ + + * @version 0.3.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.mxchange.org + * + * This program 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. + * + * This program 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 this program. If not, see . + */ +class BaseAction extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/actions/post_registration/.htaccess b/inc/classes/main/actions/post_registration/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/actions/post_registration/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/cache/class_MemoryCache.php b/inc/classes/main/cache/class_MemoryCache.php index e708b2c..01d2a36 100644 --- a/inc/classes/main/cache/class_MemoryCache.php +++ b/inc/classes/main/cache/class_MemoryCache.php @@ -40,7 +40,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { $this->setObjectDescription("Memory cache"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 0d82132..f61deb8 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -432,7 +432,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * * @return void */ - public final function createUniqueID () { + public final function generateUniqueId () { // Existiert noch keine? if (empty($this->uniqueID)) { diff --git a/inc/classes/main/commands/web/class_WebDoFormCommand.php b/inc/classes/main/commands/web/class_WebDoFormCommand.php index bfdf8fe..e7f59ad 100644 --- a/inc/classes/main/commands/web/class_WebDoFormCommand.php +++ b/inc/classes/main/commands/web/class_WebDoFormCommand.php @@ -35,7 +35,7 @@ class WebDoFormCommand extends BaseCommand implements Commandable { $this->setObjectDescription("Command for handling forms on a centralized place"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 7fe95f2..8dcf3b1 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -35,7 +35,7 @@ class WebHomeCommand extends BaseCommand implements Commandable { $this->setObjectDescription("Command for the "home" page"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index abdc9ec..1f85254 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -35,7 +35,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable { $this->setObjectDescription("Command for the registration form"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php index 24566b9..a810a79 100644 --- a/inc/classes/main/compressor/class_Bzip2Compressor.php +++ b/inc/classes/main/compressor/class_Bzip2Compressor.php @@ -35,7 +35,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor { $this->setObjectDescription("BZIP2 compressor"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/compressor/class_GzipCompressor.php b/inc/classes/main/compressor/class_GzipCompressor.php index 08b1a6d..9a4489b 100644 --- a/inc/classes/main/compressor/class_GzipCompressor.php +++ b/inc/classes/main/compressor/class_GzipCompressor.php @@ -35,7 +35,7 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor { $this->setObjectDescription("GZIP compressor"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/compressor/class_NullCompressor.php b/inc/classes/main/compressor/class_NullCompressor.php index 157dc1a..38999e1 100644 --- a/inc/classes/main/compressor/class_NullCompressor.php +++ b/inc/classes/main/compressor/class_NullCompressor.php @@ -35,7 +35,7 @@ class NullCompressor extends BaseFrameworkSystem implements Compressor { $this->setObjectDescription("Null compressor"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index c1da699..ffdc182 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -35,7 +35,7 @@ class ConsoleTools extends BaseFrameworkSystem { $this->setObjectDescription("General console tools"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/default/class_WebDefaultController.php b/inc/classes/main/controller/default/class_WebDefaultController.php index 9d60e61..ec56fdd 100644 --- a/inc/classes/main/controller/default/class_WebDefaultController.php +++ b/inc/classes/main/controller/default/class_WebDefaultController.php @@ -35,7 +35,7 @@ class WebWebDefaultController extends BaseController implements Controller { $this->setObjectDescription("Default controller for all other requests"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/default/class_WebDefaultNewsController.php b/inc/classes/main/controller/default/class_WebDefaultNewsController.php index b8bbc05..326c0b0 100644 --- a/inc/classes/main/controller/default/class_WebDefaultNewsController.php +++ b/inc/classes/main/controller/default/class_WebDefaultNewsController.php @@ -35,7 +35,7 @@ class WebDefaultNewsController extends BaseController implements Controller { $this->setObjectDescription("Default controller with news"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/controller/form/class_WebDoFormController.php b/inc/classes/main/controller/form/class_WebDoFormController.php index 8d46880..db7cfb4 100644 --- a/inc/classes/main/controller/form/class_WebDoFormController.php +++ b/inc/classes/main/controller/form/class_WebDoFormController.php @@ -35,7 +35,7 @@ class WebDoFormController extends BaseController implements Controller { $this->setObjectDescription("Controller for handling forms"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/criteria/class_DataSetCriteria.php b/inc/classes/main/criteria/class_DataSetCriteria.php index d16f039..feb6366 100644 --- a/inc/classes/main/criteria/class_DataSetCriteria.php +++ b/inc/classes/main/criteria/class_DataSetCriteria.php @@ -23,6 +23,21 @@ * along with this program. If not, see . */ class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria { + /** + * Table name + */ + private $tableName = ""; + + /** + * Table columns (criteria) to store + */ + private $tableColumns = array(); + + /** + * Unique key + */ + private $uniqueKey = ""; + /** * Protected constructor * @@ -36,7 +51,7 @@ class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria { $this->setObjectDescription("Storeable data set for databases"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); @@ -57,14 +72,83 @@ class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria { } /** - * Add extra criteria + * Add criteria * * @param $criteriaKey Criteria key * @param $criteriaValue Criteria value * @return void */ public function addCriteria ($criteriaKey, $criteriaValue) { - die("STUB!"); + $this->tableColumns[(string) $criteriaKey] = $criteriaValue; + } + + /** + * Add configured criteria + * + * @param $criteriaKey Criteria key + * @param $configEntry Configuration entry + * @return void + */ + public function addConfiguredCriteria ($criteriaKey, $configEntry) { + // Add configuration entry as criteria + $value = $this->getConfigInstance()->readConfig($configEntry); + $this->addCriteria($criteriaKey, $value); + } + + /** + * Setter for table name + * + * @param $tableName Name of the table to set + * @return void + */ + public final function setTableName ($tableName) { + $this->tableName = (string) $tableName; + } + + /** + * Getter for table name + * + * @return $tableName Name of the table to set + */ + public final function getTableName () { + return $this->tableName; + } + + /** + * Setter for unique key + * + * @param $uniqueKey Column to use as unique key + * @return void + */ + public final function setUniqueKey ($uniqueKey) { + $this->uniqueKey = (string) $uniqueKey; + } + + /** + * Getter for unique key + * + * @return $uniqueKey Column to use as unique key + */ + public final function getUniqueKey () { + return $this->uniqueKey; + } + + /** + * Getter for unique key value + * + * @return $uniqueValue Value of the unique key + */ + public final function getUniqueValue () { + return $this->tableColumns[$this->getUniqueKey()]; + } + + /** + * Getter for criteria array + * + * @return $tableColumns + */ + public final function getCriteriaArray () { + return $this->tableColumns; } } diff --git a/inc/classes/main/criteria/class_SearchCriteria.php b/inc/classes/main/criteria/class_SearchCriteria.php index a0d8003..f948909 100644 --- a/inc/classes/main/criteria/class_SearchCriteria.php +++ b/inc/classes/main/criteria/class_SearchCriteria.php @@ -52,7 +52,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria $this->setObjectDescription("Search criteria class"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); @@ -73,7 +73,7 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria } /** - * Add extra criteria + * Add criteria * * @param $criteriaKey Criteria key * @param $criteriaValue Criteria value @@ -83,6 +83,19 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria $this->searchCriteria[$criteriaKey] = $criteriaValue; } + /** + * Add configured criteria + * + * @param $criteriaKey Criteria key + * @param $configEntry Configuration entry + * @return void + */ + public function addConfiguredCriteria ($criteriaKey, $configEntry) { + // Add the configuration entry as a criteria + $value = $this->getConfigInstance()->readConfig($configEntry); + $this->addCriteria($criteriaKey, $value); + } + /** * Setter for limit * @@ -93,6 +106,16 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria $this->limit = $limit; } + /** + * Getter for limit + * + * @param + * @return $limit Search limit + */ + public final function getLimit () { + return $this->limit; + } + /** * Setter for skip * @@ -103,6 +126,16 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria $this->skip = $skip; } + /** + * Getter for skip + * + * @param + * @return $skip Search skip + */ + public final function getSkip () { + return $this->skip; + } + /** * "Getter" for a cache key * @@ -130,6 +163,26 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria // Return the cache key return $cacheKey; } + + /** + * Get criteria element or null if not found + * + * @param $criteria The criteria we want to have + * @return $value Wether the value of the critera or null + */ + public function getCriteriaElemnent ($criteria) { + // Default is not found + $value = null; + + // Is the criteria there? + if (isset($this->searchCriteria[$criteria])) { + // Then use it + $value = $this->searchCriteria[$criteria]; + } + + // Return the value + return $value; + } } // [EOF] diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index fc0cd39..cdde421 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -50,7 +50,7 @@ class CryptoHelper extends BaseFrameworkSystem { $this->setObjectDescription("Cryptographical helper"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index db1d87e..c40fbf9 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -24,8 +24,10 @@ * along with this program. If not, see . */ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontendInterface { + // Constants for MySQL backward-compatiblity (PLEASE FIX THEM!) - const DB_CODE_TABLE_MISSING = 0x000; + const DB_CODE_TABLE_MISSING = 0x000; + const DB_CODE_TABLE_UNWRITEABLE = 0x001; /** * Save path for "file database" @@ -76,7 +78,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend $this->setObjectDescription("Class for local file databases"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeSystemArray(); @@ -558,9 +560,54 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend 'rows' => array() ); + // Initialize limit/skip + $limitFound = 0; $skipFound = 0; + // Read the directory with some exceptions - while ($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn"))) { - $this->partialStub(sprintf("File %s found.", $dataFile)); + while (($dataFile = $directoryInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn"))) && ($limitFound < $criteriaInstance->getLimit())) { + // Open this file for reading + $filePointer = FrameworkFileInputPointer::createFrameworkFileInputPointer($pathName . $dataFile); + + // Get the raw data and BASE64-decode it + $compressedData = base64_decode($filePointer->readLinesFromFile()); + + // Close the file and throw the instance away + $filePointer->closeFile(); + unset($filePointer); + + // Decompress it + $serializedData = $this->getCompressorChannel()->getCompressor()->decompressStream($compressedData); + + // Unserialize it + $dataArray = unserialize($serializedData); + + // Is this an array? + if (is_array($dataArray)) { + // Search in the criteria with FMFW (First Matches, First Wins) + foreach ($dataArray as $key=>$value) { + // Get criteria element + $criteria = $criteriaInstance->getCriteriaElemnent($key); + + // Is the criteria met? + if ((!is_null($criteria)) && ($criteria == $value)) { + + // Shall we skip this entry? + if ($criteriaInstance->getSkip() > 0) { + // We shall skip some entries + if ($skipFound < $criteriaInstance->getSkip()) { + // Skip this entry + $skipFound++; + break; + } // END - if + } // END - if + + // Entry found! + $resultData['rows'][] = $dataArray; + $limitFound++; + break; + } // END - if + } // END - foreach + } // END - if } // END - while // Close directory and throw the instance away @@ -591,20 +638,36 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend * * @param $dataSetInstance A storeable data set * @return void + * @throws SqlException If an SQL error occurs */ public function insertDataSet (StoreableCriteria $dataSetInstance) { // Create full path name $fqfn = sprintf("%s%s/%s.%s", $this->getSavePath(), $dataSetInstance->getTableName(), - $dataSetInstance->getCombinedUniqueKey(), + md5($dataSetInstance->getUniqueValue()), $this->getFileExtension() ); - die($fqfn); + + // Skip here while developing + return true; // Try to save the request away try { // Get a file pointer instance + $filePointer = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fqfn, 'w'); + + // Get the criteria array from the dataset + $criteriaArray = $dataSetInstance->getCriteriaArray(); + + // Serialize and compress it + $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($criteriaArray)); + + // Write this data BASE64 encoded to the file + $filePointer->writeToFile(base64_encode($compressedData)); + + // Close the file pointer + $filePointer->closeFile(); // Reset last error message and exception $this->resetLastError(); @@ -612,6 +675,9 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend // Catch all exceptions and store them in last error $this->lastException = $e; $this->lastError = $e->getMessage(); + + // Throw an SQL exception + throw new SqlException (array($this, sprintf("Cannot write data to table '%s'", $tableName), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY); } } } diff --git a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php index 262c950..88bc13f 100644 --- a/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php +++ b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php @@ -51,7 +51,7 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper { $this->setObjectDescription("Database wrapper for user objects"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** @@ -131,15 +131,12 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper { * @return void */ public function insertRegistrationObject (UserRegister $registrationInstance) { - // Get the request instance which we use for saving - $requestInstance = $registrationInstance->getRequestInstance(); - // Generate a data set for the request $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria'); $dataSetInstance->setTableName(self::DB_TABLE_USER); - // Add all needed request elements to the data set - //$requestInstance->debugInstance(); + // Add registration elements to the dataset + $registrationInstance->addElementsToDataSet($dataSetInstance); // "Insert" this request instance completely into the database $this->getDatabaseInstance()->insertDataSet($dataSetInstance); diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index 4d586db..f7dbea7 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -35,7 +35,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output $this->setObjectDescription("Debug output for the console"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/debug/class_DebugErrorLogOutput.php b/inc/classes/main/debug/class_DebugErrorLogOutput.php index a21189f..af33e70 100644 --- a/inc/classes/main/debug/class_DebugErrorLogOutput.php +++ b/inc/classes/main/debug/class_DebugErrorLogOutput.php @@ -35,7 +35,7 @@ class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, Outpu $this->setObjectDescription("Debug output to error_log()"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index c82bdd4..3eb6133 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -35,7 +35,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre $this->setObjectDescription("Debug output for webpages"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/extended/class_ObjectLimits.php b/inc/classes/main/extended/class_ObjectLimits.php index f92356b..0f9ea83 100644 --- a/inc/classes/main/extended/class_ObjectLimits.php +++ b/inc/classes/main/extended/class_ObjectLimits.php @@ -42,7 +42,7 @@ class ObjectLimits extends BaseFrameworkSystem { $this->setObjectDescription("Class for "limiting" other classes. See description for details."); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/factories/cache/class_CacheFactory.php b/inc/classes/main/factories/cache/class_CacheFactory.php index 087b942..48f8338 100644 --- a/inc/classes/main/factories/cache/class_CacheFactory.php +++ b/inc/classes/main/factories/cache/class_CacheFactory.php @@ -40,7 +40,7 @@ class CacheFactory extends BaseFactory { $this->setObjectDescription("Factory for cache objects"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 3f8ac7f..19d0e3d 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -35,7 +35,7 @@ class ObjectFactory extends BaseFactory { $this->setObjectDescription("Simple generic object factory"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/factories/web/class_WebNewsFactory.php b/inc/classes/main/factories/web/class_WebNewsFactory.php index 946f96b..ecd1f28 100644 --- a/inc/classes/main/factories/web/class_WebNewsFactory.php +++ b/inc/classes/main/factories/web/class_WebNewsFactory.php @@ -40,7 +40,7 @@ class WebNewsFactory extends BaseFactory { $this->setObjectDescription("Factory for webpages with news"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php index 006cc5e..3029dce 100644 --- a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -37,7 +37,7 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable { $this->setObjectDescription("A filter for checking if rules where accepted"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index cb1ac38..fa1f8f4 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -40,7 +40,7 @@ class FilterChain extends BaseFrameworkSystem { $this->setObjectDescription("A filter chain class"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/filter/null/class_NullFilter.php b/inc/classes/main/filter/null/class_NullFilter.php index a6cbe65..3ac6d34 100644 --- a/inc/classes/main/filter/null/class_NullFilter.php +++ b/inc/classes/main/filter/null/class_NullFilter.php @@ -36,7 +36,7 @@ class NullFilter extends BaseFrameworkSystem implements Filterable { $this->setObjectDescription("A null filter"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index 6c4f74b..d7e9a2d 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -38,7 +38,7 @@ class EmailValidatorFilter extends BaseFrameworkSystem implements Filterable { $this->setObjectDescription("A filter for Email validation"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php index 21d0941..a8369d8 100644 --- a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php @@ -36,7 +36,7 @@ class PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable $this->setObjectDescription("A filter for Password validation"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 85ddfbe..67c436f 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -38,7 +38,7 @@ class UserNameValidatorFilter extends BaseFrameworkSystem implements Filterable $this->setObjectDescription("A filter for username validation"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/helper/web/class_WebFormHelper.php b/inc/classes/main/helper/web/class_WebFormHelper.php index d3fecfc..e71f151 100644 --- a/inc/classes/main/helper/web/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/class_WebFormHelper.php @@ -67,7 +67,7 @@ class WebFormHelper extends BaseHelper { $this->setObjectDescription("Helper class for HTML forms"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php index 0800fea..1b57ee6 100644 --- a/inc/classes/main/io/class_FileIoStream.php +++ b/inc/classes/main/io/class_FileIoStream.php @@ -33,7 +33,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil $this->setObjectDescription("Universal file I/O stream system"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean-up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index f0f2dd8..79580df 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -43,7 +43,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { $this->setObjectDescription("Helper for handling directories"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean-up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index 7af6f6f..c86de9a 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -43,7 +43,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { $this->setObjectDescription("Handler for reading from files"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean-up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index 66e2575..73cf908 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -43,7 +43,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { $this->setObjectDescription("Handler for writing to files"); // Create unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Clean-up a little $this->removeNumberFormaters(); @@ -67,12 +67,11 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { * Create a file pointer based on the given file. The file will also * be verified here. * - * @param $fileName The file name we shall pass - * to fopen() - * @param $mode The output mode ('w', 'a' are valid) + * @param $fileName The file name we shall pass to fopen() + * @param $mode The output mode ('w', 'a' are valid) * @throws FileIsEmptyException If the provided file name is empty. * @throws FilePointerNotOpened If fopen() returns not a file - * resource + * resource * @return void */ public final static function createFrameworkFileOutputPointer ($fileName, $mode) { @@ -103,12 +102,12 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { /** * Write data to a file pointer * - * @param $dataStream The data stream we shall write to the file - * @return mixed The result of fwrite() + * @param $dataStream The data stream we shall write to the file + * @return mixed The result of fwrite() * @throws NullPointerException If the file pointer instance - * is not set by setPointer() + * is not set by setPointer() * @throws InvalidFileResourceException If there is being set - * an invalid file resource + * an invalid file resource */ public function writeToFile ($dataStream) { if (is_null($this->getPointer())) { @@ -129,7 +128,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { * * @return void * @throws NullPointerException If the file pointer instance - * is not set by setPointer() + * is not set by setPointer() * @throws InvalidFileResourceException If there is being set */ public function closeFile () { @@ -150,7 +149,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { /** * Setter for the file pointer * - * @param $filePointer File resource + * @param $filePointer File resource * @return void */ public final function setPointer ($filePointer) { @@ -168,7 +167,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { * Getter for the file pointer * * @return $filePointer The file pointer which shall be a valid - * file resource + * file resource */ public final function getPointer () { return $this->filePointer; @@ -177,7 +176,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { /** * Setter for file name * - * @param $fileName The new file name + * @param $fileName The new file name * @return void */ public final function setFileName ($fileName) { @@ -188,7 +187,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { /** * Getter for file name * - * @return $fileName The current file name + * @return $fileName The current file name */ public final function getFileName () { return $this->fileName; diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index cb4562e..19d0597 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -56,7 +56,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage { $this->setObjectDescription("Language sub-system"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index 00595db..e75cf82 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -46,7 +46,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer { $this->setObjectDescription("Console output class"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index c6bb27f..799e9ed 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -41,7 +41,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer { $this->setObjectDescription("Class for web output e.g. XHTML code"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/main/registry/class_Registry.php b/inc/classes/main/registry/class_Registry.php index 3d3c8ca..a9e1a2a 100644 --- a/inc/classes/main/registry/class_Registry.php +++ b/inc/classes/main/registry/class_Registry.php @@ -45,7 +45,7 @@ class Registry extends BaseFrameworkSystem implements Register { $this->setObjectDescription("Registry class"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index 820a27a..e3bb312 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class HttpRequest extends BaseFrameworkSystem implements Requestable, Iterateable { +class HttpRequest extends BaseFrameworkSystem implements Requestable { /** * Array for the request data */ @@ -47,7 +47,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable, Iterateabl $this->setObjectDescription("HTTP request"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/resolver/web/class_WebCommandResolver.php b/inc/classes/main/resolver/web/class_WebCommandResolver.php index 47baef4..bcc6dbb 100644 --- a/inc/classes/main/resolver/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/web/class_WebCommandResolver.php @@ -40,7 +40,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver { $this->setObjectDescription("Resolver for local web commands"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Set prefix to "Web" $this->setCommandPrefix("Web"); diff --git a/inc/classes/main/resolver/web/class_WebControllerResolver.php b/inc/classes/main/resolver/web/class_WebControllerResolver.php index 9e50d94..7da1934 100644 --- a/inc/classes/main/resolver/web/class_WebControllerResolver.php +++ b/inc/classes/main/resolver/web/class_WebControllerResolver.php @@ -45,7 +45,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver { $this->setObjectDescription("Resolver for local web controllers"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Set prefix to "Web" $this->setCommandPrefix("Web"); diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 9c04534..074373d 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -63,7 +63,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { $this->setObjectDescription("HTTP response"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/result/class_DatabaseResult.php b/inc/classes/main/result/class_DatabaseResult.php index 5214c1e..3d48861 100644 --- a/inc/classes/main/result/class_DatabaseResult.php +++ b/inc/classes/main/result/class_DatabaseResult.php @@ -50,7 +50,7 @@ class DatabaseResult extends BaseFrameworkSystem { $this->setObjectDescription("Database result"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index c5c216d..b50af11 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -56,7 +56,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $this->setObjectDescription("Standard random number generator"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index 09abcca..e1c3bce 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -126,7 +126,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate $this->setObjectDescription("Web template engine"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/user/class_User.php b/inc/classes/main/user/class_User.php index 68533c2..2ea13a2 100644 --- a/inc/classes/main/user/class_User.php +++ b/inc/classes/main/user/class_User.php @@ -51,7 +51,7 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable { $this->setObjectDescription("Generic user class"); // Create unique ID number - $this->createUniqueID(); + $this->generateUniqueId(); // Clean up a little $this->removeNumberFormaters(); @@ -119,7 +119,7 @@ class User extends BaseFrameworkSystem implements ManageableUser, Registerable { * @return void */ protected final function setEmail ($email) { - $this->userName = $email; + $this->email = $email; } /** diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index e512751..51ea53e 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -40,7 +40,7 @@ class CompressorChannel extends BaseMiddleware { $this->setObjectDescription("Komprimierungshandler"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } /** diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 87e89f2..81b402f 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -51,7 +51,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Li $this->setObjectDescription("Datenbank-Mittelschicht"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); } // Create new database connection layer @@ -211,7 +211,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Li $this->dbLayer->connectToDatabase(); // Ask the database layer - $this->dbLayer->insertDataSet($requestInstance); + $this->dbLayer->insertDataSet($dataSetInstance); } } diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php index 9c73bd1..bbd96b5 100644 --- a/inc/classes/middleware/debug/class_DebugMiddleware.php +++ b/inc/classes/middleware/debug/class_DebugMiddleware.php @@ -47,7 +47,7 @@ class DebugMiddleware extends BaseMiddleware { $this->setObjectDescription("Debug-Ausgabe-Handler"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Set own instance self::$thisInstance = $this; diff --git a/inc/classes/middleware/io/class_FileIoHandler.php b/inc/classes/middleware/io/class_FileIoHandler.php index 8e1b4b3..071e1d6 100644 --- a/inc/classes/middleware/io/class_FileIoHandler.php +++ b/inc/classes/middleware/io/class_FileIoHandler.php @@ -51,7 +51,7 @@ class FileIoHandler extends BaseMiddleware { $this->setObjectDescription("Datei-Ein-/Ausgabe-Handler"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Set own instance self::$thisInstance = $this; diff --git a/inc/config.php b/inc/config.php index 92612ba..dc48fe6 100644 --- a/inc/config.php +++ b/inc/config.php @@ -207,5 +207,8 @@ $cfg->setConfigEntry('hash_mask', "%1s:%2s:%3s"); // 1=salt, 2=extra salt, 3=pla // CFG: IS-SINGLE-SERVER $cfg->setConfigEntry('is_single_server', "Y"); +// CFG: POST-REGISTRATION-ACTION +$cfg->setConfigEntry('post_registration_action', "LoginAfterRegistrationAction"); + // [EOF] ?>