User class renamed to Member and it's interface
authorRoland Häder <roland@mxchange.org>
Tue, 1 Jul 2008 08:33:53 +0000 (08:33 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 1 Jul 2008 08:33:53 +0000 (08:33 +0000)
20 files changed:
.gitattributes
application/ship-simu/main/companies/class_ShippingCompany.php
application/ship-simu/main/login/class_ShipSimuGuestLogin.php
application/ship-simu/main/login/class_ShipSimuUserLogin.php
application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php
inc/classes/interfaces/mailer/class_DeliverableMail.php
inc/classes/interfaces/user/extended/class_ManageableMember.php [new file with mode: 0644]
inc/classes/interfaces/user/extended/class_ManageableUser.php [deleted file]
inc/classes/main/commands/web/class_WebHomeCommand.php
inc/classes/main/commands/web/class_WebResendLinkCommand.php
inc/classes/main/filter/auth/class_UserAuthFilter.php
inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php
inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/mailer/debug/class_DebugMailer.php
inc/classes/main/user/member/.htaccess [new file with mode: 0644]
inc/classes/main/user/member/class_Member.php [new file with mode: 0644]
inc/classes/main/user/user/.htaccess [deleted file]
inc/classes/main/user/user/class_User.php [deleted file]
inc/config.php

index 4c2153b14c6c6d83de001c5c01ad22546ab0e668..2084758942c71ba1673686d533a13e1ac997616c 100644 (file)
@@ -417,7 +417,7 @@ inc/classes/interfaces/user/.htaccess -text
 inc/classes/interfaces/user/class_ManageableAccount.php -text
 inc/classes/interfaces/user/extended/.htaccess -text
 inc/classes/interfaces/user/extended/class_ManageableGuest.php -text
-inc/classes/interfaces/user/extended/class_ManageableUser.php -text
+inc/classes/interfaces/user/extended/class_ManageableMember.php -text
 inc/classes/main/.htaccess -text
 inc/classes/main/actions/.htaccess -text
 inc/classes/main/actions/class_ -text
@@ -630,8 +630,8 @@ inc/classes/main/user/.htaccess -text
 inc/classes/main/user/class_BaseUser.php -text
 inc/classes/main/user/guest/.htaccess -text
 inc/classes/main/user/guest/class_Guest.php -text
-inc/classes/main/user/user/.htaccess -text
-inc/classes/main/user/user/class_User.php -text
+inc/classes/main/user/member/.htaccess -text
+inc/classes/main/user/member/class_Member.php -text
 inc/classes/middleware/.htaccess -text
 inc/classes/middleware/class_BaseMiddleware.php -text
 inc/classes/middleware/compressor/.htaccess -text
index a7f12ef410e559594d6730f2b07a8ad5088e0e44..1eef86b61c9afa4b5a8b120409ebc982b8f40707 100644 (file)
@@ -91,7 +91,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
         * @param       $userInstance           A user class
         * @return      $companyInstance        Prepared company instance
         */
-       public final static function createShippingCompany (BaseUser $userInstance) {
+       public final static function createShippingCompany (ManageableAccount $userInstance) {
                // Get new instance
                $companyInstance = new ShippingCompany();
 
@@ -115,7 +115,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
         * @param       $userInstance   An instance of a user class
         * @return      $participates   Wether the user participates at lease in one company
         */
-       protected function ifUserParticipatesInCompany (BaseUser $userInstance)  {
+       protected function ifUserParticipatesInCompany (ManageableAccount $userInstance)  {
                // By default no user owns any company... ;)
                $participates = false;
 
index f57cdee986b39e585c799a1f98014879aef6e35e..b59eb2b9d6ecf722a17d19a012d00a4d210b2f94 100644 (file)
@@ -111,7 +111,7 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser {
                // Is the password correct?
                if (!$userInstance->ifPasswordHashMatches($requestInstance)) {
                        // Mismatching password
-                       throw new UserPasswordMismatchException(array($this, $userInstance), User::EXCEPTION_USER_PASS_MISMATCH);
+                       throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
 
                // Now do the real login. This can be cookie- or session-based login
index 0a0c94451b469ff83f0198ff31e3571ec2c7ef7b..367103ca2021995e23bedf871ac2aa4524da2b27 100644 (file)
@@ -85,7 +85,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                // Is there an instance?
                if (is_null($userInstance)) {
                        // Get a user instance
-                       $userInstance = User::createUserByRequest($requestInstance);
+                       $userInstance = Member::createUserByRequest($requestInstance);
 
                        // Remember this new instance in registry
                        Registry::getRegistry()->addInstance($userInstance);
@@ -94,7 +94,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser {
                // Is the password correct?
                if (!$userInstance->ifPasswordHashMatches($requestInstance)) {
                        // Mismatching password
-                       throw new UserPasswordMismatchException(array($this, $userInstance), User::EXCEPTION_USER_PASS_MISMATCH);
+                       throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
 
                // ToDo place
index b49b1d050c4a56c4038baac528721ec8d7127803..80bb0371954c3adb59b07db9ad763cd4feda9fd5 100644 (file)
@@ -64,7 +64,7 @@ class CompanyDatabaseWrapper extends BaseDatabaseWrapper {
         * @param       $userInstance   An instance of a user class
         * @return      $participates   Wether the user participates at lease in one company
         */
-       public function ifUserParticipatesInCompany (BaseUser $userInstance)  {
+       public function ifUserParticipatesInCompany (ManageableAccount $userInstance)  {
                // By default no user owns any company... ;)
                $participates = false;
 
index 675254d53df51623b741beec852e8b8defd074c9..7e042044fb4419dc4cc03f90490686aca1a9931d 100644 (file)
@@ -28,7 +28,7 @@ interface DeliverableMail extends FrameworkInterface {
         * @param       $userInstance   An instance of a user class
         * @return      void
         */
-       function addRecipientByUserInstance (ManageableUser $userInstance);
+       function addRecipientByUserInstance (ManageableMember $userInstance);
 
        /**
         * Use subject line provided by the (XML) template otherwise a subject line must be set
diff --git a/inc/classes/interfaces/user/extended/class_ManageableMember.php b/inc/classes/interfaces/user/extended/class_ManageableMember.php
new file mode 100644 (file)
index 0000000..db33c63
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for manageable users
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 <http://www.gnu.org/licenses/>.
+ */
+interface ManageableMember extends ManageableAccount {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/user/extended/class_ManageableUser.php b/inc/classes/interfaces/user/extended/class_ManageableUser.php
deleted file mode 100644 (file)
index a236103..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * An interface for manageable users
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.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 <http://www.gnu.org/licenses/>.
- */
-interface ManageableUser extends ManageableAccount {
-}
-
-//
-?>
index 572d71d043c7514965b38188d879b702e489eec3..577968e7b555be68e0fb2cac1a93932f4dfc3735 100644 (file)
@@ -72,6 +72,9 @@ class WebHomeCommand extends BaseCommand implements Commandable {
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($appInstance);
 
+               // Transfer application data
+               $templateInstance->assignApplicationData($appInstance);
+
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
index fda4669147c2e846a7262ffae0bf3d117da77c2c..3c69b344461c6e3900cdf58d663fd12ac7996db0 100644 (file)
@@ -64,16 +64,16 @@ class WebResendLinkCommand extends BaseCommand implements Commandable {
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
-        * @throws      InvalidInterfaceException       If the user class does not implement ManageableUser
+        * @throws      InvalidInterfaceException       If the user class does not implement ManageableMember
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get user instance from registry
                $userInstance = Registry::getRegistry()->getInstance('user');
 
-               // Does the user instance implement ManageableUser?
-               if (!$userInstance instanceof ManageableUser) {
+               // Does the user instance implement ManageableMember?
+               if (!$userInstance instanceof ManageableMember) {
                        // Throw exception here
-                       throw new InvalidInterfaceException(array($userInstance, 'ManageableUser'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
+                       throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
                } // END - if
 
                // Get an application instance
index 1ef804583c253dee52dd22f8033945654e412db3..25641dc3b90b6debc00e26d57d685d303c021857 100644 (file)
@@ -112,13 +112,13 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        $userInstance = Guest::createGuestByUserName($authLogin);
                } else {
                        // Regular user account
-                       $userInstance = User::createUserByUserName($authLogin);
+                       $userInstance = Member::createUserByUserName($authLogin);
                }
 
                // Is the password correct?
                if ($userInstance->getPasswordHash() !== $authHash) {
                        // Mismatching password
-                       throw new UserPasswordMismatchException(array($this, $userInstance), User::EXCEPTION_USER_PASS_MISMATCH);
+                       throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
 
                // Remember auth and user instances in registry
index 7f3bc69e35d97494c3ff4e28895c0580c2ac879b..f28d1817ee3b633ddbf03f6386c06d6919cef66c 100644 (file)
@@ -97,7 +97,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                // Does it match?
                if ($oldHash != $passHash) {
                        // Throw an exception here to stop the proccessing
-                       throw new AccountPasswordMismatchException($this, User::EXCEPTION_USER_PASS_MISMATCH);
+                       throw new AccountPasswordMismatchException($this, BaseUser::EXCEPTION_USER_PASS_MISMATCH);
                } // END - if
        }
 }
index d65ca746a291af381828fbf458bdac943c368bc6..d9a11d9b950e8e652219f6d2dcf4a52b6fd3fbe8 100644 (file)
@@ -60,7 +60,7 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a user instance for comparison
-               $userInstance = User::createUserByRequest($requestInstance);
+               $userInstance = Member::createUserByRequest($requestInstance);
 
                // Is the email address valid?
                if (!$userInstance->ifEmailAddressExists()) {
index 2dcbd9315b386132448bba430f46cacc7c251573..4230fbc4892e979acd4e0c62608614afffe15325 100644 (file)
@@ -70,7 +70,7 @@ class BaseMailer extends BaseFrameworkSystem {
         * @param       $userInstance   An instance of a user class
         * @return      void
         */
-       public function addRecipientByUserInstance (ManageableUser $userInstance) {
+       public function addRecipientByUserInstance (ManageableMember $userInstance) {
                // Get template name
                $templateName = $this->getTemplateName();
 
index 6a93267b474a837f61ce4b8ba44c157f66651295..9e2aea10a43d54312d1a83b1373064dcda1c2f13 100644 (file)
@@ -78,7 +78,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                        // Walk through all recipients and "sent", or better print, it out
                        foreach ($recipientList['recipients'] as $recipientInstance) {
                                // The recipient should be a user instance, right?
-                               if ($recipientInstance instanceof ManageableUser) {
+                               if ($recipientInstance instanceof ManageableMember) {
                                        // User class found, so entry is valid, first load the template
                                        $this->loadTemplate($templateName);
 
diff --git a/inc/classes/main/user/member/.htaccess b/inc/classes/main/user/member/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php
new file mode 100644 (file)
index 0000000..1cf97e9
--- /dev/null
@@ -0,0 +1,202 @@
+<?php
+/**
+ * A generic class for handling users
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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 <http://www.gnu.org/licenses/>.
+ */
+class Member extends BaseUser implements ManageableMember, Registerable, Updateable {
+       // Exception constances
+       const EXCEPTION_USERNAME_NOT_FOUND   = 0x150;
+       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151;
+       const EXCEPTION_USER_PASS_MISMATCH   = 0x152;
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className = "") {
+               // Is the class name empty? Then this is not a specialized user class
+               if (empty($className)) $className = __CLASS__;
+
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Set part description
+               $this->setObjectDescription("Generic user class");
+
+               // Create unique ID number
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Destructor to always flush updates
+        *
+        * @return      void
+        */
+       public function __destruct () {
+               // Flush any updated entries to the database
+               $this->flushPendingUpdates();
+
+               // Call parent destructor
+               parent::__destruct();
+       }
+
+       /**
+        * Creates an instance of this user class by a provided username. This
+        * factory method will check if the username is already taken and if not
+        * so it will throw an exception.
+        *
+        * @param       $userName               Username we need a class instance for
+        * @return      $userInstance   An instance of this user class
+        * @throws      UsernameMissingException        If the username does not exist
+        */
+       public final static function createUserByUsername ($userName) {
+               // Get a new instance
+               $userInstance = new Member();
+
+               // Set the username
+               $userInstance->setUserName($userName);
+
+               // Check if the username exists
+               if (!$userInstance->ifUsernameExists()) {
+                       // Throw an exception here
+                       throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
+               }
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Creates an instance of this user class by a provided email address. This
+        * factory method will not check if the email address is there.
+        *
+        * @param       $email                  Email address of the user
+        * @return      $userInstance   An instance of this user class
+        */
+       public final static function createUserByEmail ($email) {
+               // Get a new instance
+               $userInstance = new Member();
+
+               // Set the username
+               $userInstance->setEmail($email);
+
+               // Return the instance
+               return $userInstance;
+       }
+
+       /**
+        * Creates a user by a given request instance
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      $userInstance           An instance of this user class
+        */
+       public final static function createUserByRequest (Requestable $requestInstance) {
+               // Determine if by email or username
+               if (!is_null($requestInstance->getRequestElement('username'))) {
+                       // Username supplied
+                       $userInstance = self::createUserByUserName($requestInstance->getRequestElement('username'));
+               } elseif (!is_null($requestInstance->getRequestElement('email'))) {
+                       // Email supplied
+                       $userInstance = self::createUserByEmail($requestInstance->getRequestElement('email'));
+               } else {
+                       // Unsupported mode
+                       $userInstance = new Member();
+                       $userInstance->partialStub("We need to add more ways of creating user classes here.");
+                       $userInstance->debugBackTrace();
+                       exit();
+               }
+
+               // Return the prepared instance
+               return $userInstance;
+       }
+
+       /**
+        * Adds data for later complete update
+        *
+        * @param       $column         Column we want to update
+        * @param       $value          New value to store in database
+        * @return      void
+        * @deprecated
+        */
+       public function addUpdateData ($column, $value) {
+               $this->deprecatedMethod("Please use updateDatabaseField() instead!");
+               $this->updateDatabaseField($column, $value);
+       }
+
+       /**
+        * Updates the last activity timestamp and last performed action in the
+        * database result. You should call flushPendingUpdates() to flush these updates
+        * to the database layer.
+        *
+        * @param       $requestInstance        A requestable class instance
+        * @return      void
+        */
+       public function updateLastActivity (Requestable $requestInstance) {
+               // Set last action
+               $lastAction = $requestInstance->getRequestElement('action');
+
+               // If there is no action use the default on
+               if (is_null($lastAction)) {
+                       $lastAction = $this->getConfigInstance()->readConfig('login_default_action');
+               } // END - if
+
+               // Get a critieria instance
+               $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+               // Add search criteria
+               $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+               $searchInstance->setLimit(1);
+
+               // Now get another criteria
+               $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
+
+               // And add our both entries
+               $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time()));
+               $updateInstance->addCriteria('last_action', $lastAction);
+
+               // Add the search criteria for searching for the right entry
+               $updateInstance->setSearchInstance($searchInstance);
+
+               // Remember the update in database result
+               $this->getResultInstance()->add2UpdateQueue($updateInstance);
+       }
+
+       /**
+        * Flushs all pending updates to the database layer
+        *
+        * @return      void
+        */
+       public function flushPendingUpdates () {
+               // Do we have data to update?
+               if ($this->getResultInstance()->ifDataNeedsFlush()) {
+                       // Get a database wrapper
+                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+                       // Yes, then send the whole result to the database layer
+                       $wrapperInstance->doUpdateByResult($this->getResultInstance());
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/user/user/.htaccess b/inc/classes/main/user/user/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/inc/classes/main/user/user/class_User.php b/inc/classes/main/user/user/class_User.php
deleted file mode 100644 (file)
index 6b0491d..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-<?php
-/**
- * A generic class for handling users
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.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 <http://www.gnu.org/licenses/>.
- */
-class User extends BaseUser implements ManageableUser, Registerable, Updateable {
-       // Exception constances
-       const EXCEPTION_USERNAME_NOT_FOUND   = 0x150;
-       const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151;
-       const EXCEPTION_USER_PASS_MISMATCH   = 0x152;
-
-       /**
-        * Protected constructor
-        *
-        * @param       $className      Name of the class
-        * @return      void
-        */
-       protected function __construct ($className = "") {
-               // Is the class name empty? Then this is not a specialized user class
-               if (empty($className)) $className = __CLASS__;
-
-               // Call parent constructor
-               parent::__construct($className);
-
-               // Set part description
-               $this->setObjectDescription("Generic user class");
-
-               // Create unique ID number
-               $this->generateUniqueId();
-       }
-
-       /**
-        * Destructor to always flush updates
-        *
-        * @return      void
-        */
-       public function __destruct () {
-               // Flush any updated entries to the database
-               $this->flushPendingUpdates();
-
-               // Call parent destructor
-               parent::__destruct();
-       }
-
-       /**
-        * Creates an instance of this user class by a provided username. This
-        * factory method will check if the username is already taken and if not
-        * so it will throw an exception.
-        *
-        * @param       $userName               Username we need a class instance for
-        * @return      $userInstance   An instance of this user class
-        * @throws      UsernameMissingException        If the username does not exist
-        */
-       public final static function createUserByUsername ($userName) {
-               // Get a new instance
-               $userInstance = new User();
-
-               // Set the username
-               $userInstance->setUserName($userName);
-
-               // Check if the username exists
-               if (!$userInstance->ifUsernameExists()) {
-                       // Throw an exception here
-                       throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
-               }
-
-               // Return the instance
-               return $userInstance;
-       }
-
-       /**
-        * Creates an instance of this user class by a provided email address. This
-        * factory method will not check if the email address is there.
-        *
-        * @param       $email                  Email address of the user
-        * @return      $userInstance   An instance of this user class
-        */
-       public final static function createUserByEmail ($email) {
-               // Get a new instance
-               $userInstance = new User();
-
-               // Set the username
-               $userInstance->setEmail($email);
-
-               // Return the instance
-               return $userInstance;
-       }
-
-       /**
-        * Creates a user by a given request instance
-        *
-        * @param       $requestInstance        An instance of a Requestable class
-        * @return      $userInstance           An instance of this user class
-        */
-       public final static function createUserByRequest (Requestable $requestInstance) {
-               // Determine if by email or username
-               if (!is_null($requestInstance->getRequestElement('username'))) {
-                       // Username supplied
-                       $userInstance = self::createUserByUserName($requestInstance->getRequestElement('username'));
-               } elseif (!is_null($requestInstance->getRequestElement('email'))) {
-                       // Email supplied
-                       $userInstance = self::createUserByEmail($requestInstance->getRequestElement('email'));
-               } else {
-                       // Unsupported mode
-                       $userInstance = new User();
-                       $userInstance->partialStub("We need to add more ways of creating user classes here.");
-                       $userInstance->debugBackTrace();
-                       exit();
-               }
-
-               // Return the prepared instance
-               return $userInstance;
-       }
-
-       /**
-        * Adds data for later complete update
-        *
-        * @param       $column         Column we want to update
-        * @param       $value          New value to store in database
-        * @return      void
-        * @deprecated
-        */
-       public function addUpdateData ($column, $value) {
-               $this->deprecatedMethod("Please use updateDatabaseField() instead!");
-               $this->updateDatabaseField($column, $value);
-       }
-
-       /**
-        * Updates the last activity timestamp and last performed action in the
-        * database result. You should call flushPendingUpdates() to flush these updates
-        * to the database layer.
-        *
-        * @param       $requestInstance        A requestable class instance
-        * @return      void
-        */
-       public function updateLastActivity (Requestable $requestInstance) {
-               // Set last action
-               $lastAction = $requestInstance->getRequestElement('action');
-
-               // If there is no action use the default on
-               if (is_null($lastAction)) {
-                       $lastAction = $this->getConfigInstance()->readConfig('login_default_action');
-               } // END - if
-
-               // Get a critieria instance
-               $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
-
-               // Add search criteria
-               $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
-               $searchInstance->setLimit(1);
-
-               // Now get another criteria
-               $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
-
-               // And add our both entries
-               $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time()));
-               $updateInstance->addCriteria('last_action', $lastAction);
-
-               // Add the search criteria for searching for the right entry
-               $updateInstance->setSearchInstance($searchInstance);
-
-               // Remember the update in database result
-               $this->getResultInstance()->add2UpdateQueue($updateInstance);
-       }
-
-       /**
-        * Flushs all pending updates to the database layer
-        *
-        * @return      void
-        */
-       public function flushPendingUpdates () {
-               // Do we have data to update?
-               if ($this->getResultInstance()->ifDataNeedsFlush()) {
-                       // Get a database wrapper
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
-
-                       // Yes, then send the whole result to the database layer
-                       $wrapperInstance->doUpdateByResult($this->getResultInstance());
-               } // END - if
-       }
-}
-
-// [EOF]
-?>
index ec15729d04f62e7f200cbec40a692e615e5199d5..e49f94b9bce342cbd9d0bc08ef0eea70db42c380 100644 (file)
@@ -261,7 +261,7 @@ $cfg->setConfigEntry('is_single_server', "Y");
 $cfg->setConfigEntry('post_registration_class', "LoginAfterRegistrationAction");
 
 // CFG: USER-CLASS
-$cfg->setConfigEntry('user_class', "User");
+$cfg->setConfigEntry('user_class', "Member");
 
 // CFG: GUEST-CLASS
 $cfg->setConfigEntry('guest_class', "Guest");