update copyright year
[GitHub/Stricted/Domain-Control-Panel.git] / lib / page / ApiManagementPage.class.php
CommitLineData
2aa91ff2
S
1<?php
2namespace dns\page;
3use dns\system\DNS;
4use dns\system\User;
5
6/**
7 * @author Jan Altensen (Stricted)
8 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
d4779364 9 * @copyright 2014-2016 Jan Altensen (Stricted)
2aa91ff2
S
10 */
11class ApiManagementPage extends AbstractPage {
12 public $activeMenuItem = 'api';
13
14 public function prepare() {
15 $sql = "SELECT * FROM dns_api WHERE userID = ?";
5a33cd73 16 $res = DNS::getDB()->query($sql, array(DNS::getSession()->userID));
2aa91ff2
S
17 $row = DNS::getDB()->fetch_array($res);
18
19 $apiKey = "";
20
21 if (isset($row['apiKey'])) {
22 $apiKey = $row['apiKey'];
23 }
24
e2ca4332 25 DNS::getTPL()->assign(array("userID" => DNS::getSession()->userID,"apiKey" => $apiKey));
2aa91ff2
S
26 }
27}