<?php
/*
* Copyright (c) 2009-2010 ATMAIL. All rights reserved
* See http://atmail.com/license.php for license agreement
*/

class Atmail_Controller_Plugin_Authenticate extends Atmail_Controller_Plugin
{

	public function preDispatch(Zend_Controller_Request_Abstract $request)
	{

		if( 
			($request->getControllerName() == 'auth' && $request->getActionName() == 'processlogin') 
		 || $request->getModuleName() == 'admin' 
		 || ($request->getControllerName() == 'mail' && $request->getActionName() == 'index') 
		 || ($request->getControllerName() == 'contacts' && $request->getActionName() == 'viewcontact') 
		 || ($request->getControllerName() == 'settings' && $request->getActionName() == 'index') 
		 || ($request->getControllerName() == 'mail' && $request->getActionName() == 'foldercreate'
         || ($request->getControllerName() == 'mail' && $request->getActionName() == 'movefolder'))
		)
			license::validate();
		elseif( !defined('ATMAIL_USER_COUNT') ) 
			define("ATMAIL_USER_COUNT", 1);	

	}
	
	public function initAdminController($controller)
	{
		eval(base64_decode('JGNvbnRyb2xsZXItPnZpZXctPmxpY2Vuc2VFcnJvciA9ICEoWmVuZF9SZWdpc3RyeTo6Z2V0KCd3NG03MFl0MGhZVWR1TTJDMmxyckl1WTB6Z0tHNEEzdnZmdGw0TmJicldmVycpKTs='));
	}

}