Continued:
[core.git] / framework / main / classes / commands / html / class_HtmlResendLinkCommand.php
index 9148524285557bd65258fb35bd9b498c7ab3380d..9d4a57d4fa2d55161658aa1ce3b468aa34635ca1 100644 (file)
@@ -3,12 +3,15 @@
 namespace Org\Mxchange\CoreFramework\Command\Guest;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -18,7 +21,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -41,7 +44,7 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -72,10 +75,10 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get user instance from registry
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get an application instance
-               $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
+               $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Get a RNG instance (Random Number Generator)
                $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
@@ -84,28 +87,25 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
                $randomString = $rngInstance->randomString(255);
 
                // Get a crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Hash and encrypt the string
                $hashedString = $cryptoInstance->hashString($cryptoInstance->encryptString($randomString));
 
                // Update the user class
-               $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, $hashedString);
+               $userInstance->updateDatabaseField(UserDatabaseFrontend::DB_COLUMN_CONFIRM_HASH, $hashedString);
 
                // Re-set config entry to mailer engine
-               $this->getConfigInstance()->setConfigEntry('html_template_class', $this->getConfigInstance()->getConfigEntry('mail_template_class'));
-
-               // Prepare the template engine
-               $templateInstance = $this->prepareTemplateInstance($applicationInstance);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('html_template_class', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('mail_template_class'));
 
                // Assign the application data with the template engine
-               $templateInstance->assignApplicationData();
+               $this->getTemplateInstance()->assignApplicationData();
 
                // Get a mailer class
-               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, 'resend_link'));
+               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($this->getTemplateInstance(), 'resend_link'));
 
                // Set this mailer in our template engine
-               $templateInstance->setMailerInstance($mailerInstance);
+               $this->getTemplateInstance()->setMailerInstance($mailerInstance);
 
                // Add template variables we shall get
                $mailerInstance->addConfigTemplateVariable('base_url');