<?php
namespace Modules\Utils\CollectInfo\Model;

class Auth extends GeneralAbstract
{
	/**
	 * (non-PHPdoc)
	 * @see \Modules\Utils\CollectInfo\Model\GeneralAbstract::populateResponse()
	 */
	protected function execute(\Modules\Utils\CollectInfo\Response\ResponseAbstract $response)
	{
		// set the token value
		$tokenData = md5(\Engine\RandomGenerator::randomString(10).\Engine\RandomGenerator::randomFloat(10,15));

		// store generated token
		\Engine\Storage\General::getInstance('persistent')->set($this->request->tokenKey, $tokenData);

		// populate the response
		$response->token = $tokenData;
		$response->status = 'ok';
	}

}