-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saving files before refreshing line endings
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
use fruithost\Accounting\Auth; | ||
use fruithost\Templating\TemplateFiles; | ||
|
||
$this->getFiles()->addStylesheet('global', $this->url('css/global.css'), '1.0.0', [ 'bootstrap' ]); | ||
$this->getFiles()->addJavascript('global', $this->url('js/global.js'), '1.0.0', [ 'bootstrap' ], TemplateFiles::FOOTER); | ||
$this->getFiles()->addJavascript('ajax', $this->url('js/ajax.js'), '1.0.0', [ 'bootstrap' ], TemplateFiles::FOOTER); | ||
|
||
if(!Auth::isLoggedIn()) { | ||
$this->getFiles()->addStylesheet('login', $this->url('css/login.css'), '2.0.0', [ 'bootstrap' ]); | ||
$this->getFiles()->addJavascript('login', $this->url('js/login.js'), '1.0.0', [ 'bootstrap' ], TemplateFiles::FOOTER); | ||
} else { | ||
$this->getFiles()->addStylesheet('style', $this->url('css/style.css'), '2.0.0', [ 'bootstrap' ]); | ||
$this->getFiles()->addJavascript('ui', $this->url('js/ui.js'), '2.0.0', [ 'bootstrap' ], TemplateFiles::FOOTER); | ||
$this->getFiles()->addJavascript('codemirror', $this->url('js/codemirror/build/bundle.min.js'), '6.0.0', [ 'ui' ], TemplateFiles::FOOTER); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* fruithost | OpenSource Hosting | ||
* | ||
* @author Adrian Preuß | ||
* @version 1.0.0 | ||
* @license MIT | ||
*/ | ||
|
||
use fruithost\Accounting\Auth; | ||
use fruithost\Localization\I18N; | ||
|
||
Auth::setSettings('LANGUAGE', NULL, $_POST['language']); | ||
Auth::setSettings('TIME_FORMAT', NULL, $_POST['time_format']); | ||
Auth::setSettings('TIME_ZONE', NULL, $_POST['time_zone']); | ||
|
||
$template->getCore()->getHooks()->runAction('SAVE_ACCOUNT_SETTINGS_GLOBAL', $_POST); | ||
$template->assign('success', I18N::get('Your settings has been updated.')); | ||
I18N::reload(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* fruithost | OpenSource Hosting | ||
* | ||
* @author Adrian Preuß | ||
* @version 1.0.0 | ||
* @license MIT | ||
*/ | ||
|
||
use fruithost\Accounting\Auth; | ||
use fruithost\Localization\I18N; | ||
|
||
$selected = null; | ||
|
||
foreach($template->getCore()->getHooks()->applyFilter('2FA_METHODS', [ | ||
(object) [ | ||
'id' => 'mail', | ||
'name' => I18N::get('E-Mail'), | ||
'enabled' => true | ||
] | ||
]) AS $index => $method) { | ||
if($method->id == $_POST['2fa_type']) { | ||
$selected = $method; | ||
break; | ||
} | ||
} | ||
|
||
if($selected == null) { | ||
$template->assign('error', I18N::get('The selected 2FA method is not known.')); | ||
return; | ||
} | ||
|
||
if(!$selected->enabled) { | ||
$template->assign('error', sprintf(I18N::get('The 2FA method "%s" is currently deactivated and can therefore not be used.'), $selected->name)); | ||
return; | ||
} | ||
|
||
if(isset($_POST['2fa_enabled'])) { | ||
Auth::setSettings('2FA_ENABLED', NULL, 'true'); | ||
} else { | ||
Auth::setSettings('2FA_ENABLED', NULL, 'false'); | ||
} | ||
|
||
Auth::setSettings('2FA_TYPE', NULL, $_POST['2fa_type']); | ||
|
||
$template->getCore()->getHooks()->runAction('SAVE_ACCOUNT_SETTINGS_SECURITY', $_POST); | ||
$template->assign('success', I18N::get('Your security settings has been updated.')); | ||
?> |