Guest User

Untitled

a guest
Jul 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Implementation of hook_perm().
  5. */
  6. function shared_account_perm() {
  7. return array('edit own user account');
  8. }
  9.  
  10. /**
  11. * Implementation of hook_menu_alter().
  12. */
  13. function shared_account_menu_alter(&$callbacks) {
  14. $callbacks['user/%user_category/edit']['access callback'] = 'shared_account_edit_access';
  15. }
  16.  
  17. /**
  18. * Access callback for user account editing.
  19. */
  20. function shared_account_edit_access($account) {
  21. return ((($GLOBALS['user']->uid == $account->uid) && user_access('edit own user account', $account)) || user_access('administer users')) && $account->uid > 0;
  22. }
Add Comment
Please, Sign In to add comment