User(s) browsing this thread: 1 Guest(s)
Web interface for controlling your music library
|
|
01-11-2009, 04:45 PM
(This post was last modified: 01-11-2009 10:19 PM by iix.)
|
|||
|
|||
|
Web interface for controlling your music library
Hi,
I am developing a web interface to mange my music library. I aim to, from my regular browser, be able to easily get an overview of my music, create custom play lists etc. ![]() I have finished up most of the things I initially have planned but I've run into one problem (or rather two problems one with the php5server and one with using sybhttpd). 1. If I use the php5server all my cgi scripts is run as user nobody. This means I have not been able to kill i.e. Gaya in order to reinitialize it. 2. If I use the sybhttpd server, my cgi's are run as root but I cannot seem to get Javascript POST to work properly. (I can correctly parse the URL but the actual data is nowhere to be found). In javascript I use the following approch: Code: function playList(){Where xmlHttp is a "XMLHttpRequest" object, mono.cgi the wrapper for controlling mono and playlist_disp the playlist I want to play (I construct the full playlist in my javascript so it is to big to only send with a GET request). To receive this I use the following php code in mono.cgi: PHP Code: $choise_get=$_REQUEST["g"];When I do like this with the php5server everything works fine (but there I have the user privileges issue) but when I use sybhttpd I can't seem to get the "$HTTP_RAW_POST_DATA" to be populated with anything. I have tried returning the values of $GLOBALS, $_SERVER, $_SESSION, $_POST, $_FILES, $_GET, $_REQUEST, $HTTP_RAW_POST_DATA, file_get_contents("php://input") and $_COOKIE. The php script is issued with #!/mnt/syb8634/server/php5-cgi at the top. So now onto my questions: 1. Is it possible to receive the contents of the POST "body" when using sybhttpd? 2. Is it possible to give some scripts the rights to execute as root, i.e. only a script to kill and re-init gaya? (incase I cannot use sybhttpd for my intentions) Also when playing around I noticed that when I start gaya as user "nobody" the resolution gets all screwed up, guess it might have to do with permissions to som of the files. All help and suggestions for ways to solve this will be greatly appreciated. EDIT: I just noticed that it seems as if my POST request ends up in the $_GET variable when I parse with php: Code: print_r($GLOBALS) Also, does anybody know if sybhttpd has some kind of error log (corresponding to /mnt/syb8634/server/php5server/error.log for the php5server)? EDIT EDIT: I found a reasonable workaround by using the php5server and let php start a telnet session towards the localhost when I want to perform actions with root privileges. (See the comments for http://se.php.net/fsockopen, search for telnet, for more info.) I will set the thread to solved but if anyone knows the answers to the original questions I'm still interested as it would be nice to skip the extra step and dependency. //Kristopher |
|||
|
01-12-2009, 05:04 PM
|
|||
|
|||
|
RE: Web interface for controlling your music library
Hi,
I'm interested in your permissions solution using telnet/fsock as I too have a permissions issue (namely using opendir on a mounted USB drive). Have you thought of building this directly on the PCH itself? I can find my way home from Sierra Leone, but I'm lost without an inside pocket. |
|||
|
01-12-2009, 06:42 PM
|
|||
|
|||
RE: Web interface for controlling your music library
(01-12-2009 05:04 PM)BigLarry Wrote: Hi, The telnet php scripts actually already run natively on the pch (the intention is that all needed should be the PCH, and a computer with a browser ofcourse, to use the app). The original telnet class can be found at http://www.dali.net.nz/Telnet.class.php.txt The only modifications I made for it to work with the telnetd deamon was to comment out unneeded login steps and to change the prompt we are expecting to get returned to us: PHP Code: public function login($username, $password) {I now see that the change to the prompt is actually quite unnecessary as you just as well could have passed the prompt you wanted to use to setPromt() after initializing the telnet object (as you notice I haven't looked to at the code in any greater depth ). To later use it in a php script you can for example do: PHP Code: #!/mnt/syb8634/server/php5-cgiThis is probably all info I can give at the moment, but, to my luck, the author of the class has been very generous with comments. //Kristopher |
|||
|
01-29-2009, 02:29 PM
|
|||
|
|||
|
RE: Web interface for controlling your music library
I'm thinkning of developing something in the same lines, I'm currious, where did you find the API, that is the protocol or description of what command can be used over Telnet?
//Linus |
|||
|
01-29-2009, 05:53 PM
|
|||
|
|||
RE: Web interface for controlling your music library
(01-29-2009 02:29 PM)linen Wrote: I'm thinkning of developing something in the same lines, I'm currious, where did you find the API, that is the protocol or description of what command can be used over Telnet? I have no good guide of where to find a description of what can be done over telnet. Most of the things I've found by searching here on the forum. The rest is trial and error. Sorry if that does not help much... //K |
|||
|
« Next Oldest | Next Newest »
|

Twitter
Facebook
NMT Wiki
Search
Member List
Help
A-400 [13 May 2013]

Web interface for controlling your music library


![[Image: screenshothd6.th.png]](http://img266.imageshack.us/img266/668/screenshothd6.th.png)

![[+]](images/collapse_collapsed.gif)

).