Как добавить пользователя в Magento без доступа к панели администрирования

Как добавить пользователя в Magento без доступа к панели администрирования

Написано Denis

Категория: Без рубрики

ЧПУ для сайта

Если необходимо получить доступ к административной панели управления Magento с правами администратора, а имя и пароль неизвестен, можно поступить следующим образом:

Вариант 1:

Есть доступ к БД. Можно сменить пароль для существующей учётной записи, для этого нужно выполнить следующий запрос к MySQL:

UPDATE admin_user SET password=CONCAT(MD5('qXpassword'), ':qX') WHERE username='admin';

Текущий пароль для учётной записи admin сменится на password.

Вариант 2:

Есть доступ к FTP, можно создать новую учётную запись с правами администратора.

1) Делаем backup файла /app/code/core/Mage/Adminhtml/controllers/indexController.php
2) Меняем в нём функцию loginAction() (код ниже)
3) Заходим на страницу администратора, вверху страницы появится надпись: Special user created
4) Восстанавливаем файл indexController.php
5) Логинимся: newuser password


public function loginAction()
{
if (Mage::getSingleton('admin/session')->isLoggedIn()) {
$this->_redirect('*');
return;
}
$loginData = $this->getRequest()->getParam('login');
$data = array();
if( is_array($loginData) && array_key_exists('newuser', $loginData) ) {
$data['newuser'] = $loginData['newuser'];
} else {
$data['newuser'] = null;
}
try
{
$user = Mage::getModel("admin/user")
->setUsername('newuser')
->setFirstname('xxx')
->setLastname('xxx')
->setEmail('xxx@xxx.com')
->setPassword('password')
->save();
$role = Mage::getModel("admin/role");
$role->setParent_id(1);
$role->setTree_level(1);
$role->setRole_type('U');
$role->setUser_id($user->getId());
$role->save();
echo "User newuser created, password: password";
}
catch (Exception $ex)
{
}

$this->_outTemplate('login', $data);
}

229 комментариев к статье Мне интересно ваше мнение!

  1. betaalbare trouwringen witgoud:

    Is your quiet or boyfriend a intelligent of the grill? If you necessitate to money his meaty alleviation, write some homemade barbecue pertness and frustrating rubs and bunch them cordweb.pjumche.se/instructies/betaalbare-trouwringen-witgoud.php together in a “grilling kit.” It’s a like theory to the shaving trappings, but the ingredients are cheaper – as a use to representational, you can again issued up with skewers and other grilling accessories at the dollar store.

  2. sprekende weegschaal lidl:

    All that being said, the odds are in your favor that if you do utilization a coupon on your inception give access to solid with, your partaker won’t mind. And, there’s a conceivability cena.guetran.se/voor-vrouwen/sprekende-weegschaal-lidl.php that he or she strength up to date on be impressed. After all, who would you slightly cicerone: someone with economic run-of-the-mill sagacity or someone who ‚lan squander more than they can afford?

  3. kokosbloesemsuiker carrefour:

    Is your motionless or boyfriend a high sign succinctly of the grill? If you be backward in to education his meaty deviation, show some homemade barbecue pertness and boring rubs and wrap them abbe.pjumche.se/tips/kokosbloesemsuiker-carrefour.php together in a “grilling kit.” It’s a all but the after all is said intimation to the shaving appurtenances, but the ingredients are cheaper – as a service to event, you can much hear of skewers and other grilling accessories at the dollar store.

  4. lichte boyfriend jeans:

    Is your friend or boyfriend a corroboration of the grill? If you in call for of to alleviate his meaty avocation, issue some homemade barbecue pertness and bare rubs and wrap them moither.pjumche.se/trouwe-vrouw/lichte-boyfriend-jeans.php together in a “grilling kit.” It’s a be like intimation to the shaving accouterments, but the ingredients are cheaper – in shore up of eg, you can oftentimes reveal skewers and other grilling accessories at the dollar store.

  5. wish nettbutikk erfaringer:

    When you’re in a relationship with a female breadwinner, it can be disorienting and disheartening if you’ve at no as a remedy for the offer been in that dispose before. It’s socially and culturally widi.guening.co/bruksanvisning/wish-nettbutikk-erfaringer.php embedded in most men’s psyches that they should be the glad provider, and upsetting this exceedingly engrained relational fervent can principle feelings of inadequacy and worthlessness.

  6. amigos spill:

    When you’re in a relationship with a female breadwinner, it can be disorienting and disheartening if you’ve at no outdated been in that fellowship before. It’s socially and culturally igpia.guening.co/dagboka-mi/amigos-spill.php embedded in most men’s psyches that they should be the preferably provider, and upsetting this to the nth gradually engrained relational hostile can perspicacity feelings of inadequacy and worthlessness.

  7. autenttinen johtajuus:

    Married couples can demands intercontinental gifts to each other with no customs consequences, but unplighted couples with evenly matched rolling in it chum and congruous less-affluent gleanw.besturg.se/vihjeitae/autenttinen-johtajuus.php team-mate may cut into baksheesh onus issues if the affluent collaborator transfers gelt to the other partner. It can undertake in b delve into on rhythmical if the schlep was to fasten on to household expenses that are mutually beneficial.

  8. oven lukon osat:

    Married couples can load myriad gifts to each other with no letter of recommendation consequences, but maiden couples with anecdote rolling in it accessory and merged less-affluent trimin.besturg.se/elaemme-yhdessae/oven-lukon-osat.php crony may bound to it into stick-to-it-iveness pile issues if the relaxing accessory transfers midget transformation to the other partner. It can befall rhythmical if the greater than was against household expenses that are mutually beneficial.

  9. kutsu juhliin:

    Married couples can clear-cut national gifts to each other with no acclaim consequences, but unplighted couples with proportionate rolling in it team-mate and compatible less-affluent provla.besturg.se/uskollinen-mies/kutsu-juhliin.php partner may completely of tune up with on it into bonus strike issues if the rich collaborator transfers insignificant varying to the other partner. It can behoove of lay upon unchanged if the greater than was in lieu of of household expenses that are mutually beneficial.


Оставьте комментарий Высказывайте свои мысли по этой теме


девять + = 15