diff --git a/admin/action.php b/admin/action.php index 768341f..d494d18 100755 --- a/admin/action.php +++ b/admin/action.php @@ -16,8 +16,7 @@ if (isset($_GET['dbbackup']) && is_loggedin() && hasPerm('db_dump')) if ($backup['error']) { echo msg('fail', $lang->get('action_backup_fail')); - } - else + } else { header("Cache-Control: public"); header("content-Description: File Transfer"); @@ -27,137 +26,136 @@ if (isset($_GET['dbbackup']) && is_loggedin() && hasPerm('db_dump')) echo $backup['msg']; exit; } -} -else +} else { printHeader($lang->get('action_edit_content')); } if (hasPerm('manage_system')) { //construction - if (isset($_GET['construction'])) + if (isset($_GET['construction'])) + { + if (isset($_GET['constr_message'])) { - if (isset($_GET['constr_message'])) + if (isset($_POST['constr_message'])) { - if (isset($_POST['constr_message'])) + if (file_put_contents('../inc/System/construction2.txt', $_POST['constr_message'])) { - if (file_put_contents('../inc/System/construction2.txt', $_POST['constr_message'])) - { - copy('../inc/System/construction2.txt', '../inc/System/construction.txt'); - echo msg('succes', $lang->get('action_construction_message_success').' '.$lang->get('back').''); - } else - { - echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); - } + copy('../inc/System/construction2.txt', '../inc/System/construction.txt'); + echo msg('succes', $lang->get('action_construction_message_success') . ' ' . $lang->get('back') . ''); } else { - tinymce(); - ?> -
-

get('action_construction_message_edit');?>

-
- - -
-
- get('action_try_again_later') . ' ' . $lang->get('back') . ''); } } else { - if(hasPerm('construction')) + tinymce(); + ?> +
+

get('action_construction_message_edit'); ?>

+
+ + +
+
+ get('action_construction_success').' '.$lang->get('back').''); - } else - { - echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); - } + echo msg('succes', $lang->get('action_construction_success') . ' ' . $lang->get('back') . ''); } else { - ?> -
-

- get('action_construction_confirm');?>
- get('general_yes');?> - get('general_no');?> -

-
- get('action_try_again_later') . ' ' . $lang->get('back') . ''); } } else { - if (isset($_GET['confirm'])) - { - if (unlink('../inc/System/construction.txt')) - { - echo msg('succes', $lang->get('action_construction_removed_success').' '.$lang->get('back').''); - } else - { - echo msg('fail', $lang->get('action_try_again_later').' '.$lang->get('back').''); - } - } else - { - ?> -
+ ?> +

- get('action_construction_remove');?>
- get('general_yes');?> - get('general_no');?> + get('action_construction_confirm'); ?>
+ get('general_yes'); ?> + get('general_no'); ?>

-
- + get('action_change_page_title_success')); } else { - echo msg('fail', $lang->get('action_try_again_later')); - } - } - $moduluri = '../apps/'; - if ($handle = opendir($moduluri)) - { - while (false !== ($mod = readdir($handle))) - { - if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) + if (isset($_GET['confirm'])) { - require $moduluri . $mod . '/config.php'; - if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($moduluri . $mod . '/' . $_CONF['general_conf'])) + if (unlink('../inc/System/construction.txt')) { - //echo '
  • '; - require $moduluri . $mod . '/' . $_CONF['general_conf']; + echo msg('succes', $lang->get('action_construction_removed_success') . ' ' . $lang->get('back') . ''); + } else + { + echo msg('fail', $lang->get('action_try_again_later') . ' ' . $lang->get('back') . ''); } + } else + { + ?> +
    +

    + get('action_construction_remove'); ?>
    + get('general_yes'); ?> + get('general_no'); ?> +

    +
    + get('action_change_page_title_success')); + } else + { + echo msg('fail', $lang->get('action_try_again_later')); + } + } + + $apps = new apps(); + $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'])) + { + //echo '
  • '; + require $appUri . $app . '/' . $_CONF['general_conf']; + } + } + } + //Update + if (isset($_GET['update'])) + { + if (hasPerm('update')) + { + $version_remote = json_decode(file_get_contents($MCONF['update_uri'] . 'version.json')); if ($version_remote->versionNum > $MCONF['version_num']) { - if (copy($MCONF['update_uri'].'update.v' . $version_remote->versionNum . '.incremental.zip', 'update.zip')) + if (copy($MCONF['update_uri'] . 'update.v' . $version_remote->versionNum . '.incremental.zip', 'update.zip')) { if (md5_file('update.zip') == $version_remote->md5) { @@ -193,10 +191,10 @@ if (hasPerm('manage_system')) //Jetzt altes update entfernen if (rrmdir('updateNeu') && $isUp && unlink('update.zip')) { - echo msg('succes', $lang->get('action_update_success').' '.$lang->get('back').''); + echo msg('succes', $lang->get('action_update_success') . ' ' . $lang->get('back') . ''); } else { - echo msg('fail', $lang->get('action_update_fail').' '.$lang->get('back').''); + echo msg('fail', $lang->get('action_update_fail') . ' ' . $lang->get('back') . ''); } } else { @@ -216,8 +214,7 @@ if (hasPerm('manage_system')) } } } -} -else +} else { echo msg('info', $lang->get('missing_permission')); } diff --git a/admin/general_config.php b/admin/general_config.php index ab0a1ce..7543732 100755 --- a/admin/general_config.php +++ b/admin/general_config.php @@ -2,15 +2,15 @@ require_once '../inc/autoload_adm.php'; printHeader($lang->get('general_config')); tinymce(); - ?> -
    +?> +
    -

    get('general_website_title');?> +

    get('general_website_title'); ?> @@ -18,86 +18,85 @@ tinymce(); -

    get('general_construction_mode');?> +

    get('general_construction_mode'); ?> '.$lang->get('general_end_construction_mode').''; + echo '' . $lang->get('general_end_construction_mode') . ''; } else { - echo ''.$lang->get('general_start_construction_mode').''; + echo '' . $lang->get('general_start_construction_mode') . ''; } - ?> get('general_edit_message');?> + ?> get('general_edit_message'); ?>

    - -

    get('general_version');?>

    -

    get('general_version_current');?>: - -

    -

    - versionNum > $MCONF['version_num']) - { - echo $lang->get('general_new_version').' ' . $version_remote->version . ' '.$lang->get('general_update').''; - } - else - { - echo $lang->get('general_version_current_new'); - } - ?> -

    - -

    get('general_database');?>

    +

    get('general_version'); ?>

    +

    get('general_version_current'); ?>: + +

    - get('general_create_backup');?> - - get('general_go_phpmyadmin');?> + versionNum > $MCONF['version_num']) + { + echo $lang->get('general_new_version') . ' ' . $version_remote->version . ' ' . $lang->get('general_update') . ''; + } else + { + echo $lang->get('general_version_current_new'); + } + ?>

    + +

    get('general_database'); ?>

    +

    + get('general_create_backup'); ?> + + get('general_go_phpmyadmin'); ?> +

    + getApps() as $app => $appconf) + { + + require $appUri . $app . '/config.php'; + if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $app . '/' . $_CONF['general_conf'])) { - if ($mod != "." && $mod != ".." && is_dir($moduluri.$mod)) - { - require $moduluri.$mod.'/config.php'; - if(isset($_CONF['general_conf']) && $_CONF['general_conf']!='' && file_exists($moduluri.$mod.'/'.$_CONF['general_conf'])) - { - echo ''; - require $moduluri.$mod.'/'.$_CONF['general_conf']; - } - } + echo ''; + require $appUri . $app . '/' . $_CONF['general_conf']; } - closedir($handle); + } ?> - + - '; require_once '../inc/footer.php'; ?> \ No newline at end of file diff --git a/admin/index.php b/admin/index.php index 1771c75..84eb28e 100755 --- a/admin/index.php +++ b/admin/index.php @@ -13,47 +13,48 @@ if (file_exists('install.php')) if (hasPerm('view_dashboard')) { - echo '
    ' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . ''.$lang->get('os').'
    '; - echo '
    ' . $_SERVER['SERVER_SOFTWARE'] . ''.$lang->get('server_software').'
    '; - echo '
    ' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . ''.$lang->get('php_version').'
    '; - echo '
    ' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . ''.$lang->get('mysql_version').'
    '; - echo '
    ' . date('H:i:s') . ''.$lang->get('system_time').'
    '; + echo '
    ' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . '' . $lang->get('os') . '
    '; + echo '
    ' . $_SERVER['SERVER_SOFTWARE'] . '' . $lang->get('server_software') . '
    '; + echo '
    ' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . '' . $lang->get('php_version') . '
    '; + echo '
    ' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . '' . $lang->get('mysql_version') . '
    '; + echo '
    ' . date('H:i:s') . '' . $lang->get('system_time') . '
    '; ?>
    - get('general_config');?>
    -
    get('logfiles');?>
    + get('general_config'); ?> +
    get('logfiles'); ?>
    '; //Find Dashboard files -$moduluri = '../apps/'; -if ($handle = opendir($moduluri)) + +$apps = new apps(); +$appUri = '../apps/'; +foreach ($apps->getApps() as $app => $appconf) { - while (false !== ($mod = readdir($handle))) + + require $appUri . $app . '/config.php'; + if (isset($_CONF['dashboard']) && $_CONF['dashboard'] != '') { - if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) + if (file_exists($appUri . $app . '/' . $_CONF['dashboard'])) { - require $moduluri . $mod . '/config.php'; - if(isset($_CONF['dashboard']) && $_CONF['dashboard'] != '') - { - if (file_exists($moduluri . $mod . '/' . $_CONF['dashboard'])) - { - echo '
    '; - require $moduluri . $mod . '/' . $_CONF['dashboard']; - echo '
    '; - } - } - $_CONF['dashboard'] = ''; + echo '
    '; + require $appUri . $app . '/' . $_CONF['dashboard']; + echo '
    '; } } - closedir($handle); + $_CONF['dashboard'] = ''; + } echo '
    '; require_once '../inc/footer.php'; diff --git a/admin/install-dev.php b/admin/install-dev.php index 260a22b..e1c221b 100644 --- a/admin/install-dev.php +++ b/admin/install-dev.php @@ -11,38 +11,39 @@ require_once '../inc/libs/lang.class.php'; require_once '../inc/libs/db-mysql.php'; require_once '../inc/libs/YAML/autoload.php'; use Symfony\Component\Yaml\Yaml; + $lang = new lang(); $lang->setLangFolder('lang/'); ?> Installation - +

    Installation

    query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; + if ($db->query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -CREATE TABLE `'.$_POST['db_prefix'].'meta_meta` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'meta_meta` ( `name` text NOT NULL, `content` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `'.$_POST['db_prefix'].'sidebar_sidebar` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'sidebar_sidebar` ( `active` tinyint(1) NOT NULL, `content` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `'.$_POST['db_prefix'].'sidebar_sidebar` (`active`, `content`) VALUES +INSERT INTO `' . $_POST['db_prefix'] . 'sidebar_sidebar` (`active`, `content`) VALUES (0, \'\'); -CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_pages` ( `id` int(11) NOT NULL, `title` text CHARACTER SET utf8 NOT NULL, `alias` longtext CHARACTER SET utf8 NOT NULL, @@ -125,7 +125,7 @@ CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages` ( `created` int(11) NOT NULL, `lastedit` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm` ( `id` int(11) NOT NULL, `page_id` int(11) NOT NULL, `title` text CHARACTER SET utf8 NOT NULL, @@ -138,13 +138,13 @@ CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` ( `created` int(11) NOT NULL, `lastedit` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `'.$_POST['db_prefix'].'simplePages_permissions` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions` ( `id` int(11) NOT NULL, `page` int(11) NOT NULL, `user` int(11) NOT NULL, `lastedit` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -CREATE TABLE `'.$_POST['db_prefix'].'system_admins` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'system_admins` ( `id` int(11) NOT NULL, `username` text NOT NULL, `pass` text NOT NULL, @@ -152,7 +152,7 @@ CREATE TABLE `'.$_POST['db_prefix'].'system_admins` ( `mail` text NOT NULL, `secret` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `'.$_POST['db_prefix'].'system_loggedin` ( +CREATE TABLE `' . $_POST['db_prefix'] . 'system_loggedin` ( `id` int(11) NOT NULL, `user` int(11) NOT NULL, `user_agent` longtext NOT NULL, @@ -160,42 +160,42 @@ CREATE TABLE `'.$_POST['db_prefix'].'system_loggedin` ( `time` int(11) NOT NULL, `token` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `'.$_POST['db_prefix'].'system_roles` ( +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 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'system_admins` +ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin` +ALTER TABLE `' . $_POST['db_prefix'] . 'system_loggedin` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'system_roles` +ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles` ADD PRIMARY KEY (`id`); -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions` +ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; -ALTER TABLE `'.$_POST['db_prefix'].'system_admins` +ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; -ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin` +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` +ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; -')) +') + ) { echo msg('success', 'Created Tables successfully.'); - } - else + } else { echo msg('fail', 'Failed Creating Tables'); exit; @@ -203,11 +203,10 @@ ALTER TABLE `'.$_POST['db_prefix'].'system_roles` //Admin group $db->setCol('system_roles'); $db->data['name'] = 'Admins'; - if($db->insert()) + if ($db->insert()) { echo msg('success', 'Successfully created admin group.'); - } - else + } else { echo msg('fail', 'Error creating admin group.'); exit; @@ -218,94 +217,82 @@ ALTER TABLE `'.$_POST['db_prefix'].'system_roles` $db->data['pass'] = password_hash($_POST['admin_pw1'], PASSWORD_DEFAULT); $db->data['lvl'] = 1; $db->data['mail'] = $_POST['admin_mail']; - if($db->insert()) + if ($db->insert()) { echo msg('success', 'Successfully created admin user.'); - } - else + } else { echo msg('fail', 'Error creating admin user.'); exit; } //Page title - if(file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title'])) + if (file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title'])) { echo msg('succes', 'Page Title was successfully set.
    '); - } - else + } else { echo msg('fail', 'Error setting page title.'); exit; } //htacces - $htacces = 'ErrorDocument 404 '.$_POST['general_home_url'].'index.php + $htacces = 'ErrorDocument 404 ' . $_POST['general_home_url'] . 'index.php SetEnv gp_rewrite U9sL2S2 RewriteEngine On -RewriteBase "'.$_POST['general_home_url'].'" +RewriteBase "' . $_POST['general_home_url'] . '" RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule /?(.*) "'.$_POST['general_home_url'].'index.php?$1" [qsa,L] +RewriteRule /?(.*) "' . $_POST['general_home_url'] . 'index.php?$1" [qsa,L] -RewriteRule . "'.$_POST['general_home_url'].'index.php" [L] +RewriteRule . "' . $_POST['general_home_url'] . 'index.php" [L] '; - if(file_put_contents('../.htaccess', $htacces)) + if (file_put_contents('../.htaccess', $htacces)) { echo msg('succes', '.htaccess was successfully set.
    '); - } - else + } else { echo msg('fail', 'Error setting up .htaccess.
    '); exit; } //Apps - $modulurl = '../apps/'; - if ($handle = opendir($modulurl)) + $apps = new apps(); + $appUri = '../apps/'; + foreach ($apps->getApps() as $app => $appconf) { - while (false !== ($mod = readdir($handle))) + require $appUri . $app . '/config.php'; + if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $app . '/' . $_CONF['install'])) { - if ($mod != "." && $mod != ".." && is_dir($modulurl.$mod)) - { - require $modulurl.$mod.'/config.php'; - if(isset($_CONF['install']) && $_CONF['install']!='' && file_exists($modulurl.$mod.'/'.$_CONF['install'])) - { - require $modulurl.$mod.'/'.$_CONF['install']; - } - } + require $appUri . $app . '/' . $_CONF['install']; } - closedir($handle); } //Write Config $configfile = Yaml::dump($CONFIG); - if(file_put_contents('../inc/config.yml', $configfile)) + if (file_put_contents('../inc/config.yml', $configfile)) { echo msg('succes', 'Configfile was successfully created.'); - } - else + } else { echo msg('fail', 'Error creating configfile.'); exit; } - echo msg('info', 'Installation successfully completed. Login'); - } - else + echo msg('info', 'Installation successfully completed. Login'); + } else { echo msg('info', 'Please fill in all fields!'); } -} -else +} else { ?>
    -
    +

    Language

    Select your language:

    @@ -327,15 +314,19 @@ else Table prefix

    Website

    - Website Url
    - Home Url
    + Website Url
    + Home Url
    Phpmyadmin Url
    Page Title
    Editor CSS
    - Template
    + Template

    Mail

    - Use SMTP
    + Use SMTP
    SMTP-Host
    SMTP-Username
    SMTP-Password
    @@ -351,22 +342,16 @@ else Password
    Confirm Password
    getApps() as $app => $appconf) { - while (false !== ($mod = readdir($handle))) + require $appUri . $app . '/config.php'; + if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $app . '/' . $_CONF['install'])) { - if ($mod != "." && $mod != ".." && is_dir($modulurl . $mod)) - { - //echo $mod; - require $modulurl . $mod . '/config.php'; - if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($modulurl . $mod . '/' . $_CONF['install'])) - { - require $modulurl . $mod . '/' . $_CONF['install']; - } - } + require $appUri . $app . '/' . $_CONF['install']; } - closedir($handle); } ?>

    diff --git a/admin/permissions.php b/admin/permissions.php index 7d566cc..b97563a 100755 --- a/admin/permissions.php +++ b/admin/permissions.php @@ -66,22 +66,17 @@ if (hasPerm('edit_permissions')) $permsTotal = []; $permsTotal['System'] = json_decode(file_get_contents('permissions.json'), true); $permsTotal['System'] = $permsTotal['System']['permissions']; - $moduluri = '../apps/'; - if ($handle = opendir($moduluri)) + + $apps = new apps(); + $appUri = '../apps/'; + foreach ($apps->getApps() as $app => $appconf) { - while (false !== ($mod = readdir($handle))) + if (file_exists($appUri . '/' . $app . '/permissions.json')) { - if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod)) - { - if (file_exists($moduluri . '/' . $mod . '/permissions.json')) - { - require $moduluri . '/' . $mod . '/config.php'; - $permsTotal[$_CONF['mod_name']] = json_decode(file_get_contents($moduluri . '/' . $mod . '/permissions.json'), true); - $permsTotal[$_CONF['mod_name']] = $permsTotal[$_CONF['mod_name']]['permissions']; - } - } + require $appUri . '/' . $app . '/config.php'; + $permsTotal[$_CONF['mod_name']] = json_decode(file_get_contents($appUri . '/' . $app . '/permissions.json'), true); + $permsTotal[$_CONF['mod_name']] = $permsTotal[$_CONF['mod_name']]['permissions']; } - closedir($handle); } //print_r($permsTotal); diff --git a/apps/SimplePages/backend/confirm.php b/apps/SimplePages/backend/confirm.php index 74c0deb..db758a1 100755 --- a/apps/SimplePages/backend/confirm.php +++ b/apps/SimplePages/backend/confirm.php @@ -1,6 +1,9 @@ get('sp_confirm')); + +require_once 'confirmConfig.php'; + if (isset($_GET['page'])) { if ($_SESSION['userid'] == $confirmationUser) diff --git a/apps/SimplePages/backend/confirmConfig.php b/apps/SimplePages/backend/confirmConfig.php new file mode 100644 index 0000000..3a94d90 --- /dev/null +++ b/apps/SimplePages/backend/confirmConfig.php @@ -0,0 +1,16 @@ +get('sp_edit')); + +require_once 'confirmConfig.php'; + if (hasPerm('manage_pages')) { tinymce(); @@ -130,8 +133,13 @@ if (hasPerm('manage_pages')) if(!isset($status)) { $status = 0; - if (isset($_POST['status'])) $status = $_POST['status']; + if (isset($_POST['status'])) + { + $status = $_POST['status']; + if($_POST['status'] == 'true') $status = 1; + } } + $db->data['status'] = $status; $db->data['meta_description'] = $_POST['meta_description']; $db->data['meta_keywords'] = $_POST['meta_keywords']; @@ -294,7 +302,7 @@ if (hasPerm('manage_pages'))

    get('sp_edit_title');?>:

    -

    get('sp_edit_alias');?>:get('sp_edit_alias');?>:

    get('sp_edit_public');?>:caching = false; - $page->error_reporting = E_ALL & ~E_NOTICE; + $page->caching = false; + $page->error_reporting = E_ALL & ~E_NOTICE; - //Set Url + //Set Url $page->setUrl(str_replace($MCONF['home_uri'], '', $_SERVER['REQUEST_URI'])); $base = explode('/', str_replace($MCONF['home_uri'], '', $_SERVER['REQUEST_URI'])); $page->setBaseUrl('/'); - if(count($base)>1) + if (count($base) > 1) { - $page->setBaseUrl($base[0].'/'); + $page->setBaseUrl($base[0] . '/'); } $page->setResponseCode(404); @@ -36,84 +35,78 @@ if (file_exists('inc/config.yml')) //Search apps and execute them if necessary foreach ($apps->getApps() as $app => $appconf) { - $appUri = 'apps/'.$app.'/'; + $appUri = 'apps/' . $app . '/'; //If the App should run from one domain only - if((isset($appconf['domain']) && $page->getDomain() == $appconf['domain']) || !isset($appconf['domain']) || (isset($appconf['domain']) && $appconf['domain'] === '')) + if ((isset($appconf['domain']) && $page->getDomain() == $appconf['domain']) || !isset($appconf['domain']) || (isset($appconf['domain']) && $appconf['domain'] === '')) { - //If we have an alias which equals the current url, execute it - if(isset($appconf['alias'])) - { - if(array_key_exists($page->getUrl(), $appconf['alias'])) + //If we have an alias which equals the current url, execute it + if (isset($appconf['alias'])) { - require $appUri. $appconf['alias'][$page->getUrl()]; - } - } - - //If we have a type - if(isset($appconf['type'])) - { - //Page for (more or less) dynamic content - if($appconf['type'] == 'page') - { - //If we have a base_url_file and the current url equals base_url, execute base_url_file - if(isset($appconf['base_url_file'])) + if (array_key_exists($page->getUrl(), $appconf['alias'])) { - if($appconf['base_url'] == $page->getUrl()) - { - require $appUri . $appconf['base_url_file']; - } - } - - //if we have a base_url and a base_file which exists and the current baseUrl equals base_url, execute base_file - if(isset($appconf['base_url']) && file_exists($appUri.'/' . $appconf['base_file'])) - { - if($appconf['base_url'] == $page->getBaseUrl()) - { - require $appUri. $appconf['base_file']; - } + require $appUri . $appconf['alias'][$page->getUrl()]; } } - //Static - if($appconf['type'] == 'static' && isset($appconf['base_file']) && file_exists($appUri.'/'.$appconf['base_file'])) + //If we have a type + if (isset($appconf['type'])) { - require $appUri.$appconf['base_file']; - } - } + //Page for (more or less) dynamic content + if ($appconf['type'] == 'page') + { + //If we have a base_url_file and the current url equals base_url, execute base_url_file + if (isset($appconf['base_url_file'])) + { + if ($appconf['base_url'] == $page->getUrl()) + { + require $appUri . $appconf['base_url_file']; + } + } - //If the App should run from one domain only - /*if(isset($appconf['domain']) && $page->getDomain() == $appconf['domain']) - { - echo 'ff';*/ + //if we have a base_url and a base_file which exists and the current baseUrl equals base_url, execute base_file + if (isset($appconf['base_url']) && file_exists($appUri . '/' . $appconf['base_file'])) + { + if ($appconf['base_url'] == $page->getBaseUrl()) + { + require $appUri . $appconf['base_file']; + } + } + } + + //Static + if ($appconf['type'] == 'static' && isset($appconf['base_file']) && file_exists($appUri . '/' . $appconf['base_file'])) + { + require $appUri . $appconf['base_file']; + } + } } $appconf = []; } - if($page->getResponseCode() == 404) + if ($page->getResponseCode() == 404) { $page->setTitle('404'); $page->setContent(file_get_contents('inc/System/404.txt')); } //Copyright bauen - $founded = date('Y', filemtime('inc/config.php')); + $founded = date('Y', filemtime('inc/config.yml')); $copy = $founded; - if($founded != date('Y')) + if ($founded != date('Y')) { - $copy = $founded.' - '.date('Y'); + $copy = $founded . ' - ' . date('Y'); } $page->assign('copyright', $copy); // dat ganze ausgeben http_response_code($page->getResponseCode()); - $page->assign($MCONF['tpl_title'], $page->getTitle(). ' | ' . $MCONF['title']); + $page->assign($MCONF['tpl_title'], $page->getTitle() . ' | ' . $MCONF['title']); $page->assign($MCONF['tpl_content'], $page->getContent()); $page->assign($MCONF['tpl_webUri'], $MCONF['web_uri']); $page->display($MCONF['template']); } -} -else +} else { header('Location: admin/install.php'); } \ No newline at end of file