Kodi Community Forum

Full Version: MediaFrontPage - Web interface with widget type architecture to control multiple apps
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
gugahoi Wrote:I've been working on the update function and I think I've got it. But it comes at a price. A lot of permission problems happening so we might have to allow PHP to use chmod or chown somehow. Otherwise no go. The script I've made is functional but it breaks with permission problems if PHP cannot rename some files. VERY ANNOYING! I wish SleepyP had released some of his work on the ping function cause I think I could've used for this script!!!!

In the wUPS widget look at the execProgram function. Using proc_open you could execute the chmod/chown directly or a shell script. It also collects any output from the command it executes so you could process the returned information from a script.
I've just noticed my Recent Movies is not 'Recenting' anymore. It looks like it's just showing the Movies in reverse alphabetical order.

Anyone else experiencing this?
DejaVu Wrote:I've just noticed my Recent Movies is not 'Recenting' anymore. It looks like it's just showing the Movies in reverse alphabetical order.

Anyone else experiencing this?

No, mine are okay. I have an issue with this widget though, when I click a movie to see info about it, the total page jumps to top again, so I have to scroll down again to read the info. Happens in Firefox and Chromium.
gugahoi Wrote:I've been working on the update function and I think I've got it. But it comes at a price. A lot of permission problems happening so we might have to allow PHP to use chmod or chown somehow. Otherwise no go. The script I've made is functional but it breaks with permission problems if PHP cannot rename some files. VERY ANNOYING! I wish SleepyP had released some of his work on the ping function cause I think I could've used for this script!!!!

So far, this looks great.
I've managed to get it working to the point you have. It downloads the Update.zip, extracts it to the update temp directory and then fails because of the file permissions.

A bit strange I though seeing as the install step I follow still uses

Code:
chmod 777 /var/www -R

I thought that gave PHP the permsission to mess with the files (config.ini and layout.php!)


Only other thing I've noticed, the commit number no longer changes to the most current one. Because it fails?

Does PHP Chmod need activating in php.ini in order to use this atm?


Mar2zz Wrote:No, mine are okay. I have an issue with this widget though, when I click a movie to see info about it, the total page jumps to top again, so I have to scroll down again to read the info. Happens in Firefox and Chromium.
I also get this, it must need to refresh the page to show the information for some reason.
Mar2zz Wrote:No, mine are okay. I have an issue with this widget though, when I click a movie to see info about it, the total page jumps to top again, so I have to scroll down again to read the info. Happens in Firefox and Chromium.

That happens because the link is to '#'. I'm sure it can be fixed but I think almost all of the widgets have this system going on. Specially because it was intended to be a single non scrolling page where that would not be a problem.

DejaVu Wrote:So far, this looks great.
I've managed to get it working to the point you have. It downloads the Update.zip, extracts it to the update temp directory and then fails because of the file permissions.

A bit strange I though seeing as the install step I follow still uses

Code:
chmod 777 /var/www -R

I thought that gave PHP the permsission to mess with the files (config.ini and layout.php!)


Only other thing I've noticed, the commit number no longer changes to the most current one. Because it fails?

Does PHP Chmod need activating in php.ini in order to use this atm?

I'm looking into it at the moment. The commit number is not updating because I've deactivated that for now. I know how to code that bit so that's not what I'm worried about at the moment. Once I get the downloading and rearranging of files right, I will have the commit number updating.
CoinTos Wrote:In the wUPS widget look at the execProgram function. Using proc_open you could execute the chmod/chown directly or a shell script. It also collects any output from the command it executes so you could process the returned information from a script.

Any chance you could post an example here? Just to make it easier for me when I have time to sit down and code. I would be either chmoding 777 -R or chowning recursively.
Where the script is giving the result of "OLD STUFF" are you attempting to backup files into a tmp that has not been CHMOD'd?

If so, is that worth doing?

I'm trying to look at the script to see what it's attempting to do and not getting very far. lol

EDIT:
I created 2 folders manually (old & tmp) and chmod them to 777 and some of the files (in the root folder) got moved successfully. How about these folders already existing on Git cloning?
DejaVu Wrote:Where the script is giving the result of "OLD STUFF" are you attempting to backup files into a tmp that has not been CHMOD'd?

If so, is that worth doing?

I'm trying to look at the script to see what it's attempting to do and not getting very far. lol

OLD STUFF is when moving the old files. I'm trying to move everything but config.ini, layout.php, git files and update folder. We don't necessarily have to move them but deleting didn't work because of permissions too. Besides moving also gives the option of rolling back in the future if the moving of new things don't work.

Also, I think you will have to create a tmp and update directory in your MFP installation to have the script start working. I have not been able to have PHP's mkdir function to work. I've been getting very frustrated with those limitations but I will find a way to do it!
Persistence is key! lol

Is it worth creating an update folder structure like -

www/update
www/update/old
www/update/tmp

If the folders are there to keep (for future) it might be an idea to keep them altogether - which also keep the root cleaner. Wink

Just a thought.
the first time i used media front page i think this forum was no more than 10 pages, i recently installed it again, and OMG it has come such a long way. i instantly started configuring it manually, because that is what i remember and as i'm researching a bunch of the new options i saw that i don't need to do that so i undid my changes.

fantastic work to all who have made it come this far, such a great tool for XBMC!

now onto my only issue i have, when i goto the NAV bar in the setting, if i add a new item, then save, it is the only item listed and it deletes all previous items. any idea how to fix this?
gugahoi Wrote:Any chance you could post an example here? Just to make it easier for me when I have time to sit down and code. I would be either chmoding 777 -R or chowning recursively.

Here is a very primitive linux/OSX webserver example using a shell script, if it were to be implemented an OS detect would be needed so that a batch file could be called instead in windows.

What is does give an idea of what could be done outside of php using your webserver user account privileges.

Example print out:
Code:
Running Script

Making Directory: boo
Listing Directory: root
total 12
drwxr-xr-x 2 www-data www-data 4096 Aug  7 13:20 boo
-rw-r--r-- 1 www-data www-data  355 Aug  7 13:09 example.sh
-rw-r--r-- 1 www-data www-data  884 Aug  7 13:07 index.php
Change Mod Directory: boo
List Directory: root
total 12
drwxrwxrwx 2 www-data www-data 4096 Aug  7 13:20 boo
-rw-r--r-- 1 www-data www-data  355 Aug  7 13:09 example.sh
-rw-r--r-- 1 www-data www-data  884 Aug  7 13:07 index.php
Copying example.sh to directory boo
List directory: boo
total 4
-rw-r--r-- 1 www-data www-data 355 Aug  7 13:20 example.sh
Removing directory boo
Listing Directory: root
total 8
-rw-r--r-- 1 www-data www-data 355 Aug  7 13:09 example.sh
-rw-r--r-- 1 www-data www-data 884 Aug  7 13:07 index.php
All done

Download Example
I've been looking into this a little and as we all know, I'm no expert. But what is this I stumbled on? It looks like it could be an answer.

http://suphp.org

Quote:suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

It has to be installed as an Apache module (I'm guessing the same way Curl is?). If I'm honest I do not understand it much. Just someone else used it as an answer for someone else having problems with mkdir.

prophetizer Wrote:when i goto the NAV bar in the setting, if i add a new item, then save, it is the only item listed and it deletes all previous items. any idea how to fix this?

What Repo are you using - the Official?

@gugahoi.
You have a PM as I feel I'm spamming the board a lot lately! Big Grin
DejaVu Wrote:It has to be installed as an Apache module (I'm guessing the same way Curl is?). If I'm honest I do not understand it much. Just someone else used it as an answer for someone else having problems with mkdir.

Well, not to shoot this one down but you are limiting users to Apache (I personally run Lighttpd) and you really shouldn't need another users access. Basically what this package does it let php-cgi run under another username through apache. If I had the time I would help complete the update feature for gugahoi, so he could have a well deserved break. Maybe sometime Wednesday if he hasn't cracked the code I will be able to clock some time on completing it.
I can't get the Recent TV and Recent Movie widgets to download the images.

It stays empty, when I click it, it tries to load something, but nothing happens (the loading-circle keeps spinning. The link the image has is:
Code:
http://user:[email protected]:port/vfs/special://masterprofile/Thumbnails/Video/b/b3eb706f.tbn

user, pass and port are okay of course, or else it wouldn't load the recent information.
(official repo)
Mar2zz Wrote:I can't get the Recent TV and Recent Movie widgets to download the images.

It stays empty, when I click it, it tries to load something, but nothing happens (the loading-circle keeps spinning. The link the image has is:
Code:
http://user:[email protected]:port/vfs/special://masterprofile/Thumbnails/Video/b/b3eb706f.tbn

user, pass and port are okay of course, or else it wouldn't load the recent information.
(official repo)

This is because the TBN has not been generated yet.
Enter XBMC and make sure the thumbnail exists.
The other way to check is to go to the location the TBN is in your machine.

It's @ %userdata%/Thumbnails/Video/Fanart/filename.tbn

In my case - /home/xbmc/.xbmc/userdata/Thumbnails/Video/Fanart/filename.tbn