refactor: add php_codesniffer to define castopod's coding style based on psr-1
- add .editorconfig file - format all files to comply with castopod's coding style - switch parsedown dependency with commonmark library to better follow commonmark spec for markdown - add prettier command to format all project files at once closes #16
This commit is contained in:
parent
58364bfed1
commit
ed6e953010
|
@ -9,6 +9,7 @@
|
||||||
"[php]": {
|
"[php]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
|
"phpSniffer.autoDetect": true,
|
||||||
"color-highlight.markerType": "dot-before"
|
"color-highlight.markerType": "dot-before"
|
||||||
},
|
},
|
||||||
"extensions": [
|
"extensions": [
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
"bradlc.vscode-tailwindcss",
|
"bradlc.vscode-tailwindcss",
|
||||||
"jamesbirtles.svelte-vscode",
|
"jamesbirtles.svelte-vscode",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"stylelint.vscode-stylelint"
|
"stylelint.vscode-stylelint",
|
||||||
|
"wongjn.php-sniffer"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
; top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
; Unix-style newlines
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
|
[*.php]
|
||||||
|
indent_style = spaces
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Castopod">
|
||||||
|
<description>Castopod's coding standard based on the PSR-1 standard.</description>
|
||||||
|
|
||||||
|
<!-- Include the whole PSR-1 standard -->
|
||||||
|
<rule ref="PSR1"/>
|
||||||
|
</ruleset>
|
|
@ -5,8 +5,7 @@
|
||||||
"files": "*.php",
|
"files": "*.php",
|
||||||
"options": {
|
"options": {
|
||||||
"phpVersion": "7.2",
|
"phpVersion": "7.2",
|
||||||
"singleQuote": true,
|
"singleQuote": true
|
||||||
"trailingCommaPHP": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,7 +10,7 @@ PHP Dependencies:
|
||||||
- [GeoIP2 PHP API](https://github.com/maxmind/GeoIP2-php) ([Apache License 2.0](https://github.com/maxmind/GeoIP2-php/blob/master/LICENSE))
|
- [GeoIP2 PHP API](https://github.com/maxmind/GeoIP2-php) ([Apache License 2.0](https://github.com/maxmind/GeoIP2-php/blob/master/LICENSE))
|
||||||
- [getID3](https://github.com/JamesHeinrich/getID3) ([GNU General Public License v3](https://github.com/JamesHeinrich/getID3/blob/2.0/licenses/license.gpl-30.txt))
|
- [getID3](https://github.com/JamesHeinrich/getID3) ([GNU General Public License v3](https://github.com/JamesHeinrich/getID3/blob/2.0/licenses/license.gpl-30.txt))
|
||||||
- [myth-auth](https://github.com/lonnieezell/myth-auth) ([MIT license](https://github.com/lonnieezell/myth-auth/blob/develop/LICENSE.md))
|
- [myth-auth](https://github.com/lonnieezell/myth-auth) ([MIT license](https://github.com/lonnieezell/myth-auth/blob/develop/LICENSE.md))
|
||||||
- [parsedown](https://github.com/erusev/parsedown) ([MIT license](https://github.com/erusev/parsedown/blob/master/LICENSE.txt))
|
- [commonmark](https://commonmark.thephpleague.com/) ([BSD 3-Clause "New" or "Revised" License](https://github.com/thephpleague/commonmark/blob/latest/LICENSE))
|
||||||
|
|
||||||
Javascript dependencies:
|
Javascript dependencies:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace App\Authorization;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Authorization;
|
||||||
|
|
||||||
class FlatAuthorization extends \Myth\Auth\Authorization\FlatAuthorization
|
class FlatAuthorization extends \Myth\Auth\Authorization\FlatAuthorization
|
||||||
{
|
{
|
||||||
|
@ -49,26 +51,26 @@ class FlatAuthorization extends \Myth\Auth\Authorization\FlatAuthorization
|
||||||
/**
|
/**
|
||||||
* Makes a member a part of multiple groups.
|
* Makes a member a part of multiple groups.
|
||||||
*
|
*
|
||||||
* @param $user_id
|
* @param $userId
|
||||||
* @param array|null $groups // Either collection of ID or names
|
* @param array|null $groups // Either collection of ID or names
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setUserGroups(int $user_id, $groups)
|
public function setUserGroups(int $userId, $groups)
|
||||||
{
|
{
|
||||||
if (empty($user_id) || !is_numeric($user_id)) {
|
if (empty($userId) || !is_numeric($userId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove user from all groups before resetting it in new groups
|
// remove user from all groups before resetting it in new groups
|
||||||
$this->groupModel->removeUserFromAllGroups($user_id);
|
$this->groupModel->removeUserFromAllGroups($userId);
|
||||||
|
|
||||||
if (empty($groups)) {
|
if (empty($groups)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
$this->addUserToGroup($user_id, $group);
|
$this->addUserToGroup($userId, $group);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace App\Authorization;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Authorization;
|
||||||
|
|
||||||
class GroupModel extends \Myth\Auth\Authorization\GroupModel
|
class GroupModel extends \Myth\Auth\Authorization\GroupModel
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace App\Authorization;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Authorization;
|
||||||
|
|
||||||
class PermissionModel extends \Myth\Auth\Authorization\PermissionModel
|
class PermissionModel extends \Myth\Auth\Authorization\PermissionModel
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,181 +7,181 @@ use CodeIgniter\Config\BaseConfig;
|
||||||
class App extends BaseConfig
|
class App extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Base Site URL
|
| Base Site URL
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| URL to your CodeIgniter root. Typically this will be your base URL,
|
| URL to your CodeIgniter root. Typically this will be your base URL,
|
||||||
| WITH a trailing slash:
|
| WITH a trailing slash:
|
||||||
|
|
|
|
||||||
| http://example.com/
|
| http://example.com/
|
||||||
|
|
|
|
||||||
| If this is not set then CodeIgniter will try guess the protocol, domain
|
| If this is not set then CodeIgniter will try guess the protocol, domain
|
||||||
| and path to your installation. However, you should always configure this
|
| and path to your installation. However, you should always configure this
|
||||||
| explicitly and never rely on auto-guessing, especially in production
|
| explicitly and never rely on auto-guessing, especially in production
|
||||||
| environments.
|
| environments.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $baseURL = 'http://localhost:8080/';
|
public $baseURL = 'http://localhost:8080/';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Index File
|
| Index File
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Typically this will be your index.php file, unless you've renamed it to
|
| 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
|
| something else. If you are using mod_rewrite to remove the page set this
|
||||||
| variable so that it is blank.
|
| variable so that it is blank.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $indexPage = 'index.php';
|
public $indexPage = 'index.php';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| URI PROTOCOL
|
| URI PROTOCOL
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This item determines which getServer global should be used to retrieve the
|
| This item determines which getServer global should be used to retrieve the
|
||||||
| URI string. The default setting of 'REQUEST_URI' works for most servers.
|
| 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:
|
| If your links do not seem to work, try one of the other delicious flavors:
|
||||||
|
|
|
|
||||||
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
|
||||||
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
|
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
|
||||||
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
||||||
|
|
|
|
||||||
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
|
||||||
*/
|
*/
|
||||||
public $uriProtocol = 'REQUEST_URI';
|
public $uriProtocol = 'REQUEST_URI';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Default Locale
|
| Default Locale
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The Locale roughly represents the language and location that your visitor
|
| The Locale roughly represents the language and location that your visitor
|
||||||
| is viewing the site from. It affects the language strings and other
|
| is viewing the site from. It affects the language strings and other
|
||||||
| strings (like currency markers, numbers, etc), that your program
|
| strings (like currency markers, numbers, etc), that your program
|
||||||
| should run under for this request.
|
| should run under for this request.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $defaultLocale = 'en';
|
public $defaultLocale = 'en';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Negotiate Locale
|
| Negotiate Locale
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If true, the current Request object will automatically determine the
|
| If true, the current Request object will automatically determine the
|
||||||
| language to use based on the value of the Accept-Language header.
|
| language to use based on the value of the Accept-Language header.
|
||||||
|
|
|
|
||||||
| If false, no automatic detection will be performed.
|
| If false, no automatic detection will be performed.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $negotiateLocale = true;
|
public $negotiateLocale = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Supported Locales
|
| Supported Locales
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If $negotiateLocale is true, this array lists the locales supported
|
| If $negotiateLocale is true, this array lists the locales supported
|
||||||
| by the application in descending order of priority. If no match is
|
| by the application in descending order of priority. If no match is
|
||||||
| found, the first locale will be used.
|
| found, the first locale will be used.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $supportedLocales = ['en'];
|
public $supportedLocales = ['en'];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Timezone
|
| Application Timezone
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The default timezone that will be used in your application to display
|
| The default timezone that will be used in your application to display
|
||||||
| dates with the date helper, and can be retrieved through app_timezone()
|
| dates with the date helper, and can be retrieved through app_timezone()
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $appTimezone = 'UTC';
|
public $appTimezone = 'UTC';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Default Character Set
|
| Default Character Set
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This determines which character set is used by default in various methods
|
| This determines which character set is used by default in various methods
|
||||||
| that require a character set to be provided.
|
| that require a character set to be provided.
|
||||||
|
|
|
|
||||||
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $charset = 'UTF-8';
|
public $charset = 'UTF-8';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| URI PROTOCOL
|
| URI PROTOCOL
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If true, this will force every request made to this application to be
|
| 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
|
| 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
|
| secure, the user will be redirected to a secure version of the page
|
||||||
| and the HTTP Strict Transport Security header will be set.
|
| and the HTTP Strict Transport Security header will be set.
|
||||||
*/
|
*/
|
||||||
public $forceGlobalSecureRequests = false;
|
public $forceGlobalSecureRequests = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Session Variables
|
| Session Variables
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| 'sessionDriver'
|
| 'sessionDriver'
|
||||||
|
|
|
|
||||||
| The storage driver to use: files, database, redis, memcached
|
| The storage driver to use: files, database, redis, memcached
|
||||||
| - CodeIgniter\Session\Handlers\FileHandler
|
| - CodeIgniter\Session\Handlers\FileHandler
|
||||||
| - CodeIgniter\Session\Handlers\DatabaseHandler
|
| - CodeIgniter\Session\Handlers\DatabaseHandler
|
||||||
| - CodeIgniter\Session\Handlers\MemcachedHandler
|
| - CodeIgniter\Session\Handlers\MemcachedHandler
|
||||||
| - CodeIgniter\Session\Handlers\RedisHandler
|
| - CodeIgniter\Session\Handlers\RedisHandler
|
||||||
|
|
|
|
||||||
| 'sessionCookieName'
|
| 'sessionCookieName'
|
||||||
|
|
|
|
||||||
| The session cookie name, must contain only [0-9a-z_-] characters
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
||||||
|
|
|
|
||||||
| 'sessionExpiration'
|
| 'sessionExpiration'
|
||||||
|
|
|
|
||||||
| The number of SECONDS you want the session to last.
|
| The number of SECONDS you want the session to last.
|
||||||
| Setting to 0 (zero) means expire when the browser is closed.
|
| Setting to 0 (zero) means expire when the browser is closed.
|
||||||
|
|
|
|
||||||
| 'sessionSavePath'
|
| 'sessionSavePath'
|
||||||
|
|
|
|
||||||
| The location to save sessions to, driver dependent.
|
| The location to save sessions to, driver dependent.
|
||||||
|
|
|
|
||||||
| For the 'files' driver, it's a path to a writable directory.
|
| For the 'files' driver, it's a path to a writable directory.
|
||||||
| WARNING: Only absolute paths are supported!
|
| WARNING: Only absolute paths are supported!
|
||||||
|
|
|
|
||||||
| For the 'database' driver, it's a table name.
|
| For the 'database' driver, it's a table name.
|
||||||
| Please read up the manual for the format with other session drivers.
|
| Please read up the manual for the format with other session drivers.
|
||||||
|
|
|
|
||||||
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
||||||
|
|
|
|
||||||
| 'sessionMatchIP'
|
| 'sessionMatchIP'
|
||||||
|
|
|
|
||||||
| Whether to match the user's IP address when reading the session data.
|
| 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
|
| WARNING: If you're using the database driver, don't forget to update
|
||||||
| your session table's PRIMARY KEY when changing this setting.
|
| your session table's PRIMARY KEY when changing this setting.
|
||||||
|
|
|
|
||||||
| 'sessionTimeToUpdate'
|
| 'sessionTimeToUpdate'
|
||||||
|
|
|
|
||||||
| How many seconds between CI regenerating the session ID.
|
| How many seconds between CI regenerating the session ID.
|
||||||
|
|
|
|
||||||
| 'sessionRegenerateDestroy'
|
| 'sessionRegenerateDestroy'
|
||||||
|
|
|
|
||||||
| Whether to destroy session data associated with the old session ID
|
| Whether to destroy session data associated with the old session ID
|
||||||
| when auto-regenerating the session ID. When set to FALSE, the data
|
| when auto-regenerating the session ID. When set to FALSE, the data
|
||||||
| will be later deleted by the garbage collector.
|
| will be later deleted by the garbage collector.
|
||||||
|
|
|
|
||||||
| Other session cookie settings are shared with the rest of the application,
|
| Other session cookie settings are shared with the rest of the application,
|
||||||
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
|
public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
|
||||||
public $sessionCookieName = 'ci_session';
|
public $sessionCookieName = 'ci_session';
|
||||||
public $sessionExpiration = 7200;
|
public $sessionExpiration = 7200;
|
||||||
|
@ -191,20 +191,20 @@ class App extends BaseConfig
|
||||||
public $sessionRegenerateDestroy = false;
|
public $sessionRegenerateDestroy = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Cookie Related Variables
|
| Cookie Related Variables
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| 'cookiePrefix' = Set a cookie name prefix if you need to avoid collisions
|
| 'cookiePrefix' = Set a cookie name prefix if you need to avoid collisions
|
||||||
| 'cookieDomain' = Set to .your-domain.com for site-wide cookies
|
| 'cookieDomain' = Set to .your-domain.com for site-wide cookies
|
||||||
| 'cookiePath' = Typically will be a forward slash
|
| 'cookiePath' = Typically will be a forward slash
|
||||||
| 'cookieSecure' = Cookie will only be set if a secure HTTPS connection exists.
|
| 'cookieSecure' = Cookie will only be set if a secure HTTPS connection exists.
|
||||||
| 'cookieHTTPOnly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| 'cookieHTTPOnly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
||||||
|
|
|
|
||||||
| Note: These settings (with the exception of 'cookie_prefix' and
|
| Note: These settings (with the exception of 'cookie_prefix' and
|
||||||
| 'cookie_httponly') will also affect sessions.
|
| 'cookie_httponly') will also affect sessions.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $cookiePrefix = '';
|
public $cookiePrefix = '';
|
||||||
public $cookieDomain = '';
|
public $cookieDomain = '';
|
||||||
public $cookiePath = '/';
|
public $cookiePath = '/';
|
||||||
|
@ -212,38 +212,38 @@ class App extends BaseConfig
|
||||||
public $cookieHTTPOnly = false;
|
public $cookieHTTPOnly = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Reverse Proxy IPs
|
| Reverse Proxy IPs
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If your server is behind a reverse proxy, you must whitelist the proxy
|
| If your server is behind a reverse proxy, you must whitelist the proxy
|
||||||
| IP addresses from which CodeIgniter should trust headers such as
|
| IP addresses from which CodeIgniter should trust headers such as
|
||||||
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
|
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
|
||||||
| the visitor's IP address.
|
| the visitor's IP address.
|
||||||
|
|
|
|
||||||
| You can use both an array or a comma-separated list of proxy addresses,
|
| 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:
|
| as well as specifying whole subnets. Here are a few examples:
|
||||||
|
|
|
|
||||||
| Comma-separated: '10.0.1.200,192.168.5.0/24'
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
|
||||||
| Array: array('10.0.1.200', '192.168.5.0/24')
|
| Array: array('10.0.1.200', '192.168.5.0/24')
|
||||||
*/
|
*/
|
||||||
public $proxyIPs = '';
|
public $proxyIPs = '';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Cross Site Request Forgery
|
| Cross Site Request Forgery
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
|
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
|
||||||
| checked on a submitted form. If you are accepting user data, it is strongly
|
| checked on a submitted form. If you are accepting user data, it is strongly
|
||||||
| recommended CSRF protection be enabled.
|
| recommended CSRF protection be enabled.
|
||||||
|
|
|
|
||||||
| CSRFTokenName = The token name
|
| CSRFTokenName = The token name
|
||||||
| CSRFHeaderName = The header name
|
| CSRFHeaderName = The header name
|
||||||
| CSRFCookieName = The cookie name
|
| CSRFCookieName = The cookie name
|
||||||
| CSRFExpire = The number in seconds the token should expire.
|
| CSRFExpire = The number in seconds the token should expire.
|
||||||
| CSRFRegenerate = Regenerate token on every submission
|
| CSRFRegenerate = Regenerate token on every submission
|
||||||
| CSRFRedirect = Redirect to previous page with error on failure
|
| CSRFRedirect = Redirect to previous page with error on failure
|
||||||
*/
|
*/
|
||||||
public $CSRFTokenName = 'csrf_test_name';
|
public $CSRFTokenName = 'csrf_test_name';
|
||||||
public $CSRFHeaderName = 'X-CSRF-TOKEN';
|
public $CSRFHeaderName = 'X-CSRF-TOKEN';
|
||||||
public $CSRFCookieName = 'csrf_cookie_name';
|
public $CSRFCookieName = 'csrf_cookie_name';
|
||||||
|
@ -252,42 +252,42 @@ class App extends BaseConfig
|
||||||
public $CSRFRedirect = true;
|
public $CSRFRedirect = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Content Security Policy
|
| Content Security Policy
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Enables the Response's Content Secure Policy to restrict the sources that
|
| 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,
|
| 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
|
| the Response object will populate default values for the policy from the
|
||||||
| ContentSecurityPolicy.php file. Controllers can always add to those
|
| ContentSecurityPolicy.php file. Controllers can always add to those
|
||||||
| restrictions at run time.
|
| restrictions at run time.
|
||||||
|
|
|
|
||||||
| For a better understanding of CSP, see these documents:
|
| For a better understanding of CSP, see these documents:
|
||||||
| - http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
| - http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
||||||
| - http://www.w3.org/TR/CSP/
|
| - http://www.w3.org/TR/CSP/
|
||||||
*/
|
*/
|
||||||
public $CSPEnabled = false;
|
public $CSPEnabled = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Media root folder
|
| Media root folder
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Defines the root folder for media files storage
|
| Defines the root folder for media files storage
|
||||||
*/
|
*/
|
||||||
public $mediaRoot = 'media';
|
public $mediaRoot = 'media';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Admin gateway
|
| Admin gateway
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Defines a base route for all admin pages
|
| Defines a base route for all admin pages
|
||||||
*/
|
*/
|
||||||
public $adminGateway = 'admin';
|
public $adminGateway = 'admin';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Auth gateway
|
| Auth gateway
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Defines a base route for all authentication related pages
|
| Defines a base route for all authentication related pages
|
||||||
*/
|
*/
|
||||||
public $authGateway = 'auth';
|
public $authGateway = 'auth';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| ERROR DISPLAY
|
| ERROR DISPLAY
|
||||||
|
|
|
@ -7,78 +7,78 @@ use CodeIgniter\Config\BaseConfig;
|
||||||
class Cache extends BaseConfig
|
class Cache extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Primary Handler
|
| Primary Handler
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The name of the preferred handler that should be used. If for some reason
|
| 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.
|
| it is not available, the $backupHandler will be used in its place.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $handler = 'file';
|
public $handler = 'file';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Backup Handler
|
| Backup Handler
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The name of the handler that will be used in case the first one is
|
| 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
|
| unreachable. Often, 'file' is used here since the filesystem is
|
||||||
| always available, though that's not always practical for the app.
|
| always available, though that's not always practical for the app.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $backupHandler = 'dummy';
|
public $backupHandler = 'dummy';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Cache Directory Path
|
| Cache Directory Path
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The path to where cache files should be stored, if using a file-based
|
| The path to where cache files should be stored, if using a file-based
|
||||||
| system.
|
| system.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $storePath = WRITEPATH . 'cache/';
|
public $storePath = WRITEPATH . 'cache/';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Cache Include Query String
|
| Cache Include Query String
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Whether to take the URL query string into consideration when generating
|
| Whether to take the URL query string into consideration when generating
|
||||||
| output cache files. Valid options are:
|
| output cache files. Valid options are:
|
||||||
|
|
|
|
||||||
| false = Disabled
|
| false = Disabled
|
||||||
| true = Enabled, take all query parameters into account.
|
| true = Enabled, take all query parameters into account.
|
||||||
| Please be aware that this may result in numerous cache
|
| Please be aware that this may result in numerous cache
|
||||||
| files generated for the same page over and over again.
|
| files generated for the same page over and over again.
|
||||||
| array('q') = Enabled, but only take into account the specified list
|
| array('q') = Enabled, but only take into account the specified list
|
||||||
| of query parameters.
|
| of query parameters.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $cacheQueryString = false;
|
public $cacheQueryString = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Key Prefix
|
| Key Prefix
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This string is added to all cache item names to help avoid collisions
|
| This string is added to all cache item names to help avoid collisions
|
||||||
| if you run multiple applications with the same cache engine.
|
| if you run multiple applications with the same cache engine.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $prefix = '';
|
public $prefix = '';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------------
|
| -------------------------------------------------------------------------
|
||||||
| Memcached settings
|
| Memcached settings
|
||||||
| -------------------------------------------------------------------------
|
| -------------------------------------------------------------------------
|
||||||
| Your Memcached servers can be specified below, if you are using
|
| Your Memcached servers can be specified below, if you are using
|
||||||
| the Memcached drivers.
|
| the Memcached drivers.
|
||||||
|
|
|
|
||||||
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $memcached = [
|
public $memcached = [
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 11211,
|
'port' => 11211,
|
||||||
|
@ -87,13 +87,13 @@ class Cache extends BaseConfig
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------------
|
| -------------------------------------------------------------------------
|
||||||
| Redis settings
|
| Redis settings
|
||||||
| -------------------------------------------------------------------------
|
| -------------------------------------------------------------------------
|
||||||
| Your Redis server can be specified below, if you are using
|
| Your Redis server can be specified below, if you are using
|
||||||
| the Redis or Predis drivers.
|
| the Redis or Predis drivers.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $redis = [
|
public $redis = [
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'password' => null,
|
'password' => null,
|
||||||
|
@ -103,14 +103,14 @@ class Cache extends BaseConfig
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Available Cache Handlers
|
| Available Cache Handlers
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This is an array of cache engine alias' and class names. Only engines
|
| This is an array of cache engine alias' and class names. Only engines
|
||||||
| that are listed here are allowed to be used.
|
| that are listed here are allowed to be used.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $validHandlers = [
|
public $validHandlers = [
|
||||||
'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class,
|
'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class,
|
||||||
'file' => \CodeIgniter\Cache\Handlers\FileHandler::class,
|
'file' => \CodeIgniter\Cache\Handlers\FileHandler::class,
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database Configuration
|
* Database Configuration
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DocTypes
|
* DocTypes
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Config;
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Config;
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
@ -12,24 +13,24 @@ use CodeIgniter\Config\BaseConfig;
|
||||||
class Encryption extends BaseConfig
|
class Encryption extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Encryption Key Starter
|
| Encryption Key Starter
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If you use the Encryption class you must set an encryption key (seed).
|
| 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.
|
| You need to ensure it is long enough for the cipher and mode you plan to use.
|
||||||
| See the user guide for more info.
|
| See the user guide for more info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public $key = '';
|
public $key = '';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Encryption driver to use
|
| Encryption driver to use
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| One of the supported drivers, eg 'OpenSSL' or 'Sodium'.
|
| One of the supported drivers, eg 'OpenSSL' or 'Sodium'.
|
||||||
| The default driver, if you don't specify one, is 'OpenSSL'.
|
| The default driver, if you don't specify one, is 'OpenSSL'.
|
||||||
*/
|
*/
|
||||||
public $driver = 'OpenSSL';
|
public $driver = 'OpenSSL';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Events\Events;
|
use CodeIgniter\Events\Events;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup how the exception handler works.
|
* Setup how the exception handler works.
|
||||||
|
@ -9,33 +11,33 @@
|
||||||
class Exceptions
|
class Exceptions
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| LOG EXCEPTIONS?
|
| LOG EXCEPTIONS?
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| If true, then exceptions will be logged
|
| If true, then exceptions will be logged
|
||||||
| through Services::Log.
|
| through Services::Log.
|
||||||
|
|
|
|
||||||
| Default: true
|
| Default: true
|
||||||
*/
|
*/
|
||||||
public $log = true;
|
public $log = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| DO NOT LOG STATUS CODES
|
| DO NOT LOG STATUS CODES
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Any status codes here will NOT be logged if logging is turned on.
|
| Any status codes here will NOT be logged if logging is turned on.
|
||||||
| By default, only 404 (Page Not Found) exceptions are ignored.
|
| By default, only 404 (Page Not Found) exceptions are ignored.
|
||||||
*/
|
*/
|
||||||
public $ignoreCodes = [404];
|
public $ignoreCodes = [404];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Error Views Path
|
| Error Views Path
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| This is the path to the directory that contains the 'cli' and 'html'
|
| This is the path to the directory that contains the 'cli' and 'html'
|
||||||
| directories that hold the views used to generate errors.
|
| directories that hold the views used to generate errors.
|
||||||
|
|
|
|
||||||
| Default: APPPATH.'Views/errors'
|
| Default: APPPATH.'Views/errors'
|
||||||
*/
|
*/
|
||||||
public $errorViewPath = APPPATH . 'Views/errors';
|
public $errorViewPath = APPPATH . 'Views/errors';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
class ForeignCharacters extends \CodeIgniter\Config\ForeignCharacters
|
class ForeignCharacters extends \CodeIgniter\Config\ForeignCharacters
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,23 +1,25 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class Format extends BaseConfig
|
class Format extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Available Response Formats
|
| Available Response Formats
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| When you perform content negotiation with the request, these are the
|
| When you perform content negotiation with the request, these are the
|
||||||
| available formats that your application supports. This is currently
|
| available formats that your application supports. This is currently
|
||||||
| only used with the API\ResponseTrait. A valid Formatter must exist
|
| only used with the API\ResponseTrait. A valid Formatter must exist
|
||||||
| for the specified format.
|
| for the specified format.
|
||||||
|
|
|
|
||||||
| These formats are only checked when the data passed to the respond()
|
| These formats are only checked when the data passed to the respond()
|
||||||
| method is an array.
|
| method is an array.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $supportedResponseFormats = [
|
public $supportedResponseFormats = [
|
||||||
'application/json',
|
'application/json',
|
||||||
'application/xml', // machine-readable XML
|
'application/xml', // machine-readable XML
|
||||||
|
@ -25,15 +27,15 @@ class Format extends BaseConfig
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Formatters
|
| Formatters
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Lists the class to use to format responses with of a particular type.
|
| 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
|
| For each mime type, list the class that should be used. Formatters
|
||||||
| can be retrieved through the getFormatter() method.
|
| can be retrieved through the getFormatter() method.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $formatters = [
|
public $formatters = [
|
||||||
'application/json' => \CodeIgniter\Format\JSONFormatter::class,
|
'application/json' => \CodeIgniter\Format\JSONFormatter::class,
|
||||||
'application/xml' => \CodeIgniter\Format\XMLFormatter::class,
|
'application/xml' => \CodeIgniter\Format\XMLFormatter::class,
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
use Kint\Renderer\Renderer;
|
use Kint\Renderer\Renderer;
|
||||||
|
@ -6,23 +8,23 @@ use Kint\Renderer\Renderer;
|
||||||
class Kint extends BaseConfig
|
class Kint extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Kint
|
| Kint
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| We use Kint's RichRenderer and CLIRenderer. This area contains options
|
| We use Kint's RichRenderer and CLIRenderer. This area contains options
|
||||||
| that you can set to customize how Kint works for you.
|
| that you can set to customize how Kint works for you.
|
||||||
|
|
|
|
||||||
| For details on these settings, see Kint's docs:
|
| For details on these settings, see Kint's docs:
|
||||||
| https://kint-php.github.io/kint/
|
| https://kint-php.github.io/kint/
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Global Settings
|
| Global Settings
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public $plugins = null;
|
public $plugins = null;
|
||||||
|
|
||||||
|
@ -33,10 +35,10 @@ class Kint extends BaseConfig
|
||||||
public $expanded = false;
|
public $expanded = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| RichRenderer Settings
|
| RichRenderer Settings
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
public $richTheme = 'aante-light.css';
|
public $richTheme = 'aante-light.css';
|
||||||
|
|
||||||
public $richFolder = false;
|
public $richFolder = false;
|
||||||
|
@ -48,10 +50,10 @@ class Kint extends BaseConfig
|
||||||
public $richTabPlugins = null;
|
public $richTabPlugins = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| CLI Settings
|
| CLI Settings
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
public $cliColors = true;
|
public $cliColors = true;
|
||||||
|
|
||||||
public $cliForceUTF8 = false;
|
public $cliForceUTF8 = false;
|
||||||
|
|
|
@ -1,74 +1,76 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class Logger extends BaseConfig
|
class Logger extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Error Logging Threshold
|
| Error Logging Threshold
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| You can enable error logging by setting a threshold over zero. The
|
| 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 determines what gets logged. Any values below or equal to the
|
||||||
| threshold will be logged. Threshold options are:
|
| threshold will be logged. Threshold options are:
|
||||||
|
|
|
|
||||||
| 0 = Disables logging, Error logging TURNED OFF
|
| 0 = Disables logging, Error logging TURNED OFF
|
||||||
| 1 = Emergency Messages - System is unusable
|
| 1 = Emergency Messages - System is unusable
|
||||||
| 2 = Alert Messages - Action Must Be Taken Immediately
|
| 2 = Alert Messages - Action Must Be Taken Immediately
|
||||||
| 3 = Critical Messages - Application component unavailable, unexpected exception.
|
| 3 = Critical Messages - Application component unavailable, unexpected exception.
|
||||||
| 4 = Runtime Errors - Don't need immediate action, but should be monitored.
|
| 4 = Runtime Errors - Don't need immediate action, but should be monitored.
|
||||||
| 5 = Warnings - Exceptional occurrences that are not errors.
|
| 5 = Warnings - Exceptional occurrences that are not errors.
|
||||||
| 6 = Notices - Normal but significant events.
|
| 6 = Notices - Normal but significant events.
|
||||||
| 7 = Info - Interesting events, like user logging in, etc.
|
| 7 = Info - Interesting events, like user logging in, etc.
|
||||||
| 8 = Debug - Detailed debug information.
|
| 8 = Debug - Detailed debug information.
|
||||||
| 9 = All Messages
|
| 9 = All Messages
|
||||||
|
|
|
|
||||||
| You can also pass an array with threshold levels to show individual error types
|
| 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
|
| 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
|
| For a live site you'll usually enable Critical or higher (3) to be logged otherwise
|
||||||
| your log files will fill up very fast.
|
| your log files will fill up very fast.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $threshold = 3;
|
public $threshold = 3;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Date Format for Logs
|
| Date Format for Logs
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Each item that is logged has an associated date. You can use PHP date
|
| Each item that is logged has an associated date. You can use PHP date
|
||||||
| codes to set your own date formatting
|
| codes to set your own date formatting
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $dateFormat = 'Y-m-d H:i:s';
|
public $dateFormat = 'Y-m-d H:i:s';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Log Handlers
|
| Log Handlers
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The logging system supports multiple actions to be taken when something
|
| The logging system supports multiple actions to be taken when something
|
||||||
| is logged. This is done by allowing for multiple Handlers, special classes
|
| is logged. This is done by allowing for multiple Handlers, special classes
|
||||||
| designed to write the log to their chosen destinations, whether that is
|
| 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
|
| a file on the getServer, a cloud-based service, or even taking actions such
|
||||||
| as emailing the dev team.
|
| as emailing the dev team.
|
||||||
|
|
|
|
||||||
| Each handler is defined by the class name used for that handler, and it
|
| Each handler is defined by the class name used for that handler, and it
|
||||||
| MUST implement the CodeIgniter\Log\Handlers\HandlerInterface interface.
|
| MUST implement the CodeIgniter\Log\Handlers\HandlerInterface interface.
|
||||||
|
|
|
|
||||||
| The value of each key is an array of configuration items that are sent
|
| 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
|
| to the constructor of each handler. The only required configuration item
|
||||||
| is the 'handles' element, which must be an array of integer log levels.
|
| 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
|
| This is most easily handled by using the constants defined in the
|
||||||
| Psr\Log\LogLevel class.
|
| Psr\Log\LogLevel class.
|
||||||
|
|
|
|
||||||
| Handlers are executed in the order defined in this array, starting with
|
| Handlers are executed in the order defined in this array, starting with
|
||||||
| the handler on top and continuing down.
|
| the handler on top and continuing down.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $handlers = [
|
public $handlers = [
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// File Handler
|
// File Handler
|
||||||
|
|
|
@ -1,49 +1,51 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class Migrations extends BaseConfig
|
class Migrations extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Enable/Disable Migrations
|
| Enable/Disable Migrations
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Migrations are enabled by default for security reasons.
|
| Migrations are enabled by default for security reasons.
|
||||||
| You should enable migrations whenever you intend to do a schema migration
|
| You should enable migrations whenever you intend to do a schema migration
|
||||||
| and disable it back when you're done.
|
| and disable it back when you're done.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $enabled = true;
|
public $enabled = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Migrations table
|
| Migrations table
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This is the name of the table that will store the current migrations state.
|
| 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
|
| 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
|
| 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
|
| table to the $config['migration_version'] if they are not the same it
|
||||||
| will migrate up. This must be set.
|
| will migrate up. This must be set.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $table = 'migrations';
|
public $table = 'migrations';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Timestamp Format
|
| Timestamp Format
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This is the format that will be used when creating new migrations
|
| This is the format that will be used when creating new migrations
|
||||||
| using the cli command:
|
| using the cli command:
|
||||||
| > php spark migrate:create
|
| > php spark migrate:create
|
||||||
|
|
|
|
||||||
| Typical formats:
|
| Typical formats:
|
||||||
| YmdHis_
|
| YmdHis_
|
||||||
| Y-m-d-His_
|
| Y-m-d-His_
|
||||||
| Y_m_d_His_
|
| Y_m_d_His_
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $timestampFormat = 'Y-m-d-His_';
|
public $timestampFormat = 'Y-m-d-His_';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
|
|
|
@ -1,38 +1,40 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
// Cannot extend BaseConfig or looping resources occurs.
|
// Cannot extend BaseConfig or looping resources occurs.
|
||||||
class Modules
|
class Modules
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Auto-Discovery Enabled?
|
| Auto-Discovery Enabled?
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If true, then auto-discovery will happen across all elements listed in
|
| If true, then auto-discovery will happen across all elements listed in
|
||||||
| $activeExplorers below. If false, no auto-discovery will happen at all,
|
| $activeExplorers below. If false, no auto-discovery will happen at all,
|
||||||
| giving a slight performance boost.
|
| giving a slight performance boost.
|
||||||
*/
|
*/
|
||||||
public $enabled = true;
|
public $enabled = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Auto-Discovery Within Composer Packages Enabled?
|
| Auto-Discovery Within Composer Packages Enabled?
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| If true, then auto-discovery will happen across all namespaces loaded
|
| If true, then auto-discovery will happen across all namespaces loaded
|
||||||
| by Composer, as well as the namespaces configured locally.
|
| by Composer, as well as the namespaces configured locally.
|
||||||
*/
|
*/
|
||||||
public $discoverInComposer = true;
|
public $discoverInComposer = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Auto-discover Rules
|
| Auto-discover Rules
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Lists the aliases of all discovery classes that will be active
|
| Lists the aliases of all discovery classes that will be active
|
||||||
| and used during the current application request. If it is not
|
| and used during the current application request. If it is not
|
||||||
| listed here, only the base application elements will be used.
|
| listed here, only the base application elements will be used.
|
||||||
*/
|
*/
|
||||||
public $activeExplorers = ['events', 'registrars', 'routes', 'services'];
|
public $activeExplorers = ['events', 'registrars', 'routes', 'services'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class Pager extends BaseConfig
|
class Pager extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Templates
|
| Templates
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Pagination links are rendered out using views to configure their
|
| Pagination links are rendered out using views to configure their
|
||||||
| appearance. This array contains aliases and the view names to
|
| appearance. This array contains aliases and the view names to
|
||||||
| use when rendering the links.
|
| use when rendering the links.
|
||||||
|
|
|
|
||||||
| Within each view, the Pager object will be available as $pager,
|
| Within each view, the Pager object will be available as $pager,
|
||||||
| and the desired group as $pagerGroup;
|
| and the desired group as $pagerGroup;
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $templates = [
|
public $templates = [
|
||||||
'default_full' => 'CodeIgniter\Pager\Views\default_full',
|
'default_full' => 'CodeIgniter\Pager\Views\default_full',
|
||||||
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
|
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
|
||||||
|
@ -24,12 +26,12 @@ class Pager extends BaseConfig
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Items Per Page
|
| Items Per Page
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The default number of results shown in a single page.
|
| The default number of results shown in a single page.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $perPage = 20;
|
public $perPage = 20;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the paths that are used by the system to
|
* Holds the paths that are used by the system to
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\Services as CoreServices;
|
use CodeIgniter\Config\Services as CoreServices;
|
||||||
use CodeIgniter\Model;
|
use CodeIgniter\Model;
|
||||||
|
|
|
@ -1,21 +1,23 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class Toolbar extends BaseConfig
|
class Toolbar extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Debug Toolbar
|
| Debug Toolbar
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| The Debug Toolbar provides a way to see information about the performance
|
| 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
|
| and state of your application during that page display. By default it will
|
||||||
| NOT be displayed under production environments, and will only display if
|
| 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.
|
| CI_DEBUG is true, since if it's not, there's not much to display anyway.
|
||||||
|
|
|
|
||||||
| toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited
|
| toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $collectors = [
|
public $collectors = [
|
||||||
\CodeIgniter\Debug\Toolbar\Collectors\Timers::class,
|
\CodeIgniter\Debug\Toolbar\Collectors\Timers::class,
|
||||||
\CodeIgniter\Debug\Toolbar\Collectors\Database::class,
|
\CodeIgniter\Debug\Toolbar\Collectors\Database::class,
|
||||||
|
@ -29,41 +31,41 @@ class Toolbar extends BaseConfig
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Max History
|
| Max History
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| The Toolbar allows you to view recent requests that have been made to
|
| The Toolbar allows you to view recent requests that have been made to
|
||||||
| the application while the toolbar is active. This allows you to quickly
|
| the application while the toolbar is active. This allows you to quickly
|
||||||
| view and compare multiple requests.
|
| view and compare multiple requests.
|
||||||
|
|
|
|
||||||
| $maxHistory sets a limit on the number of past requests that are stored,
|
| $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
|
| 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.
|
| 0 (zero) to not have any history stored, or -1 for unlimited history.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $maxHistory = 20;
|
public $maxHistory = 20;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Toolbar Views Path
|
| Toolbar Views Path
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| The full path to the the views that are used by the toolbar.
|
| The full path to the the views that are used by the toolbar.
|
||||||
| MUST have a trailing slash.
|
| MUST have a trailing slash.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
|
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Max Queries
|
| Max Queries
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| If the Database Collector is enabled, it will log every query that the
|
| 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
|
| 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
|
| and in the query log. This can lead to memory issues in some instances
|
||||||
| with hundreds of queries.
|
| with hundreds of queries.
|
||||||
|
|
|
|
||||||
| $maxQueries defines the maximum amount of queries that will be stored.
|
| $maxQueries defines the maximum amount of queries that will be stored.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
public $maxQueries = 100;
|
public $maxQueries = 100;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
use CodeIgniter\Config\BaseConfig;
|
use CodeIgniter\Config\BaseConfig;
|
||||||
|
|
||||||
class UserAgents extends BaseConfig
|
class UserAgents extends BaseConfig
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
| USER AGENT TYPES
|
| USER AGENT TYPES
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
| This file contains four arrays of user agent data. It is used by the
|
| This file contains four arrays of user agent data. It is used by the
|
||||||
| User Agent Class to help identify browser, platform, robot, and
|
| User Agent Class to help identify browser, platform, robot, and
|
||||||
| mobile device data. The array keys are used to identify the device
|
| 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.
|
| and the array values are used to set the actual name of the item.
|
||||||
*/
|
*/
|
||||||
public $platforms = [
|
public $platforms = [
|
||||||
'windows nt 10.0' => 'Windows 10',
|
'windows nt 10.0' => 'Windows 10',
|
||||||
'windows nt 6.3' => 'Windows 8.1',
|
'windows nt 6.3' => 'Windows 8.1',
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
class Validation
|
class Validation
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace Config;
|
<?php
|
||||||
|
|
||||||
|
namespace Config;
|
||||||
|
|
||||||
class View extends \CodeIgniter\Config\View
|
class View extends \CodeIgniter\Config\View
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -66,7 +67,9 @@ class Contributor extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', [lang('Contributor.alreadyAddedError')]);
|
->with('errors', [
|
||||||
|
lang('Contributor.messages.alreadyAddedError'),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('contributor_list', [$this->podcast->id]);
|
return redirect()->route('contributor_list', [$this->podcast->id]);
|
||||||
|
@ -77,7 +80,7 @@ class Contributor extends BaseController
|
||||||
$data = [
|
$data = [
|
||||||
'podcast' => $this->podcast,
|
'podcast' => $this->podcast,
|
||||||
'user' => $this->user,
|
'user' => $this->user,
|
||||||
'contributor_group_id' => (new PodcastModel())->getContributorGroupId(
|
'contributorGroupId' => (new PodcastModel())->getContributorGroupId(
|
||||||
$this->user->id,
|
$this->user->id,
|
||||||
$this->podcast->id
|
$this->podcast->id
|
||||||
),
|
),
|
||||||
|
@ -104,27 +107,27 @@ class Contributor extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', [
|
->with('errors', [
|
||||||
lang('Contributor.removeOwnerContributorError'),
|
lang('Contributor.messages.removeOwnerContributorError'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$podcast_model = new PodcastModel();
|
$podcastModel = new PodcastModel();
|
||||||
if (
|
if (
|
||||||
!$podcast_model->removePodcastContributor(
|
!$podcastModel->removePodcastContributor(
|
||||||
$this->user->id,
|
$this->user->id,
|
||||||
$this->podcast->id
|
$this->podcast->id
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', $podcast_model->errors());
|
->with('errors', $podcastModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('Contributor.removeContributorSuccess', [
|
lang('Contributor.messages.removeContributorSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
'podcastTitle' => $this->podcast->title,
|
'podcastTitle' => $this->podcast->title,
|
||||||
])
|
])
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -20,9 +21,8 @@ class Episode extends BaseController
|
||||||
$this->podcast = (new PodcastModel())->find($params[0]);
|
$this->podcast = (new PodcastModel())->find($params[0]);
|
||||||
|
|
||||||
if (count($params) > 1) {
|
if (count($params) > 1) {
|
||||||
$episode_model = new EpisodeModel();
|
|
||||||
if (
|
if (
|
||||||
!($this->episode = $episode_model
|
!($this->episode = (new EpisodeModel())
|
||||||
->where([
|
->where([
|
||||||
'id' => $params[1],
|
'id' => $params[1],
|
||||||
'podcast_id' => $params[0],
|
'podcast_id' => $params[0],
|
||||||
|
@ -78,7 +78,7 @@ class Episode extends BaseController
|
||||||
->with('errors', $this->validator->getErrors());
|
->with('errors', $this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_episode = new \App\Entities\Episode([
|
$newEpisode = new \App\Entities\Episode([
|
||||||
'podcast_id' => $this->podcast->id,
|
'podcast_id' => $this->podcast->id,
|
||||||
'title' => $this->request->getPost('title'),
|
'title' => $this->request->getPost('title'),
|
||||||
'slug' => $this->request->getPost('slug'),
|
'slug' => $this->request->getPost('slug'),
|
||||||
|
@ -95,13 +95,13 @@ class Episode extends BaseController
|
||||||
'block' => (bool) $this->request->getPost('block'),
|
'block' => (bool) $this->request->getPost('block'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$episode_model = new EpisodeModel();
|
$episodeModel = new EpisodeModel();
|
||||||
|
|
||||||
if (!$episode_model->save($new_episode)) {
|
if (!$episodeModel->save($newEpisode)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $episode_model->errors());
|
->with('errors', $episodeModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||||
|
@ -112,7 +112,6 @@ class Episode extends BaseController
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'podcast' => $this->podcast,
|
|
||||||
'episode' => $this->episode,
|
'episode' => $this->episode,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -158,13 +157,13 @@ class Episode extends BaseController
|
||||||
$this->episode->image = $image;
|
$this->episode->image = $image;
|
||||||
}
|
}
|
||||||
|
|
||||||
$episode_model = new EpisodeModel();
|
$episodeModel = new EpisodeModel();
|
||||||
|
|
||||||
if (!$episode_model->save($this->episode)) {
|
if (!$episodeModel->save($this->episode)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $episode_model->errors());
|
->with('errors', $episodeModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||||
|
@ -172,8 +171,7 @@ class Episode extends BaseController
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$episode_model = new EpisodeModel();
|
(new EpisodeModel())->delete($this->episode->id);
|
||||||
$episode_model->delete($this->episode->id);
|
|
||||||
|
|
||||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -25,7 +26,7 @@ class Myaccount extends BaseController
|
||||||
public function attemptChange()
|
public function attemptChange()
|
||||||
{
|
{
|
||||||
$auth = Services::authentication();
|
$auth = Services::authentication();
|
||||||
$user_model = new UserModel();
|
$userModel = new UserModel();
|
||||||
|
|
||||||
// Validate here first, since some things,
|
// Validate here first, since some things,
|
||||||
// like the password, can only be validated properly here.
|
// like the password, can only be validated properly here.
|
||||||
|
@ -40,7 +41,7 @@ class Myaccount extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$credentials = [
|
$credentials = [
|
||||||
|
@ -52,22 +53,22 @@ class Myaccount extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
user()->password = $this->request->getPost('new_password');
|
user()->password = $this->request->getPost('new_password');
|
||||||
$user_model->save(user());
|
$userModel->save(user());
|
||||||
|
|
||||||
if (!$user_model->save(user())) {
|
if (!$userModel->save(user())) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success!
|
// Success!
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('myAccount')
|
->route('myAccount')
|
||||||
->with('message', lang('MyAccount.passwordChangeSuccess'));
|
->with('message', lang('MyAccount.messages.passwordChangeSuccess'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
use App\Models\CategoryModel;
|
use App\Models\CategoryModel;
|
||||||
|
@ -29,7 +31,7 @@ class Podcast extends BaseController
|
||||||
public function myPodcasts()
|
public function myPodcasts()
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'all_podcasts' => (new PodcastModel())->getUserPodcasts(user()->id),
|
'podcasts' => (new PodcastModel())->getUserPodcasts(user()->id),
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('admin/podcast/list', $data);
|
return view('admin/podcast/list', $data);
|
||||||
|
@ -41,7 +43,7 @@ class Podcast extends BaseController
|
||||||
return redirect()->route('my_podcasts');
|
return redirect()->route('my_podcasts');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = ['all_podcasts' => (new PodcastModel())->findAll()];
|
$data = ['podcasts' => (new PodcastModel())->findAll()];
|
||||||
|
|
||||||
return view('admin/podcast/list', $data);
|
return view('admin/podcast/list', $data);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +64,7 @@ class Podcast extends BaseController
|
||||||
$data = [
|
$data = [
|
||||||
'languages' => $languageModel->findAll(),
|
'languages' => $languageModel->findAll(),
|
||||||
'categories' => $categoryModel->findAll(),
|
'categories' => $categoryModel->findAll(),
|
||||||
'browser_lang' => get_browser_language(
|
'browserLang' => get_browser_language(
|
||||||
$this->request->getServer('HTTP_ACCEPT_LANGUAGE')
|
$this->request->getServer('HTTP_ACCEPT_LANGUAGE')
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -106,26 +108,26 @@ class Podcast extends BaseController
|
||||||
'custom_html_head' => $this->request->getPost('custom_html_head'),
|
'custom_html_head' => $this->request->getPost('custom_html_head'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$podcast_model = new PodcastModel();
|
$podcastModel = new PodcastModel();
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
|
|
||||||
$db->transStart();
|
$db->transStart();
|
||||||
|
|
||||||
if (!($new_podcast_id = $podcast_model->insert($podcast, true))) {
|
if (!($newPodcastId = $podcastModel->insert($podcast, true))) {
|
||||||
$db->transComplete();
|
$db->transComplete();
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $podcast_model->errors());
|
->with('errors', $podcastModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
$authorize = Services::authorization();
|
$authorize = Services::authorization();
|
||||||
$podcast_admin_group = $authorize->group('podcast_admin');
|
$podcastAdminGroup = $authorize->group('podcast_admin');
|
||||||
|
|
||||||
$podcast_model->addPodcastContributor(
|
$podcastModel->addPodcastContributor(
|
||||||
user()->id,
|
user()->id,
|
||||||
$new_podcast_id,
|
$newPodcastId,
|
||||||
$podcast_admin_group->id
|
$podcastAdminGroup->id
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->transComplete();
|
$db->transComplete();
|
||||||
|
@ -137,12 +139,10 @@ class Podcast extends BaseController
|
||||||
{
|
{
|
||||||
helper('form');
|
helper('form');
|
||||||
|
|
||||||
$languageModel = new LanguageModel();
|
|
||||||
$categoryModel = new CategoryModel();
|
|
||||||
$data = [
|
$data = [
|
||||||
'podcast' => $this->podcast,
|
'podcast' => $this->podcast,
|
||||||
'languages' => $languageModel->findAll(),
|
'languages' => (new LanguageModel())->findAll(),
|
||||||
'categories' => $categoryModel->findAll(),
|
'categories' => (new CategoryModel())->findAll(),
|
||||||
];
|
];
|
||||||
|
|
||||||
echo view('admin/podcast/edit', $data);
|
echo view('admin/podcast/edit', $data);
|
||||||
|
@ -188,13 +188,13 @@ class Podcast extends BaseController
|
||||||
'custom_html_head'
|
'custom_html_head'
|
||||||
);
|
);
|
||||||
|
|
||||||
$podcast_model = new PodcastModel();
|
$podcastModel = new PodcastModel();
|
||||||
|
|
||||||
if (!$podcast_model->save($this->podcast)) {
|
if (!$podcastModel->save($this->podcast)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $podcast_model->errors());
|
->with('errors', $podcastModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('podcast_list');
|
return redirect()->route('podcast_list');
|
||||||
|
@ -202,8 +202,7 @@ class Podcast extends BaseController
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$podcast_model = new PodcastModel();
|
(new PodcastModel())->delete($this->podcast->id);
|
||||||
$podcast_model->delete($this->podcast->id);
|
|
||||||
|
|
||||||
return redirect()->route('podcast_list');
|
return redirect()->route('podcast_list');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -18,8 +19,7 @@ class User extends BaseController
|
||||||
public function _remap($method, ...$params)
|
public function _remap($method, ...$params)
|
||||||
{
|
{
|
||||||
if (count($params) > 0) {
|
if (count($params) > 0) {
|
||||||
$user_model = new UserModel();
|
if (!($this->user = (new UserModel())->find($params[0]))) {
|
||||||
if (!($this->user = $user_model->find($params[0]))) {
|
|
||||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class User extends BaseController
|
||||||
|
|
||||||
public function list()
|
public function list()
|
||||||
{
|
{
|
||||||
$data = ['all_users' => (new UserModel())->findAll()];
|
$data = ['users' => (new UserModel())->findAll()];
|
||||||
|
|
||||||
return view('admin/user/list', $data);
|
return view('admin/user/list', $data);
|
||||||
}
|
}
|
||||||
|
@ -45,12 +45,12 @@ class User extends BaseController
|
||||||
|
|
||||||
public function attemptCreate()
|
public function attemptCreate()
|
||||||
{
|
{
|
||||||
$user_model = new UserModel();
|
$userModel = new UserModel();
|
||||||
|
|
||||||
// Validate here first, since some things,
|
// Validate here first, since some things,
|
||||||
// like the password, can only be validated properly here.
|
// like the password, can only be validated properly here.
|
||||||
$rules = array_merge(
|
$rules = array_merge(
|
||||||
$user_model->getValidationRules(['only' => ['username']]),
|
$userModel->getValidationRules(['only' => ['username']]),
|
||||||
[
|
[
|
||||||
'email' => 'required|valid_email|is_unique[users.email]',
|
'email' => 'required|valid_email|is_unique[users.email]',
|
||||||
'password' => 'required|strong_password',
|
'password' => 'required|strong_password',
|
||||||
|
@ -74,11 +74,11 @@ class User extends BaseController
|
||||||
// Force user to reset his password on first connection
|
// Force user to reset his password on first connection
|
||||||
$user->forcePasswordReset();
|
$user->forcePasswordReset();
|
||||||
|
|
||||||
if (!$user_model->save($user)) {
|
if (!$userModel->save($user)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success!
|
// Success!
|
||||||
|
@ -86,7 +86,7 @@ class User extends BaseController
|
||||||
->route('user_list')
|
->route('user_list')
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.createSuccess', [
|
lang('User.messages.createSuccess', [
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
@ -114,7 +114,7 @@ class User extends BaseController
|
||||||
->route('user_list')
|
->route('user_list')
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.rolesEditSuccess', [
|
lang('User.messages.rolesEditSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
@ -122,13 +122,13 @@ class User extends BaseController
|
||||||
|
|
||||||
public function forcePassReset()
|
public function forcePassReset()
|
||||||
{
|
{
|
||||||
$user_model = new UserModel();
|
$userModel = new UserModel();
|
||||||
$this->user->forcePasswordReset();
|
$this->user->forcePasswordReset();
|
||||||
|
|
||||||
if (!$user_model->save($this->user)) {
|
if (!$userModel->save($this->user)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success!
|
// Success!
|
||||||
|
@ -136,7 +136,7 @@ class User extends BaseController
|
||||||
->route('user_list')
|
->route('user_list')
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.forcePassResetSuccess', [
|
lang('User.messages.forcePassResetSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
@ -149,27 +149,27 @@ class User extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', [
|
->with('errors', [
|
||||||
lang('User.banSuperAdminError', [
|
lang('User.messages.banSuperAdminError', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_model = new UserModel();
|
$userModel = new UserModel();
|
||||||
// TODO: add ban reason?
|
// TODO: add ban reason?
|
||||||
$this->user->ban('');
|
$this->user->ban('');
|
||||||
|
|
||||||
if (!$user_model->save($this->user)) {
|
if (!$userModel->save($this->user)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('user_list')
|
->route('user_list')
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.banSuccess', [
|
lang('User.messages.banSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
@ -177,20 +177,20 @@ class User extends BaseController
|
||||||
|
|
||||||
public function unBan()
|
public function unBan()
|
||||||
{
|
{
|
||||||
$user_model = new UserModel();
|
$userModel = new UserModel();
|
||||||
$this->user->unBan();
|
$this->user->unBan();
|
||||||
|
|
||||||
if (!$user_model->save($this->user)) {
|
if (!$userModel->save($this->user)) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', $user_model->errors());
|
->with('errors', $userModel->errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('user_list')
|
->route('user_list')
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.unbanSuccess', [
|
lang('User.messages.unbanSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
@ -203,20 +203,19 @@ class User extends BaseController
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with('errors', [
|
->with('errors', [
|
||||||
lang('User.deleteSuperAdminError', [
|
lang('User.messages.deleteSuperAdminError', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_model = new UserModel();
|
(new UserModel())->delete($this->user->id);
|
||||||
$user_model->delete($this->user->id);
|
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->back()
|
->back()
|
||||||
->with(
|
->with(
|
||||||
'message',
|
'message',
|
||||||
lang('User.deleteSuccess', [
|
lang('User.messages.deleteSuccess', [
|
||||||
'username' => $this->user->username,
|
'username' => $this->user->username,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Analytics
|
* Class Analytics
|
||||||
* Creates Analytics controller
|
* Creates Analytics controller
|
||||||
|
@ -44,9 +45,9 @@ class Analytics extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add one hit to this episode:
|
// Add one hit to this episode:
|
||||||
public function hit($p_podcast_id, $p_episode_id, ...$filename)
|
public function hit($p_podcastId, $p_episodeId, ...$filename)
|
||||||
{
|
{
|
||||||
podcast_hit($p_podcast_id, $p_episode_id);
|
podcast_hit($p_podcastId, $p_episodeId);
|
||||||
return redirect()->to(media_url(implode('/', $filename)));
|
return redirect()->to(media_url(implode('/', $filename)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@ class BaseController extends Controller
|
||||||
set_user_session_referer();
|
set_user_session_referer();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function triggerWebpageHit($postcast_id)
|
protected static function triggerWebpageHit($podcastId)
|
||||||
{
|
{
|
||||||
webpage_hit($postcast_id);
|
webpage_hit($podcastId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -17,22 +18,20 @@ class Episode extends BaseController
|
||||||
|
|
||||||
public function _remap($method, ...$params)
|
public function _remap($method, ...$params)
|
||||||
{
|
{
|
||||||
$podcast_model = new PodcastModel();
|
$this->podcast = (new PodcastModel())
|
||||||
|
->where('name', $params[0])
|
||||||
|
->first();
|
||||||
|
|
||||||
$this->podcast = $podcast_model->where('name', $params[0])->first();
|
if (
|
||||||
|
count($params) > 1 &&
|
||||||
if (count($params) > 1) {
|
!($this->episode = (new EpisodeModel())
|
||||||
$episode_model = new EpisodeModel();
|
->where([
|
||||||
if (
|
'podcast_id' => $this->podcast->id,
|
||||||
!($this->episode = $episode_model
|
'slug' => $params[1],
|
||||||
->where([
|
])
|
||||||
'podcast_id' => $this->podcast->id,
|
->first())
|
||||||
'slug' => $params[1],
|
) {
|
||||||
])
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
->first())
|
|
||||||
) {
|
|
||||||
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->$method();
|
return $this->$method();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -12,16 +13,15 @@ use CodeIgniter\Controller;
|
||||||
|
|
||||||
class Feed extends Controller
|
class Feed extends Controller
|
||||||
{
|
{
|
||||||
public function index($podcast_name)
|
public function index($podcastName)
|
||||||
{
|
{
|
||||||
helper('rss');
|
|
||||||
|
|
||||||
$podcast_model = new PodcastModel();
|
|
||||||
$podcast = $podcast_model->where('name', $podcast_name)->first();
|
|
||||||
|
|
||||||
// The page cache is set to a decade so it is deleted manually upon podcast update
|
// The page cache is set to a decade so it is deleted manually upon podcast update
|
||||||
$this->cachePage(DECADE);
|
$this->cachePage(DECADE);
|
||||||
|
|
||||||
|
helper('rss');
|
||||||
|
|
||||||
|
$podcast = (new PodcastModel())->where('name', $podcastName)->first();
|
||||||
|
|
||||||
return $this->response->setXML(get_rss_feed($podcast));
|
return $this->response->setXML(get_rss_feed($podcast));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -15,15 +16,15 @@ class Home extends BaseController
|
||||||
{
|
{
|
||||||
$model = new PodcastModel();
|
$model = new PodcastModel();
|
||||||
|
|
||||||
$all_podcasts = $model->findAll();
|
$allPodcasts = $model->findAll();
|
||||||
|
|
||||||
// check if there's only one podcast to redirect user to it
|
// check if there's only one podcast to redirect user to it
|
||||||
if (count($all_podcasts) == 1) {
|
if (count($allPodcasts) == 1) {
|
||||||
return redirect()->route('podcast', [$all_podcasts[0]->name]);
|
return redirect()->route('podcast', [$allPodcasts[0]->name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// default behavior: list all podcasts on home page
|
// default behavior: list all podcasts on home page
|
||||||
$data = ['podcasts' => $all_podcasts];
|
$data = ['podcasts' => $allPodcasts];
|
||||||
return view('home', $data);
|
return view('home', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
use App\Models\PodcastModel;
|
use App\Models\PodcastModel;
|
||||||
|
@ -15,9 +17,8 @@ class Podcast extends BaseController
|
||||||
public function _remap($method, ...$params)
|
public function _remap($method, ...$params)
|
||||||
{
|
{
|
||||||
if (count($params) > 0) {
|
if (count($params) > 0) {
|
||||||
$podcast_model = new PodcastModel();
|
|
||||||
if (
|
if (
|
||||||
!($this->podcast = $podcast_model
|
!($this->podcast = (new PodcastModel())
|
||||||
->where('name', $params[0])
|
->where('name', $params[0])
|
||||||
->first())
|
->first())
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -6,14 +7,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
use CodeIgniter\Controller;
|
use CodeIgniter\Controller;
|
||||||
|
|
||||||
class UnknownUserAgents extends Controller
|
class UnknownUserAgents extends Controller
|
||||||
{
|
{
|
||||||
public function index($last_known_id = 0)
|
public function index($lastKnownId = 0)
|
||||||
{
|
{
|
||||||
$model = new \App\Models\UnknownUserAgentsModel();
|
$model = new \App\Models\UnknownUserAgentsModel();
|
||||||
|
|
||||||
return $this->response->setJSON($model->getUserAgents($last_known_id));
|
return $this->response->setJSON($model->getUserAgents($lastKnownId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddCategories
|
* Class AddCategories
|
||||||
* Creates categories table in database
|
* Creates categories table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddLanguages
|
* Class AddLanguages
|
||||||
* Creates languages table in database
|
* Creates languages table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddPodcasts
|
* Class AddPodcasts
|
||||||
* Creates podcasts table in database
|
* Creates podcasts table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddEpisodes
|
* Class AddEpisodes
|
||||||
* Creates episodes table in database
|
* Creates episodes table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddPlatforms
|
* Class AddPlatforms
|
||||||
* Creates platforms table in database
|
* Creates platforms table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddPlatformsLinks
|
* Class AddPlatformsLinks
|
||||||
* Creates platform_links table in database
|
* Creates platform_links table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsEpisodesByCountry
|
* Class AddAnalyticsEpisodesByCountry
|
||||||
* Creates analytics_episodes_by_country table in database
|
* Creates analytics_episodes_by_country table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsEpisodesByPlayer
|
* Class AddAnalyticsEpisodesByPlayer
|
||||||
* Creates analytics_episodes_by_player table in database
|
* Creates analytics_episodes_by_player table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsPodcastsByCountry
|
* Class AddAnalyticsPodcastsByCountry
|
||||||
* Creates analytics_podcasts_by_country table in database
|
* Creates analytics_podcasts_by_country table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsPodcastsByPlayer
|
* Class AddAnalyticsPodcastsByPlayer
|
||||||
* Creates analytics_podcasts_by_player table in database
|
* Creates analytics_podcasts_by_player table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsUnknownUseragents
|
* Class AddAnalyticsUnknownUseragents
|
||||||
* Creates analytics_unknown_useragents table in database
|
* Creates analytics_unknown_useragents table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsWebsiteByBrowser
|
* Class AddAnalyticsWebsiteByBrowser
|
||||||
* Creates analytics_website_by_browser table in database
|
* Creates analytics_website_by_browser table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsWebsiteByCountry
|
* Class AddAnalyticsWebsiteByCountry
|
||||||
* Creates analytics_website_by_country table in database
|
* Creates analytics_website_by_country table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsWebsiteByReferer
|
* Class AddAnalyticsWebsiteByReferer
|
||||||
* Creates analytics_website_by_referer table in database
|
* Creates analytics_website_by_referer table in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsPodcastsStoredProcedure
|
* Class AddAnalyticsPodcastsStoredProcedure
|
||||||
* Creates analytics_podcasts stored procedure in database
|
* Creates analytics_podcasts stored procedure in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsUnknownUseragentsStoredProcedure
|
* Class AddAnalyticsUnknownUseragentsStoredProcedure
|
||||||
* Creates analytics_unknown_useragents stored procedure in database
|
* Creates analytics_unknown_useragents stored procedure in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddAnalyticsWebsiteStoredProcedure
|
* Class AddAnalyticsWebsiteStoredProcedure
|
||||||
* Creates analytics_website stored procedure in database
|
* Creates analytics_website stored procedure in database
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AddLanguages
|
* Class AddLanguages
|
||||||
* Creates languages table in database
|
* Creates languages table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PermissionSeeder
|
* Class PermissionSeeder
|
||||||
* Inserts permissions
|
* Inserts permissions
|
||||||
|
@ -224,9 +225,9 @@ class AuthSeeder extends Seeder
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
static function getGroupIdByName($name, $data_groups)
|
static function getGroupIdByName($name, $dataGroups)
|
||||||
{
|
{
|
||||||
foreach ($data_groups as $group) {
|
foreach ($dataGroups as $group) {
|
||||||
if ($group['name'] === $name) {
|
if ($group['name'] === $name) {
|
||||||
return $group['id'];
|
return $group['id'];
|
||||||
}
|
}
|
||||||
|
@ -236,45 +237,45 @@ class AuthSeeder extends Seeder
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$group_id = 0;
|
$groupId = 0;
|
||||||
$data_groups = [];
|
$dataGroups = [];
|
||||||
foreach ($this->groups as $group) {
|
foreach ($this->groups as $group) {
|
||||||
array_push($data_groups, [
|
array_push($dataGroups, [
|
||||||
'id' => ++$group_id,
|
'id' => ++$groupId,
|
||||||
'name' => $group['name'],
|
'name' => $group['name'],
|
||||||
'description' => $group['description'],
|
'description' => $group['description'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map permissions to a format the `auth_permissions` table expects
|
// Map permissions to a format the `auth_permissions` table expects
|
||||||
$data_permissions = [];
|
$dataPermissions = [];
|
||||||
$data_groups_permissions = [];
|
$dataGroupsPermissions = [];
|
||||||
$permission_id = 0;
|
$permissionId = 0;
|
||||||
foreach ($this->permissions as $context => $actions) {
|
foreach ($this->permissions as $context => $actions) {
|
||||||
foreach ($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
array_push($data_permissions, [
|
array_push($dataPermissions, [
|
||||||
'id' => ++$permission_id,
|
'id' => ++$permissionId,
|
||||||
'name' => $context . '-' . $action['name'],
|
'name' => $context . '-' . $action['name'],
|
||||||
'description' => $action['description'],
|
'description' => $action['description'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
foreach ($action['has_permission'] as $role) {
|
foreach ($action['has_permission'] as $role) {
|
||||||
// link permission to specified groups
|
// link permission to specified groups
|
||||||
array_push($data_groups_permissions, [
|
array_push($dataGroupsPermissions, [
|
||||||
'group_id' => $this->getGroupIdByName(
|
'group_id' => $this->getGroupIdByName(
|
||||||
$role,
|
$role,
|
||||||
$data_groups
|
$dataGroups
|
||||||
),
|
),
|
||||||
'permission_id' => $permission_id,
|
'permission_id' => $permissionId,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->table('auth_permissions')->insertBatch($data_permissions);
|
$this->db->table('auth_permissions')->insertBatch($dataPermissions);
|
||||||
$this->db->table('auth_groups')->insertBatch($data_groups);
|
$this->db->table('auth_groups')->insertBatch($dataGroups);
|
||||||
$this->db
|
$this->db
|
||||||
->table('auth_groups_permissions')
|
->table('auth_groups_permissions')
|
||||||
->insertBatch($data_groups_permissions);
|
->insertBatch($dataGroupsPermissions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CategorySeeder
|
* Class CategorySeeder
|
||||||
* Inserts values in categories table in database
|
* Inserts values in categories table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class LanguageSeeder
|
* Class LanguageSeeder
|
||||||
* Inserts values in languages table in database
|
* Inserts values in languages table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PlatformsSeeder
|
* Class PlatformsSeeder
|
||||||
* Inserts values in platforms table in database
|
* Inserts values in platforms table in database
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TestSeeder
|
* Class TestSeeder
|
||||||
* Inserts a superadmin user in the database
|
* Inserts a superadmin user in the database
|
||||||
|
@ -23,7 +24,7 @@ class TestSeeder extends Seeder
|
||||||
$this->db->table('users')->insert([
|
$this->db->table('users')->insert([
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'username' => 'admin',
|
'username' => 'admin',
|
||||||
'email' => 'admin@castopod.com',
|
'email' => 'admin@example.com',
|
||||||
'password_hash' =>
|
'password_hash' =>
|
||||||
'$2y$10$TXJEHX/djW8jtzgpDVf7dOOCGo5rv1uqtAYWdwwwkttQcDkAeB2.6',
|
'$2y$10$TXJEHX/djW8jtzgpDVf7dOOCGo5rv1uqtAYWdwwwkttQcDkAeB2.6',
|
||||||
'active' => 1,
|
'active' => 1,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsEpisodesByCountry
|
* Class AnalyticsEpisodesByCountry
|
||||||
* Entity for AnalyticsEpisodesByCountry
|
* Entity for AnalyticsEpisodesByCountry
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsEpisodesByPlayer
|
* Class AnalyticsEpisodesByPlayer
|
||||||
* Entity for AnalyticsEpisodesByPlayer
|
* Entity for AnalyticsEpisodesByPlayer
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsPodcastsByCountry
|
* Class AnalyticsPodcastsByCountry
|
||||||
* Entity for AnalyticsPodcastsByCountry
|
* Entity for AnalyticsPodcastsByCountry
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsPodcastsByPlayer
|
* Class AnalyticsPodcastsByPlayer
|
||||||
* Entity for AnalyticsPodcastsByPlayer
|
* Entity for AnalyticsPodcastsByPlayer
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsUnknownUseragents
|
* Class AnalyticsUnknownUseragents
|
||||||
* Entity for AnalyticsUnknownUseragents
|
* Entity for AnalyticsUnknownUseragents
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsWebsiteByBrowser
|
* Class AnalyticsWebsiteByBrowser
|
||||||
* Entity for AnalyticsWebsiteByBrowser
|
* Entity for AnalyticsWebsiteByBrowser
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AnalyticsWebsiteByCountry
|
* Class AnalyticsWebsiteByCountry
|
||||||
* Entity for AnalyticsWebsiteByCountry
|
* Entity for AnalyticsWebsiteByCountry
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class class AnalyticsWebsiteByReferer
|
* Class class AnalyticsWebsiteByReferer
|
||||||
* Entity for AnalyticsWebsiteByReferer
|
* Entity for AnalyticsWebsiteByReferer
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -23,11 +24,10 @@ class Category extends Entity
|
||||||
|
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
$category_model = new CategoryModel();
|
$parentId = $this->attributes['parent_id'];
|
||||||
$parent_id = $this->attributes['parent_id'];
|
|
||||||
|
|
||||||
return $parent_id != 0
|
return $parentId != 0
|
||||||
? $category_model->find($this->attributes['parent_id'])
|
? (new CategoryModel())->findParent($parentId)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -9,7 +10,7 @@ namespace App\Entities;
|
||||||
|
|
||||||
use App\Models\PodcastModel;
|
use App\Models\PodcastModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
use Parsedown;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
|
||||||
class Episode extends Entity
|
class Episode extends Entity
|
||||||
{
|
{
|
||||||
|
@ -43,7 +44,7 @@ class Episode extends Entity
|
||||||
|
|
||||||
public function setImage(?\CodeIgniter\HTTP\Files\UploadedFile $image)
|
public function setImage(?\CodeIgniter\HTTP\Files\UploadedFile $image)
|
||||||
{
|
{
|
||||||
if ($image->isValid()) {
|
if (!empty($image) && $image->isValid()) {
|
||||||
// check whether the user has inputted an image and store it
|
// check whether the user has inputted an image and store it
|
||||||
$this->attributes['image_uri'] = save_podcast_media(
|
$this->attributes['image_uri'] = save_podcast_media(
|
||||||
$image,
|
$image,
|
||||||
|
@ -68,17 +69,17 @@ class Episode extends Entity
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getImage()
|
public function getImage(): \CodeIgniter\Files\File
|
||||||
{
|
{
|
||||||
return new \CodeIgniter\Files\File($this->getImageMediaPath());
|
return new \CodeIgniter\Files\File($this->getImageMediaPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getImageMediaPath()
|
public function getImageMediaPath(): string
|
||||||
{
|
{
|
||||||
return media_path($this->attributes['image_uri']);
|
return media_path($this->attributes['image_uri']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getImageUrl()
|
public function getImageUrl(): string
|
||||||
{
|
{
|
||||||
if ($image_uri = $this->attributes['image_uri']) {
|
if ($image_uri = $this->attributes['image_uri']) {
|
||||||
return media_url($image_uri);
|
return media_url($image_uri);
|
||||||
|
@ -89,7 +90,7 @@ class Episode extends Entity
|
||||||
public function setEnclosure(
|
public function setEnclosure(
|
||||||
\CodeIgniter\HTTP\Files\UploadedFile $enclosure = null
|
\CodeIgniter\HTTP\Files\UploadedFile $enclosure = null
|
||||||
) {
|
) {
|
||||||
if ($enclosure->isValid()) {
|
if (!empty($enclosure) && $enclosure->isValid()) {
|
||||||
helper('media');
|
helper('media');
|
||||||
|
|
||||||
$this->attributes['enclosure_uri'] = save_podcast_media(
|
$this->attributes['enclosure_uri'] = save_podcast_media(
|
||||||
|
@ -151,26 +152,25 @@ class Episode extends Entity
|
||||||
|
|
||||||
public function getPodcast()
|
public function getPodcast()
|
||||||
{
|
{
|
||||||
$podcast_model = new PodcastModel();
|
return (new PodcastModel())->find($this->attributes['podcast_id']);
|
||||||
|
|
||||||
return $podcast_model->find($this->attributes['podcast_id']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescriptionHtml()
|
public function getDescriptionHtml()
|
||||||
{
|
{
|
||||||
$converter = new Parsedown();
|
$converter = new CommonMarkConverter([
|
||||||
$converter->setBreaksEnabled(true);
|
'html_input' => 'strip',
|
||||||
|
'allow_unsafe_links' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$description_footer = $this->getPodcast()
|
$descriptionFooter = $this->getPodcast()->episode_description_footer
|
||||||
->episode_description_footer
|
|
||||||
) {
|
) {
|
||||||
return $converter->text($this->attributes['description']) .
|
return $converter->convertToHtml($this->attributes['description']) .
|
||||||
'<footer>' .
|
'<footer>' .
|
||||||
$converter->text($description_footer) .
|
$converter->convertToHtml($descriptionFooter) .
|
||||||
'</footer>';
|
'</footer>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $converter->text($this->attributes['description']);
|
return $converter->convertToHtml($this->attributes['description']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -10,7 +11,7 @@ namespace App\Entities;
|
||||||
use App\Models\EpisodeModel;
|
use App\Models\EpisodeModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use Parsedown;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
|
||||||
class Podcast extends Entity
|
class Podcast extends Entity
|
||||||
{
|
{
|
||||||
|
@ -158,9 +159,11 @@ class Podcast extends Entity
|
||||||
|
|
||||||
public function getDescriptionHtml()
|
public function getDescriptionHtml()
|
||||||
{
|
{
|
||||||
$converter = new Parsedown();
|
$converter = new CommonMarkConverter([
|
||||||
$converter->setBreaksEnabled(true);
|
'html_input' => 'strip',
|
||||||
|
'allow_unsafe_links' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
return $converter->text($this->attributes['description']);
|
return $converter->convertToHtml($this->attributes['description']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace App\Entities;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entities;
|
||||||
|
|
||||||
use App\Models\PodcastModel;
|
use App\Models\PodcastModel;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php namespace App\Filters;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filters;
|
||||||
|
|
||||||
use App\Models\PodcastModel;
|
use App\Models\PodcastModel;
|
||||||
use Config\Services;
|
use Config\Services;
|
||||||
|
@ -57,14 +59,12 @@ class Permission implements FilterInterface
|
||||||
count($routerParams) > 0
|
count($routerParams) > 0
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
$group_id = (new PodcastModel())->getContributorGroupId(
|
$groupId = (new PodcastModel())->getContributorGroupId(
|
||||||
$authenticate->id(),
|
$authenticate->id(),
|
||||||
$routerParams[0]
|
$routerParams[0]
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
if (
|
if ($authorize->groupHasPermission($permission, $groupId)) {
|
||||||
$authorize->groupHasPermission($permission, $group_id)
|
|
||||||
) {
|
|
||||||
$result = true;
|
$result = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -187,4 +187,3 @@ function podcast_hit($p_podcast_id, $p_episode_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Libraries\SimpleRSSElement;
|
||||||
use App\Models\CategoryModel;
|
use App\Models\CategoryModel;
|
||||||
use CodeIgniter\I18n\Time;
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'dashboard' => 'Dashboard',
|
'dashboard' => 'Dashboard',
|
||||||
'podcasts' => 'Podcasts',
|
'podcasts' => 'Podcasts',
|
||||||
'users' => 'Users',
|
'users' => 'Users',
|
||||||
'admin_home' => 'Home',
|
'admin_home' => 'Home',
|
||||||
'my_podcasts' => 'My podcasts',
|
'my_podcasts' => 'My podcasts',
|
||||||
'podcast_list' => 'All podcasts',
|
'podcast_list' => 'All podcasts',
|
||||||
'podcast_create' => 'New podcast',
|
'podcast_create' => 'New podcast',
|
||||||
'user_list' => 'All users',
|
'user_list' => 'All users',
|
||||||
'user_create' => 'New user',
|
'user_create' => 'New user',
|
||||||
'go_to_website' => 'Go to website'
|
'go_to_website' => 'Go to website',
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -6,9 +7,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'removeOwnerContributorError' => 'You can\'t remove the podcast owner!',
|
|
||||||
'removeContributorSuccess' => 'You have successfully removed {username} from {podcastTitle}',
|
|
||||||
'alreadyAddedError' => 'The contributor you\'re trying to add has already been added!',
|
|
||||||
'podcast_contributors' => 'Podcast contributors',
|
'podcast_contributors' => 'Podcast contributors',
|
||||||
'add' => 'Add contributor',
|
'add' => 'Add contributor',
|
||||||
'add_contributor' => 'Add a contributor for {0}',
|
'add_contributor' => 'Add a contributor for {0}',
|
||||||
|
@ -19,6 +17,13 @@ return [
|
||||||
'user' => 'User',
|
'user' => 'User',
|
||||||
'role' => 'Role',
|
'role' => 'Role',
|
||||||
'submit_add' => 'Add contributor',
|
'submit_add' => 'Add contributor',
|
||||||
'submit_edit' => 'Update role'
|
'submit_edit' => 'Update role',
|
||||||
]
|
],
|
||||||
|
'messages' => [
|
||||||
|
'removeOwnerContributorError' => 'You can\'t remove the podcast owner!',
|
||||||
|
'removeContributorSuccess' =>
|
||||||
|
'You have successfully removed {username} from {podcastTitle}',
|
||||||
|
'alreadyAddedError' =>
|
||||||
|
'The contributor you\'re trying to add has already been added!',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ISO 3166 country codes
|
* ISO 3166 country codes
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
|
@ -257,4 +258,4 @@ return [
|
||||||
'ZA' => 'South Africa',
|
'ZA' => 'South Africa',
|
||||||
'ZM' => 'Zambia',
|
'ZM' => 'Zambia',
|
||||||
'ZW' => 'Zimbabwe',
|
'ZW' => 'Zimbabwe',
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -10,7 +11,7 @@ return [
|
||||||
'back_to_podcast' => 'Go back to podcast',
|
'back_to_podcast' => 'Go back to podcast',
|
||||||
'edit' => 'Edit',
|
'edit' => 'Edit',
|
||||||
'delete' => 'Delete',
|
'delete' => 'Delete',
|
||||||
'goto_page' => 'Go to page',
|
'go_to_page' => 'Go to page',
|
||||||
'create' => 'Add an episode',
|
'create' => 'Add an episode',
|
||||||
'form' => [
|
'form' => [
|
||||||
'file' => 'Audio file',
|
'file' => 'Audio file',
|
||||||
|
@ -33,5 +34,5 @@ return [
|
||||||
'block' => 'Block',
|
'block' => 'Block',
|
||||||
'submit_create' => 'Create episode',
|
'submit_create' => 'Create episode',
|
||||||
'submit_edit' => 'Save episode',
|
'submit_edit' => 'Save episode',
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -6,7 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'passwordChangeSuccess' => 'Password has been successfully changed!',
|
'info' => 'My account info',
|
||||||
'changePassword' => 'Change my password',
|
'messages' => [
|
||||||
'info' => 'My account info'
|
'passwordChangeSuccess' => 'Password has been successfully changed!',
|
||||||
|
'changePassword' => 'Change my password',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright 2020 Podlibre
|
* @copyright 2020 Podlibre
|
||||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||||
|
@ -16,7 +17,7 @@ return [
|
||||||
'delete' => 'Delete podcast',
|
'delete' => 'Delete podcast',
|
||||||
'see_episodes' => 'See episodes',
|
'see_episodes' => 'See episodes',
|
||||||
'see_contributors' => 'See contributors',
|
'see_contributors' => 'See contributors',
|
||||||
'goto_page' => 'Go to page',
|
'go_to_page' => 'Go to page',
|
||||||
'form' => [
|
'form' => [
|
||||||
'title' => 'Title',
|
'title' => 'Title',
|
||||||
'name' => 'Name',
|
'name' => 'Name',
|
||||||
|
@ -156,5 +157,5 @@ return [
|
||||||
'tv_reviews' => 'TV Reviews',
|
'tv_reviews' => 'TV Reviews',
|
||||||
],
|
],
|
||||||
'list_of_episodes' => 'List of episodes',
|
'list_of_episodes' => 'List of episodes',
|
||||||
'no_episode' => 'No episode found'
|
'no_episode' => 'No episode found',
|
||||||
];
|
];
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue