fetchAll(PDO::FETCH_ASSOC); if (isset($data[0])) { // Updating if (MTrackACL::hasAllRights('User', 'modify')) { if (isset($_POST['active'])) { $active = $_POST['active'] == 'on' ? '1' : '0'; } else { $active = '0'; } MTrackDB::q('update userinfo set fullname = ?, email = ?, timezone = ?, active = ?, sshkeys = ? where userid = ?', $_POST['fullname'], $_POST['email'], $_POST['timezone'], $active, $_POST['keys'], $user); } else { MTrackDB::q('update userinfo set fullname = ?, email = ?, timezone = ?, sshkeys = ? where userid = ?', $_POST['fullname'], $_POST['email'], $_POST['timezone'], $_POST['keys'], $user); } } else { MTrackDB::q('insert into userinfo (active, fullname, email, timezone, sshkeys, userid) values (1, ?, ?, ?, ?, ?)', $_POST['fullname'], $_POST['email'], $_POST['timezone'], $_POST['keys'], $user); } if (MTrackACL::hasAllRights('User', 'modify')) { MTrackDB::q('delete from useraliases where userid = ?', $user); foreach (preg_split("/\r?\n/", $_POST['aliases']) as $alias) { if (!strlen(trim($alias))) { continue; } MTrackDB::q('insert into useraliases (userid, alias) values (?, ?)', $user, $alias); } $user_class = MTrackAuth::getUserClass($user); if (isset($_POST['user_role']) && $_POST['user_role'] != $user_class) { MTrackConfig::set('user_classes', $user, $_POST['user_role']); MTrackConfig::save(); } } $http_auth = MTrackAuth::getMech('MTrackAuth_HTTP'); if ($http_auth && !isset($_SERVER['REMOTE_USER']) && !empty($_POST['passwd1'])) { // Allow changing their password $http_auth->setUserPassword($user, $_POST['passwd1']); } header("Location: {$ABSWEB}user.php?user=" . urlencode($user)); exit; } } else { MTrackACL::requireAllRights('User', 'read'); } mtrack_head("User $user"); $data = MTrackDB::q('select * from userinfo where userid = ?', $user)->fetchAll(PDO::FETCH_ASSOC); if (isset($data[0])) { $data = $data[0]; } else { $data = null; } $display = $user; if (strlen($data['fullname'])) { $display .= " - " . $data['fullname']; } echo "

", htmlentities($display, ENT_QUOTES, 'utf-8'), "

"; echo "
"; echo mtrack_username($user, array( 'no_name' => true, 'size' => 128 )); echo "$data[email]
\n"; if (empty($_GET['edit'])) { $aliases = MTrackDB::q('select alias from useraliases where userid = ? order by alias', $user)->fetchAll(PDO::FETCH_COLUMN, 0); if (count($aliases)) { echo "

Aliases

\n"; } } echo "
"; if (empty($_GET['edit'])) { $me = mtrack_canon_username(MTrackAuth::whoami()); if ($me != 'anonymous' && $me === $user) { $label = 'Edit my details'; } else if (MTrackACL::hasAnyRights('User', 'modify')) { $label = 'Edit user details'; } else { $label = null; } if ($label !== null) { echo "
" . "" . "" . "
"; } if (MTrackACL::hasAnyRights('Timeline', 'read')) { echo "

Recent Activity

\n"; mtrack_render_timeline($user); } } else { echo "
\n"; $fullname = htmlentities( isset($data['fullname']) ? $data['fullname'] : '', ENT_QUOTES, 'utf-8'); $email = htmlentities( isset($data['email']) ? $data['email'] : '', ENT_QUOTES, 'utf-8'); $timezone = htmlentities( isset($data['timezone']) ? $data['timezone'] : '', ENT_QUOTES, 'utf-8'); echo <<
User Information HTML; if (MTrackACL::hasAllRights('User', 'modify')) { if (isset($data['active'])) { $active = (int)$data['active']; } else { $active = 0; } if ($active) { $active = " checked='checked'"; } echo << HTML; $user_class = MTrackAuth::getUserClass($user); $user_class_roles = array(); foreach (MTrackConfig::getSection('user_class_roles') as $role => $rights) { $user_class_roles[$role] = $role; } $role_select = mtrack_select_box('user_role', $user_class_roles, $user_class); echo << HTML; } $http_auth = MTrackAuth::getMech('MTrackAuth_HTTP'); if ($http_auth && !isset($_SERVER['REMOTE_USER'])) { if ($me == $user) { $your = "your"; } else { $your = "this users"; } echo << HTML; } echo << HTML; $groups = MTrackAuth::getGroups($user); echo <<GroupsThis user is a member of the following groups

We use this with Gravatar to obtain your avatar image throughout mtrack

We use this to show times in your preferred timezone

Active users are shown in the Responsible users list when editing tickets
$role_select
The role defines which actions this user can carry out in mtrack

Enter $your new password

Confirm $your new password