diff --git a/.gitignore b/.gitignore index 1dc4932..e067634 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,2 @@ -data/customers.json -data/users.json -data/changelog.json -data/archive.json -data/leads.json -data/config.json -data/tickets.json -data/reset_tokens.json -data/login_attempts.json data/backups/ data/files/ -data/companies.json -data/companies/*/ diff --git a/api.php b/api.php index f58dde9..f5260b3 100644 --- a/api.php +++ b/api.php @@ -15,11 +15,12 @@ define('TOKENS_FILE', DATA_DIR . '/reset_tokens.json'); define('RATE_FILE', DATA_DIR . '/login_attempts.json'); define('CONFIG_FILE', DATA_DIR . '/config.json'); define('COMPANIES_FILE', DATA_DIR . '/companies.json'); -define('SITE_URL', 'https://intra.cuitunet.fi'); +// Dynaaminen SITE_URL domainin mukaan +define('SITE_URL', 'https://' . ($_SERVER['HTTP_HOST'] ?? 'intra.noxus.fi')); // Sähköpostiasetukset (fallback) -define('MAIL_FROM', 'sivusto@cuitunet.fi'); -define('MAIL_FROM_NAME', 'CuituNet Intra'); +define('MAIL_FROM', 'noreply@noxus.fi'); +define('MAIL_FROM_NAME', 'Noxus Intra'); // Varmista data-kansio ja globaalit tiedostot if (!file_exists(DATA_DIR)) mkdir(DATA_DIR, 0755, true); @@ -1322,7 +1323,7 @@ switch ($action) { saveToken($user['id'], $token); $resetUrl = SITE_URL . '/?reset=' . $token; $html = '
'; - $html .= '

CuituNet Intra

'; + $html .= '

Noxus Intra

'; $html .= '

Hei ' . htmlspecialchars($user['nimi'] ?: $user['username']) . ',

'; $html .= '

Sait tämän viestin koska salasanan palautusta pyydettiin tilillesi.

'; $html .= '

Vaihda salasana

'; diff --git a/data/companies.json b/data/companies.json new file mode 100644 index 0000000..c4cbd47 --- /dev/null +++ b/data/companies.json @@ -0,0 +1,14 @@ +[ + { + "id": "cuitunet", + "nimi": "CuituNet", + "luotu": "2026-03-10 08:58:43", + "aktiivinen": true, + "domains": [ + "localhost", + "intra.cuitunet.fi" + ], + "primary_color": "#0f3460", + "subtitle": "Kuituasiakkaiden hallinta" + } +] \ No newline at end of file diff --git a/data/companies/cuitunet/.gitkeep b/data/companies/cuitunet/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/config.json b/data/config.json new file mode 100644 index 0000000..f3f3f26 --- /dev/null +++ b/data/config.json @@ -0,0 +1,7 @@ +{ + "api_key": "3de64ed2a3ece1c0f497345e41e8e76d", + "cors_origins": [ + "https:\/\/cuitunet.fi", + "https:\/\/www.cuitunet.fi" + ] +} \ No newline at end of file diff --git a/data/login_attempts.json b/data/login_attempts.json new file mode 100644 index 0000000..1d536b0 --- /dev/null +++ b/data/login_attempts.json @@ -0,0 +1 @@ +[{"ip":"::1","time":1773143220}] \ No newline at end of file diff --git a/data/reset_tokens.json b/data/reset_tokens.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/data/reset_tokens.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/data/users.json b/data/users.json new file mode 100644 index 0000000..3591271 --- /dev/null +++ b/data/users.json @@ -0,0 +1,17 @@ +[ + { + "id": "419d4b0c32b88d91", + "username": "admin", + "password_hash": "$2y$12$dEscK23qZ6Dt3idZxZxYl.6Z6sRdEWKeWvb7zmDYWDKsK/.l7bfli", + "nimi": "Ylläpitäjä", + "role": "admin", + "luotu": "2026-03-09 22:36:39", + "companies": [ + "cuitunet" + ], + "email": "", + "signatures": { + "846898d4a1cb3a08": "Jukka Lampikoski\nCuituNet Oy\nasiakaspalvelu@cuitunet.fi" + } + } +] \ No newline at end of file