Last active
January 30, 2018 16:12
-
-
Save stnc/a84e2fb46fcb74c34c6e143cb02970b1 to your computer and use it in GitHub Desktop.
Programmatically new Admin in Magento
This file contains 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_once('app/Mage.php'); | |
umask(0); | |
Mage::app(); | |
$user = Mage::getModel('admin/user')->setData(array( | |
'username' => 'user123', | |
'firstname' => 'selman', | |
'lastname' => 'selman', | |
'email' => 'selamntunc@gmail.com', | |
'password' => 'xxxxxx', | |
'is_active' => 1 | |
)) | |
->save(); | |
$user->setRoleIds(array(1)) | |
->setRoleUserId($user->getUserId()) | |
->saveRelations(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment