Project

General

Profile

Bug #1569 ยป 1569.patch

krileon, 10 June 2010 19:18

View differences:

administrator/components/com_comprofiler/comprofiler.class.php
return true;
}
function _cbdeleteUserImages( &$user ) {
global $_CB_framework, $_CB_database;
$query = 'SELECT ' . $_CB_database->NameQuote( 'name' )
. "\n FROM " . $_CB_database->NameQuote( '#__comprofiler_fields' )
. "\n WHERE " . $_CB_database->NameQuote( 'type' ). " = " . $_CB_database->Quote( 'image' )
. "\n AND " . $_CB_database->NameQuote( 'name' ). " != " . $_CB_database->Quote( 'avatar' );
$_CB_database->setQuery( $query );
$image_fields = $_CB_database->loadResultArray();
if ( $image_fields ) {
$image_path = $_CB_framework->getCfg( 'absolute_path' ) . '/images/comprofiler/';
foreach ( $image_fields as $image_field ) {
if ( isset( $user->$image_field ) && ( $user->$image_field != '' ) ) {
if ( file_exists( $image_path . $user->$image_field ) ) {
@unlink( $image_path . $user->$image_field );
if ( file_exists( $image_path . 'tn' . $user->$image_field ) ) {
@unlink( $image_path . 'tn' . $user->$image_field );
}
}
}
}
}
}
//FUNCTIONS
function deleteAvatar( $avatar ){
......
$reports = new moscomprofilerUserReport( $_CB_database );
$reports->deleteUserReports ( $user->id );
_cbdeleteUserViews( $user->id );
_cbdeleteUserImages( $user );
if ( ! $inComprofilerOnly ) {
$obj =& $_CB_framework->_getCmsUserObject( $id );
$obj->delete( $id );
    (1-1/1)