# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: Joomla root # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. --- administrator/components/com_comprofiler/library/cb/cb.tables.php +++ administrator/components/com_comprofiler/library/cb/cb.tables.php @@ -1244,7 +1244,7 @@ } return $result; } - function storeDatabaseValue( $name, $value ) { + function storeDatabaseValue( $name, $value, $triggers = true ) { global $_CB_framework, $_PLUGINS; if ( $this->id && ( isset( $this->$name ) ) ) { @@ -1265,10 +1265,12 @@ $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: @@ -1279,13 +1281,24 @@ // 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; } @@ -1297,9 +1310,9 @@ * * @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; } @@ -1308,9 +1321,9 @@ * * @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; } @@ -1319,9 +1332,9 @@ * * @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; } @@ -1330,9 +1343,9 @@ * * @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; }