>|null
+ */
public $richTabPlugins;
/*
@@ -51,11 +59,8 @@ class Kint extends BaseConfig
| CLI Settings
|--------------------------------------------------------------------------
*/
- public $cliColors = true;
-
- public $cliForceUTF8 = false;
-
- public $cliDetectWidth = true;
-
- public $cliMinWidth = 40;
+ public bool $cliColors = true;
+ public bool $cliForceUTF8 = false;
+ public bool $cliDetectWidth = true;
+ public int $cliMinWidth = 40;
}
diff --git a/ci4/app/Config/Publisher.php b/ci4/app/Config/Publisher.php
new file mode 100644
index 00000000..bf03be1d
--- /dev/null
+++ b/ci4/app/Config/Publisher.php
@@ -0,0 +1,28 @@
+
+ */
+ public $restrictions = [
+ ROOTPATH => '*',
+ FCPATH => '#\.(s?css|js|map|html?|xml|json|webmanifest|ttf|eot|woff2?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i',
+ ];
+}
diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php
index cd7334ff..e7ce008e 100755
--- a/ci4/app/Config/Routes.php
+++ b/ci4/app/Config/Routes.php
@@ -1,36 +1,13 @@
setDefaultNamespace('App\Controllers');
-$routes->setDefaultController('Home');
-$routes->setDefaultMethod('index');
-$routes->setTranslateURIDashes(false);
-$routes->set404Override();
-$routes->setAutoRoute(true);
-*/
-// Create a new instance of our RouteCollection class.
-$routes = Services::routes();
+//service('auth')->routes($routes, ['except' => ['login', 'register']]);
+service('auth')->routes($routes);
//WEB ROUTER ------------------------------------------------------
//------------------------------------------------------------------
diff --git a/ci4/app/Config/Routing.php b/ci4/app/Config/Routing.php
index bd091a65..c0234da8 100644
--- a/ci4/app/Config/Routing.php
+++ b/ci4/app/Config/Routing.php
@@ -87,7 +87,7 @@ class Routing extends BaseRouting
*
* If FALSE, will stop searching and do NO automatic routing.
*/
- public bool $autoRoute = true;
+ public bool $autoRoute = false;
/**
* If TRUE, will enable the use of the 'prioritize' option
diff --git a/ci4/app/Config/Toolbar.php b/ci4/app/Config/Toolbar.php
old mode 100755
new mode 100644
diff --git a/ci4/app/Database/Migrations/2023-04-22-074343_ChangeTablesNames.php b/ci4/app/Database/Migrations/2023-04-22-074343_ChangeTablesNames.php
deleted file mode 100755
index 0e0782ae..00000000
--- a/ci4/app/Database/Migrations/2023-04-22-074343_ChangeTablesNames.php
+++ /dev/null
@@ -1,45 +0,0 @@
-forge->renameTable('wg_activity', 'auth_activity');
- $this->forge->renameTable('wg_backup', 'auth_backup');
- $this->forge->renameTable('wg_confirmation_token', 'auth_confirmation_token');
- $this->forge->renameTable('wg_crontab_history', 'auth_crontab_history');
- $this->forge->renameTable('wg_notification', 'auth_notification');
- $this->forge->renameTable('wg_password_recovery', 'auth_password_recovery');
- $this->forge->renameTable('wg_settings', 'auth_settings');
- $this->forge->renameTable('wg_template', 'auth_template');
- $this->forge->renameTable('wg_theme', 'auth_theme');
- $this->forge->renameTable('wg_timezone', 'auth_timezone');
- $this->forge->renameTable('wg_user', 'auth_user');
- $this->forge->renameTable('wg_user_group', 'auth_user_group');
- $this->forge->renameTable('wg_user_group', 'auth_user_group');
- $this->forge->renameTable('wg_countries', 'auth_countries');
- $this->forge->renameTable('wg_currency', 'auth_currency');
- }
-
- public function down()
- {
- $this->forge->renameTable('auth_activity', 'wg_activity');
- $this->forge->renameTable('auth_backup', 'wg_backup');
- $this->forge->renameTable('auth_confirmation_token', 'wg_confirmation_token');
- $this->forge->renameTable('auth_crontab_history', 'wg_crontab_history');
- $this->forge->renameTable('wg_notification', 'auth_notification');
- $this->forge->renameTable('auth_password_recovery', 'wg_password_recovery');
- $this->forge->renameTable('auth_settings', 'wg_settings');
- $this->forge->renameTable('auth_template', 'wg_template');
- $this->forge->renameTable('auth_theme', 'wg_theme');
- $this->forge->renameTable('auth_timezone', 'wg_timezone');
- $this->forge->renameTable('auth_user', 'wg_user');
- $this->forge->renameTable('auth_user_group', 'wg_user_group');
- $this->forge->renameTable('auth_countries', 'wg_countries');
- $this->forge->renameTable('auth_currency', 'wg_currency');
- }
-}
diff --git a/ci4/app/Database/Migrations/2023-04-22-083118_CreateGroupUserTable.php b/ci4/app/Database/Migrations/2023-04-22-083118_CreateGroupUserTable.php
deleted file mode 100755
index 622f5229..00000000
--- a/ci4/app/Database/Migrations/2023-04-22-083118_CreateGroupUserTable.php
+++ /dev/null
@@ -1,33 +0,0 @@
- array(
- 'type' => 'VARCHAR',
- 'constraint' => 35
- ),
- 'token_group' => array(
- 'type' => 'VARCHAR',
- 'constraint' => 35
- )
- );
-
- $this->forge->addField($fields);
-
- // create table
- $this->forge->createTable('group_user');
- }
-
- public function down()
- {
- $this->forge->dropTable('group_user',TRUE);
- }
-}
diff --git a/ci4/app/Database/Migrations/2023-04-25-161753_RemoveGroupFromUser.php b/ci4/app/Database/Migrations/2023-04-25-161753_RemoveGroupFromUser.php
deleted file mode 100755
index ee72788e..00000000
--- a/ci4/app/Database/Migrations/2023-04-25-161753_RemoveGroupFromUser.php
+++ /dev/null
@@ -1,19 +0,0 @@
-forge->dropColumn('auth_user', ['group']);
- }
-
- public function down()
- {
- $sql = "ALTER TABLE `auth_user` ADD `group` varchar(216) COLLATE latin1_general_ci;";
- $this->db->query($sql);
- }
-}
diff --git a/ci4/app/Database/Migrations/2023_03_27_185500_DeleteOauthTables.php b/ci4/app/Database/Migrations/2023_03_27_185500_DeleteOauthTables.php
deleted file mode 100755
index 510986cb..00000000
--- a/ci4/app/Database/Migrations/2023_03_27_185500_DeleteOauthTables.php
+++ /dev/null
@@ -1,43 +0,0 @@
-forge->dropTable('wg_user_oauth');
- $this->forge->dropTable('wg_settings_oauth');
- }
-
- public function down()
- {
- $sql = "CREATE TABLE IF NOT EXISTS `wg_settings_oauth` (
- `id_oauth` int(11) NOT NULL AUTO_INCREMENT,
- `provider` enum('facebook','google','twitter','linkedin','github','instagram','slack','spotify','reddit','discord','dribbble','dropbox','gitlab','strava','tumblr','twitch','vkontakte','wordpress','yahoo','bitbucket','wechat') COLLATE latin1_general_ci NOT NULL,
- `key` varchar(200) COLLATE latin1_general_ci DEFAULT NULL,
- `secret` varchar(200) COLLATE latin1_general_ci DEFAULT NULL,
- `btn_class` varchar(50) COLLATE latin1_general_ci NOT NULL,
- `btn_text` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
- `show_text` tinyint(1) NOT NULL DEFAULT '0',
- `icon_class` varchar(50) COLLATE latin1_general_ci NOT NULL,
- `status` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id_oauth`)
- ) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;";
- $this->db->query($sql);
-
- $sql = "CREATE TABLE IF NOT EXISTS `wg_user_oauth` (
- `id_user_oauth` int(11) NOT NULL AUTO_INCREMENT,
- `user` varchar(35) COLLATE latin1_general_ci NOT NULL,
- `provider` enum('facebook','google','twitter','linkedin','github','instagram','slack','spotify','reddit','discord','dribbble','dropbox','gitlab','strava','tumblr','twitch','vkontakte','wordpress','yahoo','bitbucket') COLLATE latin1_general_ci NOT NULL,
- `identifier` varchar(50) COLLATE latin1_general_ci NOT NULL,
- `picture` varchar(150) COLLATE latin1_general_ci NOT NULL,
- `created_at` timestamp NOT NULL,
- `updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id_user_oauth`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;";
- $this->db->query($sql);
- }
-}
\ No newline at end of file
diff --git a/ci4/app/Database/Migrations/2023_03_28_200000_DeleteSMSColumns.php b/ci4/app/Database/Migrations/2023_03_28_200000_DeleteSMSColumns.php
deleted file mode 100755
index 0246bac6..00000000
--- a/ci4/app/Database/Migrations/2023_03_28_200000_DeleteSMSColumns.php
+++ /dev/null
@@ -1,42 +0,0 @@
-forge->dropColumn('notification', ['is_send_sms', 'send_sms_notification']);
- $this->forge->dropColumn('settings', ['sms_gateway','sms_account_id', 'sms_auth_token', 'sms_info_add',
- 'sms_confirmation', 'send_sms_register', 'send_sms_welcome']);
- $this->forge->dropColumn('user', ['sms_confirmed']);
- }
-
- public function down()
- {
- $sql = "ALTER TABLE `wg_notification` ADD `is_send_sms` tinyint(1) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_notification` ADD `send_sms_notification` tinyint(1) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
-
- $sql = "ALTER TABLE `wg_settings` ADD `sms_gateway` enum('twilio') COLLATE latin1_general_ci NOT NULL DEFAULT 'twilio';";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `sms_account_id` varchar(255) COLLATE latin1_general_ci DEFAULT NULL;";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `sms_auth_token` varchar(255) COLLATE latin1_general_ci DEFAULT NULL;";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `sms_info_add` varchar(255) COLLATE latin1_general_ci DEFAULT NULL;";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `sms_confirmation` tinyint(1) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `send_sms_register` tinyint(1) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
- $sql = "ALTER TABLE `wg_settings` ADD `send_sms_welcome` tinyint(1) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
-
- $sql = "ALTER TABLE `wg_user` ADD `sms_confirmed` tinyint(4) NOT NULL DEFAULT '0';";
- $this->db->query($sql);
- }
-}
\ No newline at end of file
diff --git a/ci4/app/Filters/JWTAuthFilter.php b/ci4/app/Filters/JWTAuthFilter.php
deleted file mode 100755
index 9f9a5bdc..00000000
--- a/ci4/app/Filters/JWTAuthFilter.php
+++ /dev/null
@@ -1,28 +0,0 @@
-getServer('HTTP_AUTHORIZATION')));
- return $request;
- } catch (Exception $e) {
- return Services::response()->setJSON(['error' => $e->getMessage()])->setStatusCode(ResponseInterface::HTTP_UNAUTHORIZED);
- }
- }
-
- public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
- {
-
- }
-}
\ No newline at end of file
diff --git a/ci4/app/Filters/LoginAuthFilter.php b/ci4/app/Filters/LoginAuthFilter.php
index 6bfa7ab0..3e91a47c 100755
--- a/ci4/app/Filters/LoginAuthFilter.php
+++ b/ci4/app/Filters/LoginAuthFilter.php
@@ -12,7 +12,7 @@ class LoginAuthFilter implements FilterInterface
public function before(RequestInterface $request, $arguments = null)
{
try {
- if(!$this->validateIgnoreControllerAccess()){
+ /*if(!$this->validateIgnoreControllerAccess()){
$session = session();
$token = $session->get('token')??'';
$tfa = $session->get('tfa')??false;
@@ -24,7 +24,7 @@ class LoginAuthFilter implements FilterInterface
}else{
$this->validateControllerAccess();
}
- }
+ }*/
} catch (Exception $e) {
}
diff --git a/ci4/app/Filters/ThrottlerFilter.php b/ci4/app/Filters/ThrottlerFilter.php
deleted file mode 100755
index d7538ba0..00000000
--- a/ci4/app/Filters/ThrottlerFilter.php
+++ /dev/null
@@ -1,43 +0,0 @@
-getIPAddress();
- $settingsBase = new SettingsModel();
- $settings = $settingsBase->first()??[];
- if(!$settings['enable_api']){
- return Services::response()->setJSON(['error' => 'ApiRest is currently disabled.'])->setStatusCode(ResponseInterface::HTTP_UNAUTHORIZED);
- }
- if($settings['block_external_api']){
- if($ip != $settings['ip_allowed_api']??''){
- return Services::response()->setJSON(['error' => 'Endpoint access from external domains is not allowed.'])->setStatusCode(ResponseInterface::HTTP_UNAUTHORIZED);
- }
- if ($throttler->check($ip, 60, MINUTE) === false)
- {
- return Services::response()->setStatusCode(429);
- }
- }
- } catch (Exception $e) {
- return Services::response()->setJSON(['error' => $e->getMessage()])->setStatusCode(ResponseInterface::HTTP_UNAUTHORIZED);
- }
- }
-
- public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
- {
-
- }
-}
\ No newline at end of file
diff --git a/ci4/app/UserModel.php b/ci4/app/UserModel.php
new file mode 100644
index 00000000..4cae8741
--- /dev/null
+++ b/ci4/app/UserModel.php
@@ -0,0 +1,21 @@
+allowedFields = [
+ ...$this->allowedFields,
+
+ // 'first_name',
+ ];
+ }
+}
diff --git a/ci4/app/Views/Shield/Email/email_2fa_email.php b/ci4/app/Views/Shield/Email/email_2fa_email.php
new file mode 100644
index 00000000..c93d8e80
--- /dev/null
+++ b/ci4/app/Views/Shield/Email/email_2fa_email.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+ = lang('Auth.email2FASubject') ?>
+
+
+
+ = lang('Auth.email2FAMailBody') ?>
+
+
= $code ?>
+
+
+ = lang('Auth.emailInfo') ?>
+ = lang('Auth.emailIpAddress') ?> = esc($ipAddress) ?>
+ = lang('Auth.emailDevice') ?> = esc($userAgent) ?>
+ = lang('Auth.emailDate') ?> = esc($date) ?>
+
+
+