diff --git a/Dockerfile b/Dockerfile index 20ef1d1..78f35a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.17.8-alpine +FROM nginx:1.29-alpine # Copy the public directory COPY . /app/public/ @@ -6,5 +6,4 @@ COPY . /app/public/ # Copy the nginx config file COPY ./site.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 -EXPOSE 8080 \ No newline at end of file +EXPOSE 80 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8aaaf02..673d05f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,24 @@ -version: '3' # Php-fpm configuration - php: +services: + php-panda: build: ./php_docker/ volumes: - .:/app/public - links: - - clubdb + networks: + - panda-net - web: + web-panda: build: . ports: - - "8080:80" + - "5000:80" volumes: - .:/app/public - links: - - php depends_on: - - php + - php-panda + networks: + - panda-net + +networks: + panda-net: + driver: bridge diff --git a/games/bamboofield.html b/games/bamboofield.html index 4b19252..fb780ed 100644 --- a/games/bamboofield.html +++ b/games/bamboofield.html @@ -243,9 +243,8 @@ function playBF() 'action="insertScore.php" method="post">' + '>'; + 'type="hidden" name="user_id_score" value=>'; document.getElementById("dynForm").submit(); sent = true; diff --git a/games/zombiePanda.html b/games/zombiePanda.html index b40c35f..d23f426 100644 --- a/games/zombiePanda.html +++ b/games/zombiePanda.html @@ -144,6 +144,8 @@ function playZP() return Math.floor(Math.random() * (max - min + 1)) + min; } + var zombieBaseSpeed = 1; + //zombie var Zombie = function(x,y) { @@ -151,7 +153,7 @@ function playZP() this.y = y; this.width = 25; this.height = 25; - this.speed = 3; + this.speed = zombieBaseSpeed; var side = getRandomIntInclusive(0,3); var mid = getRandomIntInclusive(0,700); @@ -348,7 +350,7 @@ function playZP() '' + '>>' + ''; document.getElementById("dynForm").submit(); diff --git a/includes/header.php b/includes/header.php index 85eeac6..770d2a3 100644 --- a/includes/header.php +++ b/includes/header.php @@ -6,8 +6,16 @@ $admin = false; session_start(); ob_start(); -echo getcwd(); -echo "$dir"; +// Determine directory depth by checking if club_connect.php exists in current or parent directory +if(file_exists("./club_connect.php")) +{ + $dir = 1; +} +else +{ + $dir = 2; +} + if($dir == 2) { require_once("../club_connect.php"); @@ -20,7 +28,8 @@ else } -if((md5($_SERVER['HTTP_USERAGENT'] . 'salt')) == ($_SESSION['agent']) && +if(isset($_SERVER['HTTP_USERAGENT']) && isset($_SESSION['agent']) && isset($_SESSION['use']) && + md5($_SERVER['HTTP_USERAGENT'] . 'salt') == $_SESSION['agent'] && $_SESSION['use'] == true) { $loggedIn = true; diff --git a/php_docker/Dockerfile b/php_docker/Dockerfile index 8a10824..55e9d4a 100644 --- a/php_docker/Dockerfile +++ b/php_docker/Dockerfile @@ -1,9 +1,8 @@ -FROM php:7.4.3-fpm-alpine3.11 +FROM php:8.1-fpm-alpine RUN apk update \ && apk add sqlite \ - && apk add socat \ - && apk add php-sqlite3 + && apk add socat # Copy the php config file COPY ./php-fpm.conf /usr/local/etc/php-fpm.d/www.conf diff --git a/site.conf b/site.conf index 1d27d4b..cd9eec3 100644 --- a/site.conf +++ b/site.conf @@ -13,9 +13,8 @@ server { location ~ \.php$ { resolver 127.0.0.11; - set $upstream php:9000; include fastcgi_params; - fastcgi_pass $upstream; + fastcgi_pass php-panda:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } \ No newline at end of file