diff --git a/plugins/wordpress-mu-plugin-fasauth/fasauth.php b/plugins/wordpress-mu-plugin-fasauth/fasauth.php new file mode 100644 index 0000000..36683d9 --- /dev/null +++ b/plugins/wordpress-mu-plugin-fasauth/fasauth.php @@ -0,0 +1,260 @@ + +
+

External database settings

+
+ +

Connection settings

+

Caution: If you make a mistake, it will lock you out of your Wordpress installation, and you'll have to delete or rename the plugin file to regain access!

+ Make sure your WP admin account exists in the external db prior to saving these settings. + + + + + + + + + + + + + + + + + + + +
External database type: +
required; If not MySQL, requires PEAR MDB2 package and relevant database driver package installation. +

+ In case this isn't in some sort of include path in your PHP configuration. No trailing slash! e.g., /home/username/php
+

required; (often localhost)
+

Only set this if you have a non-standard port for connecting.
+

required
+

required; (recommend select privileges only)
+

required
+

required
+
+ +

Field matching settings

+

Username, password, and password hash type have to be set at the minimum. Be careful with this section! If you enter incorrect settings, you'll get locked out of your admin panel and will need to delete the plugin or change plugin settings directly in the wp_options table.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

required
+

required
+
Type of encryption for password:
required; (using "Other" requires you to enter PHP code below!)

Enter code here; only will run if "Other" is selected. Variable you need to set is $password2. See source code for other variable names.
+
+ +
Use this if you have certain user role ids in your external database to further restrict allowed logins. If unused, leave fields blank.
+
+
+
+
+
+
+
+
+
+

Other

+ + + + + +
Custom login message: +
Shows up in login box, e.g., to tell them where to get an account. You can use HTML in this text.
+ +

+ +

+
+
+'.get_option('ext_db_error_msg')); +} + +//gives warning for login - where to get "source" login +function fas_auth_warning() { + echo "

".get_option('fas_error_msg')."

"; +} + +function fas_errors() { + global $error; + global $fas_error; + if ($fas_error == "notindb") + return "ERROR: Username not found."; + else if ($fas_error == "wrongrole") + return "ERROR: You don't have permissions to log in."; + else if ($fas_error == "wrongpw") + return "ERROR: Invalid password."; + else + return $error; +} + +add_action('admin_init', 'fas_auth_init' ); +add_action('admin_menu', 'fas_auth_add_menu'); +add_action('wp_authenticate', 'fas_auth_check_login', 1, 2 ); +add_action('login_form','fas_auth_warning'); +add_action('lost_password', 'disable_function'); +add_action('retrieve_password', 'disable_function'); +add_action('password_reset', 'disable_function'); +add_filter('login_errors','fas_errors'); + + +register_activation_hook( __FILE__, 'fas_auth_activate' );