It is currently Sat May 25, 2013 4:13 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Shell Console in a web page via PHP
PostPosted: Fri Nov 19, 2010 9:20 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

I find this very useful. If I am out and about and need to do something, or check something that can only be done on the command line, with this plugin, I can just do it in any web browser; no Putty or other ssh app needed.

The program I found is called PHP Shell, and it is a released under the GPL license. Source code is at http://phpshell.sourceforge.net/.

There are some limitations due to the fact you are not actually in an open session. You can't run anything that requires user input, so you can't edit a file via vi. But it remembers what directory you are in, and you can run scripts that do not need user interaction. You can perform file operations, system commands, get system info, mount/unmount drives, and much more.

This is a mildly modified plugin I packaged for my personal use, but if I see actual interest in this, I will package it up as a PHP plugin for use by the community.

screenshot:
Attachment:
File comment: php shell
shell.jpg
shell.jpg [ 86.03 KiB | Viewed 1060 times ]

_________________
My Tonido Plugins:


Last edited by facelessuser on Sat Nov 20, 2010 11:24 am, edited 1 time in total.

Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Fri Nov 19, 2010 11:45 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7314
Location: Dallas, USA

Nice, that is real handy!


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Tue Nov 23, 2010 9:14 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Since I am waiting for the new PHP release before I release the next wiki RC, I have been messing with this PHP shell a bunch.

  • I restyled it to look like a terminal window, minus the file menu.
  • I relocated the logout button to be the window close button (also you can just type exit).
  • I added the "clear" command to wipe the output buffer.
  • I added a toggle to turn off waiting for a response (when executing commands or daemons that will take a while to finish, or never finish so the session doesn't lock up waiting for a response)
  • eliminated the setting to set columns (this was not needed, the window already stretched to fill the window, so I made the input do the same)

I plan on:
  • getting rid of the "execute" button (enter key already does the same thing).
  • Probably move the other options into a drop down file menu
  • Create a faux VI that you can launch with "vi <file>"(in webpage simple text editor)

Screenshot:
Attachment:
File comment: Php Shell Mod
phpshellmod.jpg
phpshellmod.jpg [ 110.91 KiB | Viewed 1051 times ]

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Tue Nov 23, 2010 9:23 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7314
Location: Dallas, USA

Nice progress. Btw, the latest build has the additional PHP variables you requested.


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Tue Nov 23, 2010 11:09 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Is the latest build available to the public yet? Or is it coming down the road?

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Tue Nov 23, 2010 11:39 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7314
Location: Dallas, USA

It already released ! 2.12 has those variables.


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Wed Nov 24, 2010 2:36 am 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

:lol: didn't even realize it. I assumed I still had the old PHP version. Thanks for the info.

edit: Wow. You guys added a lot of new variables. This will make things much easier.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Fri Nov 26, 2010 3:16 pm 
Super Tonidoid
Super Tonidoid
Joined: Fri Nov 26, 2010 10:09 am
Posts: 25

This is really handy, looking great. Are you releasing it any soon? I want to give it a try


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Fri Nov 26, 2010 11:47 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Sure. I am pretty much at at a decent beta level now. I haven't formally packaged it up yet, but I can do that sometime soon. It probably needs some cleaning up on the inside, but I am currently using it.

Just check back sometime in the next week. I should have something up by then.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Shell Console in a web page via PHP
PostPosted: Tue Nov 30, 2010 1:20 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Beta1 is on its way. I did a lot of work this weekend on this.

I overhauled UI elements. I am doing everything from scratch except base code which I am building upon; so all icons and and graphical elements are being done by hand which takes time. I think it is starting look a bit more polished. I need to pretty up the menus still though.

  • I redid some icons and graphical elements and created more.
  • I created my own modal dialog library to override the default so that the dialogs would match the theme: alert dialog, warning dialogs, prompt dialogs, confirm dialogs, etc. (this took much longer than I would like to admit, but I learned a lot about javascript and CSS by doing this.)
  • Created a CSS driven menu.
  • Made colors of the terminal, and title bar configurable.
  • When you double click the terminal, it will open a new window with just the terminal output text for easy copy and paste of results.
  • other stuff I may have forgotten

I have painfully tested this on most modern browsers: latest firefox, latest chrome, latest safari, and IE8.

I do not promise this will work on older browsers such as IE6, a matter of fact, I can almost guarantee it won't (at least not well)...but really, update your browser already :D.

I am shooting for the end of the week on this for an Beta release.

screenshots:
Attachment:
File comment: PHP Shell 3.0
phpshell3.0.jpg
phpshell3.0.jpg [ 19.76 KiB | Viewed 1009 times ]


Attachment:
File comment: Modal dialogs
modal.jpg
modal.jpg [ 17.02 KiB | Viewed 1009 times ]


Attachment:
File comment: Menus
menus.jpg
menus.jpg [ 22.53 KiB | Viewed 1009 times ]

_________________
My Tonido Plugins:


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: