-
Notifications
You must be signed in to change notification settings - Fork 0
/
member_c.php
32 lines (27 loc) · 911 Bytes
/
member_c.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
<?php
require('./config/config.php');
require('./code/init.php');
require('./code/dbaccess.class.php');
require('./code/dbaccess-users.class.php');
$db = new Database();
if (!$db->connx) {
setSysMsg('_nobase');
header(URL_HEADER . 'home.php?prj=' . $_GET['prj']);
exit;
}
$dbaUsers = new dbaccessUsers($db);
list($id_user, $rank, $error) = $dbaUsers->connectUser($_COOKIE['login'], $_COOKIE['pw'], $_GET['prj']);
if ($id_user == -1) {
setSysMsg($error);
header(URL_HEADER . 'home.php?prj=' . $_GET['prj']);
exit;
}
if ($rank > 2 or ($_POST['user_rank'] == 1 and $rank > 1)) {
setSysMsg('_noaccess');
header(URL_HEADER . 'home.php?prj=' . $_GET['prj']);
exit;
}
list($ok, $msgcode) = $dbaUsers->setRank($_POST['id_user'], $_GET['prj'], $_POST['user_rank']);
setSysMsg($msgcode);
header(URL_HEADER . 'member.php?prj=' . $_GET['prj'] . '&id_user=' . $_POST['id_user']);
?>