Refactoring docker image building, NEW: added docker compose support
Signed-off-by: giandonato.inverso@edempg.it <giandonato.inverso@studenti.unimi.it>
This commit is contained in:
committed by
giandonato.inverso@edempg.it
parent
5335b6fb7e
commit
68a2b9f7f3
@@ -0,0 +1,3 @@
|
||||
# Exclude specific directories
|
||||
src/install/
|
||||
src/upgrade/
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
.settings
|
||||
.project
|
||||
.idea
|
||||
.DS_Store
|
||||
src/config/environment.php
|
||||
.DS_Store
|
||||
+24
@@ -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"]
|
||||
@@ -12,7 +12,7 @@
|
||||
<li><strong>#1 Dynamic Qr code generator on GitHub with database to store Qr codes</strong></li>
|
||||
<li>Create unlimited Qr code</li>
|
||||
<li>Easy installation wizard</li>
|
||||
<li>Control panel with 2 access levels</li>
|
||||
<li>Control panel with 2 access levels and multi-user support</li>
|
||||
<li>Dashboard with advanced statistics on Qr code created and on scans</li>
|
||||
<li>Dynamic Qr code</li>
|
||||
<ul>
|
||||
@@ -75,4 +75,9 @@
|
||||
<li>Added script for upgrading to versions >= 2.0</li>
|
||||
<li>NEW: added multi-user support for dynamic/static qrcodes</li>
|
||||
</ul>
|
||||
<li>Version 2.2 – 16th October, 2023</li>
|
||||
<ul>
|
||||
<li>Refactoring docker image building</li>
|
||||
<li>NEW: added docker compose support</li>
|
||||
</ul>
|
||||
</ul>
|
||||
@@ -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
|
||||
@@ -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"]
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
<?php phpinfo( ); ?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /var/www/html/
|
||||
<Directory “/var/www/html/”>
|
||||
AllowOverride all
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
|
||||
</VirtualHost>
|
||||
@@ -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
|
||||
+25
-5
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
/*
|
||||
Vendored
+2
-2
@@ -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('<i class="fas fa-exclamation-circle"></i> ' + res.data);
|
||||
$('#err-msg').append('<i class="fas fa-exclamation-circle"></i> ' + err.responseText);
|
||||
$('#err-msg').css('display', 'block');
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<strong>Copyright © <?php echo date("Y");?> <a href="#">PHP Qrcode Generator</a> - </strong>
|
||||
All rights reserved by Giandonato Inverso.
|
||||
<div class="float-right d-none d-sm-inline-block">
|
||||
<b>Version</b> 2.1.0
|
||||
<b>Version</b> 2.2.0
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -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', '<strong>Text:</strong> My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL),
|
||||
(2, 0, 'Email', 'jpg', 'email', '<strong>Email:</strong> assistance@domain.com<br><strong>Subject:</strong> Assistance request<br><strong>Message:</strong> 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', '<strong>Phone number:</strong> 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL),
|
||||
(4, 0, 'Send sms', 'png', 'sms', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> Test message', 'Send sms.png', 'enable', 0, '2020-08-24 08:46:52', 0, NULL),
|
||||
(5, 0, 'wa.me', 'svg', 'whatsapp', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> 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', '<strong>Latitude:</strong> 40.7127753<br><strong>Longitude:</strong> -74.0059728', 'New York.png', 'enable', 0, '2020-08-24 08:51:55', 0, NULL),
|
||||
(7, 0, 'John Doe', 'png', 'vcard', '<div class="row"><div class="col-sm-4"><strong>Full name:</strong> John Doe<br><strong>Nickname:</strong> John<br><strong>Email:</strong> john@domain.com<br><strong>Website:</strong> https://johndoe.com</div><div class="col-sm-4"><strong>Company:</strong> Doe Inc.<br><strong>Role:</strong> CEO<br><strong>Categories:</strong> electronics, vcard<br><strong>Note:</strong> </div><div class="col-sm-4"><strong>Phone:</strong> 412-999-9988<br><strong>Home Phone:</strong> 412-999-5555<br><strong>Work phone:</strong> 412-444-2222<br><strong>Address:</strong> 123 Main Street Anywhere 15523 Arizona</div></div>', 'John Doe.png', 'enable', 0, '2020-08-24 08:55:59', 0, NULL),
|
||||
(8, 0, 'Boat party', 'png', 'event', '<div class="row"><div class="col-sm-4"><strong>Title:</strong> Party with friends<br><strong>Start event:</strong> 2020-08-26 09:00 AM<br><strong>End event:</strong> 2020-08-26 03:00 PM<br></div><div class="col-sm-4"><strong>Location:</strong> New York<br><strong>Description:</strong> Happy Birthday Carl!<br><strong>URL:</strong> </div></div>', 'Boat party.png', 'enable', 0, '2020-08-24 08:58:20', 0, NULL),
|
||||
(9, 0, 'Save me', 'svg', 'bookmark', '<strong>Title:</strong> Google search<br><strong>Url:</strong> https://google.it', 'Save me.svg', 'enable', 0, '2020-08-24 08:59:46', 0, NULL),
|
||||
(10, 0, 'Free wifi', 'png', 'wifi', '<strong>Encryption:</strong> WPA<br><strong>SSID:</strong> TP-LINK-AB123<br><strong>Password:</strong> bBB8MR7TwbbUWMZT', 'Free wifi.png', 'enable', 0, '2020-08-24 09:02:35', 0, NULL),
|
||||
(11, 0, 'Pay here', 'png', 'paypal', '<div class="row"><div class="col-sm-4"><strong>Payment type:</strong> _click<br><strong>Email:</strong> paypal@domain.com<br><strong>Item name:</strong> T-shirt<br><strong>Item id:</strong> 177</div><div class="col-sm-4"><strong>Amount:</strong> 15<br><strong>Currency:</strong> USD<br><strong>Shipping:</strong> 4<br><strong>Tax rate:</strong> </div></div>', 'Pay here.png', 'enable', 0, '2020-08-24 09:04:13', 0, NULL),
|
||||
(12, 0, 'Send BTC ', 'jpg', 'bitcoin', '<strong>BTC address:</strong> 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa<br><strong>Amount:</strong> 1<br><strong>Label:</strong> <br><strong>Message:</strong> ', 'Send BTC .jpg', 'enable', 0, '2020-09-01 10:51:08', 0, NULL);
|
||||
(1, 1, 'Text qr code', 'png', 'text', '<strong>Text:</strong> My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL),
|
||||
(2, 1, 'Email', 'jpg', 'email', '<strong>Email:</strong> assistance@domain.com<br><strong>Subject:</strong> Assistance request<br><strong>Message:</strong> 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', '<strong>Phone number:</strong> 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL),
|
||||
(4, 1, 'Send sms', 'png', 'sms', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> Test message', 'Send sms.png', 'enable', 0, '2020-08-24 08:46:52', 0, NULL),
|
||||
(5, 1, 'wa.me', 'svg', 'whatsapp', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> 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', '<strong>Latitude:</strong> 40.7127753<br><strong>Longitude:</strong> -74.0059728', 'New York.png', 'enable', 0, '2020-08-24 08:51:55', 0, NULL),
|
||||
(7, 1, 'John Doe', 'png', 'vcard', '<div class="row"><div class="col-sm-4"><strong>Full name:</strong> John Doe<br><strong>Nickname:</strong> John<br><strong>Email:</strong> john@domain.com<br><strong>Website:</strong> https://johndoe.com</div><div class="col-sm-4"><strong>Company:</strong> Doe Inc.<br><strong>Role:</strong> CEO<br><strong>Categories:</strong> electronics, vcard<br><strong>Note:</strong> </div><div class="col-sm-4"><strong>Phone:</strong> 412-999-9988<br><strong>Home Phone:</strong> 412-999-5555<br><strong>Work phone:</strong> 412-444-2222<br><strong>Address:</strong> 123 Main Street Anywhere 15523 Arizona</div></div>', 'John Doe.png', 'enable', 0, '2020-08-24 08:55:59', 0, NULL),
|
||||
(8, 1, 'Boat party', 'png', 'event', '<div class="row"><div class="col-sm-4"><strong>Title:</strong> Party with friends<br><strong>Start event:</strong> 2020-08-26 09:00 AM<br><strong>End event:</strong> 2020-08-26 03:00 PM<br></div><div class="col-sm-4"><strong>Location:</strong> New York<br><strong>Description:</strong> Happy Birthday Carl!<br><strong>URL:</strong> </div></div>', 'Boat party.png', 'enable', 0, '2020-08-24 08:58:20', 0, NULL),
|
||||
(9, 1, 'Save me', 'svg', 'bookmark', '<strong>Title:</strong> Google search<br><strong>Url:</strong> https://google.it', 'Save me.svg', 'enable', 0, '2020-08-24 08:59:46', 0, NULL),
|
||||
(10, 1, 'Free wifi', 'png', 'wifi', '<strong>Encryption:</strong> WPA<br><strong>SSID:</strong> TP-LINK-AB123<br><strong>Password:</strong> bBB8MR7TwbbUWMZT', 'Free wifi.png', 'enable', 0, '2020-08-24 09:02:35', 0, NULL),
|
||||
(11, 1, 'Pay here', 'png', 'paypal', '<div class="row"><div class="col-sm-4"><strong>Payment type:</strong> _click<br><strong>Email:</strong> paypal@domain.com<br><strong>Item name:</strong> T-shirt<br><strong>Item id:</strong> 177</div><div class="col-sm-4"><strong>Amount:</strong> 15<br><strong>Currency:</strong> USD<br><strong>Shipping:</strong> 4<br><strong>Tax rate:</strong> </div></div>', 'Pay here.png', 'enable', 0, '2020-08-24 09:04:13', 0, NULL),
|
||||
(12, 1, 'Send BTC', 'jpg', 'bitcoin', '<strong>BTC address:</strong> 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa<br><strong>Amount:</strong> 1<br><strong>Label:</strong> <br><strong>Message:</strong> ', '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 */;
|
||||
|
||||
+6
-9
@@ -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'];
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -30,14 +30,14 @@ if ($conn->query($sql) === TRUE) {
|
||||
echo "Error renaming column: " . $conn->error . "<br>";
|
||||
}
|
||||
|
||||
$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.<br>";
|
||||
} else {
|
||||
echo "Error adding column: " . $conn->error . "<br>";
|
||||
}
|
||||
|
||||
$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.<br>";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user