-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathindex.php
75 lines (62 loc) · 2.3 KB
/
index.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
68
69
70
71
72
73
74
75
<?php
/************************************************************************/
/* AContent */
/************************************************************************/
/* Copyright (c) 2013 */
/* Inclusive Design Institute */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
define('TR_INCLUDE_PATH', '../include/');
require(TR_INCLUDE_PATH.'vitals.inc.php');
require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php');
unset($_SESSION['course_id']);
global $_current_user;
if (!isset($_current_user))
{
require(TR_INCLUDE_PATH.'header.inc.php');
$msg->printInfos('INVALID_USER');
require(TR_INCLUDE_PATH.'footer.inc.php');
exit;
}
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
Header('Location: ../index.php');
exit;
}
if (isset($_POST['submit'])) {
if (isset($_POST['is_author'])) $is_author = 1;
else $is_author = 0;
$usersDAO = new UsersDAO();
$user_row = $usersDAO->getUserByID($_SESSION['user_id']);
if ($usersDAO->Update($_SESSION['user_id'],
$user_row['user_group_id'],
$user_row['login'],
$user_row['email'],
$_POST['first_name'],
$_POST['last_name'],
$is_author,
$_POST['organization'],
$_POST['phone'],
$_POST['address'],
$_POST['city'],
$_POST['province'],
$_POST['country'],
$_POST['postal_code'],
$_POST['status']))
{
$msg->addFeedback('PROFILE_UPDATED');
}
}
$row = $_current_user->getInfo();
if (!isset($_POST['submit'])) {
$_POST = $row;
}
/* template starts here */
$savant->assign('row', $row);
global $onload;
$onload = 'document.form.first_name.focus();';
$savant->display('profile/index.tmpl.php');
?>