-
Notifications
You must be signed in to change notification settings - Fork 100
Panel APIs
Terry L edited this page Aug 24, 2020
·
1 revision
- entry
- ::getRoutes
- demo
- csrf
-
return
void
The entry point of the control panel.
Example:
$panel->entry();
-
param
array
$csrfparams-
The CSRF field data. -
return
void
Create the CSRF form data for control panel. This is required for submitting data if the framework you're using has the CSRF protection.
Example:
In Laravel 6 -
Route::any('/firewall/panel/{path?}', function() {
$panel = new \Shieldon\Firewall\Panel();
$panel->csrf(['_token' => csrf_token()]);
$panel->entry();
})->where('path', '(.*)');
-
return
array
Get the list of all routes of the control panel pages.
Example:
$list = $panel::getRoutes();
var_dump($list);
/*
array(27) {
[0]=>
string(17) "ajax/changeLocale"
[1]=>
string(17) "ajax/tryMessenger"
[2]=>
string(13) "circle/filter"
[3]=>
string(11) "circle/rule"
[4]=>
string(14) "circle/session"
[5]=>
string(10) "home/index"
[6]=>
string(13) "home/overview"
[7]=>
string(12) "iptables/ip4"
[8]=>
string(18) "iptables/ip4status"
[9]=>
string(12) "iptables/ip6"
[10]=>
string(18) "iptables/ip6status"
[11]=>
string(16) "report/actionLog"
[12]=>
string(16) "report/operation"
[13]=>
string(23) "security/authentication"
[14]=>
string(22) "security/xssProtection"
[15]=>
string(13) "setting/basic"
[16]=>
string(17) "setting/exclusion"
[17]=>
string(14) "setting/export"
[18]=>
string(14) "setting/import"
[19]=>
string(17) "setting/ipManager"
[20]=>
string(17) "setting/messenger"
[21]=>
string(10) "user/login"
[22]=>
string(11) "user/logout"
[23]=>
string(9) "asset/css"
[24]=>
string(8) "asset/js"
[25]=>
string(13) "asset/favicon"
[26]=>
string(10) "asset/logo"
}
*/
-
param
string
$user-
The user name. -
param
string
$pass-
The user password. -
return
string
In demo mode, user's submit will not take effect.
Example:
echo $panel->demo();
- Author: Terry L. from Taiwan.
- Website: shieldon.io
- GitHub repository: github.com/terrylinooo/shieldon
- WordPress plugin: wordpress.org/plugins/wp-shieldon/
Docs: Laravel, Symfony, CodeIgniter, CakePHP, Yii, Zend, Slim, Fat-Free, Fuel, PHPixie