xss protection, headers and offline loading
This commit is contained in:
parent
34da242eaa
commit
ea6e310706
|
@ -8,7 +8,8 @@
|
|||
"delight-im/auth": "dev-master",
|
||||
"ulrichsg/getopt-php": "dev-master",
|
||||
"nikic/fast-route": "^2.0@dev",
|
||||
"spatie/array-to-xml": "^2.13"
|
||||
"spatie/array-to-xml": "^2.13",
|
||||
"ezyang/htmlpurifier": "^4.13"
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"authors": [
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "0e3e20960c2b8fb600ba4e052f0e2c8c",
|
||||
"content-hash": "0d54de5193df865178012ce3fdeddbe2",
|
||||
"packages": [
|
||||
{
|
||||
"name": "delight-im/auth",
|
||||
|
@ -206,6 +206,56 @@
|
|||
],
|
||||
"time": "2016-07-21T15:05:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ezyang/htmlpurifier",
|
||||
"version": "v4.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ezyang/htmlpurifier.git",
|
||||
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
|
||||
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"HTMLPurifier": "library/"
|
||||
},
|
||||
"files": [
|
||||
"library/HTMLPurifier.composer.php"
|
||||
],
|
||||
"exclude-from-classmap": [
|
||||
"/library/HTMLPurifier/Language/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-2.1-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Edward Z. Yang",
|
||||
"email": "admin@htmlpurifier.org",
|
||||
"homepage": "http://ezyang.com"
|
||||
}
|
||||
],
|
||||
"description": "Standards compliant HTML filter written in PHP",
|
||||
"homepage": "http://htmlpurifier.org/",
|
||||
"keywords": [
|
||||
"html"
|
||||
],
|
||||
"time": "2020-06-29T00:56:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/fast-route",
|
||||
"version": "dev-master",
|
||||
|
@ -374,20 +424,6 @@
|
|||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -451,20 +487,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -600,16 +622,6 @@
|
|||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-24T10:15:25+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -849,12 +861,6 @@
|
|||
"functional testing",
|
||||
"unit testing"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://opencollective.com/codeception",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2020-03-23T17:07:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -1238,20 +1244,6 @@
|
|||
"constructor",
|
||||
"instantiate"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpdoctrine",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-29T17:27:14+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -1503,12 +1495,6 @@
|
|||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-06-29T13:22:24+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -1627,16 +1613,6 @@
|
|||
"datetime",
|
||||
"time"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://opencollective.com/Carbon",
|
||||
"type": "open_collective"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-24T12:35:58+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -2197,7 +2173,6 @@
|
|||
"keywords": [
|
||||
"tokenizer"
|
||||
],
|
||||
"abandoned": true,
|
||||
"time": "2017-11-27T05:48:46+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3194,20 +3169,6 @@
|
|||
],
|
||||
"description": "Symfony BrowserKit Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-06-24T13:36:18+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3287,20 +3248,6 @@
|
|||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3354,20 +3301,6 @@
|
|||
],
|
||||
"description": "Symfony CssSelector Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-20T17:43:50+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3418,20 +3351,6 @@
|
|||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-06-06T08:49:21+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3494,20 +3413,6 @@
|
|||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-12T08:45:47+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3580,20 +3485,6 @@
|
|||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-13T14:19:42+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3656,20 +3547,6 @@
|
|||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3719,20 +3596,6 @@
|
|||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-20T17:43:50+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3796,20 +3659,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3874,20 +3723,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3955,20 +3790,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4031,20 +3852,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4111,20 +3918,6 @@
|
|||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4187,20 +3980,6 @@
|
|||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4272,20 +4051,6 @@
|
|||
"utf-8",
|
||||
"utf8"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-17T07:48:54+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4364,20 +4129,6 @@
|
|||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-06-30T17:42:22+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4439,20 +4190,6 @@
|
|||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4516,20 +4253,6 @@
|
|||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-26T08:30:57+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4570,12 +4293,6 @@
|
|||
}
|
||||
],
|
||||
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/theseer",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-12T23:59:07+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4798,12 +4515,6 @@
|
|||
"stream",
|
||||
"uuencode"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/zbateson",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-10T18:59:43+00:00"
|
||||
}
|
||||
],
|
||||
|
@ -4820,6 +4531,5 @@
|
|||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
"platform-dev": []
|
||||
}
|
||||
|
|
|
@ -147,6 +147,20 @@ class tools{
|
|||
}
|
||||
return $code;
|
||||
}
|
||||
|
||||
public function sanitize($string, $htmlAllowed=false, $htmlPurifierOptions=[]){
|
||||
if($htmlAllowed){
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
foreach ($htmlPurifierOptions as $key => $value) {
|
||||
$config->set($key, $value);
|
||||
}
|
||||
$purifier = new HTMLPurifier($config);
|
||||
$string = $purifier->purify($string);
|
||||
} else {
|
||||
$string = htmlspecialchars($string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
class database{
|
||||
|
@ -390,12 +404,12 @@ class user{
|
|||
$profiles = $this->database->exec("SELECT `name` FROM `%PREFIX%_profiles` WHERE id = :id;", true, [":id" => $id]);
|
||||
if(!empty($profiles)){
|
||||
if(!is_null($profiles[0]["name"])){
|
||||
return($profiles[0]["name"]);
|
||||
return(s($profiles[0]["name"],false));
|
||||
} else {
|
||||
$user = $this->database->exec("SELECT `username` FROM `%PREFIX%_users` WHERE id = :id;", true, [":id" => $id]);
|
||||
if(!empty($user)){
|
||||
if(!is_null($user[0]["username"])){
|
||||
return($user[0]["username"]);
|
||||
return(s($user[0]["username"],false));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -576,7 +590,7 @@ class translations{
|
|||
}
|
||||
}
|
||||
|
||||
function init_class($enableDebugger=true){
|
||||
function init_class($enableDebugger=true, $headers=true){
|
||||
global $tools, $database, $user, $translations;
|
||||
if(!isset($tools) && !isset($database) && !isset($translations)){
|
||||
$database = new database();
|
||||
|
@ -584,6 +598,13 @@ function init_class($enableDebugger=true){
|
|||
$user = new user($database, $tools);
|
||||
$translations = new translations();
|
||||
}
|
||||
if($headers){
|
||||
header("Content-Security-Policy: default-src 'unsafe-eval' 'unsafe-inline' 'self'");
|
||||
header("X-XSS-Protection: 1; mode=block");
|
||||
header("X-Frame-Options: DENY");
|
||||
header("X-Content-Type-Options: nosniff");
|
||||
header("Feature-Policy: autoplay 'none'; camera 'none'; microphone 'none'; payment 'none'");
|
||||
}
|
||||
if($enableDebugger){
|
||||
if($user->requireRole(Role::DEVELOPER)){
|
||||
Debugger::enable(Debugger::DEVELOPMENT, __DIR__ . '/error-log');
|
||||
|
@ -602,4 +623,13 @@ function t($string, $echo=true){
|
|||
} else {
|
||||
return $translations->translate($string);
|
||||
}
|
||||
}
|
||||
|
||||
function s($string, $echo=true, $htmlAllowed=false, $htmlPurifierOptions=[]){
|
||||
global $tools;
|
||||
if($echo){
|
||||
echo $tools->sanitize($string, $htmlAllowed, $htmlPurifierOptions);
|
||||
} else {
|
||||
return $tools->sanitize($string, $htmlAllowed, $htmlPurifierOptions);
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY availab
|
|||
|
||||
$hidden = $user->hidden();
|
||||
?>
|
||||
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
||||
<style>
|
||||
th, td {
|
||||
border: 1px solid grey;
|
||||
|
@ -48,7 +47,7 @@ th, td {
|
|||
<th><?php t("Other"); ?></th>
|
||||
<?php
|
||||
foreach($risultato as $row){
|
||||
if(!in_array($row['name'], $hidden) OR in_array($user->name(), $hidden)){
|
||||
if(!in_array($row['name'], $hidden) && ($row['hidden'] == 0 && $row['disabled'] == 0)){
|
||||
echo "<tr>
|
||||
<td>";
|
||||
$name = $user->nameById($row["id"]);
|
||||
|
|
|
@ -315,7 +315,7 @@ function vero1($text, $img1 = "", $img2 = ""){
|
|||
}
|
||||
//var_dump($risultato);
|
||||
foreach($risultato as $row){
|
||||
$name = ($row['online']==1) ? '<u>' . $row['name'] . "</u>" : $row['name'];
|
||||
$name = ($row['online']==1) ? '<u>' . $user->nameById($row["id"]) . "</u>" : $user->nameById($row["id"]);
|
||||
echo("<h1>".t("Personal data",false)." <b>$name</b></h1><br><br>");
|
||||
echo('<img alt="VVF" src="./risorse/images/distaccamento.png" width="150" class="img-resposive"><br><br><br>');
|
||||
$disp = vero1($row['available'], "<i class='fa fa-check' style='color:green' width='22px'></i>", "<i class='fa fa-times' style='color:red' width='22px'></i>");
|
||||
|
|
|
@ -7,7 +7,6 @@ $risultato = $database->exec("SELECT * FROM `%PREFIX%_profiles` ORDER BY availab
|
|||
|
||||
$hidden = $user->hidden();
|
||||
?>
|
||||
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
||||
<style>
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ select::-ms-expand {
|
|||
foreach($risultato as $row){
|
||||
if(!in_array($row['changed'], $hidden) OR in_array($user->name(), $hidden)){
|
||||
echo "<tr><td>" . $row["action"] . "</td><td>" . $user->nameById($row["changed"]) . "</td><td>" . $user->nameById($row["editor"]) ."</td><td>" . $row['date'] . " - ore " . $row['time'] . "</tr>";
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -8,60 +8,6 @@ $impostazioni['delete'] = true;
|
|||
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_services` ORDER BY data DESC, uscita desc", true); // Pesco i dati della table e li ordino in base alla data
|
||||
?>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<style>
|
||||
|
||||
#add {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
#href {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid grey;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
|
||||
border-radius: 5px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#new-search-area {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
#new-search-area input {
|
||||
width: 600px;
|
||||
font-size: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 150px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
</style>
|
||||
<div style='margin: 20px 0;' class="mx-auto">
|
||||
<div style='margin: 2px auto' id="new-search-area"></div>
|
||||
<div class="table-responsive">
|
||||
|
@ -95,7 +41,7 @@ foreach($risultato as $row){
|
|||
foreach(explode(",", $row['personale']) as $key=>$name){
|
||||
$others_people = $others_people.$user->nameById($name).", ";
|
||||
}
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['codice'] . "</td><td>" . $row['uscita'] . "</td><td>" . $row['rientro'] . "</td><td>" . $foreman . "</td><td>" . $drivers . "</td><td>" . $others_people . "</td><td>" . $row['luogo'] . "</td><td>" . $row['note'] . "</td><td>" . $row['tipo'] . "</td>";
|
||||
echo "<tr><td>" . $row['data'] . "</td><td>" . $row['codice'] . "</td><td>" . $row['uscita'] . "</td><td>" . $row['rientro'] . "</td><td>" . $foreman . "</td><td>" . $drivers . "</td><td>" . $others_people . "</td><td>" . s($row['luogo'],false,true) . "</td><td>" . s($row['note'],false,true) . "</td><td>" . s($row['tipo'],false,true) . "</td>";
|
||||
if($impostazioni['edit']) {
|
||||
echo "<td><a href='edit_service.php?edit&id={$row['id']}'><i style='font-size: 40px' class='fa fa-edit'></i></a></td>";
|
||||
}
|
||||
|
|
|
@ -8,60 +8,6 @@ $impostazioni['delete'] = true;
|
|||
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_trainings` ORDER BY data DESC, inizio desc", true); // Pesco i dati della table e li ordino in base alla data
|
||||
?>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<style>
|
||||
|
||||
#add {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
#href {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid grey;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
|
||||
border-radius: 5px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#new-search-area {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
#new-search-area input {
|
||||
width: 600px;
|
||||
font-size: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 150px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
</style>
|
||||
<div style='margin: 20px 0;' class="mx-auto">
|
||||
<div style='margin: 2px auto' id="new-search-area"></div>
|
||||
<div class="table-responsive">
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,6 @@
|
|||
.cc-window{opacity:1;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{transition:transform 1s ease}.cc-animate.cc-revoke.cc-top{transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-bottom,.cc-animate.cc-revoke.cc-active.cc-top,.cc-revoke:hover{transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;transition:max-height 1s}
|
||||
.cc-link,.cc-revoke:hover{text-decoration:underline}.cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}
|
||||
.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-banner{-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{-ms-flex:1;flex:1}.cc-compliance{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-compliance>.cc-btn{-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em}
|
||||
@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-ms-flex-align:unset;align-items:unset}}
|
||||
.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block}
|
||||
.cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em 2em 1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -11,12 +11,13 @@
|
|||
overflow-x: hidden;
|
||||
}
|
||||
</style>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script async src='https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.14/howler.js'></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
|
||||
<script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>
|
||||
<script src="risorse/js/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="risorse/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="risorse/css/font-awesome.min.css">
|
||||
<script defer src="risorse/js/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script async src='risorse/js/howler.min.js'></script>
|
||||
<script src="risorse/js/cookieconsent.min.js"></script>
|
||||
<script src="risorse/js/dexie.min.js"></script>
|
||||
{% if enable_technical_support and technical_support_open %}
|
||||
<!-- Smartsupp Live Chat script -->
|
||||
<script type='text/javascript'>
|
||||
|
@ -276,8 +277,7 @@
|
|||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
|
||||
<link rel="stylesheet" type="text/css" href="risorse/css/cookieconsent.min.css" />
|
||||
<script>
|
||||
window.cookieconsent.initialise({
|
||||
"palette": {
|
||||
|
|
|
@ -1,6 +1,59 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
|
||||
#add {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
#href {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid grey;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
|
||||
border-radius: 5px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#new-search-area {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
#new-search-area input {
|
||||
width: 600px;
|
||||
font-size: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 150px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
</style>
|
||||
<br>
|
||||
<img alt="VVF" src="./risorse/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
|
||||
<br>
|
||||
|
|
|
@ -1,6 +1,59 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<style>
|
||||
|
||||
#add {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
#href {
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: bold 12px Arial, Helvetica, sans-serif;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid grey;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
|
||||
border-radius: 5px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#new-search-area {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
#new-search-area input {
|
||||
width: 600px;
|
||||
font-size: 20px;
|
||||
padding: 5px;
|
||||
margin-right: 150px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
</style>
|
||||
<br>
|
||||
<img alt="VVF" src="./risorse/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
|
||||
<br>
|
||||
|
|
|
@ -36,22 +36,41 @@ class FirstCest
|
|||
public function logsWorks(AcceptanceTester $I)
|
||||
{
|
||||
$I->amOnPage('/list.php');
|
||||
$I->click('Attivo');
|
||||
$I->click('Active');
|
||||
$I->click('Log');
|
||||
$I->seeCurrentURLEquals('/log.php');
|
||||
$I->see('Attivazione disponibilita\'');
|
||||
|
||||
$I->click('Lista Disponibilità');
|
||||
$I->seeCurrentURLEquals('/list.php');
|
||||
$I->click('Non Attivo');
|
||||
$I->click('Not Active');
|
||||
$I->seeCurrentURLEquals('/list.php');
|
||||
$I->click('Log');
|
||||
$I->seeCurrentURLEquals('/log.php');
|
||||
$I->see('Rimozione disponibilita\'');
|
||||
}
|
||||
|
||||
public function servicesWorks(AcceptanceTester $I)
|
||||
/**
|
||||
* @depends installWorks
|
||||
*/
|
||||
public function addUsersWorks(AcceptanceTester $I)
|
||||
{
|
||||
$I->amOnPage('/list.php');
|
||||
$I->click('Add user');
|
||||
$I->seeCurrentURLEquals('/edit_user.php?add');
|
||||
/* TODO
|
||||
$I->click('Lista Disponibilità');
|
||||
$I->seeCurrentURLEquals('/list.php');
|
||||
$I->click('Not Active');
|
||||
$I->seeCurrentURLEquals('/list.php');
|
||||
$I->click('Log');
|
||||
$I->seeCurrentURLEquals('/log.php');
|
||||
$I->see('Rimozione disponibilita\'');
|
||||
*/
|
||||
}
|
||||
|
||||
//public function servicesWorks(AcceptanceTester $I)
|
||||
//{
|
||||
/**
|
||||
* @var FakerGenerator
|
||||
*/
|
||||
|
@ -73,6 +92,6 @@ class FirstCest
|
|||
$I->seeCurrentURLEquals('/services.php');
|
||||
$I->see('type2');
|
||||
*/
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue