예제 #1
0
 /**
  * Disabled form security in order to prevent exit from the app
  * @magentoConfigFixture current_store admin/security/session_lifetime 59
  */
 public function testIsLoggedInWithIgnoredLifetime()
 {
     $this->_auth->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
     $this->assertTrue($this->_model->isLoggedIn());
     $this->_model->setUpdatedAt(time() - 101);
     $this->assertTrue($this->_model->isLoggedIn());
 }
예제 #2
0
 protected function tearDown()
 {
     $this->_auth->logout();
     $this->_auth = null;
     $this->_session = null;
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
     parent::tearDown();
 }
예제 #3
0
 /**
  * @magentoConfigFixture current_store admin/captcha/enable 1
  * @magentoConfigFixture current_store admin/captcha/forms backend_login
  * @magentoConfigFixture current_store admin/captcha/mode after_fail
  * @magentoConfigFixture current_store admin/captcha/failed_attempts_login 1
  * @magentoDbIsolation enabled
  * @magentoAppIsolation enabled
  */
 public function testCaptchaIsRequiredAfterFailedLoginAttempts()
 {
     $this->markTestIncomplete('MAGETWO-1662');
     Mage::app()->setCurrentStore(0);
     $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha('backend_login');
     try {
         $authModel = new Mage_Backend_Model_Auth();
         $authModel->login(Magento_Test_Bootstrap::ADMIN_NAME, 'wrong_password');
     } catch (Exception $e) {
     }
     $this->assertTrue($captchaModel->isRequired());
 }
예제 #4
0
 public function testGetUser()
 {
     $this->_model->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
     $this->assertNotNull($this->_model->getUser());
     $this->assertGreaterThan(0, $this->_model->getUser()->getId());
     $this->assertInstanceOf('Mage_Backend_Model_Auth_Credential_StorageInterface', $this->_model->getUser());
 }
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Magento
 * @package     Mage_DesignEditor
 * @subpackage  integration_tests
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$session = new Mage_DesignEditor_Model_Session();
$auth = new Mage_Backend_Model_Auth();
$auth->setAuthStorage($session);
$session->deactivateDesignEditor();
$auth->logout();
예제 #6
0
 /**
  * Performs user logout
  */
 protected function _logout()
 {
     $this->_auth->logout();
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
 }
예제 #7
0
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Magento
 * @package     Mage_DesignEditor
 * @subpackage  integration_tests
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$session = new Mage_DesignEditor_Model_Session();
$auth = new Mage_Backend_Model_Auth();
$auth->setAuthStorage($session);
$auth->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
$session->activateDesignEditor();
예제 #8
0
 public static function loginAdminRollback()
 {
     $auth = new Mage_Backend_Model_Auth();
     $auth->setAuthStorage(self::$_adminSession);
     $auth->logout();
 }
예제 #9
0
 /**
  * @covers Mage_Backend_Helper_Data::getCurrentUserId
  */
 public function testGetCurrentUserId()
 {
     $this->assertFalse($this->_helper->getCurrentUserId());
     /**
      * perform login
      */
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOffSecretKey();
     $auth = new Mage_Backend_Model_Auth();
     $auth->login(Magento_Test_Bootstrap::ADMIN_NAME, Magento_Test_Bootstrap::ADMIN_PASSWORD);
     $this->assertEquals(1, $this->_helper->getCurrentUserId());
     /**
      * perform logout
      */
     $auth->logout();
     Mage::getSingleton('Mage_Backend_Model_Url')->turnOnSecretKey();
     $this->assertFalse($this->_helper->getCurrentUserId());
 }