* Returns true if the username and password work
* and false if they don't
*
- * @param string username
- * @param string plaintext password
+ * @param string $username
+ * @param string $password
*
*/
-
function auth_user_login ($username, $password) {
global $CFG;
}
/**
- * return number of daysi to user users password expires
+ * return number of days to user password expires
*
* If userpassword does not expire it should return 0. If password is already expired
* it should return negative value.
*
- * @param mixed $username username
- *
+ * @param mixed $username username
+ * @return integer
*/
function auth_password_expire($username) {
global $CFG ;
* Activates (enables) user in external db so user can login to external db
*
* @param mixed $username username
- *
+ * @return boolen result
*/
function auth_user_activate ($username) {
global $CFG;
* Disables user in external db so user can't login to external db
*
* @param mixed $username username
- *
+ * @return boolean result
*/
function auth_user_disable ($username) {
global $CFG;
* auth_iscreator returns true if user should be coursecreator
*
* @param mixed $username username
- * @return
+ * @return boolean result
*/
function auth_iscreator($username=0) {
///if user is member of creator group return true
*
* @param mixed $olduser Userobject before modifications
* @param mixed $newuser Userobject new modified userobject
- * @return
+ * @return boolean result
*
*/
function auth_user_update($olduser, $newuser) {
}
/*
- * auth_user_update_password changes userpassword in external db
+ * changes userpassword in external db
*
* called when the user password is updated.
* changes userpassword in external db
*
* @param mixed $username Username
* @param mixed $newpassword Plaintext password
- * @return
+ * @return boolean result
*
*/
function auth_user_update_password($username, $newpassword) {
/**
* returns predefined usertypes
*
- * @return
+ * @return array of predefined usertypes
*/
function auth_ldap_suppported_usertypes (){
* ....
* );
*
- * And acording this information $CFG->pseudoname values are set
- * If $CFG->pseudoname is alredy set curren value is honored.
- *
+ * @return array of default values
*/
-function auth_ldap_init () {
- global $CFG;
+
+function auth_ldap_getdefaults(){
$default['ldap_objectclass'] = array(
'edir' => 'User',
'rfc2703' => 'posixAccount',
'ad' => '', //No support yet
'default' => ''
);
-
+ return $default;
+}
+/**
+ * set $CFG-values for ldap_module
+ *
+ * Get default configuration values with auth_ldap_getdefaults()
+ * and by using this information $CFG-> values are set
+ * If $CFG->value is alredy set current value is honored.
+ *
+ *
+ */
+function auth_ldap_init () {
+ global $CFG;
+
+ $default = auth_ldap_getdefaults();
foreach ($default as $key => $value) {
//set defaults if overriding fields not set