Lisää data-tiedostot gittiin + dynaaminen SITE_URL
- companies.json, users.json, config.json gitin seurantaan - SITE_URL dynaaminen HTTP_HOST:in mukaan - MAIL_FROM vaihdettu noreply@noxus.fi - CuituNet Intra → Noxus Intra sähköposteissa Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -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/*/
|
||||
|
||||
9
api.php
9
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 = '<div style="font-family:sans-serif;max-width:500px;margin:0 auto;">';
|
||||
$html .= '<h2 style="color:#0f3460;">CuituNet Intra</h2>';
|
||||
$html .= '<h2 style="color:#0f3460;">Noxus Intra</h2>';
|
||||
$html .= '<p>Hei ' . htmlspecialchars($user['nimi'] ?: $user['username']) . ',</p>';
|
||||
$html .= '<p>Sait tämän viestin koska salasanan palautusta pyydettiin tilillesi.</p>';
|
||||
$html .= '<p><a href="' . $resetUrl . '" style="display:inline-block;background:#0f3460;color:#fff;padding:12px 24px;border-radius:8px;text-decoration:none;font-weight:600;">Vaihda salasana</a></p>';
|
||||
|
||||
14
data/companies.json
Normal file
14
data/companies.json
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
0
data/companies/cuitunet/.gitkeep
Normal file
0
data/companies/cuitunet/.gitkeep
Normal file
7
data/config.json
Normal file
7
data/config.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"api_key": "3de64ed2a3ece1c0f497345e41e8e76d",
|
||||
"cors_origins": [
|
||||
"https:\/\/cuitunet.fi",
|
||||
"https:\/\/www.cuitunet.fi"
|
||||
]
|
||||
}
|
||||
1
data/login_attempts.json
Normal file
1
data/login_attempts.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"ip":"::1","time":1773143220}]
|
||||
1
data/reset_tokens.json
Normal file
1
data/reset_tokens.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
17
data/users.json
Normal file
17
data/users.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user