diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c1bf432 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +# Exclude specific directories +src/install/ +src/upgrade/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index e8eb744..e00e331 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .settings .project .idea -.DS_Store -src/config/environment.php \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7e801d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM php:latest + +RUN apt-get update && \ + apt-get install -y --no-install-recommends less nano tini curl bash tar git zip unzip && \ + #echo "**** # To install networking tools for testing purpose ****" && \ + apt-get install -y --no-install-recommends iputils-ping dnsutils net-tools procps && \ + #echo "**** cleanup ****" && \ + apt-get autoremove -y && \ + apt-get clean -y + +RUN apt-get update +RUN apt-get install -y --no-install-recommends libzip-dev libjpeg62-turbo-dev libpng-dev libfreetype6-dev + +RUN docker-php-source extract +RUN docker-php-ext-install pdo_mysql zip exif pcntl gd +RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli +RUN docker-php-ext-install gettext && docker-php-ext-enable gettext +RUN docker-php-ext-install sockets && docker-php-ext-enable sockets + +WORKDIR /var/www/html +COPY ./src ./ +RUN chmod 755 *; +EXPOSE 80 +CMD ["php", "-S", "0.0.0.0:80"] diff --git a/README.md b/README.md index 67add7c..c8f5ee8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@
  • #1 Dynamic Qr code generator on GitHub with database to store Qr codes
  • Create unlimited Qr code
  • Easy installation wizard
  • -
  • Control panel with 2 access levels
  • +
  • Control panel with 2 access levels and multi-user support
  • Dashboard with advanced statistics on Qr code created and on scans
  • Dynamic Qr code
  • +
  • Version 2.2 – 16th October, 2023
  • + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..df8fbe5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,47 @@ +version: "3.2" +services: + php-dynamic-qrcode: + image: "giandonatoinverso/php-dynamic-qr-code:latest" + restart: "unless-stopped" + environment: + TYPE: "docker" + DATABASE_HOST: "php-dynamic-qrcode-db" + DATABASE_PORT: "3306" + DATABASE_NAME: "qrcode" + DATABASE_USER: "qrcode" + DATABASE_PASSWORD: "changeme" + DATABASE_PREFIX: "" + DATABASE_CHARSET: "utf8" + ports: + - 80:80 + depends_on: + - php-dynamic-qrcode-db + volumes: + - php_dynamic_qrcode_config_data:/var/www/html/config + - php_dynamic_qrcode_saved_qrcode_data:/var/www/html/saved_qrcode + networks: + - php-dynamic-qrcode-network + + php-dynamic-qrcode-db: + image: "giandonatoinverso/php-dynamic-qr-code-db:latest" + restart: "unless-stopped" + volumes: + - php_dynamic_qrcode_db_data:/var/lib/mysql + ports: + - '13306:3306' + environment: + MYSQL_ROOT_PASSWORD: "changeme" + MYSQL_DATABASE: "qrcode" + MYSQL_USER: "qrcode" + MYSQL_PASSWORD: "changeme" + networks: + - php-dynamic-qrcode-network + +volumes: + php_dynamic_qrcode_db_data: + php_dynamic_qrcode_config_data: + php_dynamic_qrcode_saved_qrcode_data: + +networks: + php-dynamic-qrcode-network: + driver: bridge \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index ec79d08..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,59 +0,0 @@ -FROM php:7.4.21-apache -ARG APP_VERSION=v1.0.6 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends less nano tini curl tar git zip unzip && \ - #echo "**** # To install networking tools for testing purpose ****" && \ - apt-get install -y --no-install-recommends iputils-ping dnsutils net-tools procps && \ - #echo "**** cleanup ****" && \ - apt-get autoremove -y && \ - apt-get clean -y - -RUN curl -SL -o app.tar.gz "https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code/archive/${APP_VERSION}.tar.gz" \ - && mkdir -p /app \ - && tar xvf app.tar.gz -C /app --strip-components=1 \ - && cp -r /app/qrcode/** /var/www/html \ - && rm app.tar.gz - -RUN apt-get update -RUN apt-get install -y --no-install-recommends libzip-dev libjpeg62-turbo-dev libpng-dev libfreetype6-dev - -# install composer -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php composer-setup.php -RUN rm composer-setup.php -RUN mv composer.phar /usr/local/bin/composer - -# Install extensions -RUN docker-php-source extract -RUN docker-php-ext-install pdo_mysql zip exif pcntl gd -RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli -RUN docker-php-ext-install gettext && docker-php-ext-enable gettext -RUN docker-php-ext-install sockets && docker-php-ext-enable sockets - -RUN mv "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" - -WORKDIR /var/www/html - -COPY ./config/docker-entrypoint.sh /bin/docker-entrypoint.sh -RUN chmod +x /bin/docker-entrypoint.sh -COPY ./config/vhost.conf /etc/apache2/sites-available/000-default.conf -RUN a2enmod rewrite - -ENV APP_USER appuser -ARG PUID=1000 -ARG PGID=1000 -RUN groupadd -g ${PGID} $APP_USER \ - && useradd -M -u ${PUID} -g ${PGID} $APP_USER \ - && chown -R $APP_USER:$APP_USER /var/run/apache2 \ - && chown -R $APP_USER:$APP_USER /var/log \ - && chown -R $APP_USER:$APP_USER /etc/apache2 \ - && chown -R $APP_USER:$APP_USER /var/lib/apache2 \ - && chown -R $APP_USER:$APP_USER /var/www -USER $APP_USER -CMD apache2ctl -D FOREGROUND - -EXPOSE 80 - -# needs to fix install process to create database and then below line can be commented out -#ENTRYPOINT ["/bin/docker-entrypoint.sh"] diff --git a/docker/config/docker-entrypoint.sh b/docker/config/docker-entrypoint.sh deleted file mode 100644 index 9346f63..0000000 --- a/docker/config/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -o errexit -o nounset - -APP_PATH=/var/www/html - -echo "##### coping config file #####" -cp $APP_PATH/install/config/database.php $APP_PATH/config/config.php - -echo "##### setting database hostname #####" -sed -i "s/%HOSTNAME%/$DATABASE_HOST/" $APP_PATH/config/config.php - -echo "##### setting database username #####" -sed -i "s/%USERNAME%/$DATABASE_USER/" $APP_PATH/config/config.php - -echo "##### setting database password #####" -sed -i "s/%PASSWORD%/$DATABASE_PASSWORD/" $APP_PATH/config/config.php - -echo "##### setting database name #####" -sed -i "s/%DATABASE%/$DATABASE_NAME/" $APP_PATH/config/config.php - -echo "#### Deleting install folder #####" -rm -r $APP_PATH/install - -exec apache2-foreground \ No newline at end of file diff --git a/docker/config/info.php b/docker/config/info.php deleted file mode 100644 index 5a1884f..0000000 --- a/docker/config/info.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docker/config/vhost.conf b/docker/config/vhost.conf deleted file mode 100644 index 1c9b57c..0000000 --- a/docker/config/vhost.conf +++ /dev/null @@ -1,11 +0,0 @@ - - DocumentRoot /var/www/html/ - - AllowOverride all - Require all granted - - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index a9c1932..0000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: "3.9" - -services: - qrcode: - build: - context: . - args: - PUID: ${PUID} - PGID: ${PGID} - image: qrcode:1.0 - container_name: qrcode - restart: "unless-stopped" - networks: - - qrcode_network - ports: - - "8080:80" - user: "${PUID}:${PGID}" - environment: - ADMIN_USER: "superadmin" - ADMIN_PASSWORD: "superadmin" - DATABASE_HOST: "mariadb" - DATABASE_PORT: "3306" - DATABASE_NAME: "qrcode" - DATABASE_USER: "qrcode" - DATABASE_PASSWORD: "changeme" - DATABASE_PREFIX: "" - DATABASE_CHARSET: "utf8" - volumes: - - ./data/app/config:/var/www/html/config - - ./data/app/saved_qrcode:/var/www/html/saved_qrcode - - mariadb: - image: mariadb:10.5 - container_name: mariadb - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW - restart: "unless-stopped" - environment: - MARIADB_ROOT_PASSWORD: "changeme" - MARIADB_DATABASE: "qrcode" - MARIADB_USER: "qrcode" - MARIADB_PASSWORD: "changeme" - networks: - - qrcode_network - volumes: - - ./data/mariadb:/var/lib/mysql - ports: - - 3306:3306 - -networks: - qrcode_network: - driver: bridge - name: qrcode diff --git a/src/bulk_action.php b/src/bulk_action.php index ab321d6..1c7e46b 100644 --- a/src/bulk_action.php +++ b/src/bulk_action.php @@ -5,10 +5,29 @@ require_once 'config/config.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $db = getDbInstance(); $json = json_decode(file_get_contents('php://input'), true); - $action = filter_var($json['action'], FILTER_SANITIZE_STRING); + + if (isset($json['action'])) { + $action = filter_var($json['action'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); + } else { + echo json_encode([ + 'data' => 'Missing action field in the request.', + 'status' => 400 + ]); + exit(); + } + $params = $json['params']; $files = []; - $type = filter_var($json['type'], FILTER_SANITIZE_STRING); + + if (isset($json['type'])) { + $type = filter_var($json['type'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); + } else { + echo json_encode([ + 'data' => 'Type action field in the request.', + 'status' => 400 + ]); + exit(); + } if (count($params) == 0) { echo json_encode([ @@ -25,9 +44,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } $zip = new ZipArchive(); - $relative_dir = SAVED_QRCODE_FOLDER. 'zip/qrcodes_'. $_SESSION['user_id'] .'.zip'; - unlink($relative_dir); - $url_path = SAVED_QRCODE_URL . 'zip/qrcodes_'. $_SESSION['user_id'] .'.zip'; + $uniqid = uniqid(); + $relative_dir = SAVED_QRCODE_FOLDER. 'zip/qrcodes_'. $uniqid .'.zip'; + @unlink($relative_dir); + $url_path = SAVED_QRCODE_URL . 'zip/qrcodes_'. $uniqid .'.zip'; $zip->open($relative_dir, ZipArchive::CREATE); foreach ($files as $file) { diff --git a/src/config/environment.php.example b/src/config/environment.php similarity index 74% rename from src/config/environment.php.example rename to src/config/environment.php index 70640ed..7bab326 100644 --- a/src/config/environment.php.example +++ b/src/config/environment.php @@ -4,27 +4,22 @@ | DOCKER INSTALLATION |-------------------------------------------------------------------------- */ -$docker_cid = getenv('DOCKER_CID'); -if(is_string($docker_cid)) { +if(is_string(Getenv('TYPE')) && Getenv('TYPE') == "docker") { define('DATABASE_HOST', Getenv('DATABASE_HOST')); define('DATABASE_PORT', filter_var(Getenv('DATABASE_PORT'), FILTER_VALIDATE_INT)); define('DATABASE_NAME', Getenv('DATABASE_NAME')); define('DATABASE_USER', Getenv('DATABASE_USER')); define('DATABASE_PASSWORD', Getenv('DATABASE_PASSWORD')); - // This must have a trailing underscore. - // Example: qr_ - define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX')); + define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX')); // This must have a trailing underscore. Example: qr_ define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET')); } else { - define('DATABASE_HOST', "mariadb"); + define('DATABASE_HOST', "localhost"); define('DATABASE_PORT', "3306"); define('DATABASE_NAME', "qrcode"); define('DATABASE_USER', "root"); define('DATABASE_PASSWORD', "root"); - // This must have a trailing underscore. - // Example: qr_ - define('DATABASE_PREFIX', ""); + define('DATABASE_PREFIX', ""); // This must have a trailing underscore. Example: qr_ define('DATABASE_CHARSET', "utf8"); } /* diff --git a/src/dist/js/custom.js b/src/dist/js/custom.js index b4810b6..19a57e1 100644 --- a/src/dist/js/custom.js +++ b/src/dist/js/custom.js @@ -453,7 +453,7 @@ }); const data = { - action: $('select[name=bulk-action]').val(), + action: 'download', params: params, type: $('input[name=type]').val() } @@ -478,7 +478,7 @@ }, error: (err) => { $('#err-msg').empty(); - $('#err-msg').append(' ' + res.data); + $('#err-msg').append(' ' + err.responseText); $('#err-msg').css('display', 'block'); console.log(err); } diff --git a/src/includes/footer.php b/src/includes/footer.php index 32a7562..ec78f93 100644 --- a/src/includes/footer.php +++ b/src/includes/footer.php @@ -9,7 +9,7 @@ Copyright © PHP Qrcode Generator - All rights reserved by Giandonato Inverso.
    - Version 2.1.0 + Version 2.2.0
    diff --git a/src/install/sql/sample_data.sql b/src/install/sql/sample_data.sql index 7e417c8..f6377d3 100644 --- a/src/install/sql/sample_data.sql +++ b/src/install/sql/sample_data.sql @@ -23,7 +23,7 @@ INSERT INTO `#prefix#users` (`id`, `username`, `password`, `series_id`, `remembe CREATE TABLE IF NOT EXISTS `#prefix#dynamic_qrcodes` ( `id` int(10) NOT NULL AUTO_INCREMENT, - `id_owner` int(25) NOT NULL AUTO_INCREMENT, + `id_owner` int(25) NULL DEFAULT NULL, `filename` varchar(45) NOT NULL, `format` varchar(45) DEFAULT NULL, `identifier` longtext, @@ -39,16 +39,16 @@ CREATE TABLE IF NOT EXISTS `#prefix#dynamic_qrcodes` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; INSERT INTO `#prefix#dynamic_qrcodes` (`id`, `id_owner`, `filename`, `format`, `identifier`, `link`, `qrcode`, `scan`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES -(1, 0, 'Facebook', 'png', 'rcCeC', 'https://facebook.com', 'Facebook.png', 0, 'enable', 0, '2020-09-01 15:35:13', 0, NULL), -(2, 0, 'Amazon', 'png', 'F7GOY6', 'https://amazon.com', 'Amazon.png', 0, 'enable', 0, '2020-09-01 15:40:34', 0, NULL), -(3, 0, 'Youtube', 'png', '8dK5Nd', 'https://youtube.com', 'Youtube.png', 0, 'enable', 0, '2020-09-01 15:41:43', 0, NULL), -(4, 0, 'Apple', 'jpg', '7zxTKn', 'https://apple.com', 'Apple.jpg', 0, 'enable', 0, '2020-09-01 15:44:20', 0, NULL), -(5, 0, 'Ebay', 'svg', 'a4F3kr', 'https://ebay.com', 'Ebay.svg', 0, 'enable', 0, '2020-09-01 15:44:46', 0, NULL), -(6, 0, 'Google', 'png', 'saJV1y', 'https://google.it', 'Google.png', 0, 'enable', 0, '2020-09-01 15:46:37', 0, NULL); +(1, 1, 'Facebook', 'png', 'rcCeC', 'https://facebook.com', 'Facebook.png', 0, 'enable', 0, '2020-09-01 15:35:13', 0, NULL), +(2, 1, 'Amazon', 'png', 'F7GOY6', 'https://amazon.com', 'Amazon.png', 0, 'enable', 0, '2020-09-01 15:40:34', 0, NULL), +(3, 1, 'Youtube', 'png', '8dK5Nd', 'https://youtube.com', 'Youtube.png', 0, 'enable', 0, '2020-09-01 15:41:43', 0, NULL), +(4, 1, 'Apple', 'jpg', '7zxTKn', 'https://apple.com', 'Apple.jpg', 0, 'enable', 0, '2020-09-01 15:44:20', 0, NULL), +(5, 1, 'Ebay', 'svg', 'a4F3kr', 'https://ebay.com', 'Ebay.svg', 0, 'enable', 0, '2020-09-01 15:44:46', 0, NULL), +(6, 1, 'Google', 'png', 'saJV1y', 'https://google.it', 'Google.png', 0, 'enable', 0, '2020-09-01 15:46:37', 0, NULL); CREATE TABLE IF NOT EXISTS `#prefix#static_qrcodes` ( `id` int(10) NOT NULL AUTO_INCREMENT, - `id_owner` int(25) NOT NULL AUTO_INCREMENT, + `id_owner` int(25) NULL DEFAULT NULL, `filename` varchar(45) CHARACTER SET utf8 NOT NULL, `format` varchar(45) DEFAULT NULL, `type` varchar(45) CHARACTER SET utf8 DEFAULT NULL, @@ -63,18 +63,18 @@ CREATE TABLE IF NOT EXISTS `#prefix#static_qrcodes` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; INSERT INTO `#prefix#static_qrcodes` (`id`, `id_owner`, `filename`, `format`, `type`, `content`, `qrcode`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES -(1, 0, 'Text qr code', 'png', 'text', 'Text: My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL), -(2, 0, 'Email', 'jpg', 'email', 'Email: assistance@domain.com
    Subject: Assistance request
    Message: Regarding my order N ° ... I require assistance', 'Email.jpg', 'enable', 0, '2020-08-24 08:44:13', 0, NULL), -(3, 0, 'Call me', 'png', 'phone', 'Phone number: 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL), -(4, 0, 'Send sms', 'png', 'sms', 'Phone number: 12563776756
    Message: Test message', 'Send sms.png', 'enable', 0, '2020-08-24 08:46:52', 0, NULL), -(5, 0, 'wa.me', 'svg', 'whatsapp', 'Phone number: 12563776756
    Message: Hey there! I am using WhatsApp', 'wa.me.svg', 'enable', 0, '2020-08-24 08:47:49', 0, NULL), -(6, 0, 'New York', 'png', 'location', 'Latitude: 40.7127753
    Longitude: -74.0059728', 'New York.png', 'enable', 0, '2020-08-24 08:51:55', 0, NULL), -(7, 0, 'John Doe', 'png', 'vcard', '
    Full name: John Doe
    Nickname: John
    Email: john@domain.com
    Website: https://johndoe.com
    Company: Doe Inc.
    Role: CEO
    Categories: electronics, vcard
    Note:
    Phone: 412-999-9988
    Home Phone: 412-999-5555
    Work phone: 412-444-2222
    Address: 123 Main Street Anywhere 15523 Arizona
    ', 'John Doe.png', 'enable', 0, '2020-08-24 08:55:59', 0, NULL), -(8, 0, 'Boat party', 'png', 'event', '
    Title: Party with friends
    Start event: 2020-08-26 09:00 AM
    End event: 2020-08-26 03:00 PM
    Location: New York
    Description: Happy Birthday Carl!
    URL:
    ', 'Boat party.png', 'enable', 0, '2020-08-24 08:58:20', 0, NULL), -(9, 0, 'Save me', 'svg', 'bookmark', 'Title: Google search
    Url: https://google.it', 'Save me.svg', 'enable', 0, '2020-08-24 08:59:46', 0, NULL), -(10, 0, 'Free wifi', 'png', 'wifi', 'Encryption: WPA
    SSID: TP-LINK-AB123
    Password: bBB8MR7TwbbUWMZT', 'Free wifi.png', 'enable', 0, '2020-08-24 09:02:35', 0, NULL), -(11, 0, 'Pay here', 'png', 'paypal', '
    Payment type: _click
    Email: paypal@domain.com
    Item name: T-shirt
    Item id: 177
    Amount: 15
    Currency: USD
    Shipping: 4
    Tax rate:
    ', 'Pay here.png', 'enable', 0, '2020-08-24 09:04:13', 0, NULL), -(12, 0, 'Send BTC ', 'jpg', 'bitcoin', 'BTC address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
    Amount: 1
    Label:
    Message: ', 'Send BTC .jpg', 'enable', 0, '2020-09-01 10:51:08', 0, NULL); +(1, 1, 'Text qr code', 'png', 'text', 'Text: My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL), +(2, 1, 'Email', 'jpg', 'email', 'Email: assistance@domain.com
    Subject: Assistance request
    Message: Regarding my order N ° ... I require assistance', 'Email.jpg', 'enable', 0, '2020-08-24 08:44:13', 0, NULL), +(3, 1, 'Call me', 'png', 'phone', 'Phone number: 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL), +(4, 1, 'Send sms', 'png', 'sms', 'Phone number: 12563776756
    Message: Test message', 'Send sms.png', 'enable', 0, '2020-08-24 08:46:52', 0, NULL), +(5, 1, 'wa.me', 'svg', 'whatsapp', 'Phone number: 12563776756
    Message: Hey there! I am using WhatsApp', 'wa.me.svg', 'enable', 0, '2020-08-24 08:47:49', 0, NULL), +(6, 1, 'New York', 'png', 'location', 'Latitude: 40.7127753
    Longitude: -74.0059728', 'New York.png', 'enable', 0, '2020-08-24 08:51:55', 0, NULL), +(7, 1, 'John Doe', 'png', 'vcard', '
    Full name: John Doe
    Nickname: John
    Email: john@domain.com
    Website: https://johndoe.com
    Company: Doe Inc.
    Role: CEO
    Categories: electronics, vcard
    Note:
    Phone: 412-999-9988
    Home Phone: 412-999-5555
    Work phone: 412-444-2222
    Address: 123 Main Street Anywhere 15523 Arizona
    ', 'John Doe.png', 'enable', 0, '2020-08-24 08:55:59', 0, NULL), +(8, 1, 'Boat party', 'png', 'event', '
    Title: Party with friends
    Start event: 2020-08-26 09:00 AM
    End event: 2020-08-26 03:00 PM
    Location: New York
    Description: Happy Birthday Carl!
    URL:
    ', 'Boat party.png', 'enable', 0, '2020-08-24 08:58:20', 0, NULL), +(9, 1, 'Save me', 'svg', 'bookmark', 'Title: Google search
    Url: https://google.it', 'Save me.svg', 'enable', 0, '2020-08-24 08:59:46', 0, NULL), +(10, 1, 'Free wifi', 'png', 'wifi', 'Encryption: WPA
    SSID: TP-LINK-AB123
    Password: bBB8MR7TwbbUWMZT', 'Free wifi.png', 'enable', 0, '2020-08-24 09:02:35', 0, NULL), +(11, 1, 'Pay here', 'png', 'paypal', '
    Payment type: _click
    Email: paypal@domain.com
    Item name: T-shirt
    Item id: 177
    Amount: 15
    Currency: USD
    Shipping: 4
    Tax rate:
    ', 'Pay here.png', 'enable', 0, '2020-08-24 09:04:13', 0, NULL), +(12, 1, 'Send BTC', 'jpg', 'bitcoin', 'BTC address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
    Amount: 1
    Label:
    Message: ', 'Send BTC .jpg', 'enable', 0, '2020-09-01 10:51:08', 0, NULL); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/src/login.php b/src/login.php index 4d1d90c..ed92009 100644 --- a/src/login.php +++ b/src/login.php @@ -25,16 +25,13 @@ if (isset($_COOKIE['series_id']) && isset($_COOKIE['remember_token'])) // User found. verify remember token if (password_verify($remember_token, $row['remember_token'])) { - // Verify if expiry time is modified. - $expires = strtotime($row['expires']); + $expires = strtotime($row['expires']); - if (strtotime(date()) > $expires) - { - // Remember Cookie has expired. - clearAuthCookie(); - header('Location: login.php'); - exit; - } + if (time() > $expires) { + clearAuthCookie(); + header('Location: login.php'); + exit; + } $_SESSION['user_logged_in'] = TRUE; $_SESSION['type'] = $row['type']; diff --git a/src/saved_qrcode/Ebay.svg b/src/saved_qrcode/Ebay.svg deleted file mode 100644 index b181e2b..0000000 --- a/src/saved_qrcode/Ebay.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - QR Code - www.giandonatoinverso.it/read.php?id=a4F3kr - - - - - diff --git a/src/saved_qrcode/Send BTC.jpg b/src/saved_qrcode/Send BTC.jpg new file mode 100644 index 0000000..3fe7691 Binary files /dev/null and b/src/saved_qrcode/Send BTC.jpg differ diff --git a/src/upgrade/upgrade.php b/src/upgrade/upgrade.php index c79e75e..2ddcab7 100644 --- a/src/upgrade/upgrade.php +++ b/src/upgrade/upgrade.php @@ -30,14 +30,14 @@ if ($conn->query($sql) === TRUE) { echo "Error renaming column: " . $conn->error . "
    "; } -$sql = "ALTER TABLE " . DATABASE_PREFIX . "dynamic_qrcodes" . " ADD `id_owner` INT(25) NULL AFTER `id`"; +$sql = "ALTER TABLE " . DATABASE_PREFIX . "dynamic_qrcodes" . " ADD `id_owner` INT(25) NULL DEFAULT NULL AFTER `id`"; if ($conn->query($sql) === TRUE) { echo "The id_owner column has been added to dynamic_qrcodes successfully.
    "; } else { echo "Error adding column: " . $conn->error . "
    "; } -$sql = "ALTER TABLE " . DATABASE_PREFIX . "static_qrcodes" . " ADD `id_owner` INT(25) NULL AFTER `id`"; +$sql = "ALTER TABLE " . DATABASE_PREFIX . "static_qrcodes" . " ADD `id_owner` INT(25) NULL DEFAULT NULL AFTER `id`"; if ($conn->query($sql) === TRUE) { echo "The id_owner column has been added to static_qrcodes successfully.
    "; } else {