├── lang ├── add_users.mo └── add_users.po ├── uninstall.php ├── .gitmodules ├── sql.txt ├── changelog.txt ├── README.md └── add-existing-users.php /lang/add_users.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/add-existing-users/master/lang/add_users.mo -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" 13 | "X-Poedit-Basepath: .\n" 14 | "X-Poedit-SearchPath-0: ..\n" 15 | 16 | #: ../add-existing-users.php:135 17 | #: ../add-existing-users.php:201 18 | msgid "Add Existing Users" 19 | msgstr "" 20 | 21 | #: ../add-existing-users.php:176 22 | msgid "Users have been added." 23 | msgstr "" 24 | 25 | #: ../add-existing-users.php:202 26 | msgid "This tool allows you to create existing users on this site to your blog." 27 | msgstr "" 28 | 29 | #: ../add-existing-users.php:206 30 | #, php-format 31 | msgid "To add new users that have not already been created, please use the Add New Users functionality here." 32 | msgstr "" 33 | 34 | #: ../add-existing-users.php:210 35 | #, php-format 36 | msgid "To add users simply enter each user's email and select a role for them on this blog - you can find out more about different levels of access for different roles here." 37 | msgstr "" 38 | 39 | #: ../add-existing-users.php:220 40 | msgid "User Email" 41 | msgstr "" 42 | 43 | #: ../add-existing-users.php:223 44 | msgid "Required" 45 | msgstr "" 46 | 47 | #: ../add-existing-users.php:231 48 | msgid "User Role" 49 | msgstr "" 50 | 51 | #: ../add-existing-users.php:241 52 | msgid "Submit" 53 | msgstr "" 54 | 55 | #: ../add-existing-users.php:243 56 | msgid "This may take some time so please be patient." 57 | msgstr "" 58 | 59 | #: ../add-existing-users.php:289 60 | #, php-format 61 | msgid "The user with email address %s could not be found" 62 | msgstr "" 63 | 64 | #: ../add-existing-users.php:305 65 | #, php-format 66 | msgid "Email %s is not a valid one" 67 | msgstr "" 68 | 69 | #: ../add-existing-users.php:315 70 | msgid "No data to process" 71 | msgstr "" 72 | 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Add Existing Users 2 | 3 | 4 | **INACTIVE NOTICE: This plugin is unsupported by WPMUDEV, we've published it here for those technical types who might want to fork and maintain it for their needs.** 5 | 6 | ## Translations 7 | 8 | Translation files can be found at https://github.com/wpmudev/translations 9 | 10 | ## About 11 | 12 | Add existing users lets you quickly bulk add existing users to any site on your network. 13 | 14 | Adding existing users to a site is now as simple as entering the email address attached to their existing username and selecting the level of access you want to grant them. Use nice simple forms, so it can be easily used by anyone. 15 | 16 |  17 | 18 | Simple forms easy for everyone 19 | 20 | Perfect for importing multiple existing users into new and existing sites. 21 | 22 | ## Usage 23 | 24 | Start by reading [Installing plugins](../wpmu-manual/installing-regular-plugins-on-wpmu/) section in our comprehensive [WordPress and WordPress Multisite Manual](https://premium.wpmudev.org/manuals/wpmu-manual-2/) if you are new to WordPress. 25 | 26 | ### To install: 27 | 28 | 1. Download the plugin file 29 | 30 | 2. Unzip the file into a folder on your hard drive 31 | 32 | 3. Upload **/add-existing-users/** folder to **/wp-content/plugins/** folder on your site 33 | 34 | 4. Login to your admin panel for WordPress Multisite 35 | 36 | 5. Visit **Network Admin -> Plugins** and **Network Activate** the plugin. **That's it! No configuration necessary!** 37 | 38 | ### To use: 39 | 40 | A new menu item called **Add Existing Users** should appear under the **Users** navigation menu in the site admin dashboard. It is designed for quickly adding existing users to a site in batches of up to 15 users. Use [Add New Users plugin](https://premium.wpmudev.org/project/add-new-users) if you want to create and add new users in batches of up to 15 users _Please note:_ 41 | 42 | * The users are immediately added to the site and automatically listed as users on the**Users** page. 43 | * They can only access features in the site’s administration panel based on the role they've been assigned 44 | * Spam filters, especially strict ones for institutional email addresses, often block the emails that the login details. If unsure use free webmail accounts such as gmail, hotmail that don’t block these invitation emails. 45 | 46 | **To add the existing users, administrators simply enter:** 47 | 48 | 1. The email address attached to their existing username 49 | 2. Assign their role - you can find out more about different [levels of access here](https://premium.wpmudev.org/wpmu-manual/introduction-to-super-admin-user/). 50 | 3. Once added they'll be sent an email with their login details -- their password will be blank since they just need to use their existing password 51 | 52 |  53 | 54 | 55 | -------------------------------------------------------------------------------- /add-existing-users.php: -------------------------------------------------------------------------------- 1 | pro_site_only = false; 67 | else 68 | $this->pro_site_only = ADD_EXISTING_USERS_PRO_SITES_ONLY; 69 | 70 | // get number of field sets 71 | $this->fields = isset( $_GET['fields'] ) ? $_GET['fields'] : ''; 72 | 73 | // default to 15 field sets 74 | if ( $this->fields == '' ) 75 | $this->fields = 10; 76 | 77 | // no more than 50 fields sets 78 | if ( $this->fields > 50 ) 79 | $this->fields = 50; 80 | 81 | global $wpmudev_notices; 82 | $wpmudev_notices[] = array( 'id'=> 175,'name'=> 'Add Existing Users', 'screens' => array( 'users_page_add-existing-users' ) ); 83 | include_once( plugin_dir_path( __FILE__ ) . 'externals/wpmudev-dash-notification.php' ); 84 | 85 | // add admin menu page 86 | add_action( 'admin_menu', array( &$this, 'plug_pages' ) ); 87 | 88 | // Load text domain 89 | add_action( 'plugins_loaded', array( &$this, 'load_text_domain' ) ); 90 | 91 | // Need upgrade? 92 | add_action( 'init', array( &$this, 'maybe_upgrade' ) ); 93 | 94 | register_activation_hook( __FILE__, array( &$this, 'activate' ) ); 95 | 96 | } 97 | 98 | /** 99 | * Load the plugin text domain and MO files 100 | * 101 | * These can be uploaded to the main WP Languages folder 102 | * or the plugin one 103 | */ 104 | public function load_text_domain() { 105 | $locale = apply_filters( 'plugin_locale', get_locale(), $this->lang_domain ); 106 | 107 | load_textdomain( $this->lang_domain, WP_LANG_DIR . '/' . $this->lang_domain . '/' . $this->lang_domain . '-' . $locale . '.mo' ); 108 | load_plugin_textdomain( $this->lang_domain, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); 109 | } 110 | 111 | public function activate() { 112 | update_site_option( $this->version_option_slug, $this->current_version ); 113 | } 114 | 115 | /** 116 | * Manage the plugin upgrades 117 | */ 118 | public function maybe_upgrade() { 119 | $current_version = get_site_option( $this->version_option_slug, '1.0' ); 120 | 121 | if ( version_compare( $current_version, '1.1.1', '<=' ) ) { 122 | global $wpdb; 123 | $table = $wpdb->base_prefix . 'add_users_queue'; 124 | $wpdb->query( "DROP TABLE $table" ); 125 | update_site_option( $this->version_option_slug, $this->current_version ); 126 | } 127 | } 128 | 129 | 130 | /** 131 | * Add admin menu 132 | * 133 | **/ 134 | function plug_pages() { 135 | $this->page_id = add_submenu_page( 'users.php', __( 'Add Existing Users', $this->lang_domain ), __( 'Add Existing Users', $this->lang_domain ), 'manage_options', $this->menu_slug, array( &$this, 'page_output' ) ); 136 | add_action( 'load-' . $this->page_id, array( &$this, 'sanitize_form' ) ); 137 | } 138 | 139 | /** 140 | * Check if current blog is a Pro Site blog 141 | * 142 | **/ 143 | function is_pro_site() { 144 | if ( function_exists( 'is_pro_site' ) ) 145 | return is_pro_site(); 146 | 147 | return false; 148 | } 149 | 150 | /** 151 | * Display plugin admin page 152 | * 153 | **/ 154 | function page_output() { 155 | global $wpdb, $wp_roles; 156 | 157 | // display error message if Pro Site only 158 | if ( ! $this->is_pro_site() && $this->pro_site_only ) { 159 | global $psts; 160 | if ( is_object( $psts ) ) 161 | $psts->feature_notice(); 162 | return; 163 | } 164 | 165 | $fields = ! empty( $_GET['fields'] ) ? $_GET['fields'] : ''; 166 | $form_url = add_query_arg( 167 | array( 168 | 'fields' => $fields, 169 | 'action' => 'process' 170 | ) 171 | ); 172 | 173 | // display message when successful 174 | if ( isset( $_GET['updated'] ) ) { 175 | ?> 176 |
lang_domain ); ?>
form_errors['no_data']->get_error_message(); ?>
lang_domain ); ?>
203 | 204 | 205 | 206 |Add New Users functionality here.', $this->lang_domain ), $add_new_users_url ); ?>
207 | 208 | 209 | 210 |here.', $this->lang_domain ), $help_url ); ?>
211 | 212 | 245 |