1
0
mirror of https://github.com/Mowie/Mowie synced 2024-06-14 06:34:09 +00:00

Compare commits

...

99 Commits

Author SHA1 Message Date
f026c66918
Merge pull request #7 from Mowie/dependabot/composer/phpmailer/phpmailer-6.1.6
Bump phpmailer/phpmailer from 6.0.7 to 6.1.6
2020-05-27 19:31:44 +02:00
dependabot[bot]
cc40ca601f
Bump phpmailer/phpmailer from 6.0.7 to 6.1.6
Bumps [phpmailer/phpmailer](https://github.com/PHPMailer/PHPMailer) from 6.0.7 to 6.1.6.
- [Release notes](https://github.com/PHPMailer/PHPMailer/releases)
- [Changelog](https://github.com/PHPMailer/PHPMailer/blob/master/changelog.md)
- [Commits](https://github.com/PHPMailer/PHPMailer/compare/v6.0.7...v6.1.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-05-27 17:15:19 +00:00
322e545b74
update composer dependencies 2020-05-26 22:10:57 +02:00
eb72b9fcca
Updated copyright date everywhere 2018-03-27 22:49:01 +02:00
0f5c7cc4b1
Improved page app meta + pageID is now available as a smarty variable 2018-03-27 18:40:51 +02:00
a9810e8ce8
Raw page title is now available as a smarty variable 2018-03-27 18:38:26 +02:00
636ae4b756
New maintenance message 2018-03-27 13:20:37 +02:00
70e1e50150
Added example update.json 2018-03-07 15:21:47 +01:00
c0232dbd43
fixed minor translation error 2018-03-07 14:30:00 +01:00
96425173e0
Added creating of dirs when installing 2018-03-07 12:49:35 +01:00
90e121d367
Fixed creating tables on installation 2018-03-07 12:44:04 +01:00
ae96503cc1
Updated copyright 2018-02-18 19:16:15 +01:00
b90a42e575
Fixed creating of new user groups failing 2018-02-18 19:13:15 +01:00
0c4649c93f
debug 2018-02-18 19:10:48 +01:00
ec44bdce88
Fixed nav-app installation not working 2018-02-18 19:07:11 +01:00
71743d5f46
Fixed nav-app installation not working 2018-02-18 19:00:09 +01:00
74428a0225
Updated gitignore 2018-02-18 18:53:00 +01:00
1bddab64d3
Updated gitignore 2018-02-18 18:49:12 +01:00
f5dcad5814
Updated gitignore 2018-02-18 18:43:15 +01:00
5e5e221451
Added composer.lock 2018-02-18 18:41:01 +01:00
a54a31a0fc
fix for #3 (hopefully) 2018-01-31 23:33:03 +01:00
7c1f581ff1
Fixed not including composer autoload when resetting admin password 2018-01-27 16:48:13 +01:00
8c02edce51
Fixed forgotten import when resetting the admin password 2018-01-27 16:41:59 +01:00
f77c375ec1 Added Directory Index to .htacces in installer 2017-10-08 16:23:00 +02:00
4e48fd77d2 Fixed Login bug when login credentials contained special characters 2017-10-08 15:22:05 +02:00
b74cad4aa8 Fixed issue if home_url was '/' 2017-10-08 14:06:09 +02:00
e8b972543c updated Version 2017-10-06 17:53:40 +02:00
f5f55ee5cc Fixed Navigation app 2017-10-06 17:42:06 +02:00
61ab6aff2b Fixed Messages not showing correctly 2017-10-06 17:21:03 +02:00
129e6ac281 Fixed Messages not showing correctly 2017-10-06 17:20:20 +02:00
58550a8a96 Fixed Version string 2017-10-06 17:16:12 +02:00
167608b023 Removed logfiles app, doesn't work anymore. Will be replaced. 2017-10-06 17:04:29 +02:00
a7b7007346 Implemented setting to enable/disable updates 2017-10-06 16:43:03 +02:00
a485c1763c Finished implementing of new update mechanism 2017-10-06 00:12:03 +02:00
e8e1ff2451 Started implementing of new update mechanism 2017-10-05 23:01:05 +02:00
9e1397a4dd Fixed setting locale bug 2017-10-05 20:56:18 +02:00
bc13edd329 added new update method 2017-10-05 19:54:20 +02:00
546bbe62cd cleanup 2017-10-04 21:16:42 +02:00
8c813b3394 Moved 2FA to new Library 2017-10-04 21:14:30 +02:00
f5291de8c2 Moved 2FA to new Library 2017-10-04 21:12:57 +02:00
d3bff8730e Fixed Logout 2017-10-04 21:12:35 +02:00
b246cf542f Fixed Database Export 2017-10-04 20:47:05 +02:00
ca69b58cca Moved all libraries to composer 2017-10-04 20:46:49 +02:00
97fdb974a2 Added Composer 2017-10-04 18:48:30 +02:00
33e88b3daf Fixed error creating a new user on newer versions of mysql/mariadb 2017-10-04 18:27:26 +02:00
81530d956b Fixed user is only every 10 minitues asked for his password 2017-10-04 18:14:41 +02:00
2398fa28c0 Fixed stream error 2017-10-04 17:26:50 +02:00
3faa9d3c35 Moved everything concerning system(-settings) to /content/.system 2017-10-04 17:15:36 +02:00
a66b948ffd Improved Readme 2017-10-04 16:53:11 +02:00
19fc3d2d15 Removed PHPmyadminlink 2017-10-04 16:44:19 +02:00
2e5afd6785 Improved dev-docker-compose file 2017-10-04 16:40:59 +02:00
c8a19d3b3c Fixed login bug 2017-10-04 16:38:44 +02:00
9599614a60 Fixed bug when home uri was '/' 2017-09-27 22:15:15 +02:00
d6db38753e updated config to get title via relative url instead of absolute path 2017-09-27 21:58:53 +02:00
4f99762684 Re-added navigation app installer 2017-09-27 21:58:12 +02:00
8bbf7acb31 Updated Docker-php.ini 2017-09-27 21:57:50 +02:00
8ed9c62ce7 Added Development Docker image 2017-09-27 21:35:44 +02:00
7806407eab Updated Readme 2017-09-27 20:48:15 +02:00
41268a2022 Updated Gitignore 2017-09-27 20:48:01 +02:00
97cc4ce084 Re-added installers 2017-09-27 20:47:43 +02:00
f72e61d856 Merge pull request #2 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2017-05-14 00:26:58 +02:00
The Gitter Badger
0bd97f3555 Add Gitter badge 2017-05-13 18:42:31 +00:00
66ac3d1e89 Updated Date 2017-05-13 15:01:54 +02:00
fa76f4bf9e Added blue to loading spinner 2017-05-08 20:32:26 +02:00
b3faa6425c Fixed langstrings in menu items 2017-05-08 12:33:48 +02:00
60e4b7cec6 Cleanup 2017-05-08 11:53:26 +02:00
ad779c5737 Added Config for timezone 2017-05-08 11:52:59 +02:00
0f6b63e8ad Moved configfile to own folder 2017-05-08 11:43:02 +02:00
afcfb78250 msg(); cleanup 2017-05-08 00:43:07 +02:00
f32d11a1f2 Removed "Generator"-Header 2017-05-08 00:33:48 +02:00
f85ec7faa4 Updated .gitignore 2017-05-08 00:24:38 +02:00
2a534d0963 Added .gitignore 2017-05-08 00:23:34 +02:00
5d5c024d08 Fixed SimplePages Confirmation error 2017-05-08 00:22:15 +02:00
ddb4a3b47d Fixed Message-Icon display 2017-05-08 00:19:48 +02:00
5cceb2eb97 Fixed saving permissions 2017-05-07 23:13:07 +02:00
7d2fdcfebc Fixed showing of group names in overview 2017-05-07 22:29:31 +02:00
0b96919d0c Fixed showing admin group membership 2017-05-07 21:59:44 +02:00
6c853cbeee Fixed looping through apps 2017-05-07 21:48:33 +02:00
4ce47c209f When performing critical operations (such as user deletion) the system now asks you to confirm your password 2017-05-01 20:25:43 +02:00
b365dc88ed Nav-App fixes and improvements
* Inserted Logging
* Added Installer
* Enabled external links as nav entries
* Fix: Pages can't be their own parent
* Fix: Top table row can't be moved
2017-05-01 17:18:39 +02:00
97bd63177e Added logging to Nav-App 2017-05-01 15:18:11 +02:00
0233dd26c3 Removed checking for existance of SimplePages-App in Navapp (now handeled by config) 2017-05-01 14:50:56 +02:00
d36b14f9c4 Added getAppByPath()-Method to get appinfos by path (not by name) 2017-05-01 14:49:21 +02:00
86f9367424 Added Dependencies for aps
+ Some Code cleanup
2017-05-01 12:37:17 +02:00
a784c5a574 Added Method to set a template 2017-04-30 00:12:32 +02:00
a15b1d92aa Fixed showing of translations in stream 2017-04-30 00:04:20 +02:00
8594b9aa11 Updated msg(); 2017-04-29 23:16:39 +02:00
0d63ceb822 Fixed Removing of install-dev files 2017-04-29 22:39:26 +02:00
d7f27d6e38 Re-Added install files 2017-04-29 22:35:20 +02:00
713b3dda18 Updated Installer 2017-04-29 19:25:18 +02:00
63b01dd4e5 Updated Readme 2017-04-29 19:20:26 +02:00
439b77ef86 Added Navigation APP 2017-02-07 18:45:35 +01:00
f8850c4b24 Added Stream-SQL-Data during installation 2017-02-07 18:44:38 +01:00
11eb5627ef Added Stream-SQL-Data during installation 2017-02-04 18:52:37 +01:00
7af66fb9b8 Bugfix: Notice: Undefined offset: 0 in /media/storage/hdd/Server/SelfCMS/Mowie-Github/apps/sidebar/genConf.php on line 32
Fix: Include Language Files when displaying an app in System Config
2017-02-04 17:31:55 +01:00
a151256905 Fixed Loading of extra CSS 2017-02-04 17:24:04 +01:00
1cbe09099a Added: function to get information from an app
Added: when loading apps via the router, extra cssfiles for the app are loaded
2017-02-02 00:07:16 +01:00
0f1f894f70 Improvements to the installer 2017-02-01 23:13:59 +01:00
dd1200d885 Bugfix: Loglevel-saving 2017-02-01 21:08:36 +01:00
258 changed files with 22924 additions and 36538 deletions

11
.gitignore vendored Executable file
View File

@ -0,0 +1,11 @@
.idea
templates_c
vendor/
content/.system/page_title.txt
content/Files/*
config/*
.db-data/
# install files
admin/install.php
apps/*/install.php

View File

@ -1,9 +1,20 @@
# Mowie
[![Join the chat at https://gitter.im/Mowie/Mowie](https://badges.gitter.im/Mowie/Mowie.svg)](https://gitter.im/Mowie/Mowie?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A modular, powerful & good-looking CMS.
#Installing
This CMS is currently under heavy development. You can use it (it is quite stable) but expect bugs - and possible changes to the api.
# Installing
To install the CMS, grab [the latest release](https://github.com/Mowie/Mowie/releases), unzip it on your webserver and open a webbrowser to the files on your server. It will guide you through all necessary steps to install.
## Development
There is a developer docker image with a `docker-compose.yml` file to quickly set up a development environment.
It will expose two ports on your local machine, `8081` for the site itself and `3361` to access the database from your local machine.
# Documentation
Comming Soon!

View File

@ -1,34 +1,36 @@
<?php
require_once '../inc/autoload_adm.php';
require_once '../inc/libs/YAML/autoload.php';
use Symfony\Component\Yaml\Yaml;
//Datenbank Backup
use HGG\DbCmd\CmdBuilder\MySql;
use HGG\DbCmd\DbCmd;
// Full Database Backeup
if (isset($_GET['dbbackup']) && is_loggedin() && hasPerm('db_dump'))
{
include '../inc/libs/dbbackup.php';
$db = new DBBackup(array(
'driver' => 'mysql',
'host' => $MCONF['db_host'],
'user' => $MCONF['db_usr'],
'password' => $MCONF['db_pw'],
'database' => $MCONF['db_name'],
'db_prefix' => $MCONF['db_prefix']
));
$backup = $db->backup();
if ($backup['error'])
{
echo msg('fail', $lang->get('action_backup_fail'));
} else
try
{
$output = '';
$cmd = new DbCmd(new MySql());
$cmd->dumpDatabase($MCONF['db_usr'], $MCONF['db_pw'], $MCONF['db_host'], $MCONF['db_name'],
'.dbdump.tmp', array(), $output);
stream_message('{user} made a database-backup.', 4);
header("Cache-Control: public");
header("content-Description: File Transfer");
header('Content-Disposition: attachment; filename=Backup_' . str_replace(' ', '_', $MCONF['title']) . '_' . date('Y-m-d_h-d') . '.sql');
header("Content-Type: application/octet-stream; ");
header("Content-Transfer-Encoding: binary");
echo $backup['msg'];
exit;
readfile('.dbdump.tmp');
unlink('.dbdump.tmp');
}
catch (\Exception $e)
{
echo msg('fail', $lang->get('action_backup_fail'));
}
exit;
}
if (hasPerm('manage_system'))
{
@ -40,10 +42,10 @@ if (hasPerm('manage_system'))
{
if (isset($_POST['constr_message']))
{
if (file_put_contents('../inc/System/construction2.txt', $_POST['constr_message']))
if (file_put_contents('../content/.system/construction2.txt', $_POST['constr_message']))
{
copy('../inc/System/construction2.txt', '../inc/System/construction.txt');
echo msg('succes', $lang->get('action_construction_message_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
copy('../content/.system/construction2.txt', '../content/.system/construction.txt');
echo msg('success', $lang->get('action_construction_message_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} edited the construction-mode message.', 2);
} else
{
@ -57,7 +59,7 @@ if (hasPerm('manage_system'))
<h1><?php echo $lang->get('action_construction_message_edit'); ?></h1>
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
<textarea id="editor"
name="constr_message"><?php require('../inc/System/construction2.txt'); ?></textarea>
name="constr_message"><?php require('../content/.system/construction2.txt'); ?></textarea>
<input type="submit" value="<?php echo $lang->get('general_save_changes'); ?>"/>
</form>
</div>
@ -67,17 +69,17 @@ if (hasPerm('manage_system'))
{
if (hasPerm('construction'))
{
if (!file_exists('../inc/System/construction.txt'))
if (!file_exists('../content/.system/construction.txt'))
{
if (isset($_GET['confirm']))
{
if (copy('../inc/System/construction2.txt', '../inc/System/construction.txt'))
if (copy('../content/.system/construction2.txt', '../content/.system/construction.txt'))
{
echo msg('succes', $lang->get('action_construction_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
echo msg('success', $lang->get('action_construction_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} put the site into construction mode.', 2);
} else
{
echo msg('fail', $lang->get('action_try_again_later') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
echo msg('fail', $lang->get('action_construction_error') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
}
} else
{
@ -97,13 +99,13 @@ if (hasPerm('manage_system'))
{
if (isset($_GET['confirm']))
{
if (unlink('../inc/System/construction.txt'))
if (unlink('../content/.system/construction.txt'))
{
echo msg('succes', $lang->get('action_construction_removed_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
echo msg('success', $lang->get('action_construction_removed_success') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} put the site into production mode.', 2);
} else
{
echo msg('fail', $lang->get('action_try_again_later') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
echo msg('fail', $lang->get('action_construction_removed_error') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
}
} else
{
@ -132,9 +134,9 @@ if (hasPerm('manage_system'))
if (hasPerm('edit_title'))
{
$titel = $_POST['titel'];
if (file_put_contents('../inc/System/page_title.txt', $titel))
if (file_put_contents('../content/.system/page_title.txt', $titel))
{
echo msg('succes', $lang->get('action_change_page_title_success'));
echo msg('success', $lang->get('action_change_page_title_success'));
stream_message('{user} edited the page title.', 2);
} else
{
@ -146,10 +148,10 @@ if (hasPerm('manage_system'))
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
require $appUri . $app . '/config.php';
if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $app . '/' . $_CONF['general_conf']))
require $appUri . $appconf['app_path'] . '/config.php';
if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $appconf['app_path'] . '/' . $_CONF['general_conf']))
{
require $appUri . $app . '/' . $_CONF['general_conf'];
require $appUri .$appconf['app_path'] . '/' . $_CONF['general_conf'];
}
}
}

View File

@ -325,6 +325,7 @@ hr{
a.del i {
font-size: 20px;
vertical-align: sub;
cursor: pointer;
}
a.del {
@ -383,7 +384,7 @@ a.del:hover {
stroke: #FF9800;
}
75% {
stroke: #4baa4f;
stroke: #448AFF;
}
100% {
stroke: #4CAF50;
@ -401,7 +402,7 @@ a.del:hover {
stroke: #FF9800;
}
75% {
stroke: #4baa4f;
stroke: #448AFF;
}
100% {
stroke: #4CAF50;
@ -438,7 +439,7 @@ a.del:hover {
}
}
/*Tabelle*/
/*Table*/
table {
box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .14);
border: 1px solid #E0E0E0;
@ -1229,18 +1230,36 @@ header .stream{
}
/*Msgs*/
[class^="message-"], [class*=" message-"] {
.message{
width: calc(100% - 95px);
max-width: 280px;
padding: 10px 15px 10px 80px;
max-width: 360px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
border-radius: 2px;
margin: 10px auto;
background: #fff;
min-height: 44px;
min-height: 65px;
position: relative;
}
[class^="message-"]:before, [class*=" message-"]:before {
.message .msg{
padding: 10px 15px 10px 80px;
box-sizing: border-box;
}
.message [class^="icon-"], .message [class*=" icon-"]{
border-radius: 2px 0 0 2px;
display: block;
width: 68px;
float: left;
top: 0;
position: absolute;
bottom: 0;
}
.message [class^="icon-"]:before, .message [class*=" icon-"]:before {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'FontAwesome' !important;
font-style: normal;
@ -1254,32 +1273,36 @@ header .stream{
-moz-osx-font-smoothing: grayscale;
font-size: 45px;
margin: -10px 10px -8px -80px;
color: #fff;
padding: 7px 15px 8px;
border-radius: 2px 0 0 2px;
min-height: 49px;
display: block;
width: 37px;
float: left;
top: calc(50% - 30px);
position: absolute;
}
.message-success:before {
content: "\f058";
.message .icon-success{
background: #4CAF50;
}
.message-fail:before {
content: "\f057";
.message .icon-fail {
background: #F44336;
}
.message-info:before {
content: "\f05a";
.message .icon-info {
background: #2280db;
}
.message .icon-success:before {
content: "\f058";
}
.message .icon-fail:before {
content: "\f057";
}
.message .icon-info:before {
content: "\f05a";
}
/*icons*/
.icon_ue {
width: 95px;
@ -1372,6 +1395,59 @@ header .stream{
display: block;
}
/*Confirm Window*/
.overlay {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 99;
}
.window-confirm, .window-confirm .head {
text-align: center;
left: calc(50vw - 175px);
width: 100%;
max-width: 350px;
top: 40px;
background: #fff;
padding: 10px 10px 20px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
z-index: 1;
border-radius: 2px;
position: fixed;
overflow: auto;
max-height: calc(100vh - 80px);
height: auto;
}
.window-confirm .head {
margin: -10px -10px 10px 0;
text-align: left;
padding: 10px 10px;
background: #eaeaea;
border-radius: 2px 2px 0 0;
-moz-user-select: -moz-none;
-webkit-user-select: none;
user-select: none;
cursor: default;
position: fixed;
}
.window-confirm .head .closeMsg {
color: #212121;
}
.window-confirm .head .closeMsg:hover {
color: #5d5d5d;
}
.window-confirm #content {
margin-top: 30px;
}
@media screen and (max-width: 450px) {
header .options span.usr_info {
display: none;

0
admin/assets/bootstrap.min.css vendored Normal file → Executable file
View File

0
admin/assets/font-awesome.css vendored Normal file → Executable file
View File

0
admin/assets/fonts/font-awesome/FontAwesome.otf Normal file → Executable file
View File

View File

View File

Before

Width:  |  Height:  |  Size: 434 KiB

After

Width:  |  Height:  |  Size: 434 KiB

View File

View File

View File

0
admin/assets/js/bootstrap.min.js vendored Normal file → Executable file
View File

0
admin/assets/js/moment.js Normal file → Executable file
View File

0
admin/assets/js/page.bodyparser.js Normal file → Executable file
View File

0
admin/assets/js/page.js Normal file → Executable file
View File

View File

@ -3,27 +3,27 @@ require_once '../inc/autoload_adm.php';
printHeader($lang->get('general_config'));
tinymce();
?>
<div class="main">
<form method="POST" action="action.php?general">
<div class="form">
<div class="main">
<form method="POST" action="action.php?general">
<div class="form">
<?php
if (hasPerm('edit_title'))
{
?>
<p><span><?php echo $lang->get('general_website_title'); ?></span>
<input type="text" name="titel" value="<?php
<p><span><?php echo $lang->get('general_website_title'); ?></span>
<input type="text" name="titel" value="<?php
echo $MCONF['title'];
?>"/>
</p>
</p>
<?php
}
if (hasPerm('construction'))
{
?>
<p><span><?php echo $lang->get('general_construction_mode'); ?></span>
<p><span><?php echo $lang->get('general_construction_mode'); ?></span>
<?php
if (file_exists('../inc/System/construction.txt'))
if (file_exists('../content/.system/construction.txt'))
{
echo '<a href="action.php?construction" class="button">' . $lang->get('general_end_construction_mode') . '</a>';
} else
@ -31,55 +31,56 @@ tinymce();
echo '<a href="action.php?construction" class="button">' . $lang->get('general_start_construction_mode') . '</a>';
}
?> <a href="action.php?construction&constr_message"
class="button"><?php echo $lang->get('general_edit_message'); ?></a>
</p>
class="button"><?php echo $lang->get('general_edit_message'); ?></a>
</p>
<?php
}
if (hasPerm('update'))
{
?>
<i class="divider"></i>
<h1><?php echo $lang->get('update_version'); ?></h1>
<p><?php echo $lang->get('update_version_current'); ?>:
<i class="divider"></i>
<h1><?php echo $lang->get('update_version'); ?></h1>
<p><?php echo $lang->get('update_version_current'); ?>:
<?php
echo $MCONF['version'];
?>
</p>
<p>
<div id="checkUpdate">
<div class="spinner-container" style="margin: 0;">
<svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44">
<circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle>
</svg>
</div>
<div style="margin: -35px 0 0 55px;padding-bottom: 10px;">Überprüfe auf Updates...</div>
</div>
</p>
</p>
<?php
if ($MCONF['update_enabled'])
{
?>
<p>
<div id="checkUpdate">
<div class="spinner-container" style="margin: 0;">
<svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44">
<circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle>
</svg>
</div>
<div style="margin: -35px 0 0 55px;padding-bottom: 10px;"></div>
</div>
</p>
<script>
$.get('update.php?checkUpdate', function (data) {
$('#checkUpdate').html('');
$('#checkUpdate').html(data);
});
</script>
<script>
$.get('update.php?checkUpdate', function (data) {
$('#checkUpdate').html('');
$('#checkUpdate').html(data);
});
</script>
<?php
}
}
if (hasPerm('db_dump'))
{
?>
<i class="divider"></i>
<h1><?php echo $lang->get('general_database'); ?></h1>
<p>
<a href="action.php?dbbackup" class="button" download="download"><i
class="fa fa-database"></i> <?php echo $lang->get('general_create_backup'); ?>
</a>
<a href="<?php
echo $MCONF['phpmyadmin'];
?>" class="button" target="_blank"><?php echo $lang->get('general_go_phpmyadmin'); ?> <i
class="fa fa-external-link"></i></a>
</p>
<i class="divider"></i>
<h1><?php echo $lang->get('general_database'); ?></h1>
<p>
<a href="action.php?dbbackup" class="button" download="download"><i
class="fa fa-database"></i> <?php echo $lang->get('general_create_backup'); ?>
</a>
</p>
<?php
}
@ -87,21 +88,24 @@ tinymce();
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
require $appUri . $app . '/config.php';
if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $app . '/' . $_CONF['general_conf']))
require $appUri . $appconf['app_path'] . '/config.php';
if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $appconf['app_path'] . '/' . $_CONF['general_conf']))
{
if (file_exists($appUri . $appconf['app_path'] . '/lang/') && is_dir($appUri . $appconf['app_path'] . '/lang/'))
{
$lang->setLangFolder($appUri . $appconf['app_path'] . '/lang/');
}
echo '<i class="divider"></i>';
require $appUri . $app . '/' . $_CONF['general_conf'];
require $appUri . $appconf['app_path'] . '/' . $_CONF['general_conf'];
}
}
?>
<i class="divider"></i>
<input type="submit" class="speichern" value="<?php echo $lang->get('general_save_changes'); ?>"
style="width: auto;"/>
</div>
</form>
<i class="divider"></i>
<input type="submit" class="speichern" value="<?php echo $lang->get('general_save_changes'); ?>"
style="width: auto;"/>
</div>
</form>
<?php
require_once '../inc/footer.php';
?>

View File

@ -15,14 +15,14 @@ if (file_exists('install.php'))
$installedApps = $apps->getApps();
foreach ($installedApps as $appuri => $installedApp)
{
if(array_key_exists('install', $installedApp))
if (array_key_exists('install', $installedApp))
{
$appInstaller = '../apps/' . $appuri . '/' . $installedApp['install'];
$appInstaller = '../apps/' . $installedApp['app_path'] . '/' . $installedApp['install'];
if (file_exists($appInstaller))
{
if (unlink($appInstaller))
{
echo msg('info', $lang->get('delete_config_success'. $installedApp['app_name']));
echo msg('info', $lang->get('delete_config_success' . $installedApp['app_name']));
}
}
}
@ -30,26 +30,27 @@ foreach ($installedApps as $appuri => $installedApp)
if (hasPerm('view_dashboard'))
{
echo '<div class="cardsContainer cardsContainer-main"><div class="card-yellow" title="' . php_uname() . '"><span>' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . '</span>' . $lang->get('os') . '</div>';
echo '<div class="card-green" title="' . $_SERVER['SERVER_SOFTWARE'] . '"><span>' . $_SERVER['SERVER_SOFTWARE'] . '</span>' . $lang->get('server_software') . '</div>';
echo '<div class="card-indigo" title="' . PHP_VERSION . '"><span>' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . '</span>' . $lang->get('php_version') . '</div>';
echo '<div class="card-orange" title="' . $db->version() . '"><span>' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . '</span>' . $lang->get('mysql_version') . '</div></div><div class="cardsContainer cardsContainer-main">';
echo '<div class="card-purple"><span>' . date('H:i:s') . '</span>' . $lang->get('system_time') . '</div>';
?>
<a href="general_config.php" class="card-blue"><span><i class="fa fa-cog"></i></span><br/>
<a href="general_config.php" class="card-blue"><span><i class="fa fa-cog"></i></span><br/>
<?php echo $lang->get('general_config'); ?></a>
<a href=".<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/logfiles/index.php" class="card-lime"><span><i
class="fa fa-list"></i></span><br/><?php echo $lang->get('logfiles'); ?></a>
</div>
<div class="cardsContainer cardsContainer-main">
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/SimplePages/backend/management.php"
class="card-red"><span><i class="fa fa-list"></i></span><br/><?php echo $lang->get('manage_pages'); ?></a>
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/SimplePages/backend/permissions.php"
class="card-pink"><span><i class="fa fa-lock"></i></span><br/><?php echo $lang->get('manage_contents'); ?>
</a>
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/Files/index.php" class="card-amber"><span>
<a href=".<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/logfiles/index.php" class="card-lime"><span><i
class="fa fa-list"></i></span><br/><?php echo $lang->get('logfiles'); ?></a>
</div>
<div class="cardsContainer cardsContainer-main">
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/SimplePages/backend/management.php"
class="card-red"><span><i class="fa fa-list"></i></span><br/><?php echo $lang->get('manage_pages'); ?></a>
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/SimplePages/backend/permissions.php"
class="card-pink"><span><i class="fa fa-lock"></i></span><br/><?php echo $lang->get('manage_contents'); ?>
</a>
<a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>apps/Files/index.php" class="card-amber"><span>
<i class="fa fa-file"></i></span><br/><?php echo $lang->get('manage_files'); ?></a>
</div>
</div>
<?php
}
echo '<div class="main container">';
@ -59,19 +60,18 @@ $apps = new apps();
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
require $appUri . $app . '/config.php';
require $appUri . $appconf['app_path'] . '/config.php';
if (isset($_CONF['dashboard']) && $_CONF['dashboard'] != '')
{
if (file_exists($appUri . $app . '/' . $_CONF['dashboard']))
if (file_exists($appUri . $appconf['app_path'] . '/' . $_CONF['dashboard']))
{
echo '<div class="box">';
require $appUri . $app . '/' . $_CONF['dashboard'];
require $appUri . $appconf['app_path'] . '/' . $_CONF['dashboard'];
echo '</div>';
}
}
$_CONF['dashboard'] = '';
}
echo '</div>';
require_once '../inc/footer.php';

292
admin/install-dev.php Normal file → Executable file
View File

@ -1,16 +1,17 @@
<?php
if(file_exists('../inc/config.yml'))
if (file_exists('../config/config.yml'))
{
header('Location: index.php');
exit;
}
session_name('adminsession');
session_start();
require_once '../vendor/autoload.php';
require_once '../inc/libs/functions.php';
require_once '../inc/libs/lang.class.php';
require_once '../inc/libs/db-mysql.php';
require_once '../inc/apps.php';
require_once '../inc/libs/YAML/autoload.php';
use Symfony\Component\Yaml\Yaml;
$lang = new lang();
@ -23,13 +24,13 @@ $lang->setLangFolder('lang/');
<link rel="stylesheet" href="assets/admin.css" type="text/css">
<script src="assets/js/jquery.min.js"></script>
<script>
function fadeInput(input) {
$('#' + input).fadeToggle(200);
}
function fadeInput(input) {
$('#' + input).fadeToggle(200);
}
</script>
</head>
<body style="background: url('assets/bglogin.jpg') no-repeat center fixed;">
<img src="http://server/SelfCMS/Version2/admin/assets/Logo.svg" alt="Mowie" class="install-logo"/>
<img src="assets/Logo.svg" alt="Mowie" class="install-logo"/>
<h1 style="text-align: center; color: #E8E8E8;">Installation</h1>
<?php
if (isset($_POST['submit']))
@ -39,13 +40,10 @@ if (isset($_POST['submit']))
$_POST['db_host'] !== '' &&
$_POST['db_name'] !== '' &&
$_POST['db_user'] !== '' &&
$_POST['db_pw1'] !== '' &&
$_POST['db_pw2'] !== '' &&
$_POST['db_pw'] !== '' &&
$_POST['general_webUrl'] !== '' &&
$_POST['general_home_url'] !== '' &&
$_POST['general_pma'] !== '' &&
$_POST['general_page_title'] !== '' &&
$_POST['general_editor_css'] !== '' &&
$_POST['general_template'] !== '' &&
$_POST['admin_name'] !== '' &&
$_POST['admin_mail'] !== '' &&
@ -56,22 +54,21 @@ if (isset($_POST['submit']))
$CONFIG = [];
$CONFIG['General']['web_uri'] = $_POST['general_webUrl'];
$CONFIG['General']['home_uri'] = $_POST['general_home_url'];
$CONFIG['General']['phpmyadmin'] = $_POST['general_pma'];
$CONFIG['General']['title'] = 'inc/System/page_title.txt';
$CONFIG['General']['tinymce_css'] = $_POST['general_editor_css'];
$CONFIG['General']['timezone'] = $_POST['general_timezone'];
$CONFIG['Database']['db_type'] = 'mysql';
$CONFIG['Database']['db_host'] = $_POST['db_host'];
$CONFIG['Database']['db_name'] = $_POST['db_name'];
$CONFIG['Database']['db_usr'] = $_POST['db_user'];
$CONFIG['Database']['db_pw'] = $_POST['db_pw1'];
$CONFIG['Database']['db_pw'] = $_POST['db_pw'];
$CONFIG['Database']['db_prefix'] = $_POST['db_prefix'];
$CONFIG['Templating']['template'] = $_POST['general_template'];
$CONFIG['Templating']['tpl_title'] = 'title';
$CONFIG['Templating']['tpl_content'] = 'content';
$CONFIG['Templating']['tpl_webUri'] = 'website_uri';
$CONFIG['Versioning']['version'] = '0.95 Beta';
$CONFIG['Versioning']['version_num'] = 6;
$CONFIG['Versioning']['update_uri'][] = 'https://cdn.kola-entertainments.de/cms/';
$CONFIG['Versioning']['version'] = '0.96.0';
$CONFIG['Versioning']['update_enabled'] = true;
$CONFIG['Versioning']['update_servers'][] = 'https://update.mowie.cc/';
$CONFIG['Mail']['smtp'] = false;
//Mail Settings
@ -93,19 +90,25 @@ if (isset($_POST['submit']))
}
//Test Passwords
if ($_POST['db_pw1'] !== $_POST['db_pw2'])
{
echo msg('fail', 'Mysqlpasswords don\'t match.');
exit;
}
if ($_POST['admin_pw1'] !== $_POST['admin_pw2'])
{
echo msg('fail', 'Adminpasswords don\'t match');
exit;
}
// Creaete folders
if (!file_exists('../config/'))
{
mkdir('../config');
}
if (!file_exists('../content/.system/'))
{
mkdir('../content/.system/', null, true);
}
//Database
$db = new db($_POST['db_host'], $_POST['db_name'], $_POST['db_user'], $_POST['db_pw1'], $_POST['db_prefix']);
$db = new db($_POST['db_host'], $_POST['db_name'], $_POST['db_user'], $_POST['db_pw'], $_POST['db_prefix']);
//Create Tables
if ($db->query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@ -130,8 +133,30 @@ CREATE TABLE `' . $_POST['db_prefix'] . 'system_loggedin` (
CREATE TABLE `' . $_POST['db_prefix'] . 'system_roles` (
`id` int(11) NOT NULL,
`name` text COLLATE utf8_unicode_ci NOT NULL,
`permissions` longtext COLLATE utf8_unicode_ci NOT NULL
`permissions` longtext COLLATE utf8_unicode_ci NOT NULL DEFAULT \'{}\'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `' . $_POST['db_prefix'] . 'system_show_stream` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`level` text CHARACTER SET latin1 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `' . $_POST['db_prefix'] . 'system_stream` (
`id` int(11) NOT NULL,
`time` text CHARACTER SET latin1 NOT NULL,
`user` text CHARACTER SET latin1 NOT NULL,
`lvl` text CHARACTER SET latin1 NOT NULL,
`message` longtext CHARACTER SET latin1 NOT NULL,
`extra` text CHARACTER SET latin1 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_show_stream`
ADD PRIMARY KEY (`id`);
ALTER TABLE `' . $_POST['db_prefix'] . 'system_stream`
ADD PRIMARY KEY (`id`);
ALTER TABLE `' . $_POST['db_prefix'] . 'system_show_stream`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_stream`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins`
ADD PRIMARY KEY (`id`);
@ -146,6 +171,10 @@ ALTER TABLE `' . $_POST['db_prefix'] . 'system_loggedin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins`
ALTER COLUMN lvl SET DEFAULT 0;
ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins`
ALTER COLUMN secret SET DEFAULT "";
')
)
{
@ -182,45 +211,62 @@ ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles`
}
//Page title
if (file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title']))
if (file_put_contents('../content/.system/page_title.txt', $_POST['general_page_title']))
{
echo msg('succes', 'Page Title was successfully set.<br/>');
echo msg('success', 'Page Title was successfully set.<br/>');
} else
{
echo msg('fail', 'Error setting page title.');
exit;
}
//htacces
$htacces = 'RewriteEngine On
if (strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'apache') !== false)
{
$htacces = 'RewriteEngine On
RewriteRule ^(admin|inc|apps|content)($|/) - [L]
RewriteRule !favicon\.ico - [C]
RewriteRule !index\.php - [C]
RewriteRule ^(.*)$ /index.php?$1 [QSA,L]';
if (file_put_contents('../.htaccess', $htacces))
{
echo msg('succes', '.htaccess was successfully set.<br/>');
RewriteRule ^(.*)$ /index.php?$1 [QSA,L]
DirectoryIndex index.php index.html
# Disables download of configuration
<Files ~ "\.(tpl|yml|ini)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</Files>';
if (file_put_contents('../.htaccess', $htacces))
{
echo msg('success', '.htaccess was successfully set.<br/>');
} else
{
echo msg('fail', 'Error setting up .htaccess.<br/>');
exit;
}
} else
{
echo msg('fail', 'Error setting up .htaccess.<br/>');
exit;
echo msg('info', 'We detected you are not using Apache. Please make sure to redirect all requests to index.php (Like Apache\'s mod_rewrite).');
}
//Apps
$apps = new apps(2);
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
require $appUri . $app . '/config.php';
if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $app . '/' . $_CONF['install']))
require $appUri . $appconf['app_path'] . '/config.php';
if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $appconf['app_path'] . '/' . $_CONF['install']))
{
require $appUri . $app . '/' . $_CONF['install'];
require $appUri . $appconf['app_path'] . '/' . $_CONF['install'];
}
}
//Write Config
$configfile = Yaml::dump($CONFIG);
if (file_put_contents('../inc/config.yml', $configfile))
if (file_put_contents('../config/config.yml', $configfile))
{
echo msg('succes', 'Configfile was successfully created.');
echo msg('success', 'Configfile was successfully created.');
} else
{
echo msg('fail', 'Error creating configfile.');
@ -249,39 +295,165 @@ RewriteRule ^(.*)$ /index.php?$1 [QSA,L]';
?>
</select><br/><br/>
<h2>Timezone</h2>
<span>Select your timezone:</span>
<select name="general_timezone">
<?php
$timezones = array(
'Pacific/Midway' => "(GMT-11:00) Midway Island",
'US/Samoa' => "(GMT-11:00) Samoa",
'US/Hawaii' => "(GMT-10:00) Hawaii",
'US/Alaska' => "(GMT-09:00) Alaska",
'US/Pacific' => "(GMT-08:00) Pacific Time (US &amp; Canada)",
'America/Tijuana' => "(GMT-08:00) Tijuana",
'US/Arizona' => "(GMT-07:00) Arizona",
'US/Mountain' => "(GMT-07:00) Mountain Time (US &amp; Canada)",
'America/Chihuahua' => "(GMT-07:00) Chihuahua",
'America/Mazatlan' => "(GMT-07:00) Mazatlan",
'America/Mexico_City' => "(GMT-06:00) Mexico City",
'America/Monterrey' => "(GMT-06:00) Monterrey",
'Canada/Saskatchewan' => "(GMT-06:00) Saskatchewan",
'US/Central' => "(GMT-06:00) Central Time (US &amp; Canada)",
'US/Eastern' => "(GMT-05:00) Eastern Time (US &amp; Canada)",
'US/East-Indiana' => "(GMT-05:00) Indiana (East)",
'America/Bogota' => "(GMT-05:00) Bogota",
'America/Lima' => "(GMT-05:00) Lima",
'America/Caracas' => "(GMT-04:30) Caracas",
'Canada/Atlantic' => "(GMT-04:00) Atlantic Time (Canada)",
'America/La_Paz' => "(GMT-04:00) La Paz",
'America/Santiago' => "(GMT-04:00) Santiago",
'Canada/Newfoundland' => "(GMT-03:30) Newfoundland",
'America/Buenos_Aires' => "(GMT-03:00) Buenos Aires",
'Greenland' => "(GMT-03:00) Greenland",
'Atlantic/Stanley' => "(GMT-02:00) Stanley",
'Atlantic/Azores' => "(GMT-01:00) Azores",
'Atlantic/Cape_Verde' => "(GMT-01:00) Cape Verde Is.",
'Africa/Casablanca' => "(GMT) Casablanca",
'Europe/Dublin' => "(GMT) Dublin",
'Europe/Lisbon' => "(GMT) Lisbon",
'Europe/London' => "(GMT) London",
'Africa/Monrovia' => "(GMT) Monrovia",
'Europe/Amsterdam' => "(GMT+01:00) Amsterdam",
'Europe/Belgrade' => "(GMT+01:00) Belgrade",
'Europe/Berlin' => "(GMT+01:00) Berlin",
'Europe/Bratislava' => "(GMT+01:00) Bratislava",
'Europe/Brussels' => "(GMT+01:00) Brussels",
'Europe/Budapest' => "(GMT+01:00) Budapest",
'Europe/Copenhagen' => "(GMT+01:00) Copenhagen",
'Europe/Ljubljana' => "(GMT+01:00) Ljubljana",
'Europe/Madrid' => "(GMT+01:00) Madrid",
'Europe/Paris' => "(GMT+01:00) Paris",
'Europe/Prague' => "(GMT+01:00) Prague",
'Europe/Rome' => "(GMT+01:00) Rome",
'Europe/Sarajevo' => "(GMT+01:00) Sarajevo",
'Europe/Skopje' => "(GMT+01:00) Skopje",
'Europe/Stockholm' => "(GMT+01:00) Stockholm",
'Europe/Vienna' => "(GMT+01:00) Vienna",
'Europe/Warsaw' => "(GMT+01:00) Warsaw",
'Europe/Zagreb' => "(GMT+01:00) Zagreb",
'Europe/Athens' => "(GMT+02:00) Athens",
'Europe/Bucharest' => "(GMT+02:00) Bucharest",
'Africa/Cairo' => "(GMT+02:00) Cairo",
'Africa/Harare' => "(GMT+02:00) Harare",
'Europe/Helsinki' => "(GMT+02:00) Helsinki",
'Europe/Istanbul' => "(GMT+02:00) Istanbul",
'Asia/Jerusalem' => "(GMT+02:00) Jerusalem",
'Europe/Kiev' => "(GMT+02:00) Kyiv",
'Europe/Minsk' => "(GMT+02:00) Minsk",
'Europe/Riga' => "(GMT+02:00) Riga",
'Europe/Sofia' => "(GMT+02:00) Sofia",
'Europe/Tallinn' => "(GMT+02:00) Tallinn",
'Europe/Vilnius' => "(GMT+02:00) Vilnius",
'Asia/Baghdad' => "(GMT+03:00) Baghdad",
'Asia/Kuwait' => "(GMT+03:00) Kuwait",
'Africa/Nairobi' => "(GMT+03:00) Nairobi",
'Asia/Riyadh' => "(GMT+03:00) Riyadh",
'Europe/Moscow' => "(GMT+03:00) Moscow",
'Asia/Tehran' => "(GMT+03:30) Tehran",
'Asia/Baku' => "(GMT+04:00) Baku",
'Europe/Volgograd' => "(GMT+04:00) Volgograd",
'Asia/Muscat' => "(GMT+04:00) Muscat",
'Asia/Tbilisi' => "(GMT+04:00) Tbilisi",
'Asia/Yerevan' => "(GMT+04:00) Yerevan",
'Asia/Kabul' => "(GMT+04:30) Kabul",
'Asia/Karachi' => "(GMT+05:00) Karachi",
'Asia/Tashkent' => "(GMT+05:00) Tashkent",
'Asia/Kolkata' => "(GMT+05:30) Kolkata",
'Asia/Kathmandu' => "(GMT+05:45) Kathmandu",
'Asia/Yekaterinburg' => "(GMT+06:00) Ekaterinburg",
'Asia/Almaty' => "(GMT+06:00) Almaty",
'Asia/Dhaka' => "(GMT+06:00) Dhaka",
'Asia/Novosibirsk' => "(GMT+07:00) Novosibirsk",
'Asia/Bangkok' => "(GMT+07:00) Bangkok",
'Asia/Jakarta' => "(GMT+07:00) Jakarta",
'Asia/Krasnoyarsk' => "(GMT+08:00) Krasnoyarsk",
'Asia/Chongqing' => "(GMT+08:00) Chongqing",
'Asia/Hong_Kong' => "(GMT+08:00) Hong Kong",
'Asia/Kuala_Lumpur' => "(GMT+08:00) Kuala Lumpur",
'Australia/Perth' => "(GMT+08:00) Perth",
'Asia/Singapore' => "(GMT+08:00) Singapore",
'Asia/Taipei' => "(GMT+08:00) Taipei",
'Asia/Ulaanbaatar' => "(GMT+08:00) Ulaan Bataar",
'Asia/Urumqi' => "(GMT+08:00) Urumqi",
'Asia/Irkutsk' => "(GMT+09:00) Irkutsk",
'Asia/Seoul' => "(GMT+09:00) Seoul",
'Asia/Tokyo' => "(GMT+09:00) Tokyo",
'Australia/Adelaide' => "(GMT+09:30) Adelaide",
'Australia/Darwin' => "(GMT+09:30) Darwin",
'Asia/Yakutsk' => "(GMT+10:00) Yakutsk",
'Australia/Brisbane' => "(GMT+10:00) Brisbane",
'Australia/Canberra' => "(GMT+10:00) Canberra",
'Pacific/Guam' => "(GMT+10:00) Guam",
'Australia/Hobart' => "(GMT+10:00) Hobart",
'Australia/Melbourne' => "(GMT+10:00) Melbourne",
'Pacific/Port_Moresby' => "(GMT+10:00) Port Moresby",
'Australia/Sydney' => "(GMT+10:00) Sydney",
'Asia/Vladivostok' => "(GMT+11:00) Vladivostok",
'Asia/Magadan' => "(GMT+12:00) Magadan",
'Pacific/Auckland' => "(GMT+12:00) Auckland",
'Pacific/Fiji' => "(GMT+12:00) Fiji"
);
foreach ($timezones as $timezone_code => $timezone_title)
{
echo '<option value="' . $timezone_code . '">' . $timezone_title . '</option>';
}
?>
</select><br/><br/>
<h2>Mysql</h2>
<span>Host</span><input type="text" placeholder="Host" name="db_host" value="localhost"/><br/>
<span>Database</span><input type="text" placeholder="Database" name="db_name"/><br/>
<span>Username</span><input type="text" placeholder="Username" name="db_user" value="root"/><br/>
<span>Password</span><input type="password" placeholder="Password" name="db_pw1"/><br/>
<span>Confirm Password</span><input type="password" placeholder="Confirm Password" name="db_pw2"/><br/>
<span>Table prefix</span><input type="text" placeholder="Table prefix" name="db_prefix"/><br/><br/>
<span>Password</span><input type="password" placeholder="Password" name="db_pw"/><br/>
<span>Table prefix (optional)</span><input type="text" placeholder="Table prefix" name="db_prefix"/><br/><br/>
<h2>Website</h2>
<span>Page Title</span><input type="text" placeholder="Page Title" name="general_page_title"/><br/>
<span>Website Url</span><input type="text" placeholder="Website Url" name="general_webUrl"
value="http://<?php echo $_SERVER['SERVER_NAME'] . str_replace('admin/install.php', '', $_SERVER['REQUEST_URI']); ?>"/><br/>
<span>Home Url</span><input type="text" placeholder="Home Url" name="general_home_url"
value="<?php echo str_replace('admin/install.php', '', $_SERVER['REQUEST_URI']); ?>"/><br/>
<span>Phpmyadmin Url</span><input type="text" placeholder="Phpmyadmin Url" name="general_pma"/><br/>
<span>Page Title</span><input type="text" placeholder="Page Title" name="general_page_title"/><br/>
<span>Editor CSS</span><input type="text" placeholder="Editor CSS" name="general_editor_css"/><br/>
<span>Template</span><input type="text" placeholder="Template" name="general_template"
value="content/template.tpl"/><br/>
<span>&nbsp;</span><a onclick="fadeInput('more');" style="display: block;">More Options</a><br/>
<div id="more" style="display: none;">
<span>Home Url</span><input type="text" placeholder="Home Url" name="general_home_url"
value="<?php echo str_replace('admin/install.php', '', $_SERVER['REQUEST_URI']); ?>"/><br/>
<span>Editor CSS (optional)</span><input type="text" placeholder="Editor CSS" name="general_editor_css"/><br/>
<span>Template</span><input type="text" placeholder="Template" name="general_template"
value="content/template.tpl"/><br/>
</div>
<h2>Mail</h2>
<span>&nbsp;</span><input type="checkbox" name="mail_smtp" id="mail_smtp" onchange="fadeInput('mailInput');"/><label for="mail_smtp"><i></i>
<span>&nbsp;</span><input type="checkbox" name="mail_smtp" id="mail_smtp"
onchange="fadeInput('mailInput');"/><label for="mail_smtp"><i></i>
Use SMTP</label>
<br/>
<div id="mailInput" style="display: none">
<span>SMTP-Host</span><input type="text" placeholder="SMTP-Host" name="mail_host"/><br/>
<span>SMTP-Username</span><input type="text" placeholder="SMTP-Username" name="mail_user"/><br/>
<span>SMTP-Password</span><input type="text" placeholder="SMTP-Password" name="mail_pass"/><br/>
<span>Security</span>
<input type="radio" name="mail_secure" id="mail_ssl"/><label for="mail_ssl"><i></i> Use SSL</label>
<input type="radio" name="mail_secure" id="mail_tls"/><label for="mail_tls"><i></i> Use TLS</label>
<br/>
<span>Port</span><input type="number" placeholder="Port" name="mail_port"/>
<span>SMTP-Host</span><input type="text" placeholder="SMTP-Host" name="mail_host"/><br/>
<span>SMTP-Username</span><input type="text" placeholder="SMTP-Username" name="mail_user"/><br/>
<span>SMTP-Password</span><input type="text" placeholder="SMTP-Password" name="mail_pass"/><br/>
<span>Security</span>
<input type="radio" name="mail_secure" id="mail_ssl"/><label for="mail_ssl"><i></i> Use SSL</label>
<input type="radio" name="mail_secure" id="mail_tls"/><label for="mail_tls"><i></i> Use TLS</label>
<br/>
<span>Port</span><input type="number" placeholder="Port" name="mail_port"/>
<br/>
</div>
@ -297,10 +469,10 @@ RewriteRule ^(.*)$ /index.php?$1 [QSA,L]';
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
require $appUri . $app . '/config.php';
if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $app . '/' . $_CONF['install']))
require $appUri . $appconf['app_path'] . '/config.php';
if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $appconf['app_path'] . '/' . $_CONF['install']))
{
require $appUri . $app . '/' . $_CONF['install'];
require $appUri . $appconf['app_path'] . '/' . $_CONF['install'];
}
}
?>

1
admin/lang.php Normal file → Executable file
View File

@ -1,6 +1,7 @@
<?php
session_name('adminsession');
session_start();
require_once '../vendor/autoload.php';
require_once '../inc/config.php';
if(isset($_GET['set']))

View File

@ -21,6 +21,7 @@ $lang['error_2fa'] = 'Fehler bei der Anmeldung in zwei Schritten.';
$lang['wrong_username_or_pass'] = 'Benutzername oder Passwort falsch.';
$lang['wrong_pass'] = 'Falsches Passwort';
$lang['404_not_found'] = 'Die Seite wurde nicht gefunden.';
$lang['error_occured'] = 'Es ist ein Fehler aufgetreten.';
//Reset Password
$lang['reset_pass_title'] = 'Passwort zurücksetzen';
@ -73,6 +74,9 @@ $lang['general_inactive'] = 'Nicht aktiviert';
$lang['general_activate'] = 'Aktivieren';
$lang['general_deactivate'] = 'Deaktivieren';
$lang['general_save_changes'] = 'Änderungen speichern';
$lang['general_needs_other_app'] = 'Diese App benötgt die andere App "%1$s" um ordnungsgemäß zu funktionieren.';
$lang['general_needs_other_version'] = 'Diese App benötigt mindestens Mowie in Version %1$s.';
$lang['general_needs_other_php'] = 'Diese App benötigt mindestens PHP in Version %1$s.';
//General Config
$lang['general_config'] = 'Systemkonfiguration';
@ -83,7 +87,14 @@ $lang['general_start_construction_mode'] = 'Seite in Baustellenzustand versetzen
$lang['general_edit_message'] = 'Meldung bearbeiten';
$lang['general_database'] = 'Datenbank';
$lang['general_create_backup'] = 'Datenbank Backup erstellen';
$lang['general_go_phpmyadmin'] = 'Zu phpmyadmin';
//Legitimation
$lang['legitimate_title'] = 'Legitimierung benötigt';
$lang['legitimate_text'] = 'Dieser Vorgang benötigt eine Passwortbestätigung.';
$lang['legitimate_confirm'] = 'Bestätigen';
$lang['legitimate_abort'] = 'Abbrechen';
$lang['legitimate_error'] = 'Beim Legitimieren ist ein Fehler aufgetreten.';
$lang['legitimate_fail'] = 'Falsches Passwort.';
/*
* Manage Admins
@ -94,6 +105,7 @@ $lang['admins_title'] = 'Administratoren';
$lang['admins_list'] = 'Benutzerliste';
$lang['admins_groups'] = 'Benutzergruppen';
$lang['admins_permissions'] = 'Berechtigungen';
$lang['admins_group'] = 'Gruppe';
$lang['admins_create_new'] = 'Neuen Benutzer anlegen';
//Admin List
$lang['admins_id'] = 'ID';
@ -180,6 +192,7 @@ $lang['user_settings_log_level_3'] = 'Änderungen';
$lang['user_settings_log_level_4'] = 'Generelle Mitteilungen';
$lang['user_settings_log_level_fail'] = 'Fehler beim Speichern des Log-Levels.';
$lang['user_settings_log_level_success'] = 'Die Änderungen des Log-Levels wurden erfolgreich gespeichert.';
$lang['user_settings_none'] = 'Keine. <a href="%1$s">Ändern</a>';
//Mail
$lang['mail_write'] = 'Email schreiben';
@ -197,8 +210,10 @@ $lang['action_construction_message_success'] = 'Die Meldung wurde erfolgreich ge
$lang['action_try_again_later'] = 'Fehler. Bitte versuchen Sie es später noch einmal.';
$lang['action_construction_message_edit'] = 'Baustellen-Meldung bearbeiten';
$lang['action_construction_success'] = 'Die Webseite wurde erfolgreich in den Baustellenzustand versetzt.';
$lang['action_construction_error'] = 'Beim Versetzen in den Baustellenmodus trat ein Fehler auf.';
$lang['action_construction_confirm'] = 'Wollen Sie die Webseite wirklich in den Baustellenzustand verstzten?';
$lang['action_construction_removed_success'] = 'Der Baustellenzustand wurde erfolgreich aufgehoben.';
$lang['action_construction_removed_error'] = 'Beim Aufheben des Baustellenzustandes ist ein Fehler aufgetreten.';
$lang['action_construction_remove'] = 'Wollen Sie den Baustellenzustand wirklich aufheben?';
$lang['action_change_page_title_success'] = 'Die Änderungen des Seitentitels wurden erfolgreich gespeichert.';
@ -212,7 +227,7 @@ $lang['update_app_succss'] = '"%1$s" wurde erfolgreich upgedatet.';
$lang['update_fail'] = 'Fehler beim Updaten.';
$lang['update_config_fail'] = 'Beim Bearbeiten der Configdatei ist ein Fehler aufgetreten.';
$lang['update_fail_unzip'] = 'Fehler beim Entpacken des Updates.';
$lang['update_md5_fake'] = 'Die Heruntergeladene Datei ist vermutlich falsch.';
$lang['update_wrong_hash'] = 'Die Heruntergeladene Datei ist vermutlich falsch.';
$lang['update_fail_copy'] = 'Fehler beim Herunterladen des Updates. <b>Hinweis:</b> Der Nutzer, unter welchem der Webserver läuft, muss im Verzeichnis /admin Schreibrechte haben!';
$lang['update_version'] = 'Version';
$lang['update_version_current'] = 'Installierte Version';
@ -220,6 +235,10 @@ $lang['update_new_version'] = 'Neue Version verfügbar!';
$lang['update_version_current_new'] = 'Die installierte Version ist aktuell.';
$lang['update_app_update_available'] = 'App-Update - Neue Version für "%1$s" verfügbar: %2$s';
$lang['update_log'] = '{user} hat das System geupdated.';
$lang['update_folder_not_writeable'] = 'Der Updateordner ist nicht schreibbar. Bitte stelle sicher, dass der Webserver Schreibrechte im Updateordner hat.';
$lang['update_create_backup_error'] = 'Beim Erstellen eines Backups ist ein Fehler aufgetreten.';
$lang['update_cleanup_error'] = 'Beim Aufräumen ist ein Fehler aufgetreten.';
$lang['update_checking'] = 'Überprüfe auf Updates...';
//Stream Messages
$lang['stream_saved_settings'] = '{user} hat seinen Benutzername/Email-Adresse geändert.';

View File

@ -21,6 +21,7 @@ $lang['error_2fa'] = 'Error with 2-Step Verification authentication';
$lang['wrong_username_or_pass'] = 'Wrong username or password.';
$lang['wrong_pass'] = 'Wrong password';
$lang['404_not_found'] = 'The page you requested was not found.';
$lang['error_occured'] = 'An error occured.';
//Reset Password
$lang['reset_pass_title'] = 'Reset Password';
@ -61,7 +62,7 @@ $lang['never'] = 'never';
$lang['admin_title'] = 'Admin';
$lang['settings'] = 'Settings';
$lang['logout'] = 'Logout';
$lang['main_page'] = 'Mainpage';
$lang['main_page'] = 'Visit site';
$lang['dashboard_title'] = 'Welcome to the dashboard';
$lang['dashboard'] = 'Dashboard';
$lang['missing_permission'] = 'Missing Permission';
@ -84,7 +85,9 @@ $lang['general_edit_message'] = 'Edit Construction Message';
$lang['general_version'] = 'Version';
$lang['general_database'] = 'Database';
$lang['general_create_backup'] = 'Create Database Backup';
$lang['general_go_phpmyadmin'] = 'phpmyadmin';
$lang['general_needs_other_app'] = 'This app needs the app "%1$s" to function properly.';
$lang['general_needs_other_version'] = 'This app needs at least Mowie version %1$s.';
$lang['general_needs_other_php'] = 'This app needs at least PHP version %1$s.';
/*
* Manage Admins
@ -95,6 +98,7 @@ $lang['admins_title'] = 'Administrators';
$lang['admins_list'] = 'Userlist';
$lang['admins_groups'] = 'Usergroups';
$lang['admins_permissions'] = 'Permissions';
$lang['admins_group'] = 'Group';
$lang['admins_create_new'] = 'Create New User';
//Admin List
$lang['admins_id'] = 'ID';
@ -181,6 +185,7 @@ $lang['user_settings_log_level_3'] = 'Edits';
$lang['user_settings_log_level_4'] = 'General Messages';
$lang['user_settings_log_level_fail'] = 'An error occured while saving Log-Levels.';
$lang['user_settings_log_level_success'] = 'The Log-Levels were saved successfully.';
$lang['user_settings_none'] = 'none <a href="%1$s">Settings</a>';
//Mail
$lang['mail_write'] = 'Write Email';
@ -198,8 +203,10 @@ $lang['action_construction_message_success'] = 'The construction-message was edi
$lang['action_try_again_later'] = 'Error. Please try again later.';
$lang['action_construction_message_edit'] = 'Edit Construction Message';
$lang['action_construction_success'] = 'The website was set to construction mode successfully.';
$lang['action_construction_error'] = 'An error occured while setting the site to construction mode.';
$lang['action_construction_confirm'] = 'Are you sure you want to enable construction mode?';
$lang['action_construction_removed_success'] = 'Construction Mode was successfully disabled.';
$lang['action_construction_removed_error'] = 'An error occured while disabling construction mode.';
$lang['action_construction_remove'] = 'Are you sure you want to disable construction mode?';
$lang['action_change_page_title_success'] = 'Page Title was successfully edited.';
@ -214,7 +221,7 @@ $lang['update_app_succss'] = '"%1$s" was updated successfully.';
$lang['update_fail'] = 'An error occured while updating.';
$lang['update_config_fail'] = 'An error occured while updating the config file.';
$lang['update_fail_unzip'] = 'An error occured while unpacking the update.';
$lang['update_md5_fake'] = 'The downloaded file has a wrong checksum.';
$lang['update_wrong_hash'] = 'The downloaded file has a wrong checksum.';
$lang['update_fail_copy'] = 'An error occured while downloading the update. <b>Hint:</b> The webserver needs writing permissions in the folder /admin!';
$lang['update_version'] = 'Version';
$lang['update_version_current'] = 'Installed Version';
@ -222,6 +229,10 @@ $lang['update_new_version'] = 'New Version Available!';
$lang['update_version_current_new'] = 'Installed Version is up-to-date';
$lang['update_app_update_available'] = 'App-Update - New Version for "%1$s" available: %2$s';
$lang['update_log'] = '{user} updated the System.';
$lang['update_folder_not_writeable'] = 'The updatefolder is not writeable. Please make sure your webserver can write into the folder.';
$lang['update_create_backup_error'] = 'An error occured while creating a backup.';
$lang['update_cleanup_error'] = 'An error occured during cleanup.';
$lang['update_checking'] = 'Checking for updates...';
//Stream Messages
$lang['stream_saved_settings'] = '{user} changed it\'s username and/or email-adress.';

View File

@ -1,82 +1,133 @@
<?php
session_name('adminsession');
session_start();
require_once '../vendor/autoload.php';
require_once '../inc/config.php';
require_once '../inc/libs/password.php';
require_once '../inc/libs/functions.php';
$db->setCol('system_admins');
$db->data['username'] = $_POST['username'];
$db->get();
if($db->data[0]['id'] != '')
if(isset($_POST['username']))
{
if(password_verify($_POST['pw'], $db->data[0]['pass']))
$db->setCol('system_admins');
$db->data['username'] = $_POST['username'];
$db->get();
if (isset($db->data[0]) && $db->data[0]['id'] != '')
{
session_regenerate_id();
$uid = $db->data[0]['id'];
//Token
$token = random(64);
$_SESSION['token'] = $token;
$db->clear();
$db->setCol('system_loggedin');
$db->data['user'] = $uid;
$db->data['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
$db->data['ip'] = $_SERVER['REMOTE_ADDR'];
$db->data['time'] = time();
$db->data['token'] = $token;
//if($db->insert()) echo 'token'; else echo 'hm';
$db->insert();
//echo $token;
$db->clear();
$db->setCol('system_admins');
$db->data['id'] = $uid;
$db->get();
if($db->data[0]['secret'] != '')
$userData = $db->data[0];
if (password_verify($_POST['pw'], $userData['pass']))
{
if(isset($_POST['2fa']) && $_POST['2fa'] == '')
{
echo '2fa';
exit;
}
else
{
require_once '../inc/libs/2fa.php';
$authenticator = new php2FA();
session_regenerate_id();
if($authenticator->verifyCode($db->data[0]['secret'], $_POST['2fa'], 3))
//Token
$token = random(64);
$_SESSION['token'] = $token;
$db->clear();
$db->setCol('system_loggedin');
$db->data['user'] = $userData['id'];
$db->data['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
$db->data['ip'] = $_SERVER['REMOTE_ADDR'];
$db->data['time'] = time();
$db->data['token'] = $token;
$db->insert();
$db->clear();
$db->setCol('system_admins');
$db->data['id'] = $userData['id'];
$db->get();
if ($db->data[0]['secret'] != '')
{
if (isset($_POST['2fa']) && $_POST['2fa'] == '')
{
echo 'success';
stream_message('{user} has logged in.', 4);
}
else
{
echo '2fafail';
echo '2fa';
exit;
}
}
}
else
{
echo 'success';
}
} else
{
$auth = new \PragmaRX\Google2FA\Google2FA();
//Session
$_SESSION['user'] = $db->data[0]['username'];
$_SESSION['userid'] = $db->data[0]['id'];
$_SESSION['lvl'] = $db->data[0]['lvl'];
$_SESSION['mail'] = $db->data[0]['mail'];
$_SESSION['guestview'] = 'true';
stream_message('{user} has logged in.', 4);
}
else
if($auth->verify($_POST['2fa'], $db->data[0]['secret']))
{
echo 'success';
stream_message('{user} has logged in.', 4, null, null, $db->data[0]['id']);
} else
{
echo '2fafail';
exit;
}
}
} else
{
echo 'success';
}
//Session
$_SESSION['user'] = $userData['username'];
$_SESSION['userid'] = $userData['id'];
$_SESSION['lvl'] = $userData['lvl'];
$_SESSION['mail'] = $userData['mail'];
$_SESSION['guestview'] = 'true';
stream_message('{user} has logged in.', 4);
} else
{
echo 'fail';
}
} else
{
echo 'fail';
}
}
else
//Check for password - needed for user's confirmation
if(isset($_GET['checkPassword']))
{
echo 'fail';
if(is_loggedin())
{
if(isset($_POST['pw']))
{
$db->setCol('system_admins');
$db->data['id'] = $_SESSION['userid'];
$db->get();
if (isset($db->data[0]) && $db->data[0]['id'] != '')
{
if (password_verify($_POST['pw'], $db->data[0]['pass']))
{
echo 'success';
$_SESSION['sudomode'] = time();
}
else
{
echo 'fail';
}
}
else
{
echo 'fail';
}
}
}
else
{
echo 'login first.';
}
}
// Check if the user already entered his password
if (isset($_GET['checkSudo']))
{
if(is_loggedin())
{
// Check if the user entered his password less then 10 minutes ago
if (isset($_SESSION['sudomode']) && $_SESSION['sudomode'] >= (time() - 600))
{
echo 'true';
} else
{
echo 'false';
}
}
else
{
echo 'login first.';
}
}

View File

@ -1,5 +1,8 @@
<?php
session_name('adminsession');session_start();
session_name('adminsession');
session_start();
require_once '../vendor/autoload.php';
require_once '../inc/config.php';
require_once '../inc/libs/functions.php';

View File

@ -26,7 +26,7 @@ if (hasPerm('manage_admins'))
if ($db->insert())
{
echo msg('succes', sprintf($lang->get('admins_cn_success'), $_POST['userN']) . ' <a href="users.php">' . $lang->get('back') . '</a>');
echo msg('success', sprintf($lang->get('admins_cn_success'), $_POST['userN']) . ' <a href="users.php">' . $lang->get('back') . '</a>');
stream_message('{user} created the new user "{extra}".', 2, $_POST['userN']);
} else
{
@ -50,6 +50,7 @@ if (hasPerm('manage_admins'))
<div class="main">
<div class="form">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="POST">
<input type="hidden" name="askPW" value="askPW">
<p><span><?php echo $lang->get('admins_cn_username'); ?>:</span><input type="text" name="userN"/>
</p>
<p><span><?php echo $lang->get('admins_cn_password'); ?>:</span><input type="password" name="pw1"/>

View File

@ -15,13 +15,17 @@ if (hasPerm('edit_permissions'))
{
$perm_full = $perm;
$perm = explode('_', $perm);
$permArr[$perm[0]][$perm[1]][] = str_replace($perm[0].'_'.$perm[1].'_', '', $perm_full);
//echo '<pre>'.print_r($perm, true).'</pre>';
if(isset($perm[1], $perm[0]))
{
$permArr[$perm[0]][$perm[1]][] = str_replace($perm[0] . '_' . $perm[1] . '_', '', $perm_full);
}
}
}
//print_r($permArr);
foreach ($permArr as $lvl => $perms)
{
$db->setCol('system_roles');
$db->data['permissions'] = json_encode($perms);
if ($db->update(['id' => $lvl]))
{
@ -35,7 +39,7 @@ if (hasPerm('edit_permissions'))
}
} else
{
echo '<div class="main"><form action="'.$_SERVER['REQUEST_URI'].'" method="post">';
echo '<div class="main"><form action="'.$_SERVER['REQUEST_URI'].'" method="post"><input type="hidden" name="askPW" value="askPW">';
//Admin Groups
$db->get();
$role_names = [];
@ -72,13 +76,13 @@ if (hasPerm('edit_permissions'))
$appUri = '../apps/';
foreach ($apps->getApps() as $app => $appconf)
{
if (file_exists($appUri . '/' . $app . '/permissions.json'))
if (file_exists($appUri . '/' . $appconf['app_path'] . '/permissions.json'))
{
require $appUri . '/' . $app . '/config.php';
require $appUri . '/' . $appconf['app_path'] . '/config.php';
$lang->setLangFolder( $appUri . $app .'/lang/');
$lang->setLangFolder( $appUri . $appconf['app_path'] .'/lang/');
$permsTotal[$_CONF['app_name']] = json_decode(file_get_contents($appUri . '/' . $app . '/permissions.json'), true);
$permsTotal[$_CONF['app_name']] = json_decode(file_get_contents($appUri . '/' . $appconf['app_path'] . '/permissions.json'), true);
$permsTotal[$_CONF['app_name']] = $permsTotal[$_CONF['app_name']]['permissions'];
}
}

5
admin/reset-pw.php Normal file → Executable file
View File

@ -1,4 +1,5 @@
<?php
require_once '../vendor/autoload.php';
require_once '../inc/config.php';
require_once '../inc/libs/functions.php';
$lang->setLangFolder('lang/');
@ -140,8 +141,8 @@ else
</form>
<div id="msg"></div>
</div>
<p style="text-align: center;color: #fff;text-shadow: 1px 1px 1px #555;">&copy; 2016 <a
href="http://mowie.cc" style="color: #fff;">Mowie</a></p>
<p style="text-align: center;color: #fff;text-shadow: 1px 1px 1px #555;">&copy; 2018 <a
href="http://mowie.cc" style="color: #fff;" target="_blank">Mowie</a></p>
</div>
<script>
$("#pwreset").submit(function () {

View File

@ -42,6 +42,7 @@ if (hasPerm('manage_groups'))
?>
<div class="main" style="text-align: center">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="hidden" name="askPW" value="askPW">
<p><?php echo $lang->get('admins_roles_delete_confirm');?></p>
<input type="submit" name="del" value="<?php echo $lang->get('general_yes');?>"/>
<a href="roles.php?members=<?php echo $_GET['members']; ?>" class="button btn_del"><?php echo $lang->get('general_no');?></a>
@ -69,6 +70,7 @@ if (hasPerm('manage_groups'))
?>
<div class="main" style="text-align: center">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="hidden" name="askPW" value="askPW">
<p><?php echo $lang->get('admins_roles_user_delete_confirm');?></p>
<input type="submit" name="del" value="<?php echo $lang->get('general_yes');?>"/>
<a href="roles.php?members=<?php echo $_GET['members']; ?>" class="button btn_del"><?php echo $lang->get('general_no');?></a>
@ -133,6 +135,7 @@ if (hasPerm('manage_groups'))
{
?>
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="hidden" name="askPW" value="askPW">
<?php echo $lang->get('admins_roles_add_user');?>:
<select name="user">
<?php
@ -173,6 +176,7 @@ if (hasPerm('manage_groups'))
<div class="main">
<h2><?php echo $lang->get('admins_roles_create_group');?></h2>
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="hidden" name="askPW" value="askPW">
<input type="text" name="group_name" placeholder="<?php echo $lang->get('admins_roles_group_name');?>"/><br/>
<input type="submit" name="submit" value="<?php echo $lang->get('admins_roles_create_group');?>"/>
</form>

58
admin/stream.php Normal file → Executable file
View File

@ -2,37 +2,50 @@
error_reporting(E_ALL);
require_once '../inc/autoload_adm.php';
//Get Langstrings
foreach ($apps->getApps() as $appname => $appdetail)
{
$path = '../apps/' . $appdetail['app_path'] . '/lang/';
if (file_exists($path) && is_dir($path))
{
$lang->setLangFolder($path);
}
}
//Get Stream as JSON
if(isset($_GET['getStream']) && is_loggedin())
if (isset($_GET['getStream']) && is_loggedin())
{
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->get();
$loglevel = json_decode($db->data[0]['level']);
$streamData = [];
$db->setCol('system_stream');
$db->get(null, null, 'id', 'DESC', 10);
foreach($db->data as $stream)
if (isset($db->data[0]))
{
if(in_array($stream['lvl'], $loglevel))
$loglevel = json_decode($db->data[0]['level']);
$streamData = [];
$db->setCol('system_stream');
$db->get(null, null, 'id', 'DESC', 10);
foreach ($db->data as $stream)
{
$message = str_replace('{user}', getUserByID($stream['user']), $lang->get($stream['message']));
$message = str_replace('{extra}', $stream['extra'], $message);
if (in_array($stream['lvl'], $loglevel))
{
$message = str_replace('{user}', getUserByID($stream['user']), $lang->get($stream['message']));
$message = str_replace('{extra}', $stream['extra'], $message);
$streamData[] = [
'id' => $stream['id'],
'time' => $stream['time'],
'user' => $stream['user'],
'message' => $message
];
$streamData[] = [
'id' => $stream['id'],
'time' => $stream['time'],
'user' => $stream['user'],
'message' => $message
];
}
}
}
header('Charset: utf-8');
header('Content-type: application/json');
echo json_encode( $streamData );
exit;
header('Charset: utf-8');
header('Content-type: application/json');
echo json_encode($streamData);
exit;
}
}
//Show Stream
@ -40,13 +53,14 @@ printHeader('Stream');
echo '<div class="main">';
//Get Stream Messages
$db->setCol('system_stream');
$db->get(null, null, 'id', 'DESC', 200);
foreach ($db->data as $stream)
{
$message = str_replace('{user}', getUserByID($stream['user']), $lang->get($stream['message']));
$message = str_replace('{extra}', $stream['extra'], $message);
echo '<p><b>'.date('d.m.Y H:i', $stream['time']).':</b> '.$message.'</p>';
echo '<p><b>' . date('d.m.Y H:i', $stream['time']) . ':</b> ' . $message . '</p>';
}
echo '</div>';

272
admin/update.php Normal file → Executable file
View File

@ -1,86 +1,46 @@
<?php
require_once '../inc/autoload_adm.php';
require_once '../inc/libs/updater.php';
$update = new Mowie\Updater\updater();
$update->setServer($MCONF['update_servers']);
$update->setCurrentVersion($MCONF['version']);
$update->setUpdateDir('../');
$update->thingsToNotUpdate = [
'apps/',
'config/',
'content/',
'vendor/',
'templates_c'
];
//Update-Checker
if (isset($_GET['checkUpdate']))
{
//sleep(50);
if (hasPerm('update'))
if (hasPerm('update') && $MCONF['update_enabled'])
{
//Check for newer Version
$nextVersion = $MCONF['version_num'] + 1;
$foundNewVersion = false;
$hasChangelog = false;
foreach ($MCONF['update_uri'] as $update_server)
try
{
$updateUrl = $update_server . 'System/v' . $nextVersion;
if (remote_file_exists($updateUrl . '/version.json'))
{
$version_remote = json_decode(file_get_contents($updateUrl . '/version.json'));
if ($version_remote->versionNum > $MCONF['version_num'])
{
$foundNewVersion = true;
//Check for Changelog
if (remote_file_exists($updateUrl . '/changelog.md'))
{
$hasChangelog = $update_server;
}
}
}
$new = $update->checkUpdateAvailable();
} catch (\Exception $e)
{
echo 'Error. ' . $e->getMessage();
}
if ($foundNewVersion)
// If we have a new version, show it
if (isset($new))
{
echo $lang->get('update_new_version') . ' <b>' . $version_remote->version . '</b> <a href="update.php?update" class="button">' . $lang->get('update_title') . '</a>';
if ($hasChangelog !== false)
echo $lang->get('update_new_version') . ' <b>' . $new['version'] . '</b> <a href="update.php?update" class="button">' . $lang->get('update_title') . '</a>';
if (isset($new['changelog']))
{
echo '<a href="update.php?showChangelog&server=' . urlencode($hasChangelog) . '&v=' . $nextVersion . '" class="button"><i class="fa fa-list-alt" aria-hidden="true"></i>&nbsp;&nbsp;Changelog</a>';
echo '<a href="update.php?showChangelog&url=' . urlencode($new['server'] . $new['changelog']) . '" class="button"><i class="fa fa-list-alt" aria-hidden="true"></i>&nbsp;&nbsp;Changelog</a>';
}
} else
{
echo $lang->get('update_version_current_new');
}
//Check for App-Updates
foreach ($apps->getApps() as $appdir => $app)
{
if(isset($app['app_build']))
{
$nextVersion = $app['app_build'] + 1;
$foundNewVersion = false;
$hasChangelog = false;
foreach ($MCONF['update_uri'] as $update_server)
{
$updateUrl = $update_server . 'apps/' . str_replace(' ', '-', $app['app_name']) . '/v' . $nextVersion;
if (remote_file_exists($updateUrl . '/version.json'))
{
$version_remote = json_decode(file_get_contents($updateUrl . '/version.json'));
if ($version_remote->versionNum > $app['app_build'])
{
$foundNewVersion = true;
//Check for Changelog
if (remote_file_exists($updateUrl . '/changelog.md'))
{
$hasChangelog = $update_server;
}
}
}
}
if ($foundNewVersion)
{
echo '<br/>'.sprintf($lang->get('update_app_update_available'), $app['app_name'], $version_remote->version). ' <a href="update.php?update&appUpdate='.urlencode($appdir).'" class="button">' . $lang->get('update_title') . '</a>';
if ($hasChangelog !== false)
{
echo '<a href="update.php?showChangelog&app='.str_replace(' ', '-', $app['app_name']).'&server=' . urlencode($hasChangelog) . '&v=' . $nextVersion . '" class="button"><i class="fa fa-list-alt" aria-hidden="true"></i>&nbsp;&nbsp;Changelog</a>';
}
}
}
}
}
exit;
}
@ -92,30 +52,15 @@ if (isset($_GET['showChangelog']))
echo '<div class="main">';
if (hasPerm('update'))
{
if(isset($_GET['server']))
if(isset($_GET['url']))
{
//If we want to see the changelog for an app, we need to look in a different directory
$remoteSubDir = 'System';
if(isset($_GET['app']))
{
$remoteSubDir = 'apps/'.$_GET['app'];
}
if (isset($_GET['v']))
{
if (remote_file_exists(urldecode($_GET['server']) . $remoteSubDir . '/v' . $_GET['v'] . '/changelog.md'))
{
require_once '../inc/libs/Parsedown.php';
$Parsedown = new Parsedown();
echo $Parsedown->text(file_get_contents(urldecode($_GET['server']) . $remoteSubDir . '/v' . $_GET['v'] . '/changelog.md'));
}
} else
{
echo 'Missing Version.';
}
$parsedown = new Parsedown();
$change = $update->getChangelog(urldecode($_GET['url']));
echo $parsedown->parse($change);
}
else
{
echo 'Missing Server';
echo 'Missing Url';
}
} else
{
@ -130,126 +75,103 @@ if (isset($_GET['showChangelog']))
if (isset($_GET['update']))
{
printHeader($lang->get('update_title'));
if (hasPerm('update'))
if (hasPerm('update') && $MCONF['update_enabled'])
{
$updated = false;
foreach ($MCONF['update_uri'] as $update_server)
//Check for newer Version
try
{
$nextVersion = $MCONF['version_num'] + 1;
$installedVersion = $MCONF['version_num'];
$new = $update->checkUpdateAvailable();
} catch (\Exception $e)
{
echo 'Error. ' . $e->getMessage();
}
//If we want to see the changelog for an app, we need to look in a different directory
$remoteSubDir = 'System';
$systemSubDir = '../';
if (isset($_GET['appUpdate']))
// Update if we have one
if(isset($new))
{
//Check writing permissions
if($update->updateFolderIsWritable())
{
// Download the update
if ($update->downloadUpdate($new))
{
require '../apps/' . urldecode($_GET['appUpdate']) . '/config.php';
$remoteSubDir = 'apps/' . str_replace(' ', '-', $_CONF['app_name']);
$nextVersion = $_CONF['app_build'] + 1;
$systemSubDir = '../apps/' . urldecode($_GET['appUpdate']) . '/';
$installedVersion = $_CONF['app_build'];
}
//Check for version.json on the remote server
$dUri = $update_server . $remoteSubDir . '/v' . $nextVersion . '/';
if (remote_file_exists($dUri . 'version.json'))
{
$version_remote = json_decode(file_get_contents($dUri . 'version.json'));
//Check if the remote version is newer
if ($version_remote->versionNum > $installedVersion)
// Check downloaded update file
if($update->verifyUpdate($new))
{
//Download the update
if (copy($dUri . 'update.v' . $version_remote->versionNum . '.incremental.zip', 'update.zip'))
// Put the site in "under construction mode"
if (copy('../content/.system/construction2.txt', '../content/.system/construction.txt'))
{
$updated = true;
//Check for md5 hash
if (md5_file('update.zip') == $version_remote->md5)
stream_message('{user} put the site into construction mode.', 2);
// Create a backup
if($update->backupUpdateFolder())
{
//unzip to temporary folder
$updateTmpDir = 'updateTmp/';
if (!file_exists($updateTmpDir))
// The actual update
try
{
if (mkdir($updateTmpDir, 0777) === false)
{
echo msg('fail', 'Error creating temporary folder.');
}
$update->rollTheUpdate();
}
catch (\Exception $e)
{
echo msg('fail', $lang->get('update_fail_unzip'). ' ('.$e->getMessage().')');
}
$zip = new ZipArchive;
$res = $zip->open('update.zip');
if ($res === true)
// Execute migrations
$update->migrate();
// Clean afterwards
if($update->cleanup())
{
$zip->extractTo($updateTmpDir);
$zip->close();
$updateInfos = json_decode(file_get_contents($updateTmpDir . 'filesToUpdate.json'));
// Update new Version in Config file
$conf = \Symfony\Component\Yaml\Yaml::parse(file_get_contents('../config/config.yml'));
$conf['Versioning']['version'] = $update->getCurrentVersion();
$isUp = false;
$fTU = [];
foreach ($updateInfos->files as $num => $file)
$configfile = \Symfony\Component\Yaml\Yaml::dump($conf);
if (file_put_contents('../config/config.yml', $configfile))
{
$fTU[] = $file;
$upNeu = $updateTmpDir . $file;
$upRem = $systemSubDir . $file;
if (copy($upNeu, $upRem))
// Disable Construction mode
if (unlink('../content/.system/construction.txt'))
{
echo msg('succes', sprintf($lang->get('update_item_succss'), $file));
$isUp = true;
} else
{
echo msg('fail', sprintf($lang->get('update_item_fail'), $file));
}
}
//Update Version in Config File - only if we don't update an app
if (!isset($_GET['appUpdate']))
{
$config = Yaml::parse(file_get_contents('../inc/config.yml', FILE_USE_INCLUDE_PATH));
$config['Versioning']['version'] = $version_remote->version;
$config['Versioning']['version_num'] = $version_remote->versionNum;
$configfile = Yaml::dump($config);
if (!file_put_contents('../inc/config.yml', $configfile))
{
echo msg('fail', $lang->get('general_config_fail'));
}
}
//Remove "old" update
if (rrmdir($updateTmpDir) && $isUp && unlink('update.zip'))
{
if(isset($_GET['appUpdate']))
{
echo msg('succes', sprintf($lang->get('update_app_succss'), $_CONF['app_name']) . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} updated the app "{extra}".', 2, $_CONF['app_name']);
echo msg('success', $lang->get('update_succss') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} updated the System.', 2);
stream_message('{user} put the site into production mode.', 2);
}
else
{
echo msg('succes', $lang->get('update_succss') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
stream_message('{user} updated the system.', 2);
echo msg('success', $lang->get('action_construction_removed_error'));
}
} else
{
echo msg('fail', $lang->get('update_fail') . ' <a href="general_config.php">' . $lang->get('back') . '</a>');
}
} else
{
echo msg('fail', $lang->get('update_fail_unzip'));
}
} else
else
{
echo msg('fail', $lang->get('update_cleanup_error'));
}
}
else
{
echo msg('fail', $lang->get('update_md5_fake'));
echo msg('fail', $lang->get('update_create_backup_error'));
}
} else
{
echo msg('fail', $lang->get('update_fail_copy'));
echo msg('fail', $lang->get('action_construction_error'));
}
} else
}
else
{
echo msg('info', $lang->get('update_version_current_new'));
echo msg('fail', $lang->get('update_wrong_hash'));
}
}
else
{
echo msg('fail', $lang->get('update_fail_copy'));
}
}
else
{
echo msg('fail', $lang->get('update_folder_not_writeable'));
}
}
if(!$updated)
else
{
echo msg('info', $lang->get('update_version_current_new'));
}

View File

@ -27,7 +27,7 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
$db->data['pass'] = password_hash($_POST['pw_new'], PASSWORD_DEFAULT);
if ($db->update(['id' => $user]))
{
echo msg('succes', $lang->get('user_settings_pw_change_success') . ' <a href="index.php">' . $lang->get('back_dashboard') . '</a>');
echo msg('success', $lang->get('user_settings_pw_change_success') . ' <a href="index.php">' . $lang->get('back_dashboard') . '</a>');
stream_message('{user}\'s password was changed.', 4);
} else
{
@ -41,15 +41,15 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
} else
{
?>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="password" name="pw_new"
placeholder="<?php echo $lang->get('user_settings_new_pass'); ?>" autofocus/><br/>
<input type="password" name="pw_new2"
placeholder="<?php echo $lang->get('user_settings_new_pass_confirm'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
<input type="password" name="pw_new"
placeholder="<?php echo $lang->get('user_settings_new_pass'); ?>" autofocus/><br/>
<input type="password" name="pw_new2"
placeholder="<?php echo $lang->get('user_settings_new_pass_confirm'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<?php
}
} elseif (isset($_GET['pw_u']))
@ -68,14 +68,14 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
{
echo '<div class="main"><p>' . $lang->get('user_settings_new_pass') . '</p>';
?>
<form action="<?php echo parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);?>?pw_new" method="post">
<input type="password" name="pw_new"
placeholder="<?php echo $lang->get('user_settings_new_pass'); ?>" autofocus/><br/>
<input type="password" name="pw_new2"
placeholder="<?php echo $lang->get('user_settings_new_pass_confirm'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<form action="<?php echo parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?>?pw_new" method="post">
<input type="password" name="pw_new"
placeholder="<?php echo $lang->get('user_settings_new_pass'); ?>" autofocus/><br/>
<input type="password" name="pw_new2"
placeholder="<?php echo $lang->get('user_settings_new_pass_confirm'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<?php
} else
{
@ -85,17 +85,17 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
} else
{
?>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<input type="password" name="pw" autofocus
placeholder="<?php echo $lang->get('user_settings_enter_current_pass'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
<input type="password" name="pw" autofocus
placeholder="<?php echo $lang->get('user_settings_enter_current_pass'); ?>"/><br/>
<input type="submit" value="<?php echo $lang->get('confirm'); ?>"/>
</form>
</div>
<?php
}
}//Sessions
elseif (isset($_GET['sessions']))
elseif (isset($_GET['sessions']))
{
$db->setCol('system_loggedin');
if (isset($_POST['smbt']))
@ -122,17 +122,18 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
echo '</table>';
?>
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post"><input type="submit" name="smbt"
value="<?php echo $lang->get('user_settings_current_sessions_logout_all'); ?>"/>
</form></div>
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post"><input type="submit" name="smbt"
value="<?php echo $lang->get('user_settings_current_sessions_logout_all'); ?>"/>
</form></div>
<?php
}
}//2-Faktor-Atentifizierung
elseif (isset($_GET['2fa']))
elseif (isset($_GET['2fa']))
{
echo '<div class="main">';
require_once '../inc/libs/2fa.php';
$authenticator = new php2FA();
$auth = new \PragmaRX\Google2FA\Google2FA();
$db->clear();
$db->setCol('system_admins');
$db->data['id'] = $_SESSION['userid'];
@ -156,13 +157,13 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
} else
{
?>
<p><?php echo $lang->get('user_settings_2fa_deactivate_confirm'); ?></p>
<p>
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post" style="text-align: center;">
<input type="submit" name="confirm" value="<?php echo $lang->get('general_yes'); ?>"/>
<a onclick="history.back();" class="button btn_del"><?php echo $lang->get('general_no'); ?></a>
</form>
</p>
<p><?php echo $lang->get('user_settings_2fa_deactivate_confirm'); ?></p>
<p>
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" style="text-align: center;">
<input type="submit" name="confirm" value="<?php echo $lang->get('general_yes'); ?>"/>
<a onclick="history.back();" class="button btn_del"><?php echo $lang->get('general_no'); ?></a>
</form>
</p>
<?php
}
}//Ansonsten mgl zum aktivieren/Einrichten anzeigen
@ -171,7 +172,7 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
echo '<h2>' . $lang->get('user_settings_2fa_activate') . '</h2>';
if (isset($_POST['smbt']))
{
if ($authenticator->verifyCode($_POST['secret'], $_POST['2fatest'], 3))
if ($auth->verify($_POST['2fatest'], $_POST['secret']))
{
$db->clear();
$db->setCol('system_admins');
@ -184,105 +185,108 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
echo msg('fail', $lang->get('user_settings_2fa_activate_fail') . ' {back}');
}
} else
{
echo msg('fail', $lang->get('user_settings_2fa_activate_wrong_code') . ' {back}');
}
} else
{
echo '<p>' . $lang->get('user_settings_2fa_activate_import_code') . '</p>';
$secret = $authenticator->createSecret();
echo '<p><b>' . $lang->get('user_settings_2fa_key') . ':</b> ' . $secret . '<br/><br/>';
$website = $MCONF['title'] . ' - Admin';
$title = $_SESSION['user'];
$qrCodeUrl = $authenticator->getSecretUrl($title, $secret, $website);
echo '<img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&format=svg&data=' . $qrCodeUrl . '" alt=""/></p>';
?>
<p><?php echo $lang->get('user_settings_2fa_confirm_code'); ?>:</p>
<form action="<?php echo $_SERVER['REQUEST_URI']?>" method="post">
<p><input type="text" placeholder="<?php echo $lang->get('user_settings_2fa_enter_code'); ?>"
name="2fatest" autocomplete="off"/>
<input type="hidden" name="secret" value="<?php echo $secret; ?>"/>
<input type="submit" name="smbt" value="<?php echo $lang->get('user_settings_2fa_test'); ?>"/>
</p>
</form>
<?php
echo msg('fail', $lang->get('user_settings_2fa_activate_wrong_code') . ' {back}');
}
}
echo '</div>';
} else
{
$db->setCol('system_admins');
if (isset($_POST['smbt']))
else
{
$db->data['username'] = $_POST['username'];
$db->data['mail'] = $_POST['mail'];
if ($db->update(['id' => $uid]))
{
echo msg('success', $lang->get('user_settings_settings_success') . ' {back}');
stream_message('{user} changed it\'s username and/or email-adress.', 4);
} else
{
echo msg('fail', $lang->get('user_settings_settings_fail') . ' {back}');
}
echo '<p>' . $lang->get('user_settings_2fa_activate_import_code') . '</p>';
$secret = $auth->generateSecretKey();
echo '<p><b>' . $lang->get('user_settings_2fa_key') . ':</b> ' . $secret . '<br/><br/>';
//Log-Level
$loglevel = '';
$loglevelA = [];
if(isset($_POST['level_1']) && $_POST['level_1'] == 'true') $loglevelA[] = 1;
if(isset($_POST['level_2']) && $_POST['level_2'] == 'true') $loglevelA[] = 2;
if(isset($_POST['level_3']) && $_POST['level_3'] == 'true') $loglevelA[] = 3;
if(isset($_POST['level_4']) && $_POST['level_4'] == 'true') $loglevelA[] = 4;
$loglevel = json_encode($loglevelA);
//Get the current status
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->get();
if(isset($db->data[0]))//If we already have stream settings saved, update them
{
$db->setCol('system_show_stream');
$db->data['level'] = $loglevel;
if($db->update(['user' => $_SESSION['userid']]))
{
echo msg('success', $lang->get('user_settings_log_level_success') . ' {back}');
}
else
{
echo msg('fail', $lang->get('user_settings_log_level_fail') . ' {back}');
}
}
else //Otherwise insert them
{
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->data['level'] = $loglevel;
if($db->insert())
{
echo msg('success', $lang->get('user_settings_log_level_success'));
}
else
{
echo msg('fail', $lang->get('user_settings_log_level_fail'));
}
}
$qrcode = $auth->getQRCodeInline(
$MCONF['title'] . ' - Admin',
$_SESSION['user'],
$secret,
250
);
echo '<img src="' . $qrcode . '" alt=""/></p>';
?>
<p><?php echo $lang->get('user_settings_2fa_confirm_code'); ?>:</p>
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post">
<p><input type="text" placeholder="<?php echo $lang->get('user_settings_2fa_enter_code'); ?>"
name="2fatest" autocomplete="off"/>
<input type="hidden" name="secret" value="<?php echo $secret; ?>"/>
<input type="submit" name="smbt" value="<?php echo $lang->get('user_settings_2fa_test'); ?>"/>
</p>
</form>
<?php
}
}
echo '</div>';
} else
{
$db->setCol('system_admins');
if (isset($_POST['smbt']))
{
$db->data['username'] = $_POST['username'];
$db->data['mail'] = $_POST['mail'];
if ($db->update(['id' => $uid]))
{
echo msg('success', $lang->get('user_settings_settings_success') . ' {back}');
stream_message('{user} changed it\'s username and/or email-adress.', 4);
} else
{
$db->data['id'] = $uid;
$db->get();
//print_r($db->data);
if ($db->data[0]['username'] !== '')
echo msg('fail', $lang->get('user_settings_settings_fail') . ' {back}');
}
//Log-Level
$loglevel = '';
$loglevelA = [];
if (isset($_POST['level_1']) && $_POST['level_1'] == 'true') $loglevelA[] = 1;
if (isset($_POST['level_2']) && $_POST['level_2'] == 'true') $loglevelA[] = 2;
if (isset($_POST['level_3']) && $_POST['level_3'] == 'true') $loglevelA[] = 3;
if (isset($_POST['level_4']) && $_POST['level_4'] == 'true') $loglevelA[] = 4;
$loglevel = json_encode($loglevelA);
//Get the current status
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->get();
if (isset($db->data[0]))//If we already have stream settings saved, update them
{
$db->setCol('system_show_stream');
$db->data['level'] = $loglevel;
if ($db->update(['user' => $_SESSION['userid']]))
{
?>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI']?>" class="form" method="post">
<p><span><?php echo $lang->get('username'); ?>:</span><input name="username"
value="<?php echo $db->data[0]['username'] ?>"/>
</p>
<p><span><?php echo $lang->get('admins_mail'); ?>:</span><input name="mail"
value="<?php echo $db->data[0]['mail'] ?>"/>
</p>
<p><span><?php echo $lang->get('password'); ?>:</span><a
href="user_settings.php?uid=<?php echo $db->data[0]['id'];
echo msg('success', $lang->get('user_settings_log_level_success') . ' {back}');
} else
{
echo msg('fail', $lang->get('user_settings_log_level_fail') . ' {back}');
}
} else //Otherwise insert them
{
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->data['level'] = $loglevel;
if ($db->insert())
{
echo msg('success', $lang->get('user_settings_log_level_success'));
} else
{
echo msg('fail', $lang->get('user_settings_log_level_fail'));
}
}
} else
{
$db->data['id'] = $uid;
$db->get();
//print_r($db->data);
if ($db->data[0]['username'] !== '')
{
?>
<div class="main">
<form action="<?php echo $_SERVER['REQUEST_URI'] ?>" class="form" method="post">
<input type="hidden" name="askPW" value="askPW">
<p><span><?php echo $lang->get('username'); ?>:</span><input name="username"
value="<?php echo $db->data[0]['username'] ?>"/>
</p>
<p><span><?php echo $lang->get('admins_mail'); ?>:</span><input name="mail"
value="<?php echo $db->data[0]['mail'] ?>"/>
</p>
<p><span><?php echo $lang->get('password'); ?>:</span><a
href="user_settings.php?uid=<?php echo $db->data[0]['id'];
if ($db->data[0]['id'] == $_SESSION['userid'])
{
echo '&pw_u';
@ -291,74 +295,91 @@ if (hasPerm('manage_admins') || $uid == $_SESSION['userid'])
echo '&pw_new';
}
?>"><?php echo $lang->get('user_settings_settings_pass'); ?></a></p>
<p><span><?php echo $lang->get('admins_roles_group'); ?>:</span><?php
$lvl = $db->data[0]['lvl'];
$db->setCol('system_roles');
$db->data['id'] = $lvl;
$db->get();
echo $db->data[0]['name'] ?></p>
<p><span><?php echo $lang->get('user_settings_last_login'); ?>:</span><?php
$db->setCol('system_loggedin');
$db->data['user'] = $uid;
$db->get();
if (isset($db->data[0]['time']))
<p><span><?php echo $lang->get('admins_roles_group'); ?>:</span><?php
$lvl = $db->data[0]['lvl'];
$db->setCol('system_roles');
$db->data['id'] = $lvl;
$db->get();
if (isset($db->data[0]['name']))
{
echo $db->data[0]['name'];
} else
{
echo '<i>' . sprintf($lang->get('user_settings_none'), $MCONF['web_uri'] . 'admin/roles.php') . '</i>';
} ?></p>
<p><span><?php echo $lang->get('user_settings_last_login'); ?>:</span><?php
$db->setCol('system_loggedin');
$db->data['user'] = $uid;
$db->get();
if (isset($db->data[0]['time']))
{
echo date('d.m.Y H:i:s', $db->data[0]['time']);
} else
{
$last_login = '<i>' . $lang->get('never') . '</i>';
foreach ($db->data as $data)
{
echo date('d.m.Y H:i:s', $db->data[0]['time']);
} else
{
$last_login = '<i>' . $lang->get('never') . '</i>';
foreach ($db->data as $data)
{
$last_login = date('d.m.Y H:i:s', $data['time']);
}
echo $last_login;
$last_login = date('d.m.Y H:i:s', $data['time']);
}
echo $last_login;
}
if ($uid == $_SESSION['userid'])
{
echo ' <a href="user_settings.php?sessions">' . $lang->get('user_settings_show_current_sessions') . '</a>';
?></p>
<p><span><?php echo $lang->get('user_settings_2fa'); ?>:</span><?php
$db->clear();
$db->setCol('system_admins');
$db->data['id'] = $_SESSION['userid'];
$db->get();
if (isset($db->data[0]['secret']) && $db->data[0]['secret'] != '')
{
echo $lang->get('general_active') . '. <a href="?2fa">' . $lang->get('general_deactivate') . '</a>';
} else
{
echo $lang->get('general_inactive') . '. <a href="?2fa">' . $lang->get('general_activate') . '</a>';
}
}
?><br/></p>
<p><span><?php echo $lang->get('user_settings_log_level'); ?>:</span>
<?php
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->get();
if ($uid == $_SESSION['userid'])
{
echo ' <a href="user_settings.php?sessions">' . $lang->get('user_settings_show_current_sessions') . '</a>';
?></p>
<p><span><?php echo $lang->get('user_settings_2fa'); ?>:</span><?php
$db->clear();
$db->setCol('system_admins');
$db->data['id'] = $_SESSION['userid'];
$db->get();
if (isset($db->data[0]['secret']) && $db->data[0]['secret'] != '')
{
echo $lang->get('general_active') . '. <a href="?2fa">' . $lang->get('general_deactivate') . '</a>';
} else
{
echo $lang->get('general_inactive') . '. <a href="?2fa">' . $lang->get('general_activate') . '</a>';
}
}
?><br/></p>
<p><span><?php echo $lang->get('user_settings_log_level'); ?>:</span>
<?php
$db->setCol('system_show_stream');
$db->data['user'] = $_SESSION['userid'];
$db->get();
$loglevel = [];
if (isset($db->data[0]))
{
$loglevel = json_decode($db->data[0]['level']);
?>
<input type="checkbox" name="level_1" id="level_1"<?php if(in_array(1, $loglevel)) echo ' checked="checked"';?>/>
<label for="level_1"><i></i> <?php echo $lang->get('user_settings_log_level_1'); ?></label><div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_2" id="level_2"<?php if(in_array(2, $loglevel)) echo ' checked="checked"';?>/>
<label for="level_2"><i></i> <?php echo $lang->get('user_settings_log_level_2'); ?></label><div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_3" id="level_3"<?php if(in_array(3, $loglevel)) echo ' checked="checked"';?>/>
<label for="level_3"><i></i> <?php echo $lang->get('user_settings_log_level_3'); ?></label><div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_4" id="level_4"<?php if(in_array(4, $loglevel)) echo ' checked="checked"';?>/>
<label for="level_4"><i></i> <?php echo $lang->get('user_settings_log_level_4'); ?></label>
</p>
<p><input type="submit" name="smbt" value="<?php echo $lang->get('general_save_changes'); ?>"/>
</p>
</form>
</div>
<?php
}
}
?>
<input type="checkbox" name="level_1"
id="level_1"<?php if (in_array(1, $loglevel)) echo ' checked="checked"'; ?>/>
<label for="level_1"><i></i> <?php echo $lang->get('user_settings_log_level_1'); ?></label>
<div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_2"
id="level_2"<?php if (in_array(2, $loglevel)) echo ' checked="checked"'; ?>/>
<label for="level_2"><i></i> <?php echo $lang->get('user_settings_log_level_2'); ?></label>
<div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_3"
id="level_3"<?php if (in_array(3, $loglevel)) echo ' checked="checked"'; ?>/>
<label for="level_3"><i></i> <?php echo $lang->get('user_settings_log_level_3'); ?></label>
<div style="clear: both;"></div>
<span>&nbsp;</span>
<input type="checkbox" name="level_4"
id="level_4"<?php if (in_array(4, $loglevel)) echo ' checked="checked"'; ?>/>
<label for="level_4"><i></i> <?php echo $lang->get('user_settings_log_level_4'); ?></label>
</p>
<p><input type="submit" name="smbt" value="<?php echo $lang->get('general_save_changes'); ?>"/>
</p>
</form>
</div>
<?php
}
}
}
} else
{
echo msg('info', $lang->get('missing_permission'));

View File

@ -1,45 +1,59 @@
<?php
require_once '../inc/autoload_adm.php';
printHeader($lang->get('admins_list'));
if(hasPerm('manage_admins'))
if (hasPerm('manage_admins'))
{
?>
<div class="main">
<table>
<tr>
<th><?php echo $lang->get('admins_id');?></th>
<th><?php echo $lang->get('admins_users');?></th>
<th><?php echo $lang->get('admins_permissions');?></th>
<th><?php echo $lang->get('admins_mail');?></th>
<th></th>
</tr>
<table>
<tr>
<th><?php echo $lang->get('admins_id'); ?></th>
<th><?php echo $lang->get('admins_users'); ?></th>
<th><?php echo $lang->get('admins_group'); ?></th>
<th><?php echo $lang->get('admins_mail'); ?></th>
<th></th>
</tr>
<?php
$db->setCol('system_admins');
$db->get();
foreach ($db->data as $user)
$users = $db->data;
foreach ($users as $user)
{
?>
<tr>
<td><?php echo $user['id']; ?></td>
<td><?php echo $user['username']; ?></td>
<td><?php echo $user['lvl']; ?></td>
<td><?php if ($user['mail'] === '')
<tr>
<td><?php echo $user['id']; ?></td>
<td><?php echo $user['username']; ?></td>
<td><?php
$db->setCol('system_roles');
$db->data['id'] = $user['lvl'];
$db->get();
if (isset($db->data[0]))
{
echo '<i>'.$lang->get('admins_not_set').'</i>';
echo '<a href="'.$MCONF['web_uri'].'admin/roles.php?members='.$user['lvl'].'">'.$db->data[0]['name'].'</a>';
}
else
{
echo '<i>'.sprintf($lang->get('user_settings_none'), $MCONF['web_uri']. 'admin/roles.php').'</i>';
}
?></td>
<td><?php if ($user['mail'] === '')
{
echo '<i>' . $lang->get('admins_not_set') . '</i>';
} else
{
?>
<a href="mail.php?to=<?php echo $user['mail']; ?>"
title="<?php printf($lang->get('admins_write_mail'), $user['username']);?>"><?php echo $user['mail']; ?></a>
<a href="mail.php?to=<?php echo $user['mail']; ?>"
title="<?php printf($lang->get('admins_write_mail'), $user['username']); ?>"><?php echo $user['mail']; ?></a>
<?php
}
?></td>
<td><a href="user_settings.php?uid=<?php echo $user['id']; ?>"><?php echo $lang->get('settings');?></a></td>
</tr>
<td><a href="user_settings.php?uid=<?php echo $user['id']; ?>"><?php echo $lang->get('settings'); ?></a>
</td>
</tr>
<?php
}
?>
</table>
</table>
<?php
}
else

View File

@ -1,12 +1,9 @@
<?php
$GLOBALS['lang']->set('Dateiverwaltung', 'files_title', 'de');
$GLOBALS['lang']->set('Manage Files', 'files_title', 'en');
$_CONF['app_name'] = 'Files';
$_CONF['app_desc'] = 'Ein Modul zum Anzeigen & Uploaden von Dateien';
$_CONF['app_build'] = 1;
$_CONF['app_version'] = 'v0.9 Beta';
$_CONF['menu_top'] = '<i class="fa fa-folder"></i> '.$GLOBALS['lang']->get('files_title');
$_CONF['menu_top'] = '<i class="fa fa-folder"></i> '.$lang->get('files_title');
$_CONF['menu'] = ['menu_top' => 'index.php'];
$_CONF['type'] = 'none';

0
apps/Files/css/files.css Normal file → Executable file
View File

View File

@ -461,6 +461,14 @@ else
}, 300);
}
window.onclick = function(event) {
if(event.target.parentElement != null) {
if (event.target.parentElement.id == 'extra') {
closeW();
}
}
}
function uploadFileBtn() {
$("#upbutton").click();
}

View File

@ -12,7 +12,7 @@ $lang['__Lang__'] = 'English (English)';
$lang['__LangCode__'] = 'en';
$lang['__Countrycode__'] = 'en';
$lang['files_title'] = 'File';
$lang['files_title'] = 'Files';
$lang['files_drag_drop_area'] = 'Drag and drop Files here to upload in the current folder.';
$lang['files_upload'] = 'Upload';
$lang['files_create_dir'] = 'Create New Folder';

132
apps/Navigation/action.php Executable file
View File

@ -0,0 +1,132 @@
<?php
require_once '../../inc/autoload.php';
$success = false;
if (is_loggedin())
{
//Save items
if (isset($_GET['save']))
{
if (hasPerm('edit_nav'))
{
$db->setCol('nav_nav');
foreach ($_POST['navID'] as $order => $id)
{
$db->data['nav_order'] = $order;
$success = $db->update(['id' => $id]);
}
//Stream Message
stream_message('{user} edited a nav entry ({extra})', 3, $id);
}
}
//Delete Items
if (isset($_GET['del']))
{
if (hasPerm('edit_nav'))
{
if (isset($_POST['id']) && is_numeric(intval($_POST['id'])))
{
$db->setCol('nav_nav');
$db->data['id'] = $_POST['id'];
$success = $db->delete();
//Find all childs
$childs = [];
function findChilds($parent)
{
global $db, $childs;
foreach ($parent as $site)
{
$childs[] = $site['id'];
$db->setCol('nav_nav');
$db->data['parent'] = $site['id'];
$db->get();
$navd = $db->data;
if (!empty($navd))
{
findChilds($navd);
}
}
}
$db->setCol('nav_nav');
$db->data['parent'] = $_POST['id'];
$db->get();
findChilds($db->data);
$db->setCol('nav_nav');
foreach ($childs as $child)
{
$db->data['id'] = $child;
$success = $db->delete();
}
//Stream Message
stream_message('{user} deleted a nav entry ({extra})', 3, $_POST['id']);
}
}
}
//Create Items
if (isset($_GET['create']))
{
if (hasPerm('edit_nav'))
{
if (isset($_POST['title'], $_POST['page'], $_POST['parent']))
{
if (is_numeric(intval($_POST['page'])) && is_numeric(intval($_POST['parent'])) && is_string(strval($_POST['title'])))
{
$pageval = $_POST['page'];
$send_ready = true;
if ($_POST['external'] !== '')
{
if (filter_var($_POST['external'], FILTER_VALIDATE_URL) === false)
{
$send_ready = false;
echo 'url_invalid';
}
$pageval = 0;
}
if ($send_ready)
{
$db->setCol('nav_nav');
$db->data['title'] = $_POST['title'];
$db->data['page'] = $pageval;
$db->data['external'] = $_POST['external'];
$db->data['parent'] = $_POST['parent'];
$success = $db->insert();
//Stream Message
stream_message('{user} created a nav entry ({extra})', 3, $_POST['page']);
}
}
}
}
}
//Update Parents
if (isset($_GET['update']))
{
if (isset($_POST['id'], $_POST['parent']))
{
if (is_numeric(intval($_POST['id'])) && is_numeric(intval($_POST['parent'])) && $_POST['parent'] != $_POST['id'])
{
$db->setCol('nav_nav');
$db->data['parent'] = $_POST['parent'];
$success = $db->update(['id' => $_POST['id']]);
//Stream Message
stream_message('{user} edited a nav entry ({extra})', 3, $_POST['id']);
}
}
}
}
if ($success)
{
echo 'success';
}

14
apps/Navigation/config.php Executable file
View File

@ -0,0 +1,14 @@
<?php
$_CONF['app_name'] = 'Navigation';
$_CONF['app_build'] = 2;
$_CONF['app_version'] = 'v0.91 Beta';
$_CONF['base_file'] = 'nav.php';
$_CONF['type'] = 'static';
$_CONF['install'] = 'install.php';
$_CONF['menu_top'] = '<i class="fa fa-bars"></i> ' . $lang->get('nav_title');
$_CONF['menu'] = ['menu_top' => 'index.php'];
$_CONF['css'] = ['css/nav.css'];
$_CONF['dependencies'] = ['apps' => ['SimplePages']];

123
apps/Navigation/css/nav.css Executable file
View File

@ -0,0 +1,123 @@
.pseudo-table{
display: table;
box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .14);
border: 1px solid #E0E0E0;
border-collapse: collapse;
white-space: nowrap;
width: 100%;
margin: 15px 0;
overflow: auto;
}
.pseudo-table .row{
display: table-row;
padding: 0 5px;
cursor: hand;
}
.pseudo-table .row{
border-bottom: 1px solid #E0E0E0;
padding: 0 5px 0 0;
transition: 0.1s ease;
-webkit-transition: 0.1s ease;
margin: 0 -15px 0 0 !important;
}
.pseudo-table .row:hover{
background: #EEEEEE;
}
.pseudo-table .row:last-child{
border-bottom: 0;
}
.pseudo-table .top{
text-align: left;
padding: 10px;
background: rgb(246, 246, 246);
}
.pseudo-table .col{
display: table-cell;
padding: 10px 5px 10px 10px;
}
.sortable-placeholder{
width: 100%;
height: 41px;
}
.row{
cursor: default;
}
.col i{
cursor: move;
}
/*Window*/
.overlay {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 99;
}
.window {
width: 100%;
max-width: 984px;
left: calc((50vw - 366px));
top: 40px;
background: #fff;
padding: 10px 10px 20px;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
z-index: 1;
border-radius: 2px;
position: fixed;
overflow: auto;
max-height: calc(100vh - 80px);
height: auto;
}
.window .head {
margin: -10px -10px 20px;
padding: 10px 10px;
background: #eaeaea;
border-radius: 2px 2px 0 0;
-moz-user-select: -moz-none;
-webkit-user-select: none;
user-select: none;
cursor: default;
position: fixed;
width: 984px;
}
.window .head .closeMsg {
color: #212121;
}
.window .head .closeMsg:hover {
color: #5d5d5d;
}
.window #content {
margin-top: 60px;
}
.window-confirm, .window-confirm .head {
width: 350px;
text-align: center;
left: calc(50vw - 175px);
}
.window-confirm .head {
margin: -10px -10px 10px 0;
text-align: left;
}

173
apps/Navigation/index.php Executable file
View File

@ -0,0 +1,173 @@
<?php
require_once '../../inc/autoload.php';
printHeader($lang->get('nav_title'));
//Get all pages and build a dropdown list
$pages = '';
$db->setCol('simplePages_pages');
$db->get();
foreach ($db->data as $page)
{
$pages .= '<option value="' . $page['id'] . '">' . $page['title'] . '</option>';
}
function getParents($exclude = null)
{
global $db;
//Get all parents and build a dropdown list
$parents = '<option value="0">--</option>';
$db->setCol('nav_nav');
$db->get(null, null, 'nav_order');
$parentdata = $db->data;
foreach ($parentdata as $parent)
{
if((isset($exclude) && $parent['id'] !== $exclude) || !isset($exclude))
{
//If we don't have a parent from the Nav itself, take the page's title
if ($parent['title'] === '')
{
$db->setCol('simplePages_pages');
$db->data['id'] = $parent['page'];
$db->get();
if (isset($db->data[0]))
{
$parents .= '<option value="' . $parent['id'] . '">' . $db->data[0]['title'] . '</option>';
}
} else
{
$parents .= '<option value="' . $parent['id'] . '">' . $parent['title'] . '</option>';
}
}
}
return $parents;
}
//Show
function buildNav($nav, $lvl = 0)
{
global $db;
foreach ($nav as $site)
{
//Reset level
if ($site['parent'] == 0)
{
$lvl = 0;
}
echo '<div class="row" id="navID_' . $site['id'] . '">';
$pageUrl = '#';
$db->setCol('simplePages_pages');
$db->data['id'] = $site['page'];
$db->get();
$title = $site['title'];
if ($title == '') $title = $db->data[0]['title'];
//Display Level
echo '<div class="col"><i class="fa fa-bars" aria-hidden="true" style="color: #ccc;"></i>&nbsp;&nbsp;&nbsp;&nbsp;';
for ($i = 1; $i <= $lvl; $i++)
{
echo '&nbsp;&nbsp;&nbsp;';
}
$title = $site['title'];
if ($title == '') $title = $db->data[0]['title'];
echo $title . '</div><div class="col">';
//Don't show edit-link if the entry is external
if($site['external'] === '')
{
echo '<a href="../SimplePages/backend/edit.php?id=' . $site['page'] . '"><i class="fa fa-pencil" aria-hidden="true"></i> ' . $db->data[0]['title'] . '</a>';
}
else
{
echo substr($site['external'], 0, 30);
if(strlen($site['external']) > 30) echo '...';
}
echo '</div>
<div class="col"><select id="parentChange_' . $site['id'] . '" data-nav-id="' . $site['id'] . '" onchange="update(\'' . $site['id'] . '\')">' . str_replace('value="' . $site['parent'] . '"', 'value="' . $site['parent'] . '" selected', getParents($site['id'])) . '</select></div>
<div class="col"><a onclick="del(' . $site['id'] . ');" class="del" title="' . $GLOBALS['lang']->get('nav_delete') . '"><i class="fa fa-trash-o" aria-hidden="true"></i></a></div>';
echo "</div>\n";
//Look for childs
$db->setCol('nav_nav');
$db->data['parent'] = $site['id'];
$db->get(null, null, 'nav_order');
$navd = $db->data;
if (!empty($navd))
{
$lvl++;
buildNav($navd, $lvl);
}
}
}
if (hasPerm('edit_nav'))
{
?>
<div class="main">
<p><i class="fa fa-info-circle"></i> <?php echo $lang->get('nav_drag') ?></p>
<p><a onclick="createItem();" class="button"><i class="fa fa-plus"
aria-hidden="true"></i>&nbsp;&nbsp;<?php echo $lang->get('nav_create'); ?>
</a></p>
<div id="sortable" class="pseudo-table">
<div class="row top" id="top notSort">
<div class="col"><?php echo $lang->get('nav_pageTitle') ?></div>
<div class="col"><?php echo $lang->get('nav_page') ?></div>
<div class="col"><?php echo $lang->get('nav_parent') ?></div>
<div class="col"><?php echo $lang->get('nav_action') ?></div>
</div>
<?php
$db->setCol('nav_nav');
$db->data['parent'] = 0;
$db->get(null, null, 'nav_order');
buildNav($db->data);
?>
</div>
<div id="extra"></div>
</div>
<script src="js/jquery-ui.js"></script>
<script src="js/nav.js"></script>
<script>
//Create Dropdowns
var parents = '<?php echo getParents();?>';
var pages = '<?php echo $pages;?>';
//Make Language Strings available in JS
var lang = {
nav_saved_success: '<?php echo $lang->get('nav_saved_success') ?>',
nav_saved_fail: '<?php echo $lang->get('nav_saved_fail') ?>',
nav_delete: '<?php echo $lang->get('nav_delete') ?>',
nav_delete_confirm: '<?php echo $lang->get('nav_delete_confirm') ?>',
nav_delete_confirm_yes: '<?php echo $lang->get('nav_delete_confirm_yes') ?>',
nav_delete_confirm_abort: '<?php echo $lang->get('nav_delete_confirm_abort') ?>',
nav_deleted_success: '<?php echo $lang->get('nav_deleted_success') ?>',
nav_deleted_fail: '<?php echo $lang->get('nav_deleted_fail') ?>',
nav_create: '<?php echo $lang->get('nav_create') ?>',
nav_create_title: '<?php echo $lang->get('nav_create_title') ?>',
nav_create_title_noptoption: '<?php echo $lang->get('nav_create_title_noptoption') ?>',
nav_create_page: '<?php echo $lang->get('nav_create_page') ?>',
nav_create_parents: '<?php echo $lang->get('nav_create_parents') ?>',
nav_create_create: '<?php echo $lang->get('nav_create_create') ?>',
nav_create_abort: '<?php echo $lang->get('nav_create_abort') ?>',
nav_create_success: '<?php echo $lang->get('nav_create_success') ?>',
nav_create_fail: '<?php echo $lang->get('nav_create_fail') ?>',
nav_update_success: '<?php echo $lang->get('nav_update_success') ?>',
nav_update_fail: '<?php echo $lang->get('nav_update_fail') ?>',
not_found: '<?php echo $lang->get('404_not_found') ?>',
nav_create_external_url_invalid: '<?php echo $lang->get('nav_create_external_url_invalid') ?>',
nav_create_external_needs_title: '<?php echo $lang->get('nav_create_external_needs_title') ?>',
nav_create_external: '<?php echo $lang->get('nav_create_external') ?>',
nav_create_external_input: '<?php echo $lang->get('nav_create_external_input') ?>'
};
</script>
<?php
} else
{
echo msg('info', 'missing_permission');
}
require_once '../../inc/footer.php';

30
apps/Navigation/install-dev.php Executable file
View File

@ -0,0 +1,30 @@
<?php
if(isset($_POST['submit']))
{
if($db->query('CREATE TABLE `' . $_POST['db_prefix'] . 'nav_nav` (
`id` int(11) NOT NULL,
`title` text CHARACTER SET latin1 NOT NULL,
`page` int(11) NOT NULL,
`parent` int(11) NOT NULL,
`nav_order` int(11) NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `' . $_POST['db_prefix'] . 'nav_nav`
ADD PRIMARY KEY (`id`);
ALTER TABLE `' . $_POST['db_prefix'] . 'nav_nav`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
ALTER TABLE `' . $_POST['db_prefix'] . 'nav_nav` ADD external VARCHAR(300) NULL;
ALTER TABLE `' . $_POST['db_prefix'] . 'nav_nav`
MODIFY COLUMN external VARCHAR(300) AFTER page;
'))
{
echo msg('success', 'Navigation was installed successfully.');
}
else
{
echo msg('fail', 'An error occured while installing Navigation.');
exit;
}
}

18706
apps/Navigation/js/jquery-ui.js vendored Executable file

File diff suppressed because it is too large Load Diff

192
apps/Navigation/js/nav.js Executable file
View File

@ -0,0 +1,192 @@
//Create the Spinner
$('#title').append('<div class="spinner-container" style="display:inline-block;vertical-align: middle;padding: 0px 10px;"><svg class="spinner" style="width: 25px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle></svg></div>');
//Hide it
$('.spinner-container').hide();
$(function () {
$("#sortable").sortable({
axis: "y",
cursor: "move",
items: 'div:not(.top).row',
placeholder: "sortable-placeholder",
over: function (event, ui) {
console.log(event, ui)
},
stop: function (event, ui) {// When finished sorting, send all data to the server to process
$('.spinner-container').show(); //Show loader
$.ajax({
url: 'action.php?save',
type: 'POST',
cache: false,
data: $("#sortable").sortable("serialize"), //Get the newly sorted array
success: function (result) { // On success, display a message..
if (result == 'success') {
showMsg(lang.nav_saved_success);
} else {
showMsg(lang.nav_saved_fail);
}
//And reload the content. We do this to display everything including their childs
reloadNav();
$('.spinner-container').hide(); //Hide the Loader
},
error: function (xhr, status, error) {
console.log(status, error);
showMsg(lang.nav_saved_fail);
}
});
}
});
});
//Delete
function del(id) {
$('#extra').html('<div class="overlay" style="display:none;"><div class="window window-confirm"><div class="head">' + lang.nav_delete + '<a onclick="closeW();" class="closeMsg"><i class="fa fa-close"></i></a></div><div id="content"><p>' + lang.nav_delete_confirm + '</p><p><a class="button btn_del" id="deleteConfirm"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;' + lang.nav_delete_confirm_yes + '</a><a onclick="closeW();" class="button">' + lang.nav_delete_confirm_abort + '</a></p></div></div></div>');
//uuund einbelnden
$(".overlay").fadeIn(250);
$('#deleteConfirm').click(function () {
closeW();
$.ajax({
url: 'action.php?del',
type: 'POST',
cache: false,
data: 'id=' + id,
success: function (result) { // On success, display a message...
console.log(result);
if (result == 'success') {
showMsg(lang.nav_deleted_success);
} else {
showMsg(lang.nav_deleted_fail);
}
//...and reload the content. We do this to display everything including their childs
reloadNav();
$('.spinner-container').hide(); //Hide the Loader
},
error: function (xhr, status, error) {
console.log(status, error);
showMsg(lang.nav_deleted_fail);
}
});
});
}
//Create menuitem
function createItem() {
$('#extra').html('<div class="overlay" style="display:none;"><div class="window window-confirm"><div class="head">' + lang.nav_create + '<a onclick="closeW();" class="closeMsg"><i class="fa fa-close"></i></a></div><div id="content"><p><input type="text" name="nav_title" id="nav_title" placeholder="' + lang.nav_create_title + '"/></p><p>' + lang.nav_create_page + ' <input type="checkbox" id="externalCheck"/><label for="externalCheck"><i></i>' + lang.nav_create_external + ' </label> <select name="nav_page" id="nav_page">' + pages + '</select><input type="text" name="nav_external" id="nav_external" style="display: none;" placeholder="' + lang.nav_create_external_input + '"/></p><p>' + lang.nav_create_parents + ': <select name="nav_parent" id="nav_parent">' + parents + '</select></p><p><a class="button" id="createConfirm"><i class="fa fa-plus"></i>&nbsp;&nbsp;' + lang.nav_create_create + '</a><a onclick="closeW();" class="button btn_del">' + lang.nav_create_abort + '</a></p></div></div></div>');
$(".overlay").fadeIn(250);
//Check for checked
$('#externalCheck').change(function () {
if (this.checked) {
$('#nav_page').hide();
$('#nav_external').show().focus();
$('#nav_title').attr('placeholder', lang.nav_create_title_noptoption);
} else {
$('#nav_page').show();
$('#nav_external').hide();
$('#nav_title').attr('placeholder', lang.nav_create_title);
}
});
//Send
$('#createConfirm').click(function () {
var external = $('#nav_external').val();
var sendReady = true;
if ($('#externalCheck').is(':checked')) {
if ($('#nav_title').val() == '') {
sendReady = false;
showMsg(lang.nav_create_external_needs_title);
}
}
//Send
if (sendReady) {
$.ajax({
url: 'action.php?create',
type: 'POST',
cache: false,
data: 'title=' + $('#nav_title').val() + '&page=' + $('#nav_page').val() + '&parent=' + $('#nav_parent').val() + '&external=' + external,
success: function (result) { // On success, display a message...
if (result == 'success') {
showMsg(lang.nav_create_success);
reloadNav();//...and reload the content. We do this to display everything properly including their childs
} else if(result == 'url_invalid') {
showMsg(lang.nav_create_external_url_invalid);
$('#nav_external').focus();
} else {
showMsg(lang.nav_create_fail);
reloadNav();//...and reload the content. We do this to display everything properly including their childs
}
$('.spinner-container').hide(); //Hide the Loader
},
error: function (xhr, status, error) {
showMsg(lang.nav_create_fail);
}
});
}
});
}
function update(id) {
var newParent = $('#parentChange_' + id).val();
$.ajax({
url: 'action.php?update',
type: 'POST',
cache: false,
data: 'id=' + id + '&parent=' + newParent,
success: function (result) { // On success, display a message...
if (result == 'success') {
showMsg(lang.nav_update_success);
} else {
showMsg(lang.nav_update_fail);
}
//...and reload the content. We do this to display everything including their childs
reloadNav();
$('.spinner-container').hide(); //Hide the Loader
},
error: function (xhr, status, error) {
showMsg(lang.nav_update_fail);
$('.spinner-container').hide(); //Hide the Loader
}
});
}
//Reload
function reloadNav() {
$.get('index.php?direct', function (data) {
$("#loader").html(data);
}).fail(function (e) {
if (e.status == 404) {
showMsg(lang.not_found + ' (' + e.statusText + ')');
} else {
showMsg('Error.');
}
});
}
//Close Window
function closeW() {
console.log('close');
$(".overlay").fadeOut(200);
setTimeout(function () {
$('#extra').html('');
}, 300);
}
window.onclick = function (event) {
if (event.target.parentElement != null) {
if (event.target.parentElement.id == 'extra') {
closeW();
}
}
}

View File

@ -0,0 +1,48 @@
<?php
/*
* Mowie Language Class
*
* -----------------
* LANGUAGE: German
* -----------------
*/
$lang = [];
$lang['__Lang__'] = 'German (Deutsch)';
$lang['__LangCode__'] = 'de';
$lang['__Countrycode__'] = 'de_DE';
$lang['nav_title'] = 'Navigation';
$lang['nav_id'] = 'ID';
$lang['nav_pageTitle'] = 'Titel';
$lang['nav_page'] = 'Seite';
$lang['nav_parent'] = 'Übergeordnet';
$lang['nav_drag'] = 'Ziehen Sie Menüpunkte herum, um sie anzuordnen.';
$lang['nav_saved_success'] = 'Die neue Reihenfolge wurde erfolgreich gespeichert.';
$lang['nav_saved_fail'] = 'Beim Speichern der neuen Reihenfolge trat ein Fehler auf.';
$lang['nav_action'] = 'Aktionen ausführen';
$lang['nav_delete'] = 'Menüeintrag löschen';
$lang['nav_deleted_success'] = 'Der Menüeintrag wurde erfolgreich gelöscht.';
$lang['nav_deleted_fail'] = 'Beim Löschen des Menüeintrags trat ein Fehler auf.';
$lang['nav_delete_confirm'] = 'Möchten Sie diesen Menüeintrag wirklich löschen?';
$lang['nav_delete_confirm_yes'] = 'Löschen!';
$lang['nav_delete_confirm_abort'] = 'Abbrechen';
$lang['nav_create'] = 'Neuen Menüeintrag erstellen';
$lang['nav_create_title'] = 'Titel (Optional)';
$lang['nav_create_title_noptoption'] = 'Titel';
$lang['nav_create_create'] = 'Erstellen';
$lang['nav_create_abort'] = 'Abbrechen';
$lang['nav_create_parents'] = 'Übergeordnet';
$lang['nav_create_page'] = 'Seite';
$lang['nav_create_success'] = 'Der neue Menüeintrag wurde erfolgreich angelegt.';
$lang['nav_create_fail'] = 'Beim Anlegen des neuen Menüeintrags trat ein Fehler auf.';
$lang['nav_update_success'] = 'Der Menüeintrag wurde erfolgreich geändert.';
$lang['nav_update_fail'] = 'Beim Ändern des Menüeintrags trat ein Fehler auf.';
$lang['nav_create_external'] = 'Extern';
$lang['nav_create_external_input'] = 'Externe URL';
$lang['nav_create_external_needs_title'] = 'Bitte geben Sie einen Titel an, wenn sie einen Externen Menüeinrag anlegen.';
$lang['nav_create_external_url_invalid'] = 'Die angegebene URL ist ungültig.';
//Stream
$lang['nav_stream_edited'] = '{user} hat einen Menüeintrag geändert ({extra})';
$lang['nav_stream_deleted'] = '{user} hat einen Menüeintrag gelöscht ({extra})';
$lang['nav_stream_created'] = '{user} hat einen Menüeintrag hinzugefügt ({extra})';

View File

@ -0,0 +1,48 @@
<?php
/*
* Mowie Language Class
*
* -----------------
* LANGUAGE: German
* -----------------
*/
$lang = [];
$lang['__Lang__'] = 'English (English)';
$lang['__LangCode__'] = 'en';
$lang['__Countrycode__'] = 'en';
$lang['nav_title'] = 'Navigation';
$lang['nav_id'] = 'ID';
$lang['nav_pageTitle'] = 'Title';
$lang['nav_page'] = 'Page';
$lang['nav_parent'] = 'Child of';
$lang['nav_drag'] = 'Drag & Drop entries to arrange them.';
$lang['nav_saved_success'] = 'The new order was successfully saved.';
$lang['nav_saved_fail'] = 'An error occured while saving the new order.';
$lang['nav_action'] = 'Action';
$lang['nav_delete'] = 'Delete';
$lang['nav_deleted_success'] = 'The item was successfully deleted.';
$lang['nav_deleted_fail'] = 'An error occured while deleting this item.';
$lang['nav_delete_confirm'] = 'Are you sure you want to delete this item?';
$lang['nav_delete_confirm_yes'] = 'Delete!';
$lang['nav_delete_confirm_abort'] = 'Cancel';
$lang['nav_create'] = 'Create a new item';
$lang['nav_create_title'] = 'Title (Optional)';
$lang['nav_create_title_noptoption'] = 'Title';
$lang['nav_create_create'] = 'Create';
$lang['nav_create_abort'] = 'Cancel';
$lang['nav_create_parents'] = 'Child of';
$lang['nav_create_page'] = 'Page';
$lang['nav_create_success'] = 'The new item was successfully created.';
$lang['nav_create_fail'] = 'An error occured while saving the new item.';
$lang['nav_update_success'] = 'The item was successfully updated.';
$lang['nav_update_fail'] = 'An error occured while updating the item.';
$lang['nav_create_external'] = 'External';
$lang['nav_create_external_input'] = 'External URL';
$lang['nav_create_external_needs_title'] = 'Please provide a title when creating an external nav entry.';
$lang['nav_create_external_url_invalid'] = 'The provided URL is invalid.';
//Stream
$lang['nav_stream_edited'] = '{user} edited a nav entry ({extra})';
$lang['nav_stream_deleted'] = '{user} deleted a nav entry ({extra})';
$lang['nav_stream_created'] = '{user} created a nav entry ({extra})';

51
apps/Navigation/nav.php Executable file
View File

@ -0,0 +1,51 @@
<?php
$navTree = '';
//Show
function buildNav($nav)
{
global $navTree, $db;
$navTree .= '<ul>';
foreach ($nav as $site)
{
//Get the Page URL
$pageUrl = '#';
if ($site['external'] === '')
{
$db->setCol('simplePages_pages');
$db->data['id'] = $site['page'];
$db->get();
if (!empty($db->data)) $pageUrl = $GLOBALS['MCONF']['web_uri'].$db->data[0]['alias'];
}
else
{
$pageUrl = $site['external'];
}
//Get the page title
$title = $site['title'];
if($title == '') $title = $db->data[0]['title'];
$navTree .= '<li><a href="'.$pageUrl.'">'.$title.'</a>';
//Look for childs
$db->setCol('nav_nav');
$db->data['parent'] = $site['id'];
$db->get(null, null, 'nav_order');
$navd = $db->data;
//If this site has any childs, build the navtree for them
if (!empty($navd))
{
buildNav($navd);
}
$navTree .= '</li>';
}
$navTree .= '</ul>';
}
//Create the Navigation, start with all top-level pages
$db->setCol('nav_nav');
$db->data['parent'] = 0;
$db->get(null, null, 'nav_order');
buildNav($db->data);
$page->assign('navTree', $navTree);

View File

@ -1,8 +1,8 @@
{
"permissions": [
{
"key": "view_logfiles",
"name": "View Logfiles",
"key": "edit_nav",
"name": "Edit the Navigation",
"description": "",
"critical": false
}

View File

@ -1,2 +1,2 @@
confirmationRequierd = true
confirmationUser = 1
confirmationRequierd = false
confirmationUser = 0

16
apps/SimplePages/backend/confirmConfig.php Normal file → Executable file
View File

@ -11,10 +11,16 @@ if(file_exists($iniFile))
$config = parse_ini_file($iniFile);
//print_r($config);exit;
$confirmationRequierd = $config['confirmationRequierd'];
$confirmationUser = $config['confirmationUser'];
$confirmationUserMail = null;
$confirmationUser = null;
$db->setCol('system_admins');
$db->data['id'] = $confirmationUser;
$db->get();
$confirmationUserMail = $db->data[0]['mail'];
if($confirmationRequierd)
{
$confirmationUser = $config['confirmationUser'];
$db->setCol('system_admins');
$db->data['id'] = $confirmationUser;
$db->get();
$confirmationUserMail = $db->data[0]['mail'];
}
}

View File

@ -8,6 +8,7 @@ if (hasPerm('view_dashboard'))
$lang->set('Pages you can edit', 'sp_edit_pages_to_edit', 'en');
//If pages are available for confirmation, show them
// TODO: Check if the config exists
$config = parse_ini_file('../apps/SimplePages/backend/confirm.ini');
if ($_SESSION['userid'] == $config['confirmationUser'])
{

View File

@ -88,11 +88,11 @@ if (hasPerm('manage_pages'))
$id = $db->lastID();
if($confirmationRequierd && ($_SESSION['userid'] != $confirmationUser))
{
echo msg('succes', sprintf($lang->get('sp_edit_created'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' <a href="management.php">'.$lang->get('back').'</a>');
echo msg('success', sprintf($lang->get('sp_edit_created'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' <a href="management.php">'.$lang->get('back').'</a>');
}
else
{
echo msg('succes', sprintf($lang->get('sp_edit_created'), $_POST['title']).' <a href="management.php">'.$lang->get('back').'</a>');
echo msg('success', sprintf($lang->get('sp_edit_created'), $_POST['title']).' <a href="management.php">'.$lang->get('back').'</a>');
}
stream_message('{user} created the page "{extra}".', 3, $_POST['title'].' ('.$id.')');
}
@ -113,7 +113,7 @@ if (hasPerm('manage_pages'))
{
if ($db->insert())
{
echo msg('succes', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' <a href="management.php">'.$lang->get('back').'</a>');
echo msg('success', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' '.sprintf($lang->get('sp_edit_edited_need_confirm'), getUserByID($confirmationUser)).' <a href="management.php">'.$lang->get('back').'</a>');
stream_message('{user} edited the page "{extra}".', 3, $_POST['title'].' ('.$id.')');
}
else
@ -125,7 +125,7 @@ if (hasPerm('manage_pages'))
{
if ($db->update(['id' => $_GET['id']]))
{
echo msg('succes', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' <a href="management.php">'.$lang->get('back').'</a>');
echo msg('success', sprintf($lang->get('sp_edit_edited'), $_POST['title']).' <a href="management.php">'.$lang->get('back').'</a>');
stream_message('{user} edited the page "{extra}".', 3, $_POST['title'].' ('.$id.')');
}
else
@ -165,7 +165,7 @@ if (hasPerm('manage_pages'))
$db->data['id'] = $_GET['id'];
if ($db->delete())
{
echo msg('succes', $lang->get('sp_edit_delete_success').' <a href="management.php">'.$lang->get('back').'</a>');
echo msg('success', $lang->get('sp_edit_delete_success').' <a href="management.php">'.$lang->get('back').'</a>');
stream_message('{user} deleted the page "{extra}".', 3, $_GET['id']);
}
else

View File

@ -40,7 +40,7 @@ if (hasPerm('grant_permissions'))
$db->data['lastedit'] = time();
if ($db->insert())
{
echo msg('succes', $lang->get('sp_grant_permissions_success'));
echo msg('success', $lang->get('sp_grant_permissions_success'));
stream_message('{user} granted permissions to "{extra}".', 3, getUserByID($_POST['user']). ' ('.$_POST['user'].')');
} else
{

View File

@ -1,25 +1,16 @@
<?php
//langstrings
$GLOBALS['lang']->set('Seiten', 'sp_pages', 'de');
$GLOBALS['lang']->set('Seitenverwaltung', 'sp_manage_pages', 'de');
$GLOBALS['lang']->set('Berechtigungen verwalten', 'sp_manage_permissions', 'de');
$GLOBALS['lang']->set('Neue Seite erstellen', 'sp_create_new', 'de');
$GLOBALS['lang']->set('Pages', 'sp_pages', 'en');
$GLOBALS['lang']->set('Manage Pages', 'sp_manage_pages', 'en');
$GLOBALS['lang']->set('Manage Permissions', 'sp_manage_permissions', 'en');
$GLOBALS['lang']->set('Create New Page', 'sp_create_new', 'en');
$_CONF['app_name'] = 'SimplePages';
$_CONF['app_desc'] = 'Wird benutzt, um Einfache statische Seitn zu erzeugen und zu verwalten.';
$_CONF['app_build'] = 2;
$_CONF['app_version'] = 'v0.9 Beta';
$_CONF['base_url'] = '/'; //Basisurl des moduls, wenn es über das Frontend aufgerufen wird
$_CONF['base_file'] = 'front/page.php'; //Datei, die angezeigt wird, wenn die basisurl aufgerufen wird
$_CONF['menu_top'] = '<i class="fa fa-file-text"></i> '.$GLOBALS['lang']->get('sp_pages'); //Name des Moduls, wie es im Adminbereich im Hauptmenü auftaucht
$_CONF['menu'] = ['<i class="fa fa-th-list"></i> '.$GLOBALS['lang']->get('sp_manage_pages') => 'backend/management.php',
'<i class="fa fa-lock"></i> '.$GLOBALS['lang']->get('sp_manage_permissions') => 'backend/permissions.php',
'<i class="fa fa-file"></i> '.$GLOBALS['lang']->get('sp_create_new') => 'backend/edit.php?new']; //Ein Array mit menüpunkten im adminbereich
$_CONF['menu_top'] = '<i class="fa fa-file-text"></i> '.$lang->get('sp_pages'); //Name des Moduls, wie es im Adminbereich im Hauptmenü auftaucht
$_CONF['menu'] = ['<i class="fa fa-th-list"></i> '.$lang->get('sp_manage_pages') => 'backend/management.php',
'<i class="fa fa-lock"></i> '.$lang->get('sp_manage_permissions') => 'backend/permissions.php',
'<i class="fa fa-file"></i> '.$lang->get('sp_create_new') => 'backend/edit.php?new']; //Ein Array mit menüpunkten im adminbereich
$_CONF['dashboard'] = 'backend/dashboard.php';
$_CONF['type'] = 'page';
$_CONF['install'] = 'install.php';
@ -28,19 +19,12 @@ $confirmationRequierd = false;
$iniFile = 'confirm.ini';
if(strpos($_SERVER['SCRIPT_FILENAME'], '/apps/') === false)
{
$iniFile = '../SimplePages/backend/confirm.ini';
$iniFile = __DIR__.'/../SimplePages/backend/confirm.ini';
}
if(file_exists($iniFile))
{
$config = parse_ini_file($iniFile);
$confirmationRequierd = $config['confirmationRequierd'];
//$confirmationUserMail = $config['confirmationUserMail'];
$confirmationUser = $config['confirmationUser'];
//Get the user's email
/*$db->setCol('system_admins');
$db->data['id'] = $confirmationUser;
$db->get();
if(isset($db->data[0])) $confirmationUserMail = $db->data[0]['mail'];*/
}

View File

@ -9,7 +9,7 @@ if(isset($db->data[0]['title']))
{
$page->setResponseCode(200);
$page->setTitle($db->data[0]['title']);
$meta = '';
$meta = [];
//gucken ob das was auszuführren ist
$pos = strpos($db->data[0]['content'], 'EXEC ');
@ -22,21 +22,19 @@ if(isset($db->data[0]['title']))
} else
{
$page->setContent($db->data[0]['content']);
//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' <meta name="description" content="' . $db->data[0]['meta_description'] . '">' . "\n";
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' <meta name="keywords" content="' . $db->data[0]['meta_keywords'] . '">' . "\n";
}
}
else
{
$page->setContent($db->data[0]['content']);
//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' <meta name="description" content="' . $db->data[0]['meta_description'] . '">' . "\n";
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' <meta name="keywords" content="' . $db->data[0]['meta_keywords'] . '">' . "\n";
}
//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '')
$meta['description'] = $db->data[0]['meta_description'];
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '')
$meta['keywords'] = $db->data[0]['meta_keywords'];
$page->assign('meta', $meta, true);
$page->assign('pageID', $db->data[0]['id']);
}
}

View File

@ -60,7 +60,7 @@ confirmationUser = '.$db->data[0]['id'];
}
file_put_contents('backend/confirm.ini', $confirmIni, FILE_USE_INCLUDE_PATH);
echo msg('succes', 'SimplePages was installed successfully.');
echo msg('success', 'SimplePages was installed successfully.');
}
else
{
@ -78,6 +78,6 @@ else
<div id="confirmationUser" style="display:none;">
<span>Confirmation User:</span> <input type="text" name="confirmationUser" placeholder="Confirmation User"/>
</div>
<?php
<?php
}
?>

View File

@ -1,398 +0,0 @@
<?php
class Logging {
//globals
var $logDir="";
var $logFile="";
var $countFile="";
var $headerTitle="";
var $logMode="";
var $logNumber="";
/**
* @return void
* @desc
Class constructor.
Prepares files for first run.
Global variables setting.
*/
function Logging($logDir='log', $logFile='log_', $headerTitle='LOG', $logMode='oneFile', $countFile="counter"){
//-----------------------------------------------------
//set global variables //es: seteo variables globales
$this->logDir=$logDir;
$this->logFile=$logFile;
if($countFile) $this->countFile=$this->logDir . "/$countFile";
$this->headerTitle=$headerTitle;
$this->logMode=$logMode;
//generate log number //es: genero el NRO DE LOG
//set counter file and log folder //es: seteo el archivo contador y la carpeta de logs
$countFile=$this->countFile;
$logDir=$this->logDir;
//verify log folder existence //es: verifico que exista la carpeta de logs
//if it doesn't I create it //es: si no existe la creo
if(!is_dir($logDir)){
if(mkdir($logDir)===FALSE){
echo "Could not create log dir"; //es: 'No es posible crear el directorio de logs';
}
}
//Counter INICILIZATION //es: INICIALIZACIÓN del Counter
if(file_exists($countFile)===FALSE){
//if log counter file does not exist, I create it //es: si el archivo de conteo de logs no existe lo genero
touch($countFile);
//inicializing file in 0 //es: inicializo el archivo en 0
$initNumber=0;
$fp=fopen($countFile,"a");
if(fwrite($fp,$initNumber)===FALSE){
echo "Could not write Counter file"; //es: "No es posible escribir el archivo Contador";
}
fclose($fp);
}
//------------------------------------------------------------
//INCREMENT Counter //es: AUMENTO del Counter
//read counter //es: leo el contador
$logNumber=trim(file_get_contents($countFile));
$logNumber++; //increment counter //es: incremento el contador
//set log number in class var //es: seteo la variable de Clase con el nro de log
$this->logNumber=$logNumber;
//write incremented counter value //es: escribo el contador aumentado en 1
$fp=fopen($countFile,"w+");
if(fwrite($fp,$logNumber)===FALSE){
echo "Could not write Counter file"; //es: "No es posible escribir el archivo Contador";
}
fclose($fp);
//-----------------------------------------------------
}//end function
//-----------------------------------------------------------------
/**
* @return void
* @param String $logString
* @desc
Recieves the string you want lo log.
This function is used by "logThis" function,
which offers simplified logging with
some practical functions.
//spanish
Recibe la cadena a loggear en el archivo de logs.
Esta función es utilizada por "logThis",
función que ofrece un uso simplificado de logging
con varias funciones prácticas.
*/
function writeLogging($logString){
global $logNumber;
//depending on selected log mode... //es: según el modo de log definido...
//use only one log file, or one file per log instance //es: uso un único archivo o un archivo por log
if($this->logMode=='oneFilePerLogging'){
$logFile=$this->logDir . "/" . $this->logFile . $logNumber . '.log';
} else {
//"oneFile" mode
$logFile=$this->logDir . "/" . $this->logFile . '.log';
}
//in case file does not exist //es: considero que el archivo no exista
if(file_exists($logFile)===FALSE){
//if log file does not exist, I create it //es: si el archivo de log no existe lo genero
touch($logFile);
//generate file header //es: genero el encabezado del archivo
$logHeader =$this->headerTitle . "\n"; //. " " . $logNumber . "\n";
$logHeader.='--------------------------------------------------------------------' . "\n";
$fp=fopen($logFile,"w+");
if(fwrite($fp,$logHeader)===FALSE){
echo "Could not write LOG Header"; //es: "No es posible escribir el Header del archivo de LOG";
}
fclose($fp);
}//end if fileExists
//-----------------------------------
//write to log file //es: escribo el archivo de LOG
$fp=fopen($logFile,"a");
if(fwrite($fp,$logString)===FALSE){
echo "Could not write to LOG file"; //es: "No es posible escribir el archivo de LOG";
}
fclose($fp);
}//end function
//-----------------------------------------------------------------
/**
* @return void
* @param String $string
* @param String $modifier
* @desc
Writes to LOG File each recieved value.
To write the log we use the function "writeLogging".
Esta función va escribiendo en el archivo de LOG
a medida que recibe valores.
Para escribir el log se recurre a la función "writeLogging".
Output: $this->writeLogging()
Will directly write to log file
*/
function logThis($string,$modifier="empty"){
//provides a global counter //es: la función provee un contador global
global $logThisCounter;
//for logThisCounter to start in 1 //es: para que el logThisCounter comience en 1
if(!isset($logThisCounter)){
$logThisCounter=0;
}
//set "line" separator //es: seteo el separador "line"
$line="\n" . '--------------------------------------------------------------------' . "\n";
//it uses modifiers only if a log function has not
//been passed
//spanish
//uso los modificadores sólo si no se ha seteado el uso
//de una función de log en forma directa.
//se considera la posibilidad de pasar sólo una línea, por ej,
//como: logThis('f:line'), en tal caso no se usan modificadores
if(substr($string,0,2)!='f:'){
//manejo distintos tipos de modificadores
switch($modifier){
case 'empty':
$this->writeLogging($string . "\n");
break;
case 'n':
$this->writeLogging($string . "\n");
break;
case '2n':
$this->writeLogging($string . "\n\n");
break;
case '3n':
$this->writeLogging($string . "\n\n\n");
break;
case 'line':
$this->writeLogging($string . $line);
break;
case '2line':
$this->writeLogging($string . $line . $line);
break;
case 'nLine':
$this->writeLogging($string . "\n" . $line);
break;
case '2nLine':
$this->writeLogging($string . "\n\n" . $line);
break;
case 'n2Line':
$this->writeLogging($string . "\n" . $line . $line);
break;
}//end switch $modifier
} else {
//----------------
//FUNCTIONS - "F:"
//--------------------------------------------------
//using a log function passed in $string //es: aquí estoy utilizando una función de log pasada en $string
//example: logThis('f:line')
switch($string){
case 'f:line':
$this->writeLogging($line);
break;
case 'f:2line':
$this->writeLogging($line . $line);
break;
case 'f:nl':
$this->writeLogging("\n");
break;
case 'f:2nl':
$this->writeLogging("\n\n");
break;
case 'f:logNumber':
$this->writeLogging('+ LOG Number: ' . $this->logNumber . "\n");
break;
case 'f:counter':
switch($modifier){
case 'empty':
$logThisCounter++;
$this->writeLogging($logThisCounter);
break;
default:
$logThisCounter++;
$this->writeLogging($modifier . $logThisCounter);
break;
}//end switch f:counter
break;
case 'f:counter.nl':
switch($modifier){
case 'empty':
$logThisCounter++;
$this->writeLogging($logThisCounter . "\n");
break;
default:
$logThisCounter++;
$this->writeLogging($modifier . $logThisCounter . "\n");
break;
}//end switch f:counter
break;
case 'f:nl.counter':
switch($modifier){
case 'empty':
$logThisCounter++;
$this->writeLogging("\n" . $logThisCounter);
break;
default:
$logThisCounter++;
$this->writeLogging("\n" . $modifier . $logThisCounter);
break;
}//end switch f:counter
break;
case 'f:nl.counter.nl':
switch($modifier){
case 'empty':
$logThisCounter++;
$this->writeLogging("\n" . $logThisCounter . "\n");
break;
default:
$logThisCounter++;
$this->writeLogging("\n" . $modifier . $logThisCounter . "\n");
break;
}//end switch f:counter
break;
}//end switch $string
}//end if "f:"
}
//----------------------------------------------
/**
* @return String $fecha
* @desc
Return formatted actual date.
Example: 28.08.2005 - 01:14
//spanish
Devuelve la fecha actual formateada.
*/
function get_formatted_date(){
$fecha=date("d.m.Y - ") . (date("H")) . date(":i");
return $fecha;
}
//-----------------------------------------------------------------
/**
* Delete a file, or a folder and its contents
*
* @author Aidan Lister <aidan@php.net>
* @version 1.0.2
* @param string $dirname Directory to delete
* @return bool Returns TRUE on success, FALSE on failure
*/
function rmdirr($dirname)
{
// Sanity check
if (!file_exists($dirname)) {
//echo 'dir not exist: ' . $dirname . "<br>\n";
return false;
}
// Simple delete for a file
if (is_file($dirname)) {
return unlink($dirname); //delete files inside dir //acá elimina los archivos dentro del dir
//echo 'DELETED FILE: ' . $dirname . "<br>\n";
}
if(is_dir($dirname)){
// Loop through the folder
$dir = dir($dirname);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
// Recurse
$this->rmdirr("$dirname/$entry");
}
// Clean up
$dir->close();
return rmdir($dirname); //delete empty dir //acá elimina el directorio que ya quedó vacío
//echo 'DELETED DIR : ' . $dirname . "<br>\n";
}//fin if is dir
}
//-----------------------------------------------------------------
/**
* @return void
* @desc
Deletes log dir and its contents.
//spanish
Elimina el directorio de Loggings y su contenido
para comenzar un nuevo proceso de log desde cero.
*/
function clean(){
$this->rmdirr($this->logDir);
}
} //end class Logging
?>

View File

@ -1,17 +0,0 @@
<?php
$GLOBALS['lang']->set('Logfiles', 'log_title', 'de');
$GLOBALS['lang']->set('Logfiles', 'log_title', 'en');
$_CONF['app_name'] = 'Logfiles';
$_CONF['app_desc'] = 'Logfiles';
$_CONF['app_build'] = 1;
$_CONF['app_version'] = 'v0.9 Beta';
//$_CONF['base_url'] = 'demomodul/'; //Basisurl des moduls, wenn es über das Frontend aufgerufen wird
$_CONF['base_file'] = 'log.php'; //Datei, die angezeigt wird, wenn die basisurl aufgerufen wird
$_CONF['menu_top'] = '<i class="fa fa-server"></i> '.$GLOBALS['lang']->get('log_title'); //Name des Moduls, wie es im Adminbereich im Hauptmenü auftaucht
$_CONF['menu'] = ['menu_top' => 'index.php']; //Ein Array mit menüpunkten im Backoffice
//$_CONF['dashboard'] = 'dashboard.php'; //Optional, eine Datei, welche im admindashboard angezeigt wird
$_CONF['type'] = 'static';
$_CONF['install'] = 'install.php';
?>

View File

@ -1,176 +0,0 @@
<?php
require_once '../../inc/autoload.php';
printHeader('Logfiles');
?>
<div class="main">
<?php
if (hasPerm('view_logfiles'))
{
$monate = array('01' => "Januar",
'02' => "Februar",
'03' => "M&auml;rz",
'04' => "April",
'05' => "Mai",
'06' => "Juni",
'07' => "Juli",
'08' => "August",
'09' => "September",
'10' => "Oktober",
'11' => "November",
'12' => "Dezember");
if (isset($_GET['detail']))
{
$logfile = $_GET['detail'] . '.log';
$logN = explode('-', str_replace('.log', '', $logfile));
echo '<h1>'. $lang->get('log_detail_title'). ' ' . $logN[2] . '. ' . $monate[$logN[1]] . ' ' . $logN[0] . '</h1>';
//var_dump($_SERVER);
?>
<form action="?detail=<?php echo $_GET['detail']; ?>" method="post">
<input type="text" name="filter" value="" placeholder="<?php echo $lang->get('log_filter_logs');?>"/>
<input type="submit" value="<?php echo $lang->get('log_filter_logs');?>"/>
</form>
<?php
$i = 0;
if (file_exists('../../' . $MCONF['log_uri'] . '/' . $logfile))
{
$lines = file('../../' . $MCONF['log_uri'] . '/' . $logfile);
foreach ($lines as $line_num => $line)//logfile ausgeben
{
if ($line_num > 1)
{
if (isset($_POST['filter']))//filtern
{
if (strpos($line, $_POST['filter']) !== false)//mit post
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
//echo $line . '<br/>';
$i++;
}
} elseif (isset($_GET['filter']))//filtern
{
if (strpos($line, $_GET['filter']) !== false)//mit get
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
$i++;
}
} else//ungefiltert
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
$i++;
}
}
}
echo '<b>'.$i . ' ' . $lang->get('log_views_total').'</b>';
} else
{
echo '<p>'.$lang->get('log_file_not_found').'</p>';
}
} elseif (isset($_GET['detailmon']))
{
$logmon = $_GET['detailmon'];
$logmonN = explode('-', $logmon);
echo '<h1>'.$lang->get('log_detail_title_from').' ' . $monate[$logmonN[0]] . ' ' . $logmonN[1] . '</h1>';
?>
<form action="?detailmon=<?php echo $_GET['detailmon']; ?>" method="post">
<input type="text" name="filter" value="" placeholder="<?php echo $lang->get('log_filter_logs');?>"/>
<input type="submit" value="<?php echo $lang->get('log_filter_logs');?>" class="speichern"/>
</form>
<?php
$i = 0;
if ($handle = opendir('../../' . $MCONF['log_uri'] . ''))//logs anzeiugen
{
while ((false !== ($file = readdir($handle))))
{
if (strpos($file, $logmonN[1] . '-' . $logmonN[0]) !== false)//nur zum monat passende logs anzeigen
{
$lines = file('../../' . $MCONF['log_uri'] . '/' . $file);
foreach ($lines as $line_num => $line)//ausgeben
{
if ($line_num > 1)
{
if (isset($_POST['filter']))//filtern
{
if (strpos($line, $_POST['filter']) !== false)//mit post
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
$i++;
}
} elseif (isset($_GET['filter']))//filtern
{
if (strpos($line, $_GET['filter']) !== false)//mit get
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
$i++;
}
} else//ungefiltert
{
$line_s = explode(' ', $line);
echo '<b>'.$line_s[0].'</b> '.str_replace($line_s[0], '', $line). '<br/>';
$i++;
}
}
}
}
}
}
echo '<b>'.$i . ' ' . $lang->get('log_views_total').'</b>';
} else
{
echo '<h2>'.$lang->get('log_total_pageviews').' ' . file_get_contents('../../' . $MCONF['log_uri'] . '/count.counter') . '</h2>';
$monatelogs = [];
//monatslogliste erstellen
if ($handle = opendir('../../' . $MCONF['log_uri'] . ''))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != 'count.counter')
{
$strtiel = [];
$strtiel = explode('-', str_replace('.log', '', $file));
$logsatr = $strtiel[0] . '-' . $strtiel[1];
if (!in_array($logsatr, $monatelogs))
{
$monatelogs[] = $strtiel[0] . '-' . $strtiel[1];
}
//echo '<a href="?detail='.$file.'">'.$file.'</a><br/>';
}
}
closedir($handle);
}
//var_dump($monatelogs);
//monatsloglist ausgeben
asort($monatelogs);
foreach ($monatelogs as $log)
{
$logN = explode('-', $log);
echo '<h2>' . $monate[$logN[1]] . ' ' . $logN[0] . '</h2>';
if ($handle = opendir('../../' . $MCONF['log_uri'] . ''))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && strpos($file, $log) !== false)
{
echo '<a href="?detail=' . str_replace('.log', '', $file) . '">' . str_replace('.log', '', $file) . '</a><br/>';
}
}
closedir($handle);
}
echo '<a href="?detailmon=' . $logN[1] . '-' . $logN[0] . '">'.sprintf($lang->get('log_show_full_logs'), $monate[$logN[1]], $logN[0]) . '</a>';
}
}
} else
{
echo msg('info', $lang->get('missing_permission'));
}
?>
</div>
<?php
require_once '../../inc/footer.php';
?>

View File

@ -1,13 +0,0 @@
<?php
if(isset($_POST['log_folder']))
{
$CONFIG['General']['log_uri'] = $_POST['log_folder'];
}
else
{
?>
<h2>Logfiles</h2>
<span>Log-Folder</span>
<input type="text" name="log_folder"/>
<?php
}

View File

@ -1,25 +0,0 @@
<?php
/*
* Mowie Language Class
*
* -----------------
* LANGUAGE: German
* Logfiles apps
* -----------------
*/
$lang = [];
$lang['__Lang__'] = 'German (Deutsch)';
$lang['__LangCode__'] = 'de';
$lang['__Countrycode__'] = 'de_DE';
$lang['log_detail_title'] = 'Logfile vom';
$lang['log_detail_title_from'] = 'Logfiles von';
$lang['log_filter_logs'] = 'Logs Filtern';
$lang['log_views_total'] = 'Aufrufe insgesamt.';
$lang['log_file_not_found'] = 'Logfile nicht gefunden';
$lang['log_total_pageviews'] = 'Gesamte Seitenaufrufe';
$lang['log_show_full_logs'] = 'Gesamte Logdateien für %1$s %2$s anzeigen';
//Permissions
$lang['logfiles_perm_view_logfiles_name'] = 'Logfiles ansehen';
$lang['logfiles_perm_view_logfiles_description'] = '';

View File

@ -1,25 +0,0 @@
<?php
/*
* Mowie Language Class
*
* -----------------
* LANGUAGE: German
* Logfiles apps
* -----------------
*/
$lang = [];
$lang['__Lang__'] = 'English (English)';
$lang['__LangCode__'] = 'en';
$lang['__Countrycode__'] = 'en';
$lang['log_detail_title'] = 'Logfile of';
$lang['log_detail_title_from'] = 'Logfiles from';
$lang['log_filter_logs'] = 'Filter logs';
$lang['log_views_total'] = 'views in total.';
$lang['log_file_not_found'] = 'Logfile not found';
$lang['log_total_pageviews'] = 'Total pageviews';
$lang['log_show_full_logs'] = 'Show all logfiles from %1$s %2$s';
//Permissions
$lang['logfiles_perm_view_logfiles_name'] = 'View Logfiles';
$lang['logfiles_perm_view_logfiles_description'] = '';

View File

@ -1,16 +0,0 @@
<?php
require_once $appUri.'/Log.class.php';
$logFileName = date('Y-m-d');
$headerTitle = 'Logfiles from '.$_SERVER['SERVER_NAME'];
$logMode = 'oneFile';
$counterFile = 'count.counter';
$log = new Logging($MCONF['log_uri'],$logFileName,$headerTitle, $logMode, $counterFile);
$charset = '';
if(isset($_SERVER['HTTP_ACCEPT_CHARSET']))
{
$charset = $_SERVER['HTTP_ACCEPT_CHARSET'];
}
$logstring = $_SERVER['REMOTE_ADDR'].' - '.$_SERVER['SERVER_NAME'].' - ['.date('d.m.Y:H:i:s').'] '.$_SERVER['SERVER_PROTOCOL'].' '.http_response_code().' "'.$_SERVER['REQUEST_METHOD'].' '.$_SERVER['REQUEST_URI'].'" "'.$_SERVER['HTTP_USER_AGENT'].'" '.$charset.' '.$_SERVER['HTTP_ACCEPT_LANGUAGE'].' '.$_SERVER['HTTP_CONNECTION'];
$log->logThis($logstring);

2
apps/meta/install-dev.php Normal file → Executable file
View File

@ -6,7 +6,7 @@ if(isset($_POST['submit']))
`content` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;'))
{
echo msg('succes', 'Meta was installed successfully.');
echo msg('success', 'Meta was installed successfully.');
}
else
{

0
apps/meta/lang/lang.de.php Normal file → Executable file
View File

0
apps/meta/lang/lang.en.php Normal file → Executable file
View File

View File

@ -29,7 +29,9 @@ else
$db->get();
$active = '';
if(!$db->data[0]['active']) $active = ' selected';
if(isset($db->data[0])) {
if(!$db->data[0]['active']) $active = ' selected';
}
?>
<p>
<input type="checkbox" name="active" value="y" id="activeswitch" onchange="toggleTextField()"/>

2
apps/sidebar/install-dev.php Normal file → Executable file
View File

@ -8,7 +8,7 @@ if(isset($_POST['submit']))
INSERT INTO `' . $_POST['db_prefix'] . 'sidebar_sidebar` (`active`, `content`) VALUES
(0, \'\');'))
{
echo msg('succes', 'Sidebar was installed successfully.');
echo msg('success', 'Sidebar was installed successfully.');
}
else
{

0
apps/sidebar/lang/lang.de.php Normal file → Executable file
View File

0
apps/sidebar/lang/lang.en.php Normal file → Executable file
View File

13
composer.json Normal file
View File

@ -0,0 +1,13 @@
{
"require": {
"smarty/smarty": "~3.1.30",
"phpmailer/phpmailer": "~6.1.6",
"symfony/yaml": "~3.3.9",
"erusev/parsedown": "~1.6.3",
"hgg/dbcmd": "~0.0.1",
"pragmarx/google2fa": "~2.0.6",
"bacon/bacon-qr-code": "~1.0.1",
"alchemy/zippy": "~0.4.8"
}
}

952
composer.lock generated Normal file
View File

@ -0,0 +1,952 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "84bc9f991786c643846d05d0c065d5f4",
"packages": [
{
"name": "alchemy/zippy",
"version": "0.4.9",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/Zippy.git",
"reference": "59fbeefb9a249122867ef25e53addfcce31850d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/59fbeefb9a249122867ef25e53addfcce31850d7",
"reference": "59fbeefb9a249122867ef25e53addfcce31850d7",
"shasum": ""
},
"require": {
"doctrine/collections": "~1.0",
"php": ">=5.5",
"symfony/filesystem": "^2.0.5 || ^3.0 || ^4.0",
"symfony/polyfill-mbstring": "^1.3",
"symfony/process": "^2.1 || ^3.0 || ^4.0"
},
"require-dev": {
"ext-zip": "*",
"guzzle/guzzle": "~3.0",
"guzzlehttp/guzzle": "^6.0",
"phpunit/phpunit": "^4.0 || ^5.0",
"symfony/finder": "^2.0.5 || ^3.0 || ^4.0"
},
"suggest": {
"ext-zip": "To use the ZipExtensionAdapter",
"guzzle/guzzle": "To use the GuzzleTeleporter with Guzzle 3",
"guzzlehttp/guzzle": "To use the GuzzleTeleporter with Guzzle 6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.4.x-dev"
}
},
"autoload": {
"psr-4": {
"Alchemy\\Zippy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alchemy",
"email": "dev.team@alchemy.fr",
"homepage": "http://www.alchemy.fr/"
}
],
"description": "Zippy, the archive manager companion",
"keywords": [
"bzip",
"compression",
"tar",
"zip"
],
"time": "2018-02-22T13:58:36+00:00"
},
{
"name": "bacon/bacon-qr-code",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": "^5.4|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"suggest": {
"ext-gd": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-0": {
"BaconQrCode": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "http://www.dasprids.de",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"time": "2017-10-17T09:59:25+00:00"
},
{
"name": "doctrine/collections",
"version": "1.6.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "fc0206348e17e530d09463fef07ba8968406cd6d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/fc0206348e17e530d09463fef07ba8968406cd6d",
"reference": "fc0206348e17e530d09463fef07ba8968406cd6d",
"shasum": ""
},
"require": {
"php": "^7.1.3 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"phpstan/phpstan-shim": "^0.9.2",
"phpunit/phpunit": "^7.0",
"vimeo/psalm": "^3.8.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.",
"homepage": "https://www.doctrine-project.org/projects/collections.html",
"keywords": [
"array",
"collections",
"iterators",
"php"
],
"time": "2020-05-25T19:24:35+00:00"
},
{
"name": "erusev/parsedown",
"version": "1.6.4",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "fbe3fe878f4fe69048bb8a52783a09802004f548"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/fbe3fe878f4fe69048bb8a52783a09802004f548",
"reference": "fbe3fe878f4fe69048bb8a52783a09802004f548",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2017-11-14T20:44:03+00:00"
},
{
"name": "hgg/dbcmd",
"version": "v0.0.1",
"source": {
"type": "git",
"url": "https://github.com/hglattergotz/dbcmd.git",
"reference": "7aeca6bf33b3bb52f42f56281aaf251c0d7a8818"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hglattergotz/dbcmd/zipball/7aeca6bf33b3bb52f42f56281aaf251c0d7a8818",
"reference": "7aeca6bf33b3bb52f42f56281aaf251c0d7a8818",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/process": ">=2.1.0"
},
"type": "library",
"autoload": {
"psr-0": {
"HGG\\DbCmd\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Henning Glatter-Götz",
"email": "henning@glatter-gotz.com",
"homepage": "http://glatter-gotz.com"
}
],
"description": "Wrappter to build and execute management commands against a DB",
"homepage": "http://github.com/hglattergotz/dbcmd",
"keywords": [
"backup",
"dump",
"mysql"
],
"time": "2014-11-07T11:28:35+00:00"
},
{
"name": "paragonie/constant_time_encoding",
"version": "v2.3.0",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2",
"reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2",
"shasum": ""
},
"require": {
"php": "^7|^8"
},
"require-dev": {
"phpunit/phpunit": "^6|^7",
"vimeo/psalm": "^1|^2|^3"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"time": "2019-11-06T19:20:29+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.18",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
"reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"autoload": {
"files": [
"lib/random.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"time": "2019-01-03T20:59:08+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v6.1.6",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"php": ">=5.5.0"
},
"require-dev": {
"doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": "^4.8 || ^5.7"
},
"suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-only"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2020-05-27T12:24:03+00:00"
},
{
"name": "pragmarx/google2fa",
"version": "v2.0.7",
"source": {
"type": "git",
"url": "https://github.com/antonioribeiro/google2fa.git",
"reference": "5a818bda62fab0c0a79060b06d50d50b5525d631"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/5a818bda62fab0c0a79060b06d50d50b5525d631",
"reference": "5a818bda62fab0c0a79060b06d50d50b5525d631",
"shasum": ""
},
"require": {
"paragonie/constant_time_encoding": "~1.0|~2.0",
"paragonie/random_compat": "~1.4|~2.0",
"php": ">=5.4",
"symfony/polyfill-php56": "~1.2"
},
"require-dev": {
"bacon/bacon-qr-code": "~1.0",
"phpunit/phpunit": "~4|~5|~6"
},
"suggest": {
"bacon/bacon-qr-code": "Required to generate inline QR Codes."
},
"type": "library",
"extra": {
"component": "package",
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"PragmaRX\\Google2FA\\": "src/",
"PragmaRX\\Google2FA\\Tests\\": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Antonio Carlos Ribeiro",
"email": "acr@antoniocarlosribeiro.com",
"role": "Creator & Designer"
}
],
"description": "A One Time Password Authentication package, compatible with Google Authenticator.",
"keywords": [
"2fa",
"Authentication",
"Two Factor Authentication",
"google2fa",
"laravel"
],
"time": "2018-01-06T16:21:07+00:00"
},
{
"name": "smarty/smarty",
"version": "v3.1.36",
"source": {
"type": "git",
"url": "https://github.com/smarty-php/smarty.git",
"reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/fd148f7ade295014fff77f89ee3d5b20d9d55451",
"reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"phpunit/phpunit": "6.4.1",
"smarty/smarty-lexer": "^3.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
}
},
"autoload": {
"classmap": [
"libs/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Monte Ohrt",
"email": "monte@ohrt.com"
},
{
"name": "Uwe Tews",
"email": "uwe.tews@googlemail.com"
},
{
"name": "Rodney Rehm",
"email": "rodney.rehm@medialize.de"
}
],
"description": "Smarty - the compiling PHP template engine",
"homepage": "http://www.smarty.net",
"keywords": [
"templating"
],
"time": "2020-04-14T14:44:26+00:00"
},
{
"name": "symfony/filesystem",
"version": "v4.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/a3ebf3bfd8a98a147c010a568add5a8aa4edea0f",
"reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Filesystem\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2020-04-12T14:39:55+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
"reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2020-05-12T16:14:59+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fa79b11539418b02fc5e1897267673ba2c19419c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c",
"reference": "fa79b11539418b02fc5e1897267673ba2c19419c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2020-05-12T16:47:27+00:00"
},
{
"name": "symfony/polyfill-php56",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
"reference": "e3c8c138280cdfe4b81488441555583aa1984e23"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/e3c8c138280cdfe4b81488441555583aa1984e23",
"reference": "e3c8c138280cdfe4b81488441555583aa1984e23",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-util": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php56\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2020-05-12T16:47:27+00:00"
},
{
"name": "symfony/polyfill-util",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
"reference": "4afb4110fc037752cf0ce9869f9ab8162c4e20d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4afb4110fc037752cf0ce9869f9ab8162c4e20d7",
"reference": "4afb4110fc037752cf0ce9869f9ab8162c4e20d7",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Util\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony utilities for portability of PHP codes",
"homepage": "https://symfony.com",
"keywords": [
"compat",
"compatibility",
"polyfill",
"shim"
],
"time": "2020-05-12T16:14:59+00:00"
},
{
"name": "symfony/process",
"version": "v4.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
"reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2020-04-15T15:56:18+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.3.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "af615970e265543a26ee712c958404eb9b7ac93d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d",
"reference": "af615970e265543a26ee712c958404eb9b7ac93d",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"require-dev": {
"symfony/console": "~2.8|~3.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-01-20T15:04:53+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

View File

@ -0,0 +1,2 @@
<h1>Maintenance</h1>
<p><a href="http://mowie.cc">mowie.cc</a></p>

View File

@ -12,13 +12,14 @@
<div class="container">
{$menu}
<div class="seite">
{$navTree}
{$sidebar}
{$content}
{$test}
{$test2}
</div>
<div class="footer">
<p>&copy; 2015 | <a href="http://kola-entertainments.de" target="_blank">KoLa Entertainments</a> | <a href="{$website_uri}Impressum">Impressum</a></p>
<p>&copy; {$copyright} | <a href="http://kola-entertainments.de" target="_blank">KoLa Entertainments</a> | <a href="{$website_uri}Impressum">Impressum</a></p>
</div>
</div>
</body>

21
docker-compose.yml Executable file
View File

@ -0,0 +1,21 @@
version: '3'
services:
web:
build: ./docker-dev/
image: mowie/mowiedev:latest
volumes:
- ./:/var/www
ports:
- 8081:80
depends_on:
- db
db:
image: mariadb:latest
volumes:
- ./.db-data:/var/lib/mysql
ports:
- 127.0.0.1:3361:3306
environment:
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_DATABASE=mowie

36
docker-dev/Dockerfile Executable file
View File

@ -0,0 +1,36 @@
FROM alpine:3.5
MAINTAINER kolaente - mowie.cc
ENV TZ "Europe/Berlin"
RUN apk update && \
apk --no-cache add bash tzdata curl ca-certificates s6 ssmtp mysql-client \
nginx nginx-mod-http-headers-more
RUN ln -sf "/usr/share/zoneinfo/$TZ" /etc/localtime && \
echo "$TZ" > /etc/timezone && date
RUN apk --no-cache add \
php7 php7-phar php7-curl php7-fpm php7-json php7-zlib php7-gd \
php7-xml php7-dom php7-ctype php7-opcache php7-zip php7-iconv \
php7-pdo php7-pdo_mysql php7-mysqli php7-mbstring php7-session \
php7-mcrypt php7-openssl php7-sockets php7-posix
RUN rm -rf /var/cache/apk/* && \
ln -s /usr/bin/php7 /usr/bin/php && \
rm -f /etc/php7/php-fpm.d/www.conf && \
touch /etc/php7/php-fpm.d/env.conf
RUN rm -rf /var/www
COPY conf/services.d /etc/services.d
COPY conf/nginx/nginx.conf /etc/nginx/nginx.conf
COPY conf/php/php-fpm.conf /etc/php7/
COPY conf/php/conf.d/php.ini /etc/php7/conf.d/zphp.ini
VOLUME /var/www
EXPOSE 80
ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"]
CMD []

View File

@ -0,0 +1,88 @@
load_module modules/ngx_http_headers_more_filter_module.so;
user nginx;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time $pipe $upstream_cache_status';
#access_log off;
#error_log /dev/stderr;
access_log /dev/stdout main_timed;
error_log /dev/stderr;
server {
listen [::]:80 default_server;
listen 80 default_server;
server_name _;
index index.php;
root /var/www;
client_max_body_size 1G;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* ^.+\.(log|sqlite|yml|yaml|ini)$ {
return 404;
}
location ~ /\.ht {
return 404;
}
location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
log_not_found off;
expires 7d;
etag on;
}
gzip on;
gzip_comp_level 3;
gzip_disable "msie6";
gzip_vary on;
gzip_types
text/plain
text/css
text/javascript
text/xml
application/javascript
application/json
application/xml
application/rss+xml;
}
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
more_clear_headers 'X-Powered-By';
more_clear_headers 'Server';
}

View File

@ -0,0 +1,9 @@
server_tokens off;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
more_clear_headers 'X-Powered-By';
more_clear_headers 'Server';

View File

@ -0,0 +1,10 @@
expose_php = Off
error_reporting = E_ALL
display_errors = On
log_errors = On
error_log = /dev/stderr
cgi.fix_pathinfo=0
date.timezone = Europe/Berlin
allow_url_fopen = On
post_max_size = 2500M
upload_max_filesize = 2G

View File

@ -0,0 +1,20 @@
[global]
error_log = /proc/self/fd/2
log_level = error
daemonize = no
[www]
catch_workers_output = yes
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
listen = /var/run/php-fpm.sock
pm = dynamic
pm.max_children = 20
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 2048
include = /etc/php7/php-fpm.d/env.conf

View File

@ -0,0 +1,2 @@
#!/bin/sh
/bin/true

View File

@ -0,0 +1,2 @@
#!/bin/sh
/bin/true

View File

@ -0,0 +1,2 @@
#!/bin/execlineb -P
nginx -g "daemon off;"

View File

@ -0,0 +1,2 @@
#!/bin/execlineb -P
php-fpm7 -F

View File

@ -1,8 +0,0 @@
<h1>Baustelle</h1>
<p>&nbsp;</p>
<p>oder so</p>
<p>&nbsp;</p>
<p>(oder?)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="/SelfCMS/Mowie-Github/admin/mowie.cc">mowie.cc</a></p>

View File

92
inc/apps.php Normal file → Executable file
View File

@ -8,21 +8,27 @@
class apps
{
private $apps;
public $unresolvedDependencies;
public function __construct()
{
global $lang;
//Find the app directory
$i = 1;
$appdir = 'apps/';
while(!file_exists($appdir) && $i<21)
//When the appdir wasn't found after 30 iterations, throw an error to prevent endless searching
while(!file_exists($appdir) && $i<31)
{
$appdir = '../' . $appdir;
$i++;
}
//When the appdir wasn't found after 20 iterations, throw an error to prevent endless searching
if(!file_exists($appdir)) echo 'Could not find App dir.';
if(!file_exists($appdir))
{
echo 'Could not find app dir. (Too many iterations)';
exit;
}
//Loop through the apps
if ($handle = opendir($appdir))
@ -34,8 +40,15 @@ class apps
$appUri = $appdir . $app;
if (file_exists($appUri . '/config.php'))
{
//Get Langstrings to display menu correctly
if (file_exists($appUri . '/lang/') && is_dir($appUri . '/lang/'))
{
$lang->setLangFolder($appUri . '/lang/');
}
require $appUri . '/config.php';
$this->apps[$app] = $_CONF;
$this->apps[$_CONF['app_name']] = $_CONF;
$this->apps[$_CONF['app_name']]['app_path'] = $app;
//print_r($_CONF);
$_CONF = [];
}
@ -54,13 +67,80 @@ class apps
//has app?
public function appExists($name)
{
foreach ($this->apps as $appDir => $app)
foreach ($this->apps as $app_name => $app)
{
if($app['app_name'] == $name)
if($app_name == $name)
{
return true;
}
}
return false;
}
//Returns informations about an app
public function getApp($app)
{
if($this->appExists($app))
{
return $this->apps[$app];
}
return false;
}
//Get app by path
public function getAppByPath($path)
{
foreach ($this->apps as $app_name => $app)
{
if($app['app_path'] == $path)
{
return $this->getApp($app_name);
}
}
return false;
}
//Check for app dependencies
public function checkDependencies($app)
{
$appconf = $this->getApp($app);
$dep = true;
if(isset($appconf['dependencies']))
{
//Min System Build
if(isset($appconf['dependencies']['mowie-version']))
{
if(!version_compare($GLOBALS['MCONF']['version'], $appconf['dependencies']['mowie-version'], '>='))
{
$this->unresolvedDependencies['mowie-version'] = $appconf['dependencies']['mowie-version'];
$dep = false;
}
}
//Required Apps
if(isset($appconf['dependencies']['apps']))
{
foreach ($appconf['dependencies']['apps'] as $dep_app)
{
if (!$this->appExists($dep_app))
{
$this->unresolvedDependencies['apps'][] = $dep_app;
$dep = false;
}
}
}
//Required PHP-Version
if(isset($appconf['dependencies']['php']))
{
if(!version_compare(PHP_VERSION, $appconf['dependencies']['php'], '>='))
{
$this->unresolvedDependencies['php'] = $appconf['dependencies']['php'];
$dep = false;
}
}
}
return $dep;
}
}

View File

@ -17,6 +17,10 @@ while($i<$count)
$i++;
}
// Require Composer Libs
require_once $path.'../../vendor/autoload.php';
// Require Config
require_once $path.'../../inc/config.php';
//Language

View File

@ -1,6 +1,11 @@
<?php
session_name('adminsession');
session_start();
// Require Composer Libs
require_once '../vendor/autoload.php';
// Require Config
require_once '../inc/config.php';
//Language

View File

@ -1,14 +1,26 @@
<?php
header('Charset: utf-8');
header('Generator: Mowie_CMS');
date_default_timezone_set('Europe/Berlin');
//Parse Config
$config = [];
require_once 'libs/YAML/autoload.php';
//Get Folderdepth
$cfg_path = 'config/config.yml';
$i = 0; // To prevent endless searching
while(!file_exists($cfg_path) && $i < 31)
{
$cfg_path = '../'.$cfg_path;
$i++;
}
if(!file_exists($cfg_path))
{
echo 'Could not find config file. (Too many iterations)';
exit;
}
use Symfony\Component\Yaml\Yaml;
$config = Yaml::parse(file_get_contents('config.yml', FILE_USE_INCLUDE_PATH));
$config = Yaml::parse(file_get_contents($cfg_path));
if(file_exists(empty($config)))
{
echo 'Error finding config file.';
@ -22,16 +34,12 @@ $MCONF['db_usr'] = $config['Database']['db_usr'];
$MCONF['db_pw'] = $config['Database']['db_pw'];
$MCONF['db_prefix'] = $config['Database']['db_prefix'];
require_once 'libs/db-mysql.php';
$db = new db($MCONF['db_host'], $MCONF['db_name'], $MCONF['db_usr'], $MCONF['db_pw'], $MCONF['db_prefix']);
//General
$MCONF['web_uri'] = $config['General']['web_uri'];
$MCONF['home_uri'] = $config['General']['home_uri'];
$MCONF['phpmyadmin'] = $config['General']['phpmyadmin'];
$MCONF['title'] = file_get_contents($MCONF['web_uri'].$config['General']['title']);
$MCONF['log_uri'] = $config['General']['log_uri'];
$MCONF['title'] = file_get_contents(str_replace('config/config.yml', '', $cfg_path).'content/.system/page_title.txt');
$MCONF['tinymce_css'] = $MCONF['web_uri'].$config['General']['tinymce_css'];
$MCONF['timezone'] = $config['General']['timezone'];
//Templateing
$MCONF['template'] = $config['Templating']['template'];
@ -41,8 +49,8 @@ $MCONF['tpl_webUri'] = $config['Templating']['tpl_webUri'];
//Versioning
$MCONF['version'] = $config['Versioning']['version'];
$MCONF['version_num'] = $config['Versioning']['version_num'];
$MCONF['update_uri'] = $config['Versioning']['update_uri'];
$MCONF['update_enabled'] = $config['Versioning']['update_enabled'];
$MCONF['update_servers'] = $config['Versioning']['update_servers'];
//Mailer
$MCONF['smtp'] = $config['Mail']['smtp'];
@ -55,6 +63,13 @@ if($MCONF['smtp'] === true)
$MCONF['smtp_port'] = $config['Mail']['port'];
}
require_once 'libs/lang.class.php';
//Set Timezone
date_default_timezone_set($MCONF['timezone']);
$lang = new lang();
//DB init
require_once 'libs/db-mysql.php';
$db = new db($MCONF['db_host'], $MCONF['db_name'], $MCONF['db_usr'], $MCONF['db_pw'], $MCONF['db_prefix']);
//Lang init
require_once 'libs/lang.class.php';
$lang = new lang();

View File

@ -4,192 +4,262 @@ if (!isset($_GET['direct']))
?>
</div>
<div id="showMsg"></div>
<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</div>
<div id="showMsg"></div>
<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/moment.js"></script>
<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/moment.js"></script>
<!--<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/page.js"></script>
<!--<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/page.js"></script>
<script src="<?php echo $MCONF['web_uri'] ?>admin/assets/js/page.bodyparser.js"></script>-->
<script>
moment.locale('de');
<script>
moment.locale('de');
//Msg
function showMsg(msg) {
$('#showMsg').html('<div class="snackbar"><a onclick="closeMsg();" class="closeMsg"><i class="fa fa-close"></i> </a><p>' + msg + '</p></div>');
}
//Msg
function showMsg(msg) {
$('#showMsg').html('<div class="snackbar"><a onclick="closeMsg();" class="closeMsg"><i class="fa fa-close"></i> </a><p>' + msg + '</p></div>');
}
function closeMsg() {
$('#showMsg').html('');
}
function closeMsg() {
$('#showMsg').html('');
}
//Show Loader
function showTopLoader() {
$('.loader-overlay').fadeIn(150);
$('.toploading').animate({height: "8px"}, 150);
}
//Show Loader
function showTopLoader() {
$('.loader-overlay').fadeIn(150);
$('.toploading').animate({height: "8px"}, 150);
}
function hideTopLoader() {
$('.loader-overlay').fadeOut(150);
$('.toploading').animate({height: "0"}, 150);
}
function hideTopLoader() {
$('.loader-overlay').fadeOut(150);
$('.toploading').animate({height: "0"}, 150);
}
//Change current Language
$('#langselectbtn').click(function () {
$('.langs').fadeToggle(100);
});
//Change current Language
$('#langselectbtn').click(function () {
$('.langs').fadeToggle(100);
});
function changeLang(lang) {
showTopLoader();
$.get('<?php echo $MCONF['home_uri'];?>admin/lang.php?set=' + lang, function (data) {
console.log(data);
if(data == 1){
location.reload();
} else {
showMsg('Error.');
}
})
}
function changeLang(lang) {
showTopLoader();
$.get('<?php echo $MCONF['home_uri'];?>admin/lang.php?set=' + lang, function (data) {
console.log(data);
if (data == 1) {
location.reload();
} else {
showMsg('Error.');
}
})
}
//showStream
function showStream()
{
$('#streamContent').fadeToggle(100,function() {
if($('#streamContent').is(":visible")) {
$.getJSON('<?php echo $MCONF['home_uri'];?>admin/stream.php?getStream&limit=10', function (streamData) {
$('#streamContent').html('');
$.each(streamData, function (key, val) {
$('#streamContent').append('<p>' + val.message + ' (' + moment(val.time * 1000).fromNow() + ')</p>');
});
$('#streamContent').append('<a href="<?php echo $MCONF['home_uri'];?>admin/stream.php" class="button">Mehr</a>');
});
}
});
}
//showStream
function showStream() {
$('#streamContent').fadeToggle(100, function () {
if ($('#streamContent').is(":visible")) {
$.getJSON('<?php echo $MCONF['home_uri'];?>admin/stream.php?getStream&limit=10', function (streamData) {
$('#streamContent').html('');
$.each(streamData, function (key, val) {
$('#streamContent').append('<p>' + val.message + ' (' + moment(val.time * 1000).fromNow() + ')</p>');
});
$('#streamContent').append('<a href="<?php echo $MCONF['home_uri'];?>admin/stream.php" class="button">Mehr</a>');
});
}
});
}
$(document).ready(function () {
function closeW() {
$('.overlay').fadeOut(200);
$('.overlay').html('');
}
//Router
$('#topnav').addClass('no-transition');
function sendPost(ctx, requestData) {
$.ajax({
url: ctx.canonicalPath,
type: 'POST',
cache: false,
data: requestData,
beforeSend: function () {
showTopLoader();
},
complete: function () {
hideTopLoader();
},
success: function (result) {
$("#loader").html(result);
},
error: function (xhr, status, error) {
console.log(status, error);
}
});
}
page('*', findPage);
page();
$(document).ready(function () {
pageBodyParser();
//Router
$('#topnav').addClass('no-transition');
function findPage(ctx, next) {
if(!ctx.init) {
if (ctx.body) { //If POST-Request, send Post via ajax
page('*', findPage);
page();
var isAjax = false;
var requestData = 'direct=true';
var editorname = '';
//console.log(typeof(tinyMCE));
if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor != null) {editorname = $('#' + tinyMCE.activeEditor.id).attr("name");}//Get the new Content, not the old
pageBodyParser();
for (var key in ctx.body) {
if (!ctx.body.hasOwnProperty(key)) continue;
function findPage(ctx, next) {
if (!ctx.init) {
if (ctx.body) { //If POST-Request, send Post via ajax
//If we have content edited with tinymce, we want the new content to be passed with the POST-Request
if(key == editorname) {
console.log(tinyMCE);
requestData += '&' + key + '=' + encodeURIComponent(tinyMCE.activeEditor.getContent());
} else {
requestData += '&' + key + '=' + encodeURIComponent(ctx.body[key]);
}
if(key == 'ajax') isAjax = true;
}
var isAjax = false;
var requestData = 'direct=true';
var editorname = '';
var needsPwConfirm = false;
//console.log(typeof(tinyMCE));
if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor != null) {
editorname = $('#' + tinyMCE.activeEditor.id).attr("name");
}//Get the new Content, not the old
console.log(requestData);
for (var key in ctx.body) {
if (!ctx.body.hasOwnProperty(key)) continue;
if(!isAjax) {
$.ajax({
url: ctx.canonicalPath,
type: 'POST',
cache: false,
data: requestData,
beforeSend: function () {
showTopLoader();
},
complete: function () {
hideTopLoader();
},
success: function (result) {
$("#loader").html(result);
},
error: function (xhr, status, error) {
console.log(status, error);
}
});
}
} else {//Otherwise display Contents
//Check users password
if (key == 'askPW') {
needsPwConfirm = true;
}
showTopLoader();
//Load Title
var title = '';
var query = '';
if (ctx.querystring != '') {
query += '&' + ctx.querystring;
}
$.get(ctx.pathname + '?title' + query, function (data) {
title = data;
}).fail(function (e) {
if (e.status == 404) {
showMsg('<?php echo $lang->get('404_not_found');?> (' + e.statusText + ')');
} else {
showMsg('Error.');
}
});
//If we have content edited with tinymce, we want the new content to be passed with the POST-Request
if (key == editorname) {
console.log(tinyMCE);
requestData += '&' + key + '=' + encodeURIComponent(tinyMCE.activeEditor.getContent());
} else {
requestData += '&' + key + '=' + encodeURIComponent(ctx.body[key]);
}
if (key == 'ajax') isAjax = true;
}
//Load Content
$.get(ctx.pathname + '?direct' + query, function (data) {
hideTopLoader();
if (data == 'Login First.') {
location.reload();
} else {
$("#loader").html(data);
//Confirm user password
if (needsPwConfirm) {
// check if the user already entered his password
$.get('login.php?checkSudo', function( data ) {
if (data == 'false'){
$('#showMsg').html('<div class="overlay" style="display:none;"><div class="window-confirm"><div class="head"><?php echo $lang->get('legitimate_title')?><a onclick="closeW();" class="closeMsg"><i class="fa fa-close"></i></a></div><div id="content"></div></div></div>');
$('#content').append('<p><?php echo $lang->get('legitimate_text')?></p><p><input type="password" placeholder="<?php echo $lang->get('password')?>" id="password_legitimate" autofocus/><input type="submit" value="<?php echo $lang->get('legitimate_confirm')?>" id="legitimateSmbt"/><a onclick="closeW();" class="button btn_del"><?php echo $lang->get('legitimate_abort')?></a></p><span id="sendMsg"></span>');
$('#password_legitimate').focus();
$(".overlay").fadeIn(250);
//Set Title
$("#title").html(title);
document.title = title + ' | <?php echo $lang->get('admin_title') . ' | ' . $MCONF['title']?>';
$('#legitimateSmbt').click(function () {
$.ajax({
url: 'login.php?checkPassword',
type: 'POST',
cache: false,
data: 'pw=' + $('#password_legitimate').val(),
success: function (result) { // On success, display a message...
if (result == 'success') {
closeW();
//Update Menu
$('li').each(function (index) {
$(this).removeClass('active');
});
//Send the request
if (!isAjax) {
sendPost(ctx, requestData);
}
} else if (result == 'fail') {
$('#sendMsg').html('<p style="color:red;"><?php echo $lang->get('legitimate_fail')?></p>');
} else {
$('#sendMsg').html('<p style="color:red;"><?php echo $lang->get('legitimate_error')?></p>');
}
},
error: function (xhr, status, error) {
console.log(status, error);
showMsg('<?php echo $lang->get('legitimate_error')?>');
}
});
});
} else {
//Send the request
if (!isAjax) {
sendPost(ctx, requestData);
}
}
});
} else {
if (!isAjax) {
sendPost(ctx, requestData);
}
}
} else {//Otherwise display Contents
//Find Class & Parent for menu
var menuitem = 'mw-menu-' + ctx.path.replace(/\//g, '-').replace('.php', '').replace('?', '').replace('&', '').replace('=', '');
//console.log(menuitem);
$('#' + menuitem).addClass('active');
showTopLoader();
//Load Title
var title = '';
var query = '';
if (ctx.querystring != '') {
query += '&' + ctx.querystring;
}
$.get(ctx.pathname + '?title' + query, function (data) {
title = data;
}).fail(function (e) {
if (e.status == 404) {
showMsg('<?php echo $lang->get('404_not_found');?> (' + e.statusText + ')');
} else {
showMsg('Error.');
}
});
//Find Top item
var topitems = menuitem.split('-');
//console.log(topitems);
$('#' + 'mw-menu-' + topitems[2] + '-' + topitems[3] + '-top').addClass('active');
if (topitems[3] == 'roles' || topitems[3] == 'users' || topitems[3] == 'permissions' || topitems[3] == 'new_user') {
$('#' + 'mw-menu-admin-users-top').addClass('active');
}
}
}).fail(function (e) {
if (e.status == 404) {
showMsg('<?php echo $lang->get('404_not_found');?> (' + e.statusText + ')');
} else {
showMsg('Error.');
}
});
}
}
}
});
</script>
</body>
</html>
//Load Content
$.get(ctx.pathname + '?direct' + query, function (data) {
hideTopLoader();
if (data == 'Login First.') {
location.reload();
} else {
$("#loader").html(data);
//Set Title
$("#title").html(title);
document.title = title + ' | <?php echo $lang->get('admin_title') . ' | ' . $MCONF['title']?>';
//Update Menu
$('li').each(function (index) {
$(this).removeClass('active');
});
//Find Class & Parent for menu
var menuitem = 'mw-menu-' + ctx.path.replace(/\//g, '-').replace('.php', '').replace('?', '').replace('&', '').replace('=', '');
//console.log(menuitem);
$('#' + menuitem).addClass('active');
//Find Top item
var topitems = menuitem.split('-');
//console.log(topitems);
$('#' + 'mw-menu-' + topitems[2] + '-' + topitems[3] + '-top').addClass('active');
if (topitems[3] == 'roles' || topitems[3] == 'users' || topitems[3] == 'permissions' || topitems[3] == 'new_user') {
$('#' + 'mw-menu-admin-users-top').addClass('active');
}
//Get CSS
$('#addedCss').remove(); // Remove old CSS
$.get(ctx.pathname + '?css' + query, function (data) {
if (data.css) {
for (var i = 0; i < data.css_files.length; i++) {
var cssFile = data.css_files[i];
$('head').append('<link rel="stylesheet" href="' + data.fullUri + cssFile + '" type="text/css" id="addedCss">');
}
}
});
}
}).fail(function (e) {
if (e.status == 404) {
showMsg('<?php echo $lang->get('404_not_found');?> (' + e.statusText + ')');
} else {
showMsg('Error.');
}
});
}
}
}
});
</script>
</body>
</html>
<?php
}

View File

@ -1,208 +0,0 @@
<?php
/**
* PHP Class for handling Google Authenticator 2-factor authentication
*
* @author Michael Kliewe
* @copyright 2012 Michael Kliewe
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @link http://www.phpgangsta.de/
*/
class php2FA
{
protected $_codeLength = 6;
/**
* Create new secret.
* 16 characters, randomly chosen from the allowed base32 characters.
*
* @param int $secretLength
* @return string
*/
public function createSecret($secretLength = 16)
{
$validChars = $this->_getBase32LookupTable();
unset($validChars[32]);
$secret = '';
for ($i = 0; $i < $secretLength; $i++) {
$secret .= $validChars[array_rand($validChars)];
}
return $secret;
}
/**
* Calculate the code, with given secret and point in time
*
* @param string $secret
* @param int|null $timeSlice
* @return string
*/
public function getCode($secret, $timeSlice = null)
{
if ($timeSlice === null) {
$timeSlice = floor(time() / 30);
}
$secretkey = $this->_base32Decode($secret);
// Pack time into binary string
$time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice);
// Hash it with users secret key
$hm = hash_hmac('SHA1', $time, $secretkey, true);
// Use last nipple of result as index/offset
$offset = ord(substr($hm, -1)) & 0x0F;
// grab 4 bytes of the result
$hashpart = substr($hm, $offset, 4);
// Unpak binary value
$value = unpack('N', $hashpart);
$value = $value[1];
// Only 32 bits
$value = $value & 0x7FFFFFFF;
$modulo = pow(10, $this->_codeLength);
return str_pad($value % $modulo, $this->_codeLength, '0', STR_PAD_LEFT);
}
/**
* Get QR-Code URL for image, from google charts
*
* @param string $name
* @param string $secret
* @param string $title
* @return string
*/
public function getSecretUrl($name, $secret, $title = null) {
$urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.'');
if(isset($title)) {
$urlencoded .= urlencode('&issuer='.urlencode($title));
}
return $urlencoded;
}
/**
* Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now
*
* @param string $secret
* @param string $code
* @param int $discrepancy This is the allowed time drift in 30 second units (8 means 4 minutes before or after)
* @param int|null $currentTimeSlice time slice if we want use other that time()
* @return bool
*/
public function verifyCode($secret, $code, $discrepancy = 1, $currentTimeSlice = null)
{
if ($currentTimeSlice === null) {
$currentTimeSlice = floor(time() / 30);
}
for ($i = -$discrepancy; $i <= $discrepancy; $i++) {
$calculatedCode = $this->getCode($secret, $currentTimeSlice + $i);
if ($calculatedCode == $code ) {
return true;
}
}
return false;
}
/**
* Set the code length, should be >=6
*
* @param int $length
* @return PHPGangsta_GoogleAuthenticator
*/
public function setCodeLength($length)
{
$this->_codeLength = $length;
return $this;
}
/**
* Helper class to decode base32
*
* @param $secret
* @return bool|string
*/
protected function _base32Decode($secret)
{
if (empty($secret)) return '';
$base32chars = $this->_getBase32LookupTable();
$base32charsFlipped = array_flip($base32chars);
$paddingCharCount = substr_count($secret, $base32chars[32]);
$allowedValues = array(6, 4, 3, 1, 0);
if (!in_array($paddingCharCount, $allowedValues)) return false;
for ($i = 0; $i < 4; $i++){
if ($paddingCharCount == $allowedValues[$i] &&
substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) return false;
}
$secret = str_replace('=','', $secret);
$secret = str_split($secret);
$binaryString = "";
for ($i = 0; $i < count($secret); $i = $i+8) {
$x = "";
if (!in_array($secret[$i], $base32chars)) return false;
for ($j = 0; $j < 8; $j++) {
$x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
}
$eightBits = str_split($x, 8);
for ($z = 0; $z < count($eightBits); $z++) {
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
}
}
return $binaryString;
}
/**
* Helper class to encode base32
*
* @param string $secret
* @param bool $padding
* @return string
*/
protected function _base32Encode($secret, $padding = true)
{
if (empty($secret)) return '';
$base32chars = $this->_getBase32LookupTable();
$secret = str_split($secret);
$binaryString = "";
for ($i = 0; $i < count($secret); $i++) {
$binaryString .= str_pad(base_convert(ord($secret[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
}
$fiveBitBinaryArray = str_split($binaryString, 5);
$base32 = "";
$i = 0;
while ($i < count($fiveBitBinaryArray)) {
$base32 .= $base32chars[base_convert(str_pad($fiveBitBinaryArray[$i], 5, '0'), 2, 10)];
$i++;
}
if ($padding && ($x = strlen($binaryString) % 40) != 0) {
if ($x == 8) $base32 .= str_repeat($base32chars[32], 6);
elseif ($x == 16) $base32 .= str_repeat($base32chars[32], 4);
elseif ($x == 24) $base32 .= str_repeat($base32chars[32], 3);
elseif ($x == 32) $base32 .= $base32chars[32];
}
return $base32;
}
/**
* Get array with all 32 characters for decoding from/encoding to base32
*
* @return array
*/
protected function _getBase32LookupTable()
{
return array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
'=' // padding char
);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,124 +0,0 @@
<?php
/**
* Smarty Autoloader
*
* @package Smarty
*/
/**
* Smarty Autoloader
*
* @package Smarty
* @author Uwe Tews
* Usage:
* require_once '...path/Autoloader.php';
* Smarty_Autoloader::register();
* $smarty = new Smarty();
* Note: This autoloader is not needed if you use Composer.
* Composer will automatically add the classes of the Smarty package to it common autoloader.
*/
class Smarty_Autoloader
{
/**
* Filepath to Smarty root
*
* @var string
*/
public static $SMARTY_DIR = '';
/**
* Filepath to Smarty internal plugins
*
* @var string
*/
public static $SMARTY_SYSPLUGINS_DIR = '';
/**
* Array with Smarty core classes and their filename
*
* @var array
*/
public static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);
/**
* Registers Smarty_Autoloader backward compatible to older installations.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function registerBC($prepend = false)
{
/**
* register the class autoloader
*/
if (!defined('SMARTY_SPL_AUTOLOAD')) {
define('SMARTY_SPL_AUTOLOAD', 0);
}
if (SMARTY_SPL_AUTOLOAD &&
set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
) {
$registeredAutoLoadFunctions = spl_autoload_functions();
if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
spl_autoload_register();
}
} else {
self::register($prepend);
}
}
/**
* Registers Smarty_Autoloader as an SPL autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function register($prepend = false)
{
self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;
self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :
self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;
if (version_compare(phpversion(), '5.3.0', '>=')) {
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
} else {
spl_autoload_register(array(__CLASS__, 'autoload'));
}
}
/**
* Handles auto loading of classes.
*
* @param string $class A class name.
*/
public static function autoload($class)
{
$_class = strtolower($class);
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
if (strpos($_class, 'smarty_internal_') === 0) {
if (strpos($_class, 'smarty_internal_compile_') === 0) {
if (is_file($file)) {
require $file;
}
return;
}
@include $file;
return;
}
if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/',
$_class, $match)) {
if (!empty($match[3])) {
@include $file;
return;
} elseif (!empty($match[9]) && isset(self::$rootClasses[$_class])) {
$file = self::$rootClasses[$_class];
require $file;
return;
}
}
if (0 !== strpos($_class, 'smarty')) {
return;
}
if (is_file($file)) {
require $file;
return;
}
return;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,160 +0,0 @@
{capture name='_smarty_debug' assign=debug_output}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Smarty Debug Console</title>
<style type="text/css">
{literal}
body, h1, h2, h3, td, th, p {
font-family: sans-serif;
font-weight: normal;
font-size: 0.9em;
margin: 1px;
padding: 0;
}
h1 {
margin: 0;
text-align: left;
padding: 2px;
background-color: #f0c040;
color: black;
font-weight: bold;
font-size: 1.2em;
}
h2 {
background-color: #9B410E;
color: white;
text-align: left;
font-weight: bold;
padding: 2px;
border-top: 1px solid black;
}
h3 {
text-align: left;
font-weight: bold;
color: black;
font-size: 0.7em;
padding: 2px;
}
body {
background: black;
}
p, table, div {
background: #f0ead8;
}
p {
margin: 0;
font-style: italic;
text-align: center;
}
table {
width: 100%;
}
th, td {
font-family: monospace;
vertical-align: top;
text-align: left;
}
td {
color: green;
}
.odd {
background-color: #eeeeee;
}
.even {
background-color: #fafafa;
}
.exectime {
font-size: 0.8em;
font-style: italic;
}
#bold div {
color: black;
font-weight: bold;
}
#blue h3 {
color: blue;
}
#normal div {
color: black;
font-weight: normal;
}
#table_assigned_vars th {
color: blue;
font-weight: bold;
}
#table_config_vars th {
color: maroon;
}
{/literal}
</style>
</head>
<body>
<h1>Smarty {Smarty::SMARTY_VERSION} Debug Console
- {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
{if !empty($template_data)}
<h2>included templates &amp; config files (load time in seconds)</h2>
<div>
{foreach $template_data as $template}
<font color=brown>{$template.name}</font>
<br>&nbsp;&nbsp;<span class="exectime">
(compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
</span>
<br>
{/foreach}
</div>
{/if}
<h2>assigned template variables</h2>
<table id="table_assigned_vars">
{foreach $assigned_vars as $vars}
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<td><h3><font color=blue>${$vars@key}</font></h3>
{if isset($vars['nocache'])}<b>Nocache</b></br>{/if}
{if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
</td>
<td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td>
<td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>
{/foreach}
</table>
<h2>assigned config file variables</h2>
<table id="table_config_vars">
{foreach $config_vars as $vars}
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<td><h3><font color=blue>#{$vars@key}#</font></h3>
{if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
</td>
<td>{$vars['value']|debug_print_var:10:80 nofilter}</td>
</tr>
{/foreach}
</table>
</body>
</html>
{/capture}
<script type="text/javascript">
{$id = '__Smarty__'}
{if $display_mode}{$id = "$offset$template_name"|md5}{/if}
_smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
_smarty_console.document.close();
</script>

View File

@ -1,223 +0,0 @@
<?php
/**
* Smarty Internal Plugin
*
* @package Smarty
* @subpackage Cacher
*/
/**
* Cache Handler API
*
* @package Smarty
* @subpackage Cacher
* @author Rodney Rehm
*/
abstract class Smarty_CacheResource
{
/**
* resource types provided by the core
*
* @var array
*/
protected static $sysplugins = array('file' => 'smarty_internal_cacheresource_file.php',);
/**
* populate Cached Object with meta data from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @param Smarty_Internal_Template $_template template object
*
* @return void
*/
abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template);
/**
* populate Cached Object with timestamp and exists from Resource
*
* @param Smarty_Template_Cached $cached
*
* @return void
*/
abstract public function populateTimestamp(Smarty_Template_Cached $cached);
/**
* Read the cached template and process header
*
* @param Smarty_Internal_Template $_template template object
* @param Smarty_Template_Cached $cached cached object
* @param bool $update flag if called because cache update
*
* @return bool true or false if the cached content does not exist
*/
abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false);
/**
* Write the rendered template output to cache
*
* @param Smarty_Internal_Template $_template template object
* @param string $content content to cache
*
* @return boolean success
*/
abstract public function writeCachedContent(Smarty_Internal_Template $_template, $content);
/**
* Return cached content
*
* @param Smarty_Internal_Template $_template template object
*
* @return null|string
*/
public function getCachedContent(Smarty_Internal_Template $_template)
{
if ($_template->cached->handler->process($_template)) {
ob_start();
$unifunc = $_template->cached->unifunc;
$unifunc($_template);
return ob_get_clean();
}
return null;
}
/**
* Empty cache
*
* @param Smarty $smarty Smarty object
* @param integer $exp_time expiration time (number of seconds, not timestamp)
*
* @return integer number of cache files deleted
*/
abstract public function clearAll(Smarty $smarty, $exp_time = null);
/**
* Empty cache for a specific template
*
* @param Smarty $smarty Smarty object
* @param string $resource_name template name
* @param string $cache_id cache id
* @param string $compile_id compile id
* @param integer $exp_time expiration time (number of seconds, not timestamp)
*
* @return integer number of cache files deleted
*/
abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);
/**
* @param Smarty $smarty
* @param Smarty_Template_Cached $cached
*
* @return bool|null
*/
public function locked(Smarty $smarty, Smarty_Template_Cached $cached)
{
// theoretically locking_timeout should be checked against time_limit (max_execution_time)
$start = microtime(true);
$hadLock = null;
while ($this->hasLock($smarty, $cached)) {
$hadLock = true;
if (microtime(true) - $start > $smarty->locking_timeout) {
// abort waiting for lock release
return false;
}
sleep(1);
}
return $hadLock;
}
/**
* Check is cache is locked for this template
*
* @param Smarty $smarty
* @param Smarty_Template_Cached $cached
*
* @return bool
*/
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
// check if lock exists
return false;
}
/**
* Lock cache for this template
*
* @param Smarty $smarty
* @param Smarty_Template_Cached $cached
*
* @return bool
*/
public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
// create lock
return true;
}
/**
* Unlock cache for this template
*
* @param Smarty $smarty
* @param Smarty_Template_Cached $cached
*
* @return bool
*/
public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
// release lock
return true;
}
/**
* Load Cache Resource Handler
*
* @param Smarty $smarty Smarty object
* @param string $type name of the cache resource
*
* @throws SmartyException
* @return Smarty_CacheResource Cache Resource Handler
*/
public static function load(Smarty $smarty, $type = null)
{
if (!isset($type)) {
$type = $smarty->caching_type;
}
// try smarty's cache
if (isset($smarty->_cache['cacheresource_handlers'][$type])) {
return $smarty->_cache['cacheresource_handlers'][$type];
}
// try registered resource
if (isset($smarty->registered_cache_resources[$type])) {
// do not cache these instances as they may vary from instance to instance
return $smarty->_cache['cacheresource_handlers'][$type] = $smarty->registered_cache_resources[$type];
}
// try sysplugins dir
if (isset(self::$sysplugins[$type])) {
$cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
}
// try plugins dir
$cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
if ($smarty->loadPlugin($cache_resource_class)) {
return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
}
// give up
throw new SmartyException("Unable to load cache resource '{$type}'");
}
/**
* Invalid Loaded Cache Files
*
* @param Smarty $smarty Smarty object
*/
public function invalidLoadedCache(Smarty $smarty)
{
$smarty->_cache['isCached'] = array();
if (isset($smarty->ext->_subtemplate)) {
$smarty->ext->_subtemplate->tplObjects = array();
}
}
}

Some files were not shown because too many files have changed in this diff Show More