From f383a83c02271022d086d70ac34792db4ad60e02 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 19 May 2017 00:45:14 +0200 Subject: [PATCH] Categories++ --- .gitignore | 2 +- .../591e22ce08934/databases/categories.php | 11 + .../591e22ce08934/databases/pages.php | 49 ++++ .../databases/plugins/about/db.php | 6 + .../databases/plugins/pages/db.php | 6 + .../databases/plugins/simplemde/db.php | 6 + .../databases/plugins/tags/db.php | 5 + .../databases/plugins/timemachine/db.php | 4 + .../591e22ce08934/databases/security.php | 7 + .../591e22ce08934/databases/site.php | 24 ++ .../591e22ce08934/databases/syslog.php | 58 +++++ .../591e22ce08934/databases/tags.php | 21 ++ .../591e22ce08934/databases/users.php | 18 ++ .../591e22ce08934/pages/about/index.txt | 2 + .../591e22ce08934/pages/error/index.txt | 2 + .../591e22ce08934/pages/welcome/index.txt | 2 + .../591e235623833/databases/categories.php | 11 + .../591e235623833/databases/pages.php | 49 ++++ .../databases/plugins/about/db.php | 6 + .../databases/plugins/pages/db.php | 6 + .../databases/plugins/simplemde/db.php | 6 + .../databases/plugins/tags/db.php | 5 + .../databases/plugins/timemachine/db.php | 4 + .../591e235623833/databases/security.php | 7 + .../591e235623833/databases/site.php | 24 ++ .../591e235623833/databases/syslog.php | 66 ++++++ .../591e235623833/databases/tags.php | 21 ++ .../591e235623833/databases/users.php | 18 ++ .../591e235623833/pages/about/index.txt | 2 + .../591e235623833/pages/error/index.txt | 2 + .../591e235623833/pages/welcome/index.txt | 2 + bl-kernel/admin/controllers/new-page.php | 7 + .../admin/controllers/settings-general.php | 14 +- bl-kernel/admin/views/settings-advanced.php | 20 +- bl-kernel/boot/init.php | 7 +- bl-kernel/dblanguage.class.php | 5 + bl-kernel/dbnotifications.php | 211 ------------------ bl-kernel/dbsyslog.class.php | 44 ++++ bl-plugins/timemachine/languages/bg_BG.json | 7 - bl-plugins/timemachine/languages/de_CH.json | 7 - bl-plugins/timemachine/languages/de_DE.json | 7 - bl-plugins/timemachine/languages/en_US.json | 7 - bl-plugins/timemachine/languages/es_AR.json | 7 - bl-plugins/timemachine/languages/ja_JP.json | 7 - bl-plugins/timemachine/languages/nl_NL.json | 7 - bl-plugins/timemachine/languages/ru_RU.json | 7 - bl-plugins/timemachine/languages/tr_TR.json | 7 - bl-plugins/timemachine/languages/uk_UA.json | 7 - bl-plugins/timemachine/metadata.json | 10 - bl-plugins/timemachine/plugin.php | 21 -- install.php | 15 +- 51 files changed, 544 insertions(+), 332 deletions(-) create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/categories.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/pages.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/plugins/about/db.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/plugins/pages/db.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/plugins/simplemde/db.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/plugins/tags/db.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/plugins/timemachine/db.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/security.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/site.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/syslog.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/tags.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/databases/users.php create mode 100644 bl-content/timemachine.workspace/591e22ce08934/pages/about/index.txt create mode 100644 bl-content/timemachine.workspace/591e22ce08934/pages/error/index.txt create mode 100644 bl-content/timemachine.workspace/591e22ce08934/pages/welcome/index.txt create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/categories.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/pages.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/plugins/about/db.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/plugins/pages/db.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/plugins/simplemde/db.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/plugins/tags/db.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/plugins/timemachine/db.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/security.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/site.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/syslog.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/tags.php create mode 100644 bl-content/timemachine.workspace/591e235623833/databases/users.php create mode 100644 bl-content/timemachine.workspace/591e235623833/pages/about/index.txt create mode 100644 bl-content/timemachine.workspace/591e235623833/pages/error/index.txt create mode 100644 bl-content/timemachine.workspace/591e235623833/pages/welcome/index.txt delete mode 100644 bl-kernel/dbnotifications.php create mode 100644 bl-kernel/dbsyslog.class.php delete mode 100644 bl-plugins/timemachine/languages/bg_BG.json delete mode 100644 bl-plugins/timemachine/languages/de_CH.json delete mode 100644 bl-plugins/timemachine/languages/de_DE.json delete mode 100644 bl-plugins/timemachine/languages/en_US.json delete mode 100644 bl-plugins/timemachine/languages/es_AR.json delete mode 100644 bl-plugins/timemachine/languages/ja_JP.json delete mode 100644 bl-plugins/timemachine/languages/nl_NL.json delete mode 100644 bl-plugins/timemachine/languages/ru_RU.json delete mode 100644 bl-plugins/timemachine/languages/tr_TR.json delete mode 100644 bl-plugins/timemachine/languages/uk_UA.json delete mode 100644 bl-plugins/timemachine/metadata.json delete mode 100644 bl-plugins/timemachine/plugin.php diff --git a/.gitignore b/.gitignore index 6ac90aee..b655b611 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ bl-content/databases bl-content/pages bl-content/posts -bl-content/uploads +bl-content/uploads \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/categories.php b/bl-content/timemachine.workspace/591e22ce08934/databases/categories.php new file mode 100644 index 00000000..d4e99bc7 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/categories.php @@ -0,0 +1,11 @@ + +{ + "videos": { + "name": "Videos", + "list": [] + }, + "music": { + "name": "Music", + "list": [] + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/pages.php b/bl-content/timemachine.workspace/591e22ce08934/databases/pages.php new file mode 100644 index 00000000..8bd1eeab --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/pages.php @@ -0,0 +1,49 @@ + +{ + "error": { + "description": "Page not found", + "username": "admin", + "tags": [], + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 0, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "451ad70b20cacffaa5d1c63300cf33cc" + }, + "about": { + "description": "About your site or yourself", + "username": "admin", + "tags": [], + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 2, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "f2ebea0584b190ce4897efddb5cd104d" + }, + "welcome": { + "description": "Welcome to Bludit", + "username": "admin", + "tags": { + "bludit": "Bludit", + "cms": "CMS", + "flat-files": "Flat files" + }, + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 1, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "eccd7bbd25a3239083ea695452043323" + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/about/db.php b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/about/db.php new file mode 100644 index 00000000..23201732 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/about/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "label": "About", + "text": "This is a brief description of yourself or your site, to change this text go to the admin panel, settings, plugins, and configure the plugin about." +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/pages/db.php b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/pages/db.php new file mode 100644 index 00000000..a81a551c --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/pages/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "homeLink": true, + "label": "Pages" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/simplemde/db.php b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/simplemde/db.php new file mode 100644 index 00000000..08e5809a --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/simplemde/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "tabSize": 4, + "toolbar": ""bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/tags/db.php b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/tags/db.php new file mode 100644 index 00000000..1bf484e0 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/tags/db.php @@ -0,0 +1,5 @@ + +{ + "position": 0, + "label": "Tags" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/timemachine/db.php b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/timemachine/db.php new file mode 100644 index 00000000..a7dfb084 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/plugins/timemachine/db.php @@ -0,0 +1,4 @@ + +{ + "position": 0 +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/security.php b/bl-content/timemachine.workspace/591e22ce08934/databases/security.php new file mode 100644 index 00000000..57df433d --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/security.php @@ -0,0 +1,7 @@ + +{ + "key1": "35a2cebb69e06e130572b109a46a0f8220af6260", + "minutesBlocked": 5, + "numberFailuresAllowed": 10, + "blackList": [] +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/site.php b/bl-content/timemachine.workspace/591e22ce08934/databases/site.php new file mode 100644 index 00000000..3e3782ad --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/site.php @@ -0,0 +1,24 @@ + +{ + "title": "BLUDIT", + "slogan": "CMS", + "description": "", + "footer": "Copyright \u00a9 2017", + "language": "en_US", + "locale": "en_US", + "timezone": "Europe\/Warsaw", + "theme": "log", + "adminTheme": "default", + "homepage": "", + "postsperpage": "6", + "uriPage": "\/", + "uriTag": "\/tag\/", + "uriCategory": "\/category\/", + "url": "http:\/\/localbluditv2.com\/", + "emailFrom": "no-reply@localbluditv2.com", + "twitter": "", + "facebook": "", + "googlePlus": "", + "instagram": "", + "github": "" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/syslog.php b/bl-content/timemachine.workspace/591e22ce08934/databases/syslog.php new file mode 100644 index 00000000..b41f2f71 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/syslog.php @@ -0,0 +1,58 @@ + +[ + { + "date": "2017-05-19 00:29:41", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e205505940", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:28:55", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e2026aa5c9", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:26:48", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e1fa822ec9", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:23:49", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e1ef48ed7d", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-18 23:58:14", + "idExecution": "591e18f6df384", + "method": "POST", + "notes": "", + "dictionaryKey": "changes-on-settings", + "username": "admin" + }, + { + "date": "2017-05-18 23:56:52", + "idExecution": "591e18a4b8d25", + "method": "POST", + "notes": "", + "dictionaryKey": "", + "username": "admin" + }, + { + "date": "2017-05-18 23:40:39", + "dictionaryKey": "welcome-to-bludit", + "username": "admin", + "idExecution": "591e14d70fe0d", + "method": "POST" + } +] \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/tags.php b/bl-content/timemachine.workspace/591e22ce08934/databases/tags.php new file mode 100644 index 00000000..7f995108 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/tags.php @@ -0,0 +1,21 @@ + +{ + "bludit": { + "name": "Bludit", + "list": [ + "welcome" + ] + }, + "cms": { + "name": "CMS", + "list": [ + "welcome" + ] + }, + "flat-files": { + "name": "Flat files", + "list": [ + "welcome" + ] + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/databases/users.php b/bl-content/timemachine.workspace/591e22ce08934/databases/users.php new file mode 100644 index 00000000..b763faaa --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/databases/users.php @@ -0,0 +1,18 @@ + +{ + "admin": { + "firstName": "Administrator", + "lastName": "", + "role": "admin", + "password": "5c3ac502b428342a56fa2abc9b7c006dd38d009a", + "salt": "mnpqWziLAR", + "email": "", + "registered": "2017-05-18 23:40:39", + "tokenEmail": "", + "tokenEmailTTL": "2009-03-15 14:00", + "twitter": "", + "facebook": "", + "googlePlus": "", + "instagram": "" + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/pages/about/index.txt b/bl-content/timemachine.workspace/591e22ce08934/pages/about/index.txt new file mode 100644 index 00000000..f118595b --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/pages/about/index.txt @@ -0,0 +1,2 @@ +Title: About +Content: The about page is an important and powerful tool for potential clients and partners. For those who wonder who is behind the website, your About page is the first source of information. Change this page's content on the admin panel, manage, pages and click on the about page. \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/pages/error/index.txt b/bl-content/timemachine.workspace/591e22ce08934/pages/error/index.txt new file mode 100644 index 00000000..b9d01714 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/pages/error/index.txt @@ -0,0 +1,2 @@ +Title: Error +Content: The page has not been found. \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e22ce08934/pages/welcome/index.txt b/bl-content/timemachine.workspace/591e22ce08934/pages/welcome/index.txt new file mode 100644 index 00000000..b9d01714 --- /dev/null +++ b/bl-content/timemachine.workspace/591e22ce08934/pages/welcome/index.txt @@ -0,0 +1,2 @@ +Title: Error +Content: The page has not been found. \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/categories.php b/bl-content/timemachine.workspace/591e235623833/databases/categories.php new file mode 100644 index 00000000..d4e99bc7 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/categories.php @@ -0,0 +1,11 @@ + +{ + "videos": { + "name": "Videos", + "list": [] + }, + "music": { + "name": "Music", + "list": [] + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/pages.php b/bl-content/timemachine.workspace/591e235623833/databases/pages.php new file mode 100644 index 00000000..8bd1eeab --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/pages.php @@ -0,0 +1,49 @@ + +{ + "error": { + "description": "Page not found", + "username": "admin", + "tags": [], + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 0, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "451ad70b20cacffaa5d1c63300cf33cc" + }, + "about": { + "description": "About your site or yourself", + "username": "admin", + "tags": [], + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 2, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "f2ebea0584b190ce4897efddb5cd104d" + }, + "welcome": { + "description": "Welcome to Bludit", + "username": "admin", + "tags": { + "bludit": "Bludit", + "cms": "CMS", + "flat-files": "Flat files" + }, + "status": "published", + "date": "2017-05-18 23:40:39", + "dateModified": "", + "allowComments": false, + "position": 1, + "coverImage": "", + "md5file": "", + "category": "", + "uuid": "eccd7bbd25a3239083ea695452043323" + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/plugins/about/db.php b/bl-content/timemachine.workspace/591e235623833/databases/plugins/about/db.php new file mode 100644 index 00000000..23201732 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/plugins/about/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "label": "About", + "text": "This is a brief description of yourself or your site, to change this text go to the admin panel, settings, plugins, and configure the plugin about." +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/plugins/pages/db.php b/bl-content/timemachine.workspace/591e235623833/databases/plugins/pages/db.php new file mode 100644 index 00000000..a81a551c --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/plugins/pages/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "homeLink": true, + "label": "Pages" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/plugins/simplemde/db.php b/bl-content/timemachine.workspace/591e235623833/databases/plugins/simplemde/db.php new file mode 100644 index 00000000..08e5809a --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/plugins/simplemde/db.php @@ -0,0 +1,6 @@ + +{ + "position": 0, + "tabSize": 4, + "toolbar": ""bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/plugins/tags/db.php b/bl-content/timemachine.workspace/591e235623833/databases/plugins/tags/db.php new file mode 100644 index 00000000..1bf484e0 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/plugins/tags/db.php @@ -0,0 +1,5 @@ + +{ + "position": 0, + "label": "Tags" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/plugins/timemachine/db.php b/bl-content/timemachine.workspace/591e235623833/databases/plugins/timemachine/db.php new file mode 100644 index 00000000..a7dfb084 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/plugins/timemachine/db.php @@ -0,0 +1,4 @@ + +{ + "position": 0 +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/security.php b/bl-content/timemachine.workspace/591e235623833/databases/security.php new file mode 100644 index 00000000..57df433d --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/security.php @@ -0,0 +1,7 @@ + +{ + "key1": "35a2cebb69e06e130572b109a46a0f8220af6260", + "minutesBlocked": 5, + "numberFailuresAllowed": 10, + "blackList": [] +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/site.php b/bl-content/timemachine.workspace/591e235623833/databases/site.php new file mode 100644 index 00000000..3e3782ad --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/site.php @@ -0,0 +1,24 @@ + +{ + "title": "BLUDIT", + "slogan": "CMS", + "description": "", + "footer": "Copyright \u00a9 2017", + "language": "en_US", + "locale": "en_US", + "timezone": "Europe\/Warsaw", + "theme": "log", + "adminTheme": "default", + "homepage": "", + "postsperpage": "6", + "uriPage": "\/", + "uriTag": "\/tag\/", + "uriCategory": "\/category\/", + "url": "http:\/\/localbluditv2.com\/", + "emailFrom": "no-reply@localbluditv2.com", + "twitter": "", + "facebook": "", + "googlePlus": "", + "instagram": "", + "github": "" +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/syslog.php b/bl-content/timemachine.workspace/591e235623833/databases/syslog.php new file mode 100644 index 00000000..055c2d48 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/syslog.php @@ -0,0 +1,66 @@ + +[ + { + "date": "2017-05-19 00:40:14", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e22ce08934", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:29:41", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e205505940", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:28:55", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e2026aa5c9", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:26:48", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e1fa822ec9", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-19 00:23:49", + "dictionaryKey": "changes-on-settings", + "notes": "", + "idExecution": "591e1ef48ed7d", + "method": "POST", + "username": "admin" + }, + { + "date": "2017-05-18 23:58:14", + "idExecution": "591e18f6df384", + "method": "POST", + "notes": "", + "dictionaryKey": "changes-on-settings", + "username": "admin" + }, + { + "date": "2017-05-18 23:56:52", + "idExecution": "591e18a4b8d25", + "method": "POST", + "notes": "", + "dictionaryKey": "", + "username": "admin" + }, + { + "date": "2017-05-18 23:40:39", + "dictionaryKey": "welcome-to-bludit", + "username": "admin", + "idExecution": "591e14d70fe0d", + "method": "POST" + } +] \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/tags.php b/bl-content/timemachine.workspace/591e235623833/databases/tags.php new file mode 100644 index 00000000..7f995108 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/tags.php @@ -0,0 +1,21 @@ + +{ + "bludit": { + "name": "Bludit", + "list": [ + "welcome" + ] + }, + "cms": { + "name": "CMS", + "list": [ + "welcome" + ] + }, + "flat-files": { + "name": "Flat files", + "list": [ + "welcome" + ] + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/databases/users.php b/bl-content/timemachine.workspace/591e235623833/databases/users.php new file mode 100644 index 00000000..b763faaa --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/databases/users.php @@ -0,0 +1,18 @@ + +{ + "admin": { + "firstName": "Administrator", + "lastName": "", + "role": "admin", + "password": "5c3ac502b428342a56fa2abc9b7c006dd38d009a", + "salt": "mnpqWziLAR", + "email": "", + "registered": "2017-05-18 23:40:39", + "tokenEmail": "", + "tokenEmailTTL": "2009-03-15 14:00", + "twitter": "", + "facebook": "", + "googlePlus": "", + "instagram": "" + } +} \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/pages/about/index.txt b/bl-content/timemachine.workspace/591e235623833/pages/about/index.txt new file mode 100644 index 00000000..f118595b --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/pages/about/index.txt @@ -0,0 +1,2 @@ +Title: About +Content: The about page is an important and powerful tool for potential clients and partners. For those who wonder who is behind the website, your About page is the first source of information. Change this page's content on the admin panel, manage, pages and click on the about page. \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/pages/error/index.txt b/bl-content/timemachine.workspace/591e235623833/pages/error/index.txt new file mode 100644 index 00000000..b9d01714 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/pages/error/index.txt @@ -0,0 +1,2 @@ +Title: Error +Content: The page has not been found. \ No newline at end of file diff --git a/bl-content/timemachine.workspace/591e235623833/pages/welcome/index.txt b/bl-content/timemachine.workspace/591e235623833/pages/welcome/index.txt new file mode 100644 index 00000000..b9d01714 --- /dev/null +++ b/bl-content/timemachine.workspace/591e235623833/pages/welcome/index.txt @@ -0,0 +1,2 @@ +Title: Error +Content: The page has not been found. \ No newline at end of file diff --git a/bl-kernel/admin/controllers/new-page.php b/bl-kernel/admin/controllers/new-page.php index 5bcab35f..e0c93172 100644 --- a/bl-kernel/admin/controllers/new-page.php +++ b/bl-kernel/admin/controllers/new-page.php @@ -12,6 +12,7 @@ function addPage($args) { global $dbPages; global $Language; + global $Syslog; // Add the page, if the $key is FALSE the creation of the post failure. $key = $dbPages->add($args); @@ -26,6 +27,12 @@ function addPage($args) // Call the plugins after page created Theme::plugins('afterPageCreate'); + // Add to syslog + $Syslog->add(array( + 'dictionaryKey'=>'new-page-created', + 'notes'=>$args['title'] + )); + // Create an alert Alert::set( $Language->g('Page added successfully') ); diff --git a/bl-kernel/admin/controllers/settings-general.php b/bl-kernel/admin/controllers/settings-general.php index dcca7fec..d053bcdc 100644 --- a/bl-kernel/admin/controllers/settings-general.php +++ b/bl-kernel/admin/controllers/settings-general.php @@ -17,6 +17,7 @@ function setSettings($args) { global $Site; global $Language; + global $Syslog; // Add slash at the begin and end. // This fields are in the settings->advanced mode @@ -33,7 +34,17 @@ function setSettings($args) } if( $Site->set($args) ) { - Alert::set($Language->g('the-changes-have-been-saved')); + // Add to syslog + $Syslog->add(array( + 'dictionaryKey'=>'changes-on-settings', + 'notes'=>'' + )); + + // Create an alert + Alert::set( $Language->g('The changes have been saved') ); + + // Redirect + Redirect::page('settings-general'); } else { Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.'); @@ -53,7 +64,6 @@ function setSettings($args) if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { setSettings($_POST); - Redirect::page($layout['controller']); } // ============================================================================ diff --git a/bl-kernel/admin/views/settings-advanced.php b/bl-kernel/admin/views/settings-advanced.php index 7b2dffe6..a83fffc3 100644 --- a/bl-kernel/admin/views/settings-advanced.php +++ b/bl-kernel/admin/views/settings-advanced.php @@ -30,21 +30,13 @@ HTML::formOpen(array('class'=>'uk-form-horizontal')); HTML::legend(array('value'=>$L->g('Website or Blog'))); - HTML::formInputRadio(array( + HTML::formSelect(array( 'name'=>'orderBy', - 'type'=>'radio', - 'label'=>$L->g('Website'), - 'value'=>'position', - 'class'=>'', - 'tip'=>'Select this option if you want to order your pages by position.' - )); - - HTML::formInputRadio(array( - 'name'=>'orderBy', - 'type'=>'radio', - 'label'=>$L->g('Blog'), - 'value'=>'date', - 'class'=>'' + 'label'=>$L->g('Order Pages By'), + 'options'=>array('date'=>'Date','position'=>'Position'), + 'selected'=>$Site->orderBy(), + 'class'=>'uk-width-1-3 uk-form-medium', + 'tip'=>$L->g('Order the pages by date to create a Blog or order the pages by position to create a Website') )); HTML::legend(array('value'=>$L->g('Email account settings'))); diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 01629432..b214177a 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -54,7 +54,7 @@ define('DB_PAGES', PATH_DATABASES.'pages.php'); define('DB_SITE', PATH_DATABASES.'site.php'); define('DB_CATEGORIES', PATH_DATABASES.'categories.php'); define('DB_TAGS', PATH_DATABASES.'tags.php'); -define('DB_NOTIFICATIONS', PATH_DATABASES.'notifications.php'); +define('DB_SYSLOG', PATH_DATABASES.'syslog.php'); // ADMIN URI FILTER define('ADMIN_URI_FILTER', '/admin/'); @@ -155,6 +155,7 @@ include(PATH_KERNEL.'dbtags.class.php'); include(PATH_KERNEL.'dblanguage.class.php'); include(PATH_KERNEL.'dbsite.class.php'); include(PATH_KERNEL.'dbcategories.class.php'); +include(PATH_KERNEL.'dbsyslog.class.php'); include(PATH_KERNEL.'page.class.php'); include(PATH_KERNEL.'user.class.php'); include(PATH_KERNEL.'url.class.php'); @@ -196,6 +197,7 @@ $Site = new dbSite(); $Url = new Url(); $Parsedown = new ParsedownExtra(); $Security = new Security(); +$Syslog = new dbSyslog(); // --- Relative paths --- // This paths are relative for the user / web browsing. @@ -275,8 +277,9 @@ $L = $Language; // --- CONSTANTS with dependency --- define('ORDER_BY', $Site->orderBy()); -$ADMIN_CONTROLLER = ''; // modified on bl-kernel/ +$ADMIN_CONTROLLER = ''; $ADMIN_VIEW = ''; +$ID_EXECUTION = uniqid(); // string 13 characters long // DEBUG: Print constants // $arr = array_filter(get_defined_constants(), 'is_string'); diff --git a/bl-kernel/dblanguage.class.php b/bl-kernel/dblanguage.class.php index 260de063..504bc492 100644 --- a/bl-kernel/dblanguage.class.php +++ b/bl-kernel/dblanguage.class.php @@ -33,6 +33,11 @@ class dbLanguage extends dbJSON unset($this->db['language-data']); } + public function exists($key) + { + return isset( $this->db[$key] ); + } + public function getCurrentLocale() { return $this->currentLocale; diff --git a/bl-kernel/dbnotifications.php b/bl-kernel/dbnotifications.php deleted file mode 100644 index 4f75c086..00000000 --- a/bl-kernel/dbnotifications.php +++ /dev/null @@ -1,211 +0,0 @@ - array('inFile'=>false, 'value'=>''), - 'date'=> array('inFile'=>false, 'value'=>''), - 'username'=> array('inFile'=>false, 'value'=>'') - ); - - function __construct() - { - parent::__construct(DB_NOTIFICATIONS); - } - - public function getUser($username) - { - $User = new User(); - - if($this->userExists($username)) - { - $User->setField('username', $username); - - foreach($this->db[$username] as $key=>$value) { - $User->setField($key, $value); - } - - return $User; - } - - return false; - } - - public function getAll() - { - return $this->db; - } - - // Return an array with the username databases, filtered by username. - public function getDb($username) - { - if($this->userExists($username)) - { - $user = $this->db[$username]; - - return $user; - } - - return false; - } - - // Return the username associated to an email, if the email does not exists return FALSE. - public function getByEmail($email) - { - foreach($this->db as $username=>$values) { - if($values['email']==$email) { - return $username; - } - } - - return false; - } - - // Return TRUE if the user exists, FALSE otherwise. - public function userExists($username) - { - return isset($this->db[$username]); - } - - public function generateTokenEmail($username) - { - // Random hash - $token = sha1(Text::randomText(SALT_LENGTH).time()); - $this->db[$username]['tokenEmail'] = $token; - - // Token time to live, defined by TOKEN_EMAIL_TTL - $this->db[$username]['tokenEmailTTL'] = Date::currentOffset(DB_DATE_FORMAT, TOKEN_EMAIL_TTL); - - // Save the database - if( $this->save() === false ) { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); - return false; - } - - return $token; - } - - public function setPassword($username, $password) - { - $salt = Text::randomText(SALT_LENGTH); - $hash = sha1($password.$salt); - - $args['username'] = $username; - $args['salt'] = $salt; - $args['password'] = $hash; - - return $this->set($args); - } - - // Disable the user - public function disableUser($username) - { - $args['username'] = $username; - $args['password'] = '!'; - - return $this->set($args); - } - - public function set($args) - { - $dataForDb = array(); - - $user = $this->getDb($args['username']); - - if($user===false) - { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the username '.$args['username']); - return false; - } - - // Verify arguments with the database fields. - foreach($args as $field=>$value) - { - if( isset($this->dbFields[$field]) ) - { - // Sanitize. - $tmpValue = Sanitize::html($value); - - // Set type. - settype($tmpValue, gettype($this->dbFields[$field]['value'])); - - $user[$field] = $tmpValue; - } - } - - // Save the database - $this->db[$args['username']] = $user; - if( $this->save() === false ) { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); - return false; - } - - return true; - } - - public function delete($username) - { - unset($this->db[$username]); - - if( $this->save() === false ) { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); - return false; - } - - return true; - } - - public function add($args) - { - $dataForDb = array(); - - // Verify arguments with the database fields. - foreach($this->dbFields as $field=>$options) - { - // If the user send the field. - if( isset($args[$field]) ) - { - // Sanitize if will be saved on database. - if( !$options['inFile'] ) { - $tmpValue = Sanitize::html($args[$field]); - } - else { - $tmpValue = $args[$field]; - } - } - // Uses a default value for the field. - else - { - $tmpValue = $options['value']; - } - - // Set type - settype($tmpValue, gettype($options['value'])); - - // Save on database - $dataForDb[$field] = $tmpValue; - } - - // Check if the user alredy exists. - if( $this->userExists($dataForDb['username']) ) { - return false; - } - - // Current date. - $dataForDb['registered'] = Date::current(DB_DATE_FORMAT); - - // Password - $dataForDb['salt'] = Text::randomText(SALT_LENGTH); - $dataForDb['password'] = sha1($dataForDb['password'].$dataForDb['salt']); - - // Save the database - $this->db[$dataForDb['username']] = $dataForDb; - if( $this->save() === false ) { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); - return false; - } - - return true; - } - -} \ No newline at end of file diff --git a/bl-kernel/dbsyslog.class.php b/bl-kernel/dbsyslog.class.php new file mode 100644 index 00000000..d671dfa2 --- /dev/null +++ b/bl-kernel/dbsyslog.class.php @@ -0,0 +1,44 @@ + array('inFile'=>false, 'value'=>''), + 'dictionaryKey'=> array('inFile'=>false, 'value'=>''), + 'notes'=> array('inFile'=>false, 'value'=>''), + 'username'=> array('inFile'=>false, 'value'=>''), + 'idExecution'=> array('inFile'=>false, 'value'=>''), + 'method'=> array('inFile'=>false, 'value'=>'') + ); + + function __construct() + { + parent::__construct(DB_SYSLOG); + } + + public function add($args) + { + global $Language; + + $data = array(); + $data['date'] = Date::current(DB_DATE_FORMAT); + $data['dictionaryKey'] = $args['dictionaryKey']; + $data['notes'] = Sanitize::html($args['notes']); + $data['idExecution'] = $GLOBALS['ID_EXECUTION']; + $data['method'] = $_SERVER['REQUEST_METHOD']; + + // Username + $data['username'] = Session::get('username'); + if( Text::isEmpty($data['username']) ) { + return false; + } + + // Insert at beggining of the database + array_unshift($this->db, $data); + + // Save + return $this->save(); + } + + +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/bg_BG.json b/bl-plugins/timemachine/languages/bg_BG.json deleted file mode 100644 index c12b1a39..00000000 --- a/bl-plugins/timemachine/languages/bg_BG.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "За мен", - "description": "Кратко описание за вашия сайт или за себе си." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/de_CH.json b/bl-plugins/timemachine/languages/de_CH.json deleted file mode 100644 index 45a153ce..00000000 --- a/bl-plugins/timemachine/languages/de_CH.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Über", - "description": "Kurzer Text über die Website oder zu dir." - } -} diff --git a/bl-plugins/timemachine/languages/de_DE.json b/bl-plugins/timemachine/languages/de_DE.json deleted file mode 100644 index a226255d..00000000 --- a/bl-plugins/timemachine/languages/de_DE.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Über", - "description": "Kurzer Text über die Website oder zu dir." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/en_US.json b/bl-plugins/timemachine/languages/en_US.json deleted file mode 100644 index 1bcab5c5..00000000 --- a/bl-plugins/timemachine/languages/en_US.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "About", - "description": "Little description about your site or yourself." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/es_AR.json b/bl-plugins/timemachine/languages/es_AR.json deleted file mode 100644 index 22b6a7dd..00000000 --- a/bl-plugins/timemachine/languages/es_AR.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Acerca de", - "description": "Breve descripción de ti mismo o sobre tu sitio." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/ja_JP.json b/bl-plugins/timemachine/languages/ja_JP.json deleted file mode 100644 index 353242d5..00000000 --- a/bl-plugins/timemachine/languages/ja_JP.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "About", - "description": "サイトやあなた自身についての概要を表示します。" - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/nl_NL.json b/bl-plugins/timemachine/languages/nl_NL.json deleted file mode 100644 index ac7332d4..00000000 --- a/bl-plugins/timemachine/languages/nl_NL.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Over mij", - "description": "Een korte beschrijving over je site of jezelf." - } -} diff --git a/bl-plugins/timemachine/languages/ru_RU.json b/bl-plugins/timemachine/languages/ru_RU.json deleted file mode 100644 index 9854c7f3..00000000 --- a/bl-plugins/timemachine/languages/ru_RU.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "О блоге", - "description": "Небольшое описание о вашем сайте или о себя." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/tr_TR.json b/bl-plugins/timemachine/languages/tr_TR.json deleted file mode 100644 index 9a256d61..00000000 --- a/bl-plugins/timemachine/languages/tr_TR.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Hakkında", - "description": "Senin veya siten hakkında kısa bilgiler" - } -} diff --git a/bl-plugins/timemachine/languages/uk_UA.json b/bl-plugins/timemachine/languages/uk_UA.json deleted file mode 100644 index 39cbf511..00000000 --- a/bl-plugins/timemachine/languages/uk_UA.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Про блог", - "description": "Невеликий опис вашого сайту або про Вас." - } -} \ No newline at end of file diff --git a/bl-plugins/timemachine/metadata.json b/bl-plugins/timemachine/metadata.json deleted file mode 100644 index 8801aa07..00000000 --- a/bl-plugins/timemachine/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Bludit", - "email": "", - "website": "https://plugins.bludit.com", - "version": "1.5.2", - "releaseDate": "2016-05-28", - "license": "MIT", - "compatible": "1.5.2", - "notes": "" -} diff --git a/bl-plugins/timemachine/plugin.php b/bl-plugins/timemachine/plugin.php deleted file mode 100644 index ffd27b9b..00000000 --- a/bl-plugins/timemachine/plugin.php +++ /dev/null @@ -1,21 +0,0 @@ -g('New page created'); - } - } - } -} diff --git a/install.php b/install.php index 7ed98d35..7ffc97c7 100644 --- a/install.php +++ b/install.php @@ -401,6 +401,19 @@ function install($adminPassword, $email, $timezone) file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); + // File syslog.php + $data = array( + array( + 'date'=>$currentDate, + 'dictionaryKey'=>'welcome-to-bludit', + 'username'=>'admin', + 'idExecution'=>uniqid(), + 'method'=>'POST' + )); + + file_put_contents(PATH_DATABASES.'syslog.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); + + // File security.php $randomKey = getRandomString(); $randomKey = sha1($randomKey); @@ -507,7 +520,7 @@ Content: - '.$Language->get('Read the documentation for more information').' - '.$Language->get('Share with your friends and enjoy'); - file_put_contents(PATH_POSTS.$welcomePageKey.DS.FILENAME, $data, LOCK_EX); + file_put_contents(PATH_PAGES.'welcome'.DS.FILENAME, $data, LOCK_EX); return true; }