Changeset 159

Show
Ignore:
Timestamp:
03/14/08 08:34:33 (10 months ago)
Author:
pdingle
Message:

added exact trust list

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/RB-0.91/wp-infocard/wp/admin.pw.php

    r155 r159  
    611611                . PW_IMGURL . '/infocard_30x21_disabled.png"' 
    612612                . " style='vertical-align: middle'/>  " 
    613                 . "</td><td colspan='5'><a href=''>" 
     613                . "</td><td colspan='5'><a href='" . pw_admin::cardAssociationUrl() . "'>" 
    614614                . "Attach a new Information Card" 
    615615                . "</a></td></tr>"; 
     
    618618                return $output; 
    619619        } 
     620 
     621        /* 
     622                Function:       cardAssociationUrl 
     623                Description:    prints out the URL to associate a card to an authenticated account 
     624                Input:          none 
     625                Output:         URL 
     626                Side-Effects:   none 
     627        */ 
     628        function cardAssociationUrl() 
     629        { 
     630                return PW_SECUREPLUGINURL . '/' . PW_PLUGIN  . '/login/infocard-newcard.php'; 
     631        } 
    620632} // end class pw_admin 
    621633?> 
  • branches/RB-0.91/wp-infocard/wp/processing.pw.php

    r158 r159  
    2323        { 
    2424                pw_utils::printDebugHeader('Final Analysis'); 
    25                 pw_utils::printDebug("&nbsp;User: ".$datamap['display_name']->new_value."<br />"); 
    26                 pw_utils::printDebug("&nbsp;Login ID: ".$datamap['user_login']->new_value."<br />"); 
    27                 pw_utils::printDebug("&nbsp;Account ID: ".$datamap['ID']->new_value."<br />"); 
     25                if ($datamap) 
     26                { 
     27                        pw_utils::printDebug("&nbsp;User: ".$datamap['display_name']->new_value."<br />"); 
     28                        pw_utils::printDebug("&nbsp;Login ID: ".$datamap['user_login']->new_value."<br />"); 
     29                        pw_utils::printDebug("&nbsp;Account ID: ".$datamap['ID']->new_value."<br />"); 
     30                } 
    2831                pw_utils::printDebug("&nbsp;User Status: ".$status." <br/>"); 
    2932 
     
    122125                return $results; 
    123126        } // end function getCardInfo 
     127 
     128        /* 
     129                Function:       lookupCardHash 
     130                Description:    attempts to retrieve a card hash record from the identities table 
     131                Input:          cardhash:   the hash to look up  
     132                Output:         Object containing Card Hash, if present (null otherwise) 
     133                Side-Effects:   none 
     134        */ 
     135        function lookupCardHash($cardhash) 
     136        { 
     137                if (!$cardhash)  
     138                        return NULL; 
     139                 
     140                global $wpdb; 
     141                $query = "SELECT * FROM wp_infocard_identities WHERE " 
     142                        . "cardhash = '$cardhash'"; 
     143 
     144                $results = $wpdb->get_results( $query, OBJECT ); 
     145                return $results; 
     146        } // end function lookupCardHash 
     147 
     148        /* 
     149                Function:       addIdentityRecord 
     150                Description:    updates the identity table with a new record 
     151                Input:          cardhash, cardhandle, accountid 
     152                Output:         FALSE on error, TRUE on success  
     153                Side-Effect:    updates infocard_identities table 
     154        */       
     155        function addIdentityRecord($cardhash,$cardhandle,$accountid) 
     156        { 
     157                if (!$cardhash || !$cardhandle || !$accountid) 
     158                        return FALSE; 
     159                $today = date('c'); 
     160                global $wpdb; 
     161                $query = "INSERT INTO `" . PW_PLUGIN . "_infocard_identities` " 
     162                . "( cardhash, cardhandle, accountid, startdate, lastused ) VALUES " 
     163                . "( '$cardhash', '$cardhandle', '$accountid', '$today', '$today' )"; 
     164 
     165                if ($wpdb->query( $query )) 
     166                        return TRUE; 
     167                else 
     168                        return FALSE;  
     169        } 
    124170} // end class pw_processing 
    125171?> 
  • branches/RB-0.91/wp-infocard/wp/userdata.pw.php

    r156 r159  
    188188                $cardhandle =  $datamap['cardhandle']->new_value; 
    189189                $today = date('c'); 
    190  
    191                 //$query = "SELECT * FROM wp_infocard_identities WHERE (ppid = '$ppid' " 
    192                 //. "AND modulusHash = '$modulus') OR (accountid = '$acct')"; 
    193190 
    194191                $query = "SELECT * FROM wp_infocard_identities WHERE cardHash = '$cardhash' " 
     
    233230                                        pw_utils::printDebug( "&nbsp; Updated card 'last used' date<br/>" ); 
    234231                                } 
    235                         break; 
    236  
    237232                        default: 
    238                                 // should never happen 
    239                                 return 'MULTIPLECARDERROR'; 
     233                                return 'MULTIPLES'; 
    240234                } 
    241235