Permalink
Browse files

MDL-12531, make the new member value available to all the affected pl…

…ugins, thanks, Robert
  • Loading branch information...
1 parent 96eb0bd commit 29a2749da5a2c3579dc456452b9e3b5f7b377216 dongsheng committed Apr 8, 2008
Showing with 11 additions and 18 deletions.
  1. +2 −1 admin/auth_config.php
  2. +1 −4 auth/cas/auth.php
  3. +1 −4 auth/db/auth.php
  4. +1 −4 auth/ldap/auth.php
  5. +1 −5 auth/shibboleth/auth.php
  6. +5 −0 lib/authlib.php
View
@@ -50,7 +50,8 @@
$frm = get_config("auth/$auth");
}
-$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "institution", "department", "address", "city", "country", "description", "idnumber", "lang");
+$user_fields = $authplugin->userfields;
+//$user_fields = array("firstname", "lastname", "email", "phone1", "phone2", "institution", "department", "address", "city", "country", "description", "idnumber", "lang");
/// Get the auth title (from core or own auth lang files)
$authtitle = $authplugin->get_title();
View
@@ -487,11 +487,8 @@ function ldap_connect($binddn='',$bindpwd='') {
* @return array
*/
function ldap_attributes () {
- $fields = array("firstname", "lastname", "email", "phone1", "phone2",
- "department", "address", "city", "country", "description",
- "idnumber", "lang" );
$moodleattributes = array();
- foreach ($fields as $field) {
+ foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
if (preg_match('/,/',$moodleattributes[$field])) {
View
@@ -132,11 +132,8 @@ function db_init() {
* @return array
*/
function db_attributes() {
- $fields = array("firstname", "lastname", "email", "phone1", "phone2",
- "department", "address", "city", "country", "description",
- "idnumber", "lang" );
$moodleattributes = array();
- foreach ($fields as $field) {
+ foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
}
View
@@ -1647,11 +1647,8 @@ function ldap_find_userdn ($ldapconnection, $extusername) {
*/
function ldap_attributes () {
- $fields = array("firstname", "lastname", "email", "phone1", "phone2",
- "department", "address", "city", "country", "description",
- "idnumber", "lang" );
$moodleattributes = array();
- foreach ($fields as $field) {
+ foreach ($this->userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
if (preg_match('/,/',$moodleattributes[$field])) {
View
@@ -123,12 +123,8 @@ function get_userinfo($username) {
function get_attributes() {
$configarray = (array) $this->config;
- $fields = array("firstname", "lastname", "email", "phone1", "phone2",
- "department", "address", "city", "country", "description",
- "idnumber", "lang", "guid");
-
$moodleattributes = array();
- foreach ($fields as $field) {
+ foreach ($this->userfields as $field) {
if (isset($configarray["field_map_$field"])) {
$moodleattributes[$field] = $configarray["field_map_$field"];
}
View
@@ -54,6 +54,11 @@ class auth_plugin_base {
* Authentication plugin type - the same as db field.
*/
var $authtype;
+ /*
+ * The fields we can lock and update from/to external authentication backends
+ *
+ */
+ var $userfields = array("firstname", "lastname", "email", "phone1", "phone2", "institution", "department", "address", "city", "country", "description", "idnumber", "lang");
/**

0 comments on commit 29a2749

Please sign in to comment.