Changeset 6115 for trunk/src/includes/admin/converters/Kunena2.php
- Timestamp:
- 11/02/2016 10:59:20 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/admin/converters/Kunena2.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/converters/Kunena2.php
r5951 r6115 30 30 * Sets up the field mappings 31 31 */ 32 public function setup_globals() {33 34 /** Forum Section *****************************************************/32 public function setup_globals() { 33 34 /** Forum Section *****************************************************/ 35 35 36 36 … … 296 296 ); 297 297 298 /** Tags Section ******************************************************/298 /** Tags Section ******************************************************/ 299 299 300 300 /** … … 399 399 ); 400 400 401 /** User Section ******************************************************/402 403 //Note: We are importing the Joomla User details and the Kunena v2.x user profile details.404 405 // Store old user id (Stored in usermeta)406 $this->field_map[] = array(407 'from_tablename' => 'users',408 'from_fieldname' => 'id',409 'to_type' => 'user',410 'to_fieldname' => '_bbp_old_user_id'411 );412 413 // Store old user password (Stored in usermeta serialized with salt)414 $this->field_map[] = array(415 'from_tablename' => 'users',416 'from_fieldname' => 'password',417 'to_type' => 'user',418 'to_fieldname' => '_bbp_password',419 'callback_method' => 'callback_savepass'420 );421 422 // Store old user salt. This is only used for the SELECT row info for the above password save423 /*424 $this->field_map[] = array(425 'from_tablename' => 'users',426 'from_fieldname' => 'salt',427 'to_type' => 'user',428 'to_fieldname' => ''429 );430 */431 432 // User password verify class. Stores in usermeta for verifying password.433 /*434 $this->field_map[] = array(435 'to_type' => 'user',436 'to_fieldname' => '_bbp_class',437 'default' => 'Kunena2'438 );439 */440 441 // User name.442 $this->field_map[] = array(443 'from_tablename' => 'users',444 'from_fieldname' => 'username',445 'to_type' => 'user',446 'to_fieldname' => 'user_login'447 );448 449 // User email.450 $this->field_map[] = array(451 'from_tablename' => 'users',452 'from_fieldname' => 'email',453 'to_type' => 'user',454 'to_fieldname' => 'user_email'455 );456 457 // User registered.458 $this->field_map[] = array(459 'from_tablename' => 'users',460 'from_fieldname' => 'registerDate',461 'to_type' => 'user',462 'to_fieldname' => 'user_registered',463 'callback_method' => 'callback_datetime'464 );401 /** User Section ******************************************************/ 402 403 //Note: We are importing the Joomla User details and the Kunena v2.x user profile details. 404 405 // Store old user id (Stored in usermeta) 406 $this->field_map[] = array( 407 'from_tablename' => 'users', 408 'from_fieldname' => 'id', 409 'to_type' => 'user', 410 'to_fieldname' => '_bbp_old_user_id' 411 ); 412 413 // Store old user password (Stored in usermeta serialized with salt) 414 $this->field_map[] = array( 415 'from_tablename' => 'users', 416 'from_fieldname' => 'password', 417 'to_type' => 'user', 418 'to_fieldname' => '_bbp_password', 419 'callback_method' => 'callback_savepass' 420 ); 421 422 // Store old user salt. This is only used for the SELECT row info for the above password save 423 /* 424 $this->field_map[] = array( 425 'from_tablename' => 'users', 426 'from_fieldname' => 'salt', 427 'to_type' => 'user', 428 'to_fieldname' => '' 429 ); 430 */ 431 432 // User password verify class. Stores in usermeta for verifying password. 433 /* 434 $this->field_map[] = array( 435 'to_type' => 'user', 436 'to_fieldname' => '_bbp_class', 437 'default' => 'Kunena2' 438 ); 439 */ 440 441 // User name. 442 $this->field_map[] = array( 443 'from_tablename' => 'users', 444 'from_fieldname' => 'username', 445 'to_type' => 'user', 446 'to_fieldname' => 'user_login' 447 ); 448 449 // User email. 450 $this->field_map[] = array( 451 'from_tablename' => 'users', 452 'from_fieldname' => 'email', 453 'to_type' => 'user', 454 'to_fieldname' => 'user_email' 455 ); 456 457 // User registered. 458 $this->field_map[] = array( 459 'from_tablename' => 'users', 460 'from_fieldname' => 'registerDate', 461 'to_type' => 'user', 462 'to_fieldname' => 'user_registered', 463 'callback_method' => 'callback_datetime' 464 ); 465 465 466 466 // User display name. … … 472 472 ); 473 473 474 }475 476 /**477 * This method allows us to indicates what is or is not converted for each478 * converter.479 */480 public function info() {481 return '';482 }483 484 /**485 * This method is to save the salt and password together. That486 * way when we authenticate it we can get it out of the database487 * as one value. Array values are auto sanitized by WordPress.488 */489 public function callback_savepass($field, $row) {490 $pass_array = array('hash' => $field, 'salt' => $row['salt']);491 return $pass_array;492 }493 494 /**495 * This method is to take the pass out of the database and compare496 * to a pass the user has typed in.497 */498 public function authenticate_pass($password, $serialized_pass) {499 $pass_array = unserialize($serialized_pass);500 return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );501 }474 } 475 476 /** 477 * This method allows us to indicates what is or is not converted for each 478 * converter. 479 */ 480 public function info() { 481 return ''; 482 } 483 484 /** 485 * This method is to save the salt and password together. That 486 * way when we authenticate it we can get it out of the database 487 * as one value. Array values are auto sanitized by WordPress. 488 */ 489 public function callback_savepass($field, $row) { 490 $pass_array = array('hash' => $field, 'salt' => $row['salt']); 491 return $pass_array; 492 } 493 494 /** 495 * This method is to take the pass out of the database and compare 496 * to a pass the user has typed in. 497 */ 498 public function authenticate_pass($password, $serialized_pass) { 499 $pass_array = unserialize($serialized_pass); 500 return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) ); 501 } 502 502 /** 503 503 * Translate the forum type from Kunena v2.x numeric's to WordPress's strings.
Note:
See TracChangeset
for help on using the changeset viewer.