user_email; $thisBlogName = get_bloginfo('name'); $thisBlogUrl = site_url(); $thisLoginUrl = get_option('amu_siteloginurl'); //begin wrap class echo '
'; echo '
'; //if saving options... if ( isset($_POST['setgenopt'] ) ) { setGeneralOptions(); echo '
'; echo '

'.__('Settings have been saved.','amulang').'

'; echo '
'; } //if resetting settings if ( isset($_POST['resetsettings'] ) ) { amu_reset_default_options(); echo '
'; echo '

'.__('Settings have been reset to default.','amulang').'

'; echo '
'; } addGeneralOptions(); $infotype = 'settings'; showPluginInfo($infotype); echo '
'; echo '
'; } /* * SHOW SETTINGS INTERFACE * Show options for modifying settings */ function addGeneralOptions() { global $current_user, $wpdb, $wp_roles; get_currentuserinfo(); echo '
'; echo '

'.__('Add Multiple Users - Plugin Settings','amulang').'

'; echo '

'.__('Update settings that affect various plugin functions. Please check the information section at the bottom of this page for more about each setting.','amulang').'

'; echo '
'; echo '
'; echo '

'.__('Validation and Notifications','amulang').'

'; echo '
'; //send emails... echo '
'; echo ' '; echo ' '; echo '
'; //send confirmation email echo '
'; echo ' '; echo ' '; echo '
'; //validate emails... echo '
'; echo ' '; echo ' '; echo '
'; //username strict validation option... echo '
'; echo ' '; echo ' '; echo '
'; ////auto-create user names - for version 2.1 // echo '
'; // echo ' '; // echo ' '; // echo '
'; //force fill emails... echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; //set default user role option echo '

'.__('New User Defaults and Overrides','amulang').'

'; echo '
'; echo '
'; //set all users to this role if (get_option('amu_setallroles')) { $rolesel = get_option('amu_setallroles'); } else { $rolesel = 'notset'; } $roles = $wp_roles->get_names(); echo ' '; echo ' '; echo '
'; //set display name option if (get_option('amu_dispnamedef')) { $defaultDispName = get_option('amu_dispnamedef'); } else { $defaultDispName = 'userlogin'; } echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; //set default sorter preference echo '

'.__('CSV Column Ordering','amulang').'

'; echo '
'; echo '
'; //column ordering preference $colpref = get_option('amu_colorderpref'); echo ' '; echo ' '; echo '
'; //predefined sort order value $sortpredef = get_option('amu_colorderpredef'); echo '
'; echo ' '; echo ' '; amuColumnNamesHint(); echo '
'; echo '
'; //meta data customisation echo '

'.__('Manual Entry User Meta Data','amulang').'

'; echo '
'; //show additional meta options on blank form echo '
'; echo '

'.__('Make additional WordPress Standard meta data fields available on Form interface','amulang').':

'; $blankmeta = get_option('amu_showblankmeta'); if($blankmeta !== '') { $blanksettings = json_decode(get_option('amu_showblankmeta')); } else { $blanksettings = array('none'=>'noextras'); } echo ' '.__('User Url', 'amulang').': keyname == 'user_url') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Nicename', 'amulang').': keyname == 'user_nicename') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Nickname', 'amulang').': keyname == 'nickname') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Display Name', 'amulang').': keyname == 'display_name') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('User Registered', 'amulang').': keyname == 'user_registered') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Description', 'amulang').': keyname == 'description') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Admin Bar Front', 'amulang').': keyname == 'show_admin_bar_front') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Rich Editing', 'amulang').': keyname == 'rich_editing') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Comment Shortcuts', 'amulang').': keyname == 'comment_shortcuts') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Admin Color', 'amulang').': keyname == 'admin_color') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('AIM', 'amulang').': keyname == 'aim') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Yahoo IM', 'amulang').': keyname == 'yim') { echo 'checked="checked"';}} echo ' value="fill" />'; echo ' '.__('Jabber', 'amulang').': keyname == 'jabber') { echo 'checked="checked"';}} echo ' value="fill" />'; echo '
'; //additional meta fields $extrameta = get_option('amu_extrameta'); echo '
'; echo ' '; echo ' '; echo '
'; echo '

'.__('Standard and Custom meta options you define here will be available on the Form using the Manual Entry function or when creating a user information form from the Import Email List function.', 'amulang').'

'; echo '
'; echo '

'.__('Customize New User Notification Email', 'amulang').'

'; echo '
'; //customize new user delivered email echo '
'; $msghead = get_option('amu_useremailhead'); $msgtext = get_option('amu_useremailtext'); $sendemailsto = get_option('amu_defadminemail'); $siteloginurl = get_option('amu_siteloginurl'); echo '
'; echo '

'.__('Use the following settings to modify the notification email that new users receive when added via the plugin.', 'amulang').'

'; echo '

'.__('Please refer to the Information about Settings options at the bottom of this page for more information about these settings.', 'amulang').'

'; echo '

'.__('Valid shortcodes are', 'amulang').': [sitename] [siteurl] [siteloginurl] [username] [password] [useremail] [fromreply]

'; echo '
'; //from email echo '
'; echo ''; echo ''; echo '
'; //custom login url echo '
'; echo ''; echo ''; echo '
'; //message header echo '
'; echo ''; echo ''; echo '
'; //message text echo '
'; echo ''; echo ''; echo '
'; echo '
'; //add dynamic emailer button to customisation box for testing email echo ''; echo '

'.__('Test emails will be sent to your administrator email.','amulang').'

'; echo '
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; } /* * SAVE SETTINGS FUNCTION * Update settings in wp_options table */ function setGeneralOptions() { global $current_user, $wpdb; get_currentuserinfo(); if ( isset($_POST['sendpswemails'] ) ) { $sendEmail = 'yes'; } else { $sendEmail = 'no'; } if ( isset($_POST['confirmEmail'] ) ) { $yesConfirm = 'yes'; } else { $yesConfirm = 'no'; } $setAllRoles = $_POST['allToRole']; if ( isset($_POST['forcefillemail'] ) ) { $forceEmail = 'yes'; } else { $forceEmail = 'no'; } if ( isset($_POST['validatemail'] ) ) { $validateEmail = 'yes'; } else { $validateEmail = 'no'; } if ( isset($_POST['validateStrict'] ) ) { $validateStrict = 'yes'; } else { $validateStrict = 'no'; } if ( isset($_POST['showblankmeta'] ) ) { $showblankmeta = 'yes'; } else { $showblankmeta = 'no'; } if ( isset($_POST['defaultdispname'] ) ) { $defDispName = $_POST['defaultdispname']; } else { $defDispName = 'userlogin'; } $emailCustomHead = $_POST['custemailhead']; $emailCustomText = stripslashes($_POST['customemailtext']); $emailFromAddr = $_POST['custademail']; $emailsiteLog = $_POST['custlogurl']; $colOrderPref = $_POST['sorterpreference']; //create json string of predefined sorting order $rawColOrderPreDef = trim($_POST['sortorderpredef']); $tempColOrderPreDef = str_replace(' ', '', $rawColOrderPreDef); if ($tempColOrderPreDef == '') { $colOrderPreDef = ''; } else { $colOrderPrefArray = explode(',',$tempColOrderPreDef); $fullColDefArray = array(); foreach($colOrderPrefArray as $fpso) { array_push($fullColDefArray, array('keyname'=>$fpso)); } $colOrderPreDef = json_encode($fullColDefArray); } //create json string of custom meta fields $rawAddMetaFields = trim($_POST['additionalmeta']); $tempAddMetaFields = str_replace(' ', '', $rawAddMetaFields); if ($tempAddMetaFields == '') { $additionalMetaFields = ''; } else { $addMetaExpArray = explode(',',$tempAddMetaFields); $fullAddMetaArray = array(); foreach($addMetaExpArray as $cmv) { array_push($fullAddMetaArray, array('keyname'=>$cmv)); } $additionalMetaFields = json_encode($fullAddMetaArray); } //show meta options array $additionalMeta = array(); //add options if ( isset($_POST['meta_user_url'] ) ) { array_push($additionalMeta, array('keyname'=>'user_url', 'dispname'=>'User URL', 'type'=>'text')); } if ( isset($_POST['meta_user_nicename'] ) ) { array_push($additionalMeta, array('keyname'=>'user_nicename', 'dispname'=>'Nicename', 'type'=>'text')); } if ( isset($_POST['meta_nickname'] ) ) { array_push($additionalMeta, array('keyname'=>'nickname', 'dispname'=>'Nickname', 'type'=>'text')); } if ( isset($_POST['meta_displayname'] ) ) { array_push($additionalMeta, array('keyname'=>'display_name', 'dispname'=>'Display Name', 'type'=>'text')); } if ( isset($_POST['meta_userregistered'] ) ) { array_push($additionalMeta, array('keyname'=>'user_registered', 'dispname'=>'Registered', 'type'=>'date')); } if ( isset($_POST['meta_description'] ) ) { array_push($additionalMeta, array('keyname'=>'description', 'dispname'=>'Description', 'type'=>'textbox')); } if ( isset($_POST['meta_barfront'] ) ) { array_push($additionalMeta, array('keyname'=>'show_admin_bar_front', 'dispname'=>'Admin Bar', 'type'=>'check')); } if ( isset($_POST['meta_richedit'] ) ) { array_push($additionalMeta, array('keyname'=>'rich_editing', 'dispname'=>'Rich Editing', 'type'=>'check')); } if ( isset($_POST['meta_comshort'] ) ) { array_push($additionalMeta, array('keyname'=>'comment_shortcuts', 'dispname'=>'Comment Shortcuts', 'type'=>'check')); } if ( isset($_POST['meta_admincolor'] ) ) { array_push($additionalMeta, array('keyname'=>'admin_color', 'dispname'=>'Admin Color', 'type'=>'select')); } if ( isset($_POST['meta_aim'] ) ) { array_push($additionalMeta, array('keyname'=>'aim', 'dispname'=>'AIM', 'type'=>'text')); } if ( isset($_POST['meta_yim'] ) ) { array_push($additionalMeta, array('keyname'=>'yim', 'dispname'=>'Yahoo IM', 'type'=>'text')); } if ( isset($_POST['meta_jabber'] ) ) { array_push($additionalMeta, array('keyname'=>'jabber', 'dispname'=>'Jabber', 'type'=>'text')); } //encode array if(empty($additionalMeta)) { $showMetaFields = ''; } else { $showMetaFields = json_encode($additionalMeta); } //update amu options update_option( 'amu_usernotify', $sendEmail ); update_option( 'amu_confirmation', $yesConfirm ); update_option( 'amu_setallroles', $setAllRoles ); update_option( 'amu_validatestrict', $validateStrict ); update_option( 'amu_validatemail', $validateEmail ); update_option( 'amu_forcefill', $forceEmail ); update_option( 'amu_useremailhead', $emailCustomHead ); update_option( 'amu_useremailtext', $emailCustomText ); update_option( 'amu_defadminemail', $emailFromAddr ); update_option( 'amu_siteloginurl', $emailsiteLog ); update_option( 'amu_showblankmeta', $showMetaFields ); update_option( 'amu_dispnamedef', $defDispName ); update_option( 'amu_extrameta', $additionalMetaFields ); update_option( 'amu_colorderpref', $colOrderPref ); update_option( 'amu_colorderpredef', $colOrderPreDef ); } /* * RESET SETTINGS FUNCTION * Set options back to default installation */ function amu_reset_default_options() { global $current_user, $wpdb; get_currentuserinfo(); $defaultAdminEmail = $current_user->user_email; $sitelogurl = site_url(); $defaultUserEmailHead = __('Your New User Account Information on', 'amulang').' [sitename]'; $defaultUserEmailText = '

'.__('You have been registered as a user on', 'amulang').' [sitename]

'.__('You may now log into the site at', 'amulang').' [siteloginurl]

'.__('Your username is', 'amulang').' [username] '.__('and your password is', 'amulang').' [password]

'.__('Regards', 'amulang').',
[sitename] '.__('Admin', 'amulang').'

[siteurl]

'; //update options update_option( 'amu_usernotify', 'yes' ); update_option( 'amu_confirmation', 'yes' ); update_option( 'amu_setallroles', 'notset' ); update_option( 'amu_validatestrict', 'no' ); update_option( 'amu_validatemail', 'yes' ); update_option( 'amu_forcefill', 'no' ); update_option( 'amu_defadminemail', $defaultAdminEmail ); update_option( 'amu_siteloginurl', $sitelogurl ); update_option( 'amu_useremailhead', $defaultUserEmailHead ); update_option( 'amu_useremailtext', $defaultUserEmailText ); update_option( 'amu_showblankmeta', '' ); update_option( 'amu_dispnamedef', 'userlogin' ); update_option( 'amu_extrameta', '' ); update_option( 'amu_colorderpref', 'dynamic' ); update_option( 'amu_colorderpredef', '' ); } ?>