<?php
date_default_timezone_set('Africa/Johannesburg');
class Union_IndexController extends Zend_Controller_Action
{

    public function init()
    {
        
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity())
        {
        	
            $this->_redirect('/');
        }
        $user = $auth->getIdentity();
        $db = new Model_Profile;
        $this->identity = $db->getRow($user->UserID);
        if($this->identity->Status ==0 ){
            $this->_redirect('/union/first');
            }else{
                if($this->identity->Active ==0 ){
                 $this->_redirect('/union/first');
                }
            }
        
        $this->view->assign("UserDetails",$this->getRequest()->getActionName());
        $this->view->assign("getControllerName",$this->getRequest()->getControllerName());
        $this->view->assign("getActionName",$this->getRequest()->getActionName());
				setcookie('FootPrintApp', 'FootPrintApp', time() + 86400, '/');
                                
                             
         
    }
    public function indexAction()
    {
       // $this->_helper->viewRenderer->setNoRender();
      	//$this->_helper->layout->disableLayout();
      	
      	 $this->_redirect('/union/squads/');
    }


}

