Changeset 158

Show
Ignore:
Timestamp:
03/13/08 16:00:41 (10 months ago)
Author:
pdingle
Message:

more progress on multiple cards per account

Files:

Legend:

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

    r150 r158  
    88define ('PW_PLUGINPATH', '/wp-content/plugins/wp-infocard'); 
    99define ('PW_VERSION', 'v0.91'); 
    10 define ('PW_VERSION_DATE', '12/27/07'); 
     10define ('PW_VERSION_DATE', '03/09/08'); 
    1111define ('PW_DB_VERSION', 'DB v3'); 
    1212define ('PW_USECAPTCHAS', false ); 
  • branches/RB-0.91/wp-infocard/wp/login/infocard-newcard.php

    r144 r158  
    66include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/clickback.pw.php'); 
    77include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/login/login.pw.php'); 
    8  
    9 $user = pw_utils::getUserInfo(); 
     8$username = pw_utils::authenticatedUsername();  
    109 
    1110?> 
     
    3635<body> 
    3736<?php 
    38         if ((!$user['authenticated']) || ($user['ID'] === 'error')
     37        if (!$username
    3938                pw_utils::errorPageRedirect('DENIEDCARD'); 
    4039?> 
     
    4645                        pw_utils::screenPrint( pw_utils::getTitle()  
    4746                                .  ': New Information Card for: ' 
    48                                 .  $user['name'] );  
     47                                .  $username );  
    4948?> 
    5049                </h3> 
     
    7069        </div> 
    7170<?php 
    72         if ( $user['authenticated']
     71        if ( $username
    7372        { 
    7473?> 
     
    7776        </div> 
    7877        <div id="pw_login"> 
    79                 <form name="ctl00" id="ctl00" method="post" action="<?php pw_login::printICPostDestination(); ?>"> 
     78                <form name="ctl00" id="ctl00" method="post" action="<?php pw_login::printICAuthenticatedPostDestination(); ?>"> 
    8079<?php 
    8180                        $trigger_debug = pw_login::printIdentitySelectorTrigger(); 
    82                         $cb_debug = pw_clickback::printHiddenClickback($clickback); 
     81                        //$cb_debug = pw_clickback::printHiddenClickback($clickback); 
    8382?> 
    8483                        <button id="pw_login_submit" type="submit"><?php pw_utils::screenPrint('Login or Register Now!'); ?></button> 
  • branches/RB-0.91/wp-infocard/wp/login/login.pw.php

    r102 r158  
    5252        { 
    5353                // could put a fancy detection for SSL here 
    54  
    5554                print PW_SECUREPLUGINURL    
    5655                        . "/pwlib/processing/infocard-post.php"; 
     
    6665        }  
    6766         
     67        function printICAuthenticatedPostDestination() 
     68        { 
     69                // could put a fancy detection for SSL here 
     70                print PW_SECUREPLUGINURL    
     71                        . "/pwlib/processing/infocard-authn.php"; 
     72        } 
     73 
    6874        function printLoginAgainLink()  
    6975        { 
  • branches/RB-0.91/wp-infocard/wp/processing.pw.php

    r149 r158  
    101101                return $cardhash; 
    102102        } //end function getDBv1CardHash 
    103          
     103 
     104        /* 
     105                Function:       getCardInfo 
     106                Description:    get Card info for a user 
     107                Input:          id:  user id 
     108                Output:         array of objects containing card data 
     109                Side-Effects:   none 
     110        */ 
     111        function getCardInfo( $id )      
     112        { 
     113                $results = array(); 
     114                if (!$id || is_int($id)) 
     115                        return $results; 
     116 
     117                global $wpdb; 
     118                $query = "SELECT * FROM wp_infocard_identities WHERE " 
     119                        . "accountid = '(int)$id'"; 
     120 
     121                $results = $wpdb->get_results( $query, OBJECT ); 
     122                return $results; 
     123        } // end function getCardInfo 
    104124} // end class pw_processing 
    105125?> 
  • branches/RB-0.91/wp-infocard/wp/utils.pw.php

    r144 r158  
    315315                return  $results; 
    316316        } 
     317        /* 
     318                Function:       authenticatedUsername 
     319                Description:    returns the username if an active sesion exists 
     320                Input:          none 
     321                Output:         user name if an active session exists 
     322                                empty string otherwise 
     323                Side-Effect:    none 
     324        */ 
     325        function authenticatedUsername() 
     326        { 
     327                $user = pw_utils::getUserInfo();         
     328                if ((!$user['authenticated']) || ($user['ID'] === 'error')) 
     329                        return ''; 
     330                else 
     331                        return $user['name']; 
     332        } 
    317333 
    318334} // end class pw_utils