<commit_before><?php
/**
 * @version     $Id$
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Users
 * @copyright   Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Login Controller Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/gergoerdosi>
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Users
 */
class ComUsersControllerLogin extends ComDefaultControllerResource
{
    protected function _actionLogin(KCommandContext $context)
    {
        if($return = KRequest::get('post.return', 'alnum'))
        {
            $return = base64_decode($return);

            if(!JURI::isInternal($return)) {
                $return = '';
            }
        }

        $options = array(
            'return'   => $return
        );

        $credentials = array(
            'username' => KRequest::get('post.username', 'string'),
            'password' => KRequest::get('post.password', 'raw')
        );

        $result = KFactory::get('lib.joomla.application')->login($credentials, $options);

        if(!JError::isError($result))
        {
            if(!$return) {
                $return = 'index.php?option=com_users&view=user';
            }

            $this->_redirect = $return;
        }
        else
        {
            if(!$return) {
                $return	= 'index.php?option=com_users&view=login';
            }

            $this->setRedirect($return, $result->getError(), 'error');
        }
    }
}<commit_msg>Change filter on return value of login to base64 from alnum<commit_after><?php
/**
 * @version     $Id$
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Users
 * @copyright   Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Login Controller Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/gergoerdosi>
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Users
 */
class ComUsersControllerLogin extends ComDefaultControllerResource
{
    protected function _actionLogin(KCommandContext $context)
    {
        if($return = KRequest::get('post.return', 'base64'))
        {
            $return = base64_decode($return);

            if(!JURI::isInternal($return)) {
                $return = '';
            }
        }

        $options = array(
            'return'   => $return
        );

        $credentials = array(
            'username' => KRequest::get('post.username', 'string'),
            'password' => KRequest::get('post.password', '<PASSWORD>')
        );

        $result = KFactory::get('lib.joomla.application')->login($credentials, $options);

        if(!JError::isError($result))
        {
            if(!$return) {
                $return = 'index.php?option=com_users&view=user';
            }

            $this->_redirect = $return;
        }
        else
        {
            if(!$return) {
                $return	= 'index.php?option=com_users&view=login';
            }

            $this->setRedirect($return, $result->getError(), 'error');
        }
    }
}
{'fraction_non_alphanumeric': 0.15184513006654568, 'fraction_numerical': 0.0054446460980036296, 'mean_word_length': 2.0145852324521423, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '5823203', 'n_tokens_mistral': 1015, 'n_tokens_neox': 981, 'n_words': 168}