This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
/
groups_notices.php
67 lines (56 loc) · 1.77 KB
/
groups_notices.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
if ($already_initialized != 1)
{
require("./inc/script_inicialization.php");
require_once("./inc/nrp_api.php");
}
if (!empty($_POST['group_id']))
$group_id = $_POST['group_id'];
elseif (!empty($_GET['group_id']))
$group_id = $_GET['group_id'];
if (Validate_Session($complete_sess_id, $_SERVER['REMOTE_ADDR'], $bd))
{
Get_Account_Id($sess_id, $account_id, $bd);
$membership = Member_Role($group_id, $account_id, $bd);
// If the user is actually member of the group
if ($membership == -1)
{
$error[$num_errors++] = "You are not member of this group";
include "groups.php";
exit;
}
else
{
$groups = List_Groups($group_id, '', '', '', 1, $bd);
switch($membership)
{
case 'O': $result_xsl = "xsl/" . $cfg['default_xsl'] . "/groups_notices_mod.xsl"; break;
case 'M': $result_xsl = "xsl/" . $cfg['default_xsl'] . "/groups_notices_mod.xsl"; break;
case 'C': $result_xsl = "xsl/" . $cfg['default_xsl'] . "/groups_notices.xsl"; break;
case 'I': $result_xsl = "xsl/" . $cfg['default_xsl'] . "/groups_notices.xsl"; break;
}
}
$people = array();
for ($i = 0; $groups[0][5][$i]; $i++)
{
$people = array_merge($people, List_People($groups[0][5][$i][0], '', '', '', '', $bd));
}
$notices = List_Notices($group_id, '', '', $bd);
}
else
{
$error[$num_errors++] = "Invalid Session ID";
include "logout.php";
exit;
}
$smarty->assign("nrpTransform", $result_xsl);
$smarty->assign("nrpSchedErrors", $error);
$smarty->assign("nrpSchedAlerts", $alert);
$smarty->assign("nrpSessId", $complete_sess_id);
$smarty->assign("nrpPeople", $people);
$smarty->assign("nrpGroups", $groups);
$smarty->assign("nrpNotices", $notices);
$result_xml = $smarty->fetch("xml/groups.xml");
require("./inc/proc_transform.php");
// Calls the commands do procede the XSLT transformation
?>