Skip to main content

Posts

Showing posts from March, 2016

magento create admin user programatically

Create test file in root directory and place code in to that file and run yoursiteurl.com/test.php  <?php       # Create New admin User programmatically.      require_once('./app/Mage.php');     umask(0);    Mage::app();    try {                    $user = Mage::getModel('admin/user')->setData(array(                     'username'  => 'pawan',                     'firstname' => 'pawan',                     'lastname'    => 'kumar',                     'email'     => 'n.pavan37@gmail.com',                     'password'  =>'pawan123',                     'is_active' => 1                    ))->save();             } catch (Exception $e) {             echo $e->getMessage();              exit;          }         //Assign Role Id        try {                $user->setRoleIds(array(1))  //Administrator role id is