Project

General

Profile

cb_2725.patch

beat, 20 August 2011 12:56 AM

View differences:

administrator/components/com_comprofiler/library/cb/cb.lists.php (working copy)
315 315
			}
316 316
			$_CB_database->setQuery( $query, (int) $limitstart, (int) $limit );
317 317
			$users				=	$_CB_database->loadObjectList( null, 'moscomprofilerUser', array( &$_CB_database ) );
318
			foreach ( $users as $k => $v ) {
319
				$users[$k]->afterBindFromDatabase();		// load gids and fix CMS database storage bugs
320
			}
318 321
	
319 322
			if ( ! $_CB_database->getErrorNum() ) {
320 323
				// creates the CBUsers in cache corresponding to the $users:
administrator/components/com_comprofiler/library/cb/cb.tables.php (working copy)
726 726
			$k					=	$this->_tbl_key;
727 727
			$this->$k			=	(int) $oid;
728 728
		}
729
		$this->gids			=	array( $this->gid );
729
		$this->afterBindFromDatabase();
730
	}
731
	/**
732
	 * This function should be called just after binding the moscomprofilerUser object from database
733
	 * to load the gids
734
	 * and to fix the CMS database storage bugs.
735
	 * It should be avoided externally, but is used by cb.lists.php
736
	 */
737
	function afterBindFromDatabase( ) {
730 738
		if ( checkJversion() == 2 ) {
731 739
			global $_CB_framework;
732 740

  
733 741
			$this->gids		=	array_values( (array) JFactory::getUser( $this->id )->groups );
734 742
			$this->gid		=	(int) $_CB_framework->acl->getBackwardsCompatibleGid( $this->gids );
735
		} elseif ( checkJversion() == 0 ) {
736
			if ( checkJversion( 'dev_level' ) < 11 ) {
743
		} else {
744
			$this->gids		=	array( $this->gid );
745
			if ( ( checkJversion() == 0 ) && ( checkJversion( 'dev_level' ) < 11 ) ) {
737 746
				// revert effect of _cbMakeHtmlSafe on user save in older joomla/mambo versions:
738 747
				$this->name	=	cbUnHtmlspecialchars( $this->name );
739 748
			}