Changeset 35
- Timestamp:
- 05/10/07 13:11:00 (2 years ago)
- Files:
-
- trunk/wp-infocard/pwlib/error/class.error.php (modified) (5 diffs)
- trunk/wp-infocard/pwlib/error/error.php (modified) (3 diffs)
- trunk/wp-infocard/pwlib/login/infocard-submit.php (modified) (4 diffs)
- trunk/wp-infocard/pwlib/utils.pwlib.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-infocard/pwlib/error/class.error.php
r34 r35 1 1 <?php 2 2 //defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 3 include_once( dirname(__FILE__) . ' ../../pw-config.php');3 include_once( dirname(__FILE__) . '/../../pw-config.php'); 4 4 //////////////////// 5 5 // Class InfoCardError … … 19 19 class InfocardError { 20 20 function printErrorName( $error_code, $lang='en-us' ){ 21 $error_file = $lang22 . '/ wp-infocard-errornames.php';23 21 $error_file = PW_PATH . '/pwlib/error/' . $lang 22 . '/infocard-errornames.php'; 23 24 24 if ( file_exists( $error_file ) ) { 25 25 include_once( $error_file ); … … 27 27 print $errorname[$error_code]; 28 28 } else { 29 _e('Unknown Error','wp-infocard');29 pw_utils::screenPrint('Unknown Error: '.$error_code); 30 30 } 31 31 } else { 32 _e('Missing Error','wp-infocard');32 pw_utils::screenPrint('Missing Error'); 33 33 } 34 34 } … … 36 36 function printErrorDescription ( $error_code, $lang='en-us' ) { 37 37 38 $error_file = $lang38 $error_file = PW_PATH . '/pwlib/error/' . $lang 39 39 . '/ErrorDescriptions/wp-infocard-description.' 40 40 . $error_code . '.html'; … … 42 42 include_once( $error_file ); 43 43 } else { 44 _e('You have encountered an error with the code: <b>' 45 . $error_code . '</b>. There is no specific user ' 46 . 'information available for this error.','wp-infocard'); 44 pw_utils::screenPrint('You have encountered an error ' 45 . 'with the code: <b>' . $error_code 46 . '</b>. There is no specific user information ' 47 . 'available for this error.'); 47 48 } 48 49 } trunk/wp-infocard/pwlib/error/error.php
r34 r35 3 3 define( '_VALID_IC', 1 ); 4 4 include_once( dirname(__FILE__) . '/../../pw-config.php'); 5 include_once( 'class.error.php');6 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . ' utils.pw.php');7 5 include_once( dirname(__FILE__) . '/class.error.php'); 6 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/utils.pw.php'); 7 8 8 $code = $_REQUEST['error_code']; 9 9 $details = $_REQUEST['error_details']; … … 11 11 <html xmlns="http://www.w3.org/1999/xhtml"> 12 12 <head> 13 <title><?php pw_utils::printTitle(); ?> › <?php _e('Error', 'wp-infocard'); ?></title>13 <title><?php pw_utils::printTitle(); ?> › <?php pw_utils::screenPrint('Error'); ?></title> 14 14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 15 15 <link rel="stylesheet" href="<?php pw_utils::printCSSlink(); ?>" type="text/css" /> … … 18 18 19 19 <div id="error_background"> 20 <p class="error"><?php _e('An error has occured during Information Card login', 'wp-infocard'); ?></p>21 <p class="error_name"><?php InfocardError::printErrorName( $code ); ?></p>20 <p class="error"><?php pw_utils::screenPrint('An error has occured during Information Card login'); ?></p> 21 <p class="error_name"><?php InfocardError::printErrorName( $code, pw_utils::getDefaultLang() ); ?></p> 22 22 23 23 <div id="error_description"> 24 24 <?php InfocardError::printErrorDescription( $code ); 25 InfocardError::printErrorDetails( $details);25 InfocardError::printErrorDetails( $details ); 26 26 ?> 27 27 </div> 28 28 <div id="error_footer"> 29 29 <ul> 30 <li id="footer"><?php pw_utils::printUserMessageLinks( ); pw_utils::printPamelaProjectLink(); ?></li>30 <li id="footer"><?php pw_utils::printUserMessageLinks( $code ); pw_utils::printPamelaProjectLink(); ?></li> 31 31 </ul> 32 32 </div> trunk/wp-infocard/pwlib/login/infocard-submit.php
r34 r35 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">2 1 <?php 3 2 … … 24 23 define( '_VALID_IC', 1 ); 25 24 include_once( dirname(__FILE__) . '/../../pw-config.php'); 26 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . ' utils.pw.php');25 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/utils.pw.php'); 27 26 include_once( dirname(__FILE__) . '/../../' . PW_PLUGIN . '/login/class.infocard-login.php'); 28 27 29 28 // this only happens in the case of account validation. 30 $clickback = $_ SERVER['QUERY_STRING'];29 $clickback = $_REQUEST['clickbackID']; 31 30 32 $netAgent = InfocardLogin::getNetAgent();33 31 $userAgent = $_SERVER['HTTP_USER_AGENT']; 34 32 $netAgent = 'septemberAgent'; // hard-coded 33 pw_utils::printDebugHeader('INFORMATION CARD LOGIN - DEBUG MODE ON'); 35 34 pw_utils::printDebug("This site is under maintenance - anything is possible<br/>" 36 35 . "<br/>This page contains the hidden form object that specifies required and optional claims, and invokes the Identity Selector.<br/>" … … 38 37 39 38 pw_utils::printDebug("Plugin: " . PW_PLUGIN . "<br/>\n"); 40 pw_utils::printDebug("Net Agent: $netAgent<br/>\n");41 39 pw_utils::printDebug("User Agent: $userAgent<br/>\n"); 42 40 41 pw_utils::showClaimList($claimslist); 42 pw_utils::showDataMap($datamap); 43 43 ?> 44 <html xmlns="http://www.w3.org/1999/xhtml">45 <head>46 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />47 </head>48 <body>49 44 <form name="ctl00" id="ctl00" method="post" action="<?php InfocardLogin::printICPostDestination(); ?>"> 50 <OBJECT type="application/x-informationCard" name="xmlToken"> 51 <PARAM Name="tokenType"52 Value="urn:oasis:names:tc:SAML:1.0:assertion"> 45 <?php 46 InfocardLogin::printIdentitySelectorTrigger(); 47 InfocardLogin::printHiddenClickback($clickback); 53 48 54 <PARAM Name="requiredClaims"55 Value="<?php InfocardLogin::printRequiredClaims($netAgent); ?>">56 <?php57 InfocardLogin::printOptionalClaims();58 ?>59 </OBJECT>60 <?php61 InfocardLogin::printHiddenClickback($clickback);62 49 if (PW_DEBUG_ON) 63 50 // replace auto-submit with manual submit in debug mode. … … 88 75 } 89 76 ?> 90 </body>91 </html>trunk/wp-infocard/pwlib/utils.pwlib.php
r34 r35 78 78 if (PW_DEBUG_ON) { 79 79 80 InfocardUtils::printDebug( $title . " (length: " .strlen($binary) . " octents) <br/>"); 80 if (PW_SHOW_BINARY === false) 81 return strlen($binary) . " characters (to see the binary enable PW_SHOW_BINARY)"; 82 83 84 85 pw_utils::printDebug( $title . " (length: " .strlen($binary) . " octents) <br/>"); 81 86 $ascii = strtoupper(bin2hex($binary)); 82 87 $ascii_length = strlen($ascii); … … 86 91 $binary_offset = 0; 87 92 // initial value of printbuf is 8 zeros 88 $printbuf .= sprintf(" <b>%08d</b> ", $binary_offset);93 $printbuf = sprintf(" <b>%08d</b> ", $binary_offset); 89 94 90 95 while ($offset < $ascii_length){ … … 101 106 // so print off the current line & start a new one 102 107 $printbuf = $printbuf."<br>"; 103 InfocardUtils::printDebug( $printbuf );108 pw_utils::printDebug( $printbuf ); 104 109 $binary_offset += 32; 105 110 $printbuf = sprintf(" <b>%08d</b> ", $binary_offset); … … 109 114 110 115 if ($linelen > 0) 111 InfocardUtils::printDebug( $printbuf . "<br/>");116 pw_utils::printDebug( $printbuf . "<br/>"); 112 117 } 113 118 … … 128 133 if (strcmp($db_item, $token_item) == 0) 129 134 { 130 Infocardutils::printDebug(" $item_name: matches ($db_item)<br/>");135 pw_utils::printDebug(" $item_name: matches ($db_item)<br/>"); 131 136 return (TRUE); 132 137 } 133 138 else 134 139 { 135 Infocardutils::printDebug(" $item_name: DB: $db_item TOKEN: $token_item<br/>");140 pw_utils::printDebug(" $item_name: DB: $db_item TOKEN: $token_item<br/>"); 136 141 return (FALSE); 137 142 }
