├── .gitignore ├── LICENSE ├── README.md ├── app ├── .htaccess ├── Common.php ├── Config │ ├── App.php │ ├── Autoload.php │ ├── Boot │ │ ├── development.php │ │ ├── production.php │ │ └── testing.php │ ├── CURLRequest.php │ ├── Cache.php │ ├── Constants.php │ ├── ContentSecurityPolicy.php │ ├── Cookie.php │ ├── Database.php │ ├── DocTypes.php │ ├── Email.php │ ├── Encryption.php │ ├── Events.php │ ├── Exceptions.php │ ├── Feature.php │ ├── Filters.php │ ├── ForeignCharacters.php │ ├── Format.php │ ├── Generators.php │ ├── Honeypot.php │ ├── Images.php │ ├── Kint.php │ ├── Logger.php │ ├── Migrations.php │ ├── Mimes.php │ ├── Modules.php │ ├── Pager.php │ ├── Paths.php │ ├── Publisher.php │ ├── Routes.php │ ├── Routing.php │ ├── Security.php │ ├── Services.php │ ├── Session.php │ ├── Toolbar.php │ ├── UserAgents.php │ ├── Validation.php │ └── View.php ├── Controllers │ ├── BaseController.php │ └── Home.php ├── Database │ ├── Migrations │ │ ├── .gitkeep │ │ └── 20200417114353_create_ci_sessions_table.php │ └── Seeds │ │ └── .gitkeep ├── Filters │ └── .gitkeep ├── Helpers │ └── .gitkeep ├── Language │ ├── .gitkeep │ └── en │ │ └── Validation.php ├── Libraries │ └── .gitkeep ├── Models │ └── .gitkeep ├── ThirdParty │ └── .gitkeep ├── Views │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ │ └── html │ │ │ ├── debug.css │ │ │ ├── debug.js │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ └── welcome_message.php └── index.html ├── builds ├── capture1.png ├── capture2.png ├── composer.json ├── composer.lock ├── contributing.md ├── env ├── license.txt ├── phpunit.xml.dist ├── preload.php ├── public ├── .htaccess ├── assets │ └── admin │ │ ├── css │ │ └── app.css │ │ └── js │ │ └── app.js ├── favicon.ico ├── index.php └── robots.txt ├── spark ├── tests ├── README.md ├── _support │ ├── Autoloader │ │ └── UnnamespacedClass.php │ ├── Commands │ │ ├── AbstractInfo.php │ │ └── AppInfo.php │ ├── Config │ │ ├── BadRegistrar.php │ │ ├── Registrar.php │ │ └── Routes.php │ ├── Controllers │ │ └── Popcorn.php │ ├── Database │ │ ├── Migrations │ │ │ ├── 20160428212500_Create_test_tables.php │ │ │ └── 2020-02-22-222222_example_migration.php │ │ └── Seeds │ │ │ ├── AnotherSeeder.php │ │ │ ├── CITestSeeder.php │ │ │ └── ExampleSeeder.php │ ├── DatabaseTestCase.php │ ├── Files │ │ ├── able │ │ │ ├── apple.php │ │ │ ├── fig_3.php │ │ │ └── prune_ripe.php │ │ └── baker │ │ │ └── banana.php │ ├── HTTP │ │ └── Files │ │ │ ├── CookiesHolder.txt │ │ │ └── tmp │ │ │ ├── fileA.txt │ │ │ └── fileB.txt │ ├── Images │ │ ├── EXIFsamples │ │ │ ├── down-mirrored.jpg │ │ │ ├── down.jpg │ │ │ ├── left-mirrored.jpg │ │ │ ├── left.jpg │ │ │ ├── right-mirrored.jpg │ │ │ ├── right.jpg │ │ │ ├── up-mirrored.jpg │ │ │ └── up.jpg │ │ ├── Steveston_dusk.JPG │ │ ├── ci-logo.gif │ │ ├── ci-logo.jpeg │ │ └── ci-logo.png │ ├── Language │ │ ├── SecondMockLanguage.php │ │ ├── ab-CD │ │ │ └── Allin.php │ │ ├── ab │ │ │ └── Allin.php │ │ ├── en-ZZ │ │ │ └── More.php │ │ ├── en │ │ │ ├── Allin.php │ │ │ ├── Core.php │ │ │ └── More.php │ │ └── ru │ │ │ └── Language.php │ ├── Libraries │ │ └── ConfigReader.php │ ├── Log │ │ └── Handlers │ │ │ └── TestHandler.php │ ├── MigrationTestMigrations │ │ └── Database │ │ │ └── Migrations │ │ │ ├── 2018-01-24-102300_Another_migration.py │ │ │ ├── 2018-01-24-102301_Some_migration.php │ │ │ └── 2018-01-24-102302_Another_migration.php │ ├── Models │ │ ├── EntityModel.php │ │ ├── EventModel.php │ │ ├── ExampleModel.php │ │ ├── JobModel.php │ │ ├── SecondaryModel.php │ │ ├── SimpleEntity.php │ │ ├── UserModel.php │ │ ├── ValidErrorsModel.php │ │ └── ValidModel.php │ ├── RESTful │ │ ├── Worker.php │ │ └── Worker2.php │ ├── Services.php │ ├── SessionTestCase.php │ ├── SomeEntity.php │ ├── Validation │ │ ├── TestRules.php │ │ └── uploads │ │ │ └── phpUxc0ty │ ├── View │ │ ├── SampleClass.php │ │ └── Views │ │ │ ├── simple.php │ │ │ └── simpler.php │ └── coverage.txt ├── database │ └── ExampleDatabaseTest.php ├── session │ └── ExampleSessionTest.php └── unit │ └── HealthTest.php └── writable ├── .htaccess ├── cache └── index.html ├── debugbar └── .gitkeep ├── logs └── index.html ├── session └── index.html └── uploads └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | #------------------------- 2 | # Operating Specific Junk Files 3 | #------------------------- 4 | 5 | # OS X 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # OS X Thumbnails 11 | ._* 12 | 13 | # Windows image file caches 14 | Thumbs.db 15 | ehthumbs.db 16 | Desktop.ini 17 | 18 | # Recycle Bin used on file shares 19 | $RECYCLE.BIN/ 20 | 21 | # Windows Installer files 22 | *.cab 23 | *.msi 24 | *.msm 25 | *.msp 26 | 27 | # Windows shortcuts 28 | *.lnk 29 | 30 | # Linux 31 | *~ 32 | 33 | # KDE directory preferences 34 | .directory 35 | 36 | # Linux trash folder which might appear on any partition or disk 37 | .Trash-* 38 | 39 | #------------------------- 40 | # Environment Files 41 | #------------------------- 42 | # These should never be under version control, 43 | # as it poses a security risk. 44 | .env 45 | .vagrant 46 | Vagrantfile 47 | 48 | #------------------------- 49 | # Temporary Files 50 | #------------------------- 51 | writable/cache/* 52 | !writable/cache/index.html 53 | 54 | writable/logs/* 55 | !writable/logs/index.html 56 | 57 | writable/session/* 58 | !writable/session/index.html 59 | 60 | writable/uploads/* 61 | !writable/uploads/index.html 62 | 63 | writable/debugbar/* 64 | !writable/debugbar/.gitkeep 65 | 66 | php_errors.log 67 | 68 | #------------------------- 69 | # User Guide Temp Files 70 | #------------------------- 71 | user_guide_src/build/* 72 | user_guide_src/cilexer/build/* 73 | user_guide_src/cilexer/dist/* 74 | user_guide_src/cilexer/pycilexer.egg-info/* 75 | 76 | #------------------------- 77 | # Test Files 78 | #------------------------- 79 | tests/coverage* 80 | 81 | # Don't save phpunit under version control. 82 | phpunit 83 | 84 | #------------------------- 85 | # Composer 86 | #------------------------- 87 | vendor/ 88 | 89 | #------------------------- 90 | # IDE / Development Files 91 | #------------------------- 92 | 93 | # Modules Testing 94 | _modules/* 95 | 96 | # phpenv local config 97 | .php-version 98 | 99 | # Jetbrains editors (PHPStorm, etc) 100 | .idea/ 101 | *.iml 102 | 103 | # Netbeans 104 | nbproject/ 105 | build/ 106 | nbbuild/ 107 | dist/ 108 | nbdist/ 109 | nbactions.xml 110 | nb-configuration.xml 111 | .nb-gradle/ 112 | 113 | # Sublime Text 114 | *.tmlanguage.cache 115 | *.tmPreferences.cache 116 | *.stTheme.cache 117 | *.sublime-workspace 118 | *.sublime-project 119 | .phpintel 120 | /api/ 121 | 122 | # Visual Studio Code 123 | .vscode/ 124 | 125 | /results/ 126 | /phpunit*.xml 127 | /.phpunit.*.cache 128 | 129 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2019 British Columbia Institute of Technology 4 | Copyright (c) 2019-2023 CodeIgniter Foundation 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project - Appstarter Untuk CodeIgniter 4 Simple RBAC 2 | 3 | Appstarter project untuk **CodeIgniter 4 Simple RBAC Module**, baca detail module [disini](https://github.com/skuadron45/ci4adminrbac) 4 | 5 | # Siapkan Database 6 | Buat database dengan nama **ci4adminlte** 7 | 8 | konfigurasi ada di **app/Config/Database.php**, silahkan ubah sesuai kebutuhan. 9 | 10 | # Cara Install 11 | ## Manual 12 | 1. Download Zip 13 | 2. Ekstrak zip file ke path direktori yang diinginkan. (htdocs for xampp or www for laragon) 14 | 3. Buka CMD/Shell, cd ke lokasi folder tujuan pada poin 2. 15 | 4. Lakukan perintah: 16 | ``` 17 | composer update --no-dev 18 | ``` 19 | 20 | ## Clone Git 21 | 1. Buka CMD/Shell, CD path direktori yang diinginkan. (htdocs for xampp or www for laragon) 22 | 2. Lakukan perintah: 23 | ``` 24 | git -clone https://github.com/skuadron45/ci4adminlte 25 | ``` 26 | 3. Lakukan perintah: 27 | ``` 28 | composer update --no-dev 29 | ``` 30 | 31 | Untuk menjalankan aplikasi, silahkan baca **User Guide CI4** [di sini](https://codeigniter4.github.io/userguide/installation/running.html) 32 | 33 | # Spak Command Untuk Instalasi Modul 34 | ``` 35 | php spark ci4adminrbac:install 36 | ``` 37 | 38 | ## User login: 39 | 40 | Akses URL : [Base_URL sesuai config]/admin 41 | 42 | example: 43 | 44 | http://localhost:8080/admin -> bila menggunakan spark serve 45 | 46 | http://ci4adminlte.test/admin -> bila menggunakan virtual host (XAMPP/Laragon) 47 | 48 | 49 | **Administrator:** 50 | 51 | username: rika 52 | 53 | password: rika 54 | 55 | Home module : Profile 56 | 57 | username: zahid 58 | 59 | password: zahid 60 | 61 | Home module : Dashboard 62 | 63 | *Hak Akses saya buat tidak dapat melakukan Add, Edit, Delete 64 | 65 | **Super Admin:** 66 | 67 | username: root 68 | 69 | password: root 70 | 71 | Semoga bermanfaat, 72 | 73 | Github: 74 | 75 | https://github.com/skuadron45/ci4adminlte 76 | 77 | *(Password root hanya berlaku di localhost) 78 | 79 | # Login Form 80 | ![capture1](https://raw.githubusercontent.com/skuadron45/ci4adminlte/master/capture1.png) 81 | 82 | # User Permission 83 | ![capture2](https://raw.githubusercontent.com/skuadron45/ci4adminlte/master/capture2.png) -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /app/Common.php: -------------------------------------------------------------------------------- 1 | 31 | */ 32 | public array $allowedHostnames = []; 33 | 34 | /** 35 | * -------------------------------------------------------------------------- 36 | * Index File 37 | * -------------------------------------------------------------------------- 38 | * 39 | * Typically this will be your index.php file, unless you've renamed it to 40 | * something else. If you are using mod_rewrite to remove the page set this 41 | * variable so that it is blank. 42 | */ 43 | public string $indexPage = ''; 44 | 45 | /** 46 | * -------------------------------------------------------------------------- 47 | * URI PROTOCOL 48 | * -------------------------------------------------------------------------- 49 | * 50 | * This item determines which server global should be used to retrieve the 51 | * URI string. The default setting of 'REQUEST_URI' works for most servers. 52 | * If your links do not seem to work, try one of the other delicious flavors: 53 | * 54 | * 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] 55 | * 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] 56 | * 'PATH_INFO' Uses $_SERVER['PATH_INFO'] 57 | * 58 | * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! 59 | */ 60 | public string $uriProtocol = 'REQUEST_URI'; 61 | 62 | /** 63 | * -------------------------------------------------------------------------- 64 | * Default Locale 65 | * -------------------------------------------------------------------------- 66 | * 67 | * The Locale roughly represents the language and location that your visitor 68 | * is viewing the site from. It affects the language strings and other 69 | * strings (like currency markers, numbers, etc), that your program 70 | * should run under for this request. 71 | */ 72 | public string $defaultLocale = 'en'; 73 | 74 | /** 75 | * -------------------------------------------------------------------------- 76 | * Negotiate Locale 77 | * -------------------------------------------------------------------------- 78 | * 79 | * If true, the current Request object will automatically determine the 80 | * language to use based on the value of the Accept-Language header. 81 | * 82 | * If false, no automatic detection will be performed. 83 | */ 84 | public bool $negotiateLocale = false; 85 | 86 | /** 87 | * -------------------------------------------------------------------------- 88 | * Supported Locales 89 | * -------------------------------------------------------------------------- 90 | * 91 | * If $negotiateLocale is true, this array lists the locales supported 92 | * by the application in descending order of priority. If no match is 93 | * found, the first locale will be used. 94 | * 95 | * IncomingRequest::setLocale() also uses this list. 96 | * 97 | * @var string[] 98 | */ 99 | public array $supportedLocales = ['en']; 100 | 101 | /** 102 | * -------------------------------------------------------------------------- 103 | * Application Timezone 104 | * -------------------------------------------------------------------------- 105 | * 106 | * The default timezone that will be used in your application to display 107 | * dates with the date helper, and can be retrieved through app_timezone() 108 | * 109 | * @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP. 110 | */ 111 | public string $appTimezone = 'UTC'; 112 | 113 | /** 114 | * -------------------------------------------------------------------------- 115 | * Default Character Set 116 | * -------------------------------------------------------------------------- 117 | * 118 | * This determines which character set is used by default in various methods 119 | * that require a character set to be provided. 120 | * 121 | * @see http://php.net/htmlspecialchars for a list of supported charsets. 122 | */ 123 | public string $charset = 'UTF-8'; 124 | 125 | /** 126 | * -------------------------------------------------------------------------- 127 | * Force Global Secure Requests 128 | * -------------------------------------------------------------------------- 129 | * 130 | * If true, this will force every request made to this application to be 131 | * made via a secure connection (HTTPS). If the incoming request is not 132 | * secure, the user will be redirected to a secure version of the page 133 | * and the HTTP Strict Transport Security header will be set. 134 | */ 135 | public bool $forceGlobalSecureRequests = false; 136 | 137 | /** 138 | * -------------------------------------------------------------------------- 139 | * Reverse Proxy IPs 140 | * -------------------------------------------------------------------------- 141 | * 142 | * If your server is behind a reverse proxy, you must whitelist the proxy 143 | * IP addresses from which CodeIgniter should trust headers such as 144 | * X-Forwarded-For or Client-IP in order to properly identify 145 | * the visitor's IP address. 146 | * 147 | * You need to set a proxy IP address or IP address with subnets and 148 | * the HTTP header for the client IP address. 149 | * 150 | * Here are some examples: 151 | * [ 152 | * '10.0.1.200' => 'X-Forwarded-For', 153 | * '192.168.5.0/24' => 'X-Real-IP', 154 | * ] 155 | * 156 | * @var array 157 | */ 158 | public array $proxyIPs = []; 159 | 160 | /** 161 | * -------------------------------------------------------------------------- 162 | * Content Security Policy 163 | * -------------------------------------------------------------------------- 164 | * 165 | * Enables the Response's Content Secure Policy to restrict the sources that 166 | * can be used for images, scripts, CSS files, audio, video, etc. If enabled, 167 | * the Response object will populate default values for the policy from the 168 | * `ContentSecurityPolicy.php` file. Controllers can always add to those 169 | * restrictions at run time. 170 | * 171 | * For a better understanding of CSP, see these documents: 172 | * 173 | * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/ 174 | * @see http://www.w3.org/TR/CSP/ 175 | */ 176 | public bool $CSPEnabled = false; 177 | } 178 | -------------------------------------------------------------------------------- /app/Config/Autoload.php: -------------------------------------------------------------------------------- 1 | SYSTEMPATH, 41 | * 'App' => APPPATH 42 | * ]; 43 | * 44 | * @var array|string> 45 | */ 46 | public $psr4 = [ 47 | APP_NAMESPACE => APPPATH, // For custom app namespace 48 | 'Config' => APPPATH . 'Config', 49 | ]; 50 | 51 | /** 52 | * ------------------------------------------------------------------- 53 | * Class Map 54 | * ------------------------------------------------------------------- 55 | * The class map provides a map of class names and their exact 56 | * location on the drive. Classes loaded in this manner will have 57 | * slightly faster performance because they will not have to be 58 | * searched for within one or more directories as they would if they 59 | * were being autoloaded through a namespace. 60 | * 61 | * Prototype: 62 | * $classmap = [ 63 | * 'MyClass' => '/path/to/class/file.php' 64 | * ]; 65 | * 66 | * @var array 67 | */ 68 | public $classmap = []; 69 | 70 | /** 71 | * ------------------------------------------------------------------- 72 | * Files 73 | * ------------------------------------------------------------------- 74 | * The files array provides a list of paths to __non-class__ files 75 | * that will be autoloaded. This can be useful for bootstrap operations 76 | * or for loading functions. 77 | * 78 | * Prototype: 79 | * $files = [ 80 | * '/path/to/my/file.php', 81 | * ]; 82 | * 83 | * @var list 84 | */ 85 | public $files = []; 86 | 87 | /** 88 | * ------------------------------------------------------------------- 89 | * Helpers 90 | * ------------------------------------------------------------------- 91 | * Prototype: 92 | * $helpers = [ 93 | * 'form', 94 | * ]; 95 | * 96 | * @var list 97 | */ 98 | public $helpers = []; 99 | } 100 | -------------------------------------------------------------------------------- /app/Config/Boot/development.php: -------------------------------------------------------------------------------- 1 | 112 | */ 113 | public array $file = [ 114 | 'storePath' => WRITEPATH . 'cache/', 115 | 'mode' => 0640, 116 | ]; 117 | 118 | /** 119 | * ------------------------------------------------------------------------- 120 | * Memcached settings 121 | * ------------------------------------------------------------------------- 122 | * Your Memcached servers can be specified below, if you are using 123 | * the Memcached drivers. 124 | * 125 | * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached 126 | * 127 | * @var array 128 | */ 129 | public array $memcached = [ 130 | 'host' => '127.0.0.1', 131 | 'port' => 11211, 132 | 'weight' => 1, 133 | 'raw' => false, 134 | ]; 135 | 136 | /** 137 | * ------------------------------------------------------------------------- 138 | * Redis settings 139 | * ------------------------------------------------------------------------- 140 | * Your Redis server can be specified below, if you are using 141 | * the Redis or Predis drivers. 142 | * 143 | * @var array 144 | */ 145 | public array $redis = [ 146 | 'host' => '127.0.0.1', 147 | 'password' => null, 148 | 'port' => 6379, 149 | 'timeout' => 0, 150 | 'database' => 0, 151 | ]; 152 | 153 | /** 154 | * -------------------------------------------------------------------------- 155 | * Available Cache Handlers 156 | * -------------------------------------------------------------------------- 157 | * 158 | * This is an array of cache engine alias' and class names. Only engines 159 | * that are listed here are allowed to be used. 160 | * 161 | * @var array> 162 | */ 163 | public array $validHandlers = [ 164 | 'dummy' => DummyHandler::class, 165 | 'file' => FileHandler::class, 166 | 'memcached' => MemcachedHandler::class, 167 | 'predis' => PredisHandler::class, 168 | 'redis' => RedisHandler::class, 169 | 'wincache' => WincacheHandler::class, 170 | ]; 171 | } 172 | -------------------------------------------------------------------------------- /app/Config/Constants.php: -------------------------------------------------------------------------------- 1 | ` element. 75 | * 76 | * Will default to self if not overridden 77 | * 78 | * @var string|string[]|null 79 | */ 80 | public $baseURI; 81 | 82 | /** 83 | * Lists the URLs for workers and embedded frame contents 84 | * 85 | * @var string|string[] 86 | */ 87 | public $childSrc = 'self'; 88 | 89 | /** 90 | * Limits the origins that you can connect to (via XHR, 91 | * WebSockets, and EventSource). 92 | * 93 | * @var string|string[] 94 | */ 95 | public $connectSrc = 'self'; 96 | 97 | /** 98 | * Specifies the origins that can serve web fonts. 99 | * 100 | * @var string|string[] 101 | */ 102 | public $fontSrc; 103 | 104 | /** 105 | * Lists valid endpoints for submission from `
` tags. 106 | * 107 | * @var string|string[] 108 | */ 109 | public $formAction = 'self'; 110 | 111 | /** 112 | * Specifies the sources that can embed the current page. 113 | * This directive applies to ``, `