Changeset 42
- Timestamp:
- 05/18/07 16:19:22 (2 years ago)
- Files:
-
- trunk/wp-infocard/pw-claimtypes.php (modified) (3 diffs)
- trunk/wp-infocard/pw-config-wp.php (modified) (1 diff)
- trunk/wp-infocard/pw-config.php (modified) (1 diff)
- trunk/wp-infocard/pwlib/login/infocard-clickback.php (modified) (1 diff)
- trunk/wp-infocard/pwlib/login/infocard-submit.php (modified) (1 diff)
- trunk/wp-infocard/pwlib/processing/infocard-post-get-claims.php (modified) (1 diff)
- trunk/wp-infocard/pwlib/utils.pwlib.php (modified) (2 diffs)
- trunk/wp-infocard/wp-infocard.php (modified) (1 diff)
- trunk/wp-infocard/wp/admin.pw.php (modified) (1 diff)
- trunk/wp-infocard/wp/clickback.pw.php (added)
- trunk/wp-infocard/wp/login/class.infocard-login.php (modified) (2 diffs)
- trunk/wp-infocard/wp/userdata.pw.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-infocard/pw-claimtypes.php
r37 r42 31 31 'Email'); 32 32 33 $datamap[' name'] = new pw_mapping(34 ' name',35 ' name',33 $datamap['displayname'] = new pw_mapping( 34 'displayname', 35 'Display Name', 36 36 PW_TABLE_PREFIX . 'users', 37 37 'return $claimslist[\'givenname\']->token_value . \' \' . $claimslist[\'surname\']->token_value;', 38 38 'concatenation of first & last name' ); 39 39 40 $datamap[' email'] = new pw_mapping(41 ' email',42 ' email',43 PW_TABLE_PREFIX . ' users',40 $datamap['user_email'] = new pw_mapping( 41 'user_email', 42 'Email Address', 43 PW_TABLE_PREFIX . '_users', 44 44 'return $claimslist[\'emailaddress\']->token_value;' ); 45 45 … … 47 47 'modulusHash', 48 48 'modulusHash', 49 PW_TABLE_PREFIX . ' infocard_identities',49 PW_TABLE_PREFIX . '_infocard_identities', 50 50 'return $' . 'claimslist[\'modulusHash\']->token_value;' ); 51 51 … … 53 53 'privatepersonalidentifier', 54 54 'ppid', 55 PW_TABLE_PREFIX . ' infocard_identities',55 PW_TABLE_PREFIX . '_infocard_identities', 56 56 'return $' . 'claimslist[\'privatepersonalidentifier\']->token_value;' ); 57 57 58 $datamap[' loginid'] = new pw_mapping(59 ' loginid',60 ' username',61 PW_TABLE_PREFIX . ' users',58 $datamap['user_login'] = new pw_mapping( 59 'user_login', 60 'Login ID', 61 PW_TABLE_PREFIX . '_users', 62 62 'return pw_userdata::getLoginID();', 63 63 'Calls out to the getLoginID function in pw_userdata' ); trunk/wp-infocard/pw-config-wp.php
r36 r42 13 13 14 14 define ('PW_DEBUG_ON', get_settings('pw_debug_on') ); 15 define ('PW_TIMEVALIDATION_ON', true ); 15 16 define ('PW_PATH', ABSPATH . PW_PLUGINPATH); 16 17 define ('PW_IMGPATH', PW_PATH . '/pwlib/images'); trunk/wp-infocard/pw-config.php
r33 r42 4 4 define ('PW_CLICKBACK_LENGTH', 16); 5 5 define ('PW_PLUGINPATH', 'wp-content/plugins/wp-infocard'); 6 define ('PW_VERSION', 'b2'); 7 define ('PW_VERSION_DATE', '17May07'); 8 define ('PW_SELECTORTRIGGER', 'html'); 6 9 7 10 require( dirname(__FILE__) . '/../../../wp-config.php' ); 11 define ('PW_TABLE_PREFIX', $table_prefix); 12 include_once( dirname(__FILE__) . '/pw-claimtypes.php'); // this file uses the TABLE_PREFIX define. 8 13 define ('PW_DEBUG_ON', get_settings('pw_debug_on')); 14 define ('PW_TIMEVALIDATION_ON', false); 9 15 define ('PW_PATH', ABSPATH . PW_PLUGINPATH); 10 16 define ('PW_IMGPATH', PW_PATH . '/pwlib/images'); trunk/wp-infocard/pwlib/login/infocard-clickback.php
r34 r42 13 13 include_once( dirname(__FILE__) . '/../../' . 'pw-config.php'); 14 14 include_once( dirname(__FILE__) . '/../../class.infocard-basic.php'); 15 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . ' utils.pw.php');15 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/utils.pw.php'); 16 16 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/login/class.infocard-login.php'); 17 17 trunk/wp-infocard/pwlib/login/infocard-submit.php
r35 r42 37 37 38 38 pw_utils::printDebug("Plugin: " . PW_PLUGIN . "<br/>\n"); 39 pw_utils::printDebug("Table Prefix: " . PW_TABLE_PREFIX . "<br/>\n"); 39 40 pw_utils::printDebug("User Agent: $userAgent<br/>\n"); 40 41 trunk/wp-infocard/pwlib/processing/infocard-post-get-claims.php
r39 r42 140 140 // Verify that the token is being processed within the time window 141 141 // specified by the Identity Provider (we could further restrict this) 142 142 143 $error_detail = pw_utils::checkTimeAhead( $NotBefore ); 143 144 trunk/wp-infocard/pwlib/utils.pwlib.php
r35 r42 39 39 40 40 function checkTimeAhead ( $NotBefore ){ 41 42 $currentTime = mktime() + PW_VALIDITY_WINDOW; 43 $adjustedTimeText = substr(gmdate("c",$currentTime), 0, 19)."Z"; 44 if ($adjustedTimeText < $NotBefore) 41 if (PW_TIMEVALIDATION_ON) 45 42 { 46 return "Adjusted current time ($adjustedTimeText) is too far ahead of the start of the validity window ($NotBefore)"; 47 } 48 43 $currentTime = mktime() + PW_VALIDITY_WINDOW; 44 $adjustedTimeText = substr(gmdate("c",$currentTime), 0, 19)."Z"; 45 if ($adjustedTimeText < $NotBefore) 46 { 47 return "Adjusted current time ($adjustedTimeText) is too far ahead of the start of the validity window ($NotBefore)"; 48 } 49 } 49 50 return false; 50 51 … … 59 60 60 61 function checkTimeBehind ( $NotOnOrAfter){ 61 62 $currentTime = mktime() - PW_VALIDITY_WINDOW; 63 $adjustedTimeText = substr(gmdate("c",$currentTime), 0, 19)."Z"; 64 if ($adjustedTimeText > $NotOnOrAfter) 62 if (PW_TIMEVALIDATION_ON) 65 63 { 66 return "Adjusted current time ($adjustedTimeText) is after the end of validity window ($NotOnOrAfter)"; 67 } 68 64 $currentTime = mktime() - PW_VALIDITY_WINDOW; 65 $adjustedTimeText = substr(gmdate("c",$currentTime), 0, 19)."Z"; 66 if ($adjustedTimeText > $NotOnOrAfter) 67 { 68 return "Adjusted current time ($adjustedTimeText) is after the end of validity window ($NotOnOrAfter)"; 69 } 70 } 69 71 return false; 70 71 72 } // end function checkTimeBehind 72 73 trunk/wp-infocard/wp-infocard.php
r33 r42 4 4 Plugin URI: http://pamelaproject.com/wp-infocard 5 5 Description: This plugin adds functionality to register and login with "information cards", part of the Identity Metasystem web services framework. Once it is activated, go to the "Options" menu and click on "Information Card Options" to see what to do next. 6 Version: Beta Rev: 226 Version: b2 7 7 Author: K. Cameron, P. Dingle 8 8 Author URI: http://www.pamelaproject.com/wp-infocard/contributors trunk/wp-infocard/wp/admin.pw.php
r33 r42 367 367 ?> 368 368 <code><br/> 369 wp_redirect( get_settings('siteurl')."/wp-content/plugins/wp-infocard/ login/infocard-login.php");369 wp_redirect( get_settings('siteurl')."/wp-content/plugins/wp-infocard/wp/login/infocard-login.php"); 370 370 </code> 371 371 </li> trunk/wp-infocard/wp/login/class.infocard-login.php
r40 r42 123 123 124 124 print PW_SECUREPLUGINURL 125 . "/p rocessing/infocard-post.php";125 . "/pwlib/processing/infocard-post.php"; 126 126 } 127 127 … … 142 142 } 143 143 144 function printIdentitySelectorTrigger() 145 { 146 switch ( PW_SELECTORTRIGGER ) 147 { 148 case 'html': 149 pw_utils::printDebug('Selector Trigger: HTML<br/>'); 150 InfocardLogin::printHTMLSelectorTrigger(); 151 break; 152 case 'xhtml': 153 pw_utils::printDebug('Selector Trigger: XHTML<br/>'); 154 InfocardLogin::printXHTMLSelectorTrigger(); 155 break; 144 156 157 default: 158 pw_utils::printDebug('ERROR: PW_SELECTORTRIGGER set to unknown value - using HTML as fallback'); 159 InfocardLogin::printHTMLSelectorTrigger(); 160 } 161 } // end function printIdentitySelectorTrigger 162 163 //<PARAM Name="issuer" Value= 164 // "https://cards.pamelaproject.com/TokenService/services/Trust"> 165 // "https://cards.pamelaproject.com/TokenService/services/Trust https://www.identityblog.com/sts"> 166 function printHTMLSelectorTrigger() 167 { 168 ?> 169 <OBJECT type="application/x-informationCard" name="xmlToken"> 170 <PARAM Name="tokenType" 171 Value="urn:oasis:names:tc:SAML:1.0:assertion"> 172 <PARAM Name="requiredClaims" 173 Value="<?php InfocardLogin::printRequiredClaims('septemberAgent'); ?>"> 174 <?php 175 InfocardLogin::printOptionalClaims(); 176 ?> 177 </OBJECT> 178 <?php 179 } // end function printHTMLSelectorTrigger 180 181 function printXHTMLSelectorTrigger() 182 { 183 ?> 184 <ic:informationCard id='xmlToken' 185 style='behavior:url(#default#informationCard)' 186 issuer="http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/se lf" 187 issuer="http://identityblog.com/sts" tokenType="urn:oasis:names:tc:SAML:1.0:assertion"> 188 189 <ic:add claimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" optional="false" /> 190 <ic:add claimType= "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" optional="false" /> 191 <ic:add claimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" optional="false" /> 192 <ic:add claimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" optional="false" /> 193 </ic:informationCard> 194 <?php 195 } // end function printXHTMLSelectorTrigger 145 196 } // end class Infocard-Login 146 197 trunk/wp-infocard/wp/userdata.pw.php
r33 r42 120 120 } 121 121 122 InfocardUtils::printDebug( " Email_user_id: $mail_user_id <br/>" );122 pw_utils::printDebug( " Email_user_id: $mail_user_id <br/>" ); 123 123 InfocardUtils::printDebug( " Status: " . $incominguser['status'] . "<br/>" ); 124 124 … … 126 126 } // end function evaluateIncomingRequest 127 127 128 129 function mapTokenData() 130 { 131 global $claimslist, $datamap; 132 pw_utils::printDebug('<br/>Mapped Data:<br/>'); 133 foreach(array_keys($datamap) as $key) 134 { 135 $datamap[$key]->new_value = eval($datamap[$key]->mappingfunction); 136 //pw_utils::printDebug(' Mapping Function: '.$datamap[$key]->mappingfunction.'<br/>'); 137 pw_utils::printDebug(' Name: '.$datamap[$key]->handle.' Value: '.$datamap[$key]->new_value.'<br/>'); 138 } 139 } // end function mapTokenData 128 140 129 141 // Function: updateIdentityData … … 186 198 } // end function updateIdentityData 187 199 200 // Function: getLoginID 201 // Description: always returns existing value if it exists 202 // otherwise for now takes the email address. 203 function getLoginID() 204 { 205 global $datamap; 206 $loginid = $datamap['loginid']->db_value; 207 208 if ($loginid) 209 return $loginid; 210 211 $loginid = $datamap['email']->new_value; 212 return $loginid; 213 } 214 188 215 } // end class pw_userdata 189 216 ?>
