<?php

class ReSendRegistCodeMailAction  extends SOY2Action{

	protected function execute(SOY2ActionRequest &$request,SOY2ActionForm &$form,SOY2ActionResponse &$response){
		
		$email = $request->getParameter("email");
		
		$dao = SOY2DAOFactory::create("asp.ASPUserDAO");
		
		try{
			$user = $dao->getByEmail($email);
			
			$queueDao = SOY2DAOFactory::create("asp.CertificationQueueDAO");
	    	$queue = $queueDao->getByUserId($user->getId());
	    	
	    	$mailLogic = SOY2Logic::createInstance("logic.asp.ASPMailLogic");
			$mailLogic->sendActivationMail($user,$queue);
			
		}catch(Exception $e){
			return SOY2Action::FAILED;
		}
		return SOY2Action::SUCCESS;
	}
}
?>