Location: PHPKode > projects > HikaShop > front/controllers/user.php
<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.4.3
 * @author		hikashop.com
 * @copyright	(C) 2010 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
class userController extends hikashopController{
	var $delete = array();
	var $modify = array('register');
	var $modify_views = array();
	var $add = array();
	function __construct($config = array()){
		parent::__construct($config);
		$this->registerDefaultTask('cpanel');
		$this->display[]='cpanel';
		$this->display[]='form';
	}
	function register(){
		$class = hikashop::get('class.user');
		$status = $class->register('user');
		if($status){
			$app=&JFactory::getApplication();
			$app->enqueueMessage(JText::sprintf('THANK_YOU_FOR_REGISTERING',HIKASHOP_LIVE));
		}
		return true;
	}
	function cpanel(){
		$user = JFactory::getUser();
		if ($user->guest) {
			$app=&JFactory::getApplication();
			$app->enqueueMessage(JText::_('PLEASE_LOGIN_FIRST'));
			global $Itemid;
			$url = '';
			if(!empty($Itemid)){
				$url='&Itemid='.$Itemid;
			}
			$app->redirect(JRoute::_('index.php?option=com_user&view=login'.$url,false));
			return false;
		}
		JRequest::setVar( 'layout', 'cpanel'  );
		return parent::display();
	}
	function form(){
		JRequest::setVar( 'layout', 'form'  );
		return $this->display();
	}
}
Return current item: HikaShop