if ($config = data_submitted()) {
$config = (array)$config;
- validate_form($config, $err);
// extract and sanitize the auth key explicitly
$modules = get_list_of_plugins("auth");
notify("Error defining the authentication method");
}
+ // load the auth plugin library
+ require_once("{$CFG->dirroot}/auth/$auth/lib.php");
+
+ $err = array();
+ if (function_exists('auth_validate_form')) {
+ auth_validate_form($config, $err);
+ }
+
if (count($err) == 0) {
foreach ($config as $name => $value) {
if (preg_match('/^pluginconfig_(.+?)$/', $name, $matches)) {
/// Functions /////////////////////////////////////////////////////////////////
-function validate_form(&$form, &$err) {
-
- // if (empty($form->fullname))
- // $err["fullname"] = get_string("missingsitename");
-
- return;
-}
-
//
// Good enough for most auth plugins
// but some may want a custom one if they are offering
Userinformation in array ( name => value, ....
or false in case of error
+ auth_validate_form(&$form, &$err)
+
+ Validate form data.
+
+ Returns:
+ Bool. Manipulates $form and $err arrays in place
+
+
COURSE CREATING
auth_iscreator($username)