added initial admin/admin account when sql/install is executed, also added the admin's functionality: libuserlist
--HG-- branch : quitta-gsoc-2013hg/feature/sse2
parent
4f82afa5d0
commit
8ff40bb619
@ -1,50 +1,60 @@
|
||||
<?php
|
||||
|
||||
//This checks to see if there is a page number. If not, it will set it to page 1
|
||||
if (!(isset($_GET['pagenum']))){
|
||||
$pagenum = 1;
|
||||
}else{
|
||||
$pagenum = $_GET['pagenum'];
|
||||
}
|
||||
|
||||
//Here we count the number of results
|
||||
global $cfg;
|
||||
$dbl = new DBLayer($cfg['db']['lib']);
|
||||
$rows = $dbl->executeWithoutParams("SELECT * FROM ams_querycache")->rowCount();
|
||||
|
||||
//This is the number of results displayed per page
|
||||
$page_rows = 2;
|
||||
|
||||
//This tells us the page number of our last page
|
||||
$last = ceil($rows/$page_rows);
|
||||
|
||||
//this makes sure the page number isn't below one, or more than our maximum pages
|
||||
if ($pagenum < 1)
|
||||
{
|
||||
$pagenum = 1;
|
||||
}else if ($pagenum > $last) {
|
||||
$pagenum = $last;
|
||||
}
|
||||
|
||||
//This sets the range to display in our query
|
||||
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;
|
||||
|
||||
//This is your query again, the same one... the only difference is we add $max into it
|
||||
$data = $dbl->executeWithoutParams("SELECT * FROM ams_querycache $max");
|
||||
|
||||
//This is where we put the results in a resultArray to be sent to smarty
|
||||
|
||||
$pageResult['liblist'] = Array();
|
||||
$i = 0;
|
||||
while($row = $data->fetch(PDO::FETCH_ASSOC)){
|
||||
$decode = json_decode($row['query']);
|
||||
$pageResult['liblist'][$i]['id'] = $row['SID'];
|
||||
$pageResult['liblist'][$i]['type'] = $row['type'];
|
||||
$pageResult['liblist'][$i]['name'] = $decode[0];
|
||||
$pageResult['liblist'][$i]['mail'] = $decode[2];
|
||||
$i++;
|
||||
}
|
||||
$pageResult['permission'] = 1;
|
||||
$pageResult['no_visible_elements'] = 'FALSE';
|
||||
helpers :: loadtemplate( 'libuserlist', $pageResult);
|
||||
exit();
|
||||
function libuserlist(){
|
||||
|
||||
//This checks to see if there is a page number. If not, it will set it to page 1
|
||||
if (!(isset($_GET['pagenum']))){
|
||||
$pagenum = 1;
|
||||
}else{
|
||||
$pagenum = $_GET['pagenum'];
|
||||
}
|
||||
|
||||
//Here we count the number of results
|
||||
global $cfg;
|
||||
$dbl = new DBLayer($cfg['db']['lib']);
|
||||
$rows = $dbl->executeWithoutParams("SELECT * FROM ams_querycache")->rowCount();
|
||||
if($rows > 0){
|
||||
//This is the number of results displayed per page
|
||||
$page_rows = 2;
|
||||
|
||||
//This tells us the page number of our last page
|
||||
$last = ceil($rows/$page_rows);
|
||||
|
||||
//this makes sure the page number isn't below one, or more than our maximum pages
|
||||
if ($pagenum < 1)
|
||||
{
|
||||
$pagenum = 1;
|
||||
}else if ($pagenum > $last) {
|
||||
$pagenum = $last;
|
||||
}
|
||||
|
||||
//This sets the range to display in our query
|
||||
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;
|
||||
|
||||
//This is your query again, the same one... the only difference is we add $max into it
|
||||
$data = $dbl->executeWithoutParams("SELECT * FROM ams_querycache $max");
|
||||
|
||||
//This is where we put the results in a resultArray to be sent to smarty
|
||||
|
||||
$pageResult['liblist'] = Array();
|
||||
$i = 0;
|
||||
while($row = $data->fetch(PDO::FETCH_ASSOC)){
|
||||
$decode = json_decode($row['query']);
|
||||
$pageResult['liblist'][$i]['id'] = $row['SID'];
|
||||
$pageResult['liblist'][$i]['type'] = $row['type'];
|
||||
$pageResult['liblist'][$i]['name'] = $decode[0];
|
||||
$pageResult['liblist'][$i]['mail'] = $decode[2];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
//check if shard is online
|
||||
try{
|
||||
$dbs = new DBLayer($cfg['db']['shard']);
|
||||
$pageResult['shard'] = "online";
|
||||
}catch(PDOException $e) {
|
||||
$pageResult['shard'] = "offline";
|
||||
}
|
||||
return $pageResult;
|
||||
}
|
@ -1,15 +1,11 @@
|
||||
{extends file="layout.tpl"}
|
||||
{block name=menu}
|
||||
<li class="nav-header hidden-tablet">Main</li>
|
||||
<li><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
|
||||
<li><a class="ajax-link" href="settings.php"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
|
||||
<li><a href="logout.php"><i class="icon-lock"></i><span class="hidden-tablet"> Logout</span></a></li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Admin</li>
|
||||
<li><a class="ajax-link" href="checkuser.php"><i class="icon-user"></i><span class="hidden-tablet">UserList</span></a></li>
|
||||
<li><a class="ajax-link" href="banlist.php"><i class="icon-remove"></i><span class="hidden-tablet"> BanList</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Ticketing</li>
|
||||
<li><a class="ajax-link" href="generalqueue.php"><i class="icon-th-list"></i><span class="hidden-tablet"> General Queue</span></a></li>
|
||||
<li><a class="ajax-link" href="personalQueue.php"><i class="icon-tag"></i><span class="hidden-tablet"> Personal Queue</span></a></li>
|
||||
<li><a class="ajax-link" href="archive.php"><i class="icon-folder-open"></i><span class="hidden-tablet"> Ticket Archive</span></a></li>
|
||||
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=libuserlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Liblist</span></a></li>
|
||||
<li class="nav-header hidden-tablet">Actions</li>
|
||||
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>
|
||||
|
||||
{/block}
|
||||
|
||||
|
Loading…
Reference in New Issue