Author: jfthomps
Date: Wed Oct 15 02:08:41 2014
New Revision: 1631933

URL: http://svn.apache.org/r1631933
Log:
VCL-664 - hard coded references to "Local Account"

authentication.php:
-modified submitLogin: added $authtype parameter for call to localLogin
-modified localLogin: added $authtype argument; changed addLoginLog calls to 
use passed in $authtype for 2nd parameter instead of 'Local' and to use it to 
get the right affiliationid from the $authMechs array instead of hard coding 
'Local Account'; use $authtype as parameter for calling printLoginPageWithSkin 
instead of hard coding 'Local Account'

Modified:
    vcl/trunk/web/.ht-inc/authentication.php

Modified: vcl/trunk/web/.ht-inc/authentication.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/authentication.php?rev=1631933&r1=1631932&r2=1631933&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/authentication.php (original)
+++ vcl/trunk/web/.ht-inc/authentication.php Wed Oct 15 02:08:41 2014
@@ -339,7 +339,7 @@ function submitLogin() {
        if($authMechs[$authtype]['type'] == 'ldap')
                ldapLogin($authtype, $userid, $passwd);
        elseif($authMechs[$authtype]['type'] == 'local')
-               localLogin($userid, $passwd);
+               localLogin($userid, $passwd, $authtype);
        else
                selectAuth();
 }
@@ -460,19 +460,20 @@ function ldapLogin($authtype, $userid, $
 
 
////////////////////////////////////////////////////////////////////////////////
 ///
-/// \fn localLogin($userid, $passwd)
+/// \fn localLogin($userid, $passwd, $authtype)
 ///
 /// \param $userid - userid without affiliation
 /// \param $passwd - submitted password
+/// \param $authtype - key from $authMechs array submitted to calling function
 ///
 /// \brief tries to authenticate user locally; calls printLoginPageWithSkin if
 /// authentication fails
 ///
 
////////////////////////////////////////////////////////////////////////////////
-function localLogin($userid, $passwd) {
+function localLogin($userid, $passwd, $authtype) {
        global $HTMLheader, $phpVer, $authMechs;
        if(validateLocalAccount($userid, $passwd)) {
-               addLoginLog($userid, 'Local', $authMechs['Local 
Account']['affiliationid'], 1);
+               addLoginLog($userid, $authtype, 
$authMechs[$authtype]['affiliationid'], 1);
                //set cookie
                $cookie = getAuthCookieData("$userid@local");
                if(version_compare(PHP_VERSION, "5.2", ">=") == true)
@@ -486,8 +487,8 @@ function localLogin($userid, $passwd) {
                exit;
        }
        else {
-               addLoginLog($userid, 'Local', $authMechs['Local 
Account']['affiliationid'], 0);
-               printLoginPageWithSkin('Local Account');
+               addLoginLog($userid, $authtype, 
$authMechs[$authtype]['affiliationid'], 0);
+               printLoginPageWithSkin($authtype);
                printHTMLFooter();
                dbDisconnect();
                exit;


Reply via email to