Project

General

Profile

Bug #3314 » 3314-pt1_rev1.patch

krileon, 05 March 2012 16:57

View differences:

administrator/components/com_comprofiler/library/cb/cb.tables.php
}
return $result;
}
function storeDatabaseValue( $name, $value ) {
function storeDatabaseValue( $name, $value, $triggers = true ) {
global $_CB_framework, $_PLUGINS;
if ( $this->id && ( isset( $this->$name ) ) ) {
......
$user->$name = $this->$name;
$currentvalue = $user->$name;
if ( $ui == 1 ) {
$_PLUGINS->trigger( 'onBeforeUserUpdate', array( &$user, &$user, &$oldUserComplete, &$oldUserComplete ) );
} elseif ( $ui == 2 ) {
$_PLUGINS->trigger( 'onBeforeUpdateUser', array( &$user, &$user, &$oldUserComplete ) );
if ( $triggers ) {
if ( $ui == 1 ) {
$_PLUGINS->trigger( 'onBeforeUserUpdate', array( &$user, &$user, &$oldUserComplete, &$oldUserComplete ) );
} elseif ( $ui == 2 ) {
$_PLUGINS->trigger( 'onBeforeUpdateUser', array( &$user, &$user, &$oldUserComplete ) );
}
}
// In case of Password, hashed value:
......
// In case of Password, cleartext value for the onAfter event:
$user->$name = $currentvalue;
if ( $return ) {
if ( $ui == 1 ) {
$_PLUGINS->trigger( 'onAfterUserUpdate', array( &$user, &$user, $oldUserComplete ) );
} elseif ( $ui == 2 ) {
$_PLUGINS->trigger( 'onAfterUpdateUser', array( &$user, &$user, $oldUserComplete ) );
if ( $triggers ) {
if ( $return ) {
if ( $ui == 1 ) {
$_PLUGINS->trigger( 'onAfterUserUpdate', array( &$user, &$user, $oldUserComplete ) );
} elseif ( $ui == 2 ) {
$_PLUGINS->trigger( 'onAfterUpdateUser', array( &$user, &$user, $oldUserComplete ) );
}
}
}
// Check if error is present in temporary user object:
$error = $user->getError();
if ( $error ) {
// Pass error to current user object so can be output properly:
$this->_error = $error;
}
unset( $user, $oldUserComplete );
return $return;
}
......
*
* @return boolean Store query error
*/
function storeBlock( ) {
function storeBlock( $triggers = true ) {
if ( $this->id ) {
return $this->storeDatabaseValue( 'block', (int) $this->block );
return $this->storeDatabaseValue( 'block', (int) $this->block, $triggers );
}
return false;
}
......
*
* @return boolean Store query error
*/
function storePassword( ) {
function storePassword( $triggers = true ) {
if ( $this->id ) {
return $this->storeDatabaseValue( 'password', $this->hashAndSaltPassword( $this->password ) );
return $this->storeDatabaseValue( 'password', $this->hashAndSaltPassword( $this->password ), $triggers );
}
return false;
}
......
*
* @return boolean Store query error
*/
function storeApproved( ) {
function storeApproved( $triggers = true ) {
if ( $this->id ) {
return $this->storeDatabaseValue( 'approved', (int) $this->approved );
return $this->storeDatabaseValue( 'approved', (int) $this->approved, $triggers );
}
return false;
}
......
*
* @return boolean Store query error
*/
function storeConfirmed( ) {
function storeConfirmed( $triggers = true ) {
if ( $this->id ) {
return $this->storeDatabaseValue( 'confirmed', (int) $this->confirmed );
return $this->storeDatabaseValue( 'confirmed', (int) $this->confirmed, $triggers );
}
return false;
}
(3-3/5)