index : flyspray | |
Archlinux32 customized Flyspray installation | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-01 09:05:48 +0100 |
commit | 6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch) | |
tree | 350feb504587d932e02837a1442b059759927646 /scripts/user.php |
-rw-r--r-- | scripts/user.php | 43 |
diff --git a/scripts/user.php b/scripts/user.php new file mode 100644 index 0000000..9993d9a --- /dev/null +++ b/scripts/user.php @@ -0,0 +1,43 @@ +<?php + + /*********************************************************\ + | View a user's profile | + | ~~~~~~~~~~~~~~~~~~~~ | + \*********************************************************/ + +if (!defined('IN_FS')) { + die('Do not access this file directly.'); +} + +$page->assign('groups', Flyspray::listGroups()); + +if ($proj->id) { + $page->assign('project_groups', Flyspray::listGroups($proj->id)); +} + +$id = Flyspray::validUserId(Get::val('id', Get::val('uid'))); +if (!$id) { + $id = Flyspray::usernameToId(Get::val('user_name')); +} + +$theuser = new User($id); +if ($theuser->isAnon()) { + Flyspray::show_error(19); +} + +// Some possibly interesting information about the user +$sql = $db->query('SELECT count(*) FROM {comments} WHERE user_id = ?', array($theuser->id)); +$page->assign('comments', $db->fetchOne($sql)); + +$sql = $db->query('SELECT count(*) FROM {tasks} WHERE opened_by = ?', array($theuser->id)); +$page->assign('tasks', $db->fetchOne($sql)); + +$sql = $db->query('SELECT count(*) FROM {assigned} WHERE user_id = ?', array($theuser->id)); +$page->assign('assigned', $db->fetchOne($sql)); + +$page->assign('theuser', $theuser); + +$page->setTitle($fs->prefs['page_title'] . L('viewprofile')); +$page->pushTpl('profile.tpl'); + +?> |