Commit c29835fe authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Make sure to check institution when authenticating a user. Removed a

couple of unnecessary auth methods. Make sure also to say the internal auth
method does not have configuration.
parent bad98159
......@@ -38,7 +38,8 @@ class AuthInternal extends Auth {
public static function authenticate_user_account($username, $password, $institution) {
if (!$user = get_record_sql('SELECT username, password, salt
FROM ' . get_config('dbprefix') . 'usr
WHERE LOWER(username) = ?', strtolower($username))) {
WHERE LOWER(username) = ?
AND institution = ?', array(strtolower($username), $institution))) {
throw new AuthUnknownUserException("\"$username\" is not known to AuthInternal");
}
......@@ -54,31 +55,6 @@ class AuthInternal extends Auth {
public static function get_user_info($username) {
}
/**
* Returns a form that allows an administrator to configure this
* authentication method.
*
* The internal method has no configuration options. This is just
* here until I can document it properly.
*/
public static function get_configuration_form() {
//return Auth::build_form('internal', array(
// 'foo' => array(
// 'type' => 'text',
// 'title' => 'wtf',
// 'description' => 'Testing',
// 'help' => 'help',
// 'defaultvalue' => get_config_plugin('auth', 'internal', 'foo')
// )
//));
}
public static function validate_configuration_form(Form $form, $values) {
//if (!$form->get_error('foo') && $values['foo'] != 'bar') {
// $form->set_error('foo', 'WTF man!');
//}
}
/**
* For internal authentication, passwords can contain a range of letters,
* numbers and symbols. There is a minimum limit of six characters allowed
......@@ -197,7 +173,7 @@ class AuthInternal extends Auth {
class PluginAuthInternal extends Plugin {
public static function has_config() {
return true;
return false;
}
public static function get_config_options() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment