Last active
September 25, 2015 08:16
-
-
Save mcjwsk/341cd6d9043141f3b35c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'app/Mage.php'; | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
// Reset admin path. | |
$config = Mage::getSingleton('core/config'); | |
$config->saveConfig('admin/url/custom_path', 'admin', 'default', 0); | |
$config->saveConfig('web/unsecure/base_url', '{{base_url}}', 'default', 0); | |
$config->saveConfig('web/secure/base_url', '{{base_url}}', 'default', 0); | |
$config->saveConfig('web/cookie/cookie_domain', '', 'default', 0); | |
// Create admin user (admin / admin123). | |
$user = Mage::getModel('admin/user'); | |
$user->setData(array( | |
'username' => 'admin', | |
'firstname' => 'admin', | |
'lastname' => 'admin', | |
'email' => '[email protected]', | |
'password' => 'admin123', | |
'is_active' => 1, | |
)); | |
$user->save(); | |
$user->setRoleIds(array(1)); | |
$user->setRoleUserId($user->getUserId()); | |
$user->saveRelations(); | |
Mage::app()->cleanCache(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment