-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuseraccount.php
52 lines (42 loc) · 1.64 KB
/
useraccount.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
<?php
require('./config/config.php');
require('./code/init.php');
require('./code/template.class.php');
require('./code/dbaccess.class.php');
require('./code/dbaccess-users.class.php');
$ui = parse_ini_file('./html/' . $_GET['prj'] . '/ui.ini', TRUE);
$db = new Database();
if (!$db->connx) {
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;
}
$template = new Template();
$template->SetPageVars($_GET['prj'], 'useraccount', $dbaUsers);
list($ok, $result) = $dbaUsers->selectUser($id_user);
if (!$ok) {
setSysMsg($result);
header(URL_HEADER . 'home.php?prj=' . $_GET['prj']);
exit;
}
$data = $result[0];
$template->SetTrunkVar('TAB_TITLE', $ui['tabs']['useraccount'].' ('.$data['login'].')');
$template->SetTrunkVars($ui['userAccount']);
$template->SetTrunkVars(array('PRJ' => $_GET['prj'],
'LOGIN' => $data['login'],
'MYNAME' => $data['name'],
'MYEMAIL' => $data['email'],
'CRYPTEDPW' => $data['pw'],
'EMAILNOTIFCHECKED' => ($data['emailnotif']) ? 'checked="checked"' : '',
'ENOTIFAUTOCHECKED' => ($data['enotifauto']) ? 'checked="checked"' : ''));
// display
$template->Grow('./html/div.head.tpl.html');
$template->Grow('./html/useraccount.div.tpl.html');
$template->Grow('./html/div.foot.tpl.html');
?>