<?PHP
// Pushok's SEMA (Small Enterprise Management Application)
//
// Copyright (C) 2004 Pushok Software http://www.pushok.com
//
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
function web_RightsMenuCreate(&$oIn, &$oOut)
{
if ( !is_array($oIn) || !isset($oIn['idobject']) || !isset($oIn['type']) )
return false;
$_oIn = array('idcontact'=>$_SESSION['iduser'], 'idobject'=>$oIn['idobject'], 'type'=>$oIn['type'], 'mask'=>'5');
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_HAS_MASK", $_oIn, $_oOut);
if ( isset($_oOut['result']) && $_oOut['result'] )
$oOut[0][_LW('Permissions')] = "?page=/web/rights/rights_view.php&idobject=".$oIn['idobject']."&idobject_type=".$oIn['type'];
$_oIn = array('idcontact'=>$_SESSION['iduser'], 'idobject'=>$oIn['idobject'], 'mask'=>'RW5');
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_HAS_MASK", $_oIn, $_oOut);
if (isset($_oOut['result']) && $_oOut['result'])
$oOut[0][_LW("Ownership")] = "?page=/web/rights/rights_object_flags.php&idobject=".$oIn['idobject'];
return true;
}
function web_ObjectFlagsSet(&$oIn, &$oOut)
{
if ( !is_array($oIn) )
return false;
if ( $oIn['step'] == 1 )
{
if ( isset($oIn['post']['flags']) && !strlen($oIn['post']['flags']) )
web_AddErrorMsg($oOut, _LW("You must input 'Flags'!"));
}
elseif ( $oIn['step'] == 2 )
{
$oIn['post']['idcontact_current'] = $_SESSION['iduser'];
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_OBJECT_FLAGS_SET", $oIn['post'], $oOut);
}
return true;
}
?>