服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > magento教程 >

Magento新增加管理员账户

时间:2015-11-23 10:24来源:未知 作者:最模板 点击:
1. 创建hash 密码: $vi generatePass.php ?php // test.php define(MAGENTO_ROOT, getcwd()); $mageFilename = MAGENTO_ROOT . /app/Mage.php; include $mageFilename; Mage::app(); $pass = YOUR_PASS; // the password which you want to use to logi
1. 创建hash 密码:
 
$vi generatePass.php
 
<?php  
// test.php  
define('MAGENTO_ROOT', getcwd());  
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';  
include $mageFilename;  
   
Mage::app();  
$pass = 'YOUR_PASS'; // the password which you want to use to login  
Zend_Debug::dump(Mage::helper('core')->getHash($pass, 2));  
[php] view plaincopy
php test.php  
string(35) "1e3960170b81bb14f312f144f992c078:GQ"  
 
2. 新建admin用户
 
INSERT INTO   
    admin_user  
SET   
    firstname = "admin",   
    lastname = 'admin',   
    email = 'YOUR_EMAIL',  
    username = 'YOUR_USERNAME',  
    password = '1e3960170b81bb14f312f144f992c078:GQ', -- or MD5('ADMIN_PASS') on comunity edition  
    is_active = 1,  
    extra = 'a:1:{s:11:"configState";a:12:{s:19:"carriers_matrixrate";s:1:"0";s:18:"carriers_tablerate";s:1:"0";s:17:"carriers_flatrate";s:1:"0";s:21:"carriers_freeshipping";s:1:"1";s:12:"carriers_ups";s:1:"1";s:13:"carriers_usps";s:1:"0";s:14:"carriers_fedex";s:1:"0";s:12:"carriers_dhl";s:1:"0";s:17:"amsorting_general";s:1:"1";s:15:"general_country";s:1:"1";s:14:"general_locale";s:1:"0";s:25:"general_store_information";s:1:"0";}}';  
 
3.添加到admin_role 表
 
INSERT INTO   
    admin_role   
SET  
    parent_id = 1,  
    tree_level = 2,  
    sort_order = 0,  
    role_type = 'U',  
    user_id = 'USER_ID', -- created in the previous step  
    role_name = 'admin';  
 
OK,大功告成
(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容