[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/auth/db/ -> auth.php (summary)

(no description)

Author: Martin Dougiamas
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 707 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 auth/db/config.html

Defines 1 class

auth_plugin_db:: (20 methods):
  auth_plugin_db()
  user_login()
  db_init()
  db_attributes()
  get_userinfo()
  user_update_password()
  sync_users()
  user_exists()
  get_userlist()
  get_userinfo_asobj()
  update_user_record()
  user_update()
  validate_form()
  is_internal()
  can_change_password()
  change_password_url()
  can_reset_password()
  config_form()
  process_config()
  ext_addslashes()


Class: auth_plugin_db  - X-Ref

External database authentication plugin.

auth_plugin_db()   X-Ref
Constructor.


user_login($username, $password)   X-Ref
Returns true if the username and password work and false if they are
wrong or don't exist.

param: string $username The username (with system magic quotes)
param: string $password The password (with system magic quotes)
return: bool Authentication success or failure.

db_init()   X-Ref
No description

db_attributes()   X-Ref
retuns user attribute mappings between moodle and ldap

return: array

get_userinfo($username)   X-Ref
Reads any other information for a user from external database,
then returns it in an array

param: string $username (with system magic quotes)
return: array without magic quotes

user_update_password($user, $newpassword)   X-Ref
Change a user's password

param: object  $user        User table object  (with system magic quotes)
param: string  $newpassword Plaintext password (with system magic quotes)
return: bool                  True on success

sync_users($do_updates=false)   X-Ref
syncronizes user fron external db to moodle user table

Sync shouid be done by using idnumber attribute, not username.
You need to pass firstsync parameter to function to fill in
idnumbers if they dont exists in moodle user table.

Syncing users removes (disables) users that dont exists anymore in external db.
Creates new users and updates coursecreator status of users.

param: bool $do_updates  Optional: set to true to force an update of existing accounts

user_exists($username)   X-Ref
No description

get_userlist()   X-Ref
No description

get_userinfo_asobj($username)   X-Ref
reads userinformation from DB and return it in an object

param: string $username username (with system magic quotes)
return: array

update_user_record($username, $updatekeys=false)   X-Ref
will update a local user record from an external source.
is a lighter version of the one in moodlelib -- won't do
expensive ops such as enrolment

If you don't pass $updatekeys, there is a performance hit and
values removed from DB won't be removed from moodle.

param: string $username username (with system magic quotes)

user_update($olduser, $newuser)   X-Ref
Called when the user record is updated.
Modifies user in external database. It takes olduser (before changes) and newuser (after changes)
conpares information saved modified information to external db.

param: mixed $olduser     Userobject before modifications    (without system magic quotes)
param: mixed $newuser     Userobject new modified userobject (without system magic quotes)
return: boolean result

validate_form(&$form, &$err)   X-Ref
A chance to validate form data, and last chance to
do stuff before it is inserted in config_plugin


is_internal()   X-Ref
Returns true if this authentication plugin is 'internal'.

return: bool

can_change_password()   X-Ref
Returns true if this authentication plugin can change the user's
password.

return: bool

change_password_url()   X-Ref
Returns the URL for changing the user's pw, or empty if the default can
be used.

return: string

can_reset_password()   X-Ref
Returns true if plugin allows resetting of internal password.

return: bool

config_form($config, $err, $user_fields)   X-Ref
Prints a form for configuring this authentication plugin.

This function is called from admin/auth.php, and outputs a full page with
a form for configuring this plugin.

param: array $page An object containing all the data for this page.

process_config($config)   X-Ref
Processes and stores configuration data for this authentication plugin.


ext_addslashes($text)   X-Ref
No description



Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7