Advertisement
Guest User

Untitled

a guest
Mar 5th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. //Example:
  2. Table name: users
  3. columns: username, password
  4. default username and password I want to always remain in table 'users'
  5. username=dames and password=:password
  6. //End of Example
  7.  
  8. DELETE
  9. u1
  10. FROM
  11. user u1
  12. LEFT JOIN
  13. user u2
  14. ON
  15. u1.access = u2.access
  16. WHERE
  17. u1.name = "current-user" AND
  18. ((u1.name != u2.name AND u1.access = "admin") OR (u1.access != "admin"));
  19.  
  20. if ($user_to_delete == $current_logged_in_user) {
  21. // Sorry, you can't delete yourself...
  22. }
  23.  
  24. // In the config file...
  25. $super_admins = array("you", "someone_else");
  26.  
  27. if (in_array($user_to_delete, $super_admins)) {
  28. // Sorry, you can't delete a super-admin from the UI.
  29. // Delete him from the application config first...
  30. }
  31.  
  32. define('SUPER_ADMIN', 'you');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement