示例#1
0
 /**
  * Action inicial do sistema
  */
 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     $identity = $auth->getIdentity();
     if ($identity) {
         $this->view->identity = $identity;
         //Obtém o profile do usuario
         $this->view->profile = $this->_bsnUserProfile->get();
     }
 }
示例#2
0
    /**
     * Renderiza o menu superior
     */
    public function menuAction()
    {
        $toshow = array();
        $identity = $this->_auth->getIdentity();
        if ($identity) {
            $profile = $this->_bsnUserProfile->get();
            $this->view->profile = $profile;
        }


        if ($identity) {
            $toshow['profile'] = true;
        } else {
            $toshow['login'] = true;
        }

        $this->view->toshow = $toshow;
        $this->view->identity = $identity;

        //Cria o redirecionador
        $this->createRedirect();
    }
示例#3
0
    /**
     * Gerencia o perfil do usuário online no momento
     *
     */
    public function manageAction()
    {
        $step = $this->_getParam('step', 'personal');


        if(!$this->_auth->getIdentity()){
            $this->autoRedirect('/');
        }

        //Faz a validação do formulário
        if ($_POST && $this->_formManage->isValid($_POST)) {
            // Salva o profile do usuário
            if ($this->_bsnUserProfile->save($_POST)) {
                //Redireciona o usuário para onde estava antes de chegar ao formulário
                $this->autoRedirect();
            }
        } else {
            $this->_formManage->populate($this->_bsnUserProfile->getToForm());
        }



        $this->view->form = $this->_formManage;
    }