diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-09-11 16:51:00 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-09-11 16:51:00 +0000 |
commit | 1d059dc06d24e02c858c43d70eaa70453d51cdff (patch) | |
tree | d29378c81ec8a9498a33ed7276722031c1f12981 /templates | |
parent | bfdc6bd7380fda2d5d8ca78a462047069c4020bc (diff) | |
download | semanticscuttle-1d059dc06d24e02c858c43d70eaa70453d51cdff.tar.gz semanticscuttle-1d059dc06d24e02c858c43d70eaa70453d51cdff.tar.bz2 |
New Feature: add users admin page with delete function
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@146 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'templates')
-rw-r--r-- | templates/toolbar.inc.php | 5 | ||||
-rw-r--r-- | templates/userlist.tpl.php | 34 |
2 files changed, 39 insertions, 0 deletions
diff --git a/templates/toolbar.inc.php b/templates/toolbar.inc.php index 593ee0f..92d8d59 100644 --- a/templates/toolbar.inc.php +++ b/templates/toolbar.inc.php @@ -4,6 +4,7 @@ if ($userservice->isLoggedOn()) { $cUser = $userservice->getCurrentUser(); $cUserId = $userservice->getCurrentUserId(); $cUsername = $cUser[$userservice->getFieldName('username')]; + $isAdmin = $userservice->isAdmin($cUser[$userservice->getFieldname('primary')]); ?> <ul id="navigation"> @@ -14,6 +15,10 @@ if ($userservice->isLoggedOn()) { <li><a href="<?php echo createURL('bookmarks', $cUsername . '?action=add'); ?>"><?php echo T_('Add a Bookmark'); ?></a></li> <li class="access"><?php echo $cUsername?><a href="<?php echo $GLOBALS['root']; ?>?action=logout">(<?php echo T_('Log Out'); ?>)</a></li> <li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li> + <?php if($isAdmin): ?>
+ <li><a href="<?php echo createURL('admin', ''); ?>"><?php echo '['.T_('Admin').']'; ?></a></li>
+ <?php endif; ?> + </ul> <?php diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php new file mode 100644 index 0000000..e05ea6d --- /dev/null +++ b/templates/userlist.tpl.php @@ -0,0 +1,34 @@ +<?php
+
+$userservice =& ServiceFactory::getServiceInstance('UserService'); + +$currentUser = $userservice->getCurrentUser();
+$currentUserID = $userservice->getCurrentUserId();
+$currentUsername = $currentUser[$userservice->getFieldName('username')]; +
+
+$this->includeTemplate($GLOBALS['top_include']);
+
+echo '<ol id="bookmarks">';
+
+foreach(array_keys($users) as $key) {
+
+ echo '<li class="xfolkentry">'."\n";
+
+ echo '<div class="link">';
+ echo '<a href="'.createURL('profile', $users[$key][$userservice->getFieldname('username')]).'">'.$users[$key][$userservice->getFieldName('username')].'</a>';
+ echo '</div>';
+ + if($users[$key][$userservice->getFieldName('username')] != $currentUsername) {
+ echo '<div class="meta">';
+ echo '<a href="'.createURL('admin','delete/'.$users[$key][$userservice->getFieldname('username')]).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>';
+ echo '</div>'; + }
+
+ echo '</li>'."\n";
+}
+
+$this->includeTemplate('sidebar.tpl');
+$this->includeTemplate($GLOBALS['bottom_include']);
+
+?>
|