Exemplo n.º 1
0
 function upme_users_page_loaded()
 {
     if (isset($_GET['action']) && $_GET['action'] === 'upme_act_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_act_user') {
         $act_users = isset($_GET['users']) ? $_GET['users'] : '';
         if ('' != $act_users) {
             foreach ($act_users as $act_user) {
                 $meta = get_user_meta($act_user, 'upme_approval_status', true);
                 if ('ACTIVE' != $meta) {
                     update_user_meta($act_user, 'upme_activation_status', 'ACTIVE');
                     upme_update_user_cache($act_user);
                 }
             }
         }
     } else {
         if (isset($_GET['action']) && $_GET['action'] === 'upme_apr_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_apr_user') {
             $apr_users = isset($_GET['users']) ? $_GET['users'] : '';
             if ('' != $apr_users) {
                 $current_option = get_option('upme_options');
                 $link = get_permalink($current_option['login_page_id']);
                 foreach ($apr_users as $apr_user) {
                     $meta = get_user_meta($apr_user, 'upme_approval_status', true);
                     if ('ACTIVE' != $meta) {
                         update_user_meta($apr_user, 'upme_approval_status', 'ACTIVE');
                         upme_update_user_cache($apr_user);
                         upme_admin_approval_notification($apr_user, $link);
                     }
                 }
             }
         } else {
             if (isset($_GET['action']) && $_GET['action'] === 'upme_deact_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deact_user') {
                 $act_users = isset($_GET['users']) ? $_GET['users'] : '';
                 if ('' != $act_users) {
                     foreach ($act_users as $act_user) {
                         update_user_meta($act_user, 'upme_activation_status', 'INACTIVE');
                         upme_update_user_cache($act_user);
                     }
                 }
             } else {
                 if (isset($_GET['action']) && $_GET['action'] === 'upme_deapr_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deapr_user') {
                     $apr_users = isset($_GET['users']) ? $_GET['users'] : '';
                     if ('' != $apr_users) {
                         foreach ($apr_users as $apr_user) {
                             update_user_meta($apr_user, 'upme_approval_status', 'INACTIVE');
                             upme_update_user_cache($apr_user);
                         }
                     }
                 } else {
                     if (isset($_GET['action']) && $_GET['action'] === 'upme_activate_profile_status_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_activate_profile_status_user') {
                         $users = isset($_GET['users']) ? $_GET['users'] : '';
                         if ('' != $users) {
                             foreach ($users as $user) {
                                 update_user_meta($user, 'upme_user_profile_status', 'ACTIVE');
                                 upme_update_user_cache($user);
                             }
                         }
                     } else {
                         if (isset($_GET['action']) && $_GET['action'] === 'upme_deactivate_profile_status_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deactivate_profile_status_user') {
                             $users = isset($_GET['users']) ? $_GET['users'] : '';
                             if ('' != $users) {
                                 foreach ($users as $user) {
                                     update_user_meta($user, 'upme_user_profile_status', 'INACTIVE');
                                     upme_update_user_cache($user);
                                 }
                             }
                         } else {
                             if (isset($_GET['action']) && $_GET['action'] === 'upme_activate_profile_permission' || isset($_GET['action2']) && $_GET['action2'] === 'upme_activate_profile_permission') {
                                 $users = isset($_GET['users']) ? $_GET['users'] : '';
                                 if ('' != $users) {
                                     foreach ($users as $user) {
                                         $user = new WP_User($user);
                                         $user->add_cap('manage_upme_options');
                                     }
                                 }
                             } else {
                                 if (isset($_GET['action']) && $_GET['action'] === 'upme_deactivate_profile_permission' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deactivate_profile_permission') {
                                     $users = isset($_GET['users']) ? $_GET['users'] : '';
                                     if ('' != $users) {
                                         foreach ($users as $user) {
                                             $user = new WP_User($user);
                                             $user->remove_cap('manage_upme_options');
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 function upme_users_page_loaded()
 {
     if (isset($_GET['action']) && $_GET['action'] === 'upme_act_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_act_user') {
         $act_users = isset($_GET['users']) ? $_GET['users'] : '';
         if ('' != $act_users) {
             foreach ($act_users as $act_user) {
                 update_user_meta($act_user, 'upme_activation_status', 'ACTIVE');
                 upme_update_user_cache($act_user);
             }
         }
     } else {
         if (isset($_GET['action']) && $_GET['action'] === 'upme_apr_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_apr_user') {
             $apr_users = isset($_GET['users']) ? $_GET['users'] : '';
             if ('' != $apr_users) {
                 $current_option = get_option('upme_options');
                 $link = get_permalink($current_option['login_page_id']);
                 foreach ($apr_users as $apr_user) {
                     update_user_meta($apr_user, 'upme_approval_status', 'ACTIVE');
                     upme_update_user_cache($apr_user);
                     upme_admin_approval_notification($apr_user, $link);
                 }
             }
         } else {
             if (isset($_GET['action']) && $_GET['action'] === 'upme_deact_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deact_user') {
                 $act_users = isset($_GET['users']) ? $_GET['users'] : '';
                 if ('' != $act_users) {
                     foreach ($act_users as $act_user) {
                         update_user_meta($act_user, 'upme_activation_status', 'INACTIVE');
                         upme_update_user_cache($act_user);
                     }
                 }
             } else {
                 if (isset($_GET['action']) && $_GET['action'] === 'upme_deapr_user' || isset($_GET['action2']) && $_GET['action2'] === 'upme_deapr_user') {
                     $apr_users = isset($_GET['users']) ? $_GET['users'] : '';
                     if ('' != $apr_users) {
                         foreach ($apr_users as $apr_user) {
                             update_user_meta($apr_user, 'upme_approval_status', 'INACTIVE');
                             upme_update_user_cache($apr_user);
                         }
                     }
                 }
             }
         }
     }
 }