Changeset 95

Show
Ignore:
Timestamp:
07/31/07 16:34:40 (1 year ago)
Author:
pdingle
Message:

cleaned up clickback file, added processing.pw.lib & created a showprocessingsummary function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/TRY-PD-phpInfoCard/wp-infocard/wp/clickback.pw.php

    r61 r95  
    6969        } // end of function verifyChallenge     
    7070 
    71         // Function:  sendAccountValidation 
    72         // Description:  creates & emails a validation message to the user 
    73         // Input:   clickbackID:  pre-created clickback value 
    74         //              user email:  destination email 
    75         // Output:  none 
    76         // Side-effects: sends an email 
     71        /* 
     72                Function:       validateClickback 
     73                Description:    returns true if the supplied candidate matches 
     74                                a newly generated clickback 
     75                Input:          candidate - the clickback value to validate 
     76                                user_email - email address from the token 
     77                                user_ppid - privatepersonalidentifier from the token 
     78                Output:         boolean 
     79                Side Effects:   none 
     80        */ 
     81        function validateClickback($candidate, $user_email, $user_ppid) 
     82        { 
     83                pw_utils::printDebug("&nbsp;Clickback posted<br/>"); 
     84 
     85                $challengeContent = $user_email . $user_ppid; 
     86                $clickbackUrl = pw_clickback::createChallenge($challengeContent); 
     87                $previousChallenge = trim($candidate); 
     88 
     89                return pw_clickback::verifyChallenge($clickbackUrl, $previousChallenge); 
     90 
     91        } 
     92 
     93        /* 
     94                Function:  sendAccountValidation 
     95                Description:  creates & emails a validation message to the user 
     96                Input:   clickbackID:  pre-created clickback value 
     97                        user email:  destination email 
     98                Output:  none 
     99                Side Effects: sends an email 
     100        */ 
    77101        function sendAccountValidation( $clickbackID, $user_email )  
    78102        { 
  • branches/TRY-PD-phpInfoCard/wp-infocard/wp/pw-claimtypes.php

    r94 r95  
    7575        'Calls out to the getLoginID function in pw_userdata' ); 
    7676 
     77$datamap['ID'] = new pw_mapping( 
     78        'Account ID', 
     79        'ID', 
     80        PW_TABLE_PREFIX . 'users', 
     81        'return pw_userdata::getAccountID();', 
     82        'Calls out to the getAccountID function in pw_userdata' ); 
     83 
    7784$datamap['first_name'] = new pw_mapping( 
    7885        'First Name', 
  • branches/TRY-PD-phpInfoCard/wp-infocard/wp/userdata.pw.php

    r84 r95  
    4848                $query = "SELECT * FROM `" . PW_TABLE_PREFIX  
    4949                . "infocard_identities` WHERE modulusHash = '" 
    50                         . $claimslist['modulusHash']->token_value  
     50                        . substr_replace($claimslist['signerkeymodulus']->token_value, '', 128, -1) 
    5151                        . "' AND ppid = '" 
    5252                        . $claimslist['privatepersonalidentifier']->token_value 
    5353                        . "'"; 
     54                pw_utils::printDebug($query); 
    5455                $identity_info = $wpdb->get_results( $query, OBJECT ); 
    5556 
     
    231232        } //end function getLoginID 
    232233 
     234        /*      Function: getAccountID 
     235                Description:    only returns the existing value. 
     236                Input:          none 
     237                Output:         existing Account ID 
     238                Side Effects:   none 
     239        */ 
     240        function getAccountID() 
     241        { 
     242                global $datamap; 
     243                return ($datamap['ID']->db_value)?$datamap['ID']->db_value:''; 
     244        } // end function getAccountID 
     245 
    233246        // Function: updateUserData 
    234247        // Description: in order to do definitive account lookup with a card,  
     
    342355 
    343356        } //end function getUserPPID 
    344  
    345         // Function:    Perform user login functions 
    346         // Description: set whatever cookie &/or session information needed 
    347         //              for an authenticated user. 
    348         // Returns: 
     357         
     358        /* 
     359                Function:       Perform user login functions 
     360                Description:    set whatever cookie &/or session information needed 
     361                                        for an authenticated user. 
     362                Input:          user id 
     363                Output:         true if the authentication succeeded, false otherwise. 
     364        */ 
     365                 
    349366        function doUserLogin( $id ) 
    350367        { 
     
    354371                . "WHERE ID = '". $id . "' AND user_login = '"  
    355372                . $datamap['user_login']->db_value . "'"; 
    356                 $user_pass = $wpdb->get_var( $query ); 
    357                 if (!$user_pass) 
     373                $pass = $wpdb->get_var( $query ); 
     374                if (!$pass) 
    358375                { 
    359376                        // this might be a new user 
    360377                        $user_pass = $datamap['modulusHash']->new_value; 
    361378                } 
    362                 $user_url = ($datamap['user_url']?$datamap['user_url']->new_value:""); 
    363                 pw_userdata::setLoginCookies($datamap['user_login']->db_value, $user_pass, $datamap['display_name']->new_value, $datamap['user_email']->new_value, $user_url); 
     379                $url = ($datamap['user_url']?$datamap['user_url']->new_value:""); 
     380                pw_userdata::setLoginCookies($datamap['user_login']->db_value, $pass, $datamap['display_name']->new_value, $datamap['user_email']->new_value, $url); 
     381 
     382                if (is_user_logged_in()) 
     383                        return TRUE; 
     384                else 
     385                        return FALSE; 
    364386        } //end function doUserLogin 
    365387