Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit 5d9f2cd

Browse files
committed
Imprint URL Support
1 parent 3ce99c7 commit 5d9f2cd

File tree

9 files changed

+52
-7
lines changed

9 files changed

+52
-7
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
latest
2-
0.2.7
2+
0.2.8
33
0.2
44
0

docker-compose.dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ services:
1818
- DEVMODE=true
1919
- CONF_DOMAIN=http://localhost:8080/
2020
- CONF_TIMEZONE=Europe/Berlin # php timezone string
21+
- CONF_IMPRESSUMURL=http://example.com/impressum
22+
- CONF_IMPRESSUMNAME=Imprint and Privacy
2123
- ADMIN_ACCOUNT=admin
2224
- ADMIN_PASSWORD=password

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ services:
1313
- DEVMODE=false
1414
- CONF_DOMAIN=http://localhost:8080/
1515
- CONF_TIMEZONE=Europe/Berlin # php timezone string
16+
#- CONF_IMPRESSUMURL=http://example.com/impressum # imprint/ privacy link and name pf link (optional)
17+
#- CONF_IMPRESSUMNAME=Imprint and Privacy
1618
- ADMIN_ACCOUNT=test # admin account (initial creation on docker container startup)
1719
- ADMIN_PASSWORD=

php/core/Config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,15 @@ public static function getBaseUrl() : string {
3737
}
3838
return $d;
3939
}
40+
41+
public static function getImprintData() : ?array {
42+
if(empty($_ENV['CONF_IMPRESSUMURL']) || empty($_ENV['CONF_IMPRESSUMURL'])){
43+
return null;
44+
}
45+
return array(
46+
'IMPRESSUMURL' => $_ENV['CONF_IMPRESSUMURL'],
47+
'IMPRESSUMNAME' => $_ENV['CONF_IMPRESSUMNAME']
48+
);
49+
}
4050
}
4151
?>

php/core/WebGUI.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,20 @@ public function __construct( ParamParser $param, Login $login ) {
3838
else{
3939
$this->mainTemp->setContent('HOMELINK', '');
4040
}
41+
42+
$this->fillTemplateWithImprint($this->mainTemp);
4143
}
4244

45+
private function fillTemplateWithImprint( Template $t ) : void {
46+
$imprintData = Config::getImprintData();
47+
if(!is_null($imprintData)){
48+
$t->setContent('COOKIEBANNER', '');
49+
foreach($imprintData as $k => $v){
50+
$t->setContent($k, $v);
51+
}
52+
}
53+
}
54+
4355
public function accountManage() : void {
4456
$this->mainTemp->setContent('TITLE', 'Account Management');
4557
$account = new Template('account');
@@ -276,6 +288,7 @@ public function loginForm() : void {
276288
$this->mainTemp->setContent('TITLE', 'Login');
277289
$login = new Template('login');
278290
$this->mainTemp->includeTemplate($login);
291+
$this->fillTemplateWithImprint($login);
279292
}
280293

281294
public function __destruct(){

php/core/templates/login.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{}
1+
{
2+
"%%COOKIEBANNER%%" : "disable",
3+
"%%IMPRESSUMURL%%" : "",
4+
"%%IMPRESSUMNAME%%" : ""
5+
}

php/core/templates/login_en.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
<input type="submit" value="Login" class="btn btn-secondary">
2020
</div>
2121
</div>
22+
<div class="alert alert-info %%COOKIEBANNER%%" role="alert">
23+
<h4 class="alert-heading">Cookies</h4>
24+
This site uses cookies to make the login work. This site does not use any tracking or third party cookies.
25+
Beside the cookie for the login, inputs of a user may be stored in the user's browser,
26+
so that the input fields can already be filled in.<br/>
27+
For more information see about cookies and privacy see <a href="%%IMPRESSUMURL%%" target="_blank">%%IMPRESSUMNAME%%</a>.
28+
</div>
2229
</form>
2330

2431

php/core/templates/main.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"%%INNERCONTAINER%%" : "",
55
"%%DISPLAYLOGOUTBOX%%" : "disable",
66
"%%GROUP%%" : "",
7-
"%%HOMELINK%%" : "<a href=\"%%SERVERURL%%\/\"><button type=\"button\" class=\"btn btn-dark\">&larr; Home<\/button><\/a>"
7+
"%%HOMELINK%%" : "<a href=\"%%SERVERURL%%\/\"><button type=\"button\" class=\"btn btn-dark\">&larr; Home<\/button><\/a>",
8+
"%%COOKIEBANNER%%" : "disable",
9+
"%%IMPRESSUMURL%%" : "",
10+
"%%IMPRESSUMNAME%%" : ""
811
}

php/core/templates/main_en.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ <h2>%%TITLE%%</h2>
4949
<div id="footer">
5050
<center>
5151
<small>
52-
TaskTimeTerminate Server for
53-
<a href="https://github.com/KIMB-technologies/TaskTimeTerminate" target="_blank">TaskTimeTerminate by KIMB-technologies</a>
54-
&ndash;
55-
<a href="https://www.gnu.org/licenses/gpl-3.0.txt" target="_blank">GPLv3</a>
52+
<p>TaskTimeTerminate Server for
53+
<a href="https://github.com/KIMB-technologies/TaskTimeTerminate" target="_blank">TaskTimeTerminate by KIMB-technologies</a>
54+
&ndash;
55+
<a href="https://www.gnu.org/licenses/gpl-3.0.txt" target="_blank">GPLv3</a>
56+
</p>
57+
<p class="%%COOKIEBANNER%%">
58+
<a href="%%IMPRESSUMURL%%" target="_blank">%%IMPRESSUMNAME%%</a>
59+
</p>
5660
</small>
5761
</center>
5862
</div>

0 commit comments

Comments
 (0)