WordPress.org

Plugin Directory

Changeset 606910


Ignore:
Timestamp:
10/02/12 09:34:51 (19 months ago)
Author:
picklewagon
Message:

correct spacing etc. of code to WP standards

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-user-approve/branches/1.4/new-user-approve.php

    r606893 r606910  
    2525 */ 
    2626 
    27 if (!class_exists('pw_new_user_approve')) { 
     27if ( ! class_exists( 'pw_new_user_approve' ) ) { 
    2828class pw_new_user_approve { 
    2929    /** 
     
    4848        // Load up the localization file if we're using WordPress in a different language 
    4949        // Just drop it in this plugin's "localization" folder and name it "new-user-approve-[value in wp-config].mo" 
    50         load_plugin_textdomain($this->plugin_id, false, dirname(plugin_basename(__FILE__)) . '/localization'); 
    51  
    52         register_activation_hook(__FILE__, array( $this, 'activation_check')); 
     50        load_plugin_textdomain( $this->plugin_id, false, dirname( plugin_basename( __FILE__ ) ) . '/localization' ); 
     51 
     52        register_activation_hook( __FILE__, array( $this, 'activation_check' ) ); 
    5353 
    5454        // Actions 
    55         add_action('admin_menu',          array( $this, 'admin_menu_link')); 
    56         add_action('admin_footer',        array( $this, 'admin_scripts_footer')); 
    57         add_action('init',                array( $this, 'init')); 
    58         add_action('init',                array( $this, 'process_input')); 
    59         add_action('register_post',       array( $this, 'send_approval_email'), 10, 3); 
    60         add_action('lostpassword_post',   array( $this, 'lost_password')); 
    61         add_action( 'user_register',      array( $this, 'add_user_status' ) ); 
     55        add_action( 'admin_menu', array( $this, 'admin_menu_link' ) ); 
     56        add_action( 'admin_footer', array( $this, 'admin_scripts_footer' ) ); 
     57        add_action( 'init', array( $this, 'init' ) ); 
     58        add_action( 'init', array( $this, 'process_input' ) ); 
     59        add_action( 'register_post', array( $this, 'send_approval_email' ), 10, 3 ); 
     60        add_action( 'lostpassword_post', array( $this, 'lost_password' ) ); 
     61        add_action( 'user_register', array( $this, 'add_user_status' ) ); 
    6262        add_action( 'new_user_approve_approve_user', array( $this, 'approve_user' ) ); 
    6363        add_action( 'new_user_approve_deny_user', array( $this, 'deny_user' ) ); 
     
    6565 
    6666        // Filters 
    67         add_filter('registration_errors', array( $this, 'show_user_pending_message'), 10, 1); 
    68         add_filter('login_message', array( $this, 'welcome_user')); 
    69         add_filter( 'wp_authenticate_user', array( $this, 'authenticate_user' ), 10, 2); 
     67        add_filter( 'registration_errors', array( $this, 'show_user_pending_message' ), 10, 1 ); 
     68        add_filter( 'login_message', array( $this, 'welcome_user' ) ); 
     69        add_filter( 'wp_authenticate_user', array( $this, 'authenticate_user' ), 10, 2 ); 
    7070    } 
    7171 
     
    7474 
    7575        $min_wp_version = '3.1'; 
    76         $exit_msg = sprintf( __('New User Approve requires WordPress %s or newer.', $this->plugin_id), $min_wp_version ); 
    77         if (version_compare($wp_version, $min_wp_version, '<=')) { 
    78             exit($exit_msg); 
     76        $exit_msg = sprintf( __( 'New User Approve requires WordPress %s or newer.', $this->plugin_id ), $min_wp_version ); 
     77        if ( version_compare( $wp_version, $min_wp_version, '<=' ) ) { 
     78            exit( $exit_msg ); 
    7979        } 
    8080    } 
     
    8383        global $wp_db_version; 
    8484 
    85         if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page) { 
    86             $page_id = ($wp_db_version >= 10851) ? '#pw_approve_tabs' : '#pw_approve_tabs > ul'; 
     85        if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page ) { 
     86            $page_id = ( $wp_db_version >= 10851 ) ? '#pw_approve_tabs' : '#pw_approve_tabs > ul'; 
    8787?> 
    8888<script type="text/javascript"> 
     
    9999    public function dashboard_stats() { 
    100100        // Query the users table 
    101         $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage']); 
     101        $wp_user_search = new WP_User_Search( $_GET['usersearch'], $_GET['userspage'] ); 
    102102        $user_status = array(); 
    103103 
    104104        // Make the user objects 
    105         foreach ($wp_user_search->get_results() as $userid) { 
    106             $user = new WP_User($userid); 
    107             $status = get_usermeta($userid, 'pw_user_status'); 
    108             if ($status == '') { // user was created in admin 
    109                 update_user_meta($userid, 'pw_user_status', 'approved'); 
    110                 $status = get_usermeta($userid, 'pw_user_status'); 
    111             } 
    112             if ($user_status[$status] == null) { 
     105        foreach ( $wp_user_search->get_results() as $userid ) { 
     106            $user = new WP_User( $userid ); 
     107            $status = get_usermeta( $userid, 'pw_user_status' ); 
     108            if ( $status == '' ) { // user was created in admin 
     109                update_user_meta( $userid, 'pw_user_status', 'approved' ); 
     110                $status = get_usermeta( $userid, 'pw_user_status' ); 
     111            } 
     112            if ( $user_status[$status] == null ) { 
    113113                $user_status[$status] = 0; 
    114114            } 
     
    117117?> 
    118118            <div> 
    119                 <p><span style="font-weight:bold;"><a href="users.php?page=<?php print $this->_admin_page ?>"><?php _e('Users', $this->plugin_id) ?></a></span>: 
    120                 <?php foreach($user_status as $status =>$count) print "$count $status&nbsp;&nbsp;"; ?> 
     119                <p><span style="font-weight:bold;"><a href="users.php?page=<?php print $this->_admin_page ?>"><?php _e( 'Users', $this->plugin_id ); ?></a></span>: 
     120                <?php foreach ( $user_status as $status => $count ) print "$count $status&nbsp;&nbsp;"; ?> 
    121121                </p> 
    122122            </div> 
     
    128128     */ 
    129129    public function approve_admin() { 
    130         if (isset($_GET['user']) && isset($_GET['status'])) { 
    131             echo '<div id="message" class="updated fade"><p>'.__('User successfully updated.', $this->plugin_id).'</p></div>'; 
     130        if ( isset( $_GET['user'] ) && isset( $_GET['status'] ) ) { 
     131            echo '<div id="message" class="updated fade"><p>'.__( 'User successfully updated.', $this->plugin_id ).'</p></div>'; 
    132132        } 
    133133?> 
    134134        <div class="wrap"> 
    135             <h2><?php _e('User Registration Approval', $this->plugin_id) ?></h2> 
    136  
    137             <h3><?php _e('User Management', $this->plugin_id) ?></h3> 
     135            <h2><?php _e( 'User Registration Approval', $this->plugin_id ); ?></h2> 
     136 
     137            <h3><?php _e( 'User Management', $this->plugin_id ); ?></h3> 
    138138            <div id="pw_approve_tabs"> 
    139139                <ul> 
    140                     <li><a href="#pw_pending_users"><span><?php _e('Users Pending Approval', $this->plugin_id) ?></span></a></li> 
    141                     <li><a href="#pw_approved_users"><span><?php _e('Approved Users', $this->plugin_id) ?></span></a></li> 
    142                     <li><a href="#pw_denied_users"><span><?php _e('Denied Users', $this->plugin_id) ?></span></a></li> 
     140                    <li><a href="#pw_pending_users"><span><?php _e( 'Users Pending Approval', $this->plugin_id ); ?></span></a></li> 
     141                    <li><a href="#pw_approved_users"><span><?php _e( 'Approved Users', $this->plugin_id ); ?></span></a></li> 
     142                    <li><a href="#pw_denied_users"><span><?php _e( 'Denied Users', $this->plugin_id ); ?></span></a></li> 
    143143                </ul> 
    144144                <div id="pw_pending_users"> 
     
    197197    <thead> 
    198198        <tr class="thead"> 
    199             <th><?php _e('Username', $this->plugin_id) ?></th> 
    200             <th><?php _e('Name', $this->plugin_id) ?></th> 
    201             <th><?php _e('E-mail', $this->plugin_id) ?></th> 
     199            <th><?php _e( 'Username', $this->plugin_id ); ?></th> 
     200            <th><?php _e( 'Name', $this->plugin_id ); ?></th> 
     201            <th><?php _e( 'E-mail', $this->plugin_id ); ?></th> 
    202202        <?php if ( 'pending' == $status ) { ?> 
    203             <th colspan="2" style="text-align: center"><?php _e('Actions', $this->plugin_id) ?></th> 
     203            <th colspan="2" style="text-align: center"><?php _e( 'Actions', $this->plugin_id ); ?></th> 
    204204        <?php } else { ?> 
    205             <th style="text-align: center"><?php _e('Actions', $this->plugin_id) ?></th> 
     205            <th style="text-align: center"><?php _e( 'Actions', $this->plugin_id ); ?></th> 
    206206        <?php } ?> 
    207207        </tr> 
     
    212212        $row = 1; 
    213213        foreach ( $users as $user ) { 
    214             $class = ($row % 2) ? '' : ' class="alternate"'; 
     214            $class = ( $row % 2 ) ? '' : ' class="alternate"'; 
    215215            $avatar = get_avatar( $user->user_email, 32 ); 
    216216            if ( $approve ) { 
    217                 $approve_link = get_option('siteurl').'/wp-admin/users.php?page='.$this->_admin_page.'&user='.$user->ID.'&status=approve'; 
    218                 $approve_link = wp_nonce_url($approve_link, 'pw_new_user_approve_action_' . get_class($this)); 
     217                $approve_link = get_option( 'siteurl' ) . '/wp-admin/users.php?page=' . $this->_admin_page . '&user=' . $user->ID . '&status=approve'; 
     218                $approve_link = wp_nonce_url( $approve_link, 'pw_new_user_approve_action_' . get_class( $this ) ); 
    219219            } 
    220220            if ( $deny ) { 
    221                 $deny_link = get_option('siteurl').'/wp-admin/users.php?page='.$this->_admin_page.'&user='.$user->ID.'&status=deny'; 
    222                 $deny_link = wp_nonce_url($deny_link, 'pw_new_user_approve_action_' . get_class($this)); 
     221                $deny_link = get_option( 'siteurl' ) . '/wp-admin/users.php?page=' . $this->_admin_page . '&user=' . $user->ID . '&status=deny'; 
     222                $deny_link = wp_nonce_url( $deny_link, 'pw_new_user_approve_action_' . get_class( $this ) ); 
    223223            } 
    224224            if ( current_user_can( 'edit_user', $user->ID ) ) { 
     
    234234 
    235235            ?><tr <?php echo $class; ?>> 
    236                 <td><?php echo $avatar." ".$edit; ?></td> 
    237                 <td><?php echo get_user_meta( $user->ID, 'first_name', true )." ".get_user_meta( $user->ID, 'last_name', true ); ?></td> 
     236                <td><?php echo $avatar . ' ' . $edit; ?></td> 
     237                <td><?php echo get_user_meta( $user->ID, 'first_name', true ) . ' ' . get_user_meta( $user->ID, 'last_name', true ); ?></td> 
    238238                <td><a href="mailto:<?php echo $user->user_email; ?>" title="<?php _e('email:', $this->plugin_id) ?> <?php echo $user->user_email; ?>"><?php echo $user->user_email; ?></a></td> 
    239239                <?php if ( $approve ) { ?> 
    240                 <td align="center"><a href="<?php echo $approve_link; ?>" title="<?php _e('Approve', $this->plugin_id) ?> <?php echo $user->user_login; ?>"><?php _e('Approve', $this->plugin_id) ?></a></td> 
     240                <td align="center"><a href="<?php echo $approve_link; ?>" title="<?php _e( 'Approve', $this->plugin_id ); ?> <?php echo $user->user_login; ?>"><?php _e( 'Approve', $this->plugin_id ); ?></a></td> 
    241241                <?php } ?> 
    242242                <?php if ( $deny ) { ?> 
    243                 <td align="center"><a href="<?php echo $deny_link; ?>" title="<?php _e('Deny', $this->plugin_id) ?> <?php echo $user->user_login; ?>"><?php _e('Deny', $this->plugin_id) ?></a></td> 
     243                <td align="center"><a href="<?php echo $deny_link; ?>" title="<?php _e( 'Deny', $this->plugin_id ); ?> <?php echo $user->user_login; ?>"><?php _e( 'Deny', $this->plugin_id ); ?></a></td> 
    244244                <?php } ?> 
    245245            </tr><?php 
     
    252252        } else { 
    253253            $status_i18n = $status; 
    254             if ($status == 'approved') { 
    255                 $status_i18n = __('approved', $this->plugin_id); 
    256             } else if ($status == 'denied') { 
    257                 $status_i18n = __('denied', $this->plugin_id); 
    258             } else if ($status == 'pending') { 
    259                 $status_i18n = __('pending', $this->plugin_id); 
    260             } 
    261  
    262             echo '<p>'.sprintf(__('There are no users with a status of %s', $this->plugin_id), $status_i18n).'</p>'; 
     254            if ( $status == 'approved' ) { 
     255                $status_i18n = __( 'approved', $this->plugin_id ); 
     256            } else if ( $status == 'denied' ) { 
     257                $status_i18n = __( 'denied', $this->plugin_id ); 
     258            } else if ( $status == 'pending' ) { 
     259                $status_i18n = __( 'pending', $this->plugin_id ); 
     260            } 
     261 
     262            echo '<p>'.sprintf( __( 'There are no users with a status of %s', $this->plugin_id ), $status_i18n ) . '</p>'; 
    263263        } 
    264264    } 
     
    267267     * @desc send an email to the admin to request approval 
    268268     */ 
    269     public function send_approval_email($user_login, $user_email, $errors) { 
    270         if (!$errors->get_error_code()) { 
     269    public function send_approval_email( $user_login, $user_email, $errors ) { 
     270        if ( ! $errors->get_error_code() ) { 
    271271            /* check if already exists */ 
    272272            $user_data = get_user_by( 'login', $user_login ); 
    273             if (!empty($user_data)){ 
    274                 $errors->add('registration_required' , __('User name already exists', $this->plugin_id), 'message'); 
     273            if ( ! empty( $user_data ) ){ 
     274                $errors->add( 'registration_required' , __( 'User name already exists', $this->plugin_id ), 'message' ); 
    275275            } else { 
    276276                /* send email to admin for approval */ 
    277                 $message  = sprintf(__('%1$s (%2$s) has requested a username at %3$s', $this->plugin_id), $user_login, $user_email, get_option('blogname')) . "\r\n\r\n"; 
    278                 $message .= get_option('siteurl') . "\r\n\r\n"; 
    279                 $message .= sprintf(__('To approve or deny this user access to %s go to', $this->plugin_id), get_option('blogname')) . "\r\n\r\n"; 
    280                 $message .= get_option('siteurl') . "/wp-admin/users.php?page=".$this->_admin_page."\r\n"; 
     277                $message  = sprintf( __( '%1$s (%2$s) has requested a username at %3$s', $this->plugin_id ), $user_login, $user_email, get_option( 'blogname' ) ) . "\r\n\r\n"; 
     278                $message .= get_option( 'siteurl' ) . "\r\n\r\n"; 
     279                $message .= sprintf( __( 'To approve or deny this user access to %s go to', $this->plugin_id ), get_option( 'blogname' ) ) . "\r\n\r\n"; 
     280                $message .= get_option( 'siteurl' ) . '/wp-admin/users.php?page=' . $this->_admin_page . "\r\n"; 
    281281                 
    282282                $message = apply_filters( 'new_user_approve_request_approval_message', $message, $user_login, $user_email ); 
    283283                 
    284                 $subject = sprintf( __('[%s] User Approval', $this->plugin_id ), get_option( 'blogname' ) ); 
     284                $subject = sprintf( __( '[%s] User Approval', $this->plugin_id ), get_option( 'blogname' ) ); 
    285285                $subject = apply_filters( 'new_user_approve_request_approval_subject', $subject ); 
    286286 
     
    290290                // create the user 
    291291                $user_pass = wp_generate_password(); 
    292                 $user_id = wp_create_user($user_login, $user_pass, $user_email); 
     292                $user_id = wp_create_user( $user_login, $user_pass, $user_email ); 
    293293            } 
    294294        } 
     
    316316                'ID' => $user->ID, 
    317317            ); 
    318             $wpdb->update($wpdb->users, $data, $where, array('%s', '%s'), array('%d')); 
    319         } 
    320  
    321         wp_cache_delete($user->ID, 'users'); 
    322         wp_cache_delete($user->user_login, 'userlogins'); 
     318            $wpdb->update($wpdb->users, $data, $where, array( '%s', '%s' ), array( '%d' ) ); 
     319        } 
     320 
     321        wp_cache_delete( $user->ID, 'users' ); 
     322        wp_cache_delete( $user->user_login, 'userlogins' ); 
    323323 
    324324        // send email to user telling of approval 
    325         $user_login = stripslashes($user->user_login); 
    326         $user_email = stripslashes($user->user_email); 
     325        $user_login = stripslashes( $user->user_login ); 
     326        $user_email = stripslashes( $user->user_email ); 
    327327 
    328328        // format the message 
    329         $message  = sprintf(__('You have been approved to access %s', $this->plugin_id), get_option('blogname')) . "\r\n"; 
    330         $message .= sprintf(__('Username: %s', $this->plugin_id), $user_login) . "\r\n"; 
     329        $message  = sprintf( __( 'You have been approved to access %s', $this->plugin_id ), get_option( 'blogname' ) ) . "\r\n"; 
     330        $message .= sprintf( __( 'Username: %s', $this->plugin_id ), $user_login ) . "\r\n"; 
    331331        if ( ! $bypass_password_reset ) { 
    332             $message .= sprintf(__('Password: %s', $this->plugin_id), $new_pass) . "\r\n"; 
    333         } 
    334         $message .= get_option('siteurl') . "/wp-login.php\r\n"; 
     332            $message .= sprintf( __( 'Password: %s', $this->plugin_id ), $new_pass ) . "\r\n"; 
     333        } 
     334        $message .= get_option( 'siteurl' ) . "/wp-login.php\r\n"; 
    335335 
    336336        $message = apply_filters( 'new_user_approve_approve_user_message', $message, $user ); 
    337337         
    338         $subject = sprintf( __('[%s] Registration Approved', $this->plugin_id ), get_option( 'blogname' ) ); 
     338        $subject = sprintf( __( '[%s] Registration Approved', $this->plugin_id ), get_option( 'blogname' ) ); 
    339339        $subject = apply_filters( 'new_user_approve_approve_user_subject', $subject ); 
    340340         
     
    356356 
    357357        // send email to user telling of denial 
    358         $user_email = stripslashes($user->user_email); 
     358        $user_email = stripslashes( $user->user_email ); 
    359359 
    360360        // format the message 
    361         $message = sprintf(__('You have been denied access to %s', $this->plugin_id), get_option('blogname')); 
     361        $message = sprintf( __( 'You have been denied access to %s', $this->plugin_id ), get_option( 'blogname' ) ); 
    362362        $message = apply_filters( 'new_user_approve_deny_user_message', $message, $user ); 
    363363         
    364         $subject = sprintf( __('[%s] Registration Denied', $this->plugin_id ), get_option( 'blogname' ) ); 
     364        $subject = sprintf( __( '[%s] Registration Denied', $this->plugin_id ), get_option( 'blogname' ) ); 
    365365        $subject = apply_filters( 'new_user_approve_deny_user_subject', $subject ); 
    366366 
     
    369369 
    370370        // change usermeta tag in database to denied 
    371         update_user_meta($user->ID, 'pw_user_status', 'denied'); 
     371        update_user_meta( $user->ID, 'pw_user_status', 'denied' ); 
    372372         
    373373        do_action( 'new_user_approve_user_denied', $user ); 
     
    378378     */ 
    379379    public function show_user_pending_message($errors) { 
    380         if ( !empty( $_POST['redirect_to'] ) ) { 
     380        if ( ! empty( $_POST['redirect_to'] ) ) { 
    381381            // if a redirect_to is set, honor it 
    382382            wp_safe_redirect( $_POST['redirect_to'] ); 
     
    388388            return $errors; 
    389389         
    390         $message  = sprintf(__('An email has been sent to the site administrator. The administrator will review the information that has been submitted and either approve or deny your request.', $this->plugin_id)); 
    391         $message .= sprintf(__('You will receive an email with instructions on what you will need to do next. Thanks for your patience.', $this->plugin_id)); 
     390        $message  = sprintf( __( 'An email has been sent to the site administrator. The administrator will review the information that has been submitted and either approve or deny your request.', $this->plugin_id ) ); 
     391        $message .= sprintf( __( 'You will receive an email with instructions on what you will need to do next. Thanks for your patience.', $this->plugin_id ) ); 
    392392        $message = apply_filters( 'new_user_approve_pending_message', $message ); 
    393393 
     
    398398         
    399399        if ( function_exists( 'login_header' ) ) { 
    400             login_header( __('Pending Approval', $this->plugin_id ), '<p class="message register">' . $success_message . '</p>', $errors ); 
     400            login_header( __( 'Pending Approval', $this->plugin_id ), '<p class="message register">' . $success_message . '</p>', $errors ); 
    401401            login_footer(); 
    402402             
     
    410410     */ 
    411411    public function process_input() { 
    412         if ((isset($_GET['page']) && $_GET['page'] == $this->_admin_page) && isset($_GET['status'])) { 
    413             $valid_request = check_admin_referer('pw_new_user_approve_action_' . get_class($this)); 
    414  
    415             if ($valid_request) { 
    416                 if ($_GET['status'] == 'approve') { 
     412        if ( ( isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page ) && isset( $_GET['status'] ) ) { 
     413            $valid_request = check_admin_referer( 'pw_new_user_approve_action_' . get_class( $this ) ); 
     414 
     415            if ( $valid_request ) { 
     416                if ( $_GET['status'] == 'approve' ) { 
    417417                    do_action( 'new_user_approve_approve_user' ); 
    418418                } 
    419419 
    420                 if ($_GET['status'] == 'deny') { 
     420                if ( $_GET['status'] == 'deny' ) { 
    421421                    do_action( 'new_user_approve_deny_user' ); 
    422422                } 
     
    429429     */ 
    430430    public function lost_password() { 
    431         $is_email = strpos($_POST['user_login'], '@'); 
    432         if ($is_email === false) { 
     431        $is_email = strpos( $_POST['user_login'], '@' ); 
     432        if ( $is_email === false ) { 
    433433            $username = sanitize_user( $_POST['user_login'] ); 
    434434            $user_data = get_user_by( 'login', trim( $username ) ); 
     
    438438        } 
    439439 
    440         if ($user_data->pw_user_status != 'approved') { 
    441             wp_redirect('wp-login.php'); 
     440        if ( $user_data->pw_user_status != 'approved' ) { 
     441            wp_redirect( 'wp-login.php' ); 
    442442            exit(); 
    443443        } 
     
    447447 
    448448    public function welcome_user($message) { 
    449         if (!isset($_GET['action'])) { 
    450             $welcome = sprintf(__('Welcome to %s. This site is accessible to approved users only. To be approved, you must first register.', $this->plugin_id), get_option('blogname')); 
     449        if ( ! isset( $_GET['action'] ) ) { 
     450            $welcome = sprintf( __( 'Welcome to %s. This site is accessible to approved users only. To be approved, you must first register.', $this->plugin_id ), get_option( 'blogname' ) ); 
    451451            $welcome = apply_filters( 'new_user_approve_welcome_message', $welcome ); 
    452452             
     
    454454        } 
    455455 
    456         if ( isset( $_GET['action'] ) && $_GET['action'] == 'register' && !$_POST ) { 
    457             $instructions = sprintf(__('After you register, your request will be sent to the site administrator for approval. You will then receive an email with further instructions.', $this->plugin_id)); 
     456        if ( isset( $_GET['action'] ) && $_GET['action'] == 'register' && ! $_POST ) { 
     457            $instructions = sprintf( __( 'After you register, your request will be sent to the site administrator for approval. You will then receive an email with further instructions.', $this->plugin_id ) ); 
    458458            $instructions = apply_filters( 'new_user_approve_register_instructions', $instructions ); 
    459459             
     
    465465 
    466466    public function init() { 
    467         if ( is_admin() && isset($_GET['page']) && $_GET['page'] == $this->_admin_page ) { 
     467        if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page ) { 
    468468            wp_enqueue_script('jquery-ui-tabs'); 
    469469            wp_enqueue_style('pw-admin-ui-tabs', plugins_url( 'ui.tabs.css', __FILE__ ) ); 
     
    473473    function admin_menu_link() { 
    474474        $cap = apply_filters( 'new_user_approve_minimum_cap', 'edit_users' ); 
    475         $this->user_page_hook = add_users_page( __('Approve New Users', $this->plugin_id), __('Approve New Users', $this->plugin_id), $cap, $this->_admin_page, array( $this, 'approve_admin' ) ); 
     475        $this->user_page_hook = add_users_page( __( 'Approve New Users', $this->plugin_id ), __( 'Approve New Users', $this->plugin_id ), $cap, $this->_admin_page, array( $this, 'approve_admin' ) ); 
    476476    } 
    477477 
     
    508508    public function add_user_status( $user_id ) { 
    509509        $status = 'pending'; 
    510         if ( isset($_REQUEST['action']) && 'createuser' == $_REQUEST['action'] ) { 
     510        if ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) { 
    511511            $status = 'approved'; 
    512512        } 
     
    518518 
    519519// instantiate the class 
    520 if (class_exists('pw_new_user_approve')) { 
     520if ( class_exists( 'pw_new_user_approve' ) ) { 
    521521    $pw_new_user_approve = new pw_new_user_approve(); 
    522522} 
Note: See TracChangeset for help on using the changeset viewer.