Initial API release

This commit is contained in:
laf
2014-07-07 00:15:04 +01:00
parent 704d7f6703
commit edec1c0c7d
25 changed files with 6292 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if ($_SESSION['userlevel'] == '10')
{
echo('
<table class="table table-bordered table-condensed">
<tr>
<th>User</th>
<th>Token Hash</th>
<th>Description</th>
</tr>
');
foreach (dbFetchRows("SELECT `AT`.*,`U`.`username` FROM `api_tokens` AS AT JOIN users AS U ON AT.user_id=U.user_id ORDER BY AT.user_id") as $api)
{
echo('
<tr>
<td>'.$api['username'].'</td>
<td>'.$api['token_hash'].'</td>
<td>'.$api['description'].'</td>
</tr>
');
}
echo('
</table>
');
} else {
include("includes/error-no-perm.inc.php");
}
?>