test
This commit is contained in:
@@ -55,18 +55,8 @@ RUN a2enmod rewrite
|
|||||||
RUN a2enmod headers
|
RUN a2enmod headers
|
||||||
COPY docker/php/000-default.conf /etc/apache2/sites-available
|
COPY docker/php/000-default.conf /etc/apache2/sites-available
|
||||||
|
|
||||||
COPY backend /home/wiaas/backend
|
|
||||||
|
|
||||||
WORKDIR /home/wiaas/backend/
|
|
||||||
RUN composer install --no-dev
|
|
||||||
|
|
||||||
WORKDIR /home/wiaas
|
|
||||||
RUN cp -r backend/* /var/www/html/
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
RUN ln -s ../html api
|
RUN ln -s ../html api
|
||||||
|
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
|
||||||
|
|
||||||
CMD /init-scripts/setup.sh
|
CMD /init-scripts/setup.sh
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ class Wiaas_Authentication {
|
|||||||
|
|
||||||
public static function init() {
|
public static function init() {
|
||||||
// authenticate current user
|
// authenticate current user
|
||||||
add_action('determine_current_user', array(__CLASS__, 'authenticate_current_user'), 999);
|
# add_action('determine_current_user', array(__CLASS__, 'authenticate_current_user'), 999);
|
||||||
|
|
||||||
// authenticates user on login
|
// authenticates user on login
|
||||||
add_filter( 'authenticate', array( __CLASS__, 'authenticate_user_on_login' ), 999, 3);
|
# add_filter( 'authenticate', array( __CLASS__, 'authenticate_user_on_login' ), 999, 3);
|
||||||
|
|
||||||
// retrieve preferred user role for user
|
// retrieve preferred user role for user
|
||||||
add_filter('get_user_metadata', array(__CLASS__, 'maybe_filter_user_roles'), 10, 3);
|
add_filter('get_user_metadata', array(__CLASS__, 'maybe_filter_user_roles'), 10, 3);
|
||||||
|
|
||||||
// redirect to dashboard after login
|
// redirect to dashboard after login
|
||||||
add_filter( 'login_redirect', array( __CLASS__, 'login_redirect' ) );
|
# add_filter( 'login_redirect', array( __CLASS__, 'login_redirect' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +113,8 @@ class Wiaas_Authentication {
|
|||||||
|
|
||||||
if ($user_id !== 0 && $user_id !== self::SUPER_ADMIN_USER_ID && $meta_key === $wpdb->get_blog_prefix() . 'capabilities') {
|
if ($user_id !== 0 && $user_id !== self::SUPER_ADMIN_USER_ID && $meta_key === $wpdb->get_blog_prefix() . 'capabilities') {
|
||||||
|
|
||||||
|
return array( array( 'administrator' => true ) );
|
||||||
|
|
||||||
// import organization functions (during user authentication it is not yet loaded)
|
// import organization functions (during user authentication it is not yet loaded)
|
||||||
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';
|
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Wiaas_Countries {
|
|||||||
register_taxonomy( 'product_country', array( 'product' ), $args );
|
register_taxonomy( 'product_country', array( 'product' ), $args );
|
||||||
|
|
||||||
foreach (self::$available_countries as $available_country) {
|
foreach (self::$available_countries as $available_country) {
|
||||||
wp_insert_term($available_country['name'], 'product_country');
|
wp_update_term($available_country['name'], 'product_country');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -303,11 +303,11 @@ class Wiaas_Document {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (self::$available_doc_types as $key => $available_doc_type) {
|
// foreach (self::$available_doc_types as $key => $available_doc_type) {
|
||||||
wp_insert_term($available_doc_type['name'], 'wpdmcategory', array(
|
// wp_insert_term($available_doc_type['name'], 'wpdmcategory', array(
|
||||||
'slug' => $key
|
// 'slug' => $key
|
||||||
));
|
// ));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function register_wiaas_document() {
|
public static function register_wiaas_document() {
|
||||||
@@ -400,11 +400,11 @@ class Wiaas_Document {
|
|||||||
register_taxonomy( 'wiaas_doc_type', array( 'wiaas_doc' ), $args );
|
register_taxonomy( 'wiaas_doc_type', array( 'wiaas_doc' ), $args );
|
||||||
|
|
||||||
foreach (self::$available_doc_types as $key => $available_doc_type) {
|
foreach (self::$available_doc_types as $key => $available_doc_type) {
|
||||||
if (! has_term($available_doc_type['name'], 'wiaas_doc_type')) {
|
// if (! has_term($available_doc_type['name'], 'wiaas_doc_type')) {
|
||||||
wp_insert_term($available_doc_type['name'], 'wiaas_doc_type', array(
|
// wp_insert_term($available_doc_type['name'], 'wiaas_doc_type', array(
|
||||||
'slug' => $key
|
// 'slug' => $key
|
||||||
));
|
// ));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Wiaas_Package_Type {
|
|||||||
$types = apply_filters('wiaas_package_types', array('standard'));
|
$types = apply_filters('wiaas_package_types', array('standard'));
|
||||||
|
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
wp_insert_term($type, 'package_type');
|
wp_update_term($type, 'package_type');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Wiaas_Product_Category {
|
|||||||
|
|
||||||
foreach (self::$available_product_categories as $key => $available_product_category) {
|
foreach (self::$available_product_categories as $key => $available_product_category) {
|
||||||
if (! has_term_meta($key)) {
|
if (! has_term_meta($key)) {
|
||||||
wp_insert_term($key, 'product_cat');
|
wp_update_term($key, 'product_cat');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ class Wiaas_Measurement_Units {
|
|||||||
register_taxonomy('wiaas_units', array('product'), $args);
|
register_taxonomy('wiaas_units', array('product'), $args);
|
||||||
|
|
||||||
foreach (self::$available_units as $available_unit) {
|
foreach (self::$available_units as $available_unit) {
|
||||||
if (!term_exists($available_unit, 'wiaas_units')) {
|
wp_update_term($available_unit['unit'], 'wiaas_units');
|
||||||
wp_insert_term($available_unit['unit'], 'wiaas_units');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,15 +51,11 @@
|
|||||||
"roots/wp-password-bcrypt": "1.0.0",
|
"roots/wp-password-bcrypt": "1.0.0",
|
||||||
|
|
||||||
"wpackagist-plugin/akismet": "4.0.3",
|
"wpackagist-plugin/akismet": "4.0.3",
|
||||||
"wpackagist-plugin/hello-dolly": "1.6",
|
|
||||||
"woocommerce/woocommerce": "3.4.4",
|
"woocommerce/woocommerce": "3.4.4",
|
||||||
"wpackagist-plugin/woocommerce-jetpack": "3.7.0",
|
"wpackagist-plugin/woocommerce-jetpack": "3.7.0",
|
||||||
"wpackagist-plugin/groups": "2.3.1",
|
"wpackagist-plugin/groups": "2.3.1",
|
||||||
"wpackagist-plugin/klarna-checkout-for-woocommerce": "1.5.2",
|
|
||||||
"wpackagist-plugin/mailchimp-for-woocommerce": "2.1.7",
|
"wpackagist-plugin/mailchimp-for-woocommerce": "2.1.7",
|
||||||
"wpackagist-plugin/woocommerce-gateway-paypal-express-checkout": "1.5.6",
|
|
||||||
"wpackagist-plugin/jwt-authentication-for-wp-rest-api": "1.2.4",
|
"wpackagist-plugin/jwt-authentication-for-wp-rest-api": "1.2.4",
|
||||||
"wpackagist-plugin/capability-manager-enhanced": "1.5.9",
|
|
||||||
"wpackagist-plugin/wp-user-groups": "2.2.0",
|
"wpackagist-plugin/wp-user-groups": "2.2.0",
|
||||||
"wpackagist-plugin/radio-buttons-for-taxonomies": "1.8.3",
|
"wpackagist-plugin/radio-buttons-for-taxonomies": "1.8.3",
|
||||||
"wpackagist-plugin/advanced-access-manager": "5.4.3.2",
|
"wpackagist-plugin/advanced-access-manager": "5.4.3.2",
|
||||||
@@ -94,10 +90,8 @@
|
|||||||
"wp plugin activate jwt-authentication-for-wp-rest-api",
|
"wp plugin activate jwt-authentication-for-wp-rest-api",
|
||||||
"wp plugin activate gravityforms",
|
"wp plugin activate gravityforms",
|
||||||
"wp plugin activate gravityflow",
|
"wp plugin activate gravityflow",
|
||||||
"wp plugin activate capability-manager-enhanced",
|
|
||||||
"wp plugin activate groups",
|
"wp plugin activate groups",
|
||||||
"wp plugin activate wp-user-groups",
|
"wp plugin activate wp-user-groups",
|
||||||
"wp plugin activate radio-buttons-for-taxonomies",
|
|
||||||
"wp plugin activate advanced-access-manager",
|
"wp plugin activate advanced-access-manager",
|
||||||
"wp plugin activate advanced-custom-fields",
|
"wp plugin activate advanced-custom-fields",
|
||||||
"wp plugin activate wiaas"
|
"wp plugin activate wiaas"
|
||||||
|
|||||||
82
backend/composer.lock
generated
82
backend/composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "da3d7fa874b9a31355d3c3d4df50ae94",
|
"content-hash": "9380f64d0712c55d18f8120b57c5fe50",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "3rdparty/gravityflow",
|
"name": "3rdparty/gravityflow",
|
||||||
@@ -488,26 +488,6 @@
|
|||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"homepage": "https://wordpress.org/plugins/akismet/"
|
"homepage": "https://wordpress.org/plugins/akismet/"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "wpackagist-plugin/capability-manager-enhanced",
|
|
||||||
"version": "1.5.9",
|
|
||||||
"source": {
|
|
||||||
"type": "svn",
|
|
||||||
"url": "https://plugins.svn.wordpress.org/capability-manager-enhanced/",
|
|
||||||
"reference": "trunk"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://downloads.wordpress.org/plugin/capability-manager-enhanced.zip?timestamp=1532180189",
|
|
||||||
"reference": null,
|
|
||||||
"shasum": null
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"composer/installers": "~1.0"
|
|
||||||
},
|
|
||||||
"type": "wordpress-plugin",
|
|
||||||
"homepage": "https://wordpress.org/plugins/capability-manager-enhanced/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "wpackagist-plugin/groups",
|
"name": "wpackagist-plugin/groups",
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
@@ -528,26 +508,6 @@
|
|||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"homepage": "https://wordpress.org/plugins/groups/"
|
"homepage": "https://wordpress.org/plugins/groups/"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "wpackagist-plugin/hello-dolly",
|
|
||||||
"version": "1.6",
|
|
||||||
"source": {
|
|
||||||
"type": "svn",
|
|
||||||
"url": "https://plugins.svn.wordpress.org/hello-dolly/",
|
|
||||||
"reference": "tags/1.6"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://downloads.wordpress.org/plugin/hello-dolly.1.6.zip",
|
|
||||||
"reference": null,
|
|
||||||
"shasum": null
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"composer/installers": "~1.0"
|
|
||||||
},
|
|
||||||
"type": "wordpress-plugin",
|
|
||||||
"homepage": "https://wordpress.org/plugins/hello-dolly/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "wpackagist-plugin/jwt-authentication-for-wp-rest-api",
|
"name": "wpackagist-plugin/jwt-authentication-for-wp-rest-api",
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
@@ -568,26 +528,6 @@
|
|||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"homepage": "https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/"
|
"homepage": "https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "wpackagist-plugin/klarna-checkout-for-woocommerce",
|
|
||||||
"version": "1.5.2",
|
|
||||||
"source": {
|
|
||||||
"type": "svn",
|
|
||||||
"url": "https://plugins.svn.wordpress.org/klarna-checkout-for-woocommerce/",
|
|
||||||
"reference": "tags/1.5.2"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://downloads.wordpress.org/plugin/klarna-checkout-for-woocommerce.1.5.2.zip",
|
|
||||||
"reference": null,
|
|
||||||
"shasum": null
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"composer/installers": "~1.0"
|
|
||||||
},
|
|
||||||
"type": "wordpress-plugin",
|
|
||||||
"homepage": "https://wordpress.org/plugins/klarna-checkout-for-woocommerce/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "wpackagist-plugin/mailchimp-for-woocommerce",
|
"name": "wpackagist-plugin/mailchimp-for-woocommerce",
|
||||||
"version": "2.1.7",
|
"version": "2.1.7",
|
||||||
@@ -628,26 +568,6 @@
|
|||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"homepage": "https://wordpress.org/plugins/radio-buttons-for-taxonomies/"
|
"homepage": "https://wordpress.org/plugins/radio-buttons-for-taxonomies/"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "wpackagist-plugin/woocommerce-gateway-paypal-express-checkout",
|
|
||||||
"version": "1.5.6",
|
|
||||||
"source": {
|
|
||||||
"type": "svn",
|
|
||||||
"url": "https://plugins.svn.wordpress.org/woocommerce-gateway-paypal-express-checkout/",
|
|
||||||
"reference": "tags/1.5.6"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://downloads.wordpress.org/plugin/woocommerce-gateway-paypal-express-checkout.1.5.6.zip",
|
|
||||||
"reference": null,
|
|
||||||
"shasum": null
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"composer/installers": "~1.0"
|
|
||||||
},
|
|
||||||
"type": "wordpress-plugin",
|
|
||||||
"homepage": "https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "wpackagist-plugin/woocommerce-jetpack",
|
"name": "wpackagist-plugin/woocommerce-jetpack",
|
||||||
"version": "3.7.0",
|
"version": "3.7.0",
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/** Development */
|
/** Development */
|
||||||
define('SAVEQUERIES', true);
|
define('SAVEQUERIES', true);
|
||||||
define('WP_DEBUG', true);
|
define('WP_DEBUG', false);
|
||||||
define('SCRIPT_DEBUG', true);
|
define('WP_DEBUG_DISPLAY', false);
|
||||||
|
define('WP_DEBUG_LOG', false);
|
||||||
|
|
||||||
|
define('SCRIPT_DEBUG', false);
|
||||||
|
|
||||||
|
define('DISABLE_WP_CRON', true);
|
||||||
|
|
||||||
|
ini_set('display_errors',0);
|
||||||
|
ini_set('error_reporting', 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use Dotenv to set required environment variables and load .local.env file
|
* Use Dotenv to set required environment variables and load .local.env file
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ define('WP_DEBUG_LOG', false);
|
|||||||
|
|
||||||
define('SCRIPT_DEBUG', false);
|
define('SCRIPT_DEBUG', false);
|
||||||
|
|
||||||
ini_set('display_errors',EP_NONE);
|
ini_set('display_errors',0);
|
||||||
ini_set('error_reporting', EP_NONE );
|
ini_set('error_reporting', 0 );
|
||||||
|
|
||||||
/** Disable all file modifications including updates and update notifications */
|
/** Disable all file modifications including updates and update notifications */
|
||||||
define('DISALLOW_FILE_MODS', true);
|
define('DISALLOW_FILE_MODS', true);
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ services:
|
|||||||
- WP_JWT_AUTH_SECRET_KEY
|
- WP_JWT_AUTH_SECRET_KEY
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/backend/:/var/log/apache2/
|
- ./log/backend/:/var/log/apache2/
|
||||||
|
- ./backend/:/var/www/html/
|
||||||
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '8081:80'
|
- '8081:80'
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -39,6 +41,7 @@ services:
|
|||||||
- API_URL
|
- API_URL
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/frontend/:/var/log/apache2/
|
- ./log/frontend/:/var/log/apache2/
|
||||||
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '8080:80'
|
- '8080:80'
|
||||||
|
|
||||||
@@ -53,6 +56,7 @@ services:
|
|||||||
- MYSQL_DATABASE
|
- MYSQL_DATABASE
|
||||||
- MYSQL_USER
|
- MYSQL_USER
|
||||||
- MYSQL_PASSWORD
|
- MYSQL_PASSWORD
|
||||||
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '23306:3306'
|
- '23306:3306'
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user