[ Index ]

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

title

Body

[close]

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

(no description)

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

Defines 1 class

auth_plugin_cas:: (29 methods):
  auth_plugin_cas()
  user_login()
  is_internal()
  can_change_password()
  loginpage_hook()
  prelogout_hook()
  connectCAS()
  config_form()
  change_password_url()
  ldap_suppported_usertypes()
  process_config()
  ldap_getdefaults()
  get_userinfo()
  get_userinfo_asobj()
  ldap_connect()
  ldap_attributes()
  ldap_find_userdn()
  ldap_addslashes()
  get_userlist()
  user_exists()
  sync_users()
  update_user_record()
  ldap_bulk_insert()
  iscreator()
  ldap_isgroupmember()
  ldap_get_userlist()
  ldap_get_entries()
  sync_roles()
  filter_addslashes()


Class: auth_plugin_cas  - X-Ref

CAS authentication plugin.

auth_plugin_cas()   X-Ref
Constructor.


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

param: string $username The username
param: string $password The password
return: bool Authentication success or failure.

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

loginpage_hook()   X-Ref
authentication choice (CAS or other)
redirection to the CAS form or to login/index.php
for other authentication


prelogout_hook()   X-Ref
logout from the cas

This function is called from admin/auth.php


connectCAS()   X-Ref
Connect to the cas (clientcas connection or proxycas connection

This function is called from admin/auth.php


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.

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

return: string

ldap_suppported_usertypes()   X-Ref
returns predefined usertypes

return: array of predefined usertypes

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


ldap_getdefaults()   X-Ref
Initializes needed ldap variables for cas-module

Uses names defined in ldap_supported_usertypes.
$default is first defined as:
$default['pseudoname'] = array(
'typename1' => 'value',
'typename2' => 'value'
....
);

return: array of default values

get_userinfo($username)   X-Ref
reads userinformation from ldap and return it in array()

Read user information from external database and returns it as array().
Function should return all information available. If you are saving
this information to moodle user-table you should honor syncronization flags

param: string $username username (with system magic quotes)
return: mixed array with no magic quotes or false on error

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

param: string $username username (with system magic quotes)
return: mixed object or false on error

ldap_connect($binddn='',$bindpwd='')   X-Ref
connects to ldap server

Tries connect to specified ldap servers.
Returns connection result or error.

return: connection result

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

return: array

ldap_find_userdn($ldapconnection, $extusername)   X-Ref
retuns dn of username

Search specified contexts for username and return user dn
like: cn=username,ou=suborg,o=org

param: mixed $ldapconnection  $ldapconnection result
param: mixed $username username (external encoding no slashes)

ldap_addslashes($text)   X-Ref
Quote control characters in quoted "texts" used in ldap

param: string

get_userlist()   X-Ref
returns all usernames from external database

get_userlist returns all usernames from external database

return: array

user_exists($username)   X-Ref
checks if user exists on external db

param: string $username (with system magic quotes)

sync_users($bulk_insert_records = 1000, $do_updates = true)   X-Ref
syncronizes user fron external db to moodle user table

Sync is now using username attribute.

Syncing users removes or suspends users that dont exists anymore in external db.
Creates new users and updates coursecreator status of users.

param: int $bulk_insert_records will insert $bulkinsert_records per insert statement
param: bool $do_updates will do pull in data updates from ldap if relevant

update_user_record($username, $updatekeys = false)   X-Ref
Update a local user record from an external source.
This 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 LDAP won't be removed from moodle.

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

ldap_bulk_insert($users, $temptable)   X-Ref
Bulk insert in SQL's temp table

param: array $users is an array of usernames

iscreator($username)   X-Ref
Returns true if user should be coursecreator.

param: mixed $username    username (without system magic quotes)
return: boolean result

ldap_isgroupmember($extusername='', $groupdns='')   X-Ref
checks if user belong to specific group(s)

Returns true if user belongs group in grupdns string.

param: mixed $username    username
param: mixed $groupdns    string of group dn separated by ;

ldap_get_userlist($filter="*")   X-Ref
return all usernames from ldap

return: array

ldap_get_entries($conn, $searchresult)   X-Ref
return entries from ldap

Returns values like ldap_get_entries but is
binary compatible and return all attributes as array

return: array ldap-entries

sync_roles($user)   X-Ref
Sync roles for this user

param: $user object user object (without system magic quotes)

filter_addslashes($text)   X-Ref
Quote control characters in texts used in ldap filters - see rfc2254.txt

param: string



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