X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcommands%2Fweb%2Fclass_WebResendLinkCommand.php;h=2cd6a82fffc118fe21d17e50d6d7c2d014fdc8e6;hp=596bf89488c6bda2e680a276fd6065d843c01628;hb=ccc1db45751c976264513b8c51884e39f8214b12;hpb=26447c8c004c0420e4fd97fe3f232f65427486fb diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php index 596bf894..2cd6a82f 100644 --- a/inc/classes/main/commands/web/class_WebResendLinkCommand.php +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -38,7 +38,7 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { * @param $resolverInstance An instance of a command resolver class * @return $commandInstance An instance a prepared command class */ - public final static function createWebResendLinkCommand (CommandResolver $resolverInstance) { + public static final function createWebResendLinkCommand (CommandResolver $resolverInstance) { // Get new instance $commandInstance = new WebResendLinkCommand(); @@ -55,20 +55,13 @@ 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 ManageableMember */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get user instance from registry $userInstance = Registry::getRegistry()->getInstance('user'); - // Does the user instance implement ManageableMember? - if (!$userInstance instanceof ManageableMember) { - // Throw exception here - throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING); - } // END - if - // Get an application instance - $appInstance = $this->getResolverInstance()->getApplicationInstance(); + $applicationInstance = $this->getResolverInstance()->getApplicationInstance(); // Get a RNG instance (Random Number Generator) $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class'); @@ -86,16 +79,16 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, $hashedString); // Re-set config entry to mailer engine - $this->getConfigInstance()->setConfigEntry('template_class', $this->getConfigInstance()->readConfig('mail_template_class')); + $this->getConfigInstance()->setConfigEntry('web_template_class', $this->getConfigInstance()->getConfigEntry('mail_template_class')); // Prepare the template engine - $templateInstance = $this->prepareTemplateInstance($appInstance); + $templateInstance = $this->prepareTemplateInstance($applicationInstance); // Assign the application data with the template engine - $templateInstance->assignApplicationData($appInstance); + $templateInstance->assignApplicationData($applicationInstance); // Get a mailer class - $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, $appInstance, 'resend_link')); + $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, $applicationInstance, 'resend_link')); // Set this mailer in our template engine $templateInstance->setMailerInstance($mailerInstance);