Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Example:
- Table name: users
- columns: username, password
- default username and password I want to always remain in table 'users'
- username=dames and password=:password
- //End of Example
- DELETE
- u1
- FROM
- user u1
- LEFT JOIN
- user u2
- ON
- u1.access = u2.access
- WHERE
- u1.name = "current-user" AND
- ((u1.name != u2.name AND u1.access = "admin") OR (u1.access != "admin"));
- if ($user_to_delete == $current_logged_in_user) {
- // Sorry, you can't delete yourself...
- }
- // In the config file...
- $super_admins = array("you", "someone_else");
- if (in_array($user_to_delete, $super_admins)) {
- // Sorry, you can't delete a super-admin from the UI.
- // Delete him from the application config first...
- }
- define('SUPER_ADMIN', 'you');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement