Author: jfthomps
Date: Fri Mar  4 17:46:50 2011
New Revision: 1078070

URL: http://svn.apache.org/viewvc?rev=1078070&view=rev
Log:
VCL-434

Removed array after $authMechs ($affilValFunc, $affilValFuncArgs, $addUserFunc, 
$addUserFuncArgs, $updateUserFunc, $updateUserFuncArgs) and replaced with some 
code that automatically generates the arrays.  Entries still need to be 
manually created for shibboleth only authentication affiliations in the 
$addUserFunc array. Instructions about that are included.

Modified:
    incubator/vcl/trunk/web/.ht-inc/conf-default.php

Modified: incubator/vcl/trunk/web/.ht-inc/conf-default.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/conf-default.php?rev=1078070&r1=1078069&r2=1078070&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/conf-default.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/conf-default.php Fri Mar  4 17:46:50 2011
@@ -129,26 +129,32 @@ $authMechs = array(
                                                                                
                        #   to use this login mechanism*/
 );
 
-$affilValFunc = array(1 => create_function('', 'return 0;'),
-                      /*3 => "validateLDAPUser",*/
-);
-
-$affilValFuncArgs = array(/*3 => 'EXAMPLE1 LDAP',*/
-);
-
-$addUserFunc = array(1 => create_function('', 'return 0;'),
-                     /*3 => 'addLDAPUser',*/
-);
+$affilValFunc = array();
+$affilValFuncArgs = array();
+$addUserFunc = array();
+$addUserFuncArgs = array();
+$updateUserFunc = array();
+$updateUserFuncArgs = array();
+foreach($authMechs as $key => $item) {
+       if($item['type'] == 'ldap') {
+               $affilValFunc[$item['affiliationid']] = 'validateLDAPUser';
+               $affilValFuncArgs[$item['affiliationid']] = $key;
+               $addUserFunc[$item['affiliationid']] = 'addLDAPUser';
+               $addUserFuncArgs[$item['affiliationid']] = $key;
+               $updateUserFunc[$item['affiliationid']] = 'updateLDAPUser';
+               $updateUserFuncArgs[$item['affiliationid']] = $key;
+       }
+       elseif($item['type'] == 'local') {
+               $affilValFunc[$item['affiliationid']] = create_function('', 
'return 0;');
+               $addUserFunc[$item['affiliationid']] = create_function('', 
'return 0;');
+               $updateUserFunc[$item['affiliationid']] = create_function('', 
'return 0;');
+       }
+}
+
+# any affiliation that is shibboleth authenticated without a corresponding
+# LDAP server needs an entry in addUserFunc
+# $addUserFunc[affiliationid goes here] = create_function('', 'return 0;');
 
-$addUserFuncArgs = array(/*3 => 'EXAMPLE1 LDAP',*/
-);
-
-$updateUserFunc = array(1 => create_function('', 'return 0;'),
-                        /*3 => 'updateLDAPUser',*/
-);
-
-$updateUserFuncArgs = array(/*3 => 'EXAMPLE1 LDAP',*/
-);
 
 $findAffilFuncs = array("testGeneralAffiliation");
 


Reply via email to