public function processAction()
    { 
    	$request = $this->getRequest();
    	

        // Check if we have a POST request
        if (!$request->isPost()) {
            return $this->_helper->redirector('index');
        }
        

        // Get our form and validate it
        $form = $this->getForm();
        
        
        // Validate username and password for matching criteria
        if (!$form->isValid($request->getPost())) 
        {
            // Invalid entries
            $this->view->form = $form;
            return $this->render('index'); // re-render the login form
        }
        echo "valid";

        // Get our authentication adapter and check credentials
        
        /*$adapter = $this->getAuthAdapter($form->getValues());
        $auth    = Zend_Auth::getInstance();
        $result  = $auth->authenticate($adapter);
        
        if (!$result->isValid()) 
        {
            // Invalid credentials
            $form->setDescription('Invalid credentials provided');
            $this->view->form = $form;
            return $this->render('index'); // re-render the login form
        }*/
        
        // Validate against LDAP 
        
        // Validate against matrix database
        $username = $form->getValue('username');
        print_r($username);
        $password = $form->getValue('password');
        
        $userService = new App_UserService();
        $valid = $userService->ValidUserPassword($username, $password);
        
        if ($valid)
        {
	 //echo"sdfasdf";
        	//$this->error_flag = FALSE;
        	//$this->view->error_flag = $this->error_flag;
        	$userRole = $userService->GetUserRole($username);
       		
        	if ($userRole == 'U' || $userRole == 'L' || $userRole == 'G')
        	{
        		$this->_helper->redirector('index', 'student');
        	}
        	else if ($userRole == 'F')
        	{
        		$this->_helper->redirector('index', 'faculty');
        	}
        	
        	//$this->_helper->redirector('index', 'index');
        }
        else
        {
        	// Redirect to the login page
        	//$this->view->error_flag = TRUE;
        	//$this->view->error_flag = $this->error_flag;
        	
        	$this->_helper->redirector('index', 'user');
        }
        
        /*
        $dbAdapter = Zend_Db_Table::getDefaultAdapter();
        /*$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
        
        $authAdapter->setTableName('user');
        $authAdapter->setIdentityColumn('username');
		$authAdapter->setCredentialColumn('password');
        $authAdapter->setCredentialTreatment('MDS(?');
        
        // Pass to the adapter the submitted username and password
        $authAdapter->setIdentity($username);
        $authAdapter->setCredential($password);*/
        
        // We're authenticated! Redirect to the home page
        //$this->_helper->redirector('index', 'index');	
        //echo 'hi';
    }