Skip to content
sites.inc.php 40.5 KiB
Newer Older
Cédric's avatar
Cédric committed
		if ($client_id != null)
			$client_id = $app->functions->intval($client_id);
		
		return $app->quota_lib->get_ftptrafficquota_data($client_id, $lastdays);
	}
	
	public function databasequota_get_by_user($session_id, $client_id)
	{
		global $app;
		$app->uses('quota_lib');
	
		if(!$this->checkPerm($session_id, 'databasequota_get_by_user')) {
			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}
	
		return $app->quota_lib->get_databasequota_data($client_id, false);
	}
	
	// ----------------------------------------------------------------------------------------------------------

	//* Get record details
	public function sites_webdav_user_get($session_id, $primary_id)
	{
		global $app;

		if(!$this->checkPerm($session_id, 'sites_webdav_user_get')) {
			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}
		$app->uses('remoting_lib');
		$app->remoting_lib->loadFormDef('../sites/form/webdav_user.tform.php');
		return $app->remoting_lib->getDataRecord($primary_id);
	}

	//* Add a record
	public function sites_webdav_user_add($session_id, $client_id, $params)
	{
		if(!$this->checkPerm($session_id, 'sites_webdav_user_add')) {
			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}
		return $this->insertQuery('../sites/form/webdav_user.tform.php', $client_id, $params);
	}

	//* Update a record
	public function sites_webdav_user_update($session_id, $client_id, $primary_id, $params)
	{
		if(!$this->checkPerm($session_id, 'sites_webdav_user_update')) {
			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}
		$affected_rows = $this->updateQuery('../sites/form/webdav_user.tform.php', $client_id, $primary_id, $params);
		return $affected_rows;
	}

	//* Delete a record
	public function sites_webdav_user_delete($session_id, $primary_id)
	{
		global $app;
		if(!$this->checkPerm($session_id, 'sites_webdav_user_delete')) {
			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}

		$affected_rows = $this->deleteQuery('../sites/form/webdav_user.tform.php', $primary_id);
		return $affected_rows;
	}