Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/modules/general.php
<?
//*****************************************************************************
/* Permissions of Admin menu options*/
//*****************************************************************************
function permission_of($permission){
	$obj_tempdbarray = new CTempDBArray();
	$obj_tempdbengine = new CTempDBEngine();

	$obj_tempdb2array = new CTempDBArray();
	$obj_tempdb2engine = new CTempDBEngine();

	$SQL = "SELECT * FROM permissions ";
	$SQL .= "WHERE active='1' ";
	$SQL .= "AND permission_tag='".strtolower($permission)."' ";
	$row = $obj_tempdbengine->GetRow($SQL);
	if ($row!=null){
		$permission_id = $row['permission_id'];
		$SQL2 = "SELECT * FROM group_permissions ";
		$SQL2 .= "WHERE group_id='".intval($_SESSION['gid'])."' ";
		$SQL2 .= "AND permission_id='".intval($permission_id)."' ";
		$row2 = $obj_tempdb2engine->GetRow($SQL2);
		if ($row2!=null)
			return true;
		else
			return false;
	}
	else
		return false;
}


?>
Return current item: ChiCoMaS - Chilek CMS