Changeset 102
- Timestamp:
- 08/21/07 13:15:19 (1 year ago)
- Files:
-
- trunk/wp-infocard/wp/admin.pw.php (modified) (8 diffs)
- trunk/wp-infocard/wp/audit.pw.php (modified) (2 diffs)
- trunk/wp-infocard/wp/clickback.pw.php (modified) (5 diffs)
- trunk/wp-infocard/wp/customdata.pw.php (modified) (4 diffs)
- trunk/wp-infocard/wp/login/login.pw.php (modified) (3 diffs)
- trunk/wp-infocard/wp/processing.pw.php (modified) (1 diff)
- trunk/wp-infocard/wp/userdata.pw.php (modified) (13 diffs)
- trunk/wp-infocard/wp/utils.pw.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-infocard/wp/admin.pw.php
r101 r102 23 23 { 24 24 25 // Function: pw_infocard26 // Description: Constructor -- Set things up.27 // Input: none28 // Output: none29 // Side effect: initializes some parameters30 function pw_infocard()31 { 32 global $table_prefix;33 34 // We use a bunch of tables to store data35 $this->table_audit = $table_prefix . "infocard_audit";36 $this->table_identity = $table_prefix . "infocard_identities";37 38 // We also use some tables from Wordpress default set39 $this->table_options = $table_prefix . "options";40 $this->table_users = $table_prefix . "users";41 $this->table_usermeta = $table_prefix . "usermeta";25 // Function: pw_infocard 26 // Description: Constructor -- Set things up. 27 // Input: none 28 // Output: none 29 // Side effect: initializes some parameters 30 function pw_infocard() 31 { 32 global $table_prefix; 33 34 // We use a bunch of tables to store data 35 $this->table_audit = $table_prefix . "infocard_audit"; 36 $this->table_identity = $table_prefix . "infocard_identities"; 37 38 // We also use some tables from Wordpress default set 39 $this->table_options = $table_prefix . "options"; 40 $this->table_users = $table_prefix . "users"; 41 $this->table_usermeta = $table_prefix . "usermeta"; 42 42 43 43 // Options Table 44 44 // For WP we will use the builtin options table. 45 45 46 //$this->table_options = $table_prefix . "infocard_options"; 47 $this->table_options = $table_prefix . "options"; 48 } // end pw_infocard 49 50 // Function: createAuditTable 51 // Description: Create audit table 52 // Input: none 53 // Output: boolean to detect if table was created 54 // Side effect: executes SQL code to create DB tables needed by the plugin 55 function _createAuditTable() { 56 global $wpdb; 57 58 $myTableAuditQuery = 59 "CREATE TABLE `$this->table_audit` ( 60 `modulusHash` varchar(128) NOT NULL default '', 61 `ppid` varchar(128) NOT NULL default '', 62 `accountid` bigint(20) unsigned, 63 `email` varchar(128) NOT NULL default '', 64 `time` datetime NOT NULL default '0000-00-00 00:00:00', 65 `IP` varchar(16) NOT NULL default '', 66 `status` varchar(128) NOT NULL default '' 67 ) ENGINE = MYISAM"; 68 69 // Check if table is already there 70 foreach ($wpdb->get_col("SHOW TABLES", 0) as $table ) { 71 if ($table == $this->table_audit) { 72 return false; 73 } 74 } 75 76 // Ok, let's proceed 77 if ( $wpdb->query( $myTableAuditQuery ) === false ) { 78 return false; 79 } 80 81 // Just to be sure, we check that tables were actually created 82 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) { 83 if ( $table == $this->table_audit ) { 84 return true; 85 } 86 } 87 return false; 88 } 89 // end createAuditTable 90 91 // Function: createIdentityTable 92 // Description: Create identity table 93 // Input: none 94 // Output: boolean to detect if table was created 95 // Side effect: executes SQL code to create DB tables needed by the plugin 96 function _createIdentityTable() { 97 global $wpdb; 46 //$this->table_options = $table_prefix . "infocard_options"; 47 $this->table_options = $table_prefix . "options"; 48 } // end pw_infocard 49 50 // Function: createAuditTable 51 // Description: Create audit table 52 // Input: none 53 // Output: boolean to detect if table was created 54 // Side effect: executes SQL code to create DB tables needed by the plugin 55 function _createAuditTable() 56 { 57 global $wpdb; 58 59 $myTableAuditQuery = 60 "CREATE TABLE `$this->table_audit` ( 61 `modulusHash` varchar(128) NOT NULL default '', 62 `ppid` varchar(128) NOT NULL default '', 63 `accountid` bigint(20) unsigned, 64 `email` varchar(128) NOT NULL default '', 65 `time` datetime NOT NULL default '0000-00-00 00:00:00', 66 `IP` varchar(16) NOT NULL default '', 67 `status` varchar(128) NOT NULL default '' 68 ) ENGINE = MYISAM"; 69 70 // Check if table is already there 71 foreach ($wpdb->get_col("SHOW TABLES", 0) as $table ) 72 { 73 if ($table == $this->table_audit) 74 { 75 return false; 76 } 77 } 78 79 // Ok, let's proceed 80 if ( $wpdb->query( $myTableAuditQuery ) === false ) 81 { 82 return false; 83 } 84 85 // Just to be sure, we check that tables were actually created 86 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) 87 { 88 if ( $table == $this->table_audit ) 89 { 90 return true; 91 } 92 } 93 return false; 94 } 95 // end createAuditTable 96 97 // Function: createIdentityTable 98 // Description: Create identity table 99 // Input: none 100 // Output: boolean to detect if table was created 101 // Side effect: executes SQL code to create DB tables needed by the plugin 102 function _createIdentityTable() 103 { 104 global $wpdb; 98 105 99 106 /* -- old format 100 $myTableIdentityQuery =101 "CREATE TABLE `$this->table_identity` (102 `modulusHash` varchar(128) NOT NULL default '',103 `ppid` varchar(128) NOT NULL default '',104 `accountid` bigint(20) unsigned105 ) ENGINE = MYISAM";107 $myTableIdentityQuery = 108 "CREATE TABLE `$this->table_identity` ( 109 `modulusHash` varchar(128) NOT NULL default '', 110 `ppid` varchar(128) NOT NULL default '', 111 `accountid` bigint(20) unsigned 112 ) ENGINE = MYISAM"; 106 113 */ 107 $myTableIdentityQuery = 108 "CREATE TABLE `$this->table_identity` ( 109 `cardhash` text default '', 110 `accountid` bigint(20) unsigned, 111 `cardhandle` varchar(128) NOT NULL default '', 112 `startdate` varchar(128) NOT NULL default '', 113 `lastused` varchar(128) NOT NULL default '' 114 ) ENGINE = MYISAM"; 115 116 // Check if table is already there 117 foreach ($wpdb->get_col("SHOW TABLES", 0) as $table ) { 118 if ($table == $this->table_identity) { 119 return false; 120 } 121 } 122 123 // Ok, let's proceed 124 if ( $wpdb->query( $myTableIdentityQuery ) === false ) { 125 return false; 126 } 127 128 // Just to be sure, we check that tables were actually created 129 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) { 130 if ( $table == $this->table_identity ) { 131 return true; 132 } 133 } 134 return false; 135 } 136 // end createIdentityTable 137 138 // Function: createOptionTable 139 // Description: Create option table (in the case of wp not needed) 140 // Input: none 141 // Output: boolean to detect if table was created 142 // Side effect: executes SQL code to create DB tables needed by the plugin 143 function _createOptionTable() { 144 global $wpdb; 114 $myTableIdentityQuery = 115 "CREATE TABLE `$this->table_identity` ( 116 `cardhash` text default '', 117 `accountid` bigint(20) unsigned, 118 `cardhandle` varchar(128) NOT NULL default '', 119 `startdate` varchar(128) NOT NULL default '', 120 `lastused` varchar(128) NOT NULL default '' 121 ) ENGINE = MYISAM"; 122 123 // Check if table is already there 124 foreach ($wpdb->get_col("SHOW TABLES", 0) as $table ) 125 { 126 if ($table == $this->table_identity) 127 { 128 return false; 129 } 130 } 131 132 // Ok, let's proceed 133 if ( $wpdb->query( $myTableIdentityQuery ) === false ) 134 { 135 return false; 136 } 137 138 // Just to be sure, we check that tables were actually created 139 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) 140 { 141 if ( $table == $this->table_identity ) 142 { 143 return true; 144 } 145 } 146 return false; 147 } 148 // end createIdentityTable 149 150 // Function: createOptionTable 151 // Description: Create option table (in the case of wp not needed) 152 // Input: none 153 // Output: boolean to detect if table was created 154 // Side effect: executes SQL code to create DB tables needed by the plugin 155 function _createOptionTable() 156 { 157 global $wpdb; 145 158 146 159 // Might decide later to have all plugins use a standard options 147 160 // table - but for right now, why re-invent the wheel. 148 161 149 // check to see if the wp_options table exists 150 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) { 151 if ( $table == $this->table_identity ) { 152 return true; 153 } 154 } 155 return false; 156 } 157 // end createOptionTable 158 159 // Function: setup 160 // Description: Creates Tables, sets up options. 161 // Input: none 162 // Output: none 163 // Side effect: creates tables 164 function setup() { 165 global $wpdb; 166 167 $isAuditTableCreated = $this->_createAuditTable(); 168 $isIdentityTableCreated = $this->_createIdentityTable(); 169 $isOptionTableCreated = $this->_createOptionTable(); 170 162 // check to see if the wp_options table exists 163 foreach ( $wpdb->get_col("SHOW TABLES", 0) as $table ) 164 { 165 if ( $table == $this->table_identity ) 166 { 167 return true; 168 } 169 } 170 return false; 171 } 172 // end createOptionTable 173 174 // Function: setup 175 // Description: Creates Tables, sets up options. 176 // Input: none 177 // Output: none 178 // Side effect: creates tables 179 function setup() 180 { 181 global $wpdb; 182 183 $isAuditTableCreated = $this->_createAuditTable(); 184 $isIdentityTableCreated = $this->_createIdentityTable(); 185 $isOptionTableCreated = $this->_createOptionTable(); 171 186 172 187 $salt = pw_admin::createClickbackSalt(); … … 186 201 $this->createOption('pw_trusted_idp_list', ''); 187 202 188 } // end function setup189 190 // Function:createOption191 // Description:if the option exists & is non-empty, it is kept192 // the same otherwise it is updated to $option_value193 // Input:option name, option value194 // Output:none195 // Side effect: updates attributes in wp_options203 } // end function setup 204 205 // Function: createOption 206 // Description: if the option exists & is non-empty, it is kept 207 // the same otherwise it is updated to $option_value 208 // Input: option name, option value 209 // Output: none 210 // Side effect: updates attributes in wp_options 196 211 function createOption($option_name, $option_value ) 197 212 { 198 199 213 $options = get_option($option_name); 200 201 if ( !$options ) 202 $options = $option_value; 203 204 update_option($option_name, $options); 205 214 if ( !$options ) 215 $options = $option_value; 216 217 update_option($option_name, $options); 206 218 } // end function createOptionValue 207 219 … … 250 262 // display_cryptographp(); 251 263 ?> 252 <hr />264 <hr /> 253 265 <a href="<?php echo PW_SECUREPLUGINURL . '/' . PW_PLUGIN; ?>/login/infocard-login.php" alt="<?php pw_utils::screenPrint('Infocard Login'); ?>" style="border-bottom: none; color: #FFF"> 254 266 <?php pw_utils::screenPrint('Login or Register using an Information Card'); ?> … … 258 270 <a alt="<?php echo __('What is this?'); ?>" style="border-bottom: none; color: #fff" href="http://pamelaproject.com/"> 259 271 <?php echo __('(what is this?)'); ?> 260 </a> 261 <?php 262 } //end function pw_loginform_link272 </a> 273 <?php 274 } //end function pw_loginform_link 263 275 264 276 function pw_printUserCardStatus() … … 294 306 class pw_admin extends pwlib_admin 295 307 { 296 // Function: getOption297 // Description: Retrieves things set in wp_options298 // Input: attribute name299 // Output: attribute value300 // Side effect: none308 // Function: getOption 309 // Description: Retrieves things set in wp_options 310 // Input: attribute name 311 // Output: attribute value 312 // Side effect: none 301 313 function getOption($attr_name) 302 314 { 303 return get_settings($attr_name); 304 315 return get_settings($attr_name); 305 316 } //end function getOption 306 317 307 // Function: createNewAccount308 // Description: creates a new db record309 // Input: account details310 // Output: returns the user Id on success, FALSE on failure311 // Side effect: none318 // Function: createNewAccount 319 // Description: creates a new db record 320 // Input: account details 321 // Output: returns the user Id on success, FALSE on failure 322 // Side effect: none 312 323 function createNewAccount( $user_login, $user_pass, $user_email, $user_url, $user_firstname, $user_lastname ) 313 324 { 314 325 require_once( ABSPATH . WPINC . '/registration-functions.php'); 315 326 316 InfocardUtils::printDebug("<br/>Action: createNewAccount<br>"); 317 $user_nicename = "$user_firstname $user_lastname"; 318 InfocardUtils::printDebug("<br/>Nice Name: $user_nicename<br>"); 319 $display_name = $user_nicename; 320 $userdata = compact('user_login', 'user_pass', 'user_email', 'user_nicename', 'user_url', 'display_name', 'user_firstname', 'user_lastname'); 321 $user_ID = wp_insert_user($userdata); 322 323 if ($user_ID) 324 { 325 InfocardUtils::printDebug(" Inserted record # $user_ID<br>"); 326 return $user_ID; 327 } else { 328 InfocardUtils::printDebug(" Error - new user not created<br/>"); 329 return FALSE; 330 } 331 332 } // end function createNewAccount 327 InfocardUtils::printDebug("<br/>Action: createNewAccount<br>"); 328 $user_nicename = "$user_firstname $user_lastname"; 329 InfocardUtils::printDebug("<br/>Nice Name: $user_nicename<br>"); 330 $display_name = $user_nicename; 331 $userdata = compact('user_login', 'user_pass', 'user_email', 'user_nicename', 'user_url', 'display_name', 'user_firstname', 'user_lastname'); 332 $user_ID = wp_insert_user($userdata); 333 334 if ($user_ID) 335 { 336 InfocardUtils::printDebug(" Inserted record # $user_ID<br>"); 337 return $user_ID; 338 } 339 else 340 { 341 InfocardUtils::printDebug(" Error - new user not created<br/>"); 342 return FALSE; 343 } 344 } // end function createNewAccount 333 345 334 346 function pwAdminScreen() … … 338 350 // write submitted changes if this page reload shows a submit 339 351 340 pw_admin::printSystemCheck($opts['pw_securesiteurl']);352 pw_admin::printSystemCheck($opts['pw_securesiteurl']); 341 353 ?> 342 354 <form action="" method="post"> … … 455 467 function pw_sidebar_cardlogin( $link ) 456 468 { 457 if( strstr('redirect_to', $link )) return $link; 458 return str_replace( 'action=logout', 'action=logout' . ini_get('arg_separator.output') . 'redirect_to=' . urlencode($_SERVER["REQUEST_URI"]), $link ); 459 } 469 if (strstr('redirect_to', $link )) 470 return $link; 471 return str_replace( 'action=logout', 'action=logout' . ini_get('arg_separator.output') . 'redirect_to=' . urlencode($_SERVER["REQUEST_URI"]), $link ); 472 } 460 473 461 474 function setupCaptcha() … … 465 478 } 466 479 467 /* 468 Function: setOption 469 Description: updates an option in the infocard_options table 470 Input: option_name: the name of the option 471 option_val: the new value 472 Output: the value set 473 Side Effects: writes to the database 474 */ 475 function setOption( $option_name, $option_val ) 476 { 477 update_option($option_name, $option_val); 478 return $option_val; 479 } 480 // Function: setOption 481 // Description: updates an option in the infocard_options table 482 // Input: option_name: the name of the option 483 // option_val: the new value 484 // Output: the value set 485 // Side Effects: writes to the database 486 function setOption( $option_name, $option_val ) 487 { 488 update_option($option_name, $option_val); 489 return $option_val; 490 } 480 491 } // end class pw_admin 481 492 ?> trunk/wp-infocard/wp/audit.pw.php
r100 r102 4 4 include_once( dirname(__FILE__) . '/../pw-config.php' ); 5 5 include_once( 'utils.pw.php' ); 6 //include_once( dirname(__FILE__) . '/../pwlib/audit.pwlib.php');6 include_once( dirname(__FILE__) . '/../pwlib/audit.pwlib.php'); 7 7 8 9 //class pw_audit extends pwlib_audit { 10 class pw_audit 8 class pw_audit extends pwlib_audit 11 9 { 12 13 // Function: writeToAudit 14 // Description: writeToAudit puts information into the pw_infocard_audit table. 15 // Input: IP address, Certificate Modulus, Email from token, Account ID if 16 // available, any Error message 17 // Output: none 10 // Function: writeToAudit 11 // Description: writeToAudit puts information into the pw_infocard_audit table. 12 // Input: IP address, Certificate Modulus, Email from token, Account ID if 13 // available, any Error message 14 // Output: none 18 15 // Side Effects: alters DB table 19 function writeToAudit( $ip, $modulus, $ppid, $email, $error, $acct)16 function writeToAudit($ip, $modulus='NA', $ppid='NA', $email='NA', $error, $acct='NA') 20 17 { 21 18 global $wpdb; 22 19 23 20 $today = date('Y-m-d H-i-s'); 24 21 $query = "INSERT INTO `" . PW_TABLE_PREFIX . "infocard_audit` " … … 27 24 28 25 $update_result = $wpdb->query( $query ); 29 if ( $update_result == FALSE )26 if ( $update_result == FALSE ) 30 27 { 31 pw_utils::printDebug("Error ".mysql_errno($update_result)."with mysql_query update (".mysql_error($update_result).")<br/>"); 32 } 33 34 } // end function writeToAudit 35 28 pw_utils::printDebug("Error ".mysql_errno($update_result)."with mysql_query update (".mysql_error($update_result).")<br/>"); 29 } 30 } // end function writeToAudit 36 31 } // end class pw_audit 37 32 ?> trunk/wp-infocard/wp/clickback.pw.php
r98 r102 4 4 include_once(dirname(__FILE__) . "/../" . PW_PLUGIN . "/userdata.pw.php"); 5 5 include_once(dirname(__FILE__) . "/../" . PW_PLUGIN . "/utils.pw.php"); 6 include_once(dirname(__FILE__) . "/../" . PW_PLUGIN . "/clickback.pwlib.php"); 6 7 7 class pw_clickback { 8 class pw_clickback extends pwlib_clickback 9 { 8 10 // this class details all of the functionality needed to support clickbacks. 9 11 // PW_CLICKBACK_LENGTH is set in pw-config.php 10 12 function printHiddenClickback($clickback = "") 11 {13 { 12 14 if ($clickback) 13 15 { 14 16 $debug = "Clickback detected: $clickback"; 15 17 print "\n\t<input type=\"hidden\" name=\"clickback\" " 16 . "value=\"$clickback\t\" />";18 . "value=\"$clickback\t\" />"; 17 19 } 18 20 else … … 23 25 } // end function printClickback 24 26 25 function createChallenge( $data ) { 27 function createChallenge( $data ) 28 { 26 29 //$clickback_salt = get_settings('clickback_salt'); 27 30 $clickback_salt = pw_admin::getOption('pw_clickback_salt'); … … 32 35 } 33 36 34 pw_utils::printDebug("Clickback: Challenge Created. <br/>"37 pw_utils::printDebug("Clickback: Challenge Created. <br/>" 35 38 . "Clickback: salted data is " . (($data)?$data:"empty") . "<br/>" 36 39 . "Clickback: length is " . PW_CLICKBACK_LENGTH 37 40 . "<br/>Clickback: salt is $clickback_salt <br/>"); 38 41 39 $data = MD5($clickback_salt . $data);42 $data = MD5($clickback_salt . $data); 40 43 41 $chopped = substr($data, 0, PW_CLICKBACK_LENGTH);44 $chopped = substr($data, 0, PW_CLICKBACK_LENGTH); 42 45 43 pw_utils::printDebug("Clickback: Hash of the salted challenge data: $data<br/>"46 pw_utils::printDebug("Clickback: Hash of the salted challenge data: $data<br/>" 44 47 . "Clickback: Chopped challenge data: $chopped <br/>"); 45 48 46 return ($chopped); 47 49 return ($chopped); 48 50 } // end of function createChallenge 49 51 50 function verifyChallenge( $currentChallenge, $previousChallenge ) { 52 function verifyChallenge( $currentChallenge, $previousChallenge ) 53 { 51 54 52 pw_utils::printDebug("<br/>Action: verifyClickbackChallenge. <br/>"55 pw_utils::printDebug("<br/>Action: verifyClickbackChallenge. <br/>" 53 56 . "Binary Clickback Details:<br/>"); 54 57 … … 57 60 // printBinary only prints if PW_DEBUG_ON is on. Otherwise it just falls through. 58 61 pw_utils::printBinary("computed challenge: ", $currentChallenge); 59 pw_utils::printBinary("previous challenge:", $previousChallenge);62 pw_utils::printBinary("previous challenge:", $previousChallenge); 60 63 61 if ($currentChallenge == $previousChallenge) { 64 if ($currentChallenge == $previousChallenge) 65 { 62 66 pw_utils::printDebug(" verifyClickback: challenges match<br/>"); 63 return (TRUE); 64 } else { 67 return (TRUE); 68 } 69 else 70 { 65 71 pw_utils::printDebug(" verifyClickback: challenges DO NOT match<br/>"); 66 72 return (FALSE); 67 73 } 68 69 74 } // end of function verifyChallenge 70 75 71 /* 72 Function: validateClickback 73 Description: returns true if the supplied candidate matches 74 a newly generated clickback 75 Input: candidate - the clickback value to validate 76 user_email - email address from the token 77 user_ppid - privatepersonalidentifier from the token 78 Output: boolean 79 Side Effects: none 80 */ 76 // Function: validateClickback 77 // Description: returns true if the supplied candidate matches 78 a newly generated clickback 79 // Input: candidate - the clickback value to validate 80 // user_email - email address from the token 81 // user_ppid - privatepersonalidentifier from the token 82 // Output: boolean 83 // Side Effects: none 81 84 function validateClickback($candidate, $user_email, $user_ppid) 82 85 { … … 88 91 89 92 return pw_clickback::verifyChallenge($clickbackUrl, $previousChallenge); 90 91 93 } 92 94 93 /* 94 Function: sendAccountValidation 95 Description: creates & emails a validation message to the user 96 Input: clickbackID: pre-created clickback value 97 user email: destination email 98 Output: none 99 Side Effects: sends an email 100 */ 95 // Function: sendAccountValidation 96 // Description: creates & emails a validation message to the user 97 // Input: clickbackID: pre-created clickback value 98 // user email: destination email 99 // Output: none 100 // Side Effects: sends an email 101 101 function sendAccountValidation( $clickbackID, $user_email ) 102 102 { 103 103 global $mosConfig_live_site; 104 $clickbackUrl = PW_SECUREPLUGINURL . "/" . PW_PLUGIN . "/login/infocard-clickback.php?clickbackID=" . $clickbackID;104 $clickbackUrl = PW_SECUREPLUGINURL . "/" . PW_PLUGIN . "/login/infocard-clickback.php?clickbackID=" . $clickbackID; 105 105 106 $message = sprintf('Please complete your registration at %s by opening the link below.', pw_utils::getTitle()) . "\r\n\r\n";107 $message .= $clickbackUrl."\r\n\r\nThanks\r\n";108 // sendEmail: to-address, subject, body109 pw_utils::sendEmail($user_email, 'New InfoCard Registration', $message);106 $message = sprintf('Please complete your registration at %s by opening the link below.', pw_utils::getTitle()) . "\r\n\r\n"; 107 $message .= $clickbackUrl."\r\n\r\nThanks\r\n"; 108 // sendEmail: to-address, subject, body 109 pw_utils::sendEmail($user_email, 'New InfoCard Registration', $message); 110 110 111 pw_utils::printDebug( "<br/><br/>Account Validation is required.<br/>" 112 . "Emailing Registration info to: $user_email<br/>" 113 . "User would be redirected to: <a href=\"$clickbackUrl\">$clickbackUrl</a><br/>" 114 . "Message would be: <pre>$message</pre>" 115 ); 116 117 } // end of function sendAccountValidation 118 119 } // end of class InfocardClickback 111 pw_utils::printDebug( "<br/><br/>Account Validation is required.<br/>" 112 . "Emailing Registration info to: $user_email<br/>" 113 . "User would be redirected to: <a href=\"$clickbackUrl\">$clickbackUrl</a><br/>" 114 . "Message would be: <pre>$message</pre>" 115 ); 116 } // end of function sendAccountValidation 117 } // end of class pw_clickback trunk/wp-infocard/wp/customdata.pw.php
r66 r102 3 3 include_once( dirname(__FILE__) . '/../pw-config.php'); 4 4 include_once( dirname(__FILE__) . '/../'.PW_PLUGIN.'/utils.pw.php'); 5 include_once(dirname(__FILE__) . "/../" . PW_PLUGIN . "/clickback.pwlib.php"); 5 6 6 7 /* … … 20 21 21 22 */ 22 class pw_customdata 23 class pw_customdata extends pwlib_customdata 23 24 { 24 25 // Function: describeCustomData … … 114 115 function evaluateIncomingCustomData( $ID ) 115 116 { 116 //global $datamap;117 // global $datamap; 117 118 118 119 // this checks for an existing database value, and updates … … 126 127 127 128 return; 128 } // end function evaluateIncomingCustomData129 } // end function evaluateIncomingCustomData 129 130 130 131 function updateNewCustomData( $ID ) trunk/wp-infocard/wp/login/login.pw.php
r78 r102 4 4 include_once( dirname(__FILE__) . '/../../pw-config.php' ); 5 5 include_once( dirname(__FILE__) . '/../../pwlib/login/login.pwlib.php'); 6 7 6 8 7 class pw_login extends pwlib_login 9 8 { … … 14 13 } //end function printRedirect 15 14 16 function printTokenType(){ 15 function printTokenType() 16 { 17 17 // one day this could be a user-chosen option 18 18 print "urn:oasis:names:tc:SAML:1.0:assertion"; … … 43 43 if ($clickback) 44 44 { 45 $path .= "?" . $clickback;45 $path .= "?" . $clickback; 46 46 } 47 47 48 48 print $path; 49 49 } trunk/wp-infocard/wp/processing.pw.php
r100 r102 26 26 pw_utils::printDebug(" Login ID: ".$datamap['user_login']->new_value."<br />"); 27 27 pw_utils::printDebug(" Account ID: ".$datamap['ID']->new_value."<br />"); 28 pw_utils::printDebug(" Status: ".$status." <br/>");28 pw_utils::printDebug(" Status: ".$status." <br/>"); 29 29 30 30 pw_utils::printDebug(" Errors: "); trunk/wp-infocard/wp/userdata.pw.php
r100 r102 4 4 include_once( dirname(__FILE__) . '/utils.pw.php'); 5 5 include_once( ABSPATH . WPINC . '/registration-functions.php'); 6 include_once(dirname(__FILE__) . "/../" . PW_PLUGIN . "/userdata.pwlib.php"); 6 7 7 8 /* … … 10 11 11 12 Class pw_userdata - plugin-specific user manipulation code 12 13 13 14 */ 14 class pw_userdata 15 class pw_userdata extends pwlib_userdata 15 16 { 16 /* 17 Function: evaluateIncomingRequest 18 Description: decides what kind of user is connecting. 19 Input: email, modulus, ppid from incoming request 20 Output: An array of user information. With the 21 following indices: 22 array['status'] - contains 1 of these statuses: 23 1. valid-user - supplied email address exists 24 and belongs to same user as supplied modulus/ppid 25 2. new-user - email address & modulus/ppid are new 26 3. new-card - email address exists but modulus is new 27 4. new-email - modulus/ppid exists but email is new 28 5. an error code 29 30 array['id'] - contains the user id number (or 0 if the status 31 is anything other than valid-user 32 Side-effects: none 33 */ 17 // Function: evaluateIncomingRequest 18 // Description: decides what kind of user is connecting. 19 // Input: email, modulus, ppid from incoming request 20 // Output: An array of user information. With the 21 // following indices: 22 // array['status'] - contains 1 of these statuses: 23 // 1. valid-user - supplied email address exists 24 // and belongs to same user as supplied modulus/ppid 25 // 2. new-user - email address & modulus/ppid are new 26 // 3. new-card - email address exists but modulus is new 27 // 4. new-email - modulus/ppid exists but email is new 28 // 5. an error code 29 // 30 // array['id'] - contains the user id number (or 0 if the status 31 // is anything other than valid-user) 32 // Side-effects: none 34 33 function evaluateIncomingRequest() 35 34 { 36 global $wpdb, $claimslist, $datamap;37 $incominguser['id'] = 0;38 $incominguser['status'] = 'UNKNOWNERROR';39 $identity_user_id = 0;35 global $wpdb, $claimslist, $datamap; 36 $incominguser['id'] = 0; 37 $incominguser['status'] = 'UNKNOWNERROR'; 38 $identity_user_id = 0; 40 39 41 40 $cardhash = pw_processing::getCardHash(); 42 pw_utils::printDebug( '<br/>Evaluating Incoming Request:<br/>'); 43 44 if (!is_email($claimslist['emailaddress']->token_value)) { 45 $incominguser['status'] = "INVALIDEMAIL"; 46 return $incominguser; 47 } 41 pw_utils::printDebug( '<br/>Evaluating Incoming Request:<br/>'); 42 43 if (!is_email($claimslist['emailaddress']->token_value)) 44 { 45 $incominguser['status'] = "INVALIDEMAIL"; 46 return $incominguser; 47 } 48 48
