<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.

	This file is part of COLLABORATION SUITE of POSH http://sourceforge.net/projects/posh/.

	POSH is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version

	POSH is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Posh.  If not, see <http://www.gnu.org/licenses/>.
*/
# ***************************************
# Check access the user has on groups
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : éàèù
# ***************************************

// check the access the user has on the group
// 3 = access public information / 2 = access private information
$DB->getResults($xmlnotebookprofile_isInGroup, $DB->escape($id), $DB->escape($_SESSION["user_id"]));
if ($DB->nbResults()==0)
{
	$groupbookAccessLevel="'3'";
	$userIsMemberOfGroup = 0;
	$groupType = -1;
	$groupOwner = -1;
}
else
{
	$row = $DB->fetch(0);
	$groupbookAccessLevel="'3', '2'";
	$userIsMemberOfGroup = 1;
	$groupType = $row['private'];
	$groupKey = $row['privatekey'];
	$groupName = $row['name'];
	$groupOwner = $row['created_by'];
}
$DB->freeResults();

?>