Changeset 33
- Timestamp:
- 04/14/07 17:18:30 (2 years ago)
- Files:
-
- trunk/wp-infocard/class.infocard-basic.php (modified) (2 diffs)
- trunk/wp-infocard/processing/class.infocard-processing.php (modified) (9 diffs)
- trunk/wp-infocard/processing/infocard-post.php (modified) (13 diffs)
- trunk/wp-infocard/pw-config.php (modified) (1 diff)
- trunk/wp-infocard/site-messages/infocard-help.php (modified) (2 diffs)
- trunk/wp-infocard/site-messages/infocard-usermessage.php (modified) (2 diffs)
- trunk/wp-infocard/wp-infocard.php (modified) (1 diff)
- trunk/wp-infocard/wp/admin.pw.php (modified) (5 diffs)
- trunk/wp-infocard/wp/audit.pw.php (modified) (1 diff)
- trunk/wp-infocard/wp/data.pw.php (modified) (4 diffs)
- trunk/wp-infocard/wp/utils.pw.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-infocard/class.infocard-basic.php
r30 r33 6 6 class InfocardGeneral { 7 7 8 function printCSSlink(){9 //print "http://wordpress/ic-admin/infocard.css";10 print PW_PLUGINURL . "/infocard.css";11 }12 13 function printTitle(){14 if ( function_exists('get_settings') ){15 print get_settings('blogname');16 } else {17 _e('Blog Login', wp-infocard);18 }19 }20 21 function printHomeLink(){22 // This is where the "Back to blog" link goes.23 print get_settings('siteurl');24 }25 26 function printPamelaProjectLink() {27 print "<a href='http://pamelaproject.com' title='" ;28 _e('Learn about Information Cards', 'wp=infocard');29 print "'>« ";30 _e('Learn more at PamelaProject.com', 'wp-infocard');31 print "</a>";32 }33 34 8 function errorPageRedirect( $error_code='', $error_details = '') { 35 $redirect = PW_PLUGINURL . "/ error/error.php?error_code=" . $error_code;9 $redirect = PW_PLUGINURL . "/pwlib/error/error.php?error_code=" . $error_code; 36 10 if ($error_details) 37 11 { … … 45 19 <html xmlns="http://www.w3.org/1999/xhtml"> 46 20 <script> 47 if(confirm("Do you want to be redirected to the Error Page?")) 48 { 21 <?php 22 if (PW_DEBUG_ON) 23 { 24 echo "if(confirm('Do you want to be redirected to the Error Page?'))"; 25 } 26 ?> 49 27 location="<?php print($redirect); ?>"; 50 } 51 </script> 28 </script> 52 29 53 30 </html> trunk/wp-infocard/processing/class.infocard-processing.php
r32 r33 1 1 <?php 2 2 //defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 3 require_once( dirname(__FILE__) . '/../class.infocard-basic.php' );4 3 include_once("infocard-print-binary.php"); 5 4 require_once( ABSPATH . WPINC . '/registration-functions.php'); … … 23 22 // Message, you would customize this function. 24 23 25 $clickbackUrl = PW_PLUGINURL . "/ login/infocard-clickback.php?" . $clickbackID;24 $clickbackUrl = PW_PLUGINURL . "/pwlib/login/infocard-clickback.php?" . $clickbackID; 26 25 27 26 $message = sprintf(__('Please complete your registration at %s by opening the link below.'), get_settings('blogname')) . "\r\n\r\n"; … … 30 29 wp_mail($user_email, sprintf(__('[%s] New User InfoCard Registration'), get_settings('blogname')), $message); 31 30 32 InfocardUtils::printDebug( "<br/><br/>Account Validation is required.<br/>"31 pw_utils::printDebug( "<br/><br/>Account Validation is required.<br/>" 33 32 . "Emailing Registration info to: $user_email<br/>" 34 33 . "User would be redirected to: <a href=\"$clickbackUrl\">$clickbackUrl</a><br/>" … … 56 55 if (PW_DEBUG_ON) 57 56 { 58 InfocardUtils::printDebug("<br/>Action: Compare & Update User Data<br/>");57 pw_utils::printDebug("<br/>Action: Compare & Update User Data<br/>"); 59 58 60 59 $sql = "SELECT a.*, b.meta_value as first_name, " … … 72 71 if (!user_row) 73 72 { 74 InfocardUtils::printDebug("Error getting original user information from database <br/>");73 pw_utils::printDebug("Error getting original user information from database <br/>"); 75 74 } 76 75 else … … 104 103 $update_result = $wpdb->query( $sql ); 105 104 106 InfocardUtils::printDebug( 'Updated LoginID<br/>');105 pw_utils::printDebug( 'Updated LoginID<br/>'); 107 106 } 108 InfocardUtils::printDebug ( '<br/>Database Updated<br/>' );107 pw_utils::printDebug ( '<br/>Database Updated<br/>' ); 109 108 } // end function updateUserData 110 109 … … 134 133 $clickback_salt = pw_admin::getOption('pw_clickback_salt'); 135 134 136 InfocardUtils::printDebug("Clickback: Challenge Created. <br/>"135 pw_utils::printDebug("Clickback: Challenge Created. <br/>" 137 136 . "Clickback: salted data is " . (($data)?$data:"empty") . "<br/>" 138 137 . "Clickback: length is " . PW_CLICKBACK_LENGTH … … 143 142 $chopped = substr($data, 0, PW_CLICKBACK_LENGTH); 144 143 145 InfocardUtils::printDebug("Clickback: Hash of the salted challenge data: $data<br/>"144 pw_utils::printDebug("Clickback: Hash of the salted challenge data: $data<br/>" 146 145 . "Clickback: Chopped challenge data: $chopped <br/>"); 147 146 … … 152 151 function verifyChallenge( $currentChallenge, $previousChallenge ) { 153 152 154 InfocardUtils::printDebug("<br/>Action: verifyClickbackChallenge. <br/>"153 pw_utils::printDebug("<br/>Action: verifyClickbackChallenge. <br/>" 155 154 . "Binary Clickback Details:<br/>"); 156 155 157 InfocardUtils::printDebug(" Previous Challenge: " . $previousChallenge . "X<br/>"156 pw_utils::printDebug(" Previous Challenge: " . $previousChallenge . "X<br/>" 158 157 . " Current Challenge: " . $currentChallenge . "X<br/>"); 159 158 // printBinary only prints if PW_DEBUG_ON is on. Otherwise it just falls through. 160 InfocardUtils::printBinary("computed challenge: ", $currentChallenge);161 InfocardUtils::printBinary("previous challenge:", $previousChallenge);159 pw_utils::printBinary("computed challenge: ", $currentChallenge); 160 pw_utils::printBinary("previous challenge:", $previousChallenge); 162 161 163 162 if ($currentChallenge == $previousChallenge) { 164 InfocardUtils::printDebug(" verifyClickback: challenges match<br/>");163 pw_utils::printDebug(" verifyClickback: challenges match<br/>"); 165 164 return (TRUE); 166 165 } else { 167 InfocardUtils::printDebug(" verifyClickback: challenges DO NOT match<br/>");166 pw_utils::printDebug(" verifyClickback: challenges DO NOT match<br/>"); 168 167 return (FALSE); 169 168 } trunk/wp-infocard/processing/infocard-post.php
r32 r33 40 40 $debug_statement .= "PHP Version: " . phpversion() . "<br/>"; 41 41 $debug_statement .= "PHP Include Path: " . ini_get('include_path') . "<br/>"; 42 InfocardUtils::printDebug($debug_statement);42 pw_utils::printDebug($debug_statement); 43 43 } 44 44 … … 59 59 } 60 60 61 InfocardUtils::printDebug("<br/>Action: decryptToken <br>");61 pw_utils::printDebug("<br/>Action: decryptToken <br>"); 62 62 63 63 $error=infocard_post_decrypt($tokenContent, $token); … … 68 68 } 69 69 70 InfocardUtils::printDebug( "<br/>Action: getTokenClaims <br>");70 pw_utils::printDebug( "<br/>Action: getTokenClaims <br>"); 71 71 72 72 if ($error = infocard_post_get_claims($token, $claims)) … … 80 80 $debug_statement .= " Claim: $key - $value <br>"; 81 81 } 82 InfocardUtils::printDebug( $debug_statement );82 pw_utils::printDebug( $debug_statement ); 83 83 } 84 84 … … 128 128 if (!user_row) 129 129 { 130 InfocardUtils::printDebug("Error with new email request getting original user information");130 pw_utils::printDebug("Error with new email request getting original user information"); 131 131 $error = 'BADDBREQUEST'; 132 132 } … … 149 149 if (!$user_ID) 150 150 { 151 InfocardUtils::printDebug('Problem Creating New User');151 pw_utils::printDebug('Problem Creating New User'); 152 152 $error = 'USERNOTCREATED'; 153 153 } 154 154 else 155 155 { 156 InfocardUtils::printDebug("inserted record with id: $user_ID<br>");156 pw_utils::printDebug("inserted record with id: $user_ID<br>"); 157 157 } 158 158 … … 175 175 { 176 176 177 InfocardUtils::printDebug("<br/>Action: check Account Validation<br/>");177 pw_utils::printDebug("<br/>Action: check Account Validation<br/>"); 178 178 179 179 $clickbackUrl = InfocardClickback::createChallenge($challengeContent); … … 181 181 { 182 182 183 InfocardUtils::printDebug(" Clickback posted<br/>");183 pw_utils::printDebug(" Clickback posted<br/>"); 184 184 $previousChallenge = trim($_POST["clickback"]); 185 185 … … 187 187 { 188 188 $accountValidationRequired = FALSE; 189 InfocardUtils::printDebug(" Account validation has succeeded <br>");189 pw_utils::printDebug(" Account validation has succeeded <br>"); 190 190 $relocationUrl = PW_SITEMESGURL . '?clickback-success'; 191 191 $incominguser['status'] = 'clickback-success'; … … 215 215 if (strlen($error) > 0) 216 216 { 217 InfocardUtils::printDebug("Unexpected Error: $error <br/>");217 pw_utils::printDebug("Unexpected Error: $error <br/>"); 218 218 $relocationUrl = "error"; 219 219 } … … 245 245 } 246 246 247 InfocardUtils::printDebug($comments_to_date);247 pw_utils::printDebug($comments_to_date); 248 248 249 249 if (array_key_exists("clickback", $_POST)){ … … 266 266 if ($relocationUrl == "error") 267 267 { 268 InfocardGeneral::errorPageRedirect($error);268 pw_utils::errorPageRedirect($error); 269 269 } 270 270 else … … 280 280 281 281 $debug_statement .= "Final redirect: <a href=\"$relocationUrl\">$relocationUrl</a> <br/>"; 282 InfocardUtils::printDebug( $debug_statement );282 pw_utils::printDebug( $debug_statement ); 283 283 284 284 } trunk/wp-infocard/pw-config.php
r32 r33 3 3 define ('PW_VALIDITY_WINDOW', 300); 4 4 define ('PW_CLICKBACK_LENGTH', 16); 5 define ('PW_DEBUG_ON', true);6 5 define ('PW_PLUGINPATH', 'wp-content/plugins/wp-infocard'); 7 6 8 7 require( dirname(__FILE__) . '/../../../wp-config.php' ); 8 define ('PW_DEBUG_ON', get_settings('pw_debug_on')); 9 9 define ('PW_PATH', ABSPATH . PW_PLUGINPATH); 10 define ('PW_IMGPATH', PW_PATH . '/ images');10 define ('PW_IMGPATH', PW_PATH . '/pwlib/images'); 11 11 define ('PW_SITEMESGPATH', PW_PATH . '/site-messages'); 12 define ('PW_IMGURL', get_settings('siteurl') . '/wp-content/plugins/wp-infocard/images');13 12 define ('PW_PLUGINURL', get_settings('siteurl') . '/' . PW_PLUGINPATH ); 13 define ('PW_IMGURL', PW_PLUGINURL . '/pwlib/images'); 14 14 define ('PW_SECUREPLUGINURL', get_settings('pw_securesiteurl') . '/' . PW_PLUGINPATH ); 15 15 define ('PW_SITEMESGURL', PW_PLUGINURL . '/site-messages/infocard-usermessage.php'); trunk/wp-infocard/site-messages/infocard-help.php
r24 r33 1 1 <?php 2 2 $messageType = $_SERVER['QUERY_STRING']; 3 include_once( dirname(__FILE__) . '/../class.infocard-basic.php'); 3 include_once( dirname(__FILE__) . '/../' . '/pw-config.php'); 4 include_once( dirname(__FILE__) . '/../' . PW_PLUGIN . '/utils.pw.php'); 4 5 //nocache_headers(); 5 6 ?> … … 7 8 <html xmlns="http://www.w3.org/1999/xhtml"> 8 9 <head> 9 <title><?php _e('User Help') ?></title>10 <title><?php pw_utils::screenPrint('User Help') ?></title> 10 11 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> 11 <link rel="stylesheet" href="<?php InfocardGeneral::printCSSlink(); ?>" type="text/css" />12 <link rel="stylesheet" href="<?php pw_utils::printCSSlink(); ?>" type="text/css" /> 12 13 </head> 13 14 <body> 14 15 15 16 <div id="help"> 16 <?php InfocardGeneral::printUserMessageText( $messageType ); ?>17 <?php pw_utils::printUserMessageText( $messageType ); ?> 17 18 <p class="submit"> 18 <?php InfocardGeneral::printUserMessageLinks( $messageType ); ?>19 <?php pw_utils::printUserMessageLinks( $messageType ); ?> 19 20 </p> 20 21 </div> trunk/wp-infocard/site-messages/infocard-usermessage.php
r24 r33 2 2 $messageType = $_SERVER['QUERY_STRING']; 3 3 4 include_once( dirname(__FILE__) . '/../class.infocard-basic.php'); 4 include_once( dirname(__FILE__) . '/../' . '/pw-config.php'); 5 include_once( dirname(__FILE__) . '/../' . PW_PLUGIN . '/utils.pw.php'); 5 6 //nocache_headers(); 6 7 ?> … … 8 9 <html xmlns="http://www.w3.org/1999/xhtml"> 9 10 <head> 10 <title><?php _e('User Message')?></title>11 <title><?php pw_utils::screenPrint('User Message'); ?></title> 11 12 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> 12 <link rel="stylesheet" href="<?php InfocardGeneral::printCSSlink(); ?>" type="text/css" />13 <link rel="stylesheet" href="<?php pw_utils::printCSSlink(); ?>" type="text/css" /> 13 14 </head> 14 15 <body> 15 16 16 17 <div id="login"> 17 <?php InfocardGeneral::printUserMessageText( $messageType ); ?> 18 19 20 <?php pw_utils::printUserMessageText( $messageType ); ?> 18 21 <p class="submit"> 19 <?php InfocardGeneral::printUserMessageLinks( $messageType ); ?>22 <?php pw_utils::printUserMessageLinks( $messageType ); ?> 20 23 </p> 21 24 </div> trunk/wp-infocard/wp-infocard.php
r30 r33 30 30 31 31 32 function infocard_admin_menu() 33 { 34 if(function_exists('add_options_page')) 35 {//($page_title, $menu_title, $access_level, $file, $function = '') 36 add_options_page('Information Card Options','Information Card Options', 'manage_options', basename(__FILE__),'infocard_options' ); 37 } 38 } 32 function infocard_admin_menu() 33 { 34 if(function_exists('add_options_page')) 35 { 36 //($page_title, $menu_title, $access_level, $file, $function = '') 37 add_options_page('Information Card Options','Information Card Options', 'manage_options', basename(__FILE__),'infocard_options' ); 38 } 39 } // end function infocard_admin_menu 39 40 40 add_action('admin_menu', 'infocard_admin_menu'); 41 add_action('admin_menu', 'infocard_admin_menu'); 42 add_action( 'delete_user', array( &$wpInfocard, 'pw_deleteUserCards' ) ); 41 43 42 43 function infocard_options() { 44 // Content shown in the Options page is constructed here 45 $ic_opener = $new_opener = get_option('pw_infocard_opener'); 46 $ic_key = $new_key = get_option('pw_infocard_key'); 47 $secureurl = $new_secureurl = get_option('pw_securesiteurl'); 48 $ic_secret = get_option('secret'); 49 50 if ( $_POST["infocard_admin_submit"] ){ 51 //update the db with submitted information 52 $new_opener = $_POST["infocard_opener"]; 53 $new_key = $_POST["infocard_key"]; 54 $new_secureurl = $_POST["securesiteurl"]; 55 } 56 if ( $ic_opener != $new_opener ){ 57 update_option('pw_infocard_opener', $new_opener); 58 } 59 60 if ( $ic_key != $new_key ){ 61 update_option('pw_infocard_key', $new_key); 62 } 63 64 if ( $secureurl != $new_secureurl ){ 65 update_option('pw_securesiteurl', $new_secureurl ); 66 } 67 68 69 $openssl_loaded = extension_loaded("openssl"); 70 $mcrypt_loaded = extension_loaded("mcrypt"); 71 if ($openssl_loaded) { 72 $key_works = pw_admin::verifyGivenCerts(); 73 } 74 ?> 75 <div class="wrap"> 76 <form action="" method="post"> 77 <h2><?php _e('Information Card Login', 'wp-infocard'); ?></h2> 78 <table border="0"><tr><th valign="bottom" colspan="2" align="left"> 79 <?php _e('The plugin will not work until this checklist is positive:', 'wp-infocard'); ?></th></tr> 80 <tr><td> 81 <?php _e('PHP Version 5 or greater installed', 'wp-infocard'); ?> 82 </td><td valign="bottom"> 83 <img src="<?php print pw_admin::checklist_icon(version_compare(phpversion(), '5.0', '>=')); ?>"/> 84 85 <a href="help/help.php?topic=php"><?php _e('More Information', 'wp-infocard');?></a> 86 </td></tr> 87 <tr><td> 88 <?php _e('Mcrypt PHP Libraries Installed', 'wp-infocard'); ?> 89 </td><td valign="bottom"> 90 <img src="<?php print pw_admin::checklist_icon($mcrypt_loaded); ?>"/> 91 <a href="help/help.php?topic=mcrypt"><?php _e('More Information', 'wp-infocard');?></a> 92 </td></tr> 93 <?php if ($mcrypt_loaded) { ?> 94 <tr><td> 95 <?php _e('Rijndael 128 Algorithm Available', 'wp-infocard'); ?> 96 </td><td valign="bottom"> 97 <img src="<?php print pw_admin::checklist_icon(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)); ?>"/> 98 <a href="help/help.php?topic=rijndael"><?php _e('More Information', 'wp-infocard');?></a> 99 </td></tr> 100 <?php } // end if mcrypt_loaded ?> 101 <tr><td> 102 <?php _e('OpenSSL Enabled', 'wp-infocard'); ?> 103 </td><td valign="bottom"> 104 <img src="<?php print pw_admin::checklist_icon($openssl_loaded); ?>"/> 105 <a href="help/help.php?topic=openssl"><?php _e('More Information', 'wp-infocard');?></a> 106 </td></tr> 107 <tr><td> 108 <?php _e('SSL Connection to Secure Site URL Works', 'wp-infocard'); ?> 109 </td><td valign="bottom"> 110 <img src="<?php print pw_admin::checklist_icon(pw_admin::verifySSLURL($new_secureurl)); ?>"/> 111 <a href="help/help.php?topic=cert"><?php _e('More Information', 'wp-infocard');?></a> 112 </td></tr> 113 <tr><td> 114 <?php _e('Private Key Validly Formatted', 'wp-infocard'); ?> 115 </td><td valign="bottom"> 116 <img src="<?php print pw_admin::checklist_icon($key_works); ?>"/> 117 <a href="help/help.php?topic=privatekey"><?php _e('More Information', 'wp-infocard');?></a> 118 </td></tr> 119 <tr><td> </td><td/></tr> 120 121 <tr><th colspan="2" align="left">Information Card Required Information</td></tr> 122 <tr><td valign="top"> 123 <label for="securesiteurl" title="Secure Site URL"> 124 <?php _e('Secure Site URL', 'wp-infocard'); ?> 125 </label> 126 </td><td> 127 <input type="text" name="securesiteurl" id="securesiteurl" size="50" value="<?php print $new_secureurl; ?>" /> 128 </td></tr> 129 130 <tr><td valign="top"> 131 <label for="infocard_key" title="SSL Private Key"> 132 <?php _e('SSL Private Key', 'wp-infocard'); ?> 133 </label> 134 </td><td> 135 <textarea cols="50" rows="4" name="infocard_key" id="infocard_key"><?php print $new_key; ?></textarea> 136 </td></tr> 137 <tr><td> 138 <label for="infocard_opener" title="SSL Passphrase"> 139 <?php _e('SSL Passphrase', 'wp-infocard'); ?> 140 </label> 141 </td><td> 142 <input type="text" name="infocard_opener" id="infocard_opener" size="50" value="<?php print $new_opener; ?>" /> 143 </td></tr> 144 <tr><td> </td><td/></tr> 145 <tr><th colspan="2" align="left">To Enable Information Card User Login</td></tr> 146 <tr><td colspan="2"><?php _e('The following changes will result in a login form with the option "Use an Information Card". Please make a copy of the wp-login.php file before you begin, so that you can revert to that original file in case of difficulties.'); ?></td></tr> 147 <tr><td colspan="2" id="code"> 148 <ol> 149 <?php $login_file = ABSPATH . "wp-login.php"; 150 _e('<li>Copy ' . $login_file . ' to '. $login_file . '.orig</li>'); 151 _e('<li>Insert the following code as described in in the next step:' ); 152 print "<br/>wp_redirect( get_settings('siteurl').\"/wp-content/plugins/wp-infocard/login/login.php\");<br/></li>"; 153 _e('<li>Wordpress 2.0.7: Edit '. $login_file .' and insert the following code between lines 209 and 210 of the file, should be just after the two lines below:' ); 154 print "<code><br/> ?><br/>"; 155 print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><br/></li></code>"; 156 _e('<br/><li>Wordpress 2.1.x: Insert the same line at line 381, just before this line:' ); 157 _e('<code><br/> login_header(__(\'Login\'));</li></code>'); 44 function infocard_options() 45 { 46 // Content shown in the Options page is constructed here 158 47 ?> 159 </td></tr> 160 <tr><td> </td><td/></tr> 161 <tr><th colspan="2" align="left">Advanced TroubleShooting</td></tr> 162 <tr><td colspan="2"><?php _e('This test requires that changes be made to the Apache configuration files. You only need to run this test if everything is green above, but things are still broken.'); ?></td></tr> 163 <tr><td> 164 <?php _e('Advanced Certificate Check', 'wp-infocard'); ?> 165 </td><td valign="bottom"> 166 <?php //pw_admin::advancedCertTest(IC_IMGURL); ?> 167 <br/> <a href="help/help.php?topic=advancedcerttest"><?php _e('More Information', 'wp-infocard');?></a> 168 </td></tr> 169 170 </table> 171 <input type="submit" name="infocard_admin_submit" id="infocard_admin_submit" value="<?php _e('Save', 'wp-infocard');?>" /> 172 </p> 173 </form> 174 <?php 175 if (!$ic_secret) { 176 _e('There is no 32-bit secret generated for this blog - the secret is needed for security purposes. Do not use this plugin until a secret has been generated & placed into the database', 'wp-infocard'); 177 } 178 ?> 179 </div> 180 <?php 181 } 48 <div class="wrap"> 49 <h2> 50 <?php _e('Information Card Login', 'wp-infocard'); ?> 51 </h2> 52 <?php 53 pw_admin::pwAdminScreen(); 54 ?> 55 </div> 56 <?php 57 } // end function infocard_options 182 58 183 59 // Add tab in the admin menu trunk/wp-infocard/wp/admin.pw.php
r31 r33 2 2 //defined( '_VALID_IC' ) or die( 'Direct Access to this location is not allowed.'); 3 3 include_once( dirname(__FILE__) . '/../pw-config.php'); 4 include_once( dirname(__FILE__) . '/../pw /admin.pwlib.php');4 include_once( dirname(__FILE__) . '/../pwlib/admin.pwlib.php'); 5 5 //require_once( ABSPATH . WPINC . '/registration-functions.php'); 6 6 /* … … 44 44 //$this->table_options = $table_prefix . "infocard_options"; 45 45 $this->table_options = $table_prefix . "options"; 46 } 47 // end pw_infocard 46 } // end pw_infocard 48 47 49 48 // Function: createAuditTable … … 167 166 $this->createOption('pw_securesiteurl', $https_url); 168 167 169 } 168 $this->createOption('pw_debug_on', 0); 169 $this->createOption('pw_enable_pass', 0); 170 171 } // end function setup 170 172 171 173 // Function: createOption … … 186 188 187 189 } // end function createOptionValue 190 191 function pw_deleteUserCards($accountid) 192 { 193 global $wpdb; 194 $query = "DELETE FROM `wp_infocard_identities` WHERE accountid " 195 . " = '" . (int)$accountid . "'"; 196 197 return $wpdb->query( $query ); 198 } // end function delete_user_cards 188 199 189 200 } // end class pw_infocard … … 229 240 } // end function createNewAccount 230 241 242 function pwAdminScreen() 243 { 244 // get initial option values 245 $ic_opener = $new_opener = pw_admin::getOption('pw_infocard_opener'); 246 $ic_key = $new_key = pw_admin::getOption('pw_infocard_key'); 247 $secureurl = $new_secureurl = pw_admin::getOption('pw_securesiteurl'); 248 $ic_secret = pw_admin::getOption('secret'); 249 $ic_debug = $new_debug = pw_admin::getOption('pw_debug_on'); 250 $ic_pass = $new_pass = pw_admin::getOption('pw_enable_pass'); 251 252 // write submitted changes if this page reload shows a submit 253 if ( $_POST["infocard_admin_submit"] ) 254 { 255 $new_opener = $_POST['pw_infocard_opener']; 256 $new_key = $_POST['pw_infocard_key']; 257 $new_secureurl = $_POST['pw_securesiteurl']; 258 $new_debug = $_POST['pw_debug_on']; 259 $new_pass = $_POST['pw_enable_pass']; 260 } 261 262 if ( $ic_opener != $new_opener ){ 263 update_option('pw_infocard_opener', $new_opener); 264 } 265 266 if ( $ic_key != $new_key ){ 267 update_option('pw_infocard_key', $new_key); 268 } 269 270 if ( $secureurl != $new_secureurl ){ 271 update_option('pw_securesiteurl', $new_secureurl ); 272 } 273 274 if ( $ic_debug != $new_debug ){ 275 update_option('pw_debug_on', $new_debug ); 276 } 277 278 if ( $ic_pass != $new_pass ){ 279 update_option('pw_enable_pass', $new_pass ); 280 } 281 282 pw_admin::printSystemCheck(); 283 ?> 284 <form action="" method="post"> 285 <table border="0"><tr><th valign="bottom" colspan="2" align="left"> 286 <tr><td> </td><td/></tr> 287 288 <tr><th colspan="2" align="left">Information Card Configuration</td></tr> 289 <tr><td valign="top"> 290 <label for="securesiteurl" title="Secure Site URL"> 291 <?php _e('Secure Site URL', 'wp-infocard'); ?> 292 </label> 293 </td><td> 294 <input type="text" name="pw_securesiteurl" id="pw_securesiteurl" size="50" value="<?php print $new_secureurl; ?>" /> 295 </td></tr> 296 297 <tr><td valign="top"> 298 <label for="pw_infocard_key" title="SSL Private Key"> 299 <?php _e('SSL Private Key', 'wp-infocard'); ?> 300 </label> 301 </td><td> 302 <textarea cols="60" rows="4" name="pw_infocard_key" id="pw_infocard_key"><?php print $new_key; ?></textarea> 303 </td></tr> 304 <tr><td> 305 <label for="pw_infocard_opener" title="SSL Passphrase"> 306 <?php _e('SSL Passphrase', 'wp-infocard'); ?> 307 </label> 308 </td><td> 309 <input type="text" name="pw_infocard_opener" id="pw_infocard_opener" size="50" value="<?php print $new_opener; ?>" /> 310 </td></tr> 311 <tr><td colspan="2"> 312 <input name="pw_enable_pass" type="checkbox" id="pw_enable_pass" value="1" <?php checked('1', ($new_pass)); ?> /> 313 <?php _e('Use Username/Password in addition to Information Cards', 'wp-infocard'); ?> 314 </td></tr> 315 <tr><td> </td><td/></tr> 316 <tr><td> 317 <?php 318 if (!$ic_secret) { 319 _e('There is no 32-bit secret generated for this blog - the secret is needed for security purposes. Do not use this plugin until a secret has been generated & placed into the database', 'wp-infocard'); 320 } 321 ?> 322 </td></tr> 323 <tr><th colspan="2" align="left">To Enable Information Card User Login</td></tr> 324 <tr><td colspan="2"><?php _e('The following changes will result in a login form with the option "Use an Information Card". Please make a copy of the wp-login.php file before you begin, so that you can revert to that original file in case of difficulties.'); ?></td></tr> 325 <tr><td colspan="2" id="code"> 326 <?php 327 pw_admin::printInstallData(); 328 ?> 329 </td></tr> 330 <tr><td> </td><td/></tr> 331 <tr><th colspan="2" align="left">Advanced TroubleShooting</td></tr> 332 <tr><td> </td><td/></tr> 333 <tr><td colspan="2"> 334 <input name="pw_debug_on" type="checkbox" id="pw_debug_on" value="1" <?php checked('1', ($new_debug)); ?> /> 335 <?php _e('Debug Mode', 'wp-infocard'); ?> 336 </td></tr> 337 <tr><td> </td><td/></tr> 338 <tr><td colspan="2"><?php _e('This test requires that changes be made to the Apache configuration files. You only need to run this test if everything is green above, but things are still broken.'); ?></td></tr> 339 <tr><td> 340 <?php _e('Advanced Certificate Check', 'wp-infocard'); ?> 341 </td><td valign="bottom"> 342 <?php //pw_admin::advancedCertTest(IC_IMGURL); ?> 343 <br/> <a href="help/help.php?topic=advancedcerttest"><?php _e('More Information', 'wp-infocard');?></a> 344 </td></tr> 345 346 </table> 347 <input type="submit" name="infocard_admin_submit" id="infocard_admin_submit" value="<?php _e('Save', 'wp-infocard');?>" /> 348 </p> 349 </form> 350 <?php 351 } // end function pwAdminScreen 352 353 function printInstallData() 354 { 355 ?> 356 <ol> 357 <li> 358 <?php 359 $login_file = ABSPATH . "wp-login.php"; 360 _e('Copy ' . $login_file . ' to '. $login_file . '.orig'); 361 ?> 362 </li> 363 <br/> 364 <li> 365 <?php 366 _e('Insert the following code as described in in the next step:' ); 367 ?> 368 <code><br/> 369 wp_redirect( get_settings('siteurl')."/wp-content/plugins/wp-infocard/login/infocard-login.php"); 370 </code> 371 </li> 372 <br/> 373 <li> 374 <?php 375 _e('Wordpress 2.0.7: Edit '. $login_file .' and insert the following code between lines 209 and 210 of the file, should be just after the two lines below:' ); 376 ?> 377 <code> 378 <br/> ?<<br/> 379 <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><br/> 380 </code> 381 </li> 382 <br/> 383 <li> 384 <?php 385 _e('Wordpress 2.1.x: Insert the same line at line 381, just before this line:' ); 386 ?> 387 <code><br/> 388 login_header(__(\'Login\')); 389 </code> 390 </li> 391 </ol> 392 <?php 393 } // end function printInstallData 394 395 function pw_sidebar_cardlogin( $link ) 396 { 397 if( strstr('redirect_to', $link )) return $link; 398 return str_replace( 'action=logout', 'action=logout' . ini_get('arg_separator.output') . 'redirect_to=' . urlencode($_SERVER["REQUEST_URI"]), $link ); 399 } 400 231 401 } // end class pw_admin 232 402 ?> trunk/wp-infocard/wp/audit.pw.php
r31 r33 3 3 4 4 include_once( dirname(__FILE__) . '/../pw-config.php' ); 5 //include_once( dirname(__FILE__) . '/../pw /audit.pwlib.php');5 //include_once( dirname(__FILE__) . '/../pwlib/audit.pwlib.php'); 6 6 7 7 trunk/wp-infocard/wp/data.pw.php
r31 r33 71 71 print "<p>Problems with this file: $message_file</p>"; 72 72 } else { 73 InfocardGeneral::errorPageRedirect('BADUSERMESSAGE', $message_file);73 pw_utils::errorPageRedirect('BADUSERMESSAGE', $message_file); 74 74
