123456789101112131415161718192021222324252627 |
- <?php
- require_once("../config.php");
- if(isset($_SESSION['authorized']) && $_SESSION['authorized']) {
- header("Location: /dashboard/");
- }
- $database = SqliteDatabase::getSingleton();
- $validAccounts = $database->queryArray("SELECT rowid AS client_id, subdomain FROM accounts;");
- $clientId = 0;
- foreach($validAccounts as $account) {
- if($account['subdomain'] == DOMAIN) {
- $clientId = $account['client_id'];
- break;
- }
- }
- if($clientId == 0) {
- header("Location: http://ccldtech.com");
- }
- $currentAccount = $database->queryArray("SELECT rowid AS client_id, * FROM accounts WHERE client_id = ".$clientId." LIMIT 1;")[0];
- $data = array();
- $data['currentClient'] = $currentAccount;
- $data['defaultStylesheet'] = DOMAIN . ".css";
- $data['currentClient']['logo'] = "ccldlogo.png";
- echo (new View())->render("login.php", $data);
|