* * 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') { if (empty($_POST['token'])) { $_POST['token'] = bin2hex(openssl_random_pseudo_bytes(16)); } ?>
'; if ($_SESSION['api_token'] === true) { echo " "; unset($_SESSION['api_token']); } echo '

API Access


 
'; 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) { if ($api['disabled'] == '1') { $api_disabled = 'checked'; } else { $api_disabled = ''; } echo ' '; } echo '
User Token Hash Description Disabled Remove
'.$api['username'].' '.$api['token_hash'].' '.$api['description'].'
'; ?>