Changeset 161

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

updated multi-card stuff

Files:

Legend:

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

    r158 r161  
    1212define ('PW_USECAPTCHAS', false ); 
    1313define ('PW_DEBUG_ON', get_settings('pw_debug_on')); 
    14 define ('PW_DEBUG_LEVEL', '0'); 
     14define ('PW_DEBUG_LEVEL', '2'); 
    1515define ('PW_SELECTOR_TRIGGER', get_settings('pw_selector_trigger')); 
    1616define ('PW_CUSTOM_DATA', get_settings('pw_custom_data')); 
  • branches/RB-0.91/wp-infocard/wp/admin.pw.php

    r159 r161  
    598598                                        . date( 'd M Y, g:ia T', strtotime($card->lastused)) . "</td><td>" 
    599599                                        . "<a href=''>Verify</a></td><td>" 
    600                                         . "<a href=''>Delete</a></td></tr>\n"; 
    601                                          
    602                                                  
     600                                        . pw_admin::cardDeleteUrl($card->cardhash, $card->cardhandle) . "</td></tr>\n"; 
    603601                        } 
    604602                        //$handle = pw_processing::getCardHandle( $current_user->ID ); 
     
    630628                return PW_SECUREPLUGINURL . '/' . PW_PLUGIN  . '/login/infocard-newcard.php'; 
    631629        } 
     630        /* 
     631                Function:       cardDeleteUrl 
     632                Description:    creates and returns a string containing the url that a user can click on to delete a card 
     633        */ 
     634        function cardDeleteUrl($cardhash,$cardhandle) 
     635        { 
     636                $action_url = PW_SECUREPLUGINURL . '/' . PW_PLUGIN  . '/login/infocard-delete.php'; 
     637                //return '<a href="' . wp_nonce_url($action_url . '?card=' . $cardhash)  
     638                return '<a href="\''  
     639                . '" onclick="confirm('  
     640                . js_escape(sprintf(__("You are about to delete an information card with the handle of '%s'.\n'Cancel' to stop, 'OK' to delete."), $cardhandle))  
     641                //. '\'test\''  
     642                . '\');">' . __('Delete') . '</a> '; 
     643                //return PW_SECUREPLUGINURL . '/' . PW_PLUGIN  . '/login/infocard-newcard.php'; 
     644        } 
    632645} // end class pw_admin 
    633646?> 
  • branches/RB-0.91/wp-infocard/wp/processing.pw.php

    r159 r161  
    5959                                -lastused 
    6060                                -startdate 
     61                                -cardhash 
    6162                Side Effects:   none 
    6263        */ 
     
    6869                        return 'Error! Information Card requested for a user other than the currently authenticated user.'; 
    6970                 
    70                 $query = "SELECT cardhandle, lastused, startdate FROM `" . PW_TABLE_PREFIX 
     71                $query = "SELECT cardhandle, cardhash, lastused, startdate FROM `" . PW_TABLE_PREFIX 
    7172                                . "infocard_identities` WHERE accountid = '" . $ID . "'";        
    7273                $output = $wpdb->get_results( $query, OBJECT ); 
  • branches/RB-0.91/wp-infocard/wp/userdata.pw.php

    r160 r161  
    232232                                break; 
    233233                        default: 
    234                                 return 'MULTIPLES'; 
     234                                /*  
     235                                   $results contains an array of objects with either a matching accountid 
     236                                   or a matching cardhash.   
     237                                        - Must check that the card hash is associated to the right account. 
     238                                        - If there are multiple cards associated, users have to update 
     239                                          their data from their profile page. 
     240                                */ 
     241                                foreach (array_values($results) as $x) 
     242                                {        
     243                                        if (pw_utils::dataCompare( $x->cardhash, $cardhash, 'Card Hash'))  
     244                                        { 
     245                                                $match = TRUE;           
     246                                        } 
     247                                } 
     248                                 
     249                                if (!$match) 
     250                                        return 'MULTIPLECARDS'; 
    235251                } 
    236252