<commit_before><?php
/**
 *
 *
 * @author      <NAME> <<EMAIL>>
 * @copyright   2012-2013 <NAME>
 * @license     GNU General Public License http://www.gnu.org/licenses/gpl.txt
 * @version     $Id: v1.0.0.2-22-g7bc4608 2013-05-05 22:07:15 +0200 Knut Kohl $
 */
namespace Controller;

/**
 *
 */
class Admin extends \Controller {

	/**
	 *
	 */
	public function LoginPOST_Action() {

		$hasher = new \PasswordHash();

		$user = $this->request->post('user');
		$pass = $this->request->post('pass');

		if ($this->config->get('Admin.User') == $user AND
		    $hasher->CheckPassword($pass, $this->config->get('Admin.Password'))) {

			$this->User = $user;
			\Session::set('user', $user);

			if ($this->request->post('save')) {
				setcookie(\Session::token(), 1, time()+60*60*24*7, '/');
			}
			\Messages::Success(\I18N::_('Welcome', $this->User));

			if ($r = \Session::get('returnto')) {
				// Clear before redirect
				\Session::set('returnto');
				$this->app->redirect($r);
			} else {
				$this->app->redirect('index');
			}

		} else {<commit_msg>Accept case insensitive user login name<commit_after><?php
/**
 *
 *
 * @author      <NAME> <<EMAIL>>
 * @copyright   2012-2013 <NAME>
 * @license     GNU General Public License http://www.gnu.org/licenses/gpl.txt
 * @version     $Id: v1.0.0.2-22-g7bc4608 2013-05-05 22:07:15 +0200 <NAME> $
 */
namespace Controller;

/**
 *
 */
class Admin extends \Controller {

	/**
	 *
	 */
	public function LoginPOST_Action() {

		$hasher = new \PasswordHash();

		$user = $this->request->post('user');
		$pass = $this->request->post('pass');

		$AdminUser = $this->config->get('Admin.User');
		$AdminPass = $this->config->get('Admin.Password');

		// Ignore case of user name input
		if (strtolower($AdminUser) == strtolower($user) AND
		    $hasher->CheckPassword($pass, $AdminPass)) {

			$this->User = $AdminUser;
			\Session::set('user', $AdminUser);

			if ($this->request->post('save')) {
				setcookie(\Session::token(), 1, time()+60*60*24*7, '/');
			}
			\Messages::Success(\I18N::_('Welcome', $this->User));

			if ($r = \Session::get('returnto')) {
				// Clear before redirect
				\Session::set('returnto');
				$this->app->redirect($r);
			} else {
				$this->app->redirect('index');
			}

		} else {
{'fraction_non_alphanumeric': 0.2225177304964539, 'fraction_numerical': 0.041666666666666664, 'mean_word_length': 3.3154875717017207, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '7364908', 'n_tokens_mistral': 943, 'n_tokens_neox': 781, 'n_words': 144}