2.5 ) add_action('admin_notices', 'version_warning'); } function version_warning(){ echo "

".__('Register Plus is only compatible with WordPress v2.5 and up.')."

"; } function AddPanel(){ add_options_page( 'Register Plus', 'Register Plus', 10, 'register-plus', array($this, 'RegPlusSettings') ); } function DefaultSettings () { $default = array( 'password' => '0', 'code' => '0', 'codepass' => array('0'), 'captcha' => '0', 'disclaimer' => '0', 'disclaimer_title' => 'Disclaimer', 'disclaimer_content' => '', 'disclaimer_agree' => 'Accept the Disclaimer', 'license' => '0', 'license_title' => 'License Agreement', 'license_content' => '', 'license_agree' => 'Accept the License Agreement', 'privacy' => '0', 'privacy_title' => 'Privacy Policy', 'privacy_content' => '', 'privacy_agree' => 'Accept the Privacy Policy', 'email_exists' => '0', 'firstname' => '0', 'lastname' => '0', 'website' => '0', 'aim' => '0', 'yahoo' => '0', 'jabber' => '0', 'about' => '0', 'profile_req' => array('0'), 'require_style' => 'border-color: red;', 'dash_widget' => '0', 'email_verify' => '0', 'email_delete_grace' => '7', 'html' => '0', 'adminhtml' => '0', 'from' => get_option('admin_email'), 'subject' => sprintf(__('[%s] Your username and password', 'regplus'), get_option('blogname')), 'custom_msg' => '0', 'msg' => " %blogname% Registration \r\n --------------------------- \r\n\r\n Here are your credentials: \r\n Username: %user_login% \r\n Password: %user_pass% \r\n Confirm Registration: %siteurl% \r\n\r\n Thank you for registering with %blogname%! \r\n", 'disable_admin' => '0', 'adminfrom' => get_option('admin_email'), 'adminsubject' => sprintf(__('[%s] New User Register', 'regplus'), get_option('blogname')), 'custom_adminmsg' => '0', 'adminmsg' => " New %blogname% Registration \r\n --------------------------- \r\n\r\n Username: %user_login% \r\n E-Mail: %user_email% \r\n", 'logo' => '' ); # Get Previously Saved Items and put into new Settings if( get_option("regplus_password") ) $default['password'] = get_option("regplus_password"); if( get_option("regplus_code") ) $default['code'] = get_option("regplus_code"); if( get_option("regplus_codepass") ) $default['codepass'] = get_option("regplus_codepass"); if( get_option("regplus_captcha") ) $default['captcha'] = get_option("regplus_captcha"); #Delete Previous Saved Items delete_option('regplus_password'); delete_option('regplus_code'); delete_option('regplus_codepass'); delete_option('regplus_captcha'); #Set Default Settings if( !get_option('register_plus') ){ #Set Defaults if no values exist add_option( 'register_plus', $default ); }else{ #Set Defaults if new value does not exist $regplus = get_option( 'register_plus' ); foreach( $default as $key => $val ){ if( !$regplus[$key] ){ $regplus[$key] = $val; $new = true; } } if( $new ) update_option( 'register_plus', $regplus ); } } function SaveSettings(){ check_admin_referer('regplus-update-options'); $update = get_option( 'register_plus' ); $update["password"] = $_POST['regplus_password']; $update["code"] = $_POST['regplus_code']; if( $_POST['regplus_code'] ) { $update["codepass"] = $_POST['regplus_codepass']; $update["code_req"] = $_POST['regplus_code_req']; } $update["captcha"] = $_POST['regplus_captcha']; $update["disclaimer"] = $_POST['regplus_disclaimer']; $update["disclaimer_title"] = $_POST['regplus_disclaimer_title']; $update["disclaimer_content"] = $_POST['regplus_disclaimer_content']; $update["disclaimer_agree"] = $_POST['regplus_disclaimer_agree']; $update["license"] = $_POST['regplus_license']; $update["license_title"] = $_POST['regplus_license_title']; $update["license_content"] = $_POST['regplus_license_content']; $update["license_agree"] = $_POST['regplus_license_agree']; $update["privacy"] = $_POST['regplus_privacy']; $update["privacy_title"] = $_POST['regplus_privacy_title']; $update["privacy_content"] = $_POST['regplus_privacy_content']; $update["privacy_agree"] = $_POST['regplus_privacy_agree']; $update["email_exists"] = $_POST['regplus_email_exists']; $update["firstname"] = $_POST['regplus_firstname']; $update["lastname"] = $_POST['regplus_lastname']; $update["website"] = $_POST['regplus_website']; $update["aim"] = $_POST['regplus_aim']; $update["yahoo"] = $_POST['regplus_yahoo']; $update["jabber"] = $_POST['regplus_jabber']; $update["about"] = $_POST['regplus_about']; $update["profile_req"] = $_POST['regplus_profile_req']; $update["require_style"] = $_POST['regplus_require_style']; $update["dash_widget"] = $_POST['regplus_dash_widget']; $update["email_verify"] = $_POST['regplus_email_verify']; $update["email_verify_date"] = $_POST['regplus_email_verify_date']; $update["email_delete_grace"] = $_POST['regplus_email_delete_grace']; $update["reCAP_public_key"] = $_POST['regplus_reCAP_public_key']; $update["reCAP_private_key"] = $_POST['regplus_reCAP_private_key']; $update['html'] = $_POST['regplus_html']; $update['from'] = $_POST['regplus_from']; $update['subject'] = $_POST['regplus_subject']; $update['custom_msg'] = $_POST['regplus_custom_msg']; $update['msg'] = $_POST['regplus_msg']; $update['disable_admin'] = $_POST['regplus_disable_admin']; $update['adminhtml'] = $_POST['regplus_adminhtml']; $update['adminfrom'] = $_POST['regplus_adminfrom']; $update['adminsubject'] = $_POST['regplus_adminsubject']; $update['custom_adminmsg'] = $_POST['regplus_custom_adminmsg']; $update['adminmsg'] = $_POST['regplus_adminmsg']; if( $_FILES['regplus_logo']['name'] ) $update['logo'] = $this->UploadLogo(); if( $_POST['label'] ){ foreach( $_POST['label'] as $k => $field ){ if( $field ) $custom[$k] = array( 'label' => $field, 'profile' => $_POST['profile'][$k], 'reg' => $_POST['reg'][$k], 'required' => $_POST['required'][$k] ); } } update_option( 'register_plus_custom', $custom ); update_option( 'register_plus', $update ); $_POST['notice'] = __('Settings Saved', 'regplus'); } function UploadLogo(){ $upload_dir = ABSPATH . get_option('upload_path'); $upload_file = trailingslashit($upload_dir) . basename($_FILES['regplus_logo']['name']); if( !is_dir($upload_dir) ) wp_upload_dir(); if( move_uploaded_file($_FILES['regplus_logo']['tmp_name'], $upload_file) ){ chmod($upload_file, 0777); $logo = $_FILES['regplus_logo']['name']; return trailingslashit( get_option('siteurl') ) . 'wp-content/uploads/' . $logo; }else{ return false; } } function SettingsHead(){ $regplus = get_option( 'register_plus' ); ?>

' . $_POST['notice'] . '.

'; if( !is_array($regplus['profile_req']) ) $regplus['profile_req'] = array(); if( is_array($regplus['codepass']) ){ foreach( $regplus['codepass'] as $code ){ $codes .= '
  ' . __( ' . __(
'; } } if( is_array($regplus_custom) ){ foreach( $regplus_custom as $k => $v ) { $rows .= '