glow Posted February 10, 2008 Share Posted February 10, 2008 I was wondering if this is possible with either javascript or php or a combination of both. Let me explain my setup first I have users that register to my web site through two subscription plans: Basic and Premium. Basic users are allowed to access basic membership folders only, while premium users are allowed access to all folders right now I have it set up that both membership levels can view the folder structure but are password prompted if they try to access the area id like to make it so users are only able to physically view the folders that they can access by membership. in other words I just don't want their access blocked to folders that they are not allowed to, I also want those folders not to be visible. the folder structure and content its set by an xml file and the user folder access permission is controlled by .htpass and .htaccess doc. is this doable? Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/ Share on other sites More sharing options...
cooldude832 Posted February 10, 2008 Share Posted February 10, 2008 What is in these folders, what strucutre is to them. MySQL controlling the flow of content might be better with the help of php Javascript isn't going to help you here Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462937 Share on other sites More sharing options...
laffin Posted February 10, 2008 Share Posted February 10, 2008 well he has the structures already in an xml content, so it can be done with just php alone, with extensions to read/parse the xml files. a lot more work. Easier as cooldude states, using MySQL to control the directory structure, with a flag which can be used, what's the lowest class that can access the node, or which class this node belongs to. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462942 Share on other sites More sharing options...
glow Posted February 10, 2008 Author Share Posted February 10, 2008 thanks for the quick answer guys. cooldude832 the folders have images in them and they are are managed by xml and displayed in a flash gallery using php as server side. the xml functionality is part of the gallery script i don't know if omitting it to replace with Mysql would cause problems or would the xml work along side mysql to do the job? right now the gallery works with mysql but mysql just handles user registration. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462952 Share on other sites More sharing options...
laffin Posted February 10, 2008 Share Posted February 10, 2008 Than ya want to keep the existing XML files. How do u update the xml files? is this manual or do u have a system that keeps them updated. if it's xml based, i take it theres more info than just the filename. how are users authenticated, do u have a db? or is it a generic password for all members in a group? u will have to consider, the current methods of the system. and how much ya willing to bend from those methods. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462955 Share on other sites More sharing options...
glow Posted February 10, 2008 Author Share Posted February 10, 2008 Yes I do update the xml file manually there is no auto system in place. the XMl file has a very basic structure, it looks like this. <key caption="RealEstate"> <entry name="realestate1" added="07-07-2004" src="RealEstate" /> <entry name="realestate2" added="07-07-2004" src="RealEstate" /> </key> and yes the users are each authenticated through db. gathering from this information would you say that this would be very complicated to achieve? or something that can maybe be achieved through .htaccess maybe? Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462970 Share on other sites More sharing options...
cooldude832 Posted February 10, 2008 Share Posted February 10, 2008 To be honest I see xml as only a mudding of your work and I'd prefer all php/mysql driven so if you want to amend your system I am no help. If you want to rework to php/mysql I'd say you save yourself a ton in the long run Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462973 Share on other sites More sharing options...
glow Posted February 10, 2008 Author Share Posted February 10, 2008 XML is part of the script so i don't know if switching to mysql will affect it. I'd t hate to pay to have it switched only to find later that it crippled the script. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462991 Share on other sites More sharing options...
cooldude832 Posted February 10, 2008 Share Posted February 10, 2008 I see xml as a presentation to export language meaning data sent to xml should be used for viewing on another server or server server interaction etc. Its not really a databasing language as is how u are using it. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-462998 Share on other sites More sharing options...
laffin Posted February 10, 2008 Share Posted February 10, 2008 keep the xml format for use by yer flash proggie construct a php/mysql system, which can autoupdate the db the creation of xml files is not hard to do for php. this can be done dynamicly (reading from the db) or a more fluid way, when u make updates (say on an upload form) which updates the db and the xml file it's not hard at all Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-463003 Share on other sites More sharing options...
glow Posted February 10, 2008 Author Share Posted February 10, 2008 thanks laffin. I will do just that. just need to find the time. thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-463005 Share on other sites More sharing options...
resago Posted February 10, 2008 Share Posted February 10, 2008 you could also use a script in conjunction with rewrite rule to check membership and display 403 or something if they don't qualify. Quote Link to comment https://forums.phpfreaks.com/topic/90288-is-this-possible/#findComment-463022 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.