@@ -0,0 +1,127 @@ | |||
#------------------------- | |||
# Operating Specific Junk Files | |||
#------------------------- | |||
# OS X | |||
.DS_Store | |||
.AppleDouble | |||
.LSOverride | |||
# OS X Thumbnails | |||
._* | |||
# Windows image file caches | |||
Thumbs.db | |||
ehthumbs.db | |||
Desktop.ini | |||
# Recycle Bin used on file shares | |||
$RECYCLE.BIN/ | |||
# Windows Installer files | |||
*.cab | |||
*.msi | |||
*.msm | |||
*.msp | |||
# Windows shortcuts | |||
*.lnk | |||
# Linux | |||
*~ | |||
# KDE directory preferences | |||
.directory | |||
# Linux trash folder which might appear on any partition or disk | |||
.Trash-* | |||
#------------------------- | |||
# Environment Files | |||
#------------------------- | |||
# These should never be under version control, | |||
# as it poses a security risk. | |||
.env | |||
.vagrant | |||
Vagrantfile | |||
#------------------------- | |||
# Temporary Files | |||
#------------------------- | |||
writable/cache/* | |||
!writable/cache/index.html | |||
writable/logs/* | |||
!writable/logs/index.html | |||
writable/session/* | |||
!writable/session/index.html | |||
writable/uploads/* | |||
!writable/uploads/index.html | |||
writable/debugbar/* | |||
php_errors.log | |||
#------------------------- | |||
# User Guide Temp Files | |||
#------------------------- | |||
user_guide_src/build/* | |||
user_guide_src/cilexer/build/* | |||
user_guide_src/cilexer/dist/* | |||
user_guide_src/cilexer/pycilexer.egg-info/* | |||
#------------------------- | |||
# Test Files | |||
#------------------------- | |||
tests/coverage* | |||
# Don't save phpunit under version control. | |||
phpunit | |||
#------------------------- | |||
# Composer | |||
#------------------------- | |||
vendor/ | |||
#------------------------- | |||
# IDE / Development Files | |||
#------------------------- | |||
# Modules Testing | |||
_modules/* | |||
# phpenv local config | |||
.php-version | |||
# Jetbrains editors (PHPStorm, etc) | |||
.idea/ | |||
*.iml | |||
# Netbeans | |||
nbproject/ | |||
build/ | |||
nbbuild/ | |||
dist/ | |||
nbdist/ | |||
nbactions.xml | |||
nb-configuration.xml | |||
.nb-gradle/ | |||
# Sublime Text | |||
*.tmlanguage.cache | |||
*.tmPreferences.cache | |||
*.stTheme.cache | |||
*.sublime-workspace | |||
*.sublime-project | |||
.phpintel | |||
/api/ | |||
# Visual Studio Code | |||
.vscode/ | |||
/results/ | |||
/phpunit*.xml | |||
/.phpunit.*.cache | |||
@@ -0,0 +1,22 @@ | |||
The MIT License (MIT) | |||
Copyright (c) 2014-2019 British Columbia Institute of Technology | |||
Copyright (c) 2019-2022 CodeIgniter Foundation | |||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||
of this software and associated documentation files (the "Software"), to deal | |||
in the Software without restriction, including without limitation the rights | |||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
copies of the Software, and to permit persons to whom the Software is | |||
furnished to do so, subject to the following conditions: | |||
The above copyright notice and this permission notice shall be included in | |||
all copies or substantial portions of the Software. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
THE SOFTWARE. |
@@ -0,0 +1,63 @@ | |||
# CodeIgniter 4 Application Starter | |||
## What is CodeIgniter? | |||
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. | |||
More information can be found at the [official site](http://codeigniter.com). | |||
This repository holds a composer-installable app starter. | |||
It has been built from the | |||
[development repository](https://github.com/codeigniter4/CodeIgniter4). | |||
More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. | |||
The user guide corresponding to this version of the framework can be found | |||
[here](https://codeigniter4.github.io/userguide/). | |||
## Installation & updates | |||
`composer create-project codeigniter4/appstarter` then `composer update` whenever | |||
there is a new release of the framework. | |||
When updating, check the release notes to see if there are any changes you might need to apply | |||
to your `app` folder. The affected files can be copied or merged from | |||
`vendor/codeigniter4/framework/app`. | |||
## Setup | |||
Copy `env` to `.env` and tailor for your app, specifically the baseURL | |||
and any database settings. | |||
## Important Change with index.php | |||
`index.php` is no longer in the root of the project! It has been moved inside the *public* folder, | |||
for better security and separation of components. | |||
This means that you should configure your web server to "point" to your project's *public* folder, and | |||
not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the | |||
framework are exposed. | |||
**Please** read the user guide for a better explanation of how CI4 works! | |||
## Repository Management | |||
We use GitHub issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages. | |||
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss | |||
FEATURE REQUESTS. | |||
This repository is a "distribution" one, built by our release preparation script. | |||
Problems with it can be raised on our forum, or as issues in the main repository. | |||
## Server Requirements | |||
PHP version 7.4 or higher is required, with the following extensions installed: | |||
- [intl](http://php.net/manual/en/intl.requirements.php) | |||
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library | |||
Additionally, make sure that the following extensions are enabled in your PHP: | |||
- json (enabled by default - don't turn it off) | |||
- [mbstring](http://php.net/manual/en/mbstring.installation.php) | |||
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) | |||
- xml (enabled by default - don't turn it off) |
@@ -0,0 +1,6 @@ | |||
<IfModule authz_core_module> | |||
Require all denied | |||
</IfModule> | |||
<IfModule !authz_core_module> | |||
Deny from all | |||
</IfModule> |
@@ -0,0 +1,15 @@ | |||
<?php | |||
/** | |||
* The goal of this file is to allow developers a location | |||
* where they can overwrite core procedural functions and | |||
* replace them with their own. This file is loaded during | |||
* the bootstrap process and is called during the frameworks | |||
* execution. | |||
* | |||
* This can be looked at as a `master helper` file that is | |||
* loaded early on, and may also contain additional functions | |||
* that you'd like to use throughout your entire application | |||
* | |||
* @see: https://codeigniter4.github.io/CodeIgniter4/ | |||
*/ |
@@ -0,0 +1,465 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Session\Handlers\FileHandler; | |||
class App extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Base Site URL | |||
* -------------------------------------------------------------------------- | |||
* | |||
* URL to your CodeIgniter root. Typically this will be your base URL, | |||
* WITH a trailing slash: | |||
* | |||
* http://example.com/ | |||
* | |||
* If this is not set then CodeIgniter will try guess the protocol, domain | |||
* and path to your installation. However, you should always configure this | |||
* explicitly and never rely on auto-guessing, especially in production | |||
* environments. | |||
* | |||
* @var string | |||
*/ | |||
public $baseURL = 'http://localhost:8080/'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Index File | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Typically this will be your index.php file, unless you've renamed it to | |||
* something else. If you are using mod_rewrite to remove the page set this | |||
* variable so that it is blank. | |||
* | |||
* @var string | |||
*/ | |||
public $indexPage = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* URI PROTOCOL | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This item determines which getServer global should be used to retrieve the | |||
* URI string. The default setting of 'REQUEST_URI' works for most servers. | |||
* If your links do not seem to work, try one of the other delicious flavors: | |||
* | |||
* 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | |||
* 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] | |||
* 'PATH_INFO' Uses $_SERVER['PATH_INFO'] | |||
* | |||
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! | |||
* | |||
* @var string | |||
*/ | |||
public $uriProtocol = 'REQUEST_URI'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Default Locale | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The Locale roughly represents the language and location that your visitor | |||
* is viewing the site from. It affects the language strings and other | |||
* strings (like currency markers, numbers, etc), that your program | |||
* should run under for this request. | |||
* | |||
* @var string | |||
*/ | |||
public $defaultLocale = 'en'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Negotiate Locale | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If true, the current Request object will automatically determine the | |||
* language to use based on the value of the Accept-Language header. | |||
* | |||
* If false, no automatic detection will be performed. | |||
* | |||
* @var bool | |||
*/ | |||
public $negotiateLocale = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Supported Locales | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If $negotiateLocale is true, this array lists the locales supported | |||
* by the application in descending order of priority. If no match is | |||
* found, the first locale will be used. | |||
* | |||
* @var string[] | |||
*/ | |||
public $supportedLocales = ['en']; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Application Timezone | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The default timezone that will be used in your application to display | |||
* dates with the date helper, and can be retrieved through app_timezone() | |||
* | |||
* @var string | |||
*/ | |||
public $appTimezone = 'America/Chicago'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Default Character Set | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This determines which character set is used by default in various methods | |||
* that require a character set to be provided. | |||
* | |||
* @see http://php.net/htmlspecialchars for a list of supported charsets. | |||
* | |||
* @var string | |||
*/ | |||
public $charset = 'UTF-8'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* URI PROTOCOL | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If true, this will force every request made to this application to be | |||
* made via a secure connection (HTTPS). If the incoming request is not | |||
* secure, the user will be redirected to a secure version of the page | |||
* and the HTTP Strict Transport Security header will be set. | |||
* | |||
* @var bool | |||
*/ | |||
public $forceGlobalSecureRequests = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Driver | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The session storage driver to use: | |||
* - `CodeIgniter\Session\Handlers\FileHandler` | |||
* - `CodeIgniter\Session\Handlers\DatabaseHandler` | |||
* - `CodeIgniter\Session\Handlers\MemcachedHandler` | |||
* - `CodeIgniter\Session\Handlers\RedisHandler` | |||
* | |||
* @var string | |||
*/ | |||
public $sessionDriver = FileHandler::class; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Cookie Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The session cookie name, must contain only [0-9a-z_-] characters | |||
* | |||
* @var string | |||
*/ | |||
public $sessionCookieName = 'ci_session'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Expiration | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The number of SECONDS you want the session to last. | |||
* Setting to 0 (zero) means expire when the browser is closed. | |||
* | |||
* @var int | |||
*/ | |||
public $sessionExpiration = 7200; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Save Path | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The location to save sessions to and is driver dependent. | |||
* | |||
* For the 'files' driver, it's a path to a writable directory. | |||
* WARNING: Only absolute paths are supported! | |||
* | |||
* For the 'database' driver, it's a table name. | |||
* Please read up the manual for the format with other session drivers. | |||
* | |||
* IMPORTANT: You are REQUIRED to set a valid save path! | |||
* | |||
* @var string | |||
*/ | |||
public $sessionSavePath = WRITEPATH . 'session'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Match IP | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Whether to match the user's IP address when reading the session data. | |||
* | |||
* WARNING: If you're using the database driver, don't forget to update | |||
* your session table's PRIMARY KEY when changing this setting. | |||
* | |||
* @var bool | |||
*/ | |||
public $sessionMatchIP = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Time to Update | |||
* -------------------------------------------------------------------------- | |||
* | |||
* How many seconds between CI regenerating the session ID. | |||
* | |||
* @var int | |||
*/ | |||
public $sessionTimeToUpdate = 300; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Session Regenerate Destroy | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Whether to destroy session data associated with the old session ID | |||
* when auto-regenerating the session ID. When set to FALSE, the data | |||
* will be later deleted by the garbage collector. | |||
* | |||
* @var bool | |||
*/ | |||
public $sessionRegenerateDestroy = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Prefix | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Set a cookie name prefix if you need to avoid collisions. | |||
* | |||
* @var string | |||
* | |||
* @deprecated use Config\Cookie::$prefix property instead. | |||
*/ | |||
public $cookiePrefix = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Domain | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Set to `.your-domain.com` for site-wide cookies. | |||
* | |||
* @var string | |||
* | |||
* @deprecated use Config\Cookie::$domain property instead. | |||
*/ | |||
public $cookieDomain = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Path | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Typically will be a forward slash. | |||
* | |||
* @var string | |||
* | |||
* @deprecated use Config\Cookie::$path property instead. | |||
*/ | |||
public $cookiePath = '/'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Secure | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Cookie will only be set if a secure HTTPS connection exists. | |||
* | |||
* @var bool | |||
* | |||
* @deprecated use Config\Cookie::$secure property instead. | |||
*/ | |||
public $cookieSecure = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie HttpOnly | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Cookie will only be accessible via HTTP(S) (no JavaScript). | |||
* | |||
* @var bool | |||
* | |||
* @deprecated use Config\Cookie::$httponly property instead. | |||
*/ | |||
public $cookieHTTPOnly = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie SameSite | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Configure cookie SameSite setting. Allowed values are: | |||
* - None | |||
* - Lax | |||
* - Strict | |||
* - '' | |||
* | |||
* Alternatively, you can use the constant names: | |||
* - `Cookie::SAMESITE_NONE` | |||
* - `Cookie::SAMESITE_LAX` | |||
* - `Cookie::SAMESITE_STRICT` | |||
* | |||
* Defaults to `Lax` for compatibility with modern browsers. Setting `''` | |||
* (empty string) means default SameSite attribute set by browsers (`Lax`) | |||
* will be set on cookies. If set to `None`, `$cookieSecure` must also be set. | |||
* | |||
* @var string|null | |||
* | |||
* @deprecated use Config\Cookie::$samesite property instead. | |||
*/ | |||
public $cookieSameSite = 'Lax'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Reverse Proxy IPs | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If your server is behind a reverse proxy, you must whitelist the proxy | |||
* IP addresses from which CodeIgniter should trust headers such as | |||
* HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify | |||
* the visitor's IP address. | |||
* | |||
* You can use both an array or a comma-separated list of proxy addresses, | |||
* as well as specifying whole subnets. Here are a few examples: | |||
* | |||
* Comma-separated: '10.0.1.200,192.168.5.0/24' | |||
* Array: ['10.0.1.200', '192.168.5.0/24'] | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $proxyIPs = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Token Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The token name. | |||
* | |||
* @deprecated Use `Config\Security` $tokenName property instead of using this property. | |||
* | |||
* @var string | |||
*/ | |||
public $CSRFTokenName = 'csrf_test_name'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Header Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The header name. | |||
* | |||
* @deprecated Use `Config\Security` $headerName property instead of using this property. | |||
* | |||
* @var string | |||
*/ | |||
public $CSRFHeaderName = 'X-CSRF-TOKEN'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Cookie Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The cookie name. | |||
* | |||
* @deprecated Use `Config\Security` $cookieName property instead of using this property. | |||
* | |||
* @var string | |||
*/ | |||
public $CSRFCookieName = 'csrf_cookie_name'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Expire | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The number in seconds the token should expire. | |||
* | |||
* @deprecated Use `Config\Security` $expire property instead of using this property. | |||
* | |||
* @var int | |||
*/ | |||
public $CSRFExpire = 7200; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Regenerate | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Regenerate token on every submission? | |||
* | |||
* @deprecated Use `Config\Security` $regenerate property instead of using this property. | |||
* | |||
* @var bool | |||
*/ | |||
public $CSRFRegenerate = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Redirect | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Redirect to previous page with error on failure? | |||
* | |||
* @deprecated Use `Config\Security` $redirect property instead of using this property. | |||
* | |||
* @var bool | |||
*/ | |||
public $CSRFRedirect = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF SameSite | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Setting for CSRF SameSite cookie token. Allowed values are: | |||
* - None | |||
* - Lax | |||
* - Strict | |||
* - '' | |||
* | |||
* Defaults to `Lax` as recommended in this link: | |||
* | |||
* @see https://portswigger.net/web-security/csrf/samesite-cookies | |||
* @deprecated `Config\Cookie` $samesite property is used. | |||
* | |||
* @var string | |||
*/ | |||
public $CSRFSameSite = 'Lax'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Content Security Policy | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Enables the Response's Content Secure Policy to restrict the sources that | |||
* can be used for images, scripts, CSS files, audio, video, etc. If enabled, | |||
* the Response object will populate default values for the policy from the | |||
* `ContentSecurityPolicy.php` file. Controllers can always add to those | |||
* restrictions at run time. | |||
* | |||
* For a better understanding of CSP, see these documents: | |||
* | |||
* @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/ | |||
* @see http://www.w3.org/TR/CSP/ | |||
* | |||
* @var bool | |||
*/ | |||
public $CSPEnabled = false; | |||
} |
@@ -0,0 +1,380 @@ | |||
<?php | |||
namespace Config; | |||
class Auth extends \Myth\Auth\Config\Auth | |||
{ | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Default User Group | |||
* -------------------------------------------------------------------- | |||
* | |||
* The name of a group a user will be added to when they register, | |||
* i.e. $defaultUserGroup = 'guests'. | |||
* | |||
* @var string | |||
*/ | |||
public $defaultUserGroup; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Landing Route | |||
* -------------------------------------------------------------------- | |||
* | |||
* This is your landing page (route name) after user success to login, | |||
* i.e $landingRoute = 'dashboard'. | |||
* | |||
* If you set $silent = true the Permission and Role filters will | |||
* use this config too for the routing. | |||
* | |||
* @var string | |||
*/ | |||
public $landingRoute = '/'; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Reserverd Routes | |||
* -------------------------------------------------------------------- | |||
* | |||
* The auth routes config is listed in here and you can customize it, | |||
* i.e. $reservedRoutes = ['forgot' => 'forgot-password']. | |||
* | |||
* Do Not Change The Key!!! Because it's the identity for routing. | |||
* | |||
* @var array | |||
*/ | |||
public $reservedRoutes = [ | |||
'login' => 'login', | |||
'logout' => 'logout', | |||
'register' => 'register', | |||
'activate-account' => 'activate-account', | |||
'resend-activate-account' => 'resend-activate-account', | |||
'forgot' => 'forgot', | |||
'reset-password' => 'reset-password', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Libraries | |||
* -------------------------------------------------------------------- | |||
* | |||
* @var array | |||
*/ | |||
public $authenticationLibs = [ | |||
'local' => 'Myth\Auth\Authentication\LocalAuthenticator', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Views used by Auth Controllers | |||
* -------------------------------------------------------------------- | |||
* | |||
* @var array | |||
*/ | |||
public $views = [ | |||
'login' => 'App\Views\Auth\login', | |||
'register' => 'App\Views\Auth\register', | |||
'forgot' => 'App\Views\Auth\forgot', | |||
'reset' => 'App\Views\Auth\reset', | |||
'emailForgot' => 'App\Views\Auth\emails\forgot', | |||
'emailActivation' => 'App\Views\Auth\emails\activation', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Layout for the views to extend | |||
* -------------------------------------------------------------------- | |||
* | |||
* @var string | |||
*/ | |||
public $viewLayout = 'App\Views\Auth\layout'; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Authentication | |||
* -------------------------------------------------------------------- | |||
* | |||
* Fields that are available to be used as credentials for login. | |||
* | |||
* @var string[] | |||
*/ | |||
public $validFields = [ | |||
'email', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Additional Fields for "Nothing Personal" | |||
* -------------------------------------------------------------------- | |||
* | |||
* The `NothingPersonalValidator` prevents personal information from | |||
* being used in passwords. The email and username fields are always | |||
* considered by the validator. Do not enter those field names here. | |||
* | |||
* An extend User Entity might include other personal info such as | |||
* first and/or last names. `$personalFields` is where you can add | |||
* fields to be considered as "personal" by the NothingPersonalValidator. | |||
* | |||
* For example: | |||
* $personalFields = ['firstname', 'lastname']; | |||
* | |||
* @var string[] | |||
*/ | |||
public $personalFields = []; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Password / Username Similarity | |||
* -------------------------------------------------------------------- | |||
* | |||
* Among other things, the NothingPersonalValidator checks the | |||
* amount of sameness between the password and username. | |||
* Passwords that are too much like the username are invalid. | |||
* | |||
* The value set for $maxSimilarity represents the maximum percentage | |||
* of similarity at which the password will be accepted. In other words, any | |||
* calculated similarity equal to, or greater than $maxSimilarity | |||
* is rejected. | |||
* | |||
* The accepted range is 0-100, with 0 (zero) meaning don't check similarity. | |||
* Using values at either extreme of the *working range* (1-100) is | |||
* not advised. The low end is too restrictive and the high end is too permissive. | |||
* The suggested value for $maxSimilarity is 50. | |||
* | |||
* You may be thinking that a value of 100 should have the effect of accepting | |||
* everything like a value of 0 does. That's logical and probably true, | |||
* but is unproven and untested. Besides, 0 skips the work involved | |||
* making the calculation unlike when using 100. | |||
* | |||
* The (admittedly limited) testing that's been done suggests a useful working range | |||
* of 50 to 60. You can set it lower than 50, but site users will probably start | |||
* to complain about the large number of proposed passwords getting rejected. | |||
* At around 60 or more it starts to see pairs like 'captain joe' and 'joe*captain' as | |||
* perfectly acceptable which clearly they are not. | |||
* | |||
* | |||
* To disable similarity checking set the value to 0. | |||
* public $maxSimilarity = 0; | |||
* | |||
* @var int | |||
*/ | |||
public $maxSimilarity = 50; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Allow User Registration | |||
* -------------------------------------------------------------------- | |||
* | |||
* When enabled (default) any unregistered user may apply for a new | |||
* account. If you disable registration you may need to ensure your | |||
* controllers and views know not to offer registration. | |||
* | |||
* @var bool | |||
*/ | |||
public $allowRegistration = true; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Require Confirmation Registration via Email | |||
* -------------------------------------------------------------------- | |||
* | |||
* When enabled, every registered user will receive an email message | |||
* with an activation link to confirm the account. | |||
* | |||
* @var string|null Name of the ActivatorInterface class | |||
*/ | |||
public $requireActivation = 'Myth\Auth\Authentication\Activators\EmailActivator'; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Allow Password Reset via Email | |||
* -------------------------------------------------------------------- | |||
* | |||
* When enabled, users will have the option to reset their password | |||
* via the specified Resetter. Default setting is email. | |||
* | |||
* @var string|null Name of the ResetterInterface class | |||
*/ | |||
public $activeResetter = 'Myth\Auth\Authentication\Resetters\EmailResetter'; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Allow Persistent Login Cookies (Remember me) | |||
* -------------------------------------------------------------------- | |||
* | |||
* While every attempt has been made to create a very strong protection | |||
* with the remember me system, there are some cases (like when you | |||
* need extreme protection, like dealing with users financials) that | |||
* you might not want the extra risk associated with this cookie-based | |||
* solution. | |||
* | |||
* @var bool | |||
*/ | |||
public $allowRemembering = false; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Remember Length | |||
* -------------------------------------------------------------------- | |||
* | |||
* The amount of time, in seconds, that you want a login to last for. | |||
* Defaults to 30 days. | |||
* | |||
* @var int | |||
*/ | |||
public $rememberLength = 30 * DAY; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Error handling | |||
* -------------------------------------------------------------------- | |||
* | |||
* If true, will continue instead of throwing exceptions. | |||
* | |||
* @var bool | |||
*/ | |||
public $silent = false; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Encryption Algorithm to Use | |||
* -------------------------------------------------------------------- | |||
* | |||
* Valid values are | |||
* - PASSWORD_DEFAULT (default) | |||
* - PASSWORD_BCRYPT | |||
* - PASSWORD_ARGON2I - As of PHP 7.2 only if compiled with support for it | |||
* - PASSWORD_ARGON2ID - As of PHP 7.3 only if compiled with support for it | |||
* | |||
* If you choose to use any ARGON algorithm, then you might want to | |||
* uncomment the "ARGON2i/D Algorithm" options to suit your needs | |||
* | |||
* @var int|string | |||
*/ | |||
public $hashAlgorithm = PASSWORD_DEFAULT; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* ARGON2i/D Algorithm options | |||
* -------------------------------------------------------------------- | |||
* | |||
* The ARGON2I method of encryption allows you to define the "memory_cost", | |||
* the "time_cost" and the number of "threads", whenever a password hash is | |||
* created. | |||
* | |||
* This defaults to a value of 10 which is an acceptable number. | |||
* However, depending on the security needs of your application | |||
* and the power of your hardware, you might want to increase the | |||
* cost. This makes the hashing process takes longer. | |||
*/ | |||
/** | |||
* @var int | |||
*/ | |||
public $hashMemoryCost = 2048; // PASSWORD_ARGON2_DEFAULT_MEMORY_COST; | |||
/** | |||
* @var int | |||
*/ | |||
public $hashTimeCost = 4; // PASSWORD_ARGON2_DEFAULT_TIME_COST; | |||
/** | |||
* @var int | |||
*/ | |||
public $hashThreads = 4; // PASSWORD_ARGON2_DEFAULT_THREADS; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Password Hashing Cost | |||
* -------------------------------------------------------------------- | |||
* | |||
* The BCRYPT method of encryption allows you to define the "cost" | |||
* or number of iterations made, whenever a password hash is created. | |||
* This defaults to a value of 10 which is an acceptable number. | |||
* However, depending on the security needs of your application | |||
* and the power of your hardware, you might want to increase the | |||
* cost. This makes the hashing process takes longer. | |||
* | |||
* Valid range is between 4 - 31. | |||
* | |||
* @var int | |||
*/ | |||
public $hashCost = 10; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Minimum Password Length | |||
* -------------------------------------------------------------------- | |||
* | |||
* The minimum length that a password must be to be accepted. | |||
* Recommended minimum value by NIST = 8 characters. | |||
* | |||
* @var int | |||
*/ | |||
public $minimumPasswordLength = 8; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Password Check Helpers | |||
* -------------------------------------------------------------------- | |||
* | |||
* The PasswordValidator class runs the password through all of these | |||
* classes, each getting the opportunity to pass/fail the password. | |||
* | |||
* You can add custom classes as long as they adhere to the | |||
* Password\ValidatorInterface. | |||
* | |||
* @var string[] | |||
*/ | |||
public $passwordValidators = [ | |||
'Myth\Auth\Authentication\Passwords\CompositionValidator', | |||
'Myth\Auth\Authentication\Passwords\NothingPersonalValidator', | |||
'Myth\Auth\Authentication\Passwords\DictionaryValidator', | |||
// 'Myth\Auth\Authentication\Passwords\PwnedValidator', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Activator classes | |||
* -------------------------------------------------------------------- | |||
* | |||
* Available activators with config settings | |||
* | |||
* @var array | |||
*/ | |||
public $userActivators = [ | |||
'Myth\Auth\Authentication\Activators\EmailActivator' => [ | |||
'fromEmail' => null, | |||
'fromName' => null, | |||
], | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Resetter Classes | |||
* -------------------------------------------------------------------- | |||
* | |||
* Available resetters with config settings | |||
* | |||
* @var array | |||
*/ | |||
public $userResetters = [ | |||
'Myth\Auth\Authentication\Resetters\EmailResetter' => [ | |||
'fromEmail' => null, | |||
'fromName' => null, | |||
], | |||
]; | |||
/** | |||
* -------------------------------------------------------------------- | |||
* Reset Time | |||
* -------------------------------------------------------------------- | |||
* | |||
* The amount of time that a password reset-token is valid for, | |||
* in seconds. | |||
* | |||
* @var int | |||
*/ | |||
public $resetTime = 3600; | |||
} |
@@ -0,0 +1,87 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\AutoloadConfig; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* AUTOLOADER CONFIGURATION | |||
* ------------------------------------------------------------------- | |||
* | |||
* This file defines the namespaces and class maps so the Autoloader | |||
* can find the files as needed. | |||
* | |||
* NOTE: If you use an identical key in $psr4 or $classmap, then | |||
* the values in this file will overwrite the framework's values. | |||
*/ | |||
class Autoload extends AutoloadConfig | |||
{ | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Namespaces | |||
* ------------------------------------------------------------------- | |||
* This maps the locations of any namespaces in your application to | |||
* their location on the file system. These are used by the autoloader | |||
* to locate files the first time they have been instantiated. | |||
* | |||
* The '/app' and '/system' directories are already mapped for you. | |||
* you may change the name of the 'App' namespace if you wish, | |||
* but this should be done prior to creating any namespaced classes, | |||
* else you will need to modify all of those classes for this to work. | |||
* | |||
* Prototype: | |||
*``` | |||
* $psr4 = [ | |||
* 'CodeIgniter' => SYSTEMPATH, | |||
* 'App' => APPPATH | |||
* ]; | |||
*``` | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $psr4 = [ | |||
APP_NAMESPACE => APPPATH, // For custom app namespace | |||
'Config' => APPPATH . 'Config', | |||
]; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Class Map | |||
* ------------------------------------------------------------------- | |||
* The class map provides a map of class names and their exact | |||
* location on the drive. Classes loaded in this manner will have | |||
* slightly faster performance because they will not have to be | |||
* searched for within one or more directories as they would if they | |||
* were being autoloaded through a namespace. | |||
* | |||
* Prototype: | |||
*``` | |||
* $classmap = [ | |||
* 'MyClass' => '/path/to/class/file.php' | |||
* ]; | |||
*``` | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $classmap = []; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Files | |||
* ------------------------------------------------------------------- | |||
* The files array provides a list of paths to __non-class__ files | |||
* that will be autoloaded. This can be useful for bootstrap operations | |||
* or for loading functions. | |||
* | |||
* Prototype: | |||
* ``` | |||
* $files = [ | |||
* '/path/to/my/file.php', | |||
* ]; | |||
* ``` | |||
* | |||
* @var array<int, string> | |||
*/ | |||
public $files = []; | |||
} |
@@ -0,0 +1,32 @@ | |||
<?php | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| ERROR DISPLAY | |||
|-------------------------------------------------------------------------- | |||
| In development, we want to show as many errors as possible to help | |||
| make sure they don't make it to production. And save us hours of | |||
| painful debugging. | |||
*/ | |||
error_reporting(-1); | |||
ini_set('display_errors', '1'); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| DEBUG BACKTRACES | |||
|-------------------------------------------------------------------------- | |||
| If true, this constant will tell the error screens to display debug | |||
| backtraces along with the other error information. If you would | |||
| prefer to not see this, set this value to false. | |||
*/ | |||
defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| DEBUG MODE | |||
|-------------------------------------------------------------------------- | |||
| Debug mode is an experimental flag that can allow changes throughout | |||
| the system. This will control whether Kint is loaded, and a few other | |||
| items. It can always be used within your own application too. | |||
*/ | |||
defined('CI_DEBUG') || define('CI_DEBUG', true); |
@@ -0,0 +1,21 @@ | |||
<?php | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| ERROR DISPLAY | |||
|-------------------------------------------------------------------------- | |||
| Don't show ANY in production environments. Instead, let the system catch | |||
| it and display a generic error message. | |||
*/ | |||
ini_set('display_errors', '0'); | |||
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| DEBUG MODE | |||
|-------------------------------------------------------------------------- | |||
| Debug mode is an experimental flag that can allow changes throughout | |||
| the system. It's not widely used currently, and may not survive | |||
| release of the framework. | |||
*/ | |||
defined('CI_DEBUG') || define('CI_DEBUG', false); |
@@ -0,0 +1,32 @@ | |||
<?php | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| ERROR DISPLAY | |||
|-------------------------------------------------------------------------- | |||
| In development, we want to show as many errors as possible to help | |||
| make sure they don't make it to production. And save us hours of | |||
| painful debugging. | |||
*/ | |||
error_reporting(-1); | |||
ini_set('display_errors', '1'); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| DEBUG BACKTRACES | |||
|-------------------------------------------------------------------------- | |||
| If true, this constant will tell the error screens to display debug | |||
| backtraces along with the other error information. If you would | |||
| prefer to not see this, set this value to false. | |||
*/ | |||
defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| DEBUG MODE | |||
|-------------------------------------------------------------------------- | |||
| Debug mode is an experimental flag that can allow changes throughout | |||
| the system. It's not widely used currently, and may not survive | |||
| release of the framework. | |||
*/ | |||
defined('CI_DEBUG') || define('CI_DEBUG', true); |
@@ -0,0 +1,22 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class CURLRequest extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CURLRequest Share Options | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Whether share options between requests or not. | |||
* | |||
* If true, all the options won't be reset between requests. | |||
* It may cause an error request with unnecessary headers. | |||
* | |||
* @var bool | |||
*/ | |||
public $shareOptions = true; | |||
} |
@@ -0,0 +1,181 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Cache\Handlers\DummyHandler; | |||
use CodeIgniter\Cache\Handlers\FileHandler; | |||
use CodeIgniter\Cache\Handlers\MemcachedHandler; | |||
use CodeIgniter\Cache\Handlers\PredisHandler; | |||
use CodeIgniter\Cache\Handlers\RedisHandler; | |||
use CodeIgniter\Cache\Handlers\WincacheHandler; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Cache extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Primary Handler | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The name of the preferred handler that should be used. If for some reason | |||
* it is not available, the $backupHandler will be used in its place. | |||
* | |||
* @var string | |||
*/ | |||
public $handler = 'file'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Backup Handler | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The name of the handler that will be used in case the first one is | |||
* unreachable. Often, 'file' is used here since the filesystem is | |||
* always available, though that's not always practical for the app. | |||
* | |||
* @var string | |||
*/ | |||
public $backupHandler = 'dummy'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cache Directory Path | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The path to where cache files should be stored, if using a file-based | |||
* system. | |||
* | |||
* @var string | |||
* | |||
* @deprecated Use the driver-specific variant under $file | |||
*/ | |||
public $storePath = WRITEPATH . 'cache/'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cache Include Query String | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Whether to take the URL query string into consideration when generating | |||
* output cache files. Valid options are: | |||
* | |||
* false = Disabled | |||
* true = Enabled, take all query parameters into account. | |||
* Please be aware that this may result in numerous cache | |||
* files generated for the same page over and over again. | |||
* array('q') = Enabled, but only take into account the specified list | |||
* of query parameters. | |||
* | |||
* @var bool|string[] | |||
*/ | |||
public $cacheQueryString = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Key Prefix | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This string is added to all cache item names to help avoid collisions | |||
* if you run multiple applications with the same cache engine. | |||
* | |||
* @var string | |||
*/ | |||
public $prefix = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Default TTL | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The default number of seconds to save items when none is specified. | |||
* | |||
* WARNING: This is not used by framework handlers where 60 seconds is | |||
* hard-coded, but may be useful to projects and modules. This will replace | |||
* the hard-coded value in a future release. | |||
* | |||
* @var int | |||
*/ | |||
public $ttl = 60; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Reserved Characters | |||
* -------------------------------------------------------------------------- | |||
* | |||
* A string of reserved characters that will not be allowed in keys or tags. | |||
* Strings that violate this restriction will cause handlers to throw. | |||
* Default: {}()/\@: | |||
* Note: The default set is required for PSR-6 compliance. | |||
* | |||
* @var string | |||
*/ | |||
public $reservedCharacters = '{}()/\@:'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* File settings | |||
* -------------------------------------------------------------------------- | |||
* Your file storage preferences can be specified below, if you are using | |||
* the File driver. | |||
* | |||
* @var array<string, int|string|null> | |||
*/ | |||
public $file = [ | |||
'storePath' => WRITEPATH . 'cache/', | |||
'mode' => 0640, | |||
]; | |||
/** | |||
* ------------------------------------------------------------------------- | |||
* Memcached settings | |||
* ------------------------------------------------------------------------- | |||
* Your Memcached servers can be specified below, if you are using | |||
* the Memcached drivers. | |||
* | |||
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached | |||
* | |||
* @var array<string, boolean|int|string> | |||
*/ | |||
public $memcached = [ | |||
'host' => '127.0.0.1', | |||
'port' => 11211, | |||
'weight' => 1, | |||
'raw' => false, | |||
]; | |||
/** | |||
* ------------------------------------------------------------------------- | |||
* Redis settings | |||
* ------------------------------------------------------------------------- | |||
* Your Redis server can be specified below, if you are using | |||
* the Redis or Predis drivers. | |||
* | |||
* @var array<string, int|string|null> | |||
*/ | |||
public $redis = [ | |||
'host' => '127.0.0.1', | |||
'password' => null, | |||
'port' => 6379, | |||
'timeout' => 0, | |||
'database' => 0, | |||
]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Available Cache Handlers | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This is an array of cache engine alias' and class names. Only engines | |||
* that are listed here are allowed to be used. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $validHandlers = [ | |||
'dummy' => DummyHandler::class, | |||
'file' => FileHandler::class, | |||
'memcached' => MemcachedHandler::class, | |||
'predis' => PredisHandler::class, | |||
'redis' => RedisHandler::class, | |||
'wincache' => WincacheHandler::class, | |||
]; | |||
} |
@@ -0,0 +1,94 @@ | |||
<?php | |||
/* | |||
| -------------------------------------------------------------------- | |||
| App Namespace | |||
| -------------------------------------------------------------------- | |||
| | |||
| This defines the default Namespace that is used throughout | |||
| CodeIgniter to refer to the Application directory. Change | |||
| this constant to change the namespace that all application | |||
| classes should use. | |||
| | |||
| NOTE: changing this will require manually modifying the | |||
| existing namespaces of App\* namespaced-classes. | |||
*/ | |||
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App'); | |||
/* | |||
| -------------------------------------------------------------------------- | |||
| Composer Path | |||
| -------------------------------------------------------------------------- | |||
| | |||
| The path that Composer's autoload file is expected to live. By default, | |||
| the vendor folder is in the Root directory, but you can customize that here. | |||
*/ | |||
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php'); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Timing Constants | |||
|-------------------------------------------------------------------------- | |||
| | |||
| Provide simple ways to work with the myriad of PHP functions that | |||
| require information to be in seconds. | |||
*/ | |||
defined('SECOND') || define('SECOND', 1); | |||
defined('MINUTE') || define('MINUTE', 60); | |||
defined('HOUR') || define('HOUR', 3600); | |||
defined('DAY') || define('DAY', 86400); | |||
defined('WEEK') || define('WEEK', 604800); | |||
defined('MONTH') || define('MONTH', 2_592_000); | |||
defined('YEAR') || define('YEAR', 31_536_000); | |||
defined('DECADE') || define('DECADE', 315_360_000); | |||
/* | |||
| -------------------------------------------------------------------------- | |||
| Exit Status Codes | |||
| -------------------------------------------------------------------------- | |||
| | |||
| Used to indicate the conditions under which the script is exit()ing. | |||
| While there is no universal standard for error codes, there are some | |||
| broad conventions. Three such conventions are mentioned below, for | |||
| those who wish to make use of them. The CodeIgniter defaults were | |||
| chosen for the least overlap with these conventions, while still | |||
| leaving room for others to be defined in future versions and user | |||
| applications. | |||
| | |||
| The three main conventions used for determining exit status codes | |||
| are as follows: | |||
| | |||
| Standard C/C++ Library (stdlibc): | |||
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html | |||
| (This link also contains other GNU-specific conventions) | |||
| BSD sysexits.h: | |||
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits | |||
| Bash scripting: | |||
| http://tldp.org/LDP/abs/html/exitcodes.html | |||
| | |||
*/ | |||
defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors | |||
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error | |||
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error | |||
defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found | |||
defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class | |||
defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member | |||
defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input | |||
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error | |||
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code | |||
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code | |||
/** | |||
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead. | |||
*/ | |||
define('EVENT_PRIORITY_LOW', 200); | |||
/** | |||
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_NORMAL instead. | |||
*/ | |||
define('EVENT_PRIORITY_NORMAL', 100); | |||
/** | |||
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead. | |||
*/ | |||
define('EVENT_PRIORITY_HIGH', 10); |
@@ -0,0 +1,188 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
/** | |||
* Stores the default settings for the ContentSecurityPolicy, if you | |||
* choose to use it. The values here will be read in and set as defaults | |||
* for the site. If needed, they can be overridden on a page-by-page basis. | |||
* | |||
* Suggested reference for explanations: | |||
* | |||
* @see https://www.html5rocks.com/en/tutorials/security/content-security-policy/ | |||
*/ | |||
class ContentSecurityPolicy extends BaseConfig | |||
{ | |||
//------------------------------------------------------------------------- | |||
// Broadbrush CSP management | |||
//------------------------------------------------------------------------- | |||
/** | |||
* Default CSP report context | |||
* | |||
* @var bool | |||
*/ | |||
public $reportOnly = false; | |||
/** | |||
* Specifies a URL where a browser will send reports | |||
* when a content security policy is violated. | |||
* | |||
* @var string|null | |||
*/ | |||
public $reportURI; | |||
/** | |||
* Instructs user agents to rewrite URL schemes, changing | |||
* HTTP to HTTPS. This directive is for websites with | |||
* large numbers of old URLs that need to be rewritten. | |||
* | |||
* @var bool | |||
*/ | |||
public $upgradeInsecureRequests = false; | |||
//------------------------------------------------------------------------- | |||
// Sources allowed | |||
// Note: once you set a policy to 'none', it cannot be further restricted | |||
//------------------------------------------------------------------------- | |||
/** | |||
* Will default to self if not overridden | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $defaultSrc; | |||
/** | |||
* Lists allowed scripts' URLs. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $scriptSrc = 'self'; | |||
/** | |||
* Lists allowed stylesheets' URLs. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $styleSrc = 'self'; | |||
/** | |||
* Defines the origins from which images can be loaded. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $imageSrc = 'self'; | |||
/** | |||
* Restricts the URLs that can appear in a page's `<base>` element. | |||
* | |||
* Will default to self if not overridden | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $baseURI; | |||
/** | |||
* Lists the URLs for workers and embedded frame contents | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $childSrc = 'self'; | |||
/** | |||
* Limits the origins that you can connect to (via XHR, | |||
* WebSockets, and EventSource). | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $connectSrc = 'self'; | |||
/** | |||
* Specifies the origins that can serve web fonts. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $fontSrc; | |||
/** | |||
* Lists valid endpoints for submission from `<form>` tags. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $formAction = 'self'; | |||
/** | |||
* Specifies the sources that can embed the current page. | |||
* This directive applies to `<frame>`, `<iframe>`, `<embed>`, | |||
* and `<applet>` tags. This directive can't be used in | |||
* `<meta>` tags and applies only to non-HTML resources. | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $frameAncestors; | |||
/** | |||
* The frame-src directive restricts the URLs which may | |||
* be loaded into nested browsing contexts. | |||
* | |||
* @var array|string|null | |||
*/ | |||
public $frameSrc; | |||
/** | |||
* Restricts the origins allowed to deliver video and audio. | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $mediaSrc; | |||
/** | |||
* Allows control over Flash and other plugins. | |||
* | |||
* @var string|string[] | |||
*/ | |||
public $objectSrc = 'self'; | |||
/** | |||
* @var string|string[]|null | |||
*/ | |||
public $manifestSrc; | |||
/** | |||
* Limits the kinds of plugins a page may invoke. | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $pluginTypes; | |||
/** | |||
* List of actions allowed. | |||
* | |||
* @var string|string[]|null | |||
*/ | |||
public $sandbox; | |||
/** | |||
* Nonce tag for style | |||
* | |||
* @var string | |||
*/ | |||
public $styleNonceTag = '{csp-style-nonce}'; | |||
/** | |||
* Nonce tag for script | |||
* | |||
* @var string | |||
*/ | |||
public $scriptNonceTag = '{csp-script-nonce}'; | |||
/** | |||
* Replace nonce tag automatically | |||
* | |||
* @var bool | |||
*/ | |||
public $autoNonce = true; | |||
} |
@@ -0,0 +1,119 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use DateTimeInterface; | |||
class Cookie extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Prefix | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Set a cookie name prefix if you need to avoid collisions. | |||
* | |||
* @var string | |||
*/ | |||
public $prefix = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Expires Timestamp | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Default expires timestamp for cookies. Setting this to `0` will mean the | |||
* cookie will not have the `Expires` attribute and will behave as a session | |||
* cookie. | |||
* | |||
* @var DateTimeInterface|int|string | |||
*/ | |||
public $expires = 0; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Path | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Typically will be a forward slash. | |||
* | |||
* @var string | |||
*/ | |||
public $path = '/'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Domain | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Set to `.your-domain.com` for site-wide cookies. | |||
* | |||
* @var string | |||
*/ | |||
public $domain = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Secure | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Cookie will only be set if a secure HTTPS connection exists. | |||
* | |||
* @var bool | |||
*/ | |||
public $secure = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie HTTPOnly | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Cookie will only be accessible via HTTP(S) (no JavaScript). | |||
* | |||
* @var bool | |||
*/ | |||
public $httponly = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie SameSite | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Configure cookie SameSite setting. Allowed values are: | |||
* - None | |||
* - Lax | |||
* - Strict | |||
* - '' | |||
* | |||
* Alternatively, you can use the constant names: | |||
* - `Cookie::SAMESITE_NONE` | |||
* - `Cookie::SAMESITE_LAX` | |||
* - `Cookie::SAMESITE_STRICT` | |||
* | |||
* Defaults to `Lax` for compatibility with modern browsers. Setting `''` | |||
* (empty string) means default SameSite attribute set by browsers (`Lax`) | |||
* will be set on cookies. If set to `None`, `$secure` must also be set. | |||
* | |||
* @var string | |||
*/ | |||
public $samesite = 'Lax'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Cookie Raw | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This flag allows setting a "raw" cookie, i.e., its name and value are | |||
* not URL encoded using `rawurlencode()`. | |||
* | |||
* If this is set to `true`, cookie names should be compliant of RFC 2616's | |||
* list of allowed characters. | |||
* | |||
* @var bool | |||
* | |||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes | |||
* @see https://tools.ietf.org/html/rfc2616#section-2.2 | |||
*/ | |||
public $raw = false; | |||
} |
@@ -0,0 +1,91 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Database\Config; | |||
/** | |||
* Database Configuration | |||
*/ | |||
class Database extends Config | |||
{ | |||
/** | |||
* The directory that holds the Migrations | |||
* and Seeds directories. | |||
* | |||
* @var string | |||
*/ | |||
public $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR; | |||
/** | |||
* Lets you choose which connection group to | |||
* use if no other is specified. | |||
* | |||
* @var string | |||
*/ | |||
public $defaultGroup = 'default'; | |||
/** | |||
* The default database connection. | |||
* | |||
* @var array | |||
*/ | |||
public $default = [ | |||
'DSN' => '', | |||
'hostname' => 'localhost', | |||
'username' => '', | |||
'password' => '', | |||
'database' => '', | |||
'DBDriver' => 'MySQLi', | |||
'DBPrefix' => '', | |||
'pConnect' => false, | |||
'DBDebug' => (ENVIRONMENT !== 'production'), | |||
'charset' => 'utf8', | |||
'DBCollat' => 'utf8_general_ci', | |||
'swapPre' => '', | |||
'encrypt' => false, | |||
'compress' => false, | |||
'strictOn' => false, | |||
'failover' => [], | |||
'port' => 3306, | |||
]; | |||
/** | |||
* This database connection is used when | |||
* running PHPUnit database tests. | |||
* | |||
* @var array | |||
*/ | |||
public $tests = [ | |||
'DSN' => '', | |||
'hostname' => '127.0.0.1', | |||
'username' => '', | |||
'password' => '', | |||
'database' => ':memory:', | |||
'DBDriver' => 'SQLite3', | |||
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS | |||
'pConnect' => false, | |||
'DBDebug' => (ENVIRONMENT !== 'production'), | |||
'charset' => 'utf8', | |||
'DBCollat' => 'utf8_general_ci', | |||
'swapPre' => '', | |||
'encrypt' => false, | |||
'compress' => false, | |||
'strictOn' => false, | |||
'failover' => [], | |||
'port' => 3306, | |||
'foreignKeys' => true, | |||
]; | |||
public function __construct() | |||
{ | |||
parent::__construct(); | |||
// Ensure that we always set the database group to 'tests' if | |||
// we are currently running an automated test suite, so that | |||
// we don't overwrite live data on accident. | |||
if (ENVIRONMENT === 'testing') { | |||
$this->defaultGroup = 'tests'; | |||
} | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
<?php | |||
namespace Config; | |||
class DocTypes | |||
{ | |||
/** | |||
* List of valid document types. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $list = [ | |||
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', | |||
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', | |||
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', | |||
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', | |||
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">', | |||
'html5' => '<!DOCTYPE html>', | |||
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', | |||
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', | |||
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', | |||
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">', | |||
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">', | |||
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">', | |||
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', | |||
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">', | |||
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">', | |||
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">', | |||
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">', | |||
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">', | |||
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">', | |||
]; | |||
} |
@@ -0,0 +1,172 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Email extends BaseConfig | |||
{ | |||
/** | |||
* @var string | |||
*/ | |||
public $fromEmail = 'admin@mail.com'; | |||
/** | |||
* @var string | |||
*/ | |||
public $fromName = 'Admin'; | |||
/** | |||
* @var string | |||
*/ | |||
public $recipients; | |||
/** | |||
* The "user agent" | |||
* | |||
* @var string | |||
*/ | |||
public $userAgent = 'CodeIgniter'; | |||
/** | |||
* The mail sending protocol: mail, sendmail, smtp | |||
* | |||
* @var string | |||
*/ | |||
public $protocol = 'smtp'; | |||
/** | |||
* The server path to Sendmail. | |||
* | |||
* @var string | |||
*/ | |||
public $mailPath = '/usr/sbin/sendmail'; | |||
/** | |||
* SMTP Server Address | |||
* | |||
* @var string | |||
*/ | |||
public $SMTPHost = 'smtp.mailtrap.io'; | |||
/** | |||
* SMTP Username | |||
* | |||
* @var string | |||
*/ | |||
public $SMTPUser = 'c504e92b75d96e'; | |||
/** | |||
* SMTP Password | |||
* | |||
* @var string | |||
*/ | |||
public $SMTPPass = '4f1c9858aef3fb'; | |||
/** | |||
* SMTP Port | |||
* | |||
* @var int | |||
*/ | |||
public $SMTPPort = 587; | |||
/** | |||
* SMTP Timeout (in seconds) | |||
* | |||
* @var int | |||
*/ | |||
public $SMTPTimeout = 20; | |||
/** | |||
* Enable persistent SMTP connections | |||
* | |||
* @var bool | |||
*/ | |||
public $SMTPKeepAlive = false; | |||
/** | |||
* SMTP Encryption. Either tls or ssl | |||
* | |||
* @var string | |||
*/ | |||
public $SMTPCrypto = 'tls'; | |||
/** | |||
* Enable word-wrap | |||
* | |||
* @var bool | |||
*/ | |||
public $wordWrap = true; | |||
/** | |||
* Character count to wrap at | |||
* | |||
* @var int | |||
*/ | |||
public $wrapChars = 76; | |||
/** | |||
* Type of mail, either 'text' or 'html' | |||
* | |||
* @var string | |||
*/ | |||
public $mailType = 'html'; | |||
/** | |||
* Character set (utf-8, iso-8859-1, etc.) | |||
* | |||
* @var string | |||
*/ | |||
public $charset = 'UTF-8'; | |||
/** | |||
* Whether to validate the email address | |||
* | |||
* @var bool | |||
*/ | |||
public $validate = false; | |||
/** | |||
* Email Priority. 1 = highest. 5 = lowest. 3 = normal | |||
* | |||
* @var int | |||
*/ | |||
public $priority = 3; | |||
/** | |||
* Newline character. (Use “\r\n” to comply with RFC 822) | |||
* | |||
* @var string | |||
*/ | |||
public $CRLF = "\r\n"; | |||
/** | |||
* Newline character. (Use “\r\n” to comply with RFC 822) | |||
* | |||
* @var string | |||
*/ | |||
public $newline = "\r\n"; | |||
/** | |||
* Enable BCC Batch Mode. | |||
* | |||
* @var bool | |||
*/ | |||
public $BCCBatchMode = false; | |||
/** | |||
* Number of emails in each BCC batch | |||
* | |||
* @var int | |||
*/ | |||
public $BCCBatchSize = 200; | |||
/** | |||
* Enable notify message from server | |||
* | |||
* @var bool | |||
*/ | |||
public $DSN = false; | |||
} |
@@ -0,0 +1,67 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
/** | |||
* Encryption configuration. | |||
* | |||
* These are the settings used for encryption, if you don't pass a parameter | |||
* array to the encrypter for creation/initialization. | |||
*/ | |||
class Encryption extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Encryption Key Starter | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If you use the Encryption class you must set an encryption key (seed). | |||
* You need to ensure it is long enough for the cipher and mode you plan to use. | |||
* See the user guide for more info. | |||
* | |||
* @var string | |||
*/ | |||
public $key = ''; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Encryption Driver to Use | |||
* -------------------------------------------------------------------------- | |||
* | |||
* One of the supported encryption drivers. | |||
* | |||
* Available drivers: | |||
* - OpenSSL | |||
* - Sodium | |||
* | |||
* @var string | |||
*/ | |||
public $driver = 'OpenSSL'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* SodiumHandler's Padding Length in Bytes | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This is the number of bytes that will be padded to the plaintext message | |||
* before it is encrypted. This value should be greater than zero. | |||
* | |||
* See the user guide for more information on padding. | |||
* | |||
* @var int | |||
*/ | |||
public $blockSize = 16; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Encryption digest | |||
* -------------------------------------------------------------------------- | |||
* | |||
* HMAC digest to use, e.g. 'SHA512' or 'SHA256'. Default value is 'SHA512'. | |||
* | |||
* @var string | |||
*/ | |||
public $digest = 'SHA512'; | |||
} |
@@ -0,0 +1,48 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Events\Events; | |||
use CodeIgniter\Exceptions\FrameworkException; | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Application Events | |||
* -------------------------------------------------------------------- | |||
* Events allow you to tap into the execution of the program without | |||
* modifying or extending core files. This file provides a central | |||
* location to define your events, though they can always be added | |||
* at run-time, also, if needed. | |||
* | |||
* You create code that can execute by subscribing to events with | |||
* the 'on()' method. This accepts any form of callable, including | |||
* Closures, that will be executed when the event is triggered. | |||
* | |||
* Example: | |||
* Events::on('create', [$myInstance, 'myMethod']); | |||
*/ | |||
Events::on('pre_system', static function () { | |||
if (ENVIRONMENT !== 'testing') { | |||
if (ini_get('zlib.output_compression')) { | |||
throw FrameworkException::forEnabledZlibOutputCompression(); | |||
} | |||
while (ob_get_level() > 0) { | |||
ob_end_flush(); | |||
} | |||
ob_start(static fn ($buffer) => $buffer); | |||
} | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Debug Toolbar Listeners. | |||
* -------------------------------------------------------------------- | |||
* If you delete, they will no longer be collected. | |||
*/ | |||
if (CI_DEBUG && ! is_cli()) { | |||
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); | |||
Services::toolbar()->respond(); | |||
} | |||
}); |
@@ -0,0 +1,60 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
/** | |||
* Setup how the exception handler works. | |||
*/ | |||
class Exceptions extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* LOG EXCEPTIONS? | |||
* -------------------------------------------------------------------------- | |||
* If true, then exceptions will be logged | |||
* through Services::Log. | |||
* | |||
* Default: true | |||
* | |||
* @var bool | |||
*/ | |||
public $log = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* DO NOT LOG STATUS CODES | |||
* -------------------------------------------------------------------------- | |||
* Any status codes here will NOT be logged if logging is turned on. | |||
* By default, only 404 (Page Not Found) exceptions are ignored. | |||
* | |||
* @var array | |||
*/ | |||
public $ignoreCodes = [404]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Error Views Path | |||
* -------------------------------------------------------------------------- | |||
* This is the path to the directory that contains the 'cli' and 'html' | |||
* directories that hold the views used to generate errors. | |||
* | |||
* Default: APPPATH.'Views/errors' | |||
* | |||
* @var string | |||
*/ | |||
public $errorViewPath = APPPATH . 'Views/errors'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* HIDE FROM DEBUG TRACE | |||
* -------------------------------------------------------------------------- | |||
* Any data that you would like to hide from the debug trace. | |||
* In order to specify 2 levels, use "/" to separate. | |||
* ex. ['server', 'setup/password', 'secret_token'] | |||
* | |||
* @var array | |||
*/ | |||
public $sensitiveDataInTrace = []; | |||
} |
@@ -0,0 +1,32 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
/** | |||
* Enable/disable backward compatibility breaking features. | |||
*/ | |||
class Feature extends BaseConfig | |||
{ | |||
/** | |||
* Enable multiple filters for a route or not. | |||
* | |||
* If you enable this: | |||
* - CodeIgniter\CodeIgniter::handleRequest() uses: | |||
* - CodeIgniter\Filters\Filters::enableFilters(), instead of enableFilter() | |||
* - CodeIgniter\CodeIgniter::tryToRouteIt() uses: | |||
* - CodeIgniter\Router\Router::getFilters(), instead of getFilter() | |||
* - CodeIgniter\Router\Router::handle() uses: | |||
* - property $filtersInfo, instead of $filterInfo | |||
* - CodeIgniter\Router\RouteCollection::getFiltersForRoute(), instead of getFilterForRoute() | |||
* | |||
* @var bool | |||
*/ | |||
public $multipleFilters = false; | |||
/** | |||
* Use improved new auto routing instead of the default legacy version. | |||
*/ | |||
public bool $autoRoutesImproved = false; | |||
} |
@@ -0,0 +1,83 @@ | |||
<?php | |||
namespace Config; | |||
use App\Filters\FormularioInicialFilter; | |||
use App\Filters\InicioFilter; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Filters\CSRF; | |||
use CodeIgniter\Filters\DebugToolbar; | |||
use CodeIgniter\Filters\Honeypot; | |||
use CodeIgniter\Filters\InvalidChars; | |||
use CodeIgniter\Filters\SecureHeaders; | |||
class Filters extends BaseConfig | |||
{ | |||
/** | |||
* Configures aliases for Filter classes to | |||
* make reading things nicer and simpler. | |||
* | |||
* @var array | |||
*/ | |||
public $aliases = [ | |||
'csrf' => CSRF::class, | |||
'toolbar' => DebugToolbar::class, | |||
'honeypot' => Honeypot::class, | |||
'invalidchars' => InvalidChars::class, | |||
'secureheaders' => SecureHeaders::class, | |||
'login' => \Myth\Auth\Filters\LoginFilter::class, | |||
'inicio' => InicioFilter::class, | |||
'formulario_inicial' => FormularioInicialFilter::class, | |||
]; | |||
/** | |||
* List of filter aliases that are always | |||
* applied before and after every request. | |||
* | |||
* @var array | |||
*/ | |||
public $globals = [ | |||
'before' => [ | |||
// 'honeypot', | |||
// 'csrf', | |||
// 'invalidchars', | |||
'login' | |||
], | |||
'after' => [ | |||
'toolbar', | |||
// 'honeypot', | |||
// 'secureheaders', | |||
], | |||
]; | |||
/** | |||
* List of filter aliases that works on a | |||
* particular HTTP method (GET, POST, etc.). | |||
* | |||
* Example: | |||
* 'post' => ['foo', 'bar'] | |||
* | |||
* If you use this, you should disable auto-routing because auto-routing | |||
* permits any HTTP method to access a controller. Accessing the controller | |||
* with a method you don’t expect could bypass the filter. | |||
* | |||
* @var array | |||
*/ | |||
public $methods = [ | |||
'post' => ['csrf'], | |||
]; | |||
/** | |||
* List of filter aliases that should run on any | |||
* before or after URI patterns. | |||
* | |||
* Example: | |||
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']] | |||
* | |||
* @var array | |||
*/ | |||
public $filters = [ | |||
'inicio' => ['before' => ['/', '/horas']], | |||
'formulario_inicial' => ['before' => ['registro/']] | |||
]; | |||
} |
@@ -0,0 +1,9 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\ForeignCharacters as BaseForeignCharacters; | |||
class ForeignCharacters extends BaseForeignCharacters | |||
{ | |||
} |
@@ -0,0 +1,77 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Format\FormatterInterface; | |||
use CodeIgniter\Format\JSONFormatter; | |||
use CodeIgniter\Format\XMLFormatter; | |||
class Format extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Available Response Formats | |||
* -------------------------------------------------------------------------- | |||
* | |||
* When you perform content negotiation with the request, these are the | |||
* available formats that your application supports. This is currently | |||
* only used with the API\ResponseTrait. A valid Formatter must exist | |||
* for the specified format. | |||
* | |||
* These formats are only checked when the data passed to the respond() | |||
* method is an array. | |||
* | |||
* @var string[] | |||
*/ | |||
public $supportedResponseFormats = [ | |||
'application/json', | |||
'application/xml', // machine-readable XML | |||
'text/xml', // human-readable XML | |||
]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Formatters | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Lists the class to use to format responses with of a particular type. | |||
* For each mime type, list the class that should be used. Formatters | |||
* can be retrieved through the getFormatter() method. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $formatters = [ | |||
'application/json' => JSONFormatter::class, | |||
'application/xml' => XMLFormatter::class, | |||
'text/xml' => XMLFormatter::class, | |||
]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Formatters Options | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Additional Options to adjust default formatters behaviour. | |||
* For each mime type, list the additional options that should be used. | |||
* | |||
* @var array<string, int> | |||
*/ | |||
public $formatterOptions = [ | |||
'application/json' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES, | |||
'application/xml' => 0, | |||
'text/xml' => 0, | |||
]; | |||
/** | |||
* A Factory method to return the appropriate formatter for the given mime type. | |||
* | |||
* @return FormatterInterface | |||
* | |||
* @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead. | |||
*/ | |||
public function getFormatter(string $mime) | |||
{ | |||
return Services::format()->getFormatter($mime); | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Generators extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Generator Commands' Views | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This array defines the mapping of generator commands to the view files | |||
* they are using. If you need to customize them for your own, copy these | |||
* view files in your own folder and indicate the location here. | |||
* | |||
* You will notice that the views have special placeholders enclosed in | |||
* curly braces `{...}`. These placeholders are used internally by the | |||
* generator commands in processing replacements, thus you are warned | |||
* not to delete them or modify the names. If you will do so, you may | |||
* end up disrupting the scaffolding process and throw errors. | |||
* | |||
* YOU HAVE BEEN WARNED! | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $views = [ | |||
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php', | |||
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php', | |||
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php', | |||
'make:entity' => 'CodeIgniter\Commands\Generators\Views\entity.tpl.php', | |||
'make:filter' => 'CodeIgniter\Commands\Generators\Views\filter.tpl.php', | |||
'make:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php', | |||
'make:model' => 'CodeIgniter\Commands\Generators\Views\model.tpl.php', | |||
'make:seeder' => 'CodeIgniter\Commands\Generators\Views\seeder.tpl.php', | |||
'make:validation' => 'CodeIgniter\Commands\Generators\Views\validation.tpl.php', | |||
'session:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php', | |||
]; | |||
} |
@@ -0,0 +1,43 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Honeypot extends BaseConfig | |||
{ | |||
/** | |||
* Makes Honeypot visible or not to human | |||
* | |||
* @var bool | |||
*/ | |||
public $hidden = true; | |||
/** | |||
* Honeypot Label Content | |||
* | |||
* @var string | |||
*/ | |||
public $label = 'Fill This Field'; | |||
/** | |||
* Honeypot Field Name | |||
* | |||
* @var string | |||
*/ | |||
public $name = 'honeypot'; | |||
/** | |||
* Honeypot HTML Template | |||
* | |||
* @var string | |||
*/ | |||
public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>'; | |||
/** | |||
* Honeypot container | |||
* | |||
* @var string | |||
*/ | |||
public $container = '<div style="display:none">{template}</div>'; | |||
} |
@@ -0,0 +1,35 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Images\Handlers\GDHandler; | |||
use CodeIgniter\Images\Handlers\ImageMagickHandler; | |||
class Images extends BaseConfig | |||
{ | |||
/** | |||
* Default handler used if no other handler is specified. | |||
* | |||
* @var string | |||
*/ | |||
public $defaultHandler = 'gd'; | |||
/** | |||
* The path to the image library. | |||
* Required for ImageMagick, GraphicsMagick, or NetPBM. | |||
* | |||
* @var string | |||
*/ | |||
public $libraryPath = '/usr/local/bin/convert'; | |||
/** | |||
* The available handler classes. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $handlers = [ | |||
'gd' => GDHandler::class, | |||
'imagick' => ImageMagickHandler::class, | |||
]; | |||
} |
@@ -0,0 +1,51 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use Kint\Renderer\Renderer; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Kint | |||
* -------------------------------------------------------------------------- | |||
* | |||
* We use Kint's `RichRenderer` and `CLIRenderer`. This area contains options | |||
* that you can set to customize how Kint works for you. | |||
* | |||
* @see https://kint-php.github.io/kint/ for details on these settings. | |||
*/ | |||
class Kint extends BaseConfig | |||
{ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Global Settings | |||
|-------------------------------------------------------------------------- | |||
*/ | |||
public $plugins; | |||
public $maxDepth = 6; | |||
public $displayCalledFrom = true; | |||
public $expanded = false; | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| RichRenderer Settings | |||
|-------------------------------------------------------------------------- | |||
*/ | |||
public $richTheme = 'aante-light.css'; | |||
public $richFolder = false; | |||
public $richSort = Renderer::SORT_FULL; | |||
public $richObjectPlugins; | |||
public $richTabPlugins; | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| CLI Settings | |||
|-------------------------------------------------------------------------- | |||
*/ | |||
public $cliColors = true; | |||
public $cliForceUTF8 = false; | |||
public $cliDetectWidth = true; | |||
public $cliMinWidth = 40; | |||
} |
@@ -0,0 +1,154 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Log\Handlers\FileHandler; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Logger extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Error Logging Threshold | |||
* -------------------------------------------------------------------------- | |||
* | |||
* You can enable error logging by setting a threshold over zero. The | |||
* threshold determines what gets logged. Any values below or equal to the | |||
* threshold will be logged. | |||
* | |||
* Threshold options are: | |||
* | |||
* - 0 = Disables logging, Error logging TURNED OFF | |||
* - 1 = Emergency Messages - System is unusable | |||
* - 2 = Alert Messages - Action Must Be Taken Immediately | |||
* - 3 = Critical Messages - Application component unavailable, unexpected exception. | |||
* - 4 = Runtime Errors - Don't need immediate action, but should be monitored. | |||
* - 5 = Warnings - Exceptional occurrences that are not errors. | |||
* - 6 = Notices - Normal but significant events. | |||
* - 7 = Info - Interesting events, like user logging in, etc. | |||
* - 8 = Debug - Detailed debug information. | |||
* - 9 = All Messages | |||
* | |||
* You can also pass an array with threshold levels to show individual error types | |||
* | |||
* array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages | |||
* | |||
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise | |||
* your log files will fill up very fast. | |||
* | |||
* @var array|int | |||
*/ | |||
public $threshold = 4; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Date Format for Logs | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Each item that is logged has an associated date. You can use PHP date | |||
* codes to set your own date formatting | |||
* | |||
* @var string | |||
*/ | |||
public $dateFormat = 'Y-m-d H:i:s'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Log Handlers | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The logging system supports multiple actions to be taken when something | |||
* is logged. This is done by allowing for multiple Handlers, special classes | |||
* designed to write the log to their chosen destinations, whether that is | |||
* a file on the getServer, a cloud-based service, or even taking actions such | |||
* as emailing the dev team. | |||
* | |||
* Each handler is defined by the class name used for that handler, and it | |||
* MUST implement the `CodeIgniter\Log\Handlers\HandlerInterface` interface. | |||
* | |||
* The value of each key is an array of configuration items that are sent | |||
* to the constructor of each handler. The only required configuration item | |||
* is the 'handles' element, which must be an array of integer log levels. | |||
* This is most easily handled by using the constants defined in the | |||
* `Psr\Log\LogLevel` class. | |||
* | |||
* Handlers are executed in the order defined in this array, starting with | |||
* the handler on top and continuing down. | |||
* | |||
* @var array | |||
*/ | |||
public $handlers = [ | |||
/* | |||
* -------------------------------------------------------------------- | |||
* File Handler | |||
* -------------------------------------------------------------------- | |||
*/ | |||
FileHandler::class => [ | |||
// The log levels that this handler will handle. | |||
'handles' => [ | |||
'critical', | |||
'alert', | |||
'emergency', | |||
'debug', | |||
'error', | |||
'info', | |||
'notice', | |||
'warning', | |||
], | |||
/* | |||
* The default filename extension for log files. | |||
* An extension of 'php' allows for protecting the log files via basic | |||
* scripting, when they are to be stored under a publicly accessible directory. | |||
* | |||
* Note: Leaving it blank will default to 'log'. | |||
*/ | |||
'fileExtension' => '', | |||
/* | |||
* The file system permissions to be applied on newly created log files. | |||
* | |||
* IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal | |||
* integer notation (i.e. 0700, 0644, etc.) | |||
*/ | |||
'filePermissions' => 0644, | |||
/* | |||
* Logging Directory Path | |||
* | |||
* By default, logs are written to WRITEPATH . 'logs/' | |||
* Specify a different destination here, if desired. | |||
*/ | |||
'path' => '', | |||
], | |||
/* | |||
* The ChromeLoggerHandler requires the use of the Chrome web browser | |||
* and the ChromeLogger extension. Uncomment this block to use it. | |||
*/ | |||
// 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [ | |||
// /* | |||
// * The log levels that this handler will handle. | |||
// */ | |||
// 'handles' => ['critical', 'alert', 'emergency', 'debug', | |||
// 'error', 'info', 'notice', 'warning'], | |||
// ], | |||
/* | |||
* The ErrorlogHandler writes the logs to PHP's native `error_log()` function. | |||
* Uncomment this block to use it. | |||
*/ | |||
// 'CodeIgniter\Log\Handlers\ErrorlogHandler' => [ | |||
// /* The log levels this handler can handle. */ | |||
// 'handles' => ['critical', 'alert', 'emergency', 'debug', 'error', 'info', 'notice', 'warning'], | |||
// | |||
// /* | |||
// * The message type where the error should go. Can be 0 or 4, or use the | |||
// * class constants: `ErrorlogHandler::TYPE_OS` (0) or `ErrorlogHandler::TYPE_SAPI` (4) | |||
// */ | |||
// 'messageType' => 0, | |||
// ], | |||
]; | |||
} |
@@ -0,0 +1,55 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Migrations extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Enable/Disable Migrations | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Migrations are enabled by default. | |||
* | |||
* You should enable migrations whenever you intend to do a schema migration | |||
* and disable it back when you're done. | |||
* | |||
* @var bool | |||
*/ | |||
public $enabled = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Migrations Table | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This is the name of the table that will store the current migrations state. | |||
* When migrations runs it will store in a database table which migration | |||
* level the system is at. It then compares the migration level in this | |||
* table to the $config['migration_version'] if they are not the same it | |||
* will migrate up. This must be set. | |||
* | |||
* @var string | |||
*/ | |||
public $table = 'migrations'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Timestamp Format | |||
* -------------------------------------------------------------------------- | |||
* | |||
* This is the format that will be used when creating new migrations | |||
* using the CLI command: | |||
* > php spark migrate:create | |||
* | |||
* Typical formats: | |||
* - YmdHis_ | |||
* - Y-m-d-His_ | |||
* - Y_m_d_His_ | |||
* | |||
* @var string | |||
*/ | |||
public $timestampFormat = 'Y-m-d-His_'; | |||
} |
@@ -0,0 +1,532 @@ | |||
<?php | |||
namespace Config; | |||
/** | |||
* Mimes | |||
* | |||
* This file contains an array of mime types. It is used by the | |||
* Upload class to help identify allowed file types. | |||
* | |||
* When more than one variation for an extension exist (like jpg, jpeg, etc) | |||
* the most common one should be first in the array to aid the guess* | |||
* methods. The same applies when more than one mime-type exists for a | |||
* single extension. | |||
* | |||
* When working with mime types, please make sure you have the ´fileinfo´ | |||
* extension enabled to reliably detect the media types. | |||
*/ | |||
class Mimes | |||
{ | |||
/** | |||
* Map of extensions to mime types. | |||
* | |||
* @var array | |||
*/ | |||
public static $mimes = [ | |||
'hqx' => [ | |||
'application/mac-binhex40', | |||
'application/mac-binhex', | |||
'application/x-binhex40', | |||
'application/x-mac-binhex40', | |||
], | |||
'cpt' => 'application/mac-compactpro', | |||
'csv' => [ | |||
'text/csv', | |||
'text/x-comma-separated-values', | |||
'text/comma-separated-values', | |||
'application/vnd.ms-excel', | |||
'application/x-csv', | |||
'text/x-csv', | |||
'application/csv', | |||
'application/excel', | |||
'application/vnd.msexcel', | |||
'text/plain', | |||
], | |||
'bin' => [ | |||
'application/macbinary', | |||
'application/mac-binary', | |||
'application/octet-stream', | |||
'application/x-binary', | |||
'application/x-macbinary', | |||
], | |||
'dms' => 'application/octet-stream', | |||
'lha' => 'application/octet-stream', | |||
'lzh' => 'application/octet-stream', | |||
'exe' => [ | |||
'application/octet-stream', | |||
'application/x-msdownload', | |||
], | |||
'class' => 'application/octet-stream', | |||
'psd' => [ | |||
'application/x-photoshop', | |||
'image/vnd.adobe.photoshop', | |||
], | |||
'so' => 'application/octet-stream', | |||
'sea' => 'application/octet-stream', | |||
'dll' => 'application/octet-stream', | |||
'oda' => 'application/oda', | |||
'pdf' => [ | |||
'application/pdf', | |||
'application/force-download', | |||
'application/x-download', | |||
], | |||
'ai' => [ | |||
'application/pdf', | |||
'application/postscript', | |||
], | |||
'eps' => 'application/postscript', | |||
'ps' => 'application/postscript', | |||
'smi' => 'application/smil', | |||
'smil' => 'application/smil', | |||
'mif' => 'application/vnd.mif', | |||
'xls' => [ | |||
'application/vnd.ms-excel', | |||
'application/msexcel', | |||
'application/x-msexcel', | |||
'application/x-ms-excel', | |||
'application/x-excel', | |||
'application/x-dos_ms_excel', | |||
'application/xls', | |||
'application/x-xls', | |||
'application/excel', | |||
'application/download', | |||
'application/vnd.ms-office', | |||
'application/msword', | |||
], | |||
'ppt' => [ | |||
'application/vnd.ms-powerpoint', | |||
'application/powerpoint', | |||
'application/vnd.ms-office', | |||
'application/msword', | |||
], | |||
'pptx' => [ | |||
'application/vnd.openxmlformats-officedocument.presentationml.presentation', | |||
], | |||
'wbxml' => 'application/wbxml', | |||
'wmlc' => 'application/wmlc', | |||
'dcr' => 'application/x-director', | |||
'dir' => 'application/x-director', | |||
'dxr' => 'application/x-director', | |||
'dvi' => 'application/x-dvi', | |||
'gtar' => 'application/x-gtar', | |||
'gz' => 'application/x-gzip', | |||
'gzip' => 'application/x-gzip', | |||
'php' => [ | |||
'application/x-php', | |||
'application/x-httpd-php', | |||
'application/php', | |||
'text/php', | |||
'text/x-php', | |||
'application/x-httpd-php-source', | |||
], | |||
'php4' => 'application/x-httpd-php', | |||
'php3' => 'application/x-httpd-php', | |||
'phtml' => 'application/x-httpd-php', | |||
'phps' => 'application/x-httpd-php-source', | |||
'js' => [ | |||
'application/x-javascript', | |||
'text/plain', | |||
], | |||
'swf' => 'application/x-shockwave-flash', | |||
'sit' => 'application/x-stuffit', | |||
'tar' => 'application/x-tar', | |||
'tgz' => [ | |||
'application/x-tar', | |||
'application/x-gzip-compressed', | |||
], | |||
'z' => 'application/x-compress', | |||
'xhtml' => 'application/xhtml+xml', | |||
'xht' => 'application/xhtml+xml', | |||
'zip' => [ | |||
'application/x-zip', | |||
'application/zip', | |||
'application/x-zip-compressed', | |||
'application/s-compressed', | |||
'multipart/x-zip', | |||
], | |||
'rar' => [ | |||
'application/vnd.rar', | |||
'application/x-rar', | |||
'application/rar', | |||
'application/x-rar-compressed', | |||
], | |||
'mid' => 'audio/midi', | |||
'midi' => 'audio/midi', | |||
'mpga' => 'audio/mpeg', | |||
'mp2' => 'audio/mpeg', | |||
'mp3' => [ | |||
'audio/mpeg', | |||
'audio/mpg', | |||
'audio/mpeg3', | |||
'audio/mp3', | |||
], | |||
'aif' => [ | |||
'audio/x-aiff', | |||
'audio/aiff', | |||
], | |||
'aiff' => [ | |||
'audio/x-aiff', | |||
'audio/aiff', | |||
], | |||
'aifc' => 'audio/x-aiff', | |||
'ram' => 'audio/x-pn-realaudio', | |||
'rm' => 'audio/x-pn-realaudio', | |||
'rpm' => 'audio/x-pn-realaudio-plugin', | |||
'ra' => 'audio/x-realaudio', | |||
'rv' => 'video/vnd.rn-realvideo', | |||
'wav' => [ | |||
'audio/x-wav', | |||
'audio/wave', | |||
'audio/wav', | |||
], | |||
'bmp' => [ | |||
'image/bmp', | |||
'image/x-bmp', | |||
'image/x-bitmap', | |||
'image/x-xbitmap', | |||
'image/x-win-bitmap', | |||
'image/x-windows-bmp', | |||
'image/ms-bmp', | |||
'image/x-ms-bmp', | |||
'application/bmp', | |||
'application/x-bmp', | |||
'application/x-win-bitmap', | |||
], | |||
'gif' => 'image/gif', | |||
'jpg' => [ | |||
'image/jpeg', | |||
'image/pjpeg', | |||
], | |||
'jpeg' => [ | |||
'image/jpeg', | |||
'image/pjpeg', | |||
], | |||
'jpe' => [ | |||
'image/jpeg', | |||
'image/pjpeg', | |||
], | |||
'jp2' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'j2k' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'jpf' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'jpg2' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'jpx' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'jpm' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'mj2' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'mjp2' => [ | |||
'image/jp2', | |||
'video/mj2', | |||
'image/jpx', | |||
'image/jpm', | |||
], | |||
'png' => [ | |||
'image/png', | |||
'image/x-png', | |||
], | |||
'webp' => 'image/webp', | |||
'tif' => 'image/tiff', | |||
'tiff' => 'image/tiff', | |||
'css' => [ | |||
'text/css', | |||
'text/plain', | |||
], | |||
'html' => [ | |||
'text/html', | |||
'text/plain', | |||
], | |||
'htm' => [ | |||
'text/html', | |||
'text/plain', | |||
], | |||
'shtml' => [ | |||
'text/html', | |||
'text/plain', | |||
], | |||
'txt' => 'text/plain', | |||
'text' => 'text/plain', | |||
'log' => [ | |||
'text/plain', | |||
'text/x-log', | |||
], | |||
'rtx' => 'text/richtext', | |||
'rtf' => 'text/rtf', | |||
'xml' => [ | |||
'application/xml', | |||
'text/xml', | |||
'text/plain', | |||
], | |||
'xsl' => [ | |||
'application/xml', | |||
'text/xsl', | |||
'text/xml', | |||
], | |||
'mpeg' => 'video/mpeg', | |||
'mpg' => 'video/mpeg', | |||
'mpe' => 'video/mpeg', | |||
'qt' => 'video/quicktime', | |||
'mov' => 'video/quicktime', | |||
'avi' => [ | |||
'video/x-msvideo', | |||
'video/msvideo', | |||
'video/avi', | |||
'application/x-troff-msvideo', | |||
], | |||
'movie' => 'video/x-sgi-movie', | |||
'doc' => [ | |||
'application/msword', | |||
'application/vnd.ms-office', | |||
], | |||
'docx' => [ | |||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document', | |||
'application/zip', | |||
'application/msword', | |||
'application/x-zip', | |||
], | |||
'dot' => [ | |||
'application/msword', | |||
'application/vnd.ms-office', | |||
], | |||
'dotx' => [ | |||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document', | |||
'application/zip', | |||
'application/msword', | |||
], | |||
'xlsx' => [ | |||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', | |||
'application/zip', | |||
'application/vnd.ms-excel', | |||
'application/msword', | |||
'application/x-zip', | |||
], | |||
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', | |||
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', | |||
'word' => [ | |||
'application/msword', | |||
'application/octet-stream', | |||
], | |||
'xl' => 'application/excel', | |||
'eml' => 'message/rfc822', | |||
'json' => [ | |||
'application/json', | |||
'text/json', | |||
], | |||
'pem' => [ | |||
'application/x-x509-user-cert', | |||
'application/x-pem-file', | |||
'application/octet-stream', | |||
], | |||
'p10' => [ | |||
'application/x-pkcs10', | |||
'application/pkcs10', | |||
], | |||
'p12' => 'application/x-pkcs12', | |||
'p7a' => 'application/x-pkcs7-signature', | |||
'p7c' => [ | |||
'application/pkcs7-mime', | |||
'application/x-pkcs7-mime', | |||
], | |||
'p7m' => [ | |||
'application/pkcs7-mime', | |||
'application/x-pkcs7-mime', | |||
], | |||
'p7r' => 'application/x-pkcs7-certreqresp', | |||
'p7s' => 'application/pkcs7-signature', | |||
'crt' => [ | |||
'application/x-x509-ca-cert', | |||
'application/x-x509-user-cert', | |||
'application/pkix-cert', | |||
], | |||
'crl' => [ | |||
'application/pkix-crl', | |||
'application/pkcs-crl', | |||
], | |||
'der' => 'application/x-x509-ca-cert', | |||
'kdb' => 'application/octet-stream', | |||
'pgp' => 'application/pgp', | |||
'gpg' => 'application/gpg-keys', | |||
'sst' => 'application/octet-stream', | |||
'csr' => 'application/octet-stream', | |||
'rsa' => 'application/x-pkcs7', | |||
'cer' => [ | |||
'application/pkix-cert', | |||
'application/x-x509-ca-cert', | |||
], | |||
'3g2' => 'video/3gpp2', | |||
'3gp' => [ | |||
'video/3gp', | |||
'video/3gpp', | |||
], | |||
'mp4' => 'video/mp4', | |||
'm4a' => 'audio/x-m4a', | |||
'f4v' => [ | |||
'video/mp4', | |||
'video/x-f4v', | |||
], | |||
'flv' => 'video/x-flv', | |||
'webm' => 'video/webm', | |||
'aac' => 'audio/x-acc', | |||
'm4u' => 'application/vnd.mpegurl', | |||
'm3u' => 'text/plain', | |||
'xspf' => 'application/xspf+xml', | |||
'vlc' => 'application/videolan', | |||
'wmv' => [ | |||
'video/x-ms-wmv', | |||
'video/x-ms-asf', | |||
], | |||
'au' => 'audio/x-au', | |||
'ac3' => 'audio/ac3', | |||
'flac' => 'audio/x-flac', | |||
'ogg' => [ | |||
'audio/ogg', | |||
'video/ogg', | |||
'application/ogg', | |||
], | |||
'kmz' => [ | |||
'application/vnd.google-earth.kmz', | |||
'application/zip', | |||
'application/x-zip', | |||
], | |||
'kml' => [ | |||
'application/vnd.google-earth.kml+xml', | |||
'application/xml', | |||
'text/xml', | |||
], | |||
'ics' => 'text/calendar', | |||
'ical' => 'text/calendar', | |||
'zsh' => 'text/x-scriptzsh', | |||
'7zip' => [ | |||
'application/x-compressed', | |||
'application/x-zip-compressed', | |||
'application/zip', | |||
'multipart/x-zip', | |||
], | |||
'cdr' => [ | |||
'application/cdr', | |||
'application/coreldraw', | |||
'application/x-cdr', | |||
'application/x-coreldraw', | |||
'image/cdr', | |||
'image/x-cdr', | |||
'zz-application/zz-winassoc-cdr', | |||
], | |||
'wma' => [ | |||
'audio/x-ms-wma', | |||
'video/x-ms-asf', | |||
], | |||
'jar' => [ | |||
'application/java-archive', | |||
'application/x-java-application', | |||
'application/x-jar', | |||
'application/x-compressed', | |||
], | |||
'svg' => [ | |||
'image/svg+xml', | |||
'image/svg', | |||
'application/xml', | |||
'text/xml', | |||
], | |||
'vcf' => 'text/x-vcard', | |||
'srt' => [ | |||
'text/srt', | |||
'text/plain', | |||
], | |||
'vtt' => [ | |||
'text/vtt', | |||
'text/plain', | |||
], | |||
'ico' => [ | |||
'image/x-icon', | |||
'image/x-ico', | |||
'image/vnd.microsoft.icon', | |||
], | |||
'stl' => [ | |||
'application/sla', | |||
'application/vnd.ms-pki.stl', | |||
'application/x-navistyle', | |||
], | |||
]; | |||
/** | |||
* Attempts to determine the best mime type for the given file extension. | |||
* | |||
* @return string|null The mime type found, or none if unable to determine. | |||
*/ | |||
public static function guessTypeFromExtension(string $extension) | |||
{ | |||
$extension = trim(strtolower($extension), '. '); | |||
if (! array_key_exists($extension, static::$mimes)) { | |||
return null; | |||
} | |||
return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; | |||
} | |||
/** | |||
* Attempts to determine the best file extension for a given mime type. | |||
* | |||
* @param string|null $proposedExtension - default extension (in case there is more than one with the same mime type) | |||
* | |||
* @return string|null The extension determined, or null if unable to match. | |||
*/ | |||
public static function guessExtensionFromType(string $type, ?string $proposedExtension = null) | |||
{ | |||
$type = trim(strtolower($type), '. '); | |||
$proposedExtension = trim(strtolower($proposedExtension ?? '')); | |||
if ( | |||
$proposedExtension !== '' | |||
&& array_key_exists($proposedExtension, static::$mimes) | |||
&& in_array($type, (array) static::$mimes[$proposedExtension], true) | |||
) { | |||
// The detected mime type matches with the proposed extension. | |||
return $proposedExtension; | |||
} | |||
// Reverse check the mime type list if no extension was proposed. | |||
// This search is order sensitive! | |||
foreach (static::$mimes as $ext => $types) { | |||
if (in_array($type, (array) $types, true)) { | |||
return $ext; | |||
} | |||
} | |||
return null; | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Modules\Modules as BaseModules; | |||
class Modules extends BaseModules | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Enable Auto-Discovery? | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If true, then auto-discovery will happen across all elements listed in | |||
* $aliases below. If false, no auto-discovery will happen at all, | |||
* giving a slight performance boost. | |||
* | |||
* @var bool | |||
*/ | |||
public $enabled = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Enable Auto-Discovery Within Composer Packages? | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If true, then auto-discovery will happen across all namespaces loaded | |||
* by Composer, as well as the namespaces configured locally. | |||
* | |||
* @var bool | |||
*/ | |||
public $discoverInComposer = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Auto-Discovery Rules | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Aliases list of all discovery classes that will be active and used during | |||
* the current application request. | |||
* | |||
* If it is not listed, only the base application elements will be used. | |||
* | |||
* @var string[] | |||
*/ | |||
public $aliases = [ | |||
'events', | |||
'filters', | |||
'registrars', | |||
'routes', | |||
'services', | |||
]; | |||
} |
@@ -0,0 +1,39 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Pager extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Templates | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Pagination links are rendered out using views to configure their | |||
* appearance. This array contains aliases and the view names to | |||
* use when rendering the links. | |||
* | |||
* Within each view, the Pager object will be available as $pager, | |||
* and the desired group as $pagerGroup; | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $templates = [ | |||
'default_full' => 'CodeIgniter\Pager\Views\default_full', | |||
'default_simple' => 'CodeIgniter\Pager\Views\default_simple', | |||
'default_head' => 'CodeIgniter\Pager\Views\default_head', | |||
]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Items Per Page | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The default number of results shown in a single page. | |||
* | |||
* @var int | |||
*/ | |||
public $perPage = 20; | |||
} |
@@ -0,0 +1,85 @@ | |||
<?php | |||
namespace Config; | |||
/** | |||
* Paths | |||
* | |||
* Holds the paths that are used by the system to | |||
* locate the main directories, app, system, etc. | |||
* | |||
* Modifying these allows you to restructure your application, | |||
* share a system folder between multiple applications, and more. | |||
* | |||
* All paths are relative to the project's root folder. | |||
*/ | |||
class Paths | |||
{ | |||
/** | |||
* --------------------------------------------------------------- | |||
* SYSTEM FOLDER NAME | |||
* --------------------------------------------------------------- | |||
* | |||
* This must contain the name of your "system" folder. Include | |||
* the path if the folder is not in the same directory as this file. | |||
* | |||
* @var string | |||
*/ | |||
public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system'; | |||
/** | |||
* --------------------------------------------------------------- | |||
* APPLICATION FOLDER NAME | |||
* --------------------------------------------------------------- | |||
* | |||
* If you want this front controller to use a different "app" | |||
* folder than the default one you can set its name here. The folder | |||
* can also be renamed or relocated anywhere on your getServer. If | |||
* you do, use a full getServer path. | |||
* | |||
* @see http://codeigniter.com/user_guide/general/managing_apps.html | |||
* | |||
* @var string | |||
*/ | |||
public $appDirectory = __DIR__ . '/..'; | |||
/** | |||
* --------------------------------------------------------------- | |||
* WRITABLE DIRECTORY NAME | |||
* --------------------------------------------------------------- | |||
* | |||
* This variable must contain the name of your "writable" directory. | |||
* The writable directory allows you to group all directories that | |||
* need write permission to a single place that can be tucked away | |||
* for maximum security, keeping it out of the app and/or | |||
* system directories. | |||
* | |||
* @var string | |||
*/ | |||
public $writableDirectory = __DIR__ . '/../../writable'; | |||
/** | |||
* --------------------------------------------------------------- | |||
* TESTS DIRECTORY NAME | |||
* --------------------------------------------------------------- | |||
* | |||
* This variable must contain the name of your "tests" directory. | |||
* | |||
* @var string | |||
*/ | |||
public $testsDirectory = __DIR__ . '/../../tests'; | |||
/** | |||
* --------------------------------------------------------------- | |||
* VIEW DIRECTORY NAME | |||
* --------------------------------------------------------------- | |||
* | |||
* This variable must contain the name of the directory that | |||
* contains the view files used by your application. By | |||
* default this is in `app/Views`. This value | |||
* is used when no value is provided to `Services::renderer()`. | |||
* | |||
* @var string | |||
*/ | |||
public $viewDirectory = __DIR__ . '/../Views'; | |||
} |
@@ -0,0 +1,28 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\Publisher as BasePublisher; | |||
/** | |||
* Publisher Configuration | |||
* | |||
* Defines basic security restrictions for the Publisher class | |||
* to prevent abuse by injecting malicious files into a project. | |||
*/ | |||
class Publisher extends BasePublisher | |||
{ | |||
/** | |||
* A list of allowed destinations with a (pseudo-)regex | |||
* of allowed files for each destination. | |||
* Attempts to publish to directories not in this list will | |||
* result in a PublisherException. Files that do no fit the | |||
* pattern will cause copy/merge to fail. | |||
* | |||
* @var array<string,string> | |||
*/ | |||
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', | |||
]; | |||
} |
@@ -0,0 +1,66 @@ | |||
<?php | |||
namespace Config; | |||
// Create a new instance of our RouteCollection class. | |||
$routes = Services::routes(); | |||
// Load the system's routing file first, so that the app and ENVIRONMENT | |||
// can override as needed. | |||
if (is_file(SYSTEMPATH . 'Config/Routes.php')) { | |||
require SYSTEMPATH . 'Config/Routes.php'; | |||
} | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Router Setup | |||
* -------------------------------------------------------------------- | |||
*/ | |||
$routes->setDefaultNamespace('App\Controllers'); | |||
$routes->setDefaultController('Home'); | |||
$routes->setDefaultMethod('index'); | |||
$routes->setTranslateURIDashes(false); | |||
$routes->set404Override(); | |||
// The Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps | |||
// where controller filters or CSRF protection are bypassed. | |||
// If you don't want to define all routes, please use the Auto Routing (Improved). | |||
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true. | |||
//$routes->setAutoRoute(false); | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Route Definitions | |||
* -------------------------------------------------------------------- | |||
*/ | |||
// We get a performance increase by specifying the default | |||
// route since we don't have to scan directories. | |||
$routes->get('/', 'Prestador::index'); | |||
$routes->get('horas/', 'Prestador::horas'); | |||
$routes->match(['get', 'post'], 'registro/', 'Prestador::formulario'); | |||
$routes->get('success', 'Prestador::success'); | |||
// utilizar m�todo attemptRegister personalizdo (no requiere de username) | |||
$routes->post('register/', 'Auth::attemptRegister'); | |||
$routes->group('admin', static function ($routes) { | |||
$routes->get('/', 'Admin::home', ['as' => 'admin_home']); | |||
}); | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Additional Routing | |||
* -------------------------------------------------------------------- | |||
* | |||
* There will often be times that you need additional routing and you | |||
* need it to be able to override any defaults in this file. Environment | |||
* based routes is one such time. require() additional route files here | |||
* to make that happen. | |||
* | |||
* You will have access to the $routes object within that file without | |||
* needing to reload it. | |||
*/ | |||
if (is_file(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) { | |||
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'; | |||
} |
@@ -0,0 +1,117 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
class Security extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Protection Method | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Protection Method for Cross Site Request Forgery protection. | |||
* | |||
* @var string 'cookie' or 'session' | |||
*/ | |||
public $csrfProtection = 'cookie'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Token Randomization | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Randomize the CSRF Token for added security. | |||
* | |||
* @var bool | |||
*/ | |||
public $tokenRandomize = false; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Token Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Token name for Cross Site Request Forgery protection. | |||
* | |||
* @var string | |||
*/ | |||
public $tokenName = 'csrf_test_name'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Header Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Header name for Cross Site Request Forgery protection. | |||
* | |||
* @var string | |||
*/ | |||
public $headerName = 'X-CSRF-TOKEN'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Cookie Name | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Cookie name for Cross Site Request Forgery protection. | |||
* | |||
* @var string | |||
*/ | |||
public $cookieName = 'csrf_cookie_name'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Expires | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Expiration time for Cross Site Request Forgery protection cookie. | |||
* | |||
* Defaults to two hours (in seconds). | |||
* | |||
* @var int | |||
*/ | |||
public $expires = 7200; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Regenerate | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Regenerate CSRF Token on every submission. | |||
* | |||
* @var bool | |||
*/ | |||
public $regenerate = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF Redirect | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Redirect to previous page with error on failure. | |||
* | |||
* @var bool | |||
*/ | |||
public $redirect = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* CSRF SameSite | |||
* -------------------------------------------------------------------------- | |||
* | |||
* Setting for CSRF SameSite cookie token. | |||
* | |||
* Allowed values are: None - Lax - Strict - ''. | |||
* | |||
* Defaults to `Lax` as recommended in this link: | |||
* | |||
* @see https://portswigger.net/web-security/csrf/samesite-cookies | |||
* | |||
* @var string | |||
* | |||
* @deprecated `Config\Cookie` $samesite property is used. | |||
*/ | |||
public $samesite = 'Lax'; | |||
} |
@@ -0,0 +1,32 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseService; | |||
/** | |||
* Services Configuration file. | |||
* | |||
* Services are simply other classes/libraries that the system uses | |||
* to do its job. This is used by CodeIgniter to allow the core of the | |||
* framework to be swapped out easily without affecting the usage within | |||
* the rest of your application. | |||
* | |||
* This file holds any application-specific services, or service overrides | |||
* that you might need. An example has been included with the general | |||
* method format you should use for your service methods. For more examples, | |||
* see the core Services file at system/Config/Services.php. | |||
*/ | |||
class Services extends BaseService | |||
{ | |||
/* | |||
* public static function example($getShared = true) | |||
* { | |||
* if ($getShared) { | |||
* return static::getSharedInstance('example'); | |||
* } | |||
* | |||
* return new \CodeIgniter\Example(); | |||
* } | |||
*/ | |||
} |
@@ -0,0 +1,100 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Database; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Events; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Files; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Logs; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Routes; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Timers; | |||
use CodeIgniter\Debug\Toolbar\Collectors\Views; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Debug Toolbar | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The Debug Toolbar provides a way to see information about the performance | |||
* and state of your application during that page display. By default it will | |||
* NOT be displayed under production environments, and will only display if | |||
* `CI_DEBUG` is true, since if it's not, there's not much to display anyway. | |||
*/ | |||
class Toolbar extends BaseConfig | |||
{ | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Toolbar Collectors | |||
* -------------------------------------------------------------------------- | |||
* | |||
* List of toolbar collectors that will be called when Debug Toolbar | |||
* fires up and collects data from. | |||
* | |||
* @var string[] | |||
*/ | |||
public $collectors = [ | |||
Timers::class, | |||
Database::class, | |||
Logs::class, | |||
Views::class, | |||
// \CodeIgniter\Debug\Toolbar\Collectors\Cache::class, | |||
Files::class, | |||
Routes::class, | |||
Events::class, | |||
\Myth\Auth\Collectors\Auth::class, | |||
]; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Collect Var Data | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If set to false var data from the views will not be colleted. Usefull to | |||
* avoid high memory usage when there are lots of data passed to the view. | |||
* | |||
* @var bool | |||
*/ | |||
public $collectVarData = true; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Max History | |||
* -------------------------------------------------------------------------- | |||
* | |||
* `$maxHistory` sets a limit on the number of past requests that are stored, | |||
* helping to conserve file space used to store them. You can set it to | |||
* 0 (zero) to not have any history stored, or -1 for unlimited history. | |||
* | |||
* @var int | |||
*/ | |||
public $maxHistory = 20; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Toolbar Views Path | |||
* -------------------------------------------------------------------------- | |||
* | |||
* The full path to the the views that are used by the toolbar. | |||
* This MUST have a trailing slash. | |||
* | |||
* @var string | |||
*/ | |||
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/'; | |||
/** | |||
* -------------------------------------------------------------------------- | |||
* Max Queries | |||
* -------------------------------------------------------------------------- | |||
* | |||
* If the Database Collector is enabled, it will log every query that the | |||
* the system generates so they can be displayed on the toolbar's timeline | |||
* and in the query log. This can lead to memory issues in some instances | |||
* with hundreds of queries. | |||
* | |||
* `$maxQueries` defines the maximum amount of queries that will be stored. | |||
* | |||
* @var int | |||
*/ | |||
public $maxQueries = 100; | |||
} |
@@ -0,0 +1,252 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* User Agents | |||
* ------------------------------------------------------------------- | |||
* | |||
* This file contains four arrays of user agent data. It is used by the | |||
* User Agent Class to help identify browser, platform, robot, and | |||
* mobile device data. The array keys are used to identify the device | |||
* and the array values are used to set the actual name of the item. | |||
*/ | |||
class UserAgents extends BaseConfig | |||
{ | |||
/** | |||
* ------------------------------------------------------------------- | |||
* OS Platforms | |||
* ------------------------------------------------------------------- | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $platforms = [ | |||
'windows nt 10.0' => 'Windows 10', | |||
'windows nt 6.3' => 'Windows 8.1', | |||
'windows nt 6.2' => 'Windows 8', | |||
'windows nt 6.1' => 'Windows 7', | |||
'windows nt 6.0' => 'Windows Vista', | |||
'windows nt 5.2' => 'Windows 2003', | |||
'windows nt 5.1' => 'Windows XP', | |||
'windows nt 5.0' => 'Windows 2000', | |||
'windows nt 4.0' => 'Windows NT 4.0', | |||
'winnt4.0' => 'Windows NT 4.0', | |||
'winnt 4.0' => 'Windows NT', | |||
'winnt' => 'Windows NT', | |||
'windows 98' => 'Windows 98', | |||
'win98' => 'Windows 98', | |||
'windows 95' => 'Windows 95', | |||
'win95' => 'Windows 95', | |||
'windows phone' => 'Windows Phone', | |||
'windows' => 'Unknown Windows OS', | |||
'android' => 'Android', | |||
'blackberry' => 'BlackBerry', | |||
'iphone' => 'iOS', | |||
'ipad' => 'iOS', | |||
'ipod' => 'iOS', | |||
'os x' => 'Mac OS X', | |||
'ppc mac' => 'Power PC Mac', | |||
'freebsd' => 'FreeBSD', | |||
'ppc' => 'Macintosh', | |||
'linux' => 'Linux', | |||
'debian' => 'Debian', | |||
'sunos' => 'Sun Solaris', | |||
'beos' => 'BeOS', | |||
'apachebench' => 'ApacheBench', | |||
'aix' => 'AIX', | |||
'irix' => 'Irix', | |||
'osf' => 'DEC OSF', | |||
'hp-ux' => 'HP-UX', | |||
'netbsd' => 'NetBSD', | |||
'bsdi' => 'BSDi', | |||
'openbsd' => 'OpenBSD', | |||
'gnu' => 'GNU/Linux', | |||
'unix' => 'Unknown Unix OS', | |||
'symbian' => 'Symbian OS', | |||
]; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Browsers | |||
* ------------------------------------------------------------------- | |||
* | |||
* The order of this array should NOT be changed. Many browsers return | |||
* multiple browser types so we want to identify the subtype first. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $browsers = [ | |||
'OPR' => 'Opera', | |||
'Flock' => 'Flock', | |||
'Edge' => 'Spartan', | |||
'Edg' => 'Edge', | |||
'Chrome' => 'Chrome', | |||
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string | |||
'Opera.*?Version' => 'Opera', | |||
'Opera' => 'Opera', | |||
'MSIE' => 'Internet Explorer', | |||
'Internet Explorer' => 'Internet Explorer', | |||
'Trident.* rv' => 'Internet Explorer', | |||
'Shiira' => 'Shiira', | |||
'Firefox' => 'Firefox', | |||
'Chimera' => 'Chimera', | |||
'Phoenix' => 'Phoenix', | |||
'Firebird' => 'Firebird', | |||
'Camino' => 'Camino', | |||
'Netscape' => 'Netscape', | |||
'OmniWeb' => 'OmniWeb', | |||
'Safari' => 'Safari', | |||
'Mozilla' => 'Mozilla', | |||
'Konqueror' => 'Konqueror', | |||
'icab' => 'iCab', | |||
'Lynx' => 'Lynx', | |||
'Links' => 'Links', | |||
'hotjava' => 'HotJava', | |||
'amaya' => 'Amaya', | |||
'IBrowse' => 'IBrowse', | |||
'Maxthon' => 'Maxthon', | |||
'Ubuntu' => 'Ubuntu Web Browser', | |||
'Vivaldi' => 'Vivaldi', | |||
]; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Mobiles | |||
* ------------------------------------------------------------------- | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $mobiles = [ | |||
// legacy array, old values commented out | |||
'mobileexplorer' => 'Mobile Explorer', | |||
// 'openwave' => 'Open Wave', | |||
// 'opera mini' => 'Opera Mini', | |||
// 'operamini' => 'Opera Mini', | |||
// 'elaine' => 'Palm', | |||
'palmsource' => 'Palm', | |||
// 'digital paths' => 'Palm', | |||
// 'avantgo' => 'Avantgo', | |||
// 'xiino' => 'Xiino', | |||
'palmscape' => 'Palmscape', | |||
// 'nokia' => 'Nokia', | |||
// 'ericsson' => 'Ericsson', | |||
// 'blackberry' => 'BlackBerry', | |||
// 'motorola' => 'Motorola' | |||
// Phones and Manufacturers | |||
'motorola' => 'Motorola', | |||
'nokia' => 'Nokia', | |||
'palm' => 'Palm', | |||
'iphone' => 'Apple iPhone', | |||
'ipad' => 'iPad', | |||
'ipod' => 'Apple iPod Touch', | |||
'sony' => 'Sony Ericsson', | |||
'ericsson' => 'Sony Ericsson', | |||
'blackberry' => 'BlackBerry', | |||
'cocoon' => 'O2 Cocoon', | |||
'blazer' => 'Treo', | |||
'lg' => 'LG', | |||
'amoi' => 'Amoi', | |||
'xda' => 'XDA', | |||
'mda' => 'MDA', | |||
'vario' => 'Vario', | |||
'htc' => 'HTC', | |||
'samsung' => 'Samsung', | |||
'sharp' => 'Sharp', | |||
'sie-' => 'Siemens', | |||
'alcatel' => 'Alcatel', | |||
'benq' => 'BenQ', | |||
'ipaq' => 'HP iPaq', | |||
'mot-' => 'Motorola', | |||
'playstation portable' => 'PlayStation Portable', | |||
'playstation 3' => 'PlayStation 3', | |||
'playstation vita' => 'PlayStation Vita', | |||
'hiptop' => 'Danger Hiptop', | |||
'nec-' => 'NEC', | |||
'panasonic' => 'Panasonic', | |||
'philips' => 'Philips', | |||
'sagem' => 'Sagem', | |||
'sanyo' => 'Sanyo', | |||
'spv' => 'SPV', | |||
'zte' => 'ZTE', | |||
'sendo' => 'Sendo', | |||
'nintendo dsi' => 'Nintendo DSi', | |||
'nintendo ds' => 'Nintendo DS', | |||
'nintendo 3ds' => 'Nintendo 3DS', | |||
'wii' => 'Nintendo Wii', | |||
'open web' => 'Open Web', | |||
'openweb' => 'OpenWeb', | |||
// Operating Systems | |||
'android' => 'Android', | |||
'symbian' => 'Symbian', | |||
'SymbianOS' => 'SymbianOS', | |||
'elaine' => 'Palm', | |||
'series60' => 'Symbian S60', | |||
'windows ce' => 'Windows CE', | |||
// Browsers | |||
'obigo' => 'Obigo', | |||
'netfront' => 'Netfront Browser', | |||
'openwave' => 'Openwave Browser', | |||
'mobilexplorer' => 'Mobile Explorer', | |||
'operamini' => 'Opera Mini', | |||
'opera mini' => 'Opera Mini', | |||
'opera mobi' => 'Opera Mobile', | |||
'fennec' => 'Firefox Mobile', | |||
// Other | |||
'digital paths' => 'Digital Paths', | |||
'avantgo' => 'AvantGo', | |||
'xiino' => 'Xiino', | |||
'novarra' => 'Novarra Transcoder', | |||
'vodafone' => 'Vodafone', | |||
'docomo' => 'NTT DoCoMo', | |||
'o2' => 'O2', | |||
// Fallback | |||
'mobile' => 'Generic Mobile', | |||
'wireless' => 'Generic Mobile', | |||
'j2me' => 'Generic Mobile', | |||
'midp' => 'Generic Mobile', | |||
'cldc' => 'Generic Mobile', | |||
'up.link' => 'Generic Mobile', | |||
'up.browser' => 'Generic Mobile', | |||
'smartphone' => 'Generic Mobile', | |||
'cellphone' => 'Generic Mobile', | |||
]; | |||
/** | |||
* ------------------------------------------------------------------- | |||
* Robots | |||
* ------------------------------------------------------------------- | |||
* | |||
* There are hundred of bots but these are the most common. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $robots = [ | |||
'googlebot' => 'Googlebot', | |||
'msnbot' => 'MSNBot', | |||
'baiduspider' => 'Baiduspider', | |||
'bingbot' => 'Bing', | |||
'slurp' => 'Inktomi Slurp', | |||
'yahoo' => 'Yahoo', | |||
'ask jeeves' => 'Ask Jeeves', | |||
'fastcrawler' => 'FastCrawler', | |||
'infoseek' => 'InfoSeek Robot 1.0', | |||
'lycos' => 'Lycos', | |||
'yandex' => 'YandexBot', | |||
'mediapartners-google' => 'MediaPartners Google', | |||
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler', | |||
'adsbot-google' => 'AdsBot Google', | |||
'feedfetcher-google' => 'Feedfetcher Google', | |||
'curious george' => 'Curious George', | |||
'ia_archiver' => 'Alexa Crawler', | |||
'MJ12bot' => 'Majestic-12', | |||
'Uptimebot' => 'Uptimebot', | |||
]; | |||
} |
@@ -0,0 +1,45 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\BaseConfig; | |||
use CodeIgniter\Validation\CreditCardRules; | |||
use CodeIgniter\Validation\FileRules; | |||
use CodeIgniter\Validation\FormatRules; | |||
use CodeIgniter\Validation\Rules; | |||
class Validation extends BaseConfig | |||
{ | |||
//-------------------------------------------------------------------- | |||
// Setup | |||
//-------------------------------------------------------------------- | |||
/** | |||
* Stores the classes that contain the | |||
* rules that are available. | |||
* | |||
* @var string[] | |||
*/ | |||
public $ruleSets = [ | |||
Rules::class, | |||
FormatRules::class, | |||
FileRules::class, | |||
CreditCardRules::class, | |||
\Myth\Auth\Authentication\Passwords\ValidationRules::class, | |||
]; | |||
/** | |||
* Specifies the views that are used to display the | |||
* errors. | |||
* | |||
* @var array<string, string> | |||
*/ | |||
public $templates = [ | |||
'list' => 'CodeIgniter\Validation\Views\list', | |||
'single' => 'CodeIgniter\Validation\Views\single', | |||
]; | |||
//-------------------------------------------------------------------- | |||
// Rules | |||
//-------------------------------------------------------------------- | |||
} |
@@ -0,0 +1,56 @@ | |||
<?php | |||
namespace Config; | |||
use CodeIgniter\Config\View as BaseView; | |||
use CodeIgniter\View\ViewDecoratorInterface; | |||
class View extends BaseView | |||
{ | |||
/** | |||
* When false, the view method will clear the data between each | |||
* call. This keeps your data safe and ensures there is no accidental | |||
* leaking between calls, so you would need to explicitly pass the data | |||
* to each view. You might prefer to have the data stick around between | |||
* calls so that it is available to all views. If that is the case, | |||
* set $saveData to true. | |||
* | |||
* @var bool | |||
*/ | |||
public $saveData = true; | |||
/** | |||
* Parser Filters map a filter name with any PHP callable. When the | |||
* Parser prepares a variable for display, it will chain it | |||
* through the filters in the order defined, inserting any parameters. | |||
* To prevent potential abuse, all filters MUST be defined here | |||
* in order for them to be available for use within the Parser. | |||
* | |||
* Examples: | |||
* { title|esc(js) } | |||
* { created_on|date(Y-m-d)|esc(attr) } | |||
* | |||
* @var array | |||
*/ | |||
public $filters = []; | |||
/** | |||
* Parser Plugins provide a way to extend the functionality provided | |||
* by the core Parser by creating aliases that will be replaced with | |||
* any callable. Can be single or tag pair. | |||
* | |||
* @var array | |||
*/ | |||
public $plugins = []; | |||
/** | |||
* View Decorators are class methods that will be run in sequence to | |||
* have a chance to alter the generated output just prior to caching | |||
* the results. | |||
* | |||
* All classes must implement CodeIgniter\View\ViewDecoratorInterface | |||
* | |||
* @var class-string<ViewDecoratorInterface>[] | |||
*/ | |||
public array $decorators = []; | |||
} |
@@ -0,0 +1,12 @@ | |||
<?php | |||
namespace App\Controllers; | |||
class Admin extends BaseController | |||
{ | |||
public function home() | |||
{ | |||
$data['title'] = 'Inicio'; | |||
return view('Admin/index', $data); | |||
} | |||
} |
@@ -0,0 +1,71 @@ | |||
<?php | |||
namespace App\Controllers; | |||
use Myth\Auth\Entities\User; | |||
use Myth\Auth\Controllers\AuthController as MythAuthController; | |||
class Auth extends MythAuthController | |||
{ | |||
/** | |||
* Attempt to register a new user. | |||
*/ | |||
public function attemptRegister() | |||
{ | |||
// Check if registration is allowed | |||
if (!$this->config->allowRegistration) { | |||
return redirect()->back()->withInput()->with('error', lang('Auth.registerDisabled')); | |||
} | |||
$users = model(UserModel::class); | |||
// Validate basics first since some password rules rely on these fields | |||
$rules = config('Validation')->registrationRules ?? [ | |||
'email' => 'required|valid_email|is_unique[users.email]', | |||
]; | |||
if (!$this->validate($rules)) { | |||
return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); | |||
} | |||
// Validate passwords since they can only be validated properly here | |||
$rules = [ | |||
'password' => 'required', | |||
'pass_confirm' => 'required|matches[password]', | |||
]; | |||
if (!$this->validate($rules)) { | |||
return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); | |||
} | |||
// Save the user | |||
$allowedPostFields = array_merge(['password'], $this->config->validFields, $this->config->personalFields); | |||
$user = new User($this->request->getPost($allowedPostFields)); | |||
$this->config->requireActivation === null ? $user->activate() : $user->generateActivateHash(); | |||
// Ensure default group gets assigned if set | |||
if (!empty($this->config->defaultUserGroup)) { | |||
$users = $users->withGroup($this->config->defaultUserGroup); | |||
} | |||
if (!$users->save($user)) { | |||
return redirect()->back()->withInput()->with('errors', $users->errors()); | |||
} | |||
if ($this->config->requireActivation !== null) { | |||
$activator = service('activator'); | |||
$sent = $activator->send($user); | |||
if (!$sent) { | |||
return redirect()->back()->withInput()->with('error', $activator->error() ?? lang('Auth.unknownError')); | |||
} | |||
// Success! | |||
return redirect()->route('login')->with('message', lang('Auth.activationSuccess')); | |||
} | |||
// Success! | |||
return redirect()->route('login')->with('message', lang('Auth.registerSuccess')); | |||
} | |||
} |
@@ -0,0 +1,52 @@ | |||
<?php | |||
namespace App\Controllers; | |||
use CodeIgniter\Controller; | |||
use CodeIgniter\HTTP\CLIRequest; | |||
use CodeIgniter\HTTP\IncomingRequest; | |||
use CodeIgniter\HTTP\RequestInterface; | |||
use CodeIgniter\HTTP\ResponseInterface; | |||
use Psr\Log\LoggerInterface; | |||
/** | |||
* Class BaseController | |||
* | |||
* BaseController provides a convenient place for loading components | |||
* and performing functions that are needed by all your controllers. | |||
* Extend this class in any new controllers: | |||
* class Home extends BaseController | |||
* | |||
* For security be sure to declare any new methods as protected or private. | |||
*/ | |||
abstract class BaseController extends Controller | |||
{ | |||
/** | |||
* Instance of the main Request object. | |||
* | |||
* @var CLIRequest|IncomingRequest | |||
*/ | |||
protected $request; | |||
/** | |||
* An array of helpers to be loaded automatically upon | |||
* class instantiation. These helpers will be available | |||
* to all other controllers that extend BaseController. | |||
* | |||
* @var array | |||
*/ | |||
protected $helpers = ['auth']; | |||
/** | |||
* Constructor. | |||
*/ | |||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) | |||
{ | |||
// Do Not Edit This Line | |||
parent::initController($request, $response, $logger); | |||
// Preload any models, libraries, etc, here. | |||
// E.g.: $this->session = \Config\Services::session(); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
<?php | |||
namespace App\Controllers; | |||
class Home extends BaseController | |||
{ | |||
public function index() | |||
{ | |||
return view('welcome_message'); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
<?php | |||
namespace App\Controllers; | |||
use App\Models\DepartamentoModel; | |||
use App\Models\EscuelaModel; | |||
use App\Models\HorasModel; | |||
use App\Models\PrestadorModel; | |||
use App\Models\PrestadorSolicitudModel; | |||
use App\Models\UserModel; | |||
use PHPUnit\Framework\MockObject\Stub\ReturnReference; | |||
class Prestador extends BaseController | |||
{ | |||
public function index() | |||
{ | |||
$horasModel = model(HorasModel::class); | |||
$segundosDiarios = model(HorasModel::class)->getHoras(user()->idprestador); | |||
$segundosMensuales = $horasModel->getSegundosMensuales(user()->idprestador); | |||
$segundosTotal = array_reduce($segundosMensuales, function ($carry, $item) { | |||
return $carry + $item['segundos']; | |||
}, 0); | |||
$data = [ | |||
'segundosMensuales' => $segundosMensuales, | |||
'horasTotales' => $segundosTotal / 3600, | |||
'segundosDiarios' => $segundosDiarios, | |||
]; | |||
return view('Prestador/index', $data); | |||
} | |||
public function horas() | |||
{ | |||
$data = [ | |||
'horas' => model(HorasModel::class)->getHoras(user()->idprestador), | |||
]; | |||
return view('Prestador/table', $data); | |||
} | |||
public function formulario() | |||
{ | |||
$prestadorModel = new PrestadorSolicitudModel(); | |||
// Guardar/actualizar registro | |||
if ($this->request->getMethod() === 'post') { | |||
$data = $this->request->getPost(); | |||
// En caso de que se actualice el registro, se tiene que agregar el id | |||
if (user()->rh_prestador_solicitud_id) { | |||
$data['id'] = user()->rh_prestador_solicitud_id; | |||
} | |||
// Validar datos | |||
if (!$prestadorModel->save($data)) { | |||
return redirect()->back()->withInput()->with('errors', $prestadorModel->errors()); | |||
} | |||
// Guardar id de prestador_solicitud en el registro del usuario (solo para nuevos registros, no actualizaciones) | |||
if (!user()->rh_prestador_solicitud_id) { | |||
$userModel = new UserModel(); | |||
$userModel->update(user_id(), [ | |||
'rh_prestador_solicitud_id' => $prestadorModel->getInsertID() | |||
]); | |||
} | |||
return view('Prestador/success'); | |||
} | |||
$data = [ | |||
'email' => user()->email, | |||
'escuelas' => model(EscuelaModel::class)->getEscuelas(), | |||
'departamentos' => model(DepartamentoModel::class)->getDepartamentos(), | |||
'datos' => $prestadorModel->getPrestadorSolicitud(user()->rh_prestador_solicitud_id), | |||
]; | |||
return view('Prestador/formulario_inicial', $data); | |||
} | |||
} |
@@ -0,0 +1,175 @@ | |||
<?php | |||
namespace App\Database\Migrations; | |||
use CodeIgniter\Database\Migration; | |||
class CreateAuthTables extends Migration | |||
{ | |||
public function up() | |||
{ | |||
// Users | |||
$this->forge->addField([ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'email' => ['type' => 'varchar', 'constraint' => 255], | |||
'password_hash' => ['type' => 'varchar', 'constraint' => 255], | |||
'reset_hash' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'reset_at' => ['type' => 'datetime', 'null' => true], | |||
'reset_expires' => ['type' => 'datetime', 'null' => true], | |||
'activate_hash' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'status' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'status_message' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'active' => ['type' => 'tinyint', 'constraint' => 1, 'null' => 0, 'default' => 0], | |||
'force_pass_reset' => ['type' => 'tinyint', 'constraint' => 1, 'null' => 0, 'default' => 0], | |||
'created_at' => ['type' => 'datetime', 'null' => true], | |||
'updated_at' => ['type' => 'datetime', 'null' => true], | |||
'deleted_at' => ['type' => 'datetime', 'null' => true], | |||
'idprestador' => ['type' => 'int', 'null' => true], | |||
]); | |||
$this->forge->addKey('id', true); | |||
$this->forge->addUniqueKey('email'); | |||
$this->forge->createTable('users', true); | |||
// Auth Login Attempts | |||
$this->forge->addField([ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'ip_address' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'email' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'user_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'null' => true], // Only for successful logins | |||
'date' => ['type' => 'datetime'], | |||
'success' => ['type' => 'tinyint', 'constraint' => 1], | |||
]); | |||
$this->forge->addKey('id', true); | |||
$this->forge->addKey('email'); | |||
$this->forge->addKey('user_id'); | |||
// NOTE: Do NOT delete the user_id or email when the user is deleted for security audits | |||
$this->forge->createTable('auth_logins', true); | |||
/* | |||
* Auth Tokens | |||
* @see https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence | |||
*/ | |||
$this->forge->addField([ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'selector' => ['type' => 'varchar', 'constraint' => 255], | |||
'hashedValidator' => ['type' => 'varchar', 'constraint' => 255], | |||
'user_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true], | |||
'expires' => ['type' => 'datetime'], | |||
]); | |||
$this->forge->addKey('id', true); | |||
$this->forge->addKey('selector'); | |||
$this->forge->addForeignKey('user_id', 'users', 'id', '', 'CASCADE'); | |||
$this->forge->createTable('auth_tokens', true); | |||
// Password Reset Table | |||
$this->forge->addField([ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'email' => ['type' => 'varchar', 'constraint' => 255], | |||
'ip_address' => ['type' => 'varchar', 'constraint' => 255], | |||
'user_agent' => ['type' => 'varchar', 'constraint' => 255], | |||
'token' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'created_at' => ['type' => 'datetime', 'null' => false], | |||
]); | |||
$this->forge->addKey('id', true); | |||
$this->forge->createTable('auth_reset_attempts', true); | |||
// Activation Attempts Table | |||
$this->forge->addField([ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'ip_address' => ['type' => 'varchar', 'constraint' => 255], | |||
'user_agent' => ['type' => 'varchar', 'constraint' => 255], | |||
'token' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], | |||
'created_at' => ['type' => 'datetime', 'null' => false], | |||
]); | |||
$this->forge->addKey('id', true); | |||
$this->forge->createTable('auth_activation_attempts', true); | |||
// Groups Table | |||
$fields = [ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'name' => ['type' => 'varchar', 'constraint' => 255], | |||
'description' => ['type' => 'varchar', 'constraint' => 255], | |||
]; | |||
$this->forge->addField($fields); | |||
$this->forge->addKey('id', true); | |||
$this->forge->createTable('auth_groups', true); | |||
// Permissions Table | |||
$fields = [ | |||
'id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true], | |||
'name' => ['type' => 'varchar', 'constraint' => 255], | |||
'description' => ['type' => 'varchar', 'constraint' => 255], | |||
]; | |||
$this->forge->addField($fields); | |||
$this->forge->addKey('id', true); | |||
$this->forge->createTable('auth_permissions', true); | |||
// Groups/Permissions Table | |||
$fields = [ | |||
'group_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
'permission_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
]; | |||
$this->forge->addField($fields); | |||
$this->forge->addKey(['group_id', 'permission_id']); | |||
$this->forge->addForeignKey('group_id', 'auth_groups', 'id', '', 'CASCADE'); | |||
$this->forge->addForeignKey('permission_id', 'auth_permissions', 'id', '', 'CASCADE'); | |||
$this->forge->createTable('auth_groups_permissions', true); | |||
// Users/Groups Table | |||
$fields = [ | |||
'group_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
'user_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
]; | |||
$this->forge->addField($fields); | |||
$this->forge->addKey(['group_id', 'user_id']); | |||
$this->forge->addForeignKey('group_id', 'auth_groups', 'id', '', 'CASCADE'); | |||
$this->forge->addForeignKey('user_id', 'users', 'id', '', 'CASCADE'); | |||
$this->forge->createTable('auth_groups_users', true); | |||
// Users/Permissions Table | |||
$fields = [ | |||
'user_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
'permission_id' => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'default' => 0], | |||
]; | |||
$this->forge->addField($fields); | |||
$this->forge->addKey(['user_id', 'permission_id']); | |||
$this->forge->addForeignKey('user_id', 'users', 'id', '', 'CASCADE'); | |||
$this->forge->addForeignKey('permission_id', 'auth_permissions', 'id', '', 'CASCADE'); | |||
$this->forge->createTable('auth_users_permissions', true); | |||
} | |||
//-------------------------------------------------------------------- | |||
public function down() | |||
{ | |||
// drop constraints first to prevent errors | |||
if ($this->db->DBDriver !== 'SQLite3') { // @phpstan-ignore-line | |||
$this->forge->dropForeignKey('auth_tokens', 'auth_tokens_user_id_foreign'); | |||
$this->forge->dropForeignKey('auth_groups_permissions', 'auth_groups_permissions_group_id_foreign'); | |||
$this->forge->dropForeignKey('auth_groups_permissions', 'auth_groups_permissions_permission_id_foreign'); | |||
$this->forge->dropForeignKey('auth_groups_users', 'auth_groups_users_group_id_foreign'); | |||
$this->forge->dropForeignKey('auth_groups_users', 'auth_groups_users_user_id_foreign'); | |||
$this->forge->dropForeignKey('auth_users_permissions', 'auth_users_permissions_user_id_foreign'); | |||
$this->forge->dropForeignKey('auth_users_permissions', 'auth_users_permissions_permission_id_foreign'); | |||
} | |||
$this->forge->dropTable('users', true); | |||
$this->forge->dropTable('auth_logins', true); | |||
$this->forge->dropTable('auth_tokens', true); | |||
$this->forge->dropTable('auth_reset_attempts', true); | |||
$this->forge->dropTable('auth_activation_attempts', true); | |||
$this->forge->dropTable('auth_groups', true); | |||
$this->forge->dropTable('auth_permissions', true); | |||
$this->forge->dropTable('auth_groups_permissions', true); | |||
$this->forge->dropTable('auth_groups_users', true); | |||
$this->forge->dropTable('auth_users_permissions', true); | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace App\Entities; | |||
use CodeIgniter\Entity\Entity; | |||
class PrestadorSolicitud extends Entity | |||
{ | |||
// ... | |||
} |
@@ -0,0 +1,45 @@ | |||
<?php | |||
namespace App\Filters; | |||
use App\Models\UserModel; | |||
use CodeIgniter\Filters\FilterInterface; | |||
use CodeIgniter\HTTP\RequestInterface; | |||
use CodeIgniter\HTTP\ResponseInterface; | |||
class FormularioInicialFilter implements FilterInterface | |||
{ | |||
/** | |||
* Revisar que el usuario no haya contestado este formulario | |||
* | |||
* @param RequestInterface $request | |||
* @param array|null $arguments | |||
* | |||
* @return mixed | |||
*/ | |||
public function before(RequestInterface $request, $arguments = null) | |||
{ | |||
// Usuario ya contestó el formulario y fue aprobado | |||
if (user()->idprestador) { | |||
return redirect('/'); | |||
} | |||
} | |||
/** | |||
* Allows After filters to inspect and modify the response | |||
* object as needed. This method does not allow any way | |||
* to stop execution of other after filters, short of | |||
* throwing an Exception or Error. | |||
* | |||
* @param RequestInterface $request | |||
* @param ResponseInterface $response | |||
* @param array|null $arguments | |||
* | |||
* @return mixed | |||
*/ | |||
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) | |||
{ | |||
// | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
<?php | |||
namespace App\Filters; | |||
use App\Models\UserModel; | |||
use CodeIgniter\Filters\FilterInterface; | |||
use CodeIgniter\HTTP\RequestInterface; | |||
use CodeIgniter\HTTP\ResponseInterface; | |||
class InicioFilter implements FilterInterface | |||
{ | |||
/** | |||
* Revisar que el usuario ya tenga su registro en la tabla prestador | |||
* De lo contrario, redireccionar a formualrio | |||
* | |||
* @param RequestInterface $request | |||
* @param array|null $arguments | |||
* | |||
* @return mixed | |||
*/ | |||
public function before(RequestInterface $request, $arguments = null) | |||
{ | |||
// Usuario no cuenta tiene asignado un registro en `prestador` | |||
if (!user()->idprestador) { | |||
// Usuario no ha registrado sus datos por primera vez | |||
if (!user()->rh_prestador_solicitud_id) { | |||
return redirect('registro'); | |||
} | |||
// Ya registró sus datos, está pendiente la aprobación de RH | |||
return \Config\Services::response()->setBody(view('Prestador/success')); | |||
} | |||
} | |||
/** | |||
* Allows After filters to inspect and modify the response | |||
* object as needed. This method does not allow any way | |||
* to stop execution of other after filters, short of | |||
* throwing an Exception or Error. | |||
* | |||
* @param RequestInterface $request | |||
* @param ResponseInterface $response | |||
* @param array|null $arguments | |||
* | |||
* @return mixed | |||
*/ | |||
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) | |||
{ | |||
// | |||
} | |||
} |
@@ -0,0 +1,6 @@ | |||
<?php | |||
// override core en language system validation or define your own en language validation message | |||
return [ | |||
'required' => 'El campo {field} es obligatorio', | |||
]; |
@@ -0,0 +1,20 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
class DepartamentoModel extends Model | |||
{ | |||
protected $table = 'departamento'; | |||
protected $primaryKey = 'iddepartamento'; | |||
function getDepartamentos() | |||
{ | |||
return $this->select(['iddepartamento', 'nombre']) | |||
->where('status', '1') | |||
->orderBy('nombre') | |||
->findAll(); | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
class EscuelaModel extends Model | |||
{ | |||
protected $table = 'escuela'; | |||
protected $primaryKey = 'idescuela'; | |||
function getEscuelas() | |||
{ | |||
return $this->select(['idescuela', 'nombrecorto']) | |||
->where('status_web', 1) | |||
->orderBy('nombrecorto') | |||
->findAll(); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
class HorasModel extends Model | |||
{ | |||
protected $table = 'horasprestador'; | |||
protected $primaryKey = 'id'; | |||
protected $useTimestamps = false; | |||
function getHorasRealizadas($idPrestador = null) | |||
{ | |||
return $this | |||
->selectSum('total_horas_truncadas', 'horas') | |||
->where('idprestador', $idPrestador) | |||
->first(); | |||
} | |||
function getHoras($idPrestador = null) | |||
{ | |||
return $this | |||
->select(['dia', 'mes', 'ano', 'total_horas_truncadas']) | |||
->where('idprestador', $idPrestador) | |||
->where('total_horas_truncadas >', 0) | |||
->orderBy('ano DESC, mes DESC, dia DESC') | |||
->findAll(); | |||
} | |||
function getSegundosMensuales($idPrestador = null) | |||
{ | |||
return $this | |||
->select(['mes', 'ano']) | |||
->selectSum('total_horas_truncadas', 'segundos') | |||
->where('idprestador', $idPrestador) | |||
->groupby(['mes', 'ano']) | |||
->findAll(); | |||
} | |||
} |
@@ -0,0 +1,99 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
use DateTime; | |||
class LoginModel extends Model | |||
{ | |||
protected $table = 'auth_logins'; | |||
protected $primaryKey = 'id'; | |||
protected $returnType = 'object'; | |||
protected $useSoftDeletes = false; | |||
protected $allowedFields = [ | |||
'ip_address', 'email', 'user_id', 'date', 'success', | |||
]; | |||
protected $useTimestamps = false; | |||
protected $validationRules = [ | |||
'ip_address' => 'required', | |||
'email' => 'required', | |||
'user_id' => 'permit_empty|integer', | |||
'date' => 'required|valid_date', | |||
]; | |||
protected $validationMessages = []; | |||
protected $skipValidation = false; | |||
/** | |||
* Stores a remember-me token for the user. | |||
* | |||
* @return mixed | |||
*/ | |||
public function rememberUser(int $userID, string $selector, string $validator, string $expires) | |||
{ | |||
$expires = new DateTime($expires); | |||
return $this->db->table('auth_tokens')->insert([ | |||
'user_id' => $userID, | |||
'selector' => $selector, | |||
'hashedValidator' => $validator, | |||
'expires' => $expires->format('Y-m-d H:i:s'), | |||
]); | |||
} | |||
/** | |||
* Returns the remember-me token info for a given selector. | |||
* | |||
* @return mixed | |||
*/ | |||
public function getRememberToken(string $selector) | |||
{ | |||
return $this->db->table('auth_tokens') | |||
->where('selector', $selector) | |||
->get() | |||
->getRow(); | |||
} | |||
/** | |||
* Updates the validator for a given selector. | |||
* | |||
* @return mixed | |||
*/ | |||
public function updateRememberValidator(string $selector, string $validator) | |||
{ | |||
return $this->db->table('auth_tokens') | |||
->where('selector', $selector) | |||
->update([ | |||
'hashedValidator' => hash('sha256', $validator), | |||
'expires' => (new DateTime())->modify('+' . config('Auth')->rememberLength . ' seconds')->format('Y-m-d H:i:s'), | |||
]); | |||
} | |||
/** | |||
* Removes all persistent login tokens (RememberMe) for a single user | |||
* across all devices they may have logged in with. | |||
* | |||
* @return mixed | |||
*/ | |||
public function purgeRememberTokens(int $id) | |||
{ | |||
return $this->builder('auth_tokens')->where(['user_id' => $id])->delete(); | |||
} | |||
/** | |||
* Purges the 'auth_tokens' table of any records that are past | |||
* their expiration date already. | |||
*/ | |||
public function purgeOldRememberTokens() | |||
{ | |||
$config = config('Auth'); | |||
if (! $config->allowRemembering) { | |||
return; | |||
} | |||
$this->db->table('auth_tokens') | |||
->where('expires <=', date('Y-m-d H:i:s')) | |||
->delete(); | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
class PrestadorModel extends Model | |||
{ | |||
protected $table = 'prestador'; | |||
protected $primaryKey = 'idprestador'; | |||
protected $useTimestamps = false; | |||
function getPrestador($id = null) | |||
{ | |||
return $this->where('idprestador', $id)->first(); | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
class PrestadorSolicitudModel extends Model | |||
{ | |||
protected $table = 'rh_prestador_solicitud'; | |||
protected $allowedFields = [ | |||
'nombre', 'apaterno', 'amaterno', 'fechanac', | |||
'direccion', 'colonia', 'municipio', 'cp', | |||
'telefono', 'celular', 'email', | |||
'idescuela', 'carrera', 'grado', 'turno', | |||
'tipo', 'fechainicio', 'iddepartamento_actual', 'horas_servicio', | |||
'codigo_estudiante', 'horario', | |||
]; | |||
// protected $returnType = \App\Entities\PrestadorSolicitud::class; | |||
protected $useTimestamps = true; | |||
protected $createdField = 'registro_fecha'; | |||
// protected $validationRules = [ | |||
// 'nombre' => 'required|alpha_space', | |||
// ]; | |||
protected $validationRules = [ | |||
'nombre' => 'required', | |||
'apaterno' => 'required', | |||
'amaterno' => 'required', | |||
'fechanac' => 'required|', | |||
'direccion' => 'required|alpha_numeric_punct', | |||
'colonia' => 'required|alpha_numeric_punct', | |||
'municipio' => 'required', | |||
'cp' => 'required', | |||
'telefono' => 'required', | |||
'celular' => 'required', | |||
'email' => 'required|valid_email', | |||
'idescuela' => 'required', | |||
'carrera' => 'required', | |||
'grado' => 'required', | |||
'turno' => 'required', | |||
'tipo' => 'required', | |||
'fechainicio' => 'required', | |||
'horas_servicio' => 'required|integer', | |||
]; | |||
protected $validationMessages = [ | |||
'nombre' => [ | |||
'alpha_space' => 'Nombre contiene caracteres no permitidos.', | |||
] | |||
]; | |||
// protected $validationMessages = [ | |||
// 'email' => [ | |||
// 'is_unique' => 'Sorry. That email has already been taken. Please choose another.', | |||
// ], | |||
// ]; | |||
function getPrestadorSolicitud($id = null) | |||
{ | |||
return $this->where('id', $id)->first(); | |||
} | |||
} |
@@ -0,0 +1,123 @@ | |||
<?php | |||
namespace App\Models; | |||
use CodeIgniter\Model; | |||
use Faker\Generator; | |||
use Myth\Auth\Authorization\GroupModel; | |||
use Myth\Auth\Entities\User; | |||
/** | |||
* @method User|null first() | |||
*/ | |||
class UserModel extends Model | |||
{ | |||
protected $table = 'users'; | |||
protected $primaryKey = 'id'; | |||
protected $returnType = User::class; | |||
protected $useSoftDeletes = true; | |||
protected $allowedFields = [ | |||
'email', 'password_hash', 'reset_hash', 'reset_at', 'reset_expires', 'activate_hash', | |||
'status', 'status_message', 'active', 'force_pass_reset', 'permissions', 'deleted_at', | |||
'rh_prestador_solicitud_id' | |||
]; | |||
protected $useTimestamps = true; | |||
protected $validationRules = [ | |||
'email' => 'required|valid_email|is_unique[users.email,id,{id}]', | |||
'password_hash' => 'required', | |||
]; | |||
protected $validationMessages = []; | |||
protected $skipValidation = false; | |||
protected $afterInsert = ['addToGroup']; | |||
/** | |||
* The id of a group to assign. | |||
* Set internally by withGroup. | |||
* | |||
* @var int|null | |||
*/ | |||
protected $assignGroup; | |||
/** | |||
* Logs a password reset attempt for posterity sake. | |||
*/ | |||
public function logResetAttempt(string $email, ?string $token = null, ?string $ipAddress = null, ?string $userAgent = null) | |||
{ | |||
$this->db->table('auth_reset_attempts')->insert([ | |||
'email' => $email, | |||
'ip_address' => $ipAddress, | |||
'user_agent' => $userAgent, | |||
'token' => $token, | |||
'created_at' => date('Y-m-d H:i:s'), | |||
]); | |||
} | |||
/** | |||
* Logs an activation attempt for posterity sake. | |||
*/ | |||
public function logActivationAttempt(?string $token = null, ?string $ipAddress = null, ?string $userAgent = null) | |||
{ | |||
$this->db->table('auth_activation_attempts')->insert([ | |||
'ip_address' => $ipAddress, | |||
'user_agent' => $userAgent, | |||
'token' => $token, | |||
'created_at' => date('Y-m-d H:i:s'), | |||
]); | |||
} | |||
/** | |||
* Sets the group to assign any users created. | |||
* | |||
* @return $this | |||
*/ | |||
public function withGroup(string $groupName) | |||
{ | |||
$group = $this->db->table('auth_groups')->where('name', $groupName)->get()->getFirstRow(); | |||
$this->assignGroup = $group->id; | |||
return $this; | |||
} | |||
/** | |||
* Clears the group to assign to newly created users. | |||
* | |||
* @return $this | |||
*/ | |||
public function clearGroup() | |||
{ | |||
$this->assignGroup = null; | |||
return $this; | |||
} | |||
/** | |||
* If a default role is assigned in Config\Auth, will | |||
* add this user to that group. Will do nothing | |||
* if the group cannot be found. | |||
* | |||
* @param mixed $data | |||
* | |||
* @return mixed | |||
*/ | |||
protected function addToGroup($data) | |||
{ | |||
if (is_numeric($this->assignGroup)) { | |||
$groupModel = model(GroupModel::class); | |||
$groupModel->addUserToGroup($data['id'], $this->assignGroup); | |||
} | |||
return $data; | |||
} | |||
/** | |||
* Faked data for Fabricator. | |||
*/ | |||
public function fake(Generator &$faker): User | |||
{ | |||
return new User([ | |||
'email' => $faker->email, | |||
'password' => bin2hex(random_bytes(16)), | |||
]); | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
<?= $this->extend('templates/baseAdmin') ?> | |||
<?= $this->section('content') ?> | |||
<h1>hey</h1> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,9 @@ | |||
<p>Correo de confirmación del sitio web: <?= site_url() ?>.</p> | |||
<p>Activa tu cuenta con el siguiente enlace, inicia sesión, y contesta el formulario.</p> | |||
<p><a href="<?= site_url('activate-account') . '?token=' . $hash ?>">Activa tu cuenta</a>.</p> | |||
<br> | |||
<p>Si no te registraste en este sitio web, puedes ignorar este correo.</p> |
@@ -0,0 +1,11 @@ | |||
<p>Someone requested a password reset at this email address for <?= site_url() ?>.</p> | |||
<p>To reset the password use this code or URL and follow the instructions.</p> | |||
<p>Your Code: <?= $hash ?></p> | |||
<p>Visit the <a href="<?= site_url('reset-password') . '?token=' . $hash ?>">Reset Form</a>.</p> | |||
<br> | |||
<p>If you did not request a password reset, you can safely ignore this email.</p> |
@@ -0,0 +1,44 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Forgot Password<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="container"> | |||
<div class="row"> | |||
<div class="col-sm-6 offset-sm-3"> | |||
<div class="card"> | |||
<h2 class="card-header"><?= lang('Auth.forgotPassword') ?></h2> | |||
<div class="card-body"> | |||
<?= view('Myth\Auth\Views\_message_block') ?> | |||
<p><?= lang('Auth.enterEmailForInstructions') ?></p> | |||
<form action="<?= route_to('forgot') ?>" method="post"> | |||
<?= csrf_field() ?> | |||
<div class="form-group"> | |||
<label for="email"><?= lang('Auth.emailAddress') ?></label> | |||
<input type="email" class="form-control <?php if (session('errors.email')) : ?>is-invalid<?php endif ?>" name="email" aria-describedby="emailHelp" placeholder="<?= lang('Auth.email') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.email') ?> | |||
</div> | |||
</div> | |||
<br> | |||
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.sendInstructions') ?></button> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,77 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Login<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="container"> | |||
<div class="row"> | |||
<div class="col-sm-6 offset-sm-3"> | |||
<div class="card"> | |||
<h2 class="card-header"><?= lang('Auth.loginTitle') ?></h2> | |||
<div class="card-body"> | |||
<?= view('Myth\Auth\Views\_message_block') ?> | |||
<form action="<?= route_to('login') ?>" method="post"> | |||
<?= csrf_field() ?> | |||
<?php if ($config->validFields === ['email']) : ?> | |||
<div class="form-group"> | |||
<label for="login"><?= lang('Auth.email') ?></label> | |||
<input type="email" class="form-control <?php if (session('errors.login')) : ?>is-invalid<?php endif ?>" name="login" placeholder="<?= lang('Auth.email') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.login') ?> | |||
</div> | |||
</div> | |||
<?php else : ?> | |||
<div class="form-group"> | |||
<label for="login"><?= lang('Auth.emailOrUsername') ?></label> | |||
<input type="text" class="form-control <?php if (session('errors.login')) : ?>is-invalid<?php endif ?>" name="login" placeholder="<?= lang('Auth.emailOrUsername') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.login') ?> | |||
</div> | |||
</div> | |||
<?php endif; ?> | |||
<div class="form-group"> | |||
<label for="password"><?= lang('Auth.password') ?></label> | |||
<input type="password" name="password" class="form-control <?php if (session('errors.password')) : ?>is-invalid<?php endif ?>" placeholder="<?= lang('Auth.password') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.password') ?> | |||
</div> | |||
</div> | |||
<?php if ($config->allowRemembering) : ?> | |||
<div class="form-check"> | |||
<label class="form-check-label"> | |||
<input type="checkbox" name="remember" class="form-check-input" <?php if (old('remember')) : ?> checked <?php endif ?>> | |||
<?= lang('Auth.rememberMe') ?> | |||
</label> | |||
</div> | |||
<?php endif; ?> | |||
<br> | |||
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.loginAction') ?></button> | |||
</form> | |||
<hr> | |||
<?php if ($config->allowRegistration) : ?> | |||
<p><a href="<?= route_to('register') ?>"><?= lang('Auth.needAnAccount') ?></a></p> | |||
<?php endif; ?> | |||
<?php if ($config->activeResetter) : ?> | |||
<p><a href="<?= route_to('forgot') ?>"><?= lang('Auth.forgotYourPassword') ?></a></p> | |||
<?php endif; ?> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,55 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Register<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="container"> | |||
<div class="row"> | |||
<div class="col-sm-6 offset-sm-3"> | |||
<div class="card"> | |||
<h2 class="card-header"><?= lang('Auth.register') ?></h2> | |||
<div class="card-body"> | |||
<?= view('Myth\Auth\Views\_message_block') ?> | |||
<form action="<?= route_to('register') ?>" method="post"> | |||
<?= csrf_field() ?> | |||
<div class="form-group"> | |||
<label for="email"><?= lang('Auth.email') ?></label> | |||
<input type="email" class="form-control <?php if (session('errors.email')) : ?>is-invalid<?php endif ?>" name="email" aria-describedby="emailHelp" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>"> | |||
<small id="emailHelp" class="form-text text-muted"><?= lang('Auth.weNeverShare') ?></small> | |||
</div> | |||
<div class="form-group"> | |||
<label for="password"><?= lang('Auth.password') ?></label> | |||
<input type="password" name="password" class="form-control <?php if (session('errors.password')) : ?>is-invalid<?php endif ?>" placeholder="<?= lang('Auth.password') ?>" autocomplete="off"> | |||
</div> | |||
<div class="form-group"> | |||
<label for="pass_confirm"><?= lang('Auth.repeatPassword') ?></label> | |||
<input type="password" name="pass_confirm" class="form-control <?php if (session('errors.pass_confirm')) : ?>is-invalid<?php endif ?>" placeholder="<?= lang('Auth.repeatPassword') ?>" autocomplete="off"> | |||
</div> | |||
<br> | |||
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.register') ?></button> | |||
</form> | |||
<hr> | |||
<p><?= lang('Auth.alreadyRegistered') ?> <a href="<?= route_to('login') ?>"><?= lang('Auth.signIn') ?></a></p> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,70 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Reset Password<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="container"> | |||
<div class="row"> | |||
<div class="col-sm-6 offset-sm-3"> | |||
<div class="card"> | |||
<h2 class="card-header"><?= lang('Auth.resetYourPassword') ?></h2> | |||
<div class="card-body"> | |||
<?= view('Myth\Auth\Views\_message_block') ?> | |||
<p><?= lang('Auth.enterCodeEmailPassword') ?></p> | |||
<form action="<?= route_to('reset-password') ?>" method="post"> | |||
<?= csrf_field() ?> | |||
<div class="form-group"> | |||
<label for="token"><?= lang('Auth.token') ?></label> | |||
<input type="text" class="form-control <?php if (session('errors.token')) : ?>is-invalid<?php endif ?>" name="token" placeholder="<?= lang('Auth.token') ?>" value="<?= old('token', $token ?? '') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.token') ?> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label for="email"><?= lang('Auth.email') ?></label> | |||
<input type="email" class="form-control <?php if (session('errors.email')) : ?>is-invalid<?php endif ?>" name="email" aria-describedby="emailHelp" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.email') ?> | |||
</div> | |||
</div> | |||
<br> | |||
<div class="form-group"> | |||
<label for="password"><?= lang('Auth.newPassword') ?></label> | |||
<input type="password" class="form-control <?php if (session('errors.password')) : ?>is-invalid<?php endif ?>" name="password"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.password') ?> | |||
</div> | |||
</div> | |||
<div class="form-group"> | |||
<label for="pass_confirm"><?= lang('Auth.newPasswordRepeat') ?></label> | |||
<input type="password" class="form-control <?php if (session('errors.pass_confirm')) : ?>is-invalid<?php endif ?>" name="pass_confirm"> | |||
<div class="invalid-feedback"> | |||
<?= session('errors.pass_confirm') ?> | |||
</div> | |||
</div> | |||
<br> | |||
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.resetPassword') ?></button> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,199 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Prestador<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<?= view('Myth\Auth\Views\_message_block') ?> | |||
<div class="card mb-5"> | |||
<div class="card-header"> | |||
Registra tus datos, estos se validarán por RH | |||
</div> | |||
<div class="card-body"> | |||
<form action="<?= route_to('registro') ?>" method="POST"> | |||
<?= csrf_field() ?> | |||
<!-- Datos personales --> | |||
<h5>Datos Personales</h5> | |||
<div class="row mb-3"> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Nombre*</label> | |||
<input name="nombre" type="text" class="form-control <?php if (session('errors.nombre')) : ?>is-invalid<?php endif ?>" value="<?php if (old('nombre')) echo old('nombre'); | |||
else if ($datos) echo $datos['nombre']; | |||
?>" required> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Apellido Paterno*</label> | |||
<input name="apaterno" type="text" class="form-control <?php if (session('errors.apaterno')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('apaterno')) echo old('apaterno'); | |||
else if ($datos) echo $datos['apaterno']; | |||
?>"> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Apellido Materno*</label> | |||
<input name="amaterno" type="text" class="form-control <?php if (session('errors.amaterno')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('amaterno')) echo old('amaterno'); | |||
else if ($datos) echo $datos['amaterno']; | |||
?>"> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Fecha de Nacimiento*</label> | |||
<input name="fechanac" type="date" class="form-control <?php if (session('errors.fechanac')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('fechanac')) echo old('fechanac'); | |||
else if ($datos) echo explode(' ', $datos['fechanac'])[0]; | |||
?>"> | |||
</div> | |||
</div> | |||
<!-- Contacto --> | |||
<div class="row mb-4"> | |||
<div class="col-md-6"> | |||
<label class="form-label" for="">E-mail*</label> | |||
<input name="email" type="email" class="form-control <?php if (session('errors.email')) : ?>is-invalid<?php endif ?>" readonly value="<?= $email ?>"> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Teléfono Fijo</label> | |||
<input name="telefono" type="text" class="form-control <?php if (session('errors.telefono')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('telefono')) echo old('telefono'); | |||
else if ($datos) echo $datos['telefono']; | |||
?>"> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Celular*</label> | |||
<input name="celular" type="text" class="form-control <?php if (session('errors.celular')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('celular')) echo old('celular'); | |||
else if ($datos) echo $datos['celular']; | |||
?>"> | |||
</div> | |||
</div> | |||
<hr class="mb-5"> | |||
<!-- Dirección --> | |||
<h5>Dirección</h5> | |||
<div class="row mb-4"> | |||
<div class="col-md-4"> | |||
<label class="form-label" for="">Domicilio*</label> | |||
<input name="direccion" type="text" class="form-control <?php if (session('errors.direccion')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('direccion')) echo old('direccion'); | |||
else if ($datos) echo $datos['direccion']; | |||
?>"> | |||
</div> | |||
<div class="col-md-4"> | |||
<label class="form-label" for="">Colonia*</label> | |||
<input name="colonia" type="text" class="form-control <?php if (session('errors.colonia')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('colonia')) echo old('colonia'); | |||
else if ($datos) echo $datos['colonia']; | |||
?>"> | |||
</div> | |||
<div class="col-md-4"> | |||
<label class="form-label" for="">Municipio*</label> | |||
<input name="municipio" type="text" class="form-control <?php if (session('errors.municipio')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('municipio')) echo old('municipio'); | |||
else if ($datos) echo $datos['municipio']; | |||
?>"> | |||
</div> | |||
<div class="col-md-2"> | |||
<label class="form-label" for="">Código Postal*</label> | |||
<input name="cp" type="text" class="form-control <?php if (session('errors.cp')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('cp')) echo old('cp'); | |||
else if ($datos) echo $datos['cp']; | |||
?>"> | |||
</div> | |||
</div> | |||
<hr class="mb-5"> | |||
<!-- Educación --> | |||
<h5 class="mb-3">Educación*</h5> | |||
<div class="row mb-4"> | |||
<div class="col-md-2"> | |||
<!-- NO SE GUARDA EN NING�N LUGAR --> | |||
<label class="form-label" for="">Código de Estudiante*</label> | |||
<input name="codigo_estudiante" type="text" class="form-control" required value="<?php if (old('codigo_estudiante')) echo old('codigo_estudiante'); | |||
else if ($datos) echo $datos['codigo_estudiante']; | |||
?>"> | |||
</div> | |||
<div class="col-md-5"> | |||
<label class="form-label" for="">Centro Universitario*</label> | |||
<select name="idescuela" class="form-select <?php if (session('errors.idescuela')) : ?>is-invalid<?php endif ?>" required> | |||
<option disabled selected value>---</option> | |||
<?php foreach ($escuelas as $escuela) : ?> | |||
<option value="<?= esc($escuela['idescuela']) ?>" <?php if (isset($datos) && $escuela['idescuela'] == $datos['idescuela']) echo 'selected="selected"'; ?>><?= esc($escuela['nombrecorto']) ?></option> | |||
<?php endforeach ?> | |||
</select> | |||
</div> | |||
<div class="col-md-5"> | |||
<label class="form-label" for="">Carrera*</label> | |||
<input name="carrera" type="text" class="form-control <?php if (session('errors.carrera')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('carrera')) echo old('carrera'); | |||
else if ($datos) echo $datos['carrera']; | |||
?>"> | |||
</div> | |||
<div class="col-md-2"> | |||
<label class="form-label" for="">Grado*</label> | |||
<input name="grado" type="text" class="form-control <?php if (session('errors.grado')) : ?>is-invalid<?php endif ?>" required value="<?php if (old('grado')) echo old('grado'); | |||
else if ($datos) echo $datos['grado']; | |||
?>"> | |||
</div> | |||
<div class="col-md-5"> | |||
<label class="form-label">Turno*</label> | |||
<select name="turno" class="form-select <?php if (session('errors.turno')) : ?>is-invalid<?php endif ?>" required> | |||
<option hidden disabled selected value>---</option> | |||
<option value="1" <?php if (isset($datos) && $datos['turno'] == 1) echo 'selected="selected"'; ?>>Matutino</option> | |||
<option value="2" <?php if (isset($datos) && $datos['turno'] == 2) echo 'selected="selected"'; ?>>Verspertino</option> | |||
<option value="3" <?php if (isset($datos) && $datos['turno'] == 3) echo 'selected="selected"'; ?>>Mixto</option> | |||
</select> | |||
</div> | |||
</div> | |||
<hr class="mb-5"> | |||
<!-- --> | |||
<h5 class="mb-3">Servicio Social / Prácticas Profesionales</h5> | |||
<div class="row mb-4"> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Elegiste Coparmex para realizar*</label> | |||
<select name="tipo" class="form-select <?php if (session('errors.tipo')) : ?>is-invalid<?php endif ?>" required> | |||
<option hidden disabled selected value>---</option> | |||
<option value="1" <?php if (isset($datos) && $datos['tipo'] == 1) echo 'selected="selected"'; ?>>Servicio Social</option> | |||
<option value="2" <?php if (isset($datos) && $datos['tipo'] == 2) echo 'selected="selected"'; ?>>Prácticas Profesionales</option> | |||
</select> | |||
</div> | |||
<div class="col-md-6"> | |||
<!-- NO SE GUARDA CAMPO EN NING�N LUGAR --> | |||
<label class="form-label">Disponibilidad de horario*</label> | |||
<select name="horario" class="form-select"> | |||
<option value="1" <?php if (isset($datos) && $datos['horario'] == 1) echo 'selected="selected"'; ?>>08:00 am a 12:00 pm</option> | |||
<option value="2" <?php if (isset($datos) && $datos['horario'] == 2) echo 'selected="selected"'; ?>>09:00 am a 01:00 pm</option> | |||
<option value="3" <?php if (isset($datos) && $datos['horario'] == 3) echo 'selected="selected"'; ?>>01:00 pm a 05:00 pm</option> | |||
<option value="4" <?php if (isset($datos) && $datos['horario'] == 4) echo 'selected="selected"'; ?>>02:00 pm a 06:00 pm</option> | |||
</select> | |||
</div> | |||
<div class="col-md-3"> | |||
<label class="form-label" for="">Fecha programada de inicio*</label> | |||
<input name="fechainicio" type="date" class="form-control <?php if (session('errors.fechainicio')) : ?>is-invalid<?php endif ?>" value="<?php if (old('fechainicio')) echo old('fechainicio'); | |||
else if ($datos) echo explode(' ', $datos['fechainicio'])[0]; | |||
?>" required> | |||
</div> | |||
<div class="col-md-2"> | |||
<label class="form-label" for="">Horas Totales a Realizar*</label> | |||
<input name="horas_servicio" type="number" class="form-control <?php if (session('errors.horas_servicio')) : ?>is-invalid<?php endif ?>" min=1 required value="<?php if (old('horas_servicio')) echo old('horas_servicio'); | |||
else if ($datos) echo $datos['horas_servicio']; | |||
?>"> | |||
</div> | |||
<div class="col-md-5 mt-md-2"> | |||
<label class="form-label">Departamento al cual fuiste asignado <span class="small">(Si aplica)</span></label> | |||
<select name="iddepartamento" class="form-select"> | |||
<option selected value>---</option> | |||
<!-- Añadir opción: no sé --> | |||
<?php foreach ($departamentos as $departamento) : ?> | |||
<option value="<?= esc($departamento['iddepartamento']) ?>"><?= esc($departamento['nombre']) ?></option> | |||
<?php endforeach ?> | |||
</select> | |||
</div> | |||
</div> | |||
<div class=""> | |||
<input type="checkbox" required> | |||
<label> | |||
Acepto el | |||
<a href="https://coparmexjal.org.mx/pdf/aviso-privacidad.pdf">aviso de privacidad</a> | |||
</label> | |||
</div> | |||
<div class="text-end"> | |||
<?php if ($datos) : ?> | |||
<a class="btn btn-danger me-3" href="<?= route_to('/') ?>">Cancelar</a> | |||
<?php endif ?> | |||
<button class="btn btn-primary" type="submit"><?= !empty($datos) ? 'Actualizar' : 'Enviar' ?></button> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,45 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Tus Horas<?= $this->endSection() ?> | |||
<!-- head --> | |||
<?= $this->section('head') ?> | |||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.0/main.min.css"> | |||
<script defer src="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.0/main.min.js"></script> | |||
<script src='fullcalendar/core/locales/es.js'></script> | |||
<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="text-center mt-5 mx-auto" style="max-width: 80%"> | |||
<div id='calendar'></div> | |||
</div> | |||
<script> | |||
const data = <?php echo json_encode($horas, JSON_HEX_TAG); ?>; | |||
const events = data.map(register => ({ | |||
title: `${parseInt(register.total_horas_truncadas) / 3600} hrs`, | |||
start: `${register.ano}-${ ('0' + register.mes).slice(-2)}-${('0' + register.dia).slice(-2)}`, | |||
display: 'list-item', | |||
})); | |||
document.addEventListener('DOMContentLoaded', function() { | |||
var calendarEl = document.getElementById('calendar'); | |||
var calendar = new FullCalendar.Calendar(calendarEl, { | |||
// initialView: 'dayGridMonth', | |||
initialView: 'listMonth', | |||
initialDate: '2018-09-01', | |||
events: events, | |||
locale: 'es', | |||
}); | |||
calendar.render(); | |||
}); | |||
</script> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,44 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>HORAS TABLE<?= $this->endSection() ?> | |||
<!-- head --> | |||
<?= $this->section('head') ?> | |||
<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css"> | |||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script> | |||
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script> | |||
<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<table id="example" class="display dataTable" style="width:100%" aria-describedby="example_info"> | |||
<thead> | |||
<tr> | |||
<th class="sorting sorting_asc" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 128.867px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">Fecha</th> | |||
<th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 217.267px;" aria-label="Position: activate to sort column ascending">Horas</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($segundosDiarios as $dia) : ?> | |||
<tr> | |||
<td class="sorting_1"><?= esc($dia['dia']) ?> / <?= esc($dia['mes']) ?> / <?= esc($dia['ano']) ?></td> | |||
<td><?= esc($dia['total_horas_truncadas']) / 3600 ?> | |||
</tr> | |||
</tr> | |||
<?php endforeach ?> | |||
</tbody> | |||
</table> | |||
<script> | |||
document.addEventListener('DOMContentLoaded', function() { | |||
let table = new DataTable('#example'); | |||
}); | |||
</script> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,103 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Prestador<?= $this->endSection() ?> | |||
<!-- head --> | |||
<?= $this->section('head') ?> | |||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css"> | |||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script> | |||
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script> | |||
<script src="https://cdn.datatables.net/1.12.1/js/dataTables.bootstrap5.min.js"></script> | |||
<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<div class="row mb-5"> | |||
<!-- HORAS MENSUALES --> | |||
<div class="col-md-4 mb-5"> | |||
<div class="card"> | |||
<div class="card-header"> | |||
Horas realizadas por mes | |||
</div> | |||
<div class="card-body"> | |||
<table class="table table-sm table-hover"> | |||
<thead> | |||
<th>Mes</th> | |||
<th>Horas</th> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($segundosMensuales as $mes) : ?> | |||
<tr> | |||
<td><?= esc($mes['mes']) ?> / <?= esc($mes['ano']) ?></td> | |||
<td><?= esc($mes['segundos']) / 3600 ?></td> | |||
</tr> | |||
<?php endforeach ?> | |||
</tbody> | |||
<tfoot class="table-active"> | |||
<td>Total</td> | |||
<td><?= $horasTotales ?></td> | |||
</tfoot> | |||
</table> | |||
<!-- <a data-bs-toggle="collapse" href="#collapseHoras" role="button" aria-expanded="true" aria-controls="collapseHoras">Ver desglose de horas</a> --> | |||
</div> | |||
</div> | |||
</div> | |||
<!-- DESGLOSE DE HORAS --> | |||
<!-- <div class="collapse show" id="collapseHoras"> --> | |||
<div class="col-md-5"> | |||
<div class="card"> | |||
<div class="card-header"> | |||
Desglose por día | |||
</div> | |||
<div class="card-body"> | |||
<table id="example" class="table table-striped" style="width:100%" aria-describedby="example_info"> | |||
<thead> | |||
<tr> | |||
<th class="sorting sorting_asc" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 128.867px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">Fecha</th> | |||
<th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 217.267px;" aria-label="Position: activate to sort column ascending">Horas</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($segundosDiarios as $dia) : ?> | |||
<tr> | |||
<td class="sorting_1"><?= sprintf("%02d", esc($dia['dia'])) ?> / <?= sprintf("%02d", esc($dia['mes'])) ?> / <?= esc($dia['ano']) ?></td> | |||
<td><?= esc($dia['total_horas_truncadas']) / 3600 ?> | |||
</tr> | |||
</tr> | |||
<?php endforeach ?> | |||
</tbody> | |||
</table> | |||
</div> | |||
</div> | |||
</div> | |||
<!-- </div> --> | |||
</div> | |||
<script> | |||
document.addEventListener('DOMContentLoaded', function() { | |||
let table = new DataTable('#example', { | |||
'searching': false, | |||
'ordering': false, | |||
'language': { | |||
"lengthMenu": "Mostrar _MENU_ registros", | |||
"info": "Página: _PAGE_ / _PAGES_", | |||
"zeroRecords": "No se encontraron registros", | |||
"paginate": { | |||
"first": "Inicio", | |||
"last": "Fin", | |||
"next": ">", | |||
"previous": "<" | |||
}, | |||
}, | |||
'order': [], | |||
}); | |||
}); | |||
</script> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,17 @@ | |||
<?= $this->extend('templates/base') ?> | |||
<!-- title --> | |||
<?= $this->section('title') ?>Prestador<?= $this->endSection() ?> | |||
<!-- content --> | |||
<?= $this->section('content') ?> | |||
<h1>Tus datos han sido registrados correctamente</h1> | |||
<h5>Una vez que sean revisados, podrás acceder a tu cuenta.</h5> | |||
<h6> | |||
(Aún puedes | |||
<a href="<?= route_to('registro') ?>">actualizar tus datos</a> | |||
) | |||
</h6> | |||
<?= $this->endSection() ?> |
@@ -0,0 +1,75 @@ | |||
<head> | |||
<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css"> | |||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script> | |||
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script> | |||
</head> | |||
<!-- <div id="example_wrapper" class="dataTables_wrapper"> --> | |||
<table id="example" class="display dataTable" style="width:100%" aria-describedby="example_info"> | |||
<thead> | |||
<tr> | |||
<th class="sorting sorting_asc" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 128.867px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">Fecha</th> | |||
<th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 217.267px;" aria-label="Position: activate to sort column ascending">Horas</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<tr class="odd"> | |||
<td class="sorting_1">=01/10/2022</td> | |||
<td>33</td> | |||
</tr> | |||
<tr class="even"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>47</td> | |||
</tr> | |||
<tr class="odd"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>66</td> | |||
</tr> | |||
<tr class="even"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>41</td> | |||
</tr> | |||
<tr class="odd"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>28</td> | |||
</tr> | |||
<tr class="even"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>61</td> | |||
</tr> | |||
<tr class="odd"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>38</td> | |||
</tr> | |||
<tr class="even"> | |||
<td class="sorting_1">02/10/2022</td> | |||
<td>21</td> | |||
</tr> | |||
<tr class="odd"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>46</td> | |||
</tr> | |||
<tr class="even"> | |||
<td class="sorting_1">01/10/2022</td> | |||
<td>22</td> | |||
</tr> | |||
</tbody> | |||
<tfoot> | |||
<tr> | |||
<th rowspan="1" colspan="1">Name</th> | |||
<th rowspan="1" colspan="1">Position</th> | |||
<th rowspan="1" colspan="1">Office</th> | |||
<th rowspan="1" colspan="1">Age</th> | |||
<th rowspan="1" colspan="1">Start date</th> | |||
<th rowspan="1" colspan="1">Salary</th> | |||
</tr> | |||
</tfoot> | |||
</table> | |||
<!-- </div> --> | |||
<script> | |||
document.addEventListener('DOMContentLoaded', function() { | |||
let table = new DataTable('#example'); | |||
}); | |||
</script> |
@@ -0,0 +1,7 @@ | |||
<?php | |||
use CodeIgniter\CLI\CLI; | |||
CLI::error('ERROR: ' . $code); | |||
CLI::write($message); | |||
CLI::newLine(); |
@@ -0,0 +1,65 @@ | |||
<?php | |||
use CodeIgniter\CLI\CLI; | |||
// The main Exception | |||
CLI::newLine(); | |||
CLI::write('[' . get_class($exception) . ']', 'light_gray', 'red'); | |||
CLI::newLine(); | |||
CLI::write($message); | |||
CLI::newLine(); | |||
CLI::write('at ' . CLI::color(clean_path($exception->getFile()) . ':' . $exception->getLine(), 'green')); | |||
CLI::newLine(); | |||
// The backtrace | |||
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) { | |||
$backtraces = $exception->getTrace(); | |||
if ($backtraces) { | |||
CLI::write('Backtrace:', 'green'); | |||
} | |||
foreach ($backtraces as $i => $error) { | |||
$padFile = ' '; // 4 spaces | |||
$padClass = ' '; // 7 spaces | |||
$c = str_pad($i + 1, 3, ' ', STR_PAD_LEFT); | |||
if (isset($error['file'])) { | |||
$filepath = clean_path($error['file']) . ':' . $error['line']; | |||
CLI::write($c . $padFile . CLI::color($filepath, 'yellow')); | |||
} else { | |||
CLI::write($c . $padFile . CLI::color('[internal function]', 'yellow')); | |||
} | |||
$function = ''; | |||
if (isset($error['class'])) { | |||
$type = ($error['type'] === '->') ? '()' . $error['type'] : $error['type']; | |||
$function .= $padClass . $error['class'] . $type . $error['function']; | |||
} elseif (! isset($error['class']) && isset($error['function'])) { | |||
$function .= $padClass . $error['function']; | |||
} | |||
$args = implode(', ', array_map(static function ($value) { | |||
switch (true) { | |||
case is_object($value): | |||
return 'Object(' . get_class($value) . ')'; | |||
case is_array($value): | |||
return count($value) ? '[...]' : '[]'; | |||
case $value === null: | |||
return 'null'; // return the lowercased version | |||
default: | |||
return var_export($value, true); | |||
} | |||
}, array_values($error['args'] ?? []))); | |||
$function .= '(' . $args . ')'; | |||
CLI::write($function); | |||
CLI::newLine(); | |||
} | |||
} |
@@ -0,0 +1,5 @@ | |||
<?php | |||
// On the CLI, we still want errors in productions | |||
// so just use the exception template. | |||
include __DIR__ . '/error_exception.php'; |
@@ -0,0 +1,197 @@ | |||
:root { | |||
--main-bg-color: #fff; | |||
--main-text-color: #555; | |||
--dark-text-color: #222; | |||
--light-text-color: #c7c7c7; | |||
--brand-primary-color: #E06E3F; | |||
--light-bg-color: #ededee; | |||
--dark-bg-color: #404040; | |||
} | |||
body { | |||
height: 100%; | |||
background: var(--main-bg-color); | |||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; | |||
color: var(--main-text-color); | |||
font-weight: 300; | |||
margin: 0; | |||
padding: 0; | |||
} | |||
h1 { | |||
font-weight: lighter; | |||
letter-spacing: 0.8; | |||
font-size: 3rem; | |||
color: var(--dark-text-color); | |||
margin: 0; | |||
} | |||
h1.headline { | |||
margin-top: 20%; | |||
font-size: 5rem; | |||
} | |||
.text-center { | |||
text-align: center; | |||
} | |||
p.lead { | |||
font-size: 1.6rem; | |||
} | |||
.container { | |||
max-width: 75rem; | |||
margin: 0 auto; | |||
padding: 1rem; | |||
} | |||
.header { | |||
background: var(--light-bg-color); | |||
color: var(--dark-text-color); | |||
} | |||
.header .container { | |||
padding: 1rem 1.75rem 1.75rem 1.75rem; | |||
} | |||
.header h1 { | |||
font-size: 2.5rem; | |||
font-weight: 500; | |||
} | |||
.header p { | |||
font-size: 1.2rem; | |||
margin: 0; | |||
line-height: 2.5; | |||
} | |||
.header a { | |||
color: var(--brand-primary-color); | |||
margin-left: 2rem; | |||
display: none; | |||
text-decoration: none; | |||
} | |||
.header:hover a { | |||
display: inline; | |||
} | |||
.footer { | |||
background: var(--dark-bg-color); | |||
color: var(--light-text-color); | |||
} | |||
.footer .container { | |||
border-top: 1px solid #e7e7e7; | |||
margin-top: 1rem; | |||
text-align: center; | |||
} | |||
.source { | |||
background: #343434; | |||
color: var(--light-text-color); | |||
padding: 0.5em 1em; | |||
border-radius: 5px; | |||
font-family: Menlo, Monaco, Consolas, "Courier New", monospace; | |||
font-size: 0.85rem; | |||
margin: 0; | |||
overflow-x: scroll; | |||
} | |||
.source span.line { | |||
line-height: 1.4; | |||
} | |||
.source span.line .number { | |||
color: #666; | |||
} | |||
.source .line .highlight { | |||
display: block; | |||
background: var(--dark-text-color); | |||
color: var(--light-text-color); | |||
} | |||
.source span.highlight .number { | |||
color: #fff; | |||
} | |||
.tabs { | |||
list-style: none; | |||
list-style-position: inside; | |||
margin: 0; | |||
padding: 0; | |||
margin-bottom: -1px; | |||
} | |||
.tabs li { | |||
display: inline; | |||
} | |||
.tabs a:link, | |||
.tabs a:visited { | |||
padding: 0rem 1rem; | |||
line-height: 2.7; | |||
text-decoration: none; | |||
color: var(--dark-text-color); | |||
background: var(--light-bg-color); | |||
border: 1px solid rgba(0,0,0,0.15); | |||
border-bottom: 0; | |||
border-top-left-radius: 5px; | |||
border-top-right-radius: 5px; | |||
display: inline-block; | |||
} | |||
.tabs a:hover { | |||
background: var(--light-bg-color); | |||
border-color: rgba(0,0,0,0.15); | |||
} | |||
.tabs a.active { | |||
background: var(--main-bg-color); | |||
color: var(--main-text-color); | |||
} | |||
.tab-content { | |||
background: var(--main-bg-color); | |||
border: 1px solid rgba(0,0,0,0.15); | |||
} | |||
.content { | |||
padding: 1rem; | |||
} | |||
.hide { | |||
display: none; | |||
} | |||
.alert { | |||
margin-top: 2rem; | |||
display: block; | |||
text-align: center; | |||
line-height: 3.0; | |||
background: #d9edf7; | |||
border: 1px solid #bcdff1; | |||
border-radius: 5px; | |||
color: #31708f; | |||
} | |||
ul, ol { | |||
line-height: 1.8; | |||
} | |||
table { | |||
width: 100%; | |||
overflow: hidden; | |||
} | |||
th { | |||
text-align: left; | |||
border-bottom: 1px solid #e7e7e7; | |||
padding-bottom: 0.5rem; | |||
} | |||
td { | |||
padding: 0.2rem 0.5rem 0.2rem 0; | |||
} | |||
tr:hover td { | |||
background: #f1f1f1; | |||
} | |||
td pre { | |||
white-space: pre-wrap; | |||
} | |||
.trace a { | |||
color: inherit; | |||
} | |||
.trace table { | |||
width: auto; | |||
} | |||
.trace tr td:first-child { | |||
min-width: 5em; | |||
font-weight: bold; | |||
} | |||
.trace td { | |||
background: var(--light-bg-color); | |||
padding: 0 1rem; | |||
} | |||
.trace td pre { | |||
margin: 0; | |||
} | |||
.args { | |||
display: none; | |||
} |
@@ -0,0 +1,116 @@ | |||
var tabLinks = new Array(); | |||
var contentDivs = new Array(); | |||
function init() | |||
{ | |||
// Grab the tab links and content divs from the page | |||
var tabListItems = document.getElementById('tabs').childNodes; | |||
console.log(tabListItems); | |||
for (var i = 0; i < tabListItems.length; i ++) | |||
{ | |||
if (tabListItems[i].nodeName == "LI") | |||
{ | |||
var tabLink = getFirstChildWithTagName(tabListItems[i], 'A'); | |||
var id = getHash(tabLink.getAttribute('href')); | |||
tabLinks[id] = tabLink; | |||
contentDivs[id] = document.getElementById(id); | |||
} | |||
} | |||
// Assign onclick events to the tab links, and | |||
// highlight the first tab | |||
var i = 0; | |||
for (var id in tabLinks) | |||
{ | |||
tabLinks[id].onclick = showTab; | |||
tabLinks[id].onfocus = function () { | |||
this.blur() | |||
}; | |||
if (i == 0) | |||
{ | |||
tabLinks[id].className = 'active'; | |||
} | |||
i ++; | |||
} | |||
// Hide all content divs except the first | |||
var i = 0; | |||
for (var id in contentDivs) | |||
{ | |||
if (i != 0) | |||
{ | |||
console.log(contentDivs[id]); | |||
contentDivs[id].className = 'content hide'; | |||
} | |||
i ++; | |||
} | |||
} | |||
function showTab() | |||
{ | |||
var selectedId = getHash(this.getAttribute('href')); | |||
// Highlight the selected tab, and dim all others. | |||
// Also show the selected content div, and hide all others. | |||
for (var id in contentDivs) | |||
{ | |||
if (id == selectedId) | |||
{ | |||
tabLinks[id].className = 'active'; | |||
contentDivs[id].className = 'content'; | |||
} | |||
else | |||
{ | |||
tabLinks[id].className = ''; | |||
contentDivs[id].className = 'content hide'; | |||
} | |||
} | |||
// Stop the browser following the link | |||
return false; | |||
} | |||
function getFirstChildWithTagName(element, tagName) | |||
{ | |||
for (var i = 0; i < element.childNodes.length; i ++) | |||
{ | |||
if (element.childNodes[i].nodeName == tagName) | |||
{ | |||
return element.childNodes[i]; | |||
} | |||
} | |||
} | |||
function getHash(url) | |||
{ | |||
var hashPos = url.lastIndexOf('#'); | |||
return url.substring(hashPos + 1); | |||
} | |||
function toggle(elem) | |||
{ | |||
elem = document.getElementById(elem); | |||
if (elem.style && elem.style['display']) | |||
{ | |||
// Only works with the "style" attr | |||
var disp = elem.style['display']; | |||
} | |||
else if (elem.currentStyle) | |||
{ | |||
// For MSIE, naturally | |||
var disp = elem.currentStyle['display']; | |||
} | |||
else if (window.getComputedStyle) | |||
{ | |||
// For most other browsers | |||
var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display'); | |||
} | |||
// Toggle the state of the "display" style | |||
elem.style.display = disp == 'block' ? 'none' : 'block'; | |||
return false; | |||
} |
@@ -0,0 +1,84 @@ | |||
<!DOCTYPE html> | |||
<html lang="en"> | |||
<head> | |||
<meta charset="utf-8"> | |||
<title>404 Page Not Found</title> | |||
<style> | |||
div.logo { | |||
height: 200px; | |||
width: 155px; | |||
display: inline-block; | |||
opacity: 0.08; | |||
position: absolute; | |||
top: 2rem; | |||
left: 50%; | |||
margin-left: -73px; | |||
} | |||
body { | |||
height: 100%; | |||
background: #fafafa; | |||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |||
color: #777; | |||
font-weight: 300; | |||
} | |||
h1 { | |||
font-weight: lighter; | |||
letter-spacing: normal; | |||
font-size: 3rem; | |||
margin-top: 0; | |||
margin-bottom: 0; | |||
color: #222; | |||
} | |||
.wrap { | |||
max-width: 1024px; | |||
margin: 5rem auto; | |||
padding: 2rem; | |||
background: #fff; | |||
text-align: center; | |||
border: 1px solid #efefef; | |||
border-radius: 0.5rem; | |||
position: relative; | |||
} | |||
pre { | |||
white-space: normal; | |||
margin-top: 1.5rem; | |||
} | |||
code { | |||
background: #fafafa; | |||
border: 1px solid #efefef; | |||
padding: 0.5rem 1rem; | |||
border-radius: 5px; | |||
display: block; | |||
} | |||
p { | |||
margin-top: 1.5rem; | |||
} | |||
.footer { | |||
margin-top: 2rem; | |||
border-top: 1px solid #efefef; | |||
padding: 1em 2em 0 2em; | |||
font-size: 85%; | |||
color: #999; | |||
} | |||
a:active, | |||
a:link, | |||
a:visited { | |||
color: #dd4814; | |||
} | |||
</style> | |||
</head> | |||
<body> | |||
<div class="wrap"> | |||
<h1>404 - File Not Found</h1> | |||
<p> | |||
<?php if (! empty($message) && $message !== '(null)') : ?> | |||
<?= nl2br(esc($message)) ?> | |||
<?php else : ?> | |||
Sorry! Cannot seem to find the page you were looking for. | |||
<?php endif ?> | |||
</p> | |||
</div> | |||
</body> | |||
</html> |
@@ -0,0 +1,397 @@ | |||
<?php $error_id = uniqid('error', true); ?> | |||
<!doctype html> | |||
<html> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<meta name="robots" content="noindex"> | |||
<title><?= esc($title) ?></title> | |||
<style type="text/css"> | |||
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?> | |||
</style> | |||
<script type="text/javascript"> | |||
<?= file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.js') ?> | |||
</script> | |||
</head> | |||
<body onload="init()"> | |||
<!-- Header --> | |||
<div class="header"> | |||
<div class="container"> | |||
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1> | |||
<p> | |||
<?= nl2br(esc($exception->getMessage())) ?> | |||
<a href="https://www.duckduckgo.com/?q=<?= urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>" | |||
rel="noreferrer" target="_blank">search →</a> | |||
</p> | |||
</div> | |||
</div> | |||
<!-- Source --> | |||
<div class="container"> | |||
<p><b><?= esc(clean_path($file)) ?></b> at line <b><?= esc($line) ?></b></p> | |||
<?php if (is_file($file)) : ?> | |||
<div class="source"> | |||
<?= static::highlightFile($file, $line, 15); ?> | |||
</div> | |||
<?php endif; ?> | |||
</div> | |||
<div class="container"> | |||
<ul class="tabs" id="tabs"> | |||
<li><a href="#backtrace">Backtrace</a></li> | |||
<li><a href="#server">Server</a></li> | |||
<li><a href="#request">Request</a></li> | |||
<li><a href="#response">Response</a></li> | |||
<li><a href="#files">Files</a></li> | |||
<li><a href="#memory">Memory</a></li> | |||
</ul> | |||
<div class="tab-content"> | |||
<!-- Backtrace --> | |||
<div class="content" id="backtrace"> | |||
<ol class="trace"> | |||
<?php foreach ($trace as $index => $row) : ?> | |||
<li> | |||
<p> | |||
<!-- Trace info --> | |||
<?php if (isset($row['file']) && is_file($row['file'])) :?> | |||
<?php | |||
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) { | |||
echo esc($row['function'] . ' ' . clean_path($row['file'])); | |||
} else { | |||
echo esc(clean_path($row['file']) . ' : ' . $row['line']); | |||
} | |||
?> | |||
<?php else: ?> | |||
{PHP internal code} | |||
<?php endif; ?> | |||
<!-- Class/Method --> | |||
<?php if (isset($row['class'])) : ?> | |||
— <?= esc($row['class'] . $row['type'] . $row['function']) ?> | |||
<?php if (! empty($row['args'])) : ?> | |||
<?php $args_id = $error_id . 'args' . $index ?> | |||
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> ) | |||
<div class="args" id="<?= esc($args_id, 'attr') ?>"> | |||
<table cellspacing="0"> | |||
<?php | |||
$params = null; | |||
// Reflection by name is not available for closure function | |||
if (substr($row['function'], -1) !== '}') { | |||
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']); | |||
$params = $mirror->getParameters(); | |||
} | |||
foreach ($row['args'] as $key => $value) : ?> | |||
<tr> | |||
<td><code><?= esc(isset($params[$key]) ? '$' . $params[$key]->name : "#{$key}") ?></code></td> | |||
<td><pre><?= esc(print_r($value, true)) ?></pre></td> | |||
</tr> | |||
<?php endforeach ?> | |||
</table> | |||
</div> | |||
<?php else : ?> | |||
() | |||
<?php endif; ?> | |||
<?php endif; ?> | |||
<?php if (! isset($row['class']) && isset($row['function'])) : ?> | |||
— <?= esc($row['function']) ?>() | |||
<?php endif; ?> | |||
</p> | |||
<!-- Source? --> | |||
<?php if (isset($row['file']) && is_file($row['file']) && isset($row['class'])) : ?> | |||
<div class="source"> | |||
<?= static::highlightFile($row['file'], $row['line']) ?> | |||
</div> | |||
<?php endif; ?> | |||
</li> | |||
<?php endforeach; ?> | |||
</ol> | |||
</div> | |||
<!-- Server --> | |||
<div class="content" id="server"> | |||
<?php foreach (['_SERVER', '_SESSION'] as $var) : ?> | |||
<?php | |||
if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var])) { | |||
continue; | |||
} ?> | |||
<h3>$<?= esc($var) ?></h3> | |||
<table> | |||
<thead> | |||
<tr> | |||
<th>Key</th> | |||
<th>Value</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($GLOBALS[$var] as $key => $value) : ?> | |||
<tr> | |||
<td><?= esc($key) ?></td> | |||
<td> | |||
<?php if (is_string($value)) : ?> | |||
<?= esc($value) ?> | |||
<?php else: ?> | |||
<pre><?= esc(print_r($value, true)) ?></pre> | |||
<?php endif; ?> | |||
</td> | |||
</tr> | |||
<?php endforeach; ?> | |||
</tbody> | |||
</table> | |||
<?php endforeach ?> | |||
<!-- Constants --> | |||
<?php $constants = get_defined_constants(true); ?> | |||
<?php if (! empty($constants['user'])) : ?> | |||
<h3>Constants</h3> | |||
<table> | |||
<thead> | |||
<tr> | |||
<th>Key</th> | |||
<th>Value</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($constants['user'] as $key => $value) : ?> | |||
<tr> | |||
<td><?= esc($key) ?></td> | |||
<td> | |||
<?php if (is_string($value)) : ?> | |||
<?= esc($value) ?> | |||
<?php else: ?> | |||
<pre><?= esc(print_r($value, true)) ?></pre> | |||
<?php endif; ?> | |||
</td> | |||
</tr> | |||
<?php endforeach; ?> | |||
</tbody> | |||
</table> | |||
<?php endif; ?> | |||
</div> | |||
<!-- Request --> | |||
<div class="content" id="request"> | |||
<?php $request = \Config\Services::request(); ?> | |||
<table> | |||
<tbody> | |||
<tr> | |||
<td style="width: 10em">Path</td> | |||
<td><?= esc($request->getUri()) ?></td> | |||
</tr> | |||
<tr> | |||
<td>HTTP Method</td> | |||
<td><?= esc(strtoupper($request->getMethod())) ?></td> | |||
</tr> | |||
<tr> | |||
<td>IP Address</td> | |||
<td><?= esc($request->getIPAddress()) ?></td> | |||
</tr> | |||
<tr> | |||
<td style="width: 10em">Is AJAX Request?</td> | |||
<td><?= $request->isAJAX() ? 'yes' : 'no' ?></td> | |||
</tr> | |||
<tr> | |||
<td>Is CLI Request?</td> | |||
<td><?= $request->isCLI() ? 'yes' : 'no' ?></td> | |||
</tr> | |||
<tr> | |||
<td>Is Secure Request?</td> | |||
<td><?= $request->isSecure() ? 'yes' : 'no' ?></td> | |||
</tr> | |||
<tr> | |||
<td>User Agent</td> | |||
<td><?= esc($request->getUserAgent()->getAgentString()) ?></td> | |||
</tr> | |||
</tbody> | |||
</table> | |||
<?php $empty = true; ?> | |||
<?php foreach (['_GET', '_POST', '_COOKIE'] as $var) : ?> | |||
<?php | |||
if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var])) { | |||
continue; | |||
} ?> | |||
<?php $empty = false; ?> | |||
<h3>$<?= esc($var) ?></h3> | |||
<table style="width: 100%"> | |||
<thead> | |||
<tr> | |||
<th>Key</th> | |||
<th>Value</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($GLOBALS[$var] as $key => $value) : ?> | |||
<tr> | |||
<td><?= esc($key) ?></td> | |||
<td> | |||
<?php if (is_string($value)) : ?> | |||
<?= esc($value) ?> | |||
<?php else: ?> | |||
<pre><?= esc(print_r($value, true)) ?></pre> | |||
<?php endif; ?> | |||
</td> | |||
</tr> | |||
<?php endforeach; ?> | |||
</tbody> | |||
</table> | |||
<?php endforeach ?> | |||
<?php if ($empty) : ?> | |||
<div class="alert"> | |||
No $_GET, $_POST, or $_COOKIE Information to show. | |||
</div> | |||
<?php endif; ?> | |||
<?php $headers = $request->getHeaders(); ?> | |||
<?php if (! empty($headers)) : ?> | |||
<h3>Headers</h3> | |||
<table> | |||
<thead> | |||
<tr> | |||
<th>Header</th> | |||
<th>Value</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($headers as $value) : ?> | |||
<?php | |||
if (empty($value)) { | |||
continue; | |||
} | |||
if (! is_array($value)) { | |||
$value = [$value]; | |||
} ?> | |||
<?php foreach ($value as $h) : ?> | |||
<tr> | |||
<td><?= esc($h->getName(), 'html') ?></td> | |||
<td><?= esc($h->getValueLine(), 'html') ?></td> | |||
</tr> | |||
<?php endforeach; ?> | |||
<?php endforeach; ?> | |||
</tbody> | |||
</table> | |||
<?php endif; ?> | |||
</div> | |||
<!-- Response --> | |||
<?php | |||
$response = \Config\Services::response(); | |||
$response->setStatusCode(http_response_code()); | |||
?> | |||
<div class="content" id="response"> | |||
<table> | |||
<tr> | |||
<td style="width: 15em">Response Status</td> | |||
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td> | |||
</tr> | |||
</table> | |||
<?php $headers = $response->getHeaders(); ?> | |||
<?php if (! empty($headers)) : ?> | |||
<?php natsort($headers) ?> | |||
<h3>Headers</h3> | |||
<table> | |||
<thead> | |||
<tr> | |||
<th>Header</th> | |||
<th>Value</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php foreach ($headers as $name => $value) : ?> | |||
<tr> | |||
<td><?= esc($name, 'html') ?></td> | |||
<td><?= esc($response->getHeaderLine($name), 'html') ?></td> | |||
</tr> | |||
<?php endforeach; ?> | |||
</tbody> | |||
</table> | |||
<?php endif; ?> | |||
</div> | |||
<!-- Files --> | |||
<div class="content" id="files"> | |||
<?php $files = get_included_files(); ?> | |||
<ol> | |||
<?php foreach ($files as $file) :?> | |||
<li><?= esc(clean_path($file)) ?></li> | |||
<?php endforeach ?> | |||
</ol> | |||
</div> | |||
<!-- Memory --> | |||
<div class="content" id="memory"> | |||
<table> | |||
<tbody> | |||
<tr> | |||
<td>Memory Usage</td> | |||
<td><?= esc(static::describeMemory(memory_get_usage(true))) ?></td> | |||
</tr> | |||
<tr> | |||
<td style="width: 12em">Peak Memory Usage:</td> | |||
<td><?= esc(static::describeMemory(memory_get_peak_usage(true))) ?></td> | |||
</tr> | |||
<tr> | |||
<td>Memory Limit:</td> | |||
<td><?= esc(ini_get('memory_limit')) ?></td> | |||
</tr> | |||
</tbody> | |||
</table> | |||
</div> | |||
</div> <!-- /tab-content --> | |||
</div> <!-- /container --> | |||
<div class="footer"> | |||
<div class="container"> | |||
<p> | |||
Displayed at <?= esc(date('H:i:sa')) ?> — | |||
PHP: <?= esc(PHP_VERSION) ?> — | |||
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?> | |||
</p> | |||
</div> | |||
</div> | |||
</body> | |||
</html> |
@@ -0,0 +1,25 @@ | |||
<!doctype html> | |||
<html> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<meta name="robots" content="noindex"> | |||
<title>Whoops!</title> | |||
<style type="text/css"> | |||
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?> | |||
</style> | |||
</head> | |||
<body> | |||
<div class="container text-center"> | |||
<h1 class="headline">Whoops!</h1> | |||
<p class="lead">We seem to have hit a snag. Please try again later...</p> | |||
</div> | |||
</body> | |||
</html> |
@@ -0,0 +1,36 @@ | |||
<!DOCTYPE html> | |||
<html lang="en"> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |||
<title> | |||
<?= $this->renderSection('title') ?> | |||
</title> | |||
<!-- Bootstrap --> | |||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> | |||
<!-- Fontawesome --> | |||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | |||
<?= $this->renderSection('head') ?> | |||
</head> | |||
<body> | |||
<!-- navbar --> | |||
<?= $this->include('templates/navbar') ?> | |||
<div class="container mt-4"> | |||
<?= $this->renderSection('content') ?> | |||
</div> | |||
<!-- Bootstrap --> | |||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script> | |||
</body> | |||
</html> |
@@ -0,0 +1,301 @@ | |||
<!DOCTYPE html> | |||
<!-- | |||
This is a starter template page. Use this page to start your new project from | |||
scratch. This page gets rid of all links and provides the needed markup only. | |||
--> | |||
<html lang="en"> | |||
<head> | |||
<meta charset="utf-8"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||
<title><?= isset($title) ? $title : 'Administrador' ?></title> | |||
<base href="/"> | |||
<!-- Google Font: Source Sans Pro --> | |||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"> | |||
<!-- Font Awesome Icons --> | |||
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css"> | |||
<!-- Theme style --> | |||
<link rel="stylesheet" href="dist/css/adminlte.min.css"> | |||
</head> | |||
<body class="hold-transition sidebar-mini"> | |||
<div class="wrapper"> | |||
<!-- Navbar --> | |||
<nav class="main-header navbar navbar-expand navbar-white navbar-light"> | |||
<!-- Left navbar links --> | |||
<ul class="navbar-nav"> | |||
<li class="nav-item"> | |||
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a> | |||
</li> | |||
<li class="nav-item d-none d-sm-inline-block"> | |||
<a href="index3.html" class="nav-link">Home</a> | |||
</li> | |||
<li class="nav-item d-none d-sm-inline-block"> | |||
<a href="#" class="nav-link">Contact</a> | |||
</li> | |||
</ul> | |||
<!-- Right navbar links --> | |||
<ul class="navbar-nav ml-auto"> | |||
<!-- Navbar Search --> | |||
<li class="nav-item"> | |||
<a class="nav-link" data-widget="navbar-search" href="#" role="button"> | |||
<i class="fas fa-search"></i> | |||
</a> | |||
<div class="navbar-search-block"> | |||
<form class="form-inline"> | |||
<div class="input-group input-group-sm"> | |||
<input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search"> | |||
<div class="input-group-append"> | |||
<button class="btn btn-navbar" type="submit"> | |||
<i class="fas fa-search"></i> | |||
</button> | |||
<button class="btn btn-navbar" type="button" data-widget="navbar-search"> | |||
<i class="fas fa-times"></i> | |||
</button> | |||
</div> | |||
</div> | |||
</form> | |||
</div> | |||
</li> | |||
<!-- Messages Dropdown Menu --> | |||
<li class="nav-item dropdown"> | |||
<a class="nav-link" data-toggle="dropdown" href="#"> | |||
<i class="far fa-comments"></i> | |||
<span class="badge badge-danger navbar-badge">3</span> | |||
</a> | |||
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right"> | |||
<a href="#" class="dropdown-item"> | |||
<!-- Message Start --> | |||
<div class="media"> | |||
<img src="dist/img/user1-128x128.jpg" alt="User Avatar" class="img-size-50 mr-3 img-circle"> | |||
<div class="media-body"> | |||
<h3 class="dropdown-item-title"> | |||
Brad Diesel | |||
<span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span> | |||
</h3> | |||
<p class="text-sm">Call me whenever you can...</p> | |||
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p> | |||
</div> | |||
</div> | |||
<!-- Message End --> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item"> | |||
<!-- Message Start --> | |||
<div class="media"> | |||
<img src="dist/img/user8-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3"> | |||
<div class="media-body"> | |||
<h3 class="dropdown-item-title"> | |||
John Pierce | |||
<span class="float-right text-sm text-muted"><i class="fas fa-star"></i></span> | |||
</h3> | |||
<p class="text-sm">I got your message bro</p> | |||
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p> | |||
</div> | |||
</div> | |||
<!-- Message End --> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item"> | |||
<!-- Message Start --> | |||
<div class="media"> | |||
<img src="dist/img/user3-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3"> | |||
<div class="media-body"> | |||
<h3 class="dropdown-item-title"> | |||
Nora Silvester | |||
<span class="float-right text-sm text-warning"><i class="fas fa-star"></i></span> | |||
</h3> | |||
<p class="text-sm">The subject goes here</p> | |||
<p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p> | |||
</div> | |||
</div> | |||
<!-- Message End --> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item dropdown-footer">See All Messages</a> | |||
</div> | |||
</li> | |||
<!-- Notifications Dropdown Menu --> | |||
<li class="nav-item dropdown"> | |||
<a class="nav-link" data-toggle="dropdown" href="#"> | |||
<i class="far fa-bell"></i> | |||
<span class="badge badge-warning navbar-badge">15</span> | |||
</a> | |||
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right"> | |||
<span class="dropdown-header">15 Notifications</span> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item"> | |||
<i class="fas fa-envelope mr-2"></i> 4 new messages | |||
<span class="float-right text-muted text-sm">3 mins</span> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item"> | |||
<i class="fas fa-users mr-2"></i> 8 friend requests | |||
<span class="float-right text-muted text-sm">12 hours</span> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item"> | |||
<i class="fas fa-file mr-2"></i> 3 new reports | |||
<span class="float-right text-muted text-sm">2 days</span> | |||
</a> | |||
<div class="dropdown-divider"></div> | |||
<a href="#" class="dropdown-item dropdown-footer">See All Notifications</a> | |||
</div> | |||
</li> | |||
<li class="nav-item"> | |||
<a class="nav-link" data-widget="fullscreen" href="#" role="button"> | |||
<i class="fas fa-expand-arrows-alt"></i> | |||
</a> | |||
</li> | |||
<li class="nav-item"> | |||
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button"> | |||
<i class="fas fa-th-large"></i> | |||
</a> | |||
</li> | |||
</ul> | |||
</nav> | |||
<!-- /.navbar --> | |||
<!-- Main Sidebar Container --> | |||
<aside class="main-sidebar sidebar-dark-primary elevation-4"> | |||
<!-- Brand Logo --> | |||
<a href="index3.html" class="brand-link"> | |||
<img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8"> | |||
<span class="brand-text font-weight-light">COPARMEX</span> | |||
</a> | |||
<!-- Sidebar --> | |||
<div class="sidebar"> | |||
<!-- Sidebar user panel (optional) --> | |||
<div class="user-panel mt-3 pb-3 mb-3 d-flex"> | |||
<div class="image"> | |||
<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> | |||
</div> | |||
<div class="info"> | |||
<a href="#" class="d-block">Alexander Pierce</a> | |||
</div> | |||
</div> | |||
<!-- SidebarSearch Form --> | |||
<div class="form-inline"> | |||
<div class="input-group" data-widget="sidebar-search"> | |||
<input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search"> | |||
<div class="input-group-append"> | |||
<button class="btn btn-sidebar"> | |||
<i class="fas fa-search fa-fw"></i> | |||
</button> | |||
</div> | |||
</div> | |||
</div> | |||
<!-- Sidebar Menu --> | |||
<nav class="mt-2"> | |||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> | |||
<!-- Add icons to the links using the .nav-icon class | |||
with font-awesome or any other icon font library --> | |||
<li class="nav-item menu-open"> | |||
<a href="#" class="nav-link active"> | |||
<i class="nav-icon fas fa-tachometer-alt"></i> | |||
<p> | |||
Starter Pages | |||
<i class="right fas fa-angle-left"></i> | |||
</p> | |||
</a> | |||
<ul class="nav nav-treeview"> | |||
<li class="nav-item"> | |||
<a href="#" class="nav-link active"> | |||
<i class="far fa-circle nav-icon"></i> | |||
<p>Active Page</p> | |||
</a> | |||
</li> | |||
<li class="nav-item"> | |||
<a href="#" class="nav-link"> | |||
<i class="far fa-circle nav-icon"></i> | |||
<p>Inactive Page</p> | |||
</a> | |||
</li> | |||
</ul> | |||
</li> | |||
<li class="nav-item"> | |||
<a href="#" class="nav-link"> | |||
<i class="nav-icon fas fa-th"></i> | |||
<p> | |||
Simple Link | |||
<span class="right badge badge-danger">New</span> | |||
</p> | |||
</a> | |||
</li> | |||
</ul> | |||
</nav> | |||
<!-- /.sidebar-menu --> | |||
</div> | |||
<!-- /.sidebar --> | |||
</aside> | |||
<!-- Content Wrapper. Contains page content --> | |||
<div class="content-wrapper"> | |||
<!-- Content Header (Page header) --> | |||
<div class="content-header"> | |||
<div class="container-fluid"> | |||
<div class="row mb-2"> | |||
<div class="col-sm-6"> | |||
<h1 class="m-0"><?= isset($title) ? $title : 'Adminstrador' ?></h1> | |||
</div><!-- /.col --> | |||
<div class="col-sm-6"> | |||
<ol class="breadcrumb float-sm-right"> | |||
<li class="breadcrumb-item"><a href="#">Home</a></li> | |||
<li class="breadcrumb-item active">Starter Page</li> | |||
</ol> | |||
</div><!-- /.col --> | |||
</div><!-- /.row --> | |||
</div><!-- /.container-fluid --> | |||
</div> | |||
<!-- /.content-header --> | |||
<!-- Main content --> | |||
<div class="content"> | |||
<div class="container-fluid"> | |||
<?= $this->renderSection('content') ?> | |||
</div><!-- /.container-fluid --> | |||
</div> | |||
<!-- /.content --> | |||
</div> | |||
<!-- /.content-wrapper --> | |||
<!-- Control Sidebar --> | |||
<aside class="control-sidebar control-sidebar-dark"> | |||
<!-- Control sidebar content goes here --> | |||
<div class="p-3"> | |||
<h5>Title</h5> | |||
<p>Sidebar content</p> | |||
</div> | |||
</aside> | |||
<!-- /.control-sidebar --> | |||
<!-- Main Footer --> | |||
<footer class="main-footer"> | |||
<!-- To the right --> | |||
<div class="float-right d-none d-sm-inline"> | |||
Anything you want | |||
</div> | |||
<!-- Default to the left --> | |||
<strong>Copyright © 2014-2021 <a href="<?= route_to('admin_home') ?>">COPARMEX</a>.</strong> All rights reserved. | |||
</footer> | |||
</div> | |||
<!-- ./wrapper --> | |||
<!-- REQUIRED SCRIPTS --> | |||
<!-- jQuery --> | |||
<script src="plugins/jquery/jquery.min.js"></script> | |||
<!-- Bootstrap 4 --> | |||
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script> | |||
<!-- AdminLTE App --> | |||
<script src="dist/js/adminlte.min.js"></script> | |||
</body> | |||
</html> |
@@ -0,0 +1,25 @@ | |||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark px-5"> | |||
<div class="container-fluid"> | |||
<a class="navbar-brand" href="<?= route_to('/') ?>">COPARMEX</a> | |||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | |||
<span class="navbar-toggler-icon"></span> | |||
</button> | |||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | |||
<ul class="navbar-nav ms-auto mb-2 mb-lg-0"> | |||
<?php helper('auth'); | |||
if (logged_in()) : ?> | |||
<li class="nav-item"> | |||
<a class="nav-link" href="<?= route_to('logout') ?>"><i class="fa-solid fa-arrow-right-from-bracket"></i> Cerrar Sesión</a> | |||
</li> | |||
<?php else : ?> | |||
<li class="nav-item me-3"> | |||
<a class="nav-link" href="<?= route_to('register') ?>"><i class="fa-solid fa-user"></i> Crear Cuenta</a> | |||
</li> | |||
<li class="nav-item"> | |||
<a class="nav-link" href="<?= route_to('login') ?>"><i class="fa-solid fa-arrow-right-to-bracket"></i> Iniciar Sesión</a> | |||
</li> | |||
<?php endif; ?> | |||
</ul> | |||
</div> | |||
</div> | |||
</nav> |
@@ -0,0 +1,11 @@ | |||
<!DOCTYPE html> | |||
<html> | |||
<head> | |||
<title>403 Forbidden</title> | |||
</head> | |||
<body> | |||
<p>Directory access is forbidden.</p> | |||
</body> | |||
</html> |
@@ -0,0 +1,125 @@ | |||
#!/usr/bin/env php | |||
<?php | |||
define('LATEST_RELEASE', '^4.0'); | |||
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4'); | |||
/* | |||
* -------------------------------------------------------------------- | |||
* Stability Toggle | |||
* -------------------------------------------------------------------- | |||
* Use this script to toggle the CodeIgniter dependency between the | |||
* latest stable release and the most recent development update. | |||
* | |||
* Usage: php builds [release|development] | |||
*/ | |||
// Determine the requested stability | |||
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'], true)) { | |||
echo 'Usage: php builds [release|development]' . PHP_EOL; | |||
exit; | |||
} | |||
$dev = $argv[1] === 'development'; | |||
$modified = []; | |||
// Locate each file and update it for the requested stability | |||
$file = __DIR__ . DIRECTORY_SEPARATOR . 'composer.json'; | |||
if (is_file($file)) { | |||
$contents = file_get_contents($file); | |||
if ((string) $contents !== '') { | |||
$array = json_decode($contents, true); | |||
if (is_array($array)) { | |||
if ($dev) { | |||
$array['minimum-stability'] = 'dev'; | |||
$array['prefer-stable'] = true; | |||
$array['repositories'] ??= []; | |||
$found = false; | |||
foreach ($array['repositories'] as $repository) { | |||
if ($repository['url'] === GITHUB_URL) { | |||
$found = true; | |||
break; | |||
} | |||
} | |||
if (! $found) { | |||
$array['repositories'][] = [ | |||
'type' => 'vcs', | |||
'url' => GITHUB_URL, | |||
]; | |||
} | |||
$array['require']['codeigniter4/codeigniter4'] = 'dev-develop'; | |||
unset($array['require']['codeigniter4/framework']); | |||
} else { | |||
unset($array['minimum-stability']); | |||
if (isset($array['repositories'])) { | |||
foreach ($array['repositories'] as $i => $repository) { | |||
if ($repository['url'] === GITHUB_URL) { | |||
unset($array['repositories'][$i]); | |||
break; | |||
} | |||
} | |||
if (empty($array['repositories'])) { | |||
unset($array['repositories']); | |||
} | |||
} | |||
$array['require']['codeigniter4/framework'] = LATEST_RELEASE; | |||
unset($array['require']['codeigniter4/codeigniter4']); | |||
} | |||
file_put_contents($file, json_encode($array, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL); | |||
$modified[] = $file; | |||
} else { | |||
echo 'Warning: Unable to decode composer.json! Skipping...' . PHP_EOL; | |||
} | |||
} else { | |||
echo 'Warning: Unable to read composer.json! Skipping...' . PHP_EOL; | |||
} | |||
} | |||
$files = [ | |||
__DIR__ . DIRECTORY_SEPARATOR . 'app/Config/Paths.php', | |||
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist', | |||
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml', | |||
]; | |||
foreach ($files as $file) { | |||
if (is_file($file)) { | |||
$contents = file_get_contents($file); | |||
if ($dev) { | |||
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents); | |||
} else { | |||
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents); | |||
} | |||
file_put_contents($file, $contents); | |||
$modified[] = $file; | |||
} | |||
} | |||
if ($modified === []) { | |||
echo 'No files modified.' . PHP_EOL; | |||
} else { | |||
echo 'The following files were modified:' . PHP_EOL; | |||
foreach ($modified as $file) { | |||
echo " * {$file}" . PHP_EOL; | |||
} | |||
echo 'Run `composer update` to sync changes with your vendor folder.' . PHP_EOL; | |||
} |
@@ -0,0 +1,38 @@ | |||
{ | |||
"name": "codeigniter4/appstarter", | |||
"type": "project", | |||
"description": "CodeIgniter4 starter app", | |||
"homepage": "https://codeigniter.com", | |||
"license": "MIT", | |||
"require": { | |||
"php": "^7.4 || ^8.0", | |||
"codeigniter4/framework": "^4.0", | |||
"myth/auth": "^1.2" | |||
}, | |||
"require-dev": { | |||
"fakerphp/faker": "^1.9", | |||
"mikey179/vfsstream": "^1.6", | |||
"phpunit/phpunit": "^9.1" | |||
}, | |||
"suggest": { | |||
"ext-fileinfo": "Improves mime type detection for files" | |||
}, | |||
"autoload": { | |||
"exclude-from-classmap": [ | |||
"**/Database/Migrations/**" | |||
] | |||
}, | |||
"autoload-dev": { | |||
"psr-4": { | |||
"Tests\\Support\\": "tests/_support" | |||
} | |||
}, | |||
"scripts": { | |||
"test": "phpunit" | |||
}, | |||
"support": { | |||
"forum": "http://forum.codeigniter.com/", | |||
"source": "https://github.com/codeigniter4/CodeIgniter4", | |||
"slack": "https://codeigniterchat.slack.com" | |||
} | |||
} |
@@ -0,0 +1,57 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php" | |||
backupGlobals="false" | |||
colors="true" | |||
convertErrorsToExceptions="true" | |||
convertNoticesToExceptions="true" | |||
convertWarningsToExceptions="true" | |||
stopOnError="false" | |||
stopOnFailure="false" | |||
stopOnIncomplete="false" | |||
stopOnSkipped="false" | |||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | |||
<coverage includeUncoveredFiles="true" processUncoveredFiles="true"> | |||
<include> | |||
<directory suffix=".php">./app</directory> | |||
</include> | |||
<exclude> | |||
<directory suffix=".php">./app/Views</directory> | |||
<file>./app/Config/Routes.php</file> | |||
</exclude> | |||
<report> | |||
<clover outputFile="build/logs/clover.xml"/> | |||
<html outputDirectory="build/logs/html"/> | |||
<php outputFile="build/logs/coverage.serialized"/> | |||
<text outputFile="php://stdout" showUncoveredFiles="false"/> | |||
</report> | |||
</coverage> | |||
<testsuites> | |||
<testsuite name="App"> | |||
<directory>./tests</directory> | |||
</testsuite> | |||
</testsuites> | |||
<logging> | |||
<testdoxHtml outputFile="build/logs/testdox.html"/> | |||
<testdoxText outputFile="build/logs/testdox.txt"/> | |||
<junit outputFile="build/logs/logfile.xml"/> | |||
</logging> | |||
<php> | |||
<server name="app.baseURL" value="http://example.com/"/> | |||
<!-- Directory containing phpunit.xml --> | |||
<const name="HOMEPATH" value="./"/> | |||
<!-- Directory containing the Paths config file --> | |||
<const name="CONFIGPATH" value="./app/Config/"/> | |||
<!-- Directory containing the front controller (index.php) --> | |||
<const name="PUBLICPATH" value="./public/"/> | |||
<!-- Database configuration --> | |||
<!-- Uncomment to provide your own database for testing | |||
<env name="database.tests.hostname" value="localhost"/> | |||
<env name="database.tests.database" value="tests"/> | |||
<env name="database.tests.username" value="tests_user"/> | |||
<env name="database.tests.password" value=""/> | |||
<env name="database.tests.DBDriver" value="MySQLi"/> | |||
<env name="database.tests.DBPrefix" value="tests_"/> | |||
--> | |||
</php> | |||
</phpunit> |
@@ -0,0 +1,112 @@ | |||
<?php | |||
/** | |||
* This file is part of CodeIgniter 4 framework. | |||
* | |||
* (c) CodeIgniter Foundation <admin@codeigniter.com> | |||
* | |||
* For the full copyright and license information, please view | |||
* the LICENSE file that was distributed with this source code. | |||
*/ | |||
/* | |||
*--------------------------------------------------------------- | |||
* Sample file for Preloading | |||
*--------------------------------------------------------------- | |||
* See https://www.php.net/manual/en/opcache.preloading.php | |||
* | |||
* How to Use: | |||
* 1. Set Preload::$paths. | |||
* 2. Set opcache.preload in php.ini. | |||
* php.ini: | |||
* opcache.preload=/path/to/preload.php | |||
*/ | |||
// Load the paths config file | |||
require __DIR__ . '/app/Config/Paths.php'; | |||
// Path to the front controller | |||
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR); | |||
/** | |||
* See https://www.php.net/manual/en/function.str-contains.php#126277 | |||
*/ | |||
if (! function_exists('str_contains')) { | |||
/** | |||
* Polyfill of str_contains() | |||
*/ | |||
function str_contains(string $haystack, string $needle): bool | |||
{ | |||
return empty($needle) || strpos($haystack, $needle) !== false; | |||
} | |||
} | |||
class preload | |||
{ | |||
/** | |||
* @var array Paths to preload. | |||
*/ | |||
private array $paths = [ | |||
[ | |||
'include' => __DIR__ . '/vendor/codeigniter4/framework/system', | |||
'exclude' => [ | |||
// Not needed if you don't use them. | |||
'/system/Database/OCI8/', | |||
'/system/Database/Postgre/', | |||
'/system/Database/SQLSRV/', | |||
// Not needed. | |||
'/system/Database/Seeder.php', | |||
'/system/Test/', | |||
'/system/Language/', | |||
'/system/CLI/', | |||
'/system/Commands/', | |||
'/system/Publisher/', | |||
'/system/ComposerScripts.php', | |||
'/Views/', | |||
// Errors occur. | |||
'/system/Config/Routes.php', | |||
'/system/ThirdParty/', | |||
], | |||
], | |||
]; | |||
public function __construct() | |||
{ | |||
$this->loadAutoloader(); | |||
} | |||
private function loadAutoloader() | |||
{ | |||
$paths = new Config\Paths(); | |||
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; | |||
} | |||
/** | |||
* Load PHP files. | |||
*/ | |||
public function load() | |||
{ | |||
foreach ($this->paths as $path) { | |||
$directory = new RecursiveDirectoryIterator($path['include']); | |||
$fullTree = new RecursiveIteratorIterator($directory); | |||
$phpFiles = new RegexIterator( | |||
$fullTree, | |||
'/.+((?<!Test)+\.php$)/i', | |||
RecursiveRegexIterator::GET_MATCH | |||
); | |||
foreach ($phpFiles as $key => $file) { | |||
foreach ($path['exclude'] as $exclude) { | |||
if (str_contains($file[0], $exclude)) { | |||
continue 2; | |||
} | |||
} | |||
require_once $file[0]; | |||
echo 'Loaded: ' . $file[0] . "\n"; | |||
} | |||
} | |||
} | |||
} | |||
(new preload())->load(); |