Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions assets/wterm.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,16 @@
e.preventDefault();
e.stopPropagation();

var value = input.attr('value');
var value = input.val();

if (settings.HISTORY) {
if (history.length > settings.HISTORY_ENTRIES) history.shift();
history.push(value);
}

// Reset The Input
input.attr('value', '');
// input.attr('value', '');
input.val('');
var tokens = value.split(/\s+/);
var key = tokens[0];

Expand Down
25 changes: 10 additions & 15 deletions readme_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand All @@ -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',
Expand All @@ -73,7 +71,7 @@ the following URLs in your application configuration in order to access web shel
),
)
)
~~~
```

You can then access web shell via:

Expand All @@ -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.'),
Expand All @@ -110,34 +107,32 @@ 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)".

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.
// In this example it's valid for PHP 5.3.
'checkAccessCallback' => function($controller, $action){
return !Yii::app()->user->isGuest;
}
~~~
```


Special thanks
Expand Down