function amu_csvimport() { //test again for admin priviledges if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } //test if disabled by superadmin if (is_multisite()) { if (get_site_option('amu_subadminaccess')) { if (get_site_option('amu_subadminaccess') == 'no') { if (!current_user_can('manage_network')) { wp_die(__('Access to AMU functions have been disabled by the Network Administrator.')); } } } } //when accessing amu, set options if they don't exist amu_set_defaultoptions(); //begin wrap class echo '<div class="wrap">'; echo '<div id="amu">'; echo '<h2>' . __('Add Multiple Users - Import CSV Data', 'amulang') . '</h2>'; //STEP ONE - PASTE DATA OR CHOOSE FILE if (empty($_POST) || isset($_POST['cancel'])) { $csvinputerror = ''; amuCSVInputMain($csvinputerror); //STEP TWO - READ AND CLEAN DATA } else { if (isset($_POST['readandclean'])) { amuCSVShowData(); //OPTION - PRINT TO FORM } else { if (isset($_POST['sendcsvtoform'])) { amuCSVToForm(); //OPTION - DIRECT REGISTER } else { if (isset($_POST['sendcsvtoreg'])) { amuCSVToRegister(); // REGISTER FROM FORM } else { if (isset($_POST['addnewusers'])) { echo '<div id="message" class="updated">'; echo '<p><strong>' . __('New User Accounts Processed.', 'amulang') . '</strong></p>'; echo '</div>'; amuRegisterFromForm(); //OTHERWISE, UNKNOWN REQUEST HANDLER } else { echo '<p>' . __('Unknown request. Please choose the CSV Import option from the menu.', 'amulang') . '</p>'; } } } } } //end wrap divs and function echo '</div>'; echo '</div>'; }
function amu_manual() { //test again for admin priviledges if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } //test if disabled by superadmin if (is_multisite()) { if (get_site_option('amu_subadminaccess')) { if (get_site_option('amu_subadminaccess') == 'no') { if (!current_user_can('manage_network')) { wp_die(__('Access to AMU functions have been disabled by the Network Administrator.')); } } } } //when accessing amu, set options if they don't exist amu_set_defaultoptions(); //begin wrap class echo '<div class="wrap">'; echo '<div id="amu">'; echo '<h2>' . __('Add Multiple Users - Manual Entry Form', 'amulang') . '</h2>'; //STEP ONE - SET LINES if (empty($_POST) || isset($_POST['createnewform'])) { $manualInputError = ''; amuGenerateManualForm($manualInputError); //STEP TWO - CREATE FORM } else { if (isset($_POST['formshow_manual'])) { amuCreateManualForm(); //STEP THREE - REGISTER USERS } else { if (isset($_POST['addnewusers'])) { echo '<div id="message" class="updated">'; echo '<p><strong>' . __('New User Accounts Processed.', 'amulang') . '</strong></p>'; echo '</div>'; amuRegisterFromForm(); //OTHERWISE, UNKNOWN REQUEST HANDLER } else { echo '<p>' . __('Unknown request. Please choose the Manual Entry option from the menu.', 'amulang') . '</p>'; } } } //end wrap divs and function echo '</div>'; echo '</div>'; }
function amu_emaillist() { //test again for admin priviledges if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } //test if disabled by superadmin if (is_multisite()) { if (get_site_option('amu_subadminaccess')) { if (get_site_option('amu_subadminaccess') == 'no') { if (!current_user_can('manage_network')) { wp_die(__('Access to AMU functions have been disabled by the Network Administrator.')); } } } } //when accessing amu, set options if they don't exist amu_set_defaultoptions(); ?> <div class="wrap"> <div id="amu"> <h2><?php _e('Add Multiple Users - Import Email List', 'amulang'); ?> </h2> <?php //STEP ONE - SHOW EMAIL INPUT FIELDS if (empty($_POST)) { $emailListError = ''; addByEmailList($emailListError); $infotype = 'emaillisting'; showPluginInfo($infotype); //OPTION - CREATE FORM FROM EMAIL LIST } else { if (isset($_POST['formshow_email'])) { amuProcessEmailInput('form'); //OPTION - REGISTER DIRECT FROM EMAIL LIST } else { if (isset($_POST['skiprun_csvprocess'])) { echo '<div id="message" class="updated">'; echo '<p><strong>' . __('New User Accounts Processed.', 'amulang') . '</strong></p>'; echo '</div>'; amuProcessEmailInput('direct'); // REGISTER FROM FORM } else { if (isset($_POST['addnewusers'])) { echo '<div id="message" class="updated">'; echo '<p><strong>' . __('New User Accounts Processed.', 'amulang') . '</strong></p>'; echo '</div>'; amuRegisterFromForm(); //OTHERWISE, UNKNOWN REQUEST HANDLER } else { echo '<p>' . __('Unknown request. Please choose the Import Email List option from the menu.', 'amulang') . '</p>'; } } } } ?> </div> </div> <?php }