um_action_request_process

The Ultimate Member um action request process function.

Description

um_action_request_process(); 

Usage

  1. if ( !function_exists( 'um_action_request_process' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ultimate-member/core/um-actions-core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = um_action_request_process(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/core/um-actions-core.php  
  1. function um_action_request_process() { 
  2. global $ultimatemember; 
  3.  
  4. if ( is_admin() ) return false; 
  5. if ( ! is_user_logged_in() ) return false; 
  6. if ( ! isset( $_REQUEST['um_action'] ) ) return false; 
  7. if ( isset( $_REQUEST['uid'] ) && !$ultimatemember->user->user_exists_by_id( $_REQUEST['uid'] ) ) return false; 
  8.  
  9. if ( isset( $_REQUEST['uid'] ) ) { 
  10. if ( is_super_admin( $_REQUEST['uid'] ) ) 
  11. wp_die('Super administrators can not be modified.'); 
  12.  
  13. if ( isset( $_REQUEST['um_action'] ) && $_REQUEST['um_action'] != "edit" && ! current_user_can( 'edit_users' ) ) { 
  14. wp_die( __( 'You do not have enough permissions to do that.', 'ultimatemember') ); 
  15.  
  16. if ( isset($_REQUEST['uid'])) { 
  17. $uid = $_REQUEST['uid']; 
  18.  
  19. switch( $_REQUEST['um_action'] ) { 
  20.  
  21. default: 
  22. $uid = ( isset( $_REQUEST['uid'] ) ) ? $_REQUEST['uid'] : 0; 
  23. do_action('um_action_user_request_hook', $_REQUEST['um_action'], $uid); 
  24. break; 
  25.  
  26. case 'edit': 
  27. $ultimatemember->fields->editing = true; 
  28. if ( !um_can_edit_my_profile() ) { 
  29. exit( wp_redirect( $url ) );  
  30. break; 
  31.  
  32. case 'um_switch_user': 
  33. if ( !current_user_can('delete_users') ) return; 
  34. $ultimatemember->user->auto_login( $_REQUEST['uid'] ); 
  35. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  36. break; 
  37.  
  38. case 'um_reject_membership': 
  39. um_fetch_user( $uid ); 
  40. $ultimatemember->user->reject(); 
  41. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  42. break; 
  43.  
  44. case 'um_approve_membership': 
  45. case 'um_reenable': 
  46. um_fetch_user( $uid ); 
  47. $ultimatemember->user->approve(); 
  48. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  49. break; 
  50.  
  51. case 'um_put_as_pending': 
  52. um_fetch_user( $uid ); 
  53. $ultimatemember->user->pending(); 
  54. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  55. break; 
  56.  
  57. case 'um_resend_activation': 
  58. um_fetch_user( $uid ); 
  59. $ultimatemember->user->email_pending(); 
  60. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  61. break; 
  62.  
  63. case 'um_deactivate': 
  64. um_fetch_user( $uid ); 
  65. $ultimatemember->user->deactivate(); 
  66. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  67. break; 
  68.  
  69. case 'um_delete': 
  70. if ( !um_current_user_can( 'delete', $uid ) ) wp_die( __('You do not have permission to delete this user.', 'ultimatemember') ); 
  71. um_fetch_user( $uid ); 
  72. $ultimatemember->user->delete(); 
  73. exit( wp_redirect( $ultimatemember->permalinks->get_current_url( true ) ) ); 
  74. break; 
  75.