2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../include/');
14 require(TR_INCLUDE_PATH.'vitals.inc.php');
15 require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php');
17 global $_current_user;
19 if (!isset($_current_user))
21 require(TR_INCLUDE_PATH.'header.inc.php');
22 $msg->printInfos('INVALID_USER');
23 require(TR_INCLUDE_PATH.'footer.inc.php');
27 if (isset($_POST['cancel'])) {
28 $msg->addFeedback('CANCELLED');
29 Header('Location: ../index.php');
33 if (isset($_POST['submit'])) {
34 if (isset($_POST['is_author'])) $is_author = 1;
37 $usersDAO = new UsersDAO();
38 $user_row = $usersDAO->getUserByID($_SESSION['user_id']);
40 if ($usersDAO->Update($_SESSION['user_id'],
41 $user_row['user_group_id'],
47 $_POST['organization'],
53 $_POST['postal_code'],
57 $msg->addFeedback('PROFILE_UPDATED');
61 $row = $_current_user->getInfo();
63 if (!isset($_POST['submit'])) {
67 /* template starts here */
68 $savant->assign('row', $row);
71 $onload = 'document.form.first_name.focus();';
73 $savant->display('profile/index.tmpl.php');