diff options
| author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-08 14:34:29 +0000 | 
|---|---|---|
| committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-08 14:34:29 +0000 | 
| commit | 50606888ddaa348bdabcd1e735eed55e26ff9c75 (patch) | |
| tree | 1b507279675532d81ae31037de08bcae92eccea6 | |
| parent | 382706c75d030ee57e9999e1916314a6dbf43659 (diff) | |
| download | elgg-50606888ddaa348bdabcd1e735eed55e26ff9c75.tar.gz elgg-50606888ddaa348bdabcd1e735eed55e26ff9c75.tar.bz2 | |
Refs #640: Renamed and moved entities.php:disable_entities to user.php:disable_user_entities
git-svn-id: https://code.elgg.org/elgg/trunk@2545 36083f99-b078-4883-b0ff-0f9b5a30f544
| -rw-r--r-- | actions/admin/user/ban.php | 2 | ||||
| -rw-r--r-- | engine/lib/entities.php | 22 | ||||
| -rw-r--r-- | engine/lib/users.php | 24 | 
3 files changed, 24 insertions, 24 deletions
| diff --git a/actions/admin/user/ban.php b/actions/admin/user/ban.php index 17e8dacb8..33232b3eb 100644 --- a/actions/admin/user/ban.php +++ b/actions/admin/user/ban.php @@ -22,7 +22,7 @@  	if ( ($obj instanceof ElggUser) && ($obj->canEdit()))  	{
 -		disable_entities($obj->guid); +		disable_user_entities($obj->guid);  		// Now actually disable it  		if ($obj->disable('banned')) {
  			system_message(elgg_echo('admin:user:ban:yes'));
 diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 55a888239..a2f671d30 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1656,28 +1656,6 @@  	}  	/** -	 * Disables all of a user's entities -	 * -	 * @param int $owner_guid The owner GUID -	 * @return true|false Depending on success -	 */ -	function disable_entities($owner_guid) { - -		global $CONFIG; -		$owner_guid = (int) $owner_guid; -		if ($entity = get_entity($owner_guid)) { -			if (trigger_elgg_event('disable',$entity->type,$entity)) { -				if ($entity->canEdit()) { -					$res = update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='no' where owner_guid={$owner_guid} or container_guid = {$owner_guid}"); -					return $res; -				} -			} -		} -		return false; -		 -	} -	 -	/**  	 * Enable an entity again.  	 *  	 * @param int $guid diff --git a/engine/lib/users.php b/engine/lib/users.php index ec3165a8d..c3ad2abfd 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -399,6 +399,28 @@  		}
  		return false;
 +	} +	 +	/** +	 * Disables all of a user's entities +	 * +	 * @param int $owner_guid The owner GUID +	 * @return true|false Depending on success +	 */ +	function disable_user_entities($owner_guid) { + +		global $CONFIG; +		$owner_guid = (int) $owner_guid; +		if ($entity = get_entity($owner_guid)) { +			if (trigger_elgg_event('disable',$entity->type,$entity)) { +				if ($entity->canEdit()) { +					$res = update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='no' where owner_guid={$owner_guid} or container_guid = {$owner_guid}"); +					return $res; +				} +			} +		} +		return false; +		  	}
  	/**
 @@ -417,7 +439,7 @@  		// Check to see if we have access and it exists
  		if ($row) 
  		{
 -			disable_entities($guid);
 +			disable_user_entities($guid);
  			// Delete any existing stuff
  			return delete_data("DELETE from {$CONFIG->dbprefix}users_entity where guid=$guid");
  		}
 | 
