<commit_before><?php
/**
 * Epixa - Forum
 */

namespace User\Controller;

use User\Form\Login as LoginForm,
    User\Service\User as UserService,
    Epixa\Exception\NotFoundException;

/**
 * User authentication controller
 *
 * @category   Module
 * @package    User
 * @subpackage Controller
 * @copyright  2010 epixa.com - Court Ewing
 * @license    http://github.com/epixa/Forum/blob/master/LICENSE New BSD
 * @author     <NAME> (<EMAIL>)
 */
class AuthController extends \Epixa\Controller\AbstractController
{
    /**
     * Log in a user
     */
    public function loginAction()
    {
        $request = $this->getRequest();

        $form = LoginForm();
        $this->view->form = $form;

        if (!$request->isPost() || $form->isValid($request->getPost())) {
            return;
        }

        try {
            $service = new UserService();
            $user = $service->login($form->getValues());
        } catch (NotFoundException $e) {
            $msg = 'Could not find a user with those credentials';
            $form->setErrorMessage($msg);
            return;
        }

        Zend_Auth::getInstance()->getStorage()->write($user);

        $this->_helper->redirector->gotoUrlAndExit('/');
    }

    /**
     * Logs out the current user.
     */
    public function logoutAction()
    {
        Zend_Auth::getInstance()->clearIdentity();

        $this->_helper->redirector->gotoUrlAndExit('/');
    }
}<commit_msg>Fixed E_FATAL error on login action<commit_after><?php
/**
 * Epixa - Forum
 */

namespace User\Controller;

use User\Form\Login as LoginForm,
    User\Service\User as UserService,
    Epixa\Exception\NotFoundException;

/**
 * User authentication controller
 *
 * @category   Module
 * @package    User
 * @subpackage Controller
 * @copyright  2010 epixa.com - Court Ewing
 * @license    http://github.com/epixa/Forum/blob/master/LICENSE New BSD
 * @author     <NAME> (<EMAIL>)
 */
class AuthController extends \Epixa\Controller\AbstractController
{
    /**
     * Log in a user
     */
    public function loginAction()
    {
        $request = $this->getRequest();

        $form = new LoginForm();
        $this->view->form = $form;

        if (!$request->isPost() || $form->isValid($request->getPost())) {
            return;
        }

        try {
            $service = new UserService();
            $user = $service->login($form->getValues());
        } catch (NotFoundException $e) {
            $msg = 'Could not find a user with those credentials';
            $form->setErrorMessage($msg);
            return;
        }

        Zend_Auth::getInstance()->getStorage()->write($user);

        $this->_helper->redirector->gotoUrlAndExit('/');
    }

    /**
     * Logs out the current user.
     */
    public function logoutAction()
    {
        Zend_Auth::getInstance()->clearIdentity();

        $this->_helper->redirector->gotoUrlAndExit('/');
    }
}
{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.0027434842249657062, 'mean_word_length': 2.303510758776897, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6430793', 'n_tokens_mistral': 841, 'n_tokens_neox': 831, 'n_words': 180}