Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. /* This is an example SQL script.
  2. You should replace all the UPPERCASED variables.
  3. The <USERNAME> variable can only be alphanumeric characters, and probably underscores (haven't tested)
  4.  
  5. You can either generate a password hash using the PHP code below,
  6. or you can grab a password hash from the admin_user table from an
  7. existing Magento install for which you know the admin password.
  8. */
  9.  
  10. /* Use the following PHP script to generate a salted password hash. You can also use a straight md5 hash, but it's much more easily brute-forced
  11. <?php $password = 'PASSWORD'; $salt = 'GF'; echo $hash = md5($salt.$password).':'.$salt; ?>
  12. */
  13.  
  14. insert into admin_user
  15. select
  16. (select max(user_id) + 1 from admin_user) user_id,
  17. 'FIRST NAME' first_name,
  18. 'LAST NAME' last_name,
  19. 'EMAIL' email,
  20. 'USERNAME' username,
  21. 'HASH EXAMPLE: 178f29c8e4c6c801db90cd171e3b2b53:in' password, /* You can replace this value with an md5 hash */
  22. now() created,
  23. NULL modified,
  24. NULL logdate,
  25. 0 lognum,
  26. 0 reload_acl_flag,
  27. 1 is_active,
  28. (select max(extra) from admin_user where extra is not null) extra;
  29.  
  30. insert into admin_role
  31. select
  32. (select max(role_id) + 1 from admin_role) role_id,
  33. (select role_id from admin_role where role_name = 'Administrators') parent_id,
  34. 2 tree_level,
  35. 0 sort_order,
  36. 'U' role_type,
  37. (select user_id from admin_user where username = 'USERNAME') user_id,
  38. 'USERNAME' role_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement