Changeset 149

Show
Ignore:
Timestamp:
01/01/08 17:40:14 (1 year ago)
Author:
pdingle
Message:

added stub for multiple cards in profile page, added some licensing headers, added new functions: pw_processing::getCurrentUserCards, pw_admin::getCurrentUserCardProfile

Files:

Legend:

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

    r144 r149  
    298298        function pw_printUserCardStatus() 
    299299        { 
     300                pw_utils::screenPrint(pw_admin::getCurrentUserCardProfile()); 
     301                return; 
    300302                include_once('userdata.pw.php'); 
    301303                global $current_user; 
     
    635637                return $output . "ERROR:  non-standard database state!"; 
    636638        } 
     639 
     640        /* 
     641                Function:       getCurrentUserCardProfile 
     642                Description:    Returns a string with code for maintaining 
     643                                the information cards of a current user. 
     644                Input:          none 
     645                Output:         String containing code for profile page 
     646                Side-Effects:   none     
     647        */ 
     648        function getCurrentUserCardProfile() 
     649        { 
     650                include_once('userdata.pw.php'); 
     651                global $current_user; 
     652 
     653                $output = "<h4>Information Cards</h4>\n"; 
     654                $output .= "<table border='1'>\n"; 
     655 
     656                //$cardcount = pw_processing::getUserCardCount( $current_user->ID ); 
     657                $cards = pw_processing::getCurrentUserCards( $current_user->ID ); 
     658                if (is_array($cards)) 
     659                { 
     660                        foreach ($cards as $card) 
     661                        { 
     662                                $output .= "<tr><td><img src='" . PW_IMGURL . "/infocard_60x42.png'/>";  
     663                                $output .= "</td><td>" . $card->cardhandle 
     664                                        . "</td><td>Last used: "  
     665                                        . $card->lastused . "</td><td>" 
     666                                        . "<a href=''>Verify</a></td><td>" 
     667                                        . "<a href=''>Delete</a></td></tr>\n"; 
     668                                         
     669                                                 
     670                        } 
     671                        //$handle = pw_processing::getCardHandle( $current_user->ID ); 
     672                } 
     673                else 
     674                { 
     675                        $output .=  "<tr><td>" . $cards . "</td></tr>"; 
     676                } 
     677                $output .= "<tr><td><label for='Information Card Info' style='display: inline'><img src=\"" 
     678                . PW_IMGURL . '/infocard_60x42_disabled.png"' 
     679                . " style='vertical-align: middle'/> &nbsp;" 
     680                . "</td><td colspan='4'><a href=''>" 
     681                . "Attach a new Information Card" 
     682                . "</a></td></tr>"; 
     683 
     684                $output .= "\n</table>"; 
     685                return $output; 
     686        } 
    637687} // end class pw_admin 
    638688?> 
  • branches/RB-0.91/wp-infocard/wp/audit.pw.php

    r111 r149  
    11<?php 
     2// This file is part of Pamela Project. 
     3// 
     4// Copyright (C) 2007 by various authors (see CONTRIBUTORS file) 
     5// This file is free software, distributed under the new BSD License (see LICENSE file). 
     6// 
     7// audit.pw.php 
     8// 
     9 
    210        //defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 
    311 
  • branches/RB-0.91/wp-infocard/wp/customdata.pw.php

    r102 r149  
    11<?php 
     2// This file is part of Pamela Project. 
     3// 
     4// Copyright (C) 2007 by various authors (see CONTRIBUTORS file) 
     5// This file is free software, distributed under the new BSD License (see LICENSE file). 
     6// 
     7// customdata.pw.php 
     8// 
    29//defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 
    310include_once( dirname(__FILE__) . '/../pw-config.php'); 
  • branches/RB-0.91/wp-infocard/wp/db_upgrade.pw.php

    r144 r149  
    11<?php 
     2// This file is part of Pamela Project. 
     3// 
     4// Copyright (C) 2007 by various authors (see CONTRIBUTORS file) 
     5// This file is free software, distributed under the new BSD License (see LICENSE file). 
     6// 
     7// db_upgrade.pw.php 
     8// 
     9 
    210        //defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 
    311 
  • branches/RB-0.91/wp-infocard/wp/processing.pw.php

    r144 r149  
    4747        } // end function showProcessingSummary 
    4848 
     49        /* 
     50                Function:       getCurrentUserCards 
     51                Description:    returns an array of any card information 
     52                                associated with the current user 
     53                Input:          ID of the current user (verified inside too) 
     54                Output:         Array of objects containing: 
     55                                -cardhandle 
     56                                -lastused 
     57                                -startdate 
     58                Side Effects:   none 
     59        */ 
     60        function getCurrentUserCards( $ID ) 
     61        { 
     62                global $current_user, $wpdb; 
     63                $output = (array)null; 
     64                if ($current_user->ID !== $ID) 
     65                        return 'Error! Information Card requested for a user other than the currently authenticated user.'; 
     66                 
     67                $query = "SELECT cardhandle, lastused, startdate FROM `" . PW_TABLE_PREFIX 
     68                                . "infocard_identities` WHERE accountid = '" . $ID . "'";        
     69                $output = $wpdb->get_results( $query, OBJECT ); 
     70                return $output; 
     71                 
     72        } //end function getCurrentUserCards 
     73 
     74 
    4975        /* 
    5076                Function:       getDBv1CardHash