From 9ddb08d837bbe151cc14eee2ace8f8e6fcb00443 Mon Sep 17 00:00:00 2001 From: Atuxe Date: Wed, 20 Jan 2016 11:05:54 +0800 Subject: [PATCH 1/3] chang the code mark in readme file --- readme_en.txt | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/readme_en.txt b/readme_en.txt index 166b179..301204e 100644 --- a/readme_en.txt +++ b/readme_en.txt @@ -15,8 +15,7 @@ Installing To use web shell, you must include it as a module in the application configuration like the following: -~~~ -[php] +```php return array( … 'modules'=>array( @@ -50,7 +49,7 @@ return array( ), ), ) -~~~ +``` With the above configuration, you will be able to access web shell in your browser using the following URL: @@ -60,8 +59,7 @@ http://localhost/path/to/index.php?r=webshell If your application is using path-format URLs with some customized URL rules, you may need to add the following URLs in your application configuration in order to access web shell module: -~~~ -[php] +```php 'components'=>array( 'urlManager'=>array( 'urlFormat'=>'path', @@ -73,7 +71,7 @@ the following URLs in your application configuration in order to access web shel ), ) ) -~~~ +``` You can then access web shell via: @@ -86,8 +84,7 @@ You can add both shell commands and yiic commands. Shell commands are configured via commands property of `WebShellModule`: -~~~ -[php] +```php 'commands' => array( // js callback as a command 'test' => array('js:function(tokens){return "Hello, world!";}', 'Just a test.'), @@ -110,17 +107,16 @@ Shell commands are configured via commands property of `WebShellModule`: 'Advanced command.', ), ), -~~~ +``` Callback for a shell command should look like this: -~~~ -[php] +```php function actionMyCommandHandler(){ $tokens = explode(" ", $_GET['tokens']); print_r($tokens); } -~~~ +``` To learn about creating custom yiic commands you can read "[Console Applications](http://www.yiiframework.com/doc/guide/topics.console)". @@ -128,8 +124,7 @@ Security -------- There are two module settings that will help you to keep web console secure: -~~~ -[php] +```php // Allowed IPs, localhost by default. Set to false to allow all IPs. 'ipFilters' => array('127.0.0.1','::1'), // Valid PHP callback that returns if user should be allowed to use web shell. @@ -137,7 +132,7 @@ There are two module settings that will help you to keep web console secure: 'checkAccessCallback' => function($controller, $action){ return !Yii::app()->user->isGuest; } -~~~ +``` Special thanks From ef67ad977be9217aed890a4e7da3046f0b27155e Mon Sep 17 00:00:00 2001 From: Atuxe Date: Wed, 20 Jan 2016 11:19:45 +0800 Subject: [PATCH 2/3] fix wterm.jquery.js --- assets/wterm.jquery.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/wterm.jquery.js b/assets/wterm.jquery.js index 469faad..113565d 100644 --- a/assets/wterm.jquery.js +++ b/assets/wterm.jquery.js @@ -256,7 +256,8 @@ e.preventDefault(); e.stopPropagation(); - var value = input.attr('value'); + // var value = input.attr('value'); + var value = input.val(); if (settings.HISTORY) { if (history.length > settings.HISTORY_ENTRIES) history.shift(); @@ -264,7 +265,8 @@ } // Reset The Input - input.attr('value', ''); + // input.attr('value', ''); + input.val(''); var tokens = value.split(/\s+/); var key = tokens[0]; From 7ae8747de3c5d3ecade35c56a1527ed74061ab7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C4=99dziocha?= Date: Fri, 4 Aug 2017 15:00:59 +0200 Subject: [PATCH 3/3] Update wterm.jquery.js --- assets/wterm.jquery.js | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/wterm.jquery.js b/assets/wterm.jquery.js index 113565d..ad91871 100644 --- a/assets/wterm.jquery.js +++ b/assets/wterm.jquery.js @@ -256,7 +256,6 @@ e.preventDefault(); e.stopPropagation(); - // var value = input.attr('value'); var value = input.val(); if (settings.HISTORY) {