added a userlist to browse users and edit their settings as admin
--HG-- branch : quitta-gsoc-2013hg/feature/sse2
parent
0b9ad19e35
commit
25f479f3d0
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function userlist(){
|
||||||
|
if(WebUsers::isAdmin()){
|
||||||
|
$users = WebUsers::getUsers();
|
||||||
|
$i = 0;
|
||||||
|
$pageResult['userlist'] = Array();
|
||||||
|
while($row = $users->fetch(PDO::FETCH_ASSOC)){
|
||||||
|
$pageResult['userlist'][$i]['id'] = $row['UId'];
|
||||||
|
$pageResult['userlist'][$i]['username'] = $row['Login'];
|
||||||
|
$pageResult['userlist'][$i]['permission'] = $row['Permission'];
|
||||||
|
$pageResult['userlist'][$i]['email'] = $row['Email'];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
return $pageResult;
|
||||||
|
}else{
|
||||||
|
print('no permission');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +1,45 @@
|
|||||||
{block name=content}
|
{block name=content}
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="box span12">
|
||||||
|
<div class="box-header well" data-original-title>
|
||||||
|
<h2><i class="icon-user"></i> Members</h2>
|
||||||
|
<div class="box-icon">
|
||||||
|
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
|
||||||
|
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
||||||
|
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-content">
|
||||||
|
<table class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Permission</th>
|
||||||
|
<th>Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{foreach from=$userlist item=element}
|
||||||
|
<tr>
|
||||||
|
<td>{$element.id}</td>
|
||||||
|
<td class="center">{$element.username}</td>
|
||||||
|
<td class="center">{$element.email}</td>
|
||||||
|
{if $element.permission eq 1}<td class="center"><span class="label label-success">User</span></td>{/if}
|
||||||
|
{if $element.permission eq 2}<td class="center"><span class="label label-warning">Admin</span></td>{/if}
|
||||||
|
<td class="center">
|
||||||
|
<a class="btn btn-info" href="index.php?page=settings&id={$element.id}"><i class=" icon-pencil icon-white"></i>Edit User</a>
|
||||||
|
</td>
|
||||||
|
|
||||||
<div class="row-fluid">
|
</tr>
|
||||||
<div class="box span12">
|
{/foreach}
|
||||||
<div class="box-header well">
|
|
||||||
<h2><i class="icon-info-sign"></i> {$userlist_info}</h2>
|
|
||||||
<div class="box-icon">
|
|
||||||
<a href="#" class="btn btn-round" onclick="javascript:show_help('intro');return false;"><i class="icon-info-sign"></i></a>
|
|
||||||
<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
|
|
||||||
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
|
|
||||||
<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box-content">
|
|
||||||
<p><strong>The shard/lib/web db user list</strong> You are about to see it here!</p>
|
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!--/span-->
|
||||||
|
|
||||||
|
</div><!--/row-->
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue