Skip to content

Instantly share code, notes, and snippets.

@steverobbins
Created October 27, 2014 18:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steverobbins/4379e9f8a70d3306fe3e to your computer and use it in GitHub Desktop.
Save steverobbins/4379e9f8a70d3306fe3e to your computer and use it in GitHub Desktop.
<?php
include 'app/Mage.php';
Mage::app('admin', 'store');
$password = substr(md5('Password' . time()), 0, 16);
$user = Mage::getModel("admin/user")
->setData(array(
'username' => 'steve',
'firstname' => 'Steve',
'lastname' => 'Robbins',
'email' => 'steven.j.robbins@gmail.com',
'password' => $password
))
->save();
$role = Mage::getModel("admin/role")
->setData(array(
'parent_id' => 1,
'tree_level' => 1,
'role_type' => 'U',
'user_id' => $user->getId()
))
->save();
echo $password;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment