diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-11-15 15:17:25 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-11-15 15:17:25 +0100 |
commit | e259aa7939e5d3cd704351d4d53d1d1497217a11 (patch) | |
tree | 7ea32b1ec14a252f21c4980fd263e0ed67726f1f /inc/auth | |
parent | 7917b6f2f2768c559c2b891f5c0077afe3eeef69 (diff) | |
download | rpg-e259aa7939e5d3cd704351d4d53d1d1497217a11.tar.gz rpg-e259aa7939e5d3cd704351d4d53d1d1497217a11.tar.bz2 |
Added isCaseSensitive() to auth backends FS#1657
Ignore-this: 3591e5a36126c72bd9b931e4aa832da8
darcs-hash:20091115141725-7ad00-7c2fc662d1999731660673d05299c4f357b797b3.gz
Diffstat (limited to 'inc/auth')
-rw-r--r-- | inc/auth/ad.class.php | 7 | ||||
-rw-r--r-- | inc/auth/basic.class.php | 18 | ||||
-rw-r--r-- | inc/auth/ldap.class.php | 7 | ||||
-rw-r--r-- | inc/auth/mysql.class.php | 7 |
4 files changed, 33 insertions, 6 deletions
diff --git a/inc/auth/ad.class.php b/inc/auth/ad.class.php index 8eb8b06d8..aac17f33c 100644 --- a/inc/auth/ad.class.php +++ b/inc/auth/ad.class.php @@ -178,6 +178,13 @@ class auth_ad extends auth_basic { } /** + * Most values in LDAP are case-insensitive + */ + function isCaseSensitive(){ + return false; + } + + /** * Initialize the AdLDAP library and connect to the server */ function _init(){ diff --git a/inc/auth/basic.class.php b/inc/auth/basic.class.php index a1f77dea5..c08422488 100644 --- a/inc/auth/basic.class.php +++ b/inc/auth/basic.class.php @@ -323,15 +323,23 @@ class auth_basic { } /** + * Return case sensitivity of the backend [OPTIONAL] + * + * When your backend is caseinsensitive (eg. you can login with USER and + * user) then you need to overwrite this method and return false + */ + function isCaseSensitive(){ + return true; + } + + /** * Sanitize a given username [OPTIONAL] * * This function is applied to any user name that is given to * the backend and should also be applied to any user name within * the backend before returning it somewhere. * - * This should be used to enforce username restrictions. Eg. when - * the backend is case insensitive all usernames should be lowercased - * here. + * This should be used to enforce username restrictions. * * @author Andreas Gohr <andi@splitbrain.org> * @param string $user - username @@ -348,9 +356,7 @@ class auth_basic { * the backend and should also be applied to any groupname within * the backend before returning it somewhere. * - * This should be used to enforce groupname restrictions. Eg. when - * the backend is case insensitive all groupames should be lowercased - * here. + * This should be used to enforce groupname restrictions. * * Groupnames are to be passed without a leading '@' here. * diff --git a/inc/auth/ldap.class.php b/inc/auth/ldap.class.php index 8eb797a11..c51924135 100644 --- a/inc/auth/ldap.class.php +++ b/inc/auth/ldap.class.php @@ -248,6 +248,13 @@ class auth_ldap extends auth_basic { } /** + * Most values in LDAP are case-insensitive + */ + function isCaseSensitive(){ + return false; + } + + /** * Make LDAP filter strings. * * Used by auth_getUserData to make the filter diff --git a/inc/auth/mysql.class.php b/inc/auth/mysql.class.php index 26cfb85d9..b1c6a3a52 100644 --- a/inc/auth/mysql.class.php +++ b/inc/auth/mysql.class.php @@ -401,6 +401,13 @@ class auth_mysql extends auth_basic { } /** + * MySQL is case-insensitive + */ + function isCaseSensitive(){ + return false; + } + + /** * Adds a user to a group. * * If $force is set to '1' non existing groups would be created. |