From 43d09e40753625862cf2f30679cf9229c2bb4008 Mon Sep 17 00:00:00 2001 From: modusinternet Date: Fri, 15 Dec 2023 21:13:36 -0800 Subject: [PATCH] Updates mostly to /user/ templates. v0.7.9 --- ccms-setup-db.sql | 3 +- ccms-setup.php | 2 +- ccmslib/_default.php | 113 +++++- ccmstpl/examples/_css/header.html | 2 +- ccmstpl/examples/_js/footer-js.html | 16 +- ccmstpl/examples/_js/main.js | 12 +- ccmstpl/examples/_js/serviceworker-01.php | 186 +++++++++ ccmstpl/examples/_js/serviceworker-02.php | 86 ++++ ccmstpl/examples/_js/serviceworker.php | 83 +++- ccmstpl/examples/cookie-policy.html | 3 +- ccmstpl/examples/index.html | 3 +- ccmstpl/examples/manifest.php | 4 + ccmstpl/examples/offline.html | 3 +- ccmstpl/examples/page-1.html | 5 +- ccmstpl/examples/page-2.html | 5 +- ccmstpl/examples/page-3.html | 5 +- ccmsusr/_css/custodiancms.css | 122 +++++- ccmsusr/_css/head-css.html | 82 +--- ccmsusr/_js/custodiancms.js | 21 +- ccmsusr/_js/jquery-3.7.0.min.js | 2 + ccmsusr/admin/backup_restore/index.php | 82 ++++ ccmsusr/admin/blacklist/index.php | 82 ++++ ccmsusr/admin/blacklist_settings/index.php | 111 ------ ccmsusr/admin/github/index.php | 438 +++++++++++++-------- ccmsusr/admin/language_support/index.php | 121 +++--- ccmsusr/admin/other_controls/index.php | 82 ++++ ccmsusr/admin/user_privileges/index.php | 121 +++--- ccmsusr/authenticator.php | 5 + ccmsusr/body-head.php | 13 +- ccmsusr/content_groups/index.php | 210 +++------- ccmsusr/content_manager/index.php | 121 +++--- ccmsusr/dashboard/index.php | 59 +-- ccmsusr/dashboard/logs_delete.php | 11 + ccmsusr/header-body.php | 4 +- ccmsusr/index.php | 9 +- ccmsusr/login.php | 6 +- ccmsusr/user_profile/index.php | 24 +- composer.json | 2 +- index.php | 4 +- 39 files changed, 1412 insertions(+), 851 deletions(-) create mode 100644 ccmstpl/examples/_js/serviceworker-01.php create mode 100644 ccmstpl/examples/_js/serviceworker-02.php create mode 100644 ccmsusr/_js/jquery-3.7.0.min.js create mode 100644 ccmsusr/admin/backup_restore/index.php create mode 100644 ccmsusr/admin/blacklist/index.php delete mode 100644 ccmsusr/admin/blacklist_settings/index.php create mode 100644 ccmsusr/admin/other_controls/index.php diff --git a/ccms-setup-db.sql b/ccms-setup-db.sql index 279392f..6fee77d 100644 --- a/ccms-setup-db.sql +++ b/ccms-setup-db.sql @@ -61,8 +61,7 @@ INSERT INTO `ccms_headers` (`id`, `status`, `name`, `value`, `note`) VALUES (6, 1, 'X-UA-Compatible', 'IE=Edge', 'Use this to force IE to hide that annoying browser compatibility button in the address bar.
\nIE=edge means IE should use the latest (edge) version of its rendering engine.'), (7, 1, 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains', 'HSTS (HTTP Strict Transport Security) header to ensure all communication from a browser is sent over HTTPS (HTTP Secure).'), (8, 1, 'Referrer-Policy', 'strict-origin-when-cross-origin', 'Setting the referrer to \'strict-origin-when-cross-origin\' means, requests for resource hosted somewhere else, like a Content Delivery Network (CDN), don\'t include anything else in the URI other than the protocol and the domain name. ie: https://example.com'), -(9, 1, 'Expect-CT', 'enforce, max-age=43200', 'A new header still in experimental status is to instruct the browser to validate the connection with web servers for certificate transparency (CT). This project aims to fix some of the flaws in the SSL/TLS certificate system.
\nhttps://certificate.transparency.dev/
\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT
\nhttps://docs.report-uri.com/setup/ect/'), -(10, 1, 'Content-Security-Policy', 'base-uri \'none\'; connect-src \'self\' https: *.cloudfront.net *.doubleclick.net *.google.com *.googleapis.com *.googletagmanager.com *.google-analytics.com *.gstatic.com; form-action \'self\'; frame-ancestors \'self\'; img-src \'self\' data: https: *.cloudfront.net *.doubleclick.net *.gstatic.com *.google-analytics.com *.googleapis.com *.googleusercontent.com *.googletagmanager.com *.google.com *.gravatar.com; object-src \'none\'; worker-src \'self\'; script-src \'self\' https: \'nonce-{NONCE}\' \'strict-dynamic\' \'unsafe-inline\'{UNSAFE-EVAL}; script-src-attr \'nonce-{NONCE}\' \'strict-dynamic\';', ''); +(9, 1, 'Content-Security-Policy', 'base-uri \'none\'; connect-src \'self\' https: *.cloudfront.net *.doubleclick.net *.google.com *.googleapis.com *.googletagmanager.com *.google-analytics.com *.gstatic.com; form-action \'self\'; frame-ancestors \'self\'; img-src \'self\' data: https: *.cloudfront.net *.doubleclick.net *.gstatic.com *.google-analytics.com *.googleapis.com *.googleusercontent.com *.googletagmanager.com *.google.com *.gravatar.com; object-src \'none\'; worker-src \'self\'; script-src \'self\' https: \'nonce-{NONCE}\' \'strict-dynamic\' \'unsafe-inline\'{UNSAFE-EVAL}; script-src-attr \'nonce-{NONCE}\' \'strict-dynamic\';', ''); -- -------------------------------------------------------- diff --git a/ccms-setup.php b/ccms-setup.php index 5d6dffa..8e5160b 100644 --- a/ccms-setup.php +++ b/ccms-setup.php @@ -630,7 +630,7 @@ */ $options = ['cost' => 10]; $hash = password_hash($_REQUEST["password"], PASSWORD_BCRYPT, $options); - $priv = '{"dashboard":2,"admin":{"rw":1,"sub":{"blacklist_settings":2,"github":2,"language_support":2,"other_controls":2,"user_privileges":2}},"content_groups":1,"content_manager":{"rw":1,"sub":{"ar":2,"bn":2,"de":2,"de-at":2,"de-ch":2,"de-de":2,"de-li":2,"de-lu":2,"en":2,"en-au":2,"en-bz":2,"en-ca":2,"en-gb":2,"en-ie":2,"en-jm":2,"en-nz":2,"en-ph":2,"en-tt":2,"en-us":2,"en-za":2,"en-zw":2,"es":2,"es-ar":2,"es-bo":2,"es-cl":2,"es-co":2,"es-cr":2,"es-do":2,"es-ec":2,"es-es":2,"es-gt":2,"es-hn":2,"es-mx":2,"es-ni":2,"es-pa":2,"es-pe":2,"es-pr":2,"es-py":2,"es-sv":2,"es-uy":2,"es-ve":2,"fr":2,"fr-be":2,"fr-ca":2,"fr-ch":2,"fr-fr":2,"fr-lu":2,"fr-mc":2,"he":2,"hi":2,"ja":2,"ko":2,"ko-kp":2,"ko-kr":2,"ms":2,"nb-no":2,"pt":2,"ru":2,"vi":2,"zh":2,"zh-cn":2,"zh-tw":2}}}'; + $priv = '{"dashboard":2,"admin":{"rw":1,"sub":{"backup_restore":2,"blacklist":2,"github":2,"language_support":2,"other_controls":2,"user_privileges":2}},"content_groups":1,"content_manager":{"rw":1,"sub":{"ar":2,"bn":2,"de":2,"de-at":2,"de-ch":2,"de-de":2,"de-li":2,"de-lu":2,"en":2,"en-au":2,"en-bz":2,"en-ca":2,"en-gb":2,"en-ie":2,"en-jm":2,"en-nz":2,"en-ph":2,"en-tt":2,"en-us":2,"en-za":2,"en-zw":2,"es":2,"es-ar":2,"es-bo":2,"es-cl":2,"es-co":2,"es-cr":2,"es-do":2,"es-ec":2,"es-es":2,"es-gt":2,"es-hn":2,"es-mx":2,"es-ni":2,"es-pa":2,"es-pe":2,"es-pr":2,"es-py":2,"es-sv":2,"es-uy":2,"es-ve":2,"fr":2,"fr-be":2,"fr-ca":2,"fr-ch":2,"fr-fr":2,"fr-lu":2,"fr-mc":2,"he":2,"hi":2,"ja":2,"ko":2,"ko-kp":2,"ko-kr":2,"ms":2,"nb-no":2,"pt":2,"ru":2,"vi":2,"zh":2,"zh-cn":2,"zh-tw":2}}}'; $qry = $CFG["DBH"]->prepare("INSERT INTO `ccms_user` (`id`, `email`, `hash`, `status`, `alias`, `super`, `priv`, `firstname`, `lastname`, `position`, `phone1`, `phone2`, `facebook`, `skype`, `note`, `address1`, `address2`, `prov_state`, `country`, `post_zip`, `nav_toggle`, `2fa_secret`) VALUES (NULL, :email, :hash, '1', :alias, '1', :priv, '', '', '', '', '', '', '', '', '', '', '', '', '', '1', :2fa_secret);"); $qry->execute(array(':email' => $_REQUEST["email"], ':hash' => $hash, ':alias' => $_REQUEST["alias"], ':priv' => $priv, ':2fa_secret' => $_REQUEST["2fa_secret"])); } diff --git a/ccmslib/_default.php b/ccmslib/_default.php index 4fa5794..4d467d4 100644 --- a/ccmslib/_default.php +++ b/ccmslib/_default.php @@ -1,4 +1,78 @@ +
+ Language List: +
/user/" style="float:left" title="Dashboard"> diff --git a/ccmstpl/examples/_css/header.html b/ccmstpl/examples/_css/header.html index 28ffe5a..c5857ff 100644 --- a/ccmstpl/examples/_css/header.html +++ b/ccmstpl/examples/_css/header.html @@ -55,7 +55,7 @@ color:var(--cl1); background-color:var(--cl0); font:300 2.6rem/3.5rem "Open Sans",sans-serif; - opacity:0; + /*opacity:0;*/ padding:20px; } diff --git a/ccmstpl/examples/_js/footer-js.html b/ccmstpl/examples/_js/footer-js.html index 2315ec8..20f394a 100644 --- a/ccmstpl/examples/_js/footer-js.html +++ b/ccmstpl/examples/_js/footer-js.html @@ -1,6 +1,8 @@ if('serviceWorker' in navigator) { window.addEventListener('load', function() { - navigator.serviceWorker.register('/serviceworker.php',{scope:'/'}).then(function(registration) { + navigator.serviceWorker.register('/serviceworker.php',{ + scope:'/' + }).then(function(registration) { console.log('SW registered.'); }, function(err) { console.log('SW registration failed: ', err); @@ -15,3 +17,15 @@ }else if(window.attachEvent){ window.attachEvent("onload",loadJSResources); }else{window.onload=loadJSResources;} + +/* Loading Screen START */ +window.setTimeout(function(){ + document.getElementById("loading_svg").style.opacity="0"; + window.setTimeout(function(){ + document.getElementById("loading_svg").style.display="none"; + },500); +},500); +window.setTimeout(function(){ + document.getElementsByTagName("body")[0].style.opacity="1"; +},100); +/* Loading Screen END */ diff --git a/ccmstpl/examples/_js/main.js b/ccmstpl/examples/_js/main.js index 51df463..06d32c2 100644 --- a/ccmstpl/examples/_js/main.js +++ b/ccmstpl/examples/_js/main.js @@ -1,4 +1,4 @@ -/* Loading Screen START */ +/* Loading Screen START window.setTimeout(function(){ document.getElementById("loading_svg").style.opacity="0"; window.setTimeout(function(){ @@ -8,21 +8,17 @@ window.setTimeout(function(){ window.setTimeout(function(){ document.getElementsByTagName("body")[0].style.opacity="1"; },250); -/* Loading Screen END */ +Loading Screen END */ /* Active link selector START */ try{ - activeArray_01.forEach(function(id){ - var element = document.getElementById(id); - element.classList.add("active"); - }) - activeArray_02.forEach(function(id){ + activeArray.forEach(function(id){ var element = document.getElementById(id); element.classList.add("active"); }) }catch(e){ - /*console.log(e);*/ + console.log(e); } /* Active link selector END */ diff --git a/ccmstpl/examples/_js/serviceworker-01.php b/ccmstpl/examples/_js/serviceworker-01.php new file mode 100644 index 0000000..958126a --- /dev/null +++ b/ccmstpl/examples/_js/serviceworker-01.php @@ -0,0 +1,186 @@ +/* In order to get the listed resources below to load properly once moved to Amazon's CloudFront servers you need to add this to your S3 bucket, under Permissions/CORS configuration: + +< ?xml version="1.0" encoding="UTF-8"?> + + + https://PUTYOURDOMAINNAMEHERE.com + GET + 3000 + Authorization + + + + +Then you need to select the appropriate distribution under CloudFront and click the Behaviors tab. Create or Edit an existing Behavior and select the following settings: + +Allowed HTTP Methods: GET, HEAD, OPTIONS + +Enable 'Cached HTTP Methods': GET, HEAD and OPTIONS +NOTE: THIS IS A MAYBE, I HAVE TO LEARN MORE ABOUT THIS Setting + +Cache Based on Selected Request Headers: Whitelist +Add these to the right box under Whitelist Headers, add as custom if necessary: + Access-Control-Allow-Origin + Access-Control-Request-Headers + Access-Control-Request-Method + Origin + +Then click the 'Yes, Edit' button at the bottom and give it about 10 minutes to propagate through the system and test using Chrome. +*/ + +const cacheName = '2023-06-20.v3'; + +/* Point this array item to your own 'offline' template if you plan on removing the 'examples' folder in your own development. */ +var cacheFiles = [ +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/offline.html', +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/manifest.php' +]; + +/* +Analytics and Service Worker: +https://developers.google.com/web/ilt/pwa/integrating-analytics#analytics_and_service_worker +self.importScripts('/ccmstpl/examples/_js/analytics-helper.js'); + +Important resources used in the assembly of this services code: +https://googlechrome.github.io/samples/service-worker/custom-offline-page/ +https://developers.google.com/web/updates/2017/02/navigation-preload +*/ + +self.addEventListener('install',(event) => { + event.waitUntil((async() => { + const cache = await caches.open(cacheName).then(cache => { + return cache.addAll(cacheFiles); + }) + })()); +}); + + +self.addEventListener('activate',(event) => { + event.waitUntil((async() => { + caches.keys().then(keyList => { + return Promise.all(keyList.map(key => { + if(key !== cacheName) return caches.delete(key); + })); + }) + })()); +}); + + +self.addEventListener('fetch',(event) => { + console.log('SW fetch event.', event.request.method, event.request.url); + /* + This example demonstrates how to avoid doing a serviceWorker cache of templates if they are coming from WordPress folders, Google RECAPTCHA or the CustodianCMS 'user' folder/admin. + if(!/\/wp\-(.*)|\/recaptcha\/|(\/(([a-z]{2,3})(-[a-z0-9]{2,3})?)\/user\/)/i.test(event.request.url)) { + */ + if(!/\/recaptcha\/|(\/(([a-z]{2,3})(-[a-z0-9]{2,3})?)\/user\/)/i.test(event.request.url)){ + event.respondWith( + caches.open(cacheName).then(cache => { + return cache.match(event.request).then(response => { + /* + Go here to learn more about cors: + https://jakearchibald.com/2015/thats-so-fetch/#no-cors-and-opaque-responses + or + https://developers.google.com/web/fundamentals/primers/service-workers/#non-cors_fail_by_default + const fetchResponse = await fetch(event.request, {mode:'cors'}); + const fetchResponse = await fetch(event.request, {mode:'no-cors'}); + const fetchResponse = await fetch(event.request, {mode:'immutable'}); + */ + const fetchPromise = fetch(event.request).then(networkResponse => { + /* Makesure never to cache a failed page call. */ + if(networkResponse.status === 404) { + return networkResponse; + } + cache.put(event.request, networkResponse.clone()); + return networkResponse; + }); + return response || fetchPromise; + }).catch(function() { + /* The template being called was not found in cache and there is no internet connection at the moment so display the offline page instead. The code below makes sure we're dispalying the appropriate offline template for the language that's currently selected by the client. */ + const regex = /\/(([a-z]{2,3})(-[a-z0-9]{2,3})?)\//i; + const lng = event.request.url.match(regex); + const searchForThis = '/' + lng[1] + '/examples/offline.html'; + return caches.match(searchForThis); + }) + }) + ); + } else { + /* This request appears to be for a Google RECAPTCHA URL or the CustodianCMS '/user/' dir, so don't cache it. Keep it fresh and always comming from the source. */ + event.respondWith(fetch(event.request)); + } +}); + + + + + + + + + + + +/* +// On fetch, use cache but update the entry with the latest contents +// from the server. +self.addEventListener('fetch', function(e) { + console.log('The service worker is serving the asset.'); + // You can use `respondWith()` to answer ASAP... + e.respondWith(fromCache(e.request)); + // ...and `waitUntil()` to prevent the worker to be killed until + // the cache is updated. + e.waitUntil( + update(e.request) + // Finally, send a message to the client to inform it about the + // resource is up to date. + .then(refresh) + ); +}); + + +// Open the cache where the assets were stored and search for the requested +// resource. Notice that in case of no matching, the promise still resolves +// but it does with `undefined` as value. +function fromCache(request) { + return caches.open(cacheName).then(function (cache) { + return cache.match(request); + }); +} + + +// Update consists in opening the cache, performing a network request and +// storing the new response data. +function update(request) { + return caches.open(cacheName).then(function (cache) { + return fetch(request).then(function (response) { + return cache.put(request, response.clone()).then(function () { + return response; + }); + }); + }); +} + + +// Sends a message to the clients. +function refresh(response) { + return self.clients.matchAll().then(function (clients) { + clients.forEach(function (client) { + // Encode which resource has been updated. By including the + // [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) the client can + // check if the content has changed. + var message = { + type: 'refresh', + url: response.url, + // Notice not all servers return the ETag header. If this is not + // provided you should use other cache headers or rely on your own + // means to check if the content has changed. + eTag: response.headers.get('ETag') + }; + // Tell the client about the update. + client.postMessage(JSON.stringify(message)); + }); + }); +} +*/ diff --git a/ccmstpl/examples/_js/serviceworker-02.php b/ccmstpl/examples/_js/serviceworker-02.php new file mode 100644 index 0000000..f00ee9c --- /dev/null +++ b/ccmstpl/examples/_js/serviceworker-02.php @@ -0,0 +1,86 @@ + + +const cacheName = '2023-06-20.v4'; + +/* Point this array item to your own 'offline' template if you plan on removing the 'examples' folder in your own development. */ +var cacheFiles = [ +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/offline.html', +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/manifest.php' +]; + +/* +Analytics and Service Worker: +https://developers.google.com/web/ilt/pwa/integrating-analytics#analytics_and_service_worker +self.importScripts('/ccmstpl/examples/_js/analytics-helper.js'); + +Important resources used in the assembly of this services code: +https://googlechrome.github.io/samples/service-worker/custom-offline-page/ +https://developers.google.com/web/updates/2017/02/navigation-preload +*/ + +self.addEventListener('install',(event) => { + event.waitUntil((async() => { + const cache = await caches.open(cacheName).then(cache => { + return cache.addAll(cacheFiles); + }) + })()); +}); + + +self.addEventListener('activate',(event) => { + event.waitUntil((async() => { + caches.keys().then(keyList => { + return Promise.all(keyList.map(key => { + if(key !== cacheName) return caches.delete(key); + })); + }) + })()); +}); + + +/* +Cache, update and refresh +Another twist on the previous strategy, now with a refreshing ingredient. +With cache, update and refresh the client will be notified by the service worker once new content is available. This way your site can show content without waiting for the network responses, while providing the UI with the means to display up-to-date content in a controlled way. +*/ + +self.addEventListener('fetch', function(evt) { + console.log('SW fetch evt.', evt.request.method, evt.request.url); + evt.respondWith(fromCache(evt.request)); + evt.waitUntil( + update(evt.request) + .then(refresh) + ); +}); + +function fromCache(request) { + return caches.open(cacheName).then(function (cache) { + return cache.match(request).then(function (matching) { + return matching || Promise.reject('no-match'); + }); + }); +} + +function update(request) { + return caches.open(cacheName).then(function (cache) { + return fetch(request).then(function (response) { + return cache.put(request, response); + }); + }); +} + +function refresh(response) { + return self.clients.matchAll().then(function (clients) { + clients.forEach(function (client) { + var message = { + type: 'refresh', + url: response.url, + eTag: response.headers.get('ETag') + }; + client.postMessage(JSON.stringify(message)); + }); + }); +} diff --git a/ccmstpl/examples/_js/serviceworker.php b/ccmstpl/examples/_js/serviceworker.php index 0065fa9..8782284 100644 --- a/ccmstpl/examples/_js/serviceworker.php +++ b/ccmstpl/examples/_js/serviceworker.php @@ -31,11 +31,12 @@ Then click the 'Yes, Edit' button at the bottom and give it about 10 minutes to propagate through the system and test using Chrome. */ -const cacheName = '2021-12-02.v1'; +const cacheName = '2023-07-07.v3'; /* Point this array item to your own 'offline' template if you plan on removing the 'examples' folder in your own development. */ var cacheFiles = [ -'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/offline.html' +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/offline.html', +'/{CCMS_LIB:_default.php;FUNC:ccms_lng}/examples/manifest.php' ]; /* @@ -87,15 +88,18 @@ const fetchResponse = await fetch(event.request, {mode:'no-cors'}); const fetchResponse = await fetch(event.request, {mode:'immutable'}); */ + const fetchPromise = fetch(event.request).then(networkResponse => { - /* Makesure never to cache a failed page call. */ + // Makesure never to cache a failed page call. if(networkResponse.status === 404) { return networkResponse; } cache.put(event.request, networkResponse.clone()); return networkResponse; }); + return response || fetchPromise; + }).catch(function() { /* The template being called was not found in cache and there is no internet connection at the moment so display the offline page instead. The code below makes sure we're dispalying the appropriate offline template for the language that's currently selected by the client. */ const regex = /\/(([a-z]{2,3})(-[a-z0-9]{2,3})?)\//i; @@ -110,3 +114,76 @@ event.respondWith(fetch(event.request)); } }); + + + + + + + + + + + +/* +// On fetch, use cache but update the entry with the latest contents +// from the server. +self.addEventListener('fetch', function(e) { + console.log('The service worker is serving the asset.'); + // You can use `respondWith()` to answer ASAP... + e.respondWith(fromCache(e.request)); + // ...and `waitUntil()` to prevent the worker to be killed until + // the cache is updated. + e.waitUntil( + update(e.request) + // Finally, send a message to the client to inform it about the + // resource is up to date. + .then(refresh) + ); +}); + + +// Open the cache where the assets were stored and search for the requested +// resource. Notice that in case of no matching, the promise still resolves +// but it does with `undefined` as value. +function fromCache(request) { + return caches.open(cacheName).then(function (cache) { + return cache.match(request); + }); +} + + +// Update consists in opening the cache, performing a network request and +// storing the new response data. +function update(request) { + return caches.open(cacheName).then(function (cache) { + return fetch(request).then(function (response) { + return cache.put(request, response.clone()).then(function () { + return response; + }); + }); + }); +} + + +// Sends a message to the clients. +function refresh(response) { + return self.clients.matchAll().then(function (clients) { + clients.forEach(function (client) { + // Encode which resource has been updated. By including the + // [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) the client can + // check if the content has changed. + var message = { + type: 'refresh', + url: response.url, + // Notice not all servers return the ETag header. If this is not + // provided you should use other cache headers or rely on your own + // means to check if the content has changed. + eTag: response.headers.get('ETag') + }; + // Tell the client about the update. + client.postMessage(JSON.stringify(message)); + }); + }); +} +*/ diff --git a/ccmstpl/examples/cookie-policy.html b/ccmstpl/examples/cookie-policy.html index fb5657c..d379f56 100644 --- a/ccmstpl/examples/cookie-policy.html +++ b/ccmstpl/examples/cookie-policy.html @@ -43,8 +43,7 @@ {CCMS_TPL:/examples/_css/header.html} diff --git a/ccmstpl/examples/index.html b/ccmstpl/examples/index.html index 7113f0b..dcf74c2 100644 --- a/ccmstpl/examples/index.html +++ b/ccmstpl/examples/index.html @@ -43,8 +43,7 @@ {CCMS_TPL:/examples/_css/header.html} diff --git a/ccmstpl/examples/manifest.php b/ccmstpl/examples/manifest.php index 1fbe6c9..e60096c 100644 --- a/ccmstpl/examples/manifest.php +++ b/ccmstpl/examples/manifest.php @@ -26,6 +26,10 @@ "sizes": "96x96", "type": "image/png", "purpose": "maskable" + },{ + "src": "/ccmstpl/examples/_img/ico/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image/png" },{ "src": "/ccmstpl/examples/_img/ico/android-chrome-144x144.png", "sizes": "144x144", diff --git a/ccmstpl/examples/offline.html b/ccmstpl/examples/offline.html index 15b9b32..3865b73 100644 --- a/ccmstpl/examples/offline.html +++ b/ccmstpl/examples/offline.html @@ -54,8 +54,7 @@ } diff --git a/ccmstpl/examples/page-1.html b/ccmstpl/examples/page-1.html index 00b0f58..0c30c8b 100644 --- a/ccmstpl/examples/page-1.html +++ b/ccmstpl/examples/page-1.html @@ -43,8 +43,7 @@ {CCMS_TPL:/examples/_css/header.html} @@ -81,7 +80,7 @@ function loadJSResources(){ loadFirst("{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_link("","","JS-01","","")}",function(){ - + }{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_sri("","JS-01")}); } diff --git a/ccmstpl/examples/page-2.html b/ccmstpl/examples/page-2.html index caf7253..c5ed0f0 100644 --- a/ccmstpl/examples/page-2.html +++ b/ccmstpl/examples/page-2.html @@ -43,8 +43,7 @@ {CCMS_TPL:/examples/_css/header.html} @@ -81,7 +80,7 @@ function loadJSResources(){ loadFirst("{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_link("","","JS-01","","")}",function(){ - + }{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_sri("","JS-01")}); } diff --git a/ccmstpl/examples/page-3.html b/ccmstpl/examples/page-3.html index 9e1c286..04939a5 100644 --- a/ccmstpl/examples/page-3.html +++ b/ccmstpl/examples/page-3.html @@ -43,8 +43,7 @@ {CCMS_TPL:/examples/_css/header.html} @@ -81,7 +80,7 @@ function loadJSResources(){ loadFirst("{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_link("","","JS-01","","")}",function(){ - + }{CCMS_LIB:examples/xyzzy.php;FUNC:example_build_js_sri("","JS-01")}); } diff --git a/ccmsusr/_css/custodiancms.css b/ccmsusr/_css/custodiancms.css index 2fabfc0..98ff22a 100644 --- a/ccmsusr/_css/custodiancms.css +++ b/ccmsusr/_css/custodiancms.css @@ -40,12 +40,19 @@ button{ border-radius:5px; color:var(--cl0); font:unset; - padding:0.5em; - /*width:100%*/ + padding:0.5em } button:hover{background-color:var(--cl3)} +code{ + background-color:#f1f1f1; + color:var(--cl3); + font-family:Consolas,"courier new"; + font-weight:normal; + padding:2px +} + form{padding-bottom:10px} h1,h2,h3,h4,h5,h6{ @@ -156,8 +163,6 @@ p{margin:0 0 20px} .ccms_msg.active.success{background-color:var(--cl3)} .logo{ - /*filter:drop-shadow(5px 5px 5px rgba(10,37,64,.5)); - filter:drop-shadow(1px 1px rgba(0,0,0,.6));*/ filter:drop-shadow(2px 2px 4px rgba(0,0,0,.2)); -webkit-transition:all 1.0s ease-in-out; -moz-transition:all 1.0s ease-in-out; @@ -242,6 +247,66 @@ p{margin:0 0 20px} /* metisMenu START */ +/* ANIMATION KEYFRAMES */ +@keyframes rotate-top-bar{ + 40%{transform:translateY(0)} + 100%{transform:translateY(0) rotate(45deg)} +} + +@keyframes rotate-bottom-bar { + 40%{transform:translateY(0)} + 100%{transform: translateY(0) rotate(-45deg)} +} + +@keyframes rotate-top-bar-2 { + 40%{transform:translateY(0)} + 100%{transform:translateY(0) rotate(45deg)} +} + +@keyframes rotate-bottom-bar-2 { + 40%{transform:translateY(0)} + 100%{transform:translateY(0) rotate(-45deg)} +} + +.crossed{background:var(--cl1)} + +.dropped{ + display:block!important; + transition:0.4s all ease-in +} + +.menu-bars{ + background:var(--cl4); + height:4px; + list-style:none; + margin:0 7px; + position:relative; + top:18px; + transition:0.4s all ease-in; + width:30px +} + +.menu-bars::after{transform:translateY(10px)} + +.menu-bars::before{transform:translateY(-10px)} + +.menu-bars::after,.menu-bars::before{ + background:var(--cl4); + content:''; + height:4px; + list-style:none; + position:absolute; + width:30px +} + +.crossed::after{animation:rotate-bottom-bar 0.4s forwards} + +.crossed::before{animation:rotate-top-bar 0.4s forwards} + +.hamburger::after{animation:rotate-bottom-bar-2 0.4s reverse} + +.hamburger::before{animation:rotate-top-bar-2 0.4s reverse} + .sidebar-nav{background-color:var(--cl4)} .sidebar-nav ul{ @@ -288,6 +353,22 @@ p{margin:0 0 20px} flex-direction:column; position:relative } + +#menu-cnt svg{ + position:relative; + top:5px; + width:30px +} + +#menu-ctn { + cursor:pointer; + filter:drop-shadow(2px 2px 4px rgba(0,0,0,.2)); + position:fixed; + right:18px; + top:25px +} + +#menu-cnt a>svg>path{fill:var(--cl0)} /* metisMenu END */ @@ -317,10 +398,10 @@ p{margin:0 0 20px} } .dropdown-content a { - color:var(--cl0); - padding:12px 16px; - text-decoration:none; - display:block; + color:var(--cl0); + padding:12px 16px; + text-decoration:none; + display:block; transition:all .3s ease-out } @@ -329,6 +410,31 @@ p{margin:0 0 20px} .dropdown-content a:hover{background-color:var(--cl3)} .show{display:block;} + + +#user_dropdown{ + position:fixed; + right:80px +} + +#user_dropdown_btn{ + cursor:pointer; + background-color:unset; + border:none; + padding:unset +} + +#user_dropdown_btn>svg>*{pointer-events:none} + +#user_dropdown_list a>svg{ + position:relative; + top:5px; + width:30px +} + +#user_dropdown_list a>svg>path{fill:var(--cl0)} + + /* w3school dropdown END */ diff --git a/ccmsusr/_css/head-css.html b/ccmsusr/_css/head-css.html index 65df1d8..d2783c9 100644 --- a/ccmsusr/_css/head-css.html +++ b/ccmsusr/_css/head-css.html @@ -33,7 +33,7 @@ background-color:var(--cl1); font:600 2.2rem/3.3rem "Open Sans",sans-serif; padding:20px; - -webkit-font-smoothing:antialiased; + -webkit-font-smoothing:antialiased } main{ @@ -43,45 +43,6 @@ } /* metisMenu START */ -.crossed{background:var(--cl1)} - -.dropped{ - display:block!important; - transition:0.4s all ease-in -} - -.menu-bars{ - background:var(--cl4); - height:4px; - list-style:none; - margin:0 7px; - position:relative; - top:18px; - transition:0.4s all ease-in; - width:30px -} - -.menu-bars::after{transform:translateY(10px)} - -.menu-bars::before{transform:translateY(-10px)} - -.menu-bars::after,.menu-bars::before{ - background:var(--cl4); - content:''; - height:4px; - list-style:none; - position:absolute; - width:30px -} - -.crossed::after{animation:rotate-bottom-bar 0.4s forwards} - -.crossed::before{animation:rotate-top-bar 0.4s forwards} - -.hamburger::after{animation:rotate-bottom-bar-2 0.4s reverse} - -.hamburger::before{animation:rotate-top-bar-2 0.4s reverse} - #menu-cnt{ box-shadow:2px 3px 10px 0 rgba(0,0,0,0.2); display:none; @@ -91,46 +52,9 @@ position:fixed; top:100px } - -#menu-cnt svg{ - position:relative; - top:5px; - width:30px -} - -#menu-ctn { - cursor:pointer; - filter:drop-shadow(2px 2px 4px rgba(0,0,0,.2)); - position:fixed; - right:18px; - top:25px -} - -#menu-cnt a>svg>path{fill:var(--cl0)} - -/* ANIMATION KEYFRAMES */ -@keyframes rotate-top-bar{ - 40%{transform:translateY(0)} - 100%{transform:translateY(0) rotate(45deg)} -} - -@keyframes rotate-bottom-bar { - 40%{transform:translateY(0)} - 100%{transform: translateY(0) rotate(-45deg)} -} - -@keyframes rotate-top-bar-2 { - 40%{transform:translateY(0)} - 100%{transform:translateY(0) rotate(45deg)} -} - -@keyframes rotate-bottom-bar-2 { - 40%{transform:translateY(0)} - 100%{transform:translateY(0) rotate(-45deg)} -} /* metisMenu END */ -/* Simple Dropdown Nav START */ +/* Simple Dropdown Nav START #user_dropdown{ position:fixed; right:80px @@ -152,7 +76,7 @@ } #user_dropdown_list a>svg>path{fill:var(--cl0)} -/* Simple Dropdown Nav END */ +Simple Dropdown Nav END */ #loading_svg{ background-image:url('data:image/svg+xml;utf8,'); diff --git a/ccmsusr/_js/custodiancms.js b/ccmsusr/_js/custodiancms.js index 2e3bc11..db52000 100644 --- a/ccmsusr/_js/custodiancms.js +++ b/ccmsusr/_js/custodiancms.js @@ -43,19 +43,38 @@ $(() => { }); $("#menu1").metisMenu(); +/* navActiveSub.forEach(function(nl){$("#"+nl).addClass("mm-active");}); navActiveSub.forEach(function(nl){$("#"+nl+">a").attr("aria-expanded","true");}); navActiveSub.forEach(function(nl){$("#"+nl+">a").addClass("active");}); navActiveSub.forEach(function(nl){$("#"+nl+">ul").addClass("mm-show");}); +*/ navActiveItem.forEach(function(nl){$("#"+nl+">a").addClass("active");}); /* metisMenu END */ /* w3schoolMenu START */ -navActiveW3schoolsItem.forEach(function(nl){$("#"+nl).addClass("active");}); +if(typeof navActiveW3schoolsItem !== 'undefined' && navActiveW3schoolsItem.length !== 0) { + navActiveW3schoolsItem.forEach(function(nl){$("#"+nl).addClass("active");}); +} /* w3schoolMenu END */ +/* user_dropdown START */ +/* When the user clicks on the svg button add the 'show' class to the dropdown box below it. */ +$("#user_dropdown_btn").click(function() { + $("#user_dropdown_list").addClass("show"); +}); + +/* Hide dropdown menu on click outside */ +$(document).on("click", function(e){ + if(!$(e.target).closest("#user_dropdown_btn").length){ + $("#user_dropdown_list").removeClass("show"); + } +}); +/* user_dropdown END */ + + /* Fetch Cache BEGIN */ const cachedFetch = (url, options) => { let expiry = 5 * 60; // 5 min default diff --git a/ccmsusr/_js/jquery-3.7.0.min.js b/ccmsusr/_js/jquery-3.7.0.min.js new file mode 100644 index 0000000..e7e29d5 --- /dev/null +++ b/ccmsusr/_js/jquery-3.7.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.0",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},R=function(){V()},M=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&z(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function X(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&M(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function U(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function z(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",R),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Me(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return R(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return R(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0 + + + <?= $_SERVER["SERVER_NAME"];?> | User | Admin | Backup - Restore + {CCMS_TPL:head-meta.html} + + + + +
+

Admin | Backup - Restore

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

+ + + + {CCMS_TPL:/footer.html} +
+ + {CCMS_TPL:/body-head.php} + + + diff --git a/ccmsusr/admin/blacklist/index.php b/ccmsusr/admin/blacklist/index.php new file mode 100644 index 0000000..edf72b7 --- /dev/null +++ b/ccmsusr/admin/blacklist/index.php @@ -0,0 +1,82 @@ + + + + <?= $_SERVER["SERVER_NAME"];?> | User | Admin | Blacklist + {CCMS_TPL:head-meta.html} + + + + +
+

Admin | Blacklist

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

+ + + + {CCMS_TPL:/footer.html} +
+ + {CCMS_TPL:/body-head.php} + + + diff --git a/ccmsusr/admin/blacklist_settings/index.php b/ccmsusr/admin/blacklist_settings/index.php deleted file mode 100644 index e54cb02..0000000 --- a/ccmsusr/admin/blacklist_settings/index.php +++ /dev/null @@ -1,111 +0,0 @@ - - - - - Blacklist Settings - - {CCMS_TPL:header-head.html} - - - -
- {CCMS_TPL:header-body.php} - - -
-
-
-

Blacklist Settings

-
-
- Notice -
-
-

This section of the Custodian CMS admin is currently under development.

-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec ligula id nisl fringilla finibus. Vestibulum rhoncus, felis at fringilla ullamcorper, ante mi tincidunt nunc, ac ultrices odio odio vitae lorem. Morbi quis elit id urna efficitur aliquam ut et sapien. Fusce porttitor vel ligula faucibus tempor. Pellentesque tincidunt imperdiet enim, id lobortis ipsum tempus id. In facilisis elementum dictum. Donec suscipit ornare tortor, sed volutpat mauris volutpat at. Pellentesque porttitor ut augue at ultrices. Proin egestas semper lorem quis suscipit. Vivamus eget magna tincidunt, semper sem eu, molestie quam. Praesent nisl velit, ultricies ac malesuada id, dapibus in dui. Mauris luctus velit non mi condimentum rhoncus. Nullam sit amet aliquet turpis, id malesuada nulla. Ut sit amet nisl nec ante commodo eleifend. - - -
-
-
-
- - - - diff --git a/ccmsusr/admin/github/index.php b/ccmsusr/admin/github/index.php index 722eb01..6c4355a 100644 --- a/ccmsusr/admin/github/index.php +++ b/ccmsusr/admin/github/index.php @@ -2,7 +2,7 @@ header("Content-Type: text/html; charset=UTF-8"); header("Expires: on, 01 Jan 1970 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); -header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @@ -11,6 +11,13 @@ die(); } +/* Confirm privilages to access this page. */ +$json_a = json_decode($_SESSION["PRIV"], true); +if(($json_a["admin"]["sub"]["github"] ?? null) < 1) { + echo "Access denied."; + die(); +} + $msg = array(); // Test to see if shell_exce() is disabled. @@ -58,191 +65,290 @@ } } ?> - + - - GitHub - - {CCMS_TPL:/head-meta.html} - + <?= $_SERVER["SERVER_NAME"];?> | User | GitHub + {CCMS_TPL:head-meta.html} + + -
- {CCMS_TPL:/header-body.php} -
-

GitHub

-

GitHub is the premier tool used by website and software engineers to collaborate and synchronize more than 85 million repositories and projects around the world. Basically, if your work involves distributing anything through the internet or collaborating with anyone other than yourself, you need to consider setting up an account on GitHub.

- +
+

Admin | GitHub

+

GitHub is the premier tool used by website developers and software engineers to collaborate on more than 100 million repositories and projects around the world.

+ +
+ + + +
- -
-
+ + + +
-
-
Error
-
-

Unable to call shell_exce(). Confirm your account has access to this function with your administrator before continuing.

-
-
+

Unable to call shell_exce(). Confirm your account has access to this function with your administrator before continuing.

-
-
Error
-
-

.git is either NOT installed or you do not have access to git from this account. Confirm with your administrator before continuing.

-
-
-
+

.git is either NOT installed or you do not have access to git from this account. Confirm with your administrator before continuing.

+
+ +

git status

+ +

No .git repository setup in this directory or any of it's parent directories yet. Click here to learn more about how to set up and connect this website to your own GitHub repository.

+
fatal: not a git repository (or any of the parent directories): .git
+ +

There is something wrong with this repository, you might need to access it from the command-line and run add/commit/push manunally to fix it.

+
+

(Easier to read file list, remember all files listed are located relative to the document root of your website.)

+
+

Note: Pushing from your server to a GitHub repository is not recommended for security reasons which is why it is not an automated feature in Custodian CMS. Use the two commands below if needed.

+

+ git commit -am "from server"
+ git push +

+

Note: Or, if all you want to do is overwrite a single file on your server with what's currently on the GitHub repo you can try the following command. (NOTE: You may need to navigate into the dir that contains the file you want to overwrite first.)

+

+ git checkout origin/master -- {filename}
+ git checkout -- .htaccess
+ git checkout origin/main -- ccmstpl/examples/index.html +

-

git status

- -
-
Error
-
-

No .git repository setup in this directory or any of it's parent directories yet. Click here to learn more about how to set up and connect this website to your own GitHub repository.

-
fatal: not a git repository (or any of the parent directories): .git
-
-
- -
-
Warning
-
-

There is something wrong with this repository, you might need to access it from the command-line and run add/commit/push manunally to fix it.

-
-

(Easier to read file list, remember all files listed are located relative to the document root of your website.)

-
-

Note: Pushing from your server to a GitHub repository is not recommended for security reasons which is why it is not an automated feature in Custodian CMS. Use the two commands below if needed.

-

- git commit -am "from server"
- git push -

-

- Note: Or, if all you want to do is overwrite a single file on your server with what's currently on the GitHub repo you can try the following command. (NOTE: You may need to navigate into the dir that contains the file you want to overwrite first.) -

-

- git checkout origin/master -- {filename}
- git checkout -- .htaccess
- git checkout origin/main -- ccmstpl/examples/index.html -

-
-
- -
-
Success
-
-
-
-
+

Success

+
-
- -
-

git --version

-
-

git config --list

-
-

.gitignore

- -
- -
.gitignore not found.
- -
+
+ + + + +
+

git --version

+
+

git config --list

+
+

.gitignore

+ +
+ +
.gitignore not found.
-
-

Listed below are the basic setup details to connect your website to a GitHub repository. For more information about how to setup and maintain Git on your server visit https://git-scm.com/docs.

-

Repository and Webserver Setup

-
    -
  1. Create a new repository at GitHub. (https://github.com)
  2. -
  3. Add your web servers public ssh-key (id_rsa.pub) to your GitHub account under "Settings/SSH and GPG keys". (Follow instructions here to generate a new ssh-key if needed: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
  4. -
  5. Add a webhook on GitHub under "Settings/Webhooks": https:///ccmsusr/github/webhook.php
  6. -
  7. Create a new website folder on your server. (You must have access to shell, ssh and git services.)
  8. -
-

Copy Custondian CMS Templates to Webserver

-

You can download the latest master version of the Custodian CMS templates from GitHub directly or use the Custodian CMS Download. If you prefer SSH, log into your server and type the following on the command-line.

-
    -
  1. git clone --depth=1 https://github.com/modusinternet/Custodian-CMS.git /tmp/Custodian-CMS
  2. -
  3. rm -rf /tmp/Custodian-CMS/.git
  4. -
  5. shopt -s dotglob
  6. -
  7. cp -r /tmp/Custodian-CMS/* /THE_PATH_TO_YOUR_WEBSITES_DOCUMMENT_ROOT
  8. -
  9. rm -rf /tmp/Custodian-CMS
  10. -
-

Initialize git on the Webserver

-

Once you've finished moving a copy of the Custodian CMS templates into place initialize git at the document root of the website and connect it to your GitHub repository.

-
    -
  1. Test your connection to the GitHub servers via ssh:
    - ssh -T git@github.com
    - If successful, type the following commands:
  2. -
  3. git init
  4. -
  5. git add .
  6. -
  7. git config --global user.email "noreply@"
  8. -
  9. git config --global user.name "YOUR_NAME"
  10. -
  11. git commit -m "first commit"
  12. -
  13. git remote add origin git@github.com:YOUR_ACCOUNT_ON_GITHUB/YOUR_REPO_ON_GITHUB.git
  14. -
  15. git push -u origin master
  16. -
-

Install Local Software

-
    -
  1. Check GitHub to see if all the files on your web server have been copied over.
  2. -
  3. Install GitHub Desktop (https://desktop.github.com) on your PC and File/Clone Repository to somewhere on your computer.
  4. -
  5. Install the Atom editor (https://atom.io) and go to "File/Add Project Folder" and select the document root folder containing the local copy of your repositories. You should now be able to make changes using Atom, commit your changes to GitHub which will automaticaly submit them to your live website using the webhook.
  6. -
-
-
-
+ + + +
+

Listed below are the basic setup details to connect your website to a GitHub repository. For more information about how to setup and maintain Git on your server visit https://git-scm.com/docs.

+

Repository and Webserver Setup

+
    +
  1. Create a new repository at GitHub. (https://github.com)
  2. +
  3. Add your web servers public ssh-key (id_rsa.pub) to your GitHub account under "Settings/SSH and GPG keys". (Follow instructions here to generate a new ssh-key if needed: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
  4. +
  5. Add a webhook on GitHub under "Settings/Webhooks": https:///ccmsusr/github/webhook.php
  6. +
  7. Create a new website folder on your server. (You must have access to shell, ssh and git services.)
  8. +
+

Copy Custondian CMS Templates to Webserver

+

You can download the latest master version of the Custodian CMS templates from GitHub directly or use the Custodian CMS Download. If you prefer SSH, log into your server and type the following on the command-line.

+
    +
  1. git clone --depth=1 https://github.com/modusinternet/Custodian-CMS.git /tmp/Custodian-CMS
  2. +
  3. rm -rf /tmp/Custodian-CMS/.git
  4. +
  5. shopt -s dotglob
  6. +
  7. cp -r /tmp/Custodian-CMS/* /THE_PATH_TO_YOUR_WEBSITES_DOCUMMENT_ROOT
  8. +
  9. rm -rf /tmp/Custodian-CMS
  10. +
+

Initialize git on the Webserver

+

Once you've finished moving a copy of the Custodian CMS templates into place initialize git at the document root of the website and connect it to your GitHub repository.

+
    +
  1. Test your connection to the GitHub servers via ssh:
    + ssh -T git@github.com
    + If successful, type the following commands:
  2. +
  3. git init
  4. +
  5. git add .
  6. +
  7. git config --global user.email "noreply@"
  8. +
  9. git config --global user.name "YOUR_NAME"
  10. +
  11. git commit -m "first commit"
  12. +
  13. git remote add origin git@github.com:YOUR_ACCOUNT_ON_GITHUB/YOUR_REPO_ON_GITHUB.git
  14. +
  15. git push -u origin master
  16. +
+

Install Local Software

+
    +
  1. Check GitHub to see if all the files on your web server have been copied over.
  2. +
  3. Install GitHub Desktop (https://desktop.github.com) on your PC and File/Clone Repository to somewhere on your computer.
  4. +
  5. Install the Atom editor (https://atom.io) and go to "File/Add Project Folder" and select the document root folder containing the local copy of your repositories. You should now be able to make changes using Atom, commit your changes to GitHub which will automaticaly submit them to your live website using the webhook.
  6. +
+
+ + + + + {CCMS_TPL:/footer.html} + + + {CCMS_TPL:/body-head.php} + <?= $_SERVER["SERVER_NAME"];?> | User | Admin | Language Support + {CCMS_TPL:head-meta.html} + + -
- {CCMS_TPL:header-body.php} - +
+

Admin | Language Support

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

-
-
-
-

Language Support

-
-
- Notice -
-
-

This section of the Custodian CMS admin is currently under development.

-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec ligula id nisl fringilla finibus. Vestibulum rhoncus, felis at fringilla ullamcorper, ante mi tincidunt nunc, ac ultrices odio odio vitae lorem. Morbi quis elit id urna efficitur aliquam ut et sapien. Fusce porttitor vel ligula faucibus tempor. Pellentesque tincidunt imperdiet enim, id lobortis ipsum tempus id. In facilisis elementum dictum. Donec suscipit ornare tortor, sed volutpat mauris volutpat at. Pellentesque porttitor ut augue at ultrices. Proin egestas semper lorem quis suscipit. Vivamus eget magna tincidunt, semper sem eu, molestie quam. Praesent nisl velit, ultricies ac malesuada id, dapibus in dui. Mauris luctus velit non mi condimentum rhoncus. Nullam sit amet aliquet turpis, id malesuada nulla. Ut sit amet nisl nec ante commodo eleifend. -
-
-
-
+ {CCMS_TPL:/footer.html} + - diff --git a/ccmsusr/admin/other_controls/index.php b/ccmsusr/admin/other_controls/index.php new file mode 100644 index 0000000..911cf88 --- /dev/null +++ b/ccmsusr/admin/other_controls/index.php @@ -0,0 +1,82 @@ + + + + <?= $_SERVER["SERVER_NAME"];?> | User | Admin | Other Controls + {CCMS_TPL:head-meta.html} + + + + +
+

Admin | Other Controls

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

+ + + + {CCMS_TPL:/footer.html} +
+ + {CCMS_TPL:/body-head.php} + + + diff --git a/ccmsusr/admin/user_privileges/index.php b/ccmsusr/admin/user_privileges/index.php index dc77dbf..d512702 100644 --- a/ccmsusr/admin/user_privileges/index.php +++ b/ccmsusr/admin/user_privileges/index.php @@ -2,7 +2,7 @@ header("Content-Type: text/html; charset=UTF-8"); header("Expires: on, 01 Jan 1970 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); -header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @@ -10,102 +10,73 @@ echo "This script can NOT be called directly."; die(); } + +/* Confirm privilages to access this page. */ +$json_a = json_decode($_SESSION["PRIV"], true); +if(($json_a["admin"]["sub"]["user_privileges"] ?? null) < 1) { + echo "Access denied."; + die(); +} + ?> - + - - User Privileges - - {CCMS_TPL:header-head.html} - + <?= $_SERVER["SERVER_NAME"];?> | User | Admin | User Privileges + {CCMS_TPL:head-meta.html} + + -
- {CCMS_TPL:header-body.php} - +
+

Admin | User Privileges

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

-
-
-
-

User Privileges

-
-
- Notice -
-
-

This section of the Custodian CMS admin is currently under development.

-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec ligula id nisl fringilla finibus. Vestibulum rhoncus, felis at fringilla ullamcorper, ante mi tincidunt nunc, ac ultrices odio odio vitae lorem. Morbi quis elit id urna efficitur aliquam ut et sapien. Fusce porttitor vel ligula faucibus tempor. Pellentesque tincidunt imperdiet enim, id lobortis ipsum tempus id. In facilisis elementum dictum. Donec suscipit ornare tortor, sed volutpat mauris volutpat at. Pellentesque porttitor ut augue at ultrices. Proin egestas semper lorem quis suscipit. Vivamus eget magna tincidunt, semper sem eu, molestie quam. Praesent nisl velit, ultricies ac malesuada id, dapibus in dui. Mauris luctus velit non mi condimentum rhoncus. Nullam sit amet aliquet turpis, id malesuada nulla. Ut sit amet nisl nec ante commodo eleifend. -
-
-
-
+ {CCMS_TPL:/footer.html} + - diff --git a/ccmsusr/authenticator.php b/ccmsusr/authenticator.php index cc90cb6..f36c986 100644 --- a/ccmsusr/authenticator.php +++ b/ccmsusr/authenticator.php @@ -430,6 +430,11 @@ function loadJSResources() { loadFirst("/ccmsusr/_js/jquery-3.6.0.min.js", function() { loadFirst("/ccmsusr/_js/custodiancms.js", function() { loadFirst("/ccmsusr/_js/jquery-validate-1.19.3.min.js", function() { + + var input = document.getElementById('ccms_auth_token'); + input.focus(); + input.select(); + $("#ccms_auth_form").validate({ rules:{ ccms_auth_token:{ diff --git a/ccmsusr/body-head.php b/ccmsusr/body-head.php index 41814b5..2f45109 100644 --- a/ccmsusr/body-head.php +++ b/ccmsusr/body-head.php @@ -46,11 +46,18 @@ Admin
-
- - + {CCMS_TPL:/body-head.php} diff --git a/ccmsusr/content_manager/index.php b/ccmsusr/content_manager/index.php index 5130085..be7bfb6 100644 --- a/ccmsusr/content_manager/index.php +++ b/ccmsusr/content_manager/index.php @@ -2,7 +2,7 @@ header("Content-Type: text/html; charset=UTF-8"); header("Expires: on, 01 Jan 1970 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); -header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @@ -10,102 +10,73 @@ echo "This script can NOT be called directly."; die(); } + +/* Confirm privilages to access this page. */ +$json_a = json_decode($_SESSION["PRIV"], true); +if(($json_a["content_manager"] ?? null) < 1) { + echo "Access denied."; + die(); +} + ?> - + - - Content Manager - - {CCMS_TPL:header-head.html} - + <?= $_SERVER["SERVER_NAME"];?> | User | Content Manager + {CCMS_TPL:head-meta.html} + + -
- {CCMS_TPL:header-body.php} - +
+

Content Manager

+

This section is still under development, but if you come across any unresolved issues please let us know at: info@custodiancms.org

-
-
-
-

Content Manager

-
-
- Notice -
-
-

This section of the Custodian CMS admin is currently under development.

-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nec ligula id nisl fringilla finibus. Vestibulum rhoncus, felis at fringilla ullamcorper, ante mi tincidunt nunc, ac ultrices odio odio vitae lorem. Morbi quis elit id urna efficitur aliquam ut et sapien. Fusce porttitor vel ligula faucibus tempor. Pellentesque tincidunt imperdiet enim, id lobortis ipsum tempus id. In facilisis elementum dictum. Donec suscipit ornare tortor, sed volutpat mauris volutpat at. Pellentesque porttitor ut augue at ultrices. Proin egestas semper lorem quis suscipit. Vivamus eget magna tincidunt, semper sem eu, molestie quam. Praesent nisl velit, ultricies ac malesuada id, dapibus in dui. Mauris luctus velit non mi condimentum rhoncus. Nullam sit amet aliquet turpis, id malesuada nulla. Ut sit amet nisl nec ante commodo eleifend. -
-
-
-
+ {CCMS_TPL:/footer.html} + - diff --git a/ccmsusr/dashboard/index.php b/ccmsusr/dashboard/index.php index 2a8b1d9..21e0586 100644 --- a/ccmsusr/dashboard/index.php +++ b/ccmsusr/dashboard/index.php @@ -16,7 +16,7 @@ <?= $_SERVER["SERVER_NAME"];?> | User | Dashboard {CCMS_TPL:head-meta.html} -