Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function bp_rc_list_not_activated_users() {
- global $wpdb;
- if( is_multisite() ) {
- return $wpdb->get_results("SELECT user_email, activation_key FROM {$wpdb->signups} WHERE active = 0", OBJECT);
- } else {
- return $wpdb->get_results("SELECT user_email, meta_value as activation_key FROM {$wpdb->usermeta} m LEFT JOIN {$wpdb->users} u ON(m.user_id = u.ID) WHERE meta_key = 'activation_key'", OBJECT);
- }
- }
- function bp_rc_admin_page(){
- if(!is_super_admin())
- return false;
- $userslist = bp_rc_list_not_activated_users();
- ?>
- <div class="wrap">
- <h2>List of users to activate</h2>
- <table class="widefat">
- <thead>
- <th>User email</th><th>activation key</th>
- </thead>
- <tbody>
- <?php if( count($userslist) > 0):?>
- <?php foreach($userslist as $user):?>
- <td><?php echo $user->user_email;?></td><td><a href="<?php echo bp_get_activation_page() . '?key='.$user->activation_key ?>" title="Activate this user !"><?php echo $user->activation_key;?></a></td>
- <?php endforeach;?>
- <?php else:?>
- <td colspan="2">No user to activate</td>
- <?php endif;?>
- </tbody>
- </table>
- </div>
- <?php
- }
- function bp_rc_administration_menu(){
- global $bp;
- if ( !is_super_admin() )
- return false;
- $code_snippets_manager_admin_page = add_submenu_page( 'bp-general-settings', __( 'BP Register Control'), __( 'BP Register Control'), 'manage_options', 'bp-rc-control', 'bp_rc_admin_page' );
- }
- add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_rc_administration_menu', 18);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement