Hi all,
I have had an idea for my site, which in my view is something I would like to have. Currently everything is in its infancy and customers are extremely few (thus the perfect time to try it maybe? ).
Basically MODx already has the ability for weblogin, so restricting access to pages within the site is easy (I think, never tried). What I am thinking of takes things that one step further. Basically I would customers to be able to log in to view their past and current, invoices, quotes, reports etc. Obviously each one in its own section. What im wanting to avoid is other customers being able to see anyone elses reports.
I am sure you already know what I mean, but take your profile on this forum as an example (in a way). Only you and the site admin have access to edit, everyone else can only view. Basically on the same sort of principle but not letting anyone else even know they exist, let alone view.
The admin (me) would log into manager, go to a specific section which can manage these details and files, chooses a user (maybe search aswell?) from a drop down list and then click on, Add new <Report, Invoice, Quote, etc>.
When opened I could put in certain details, eg Invoice amount, date due by, status (eg paid, unpaid) and then attach a file which would be uploaded to a web user specific directory (thus avoiding having to name the invoice by username or it being visable due to a bug).
At first I thought that having the file uploaded to something like /public_html/assets/module/modname/username/invoice/file.pdf would be ideal, but then it occurred to me that this is a possible breach of sensitive info, should someone accidentally find their way there. I know that I can turn off indexing of folders, but its still publicly accessible on the web.
So if possible have it uploaded to root/username/invoices/file.pdf then this is above the /public_html/ directory and not publically accessible. However the spin off is can the files specific to that user be viewed and downloaded by that user (view the PDF online)?
There is a bit more that im thinking about and debating on, but really is what ive mentioned above possible? Can anyone here dos omething like this? If so, how long would it take? How much would it be?
I have attached an image of how the user would list their files from the front end. I was meant to do an image for the manager side of things, but I got side tracked sorry.
Please do respond, or send me a private message. If you have MSN and have more questions please send me your Msn email and I will add you (I just dont want to make it publically available as im having problems with unknown users at the moment).
Many thanks.
I don’t have time to actually do anything for you but I thought I’d share some thoughts.
You might want to consider not storing any invoice documents at all. It takes up space and isn’t very flexible at all -- you can’t easily edit it, add new data, reorganize things, or generate custom reports.
Instead, you could just store the information that goes on the invoices in the database. When users request their information, you retrieve their personal info from the database and generate a report on the fly for display. That kind of system can be expanded in many ways down the road in response to customer requests (e.g. can I get a report for the third quarter of last year?).
-
☆ A M B ☆
- 24,524 Posts
I did this for client access to a database for a translation site, where the clients needed to be able to see their own translation expressions in different languages, but not anyone else’s. I pretty much documented the extjs module I created to do this.
http://www.sottwell.com/article-extjs1.html
It’s a pretty interesting idea. I like it.
A project management method in MODx would be cool. I have toyed with it but have not had the time.
I have done a similar project. Here is how I would do it on an Apache server:
- Create a password protected sub directory using .htaccess/.htpaswd.
- Create a file structure in that directory for uploading your client invoices. ie username/<filename>.pdf
- Write a script where a logged in user can read the file and echo it back to user.
You will probably need to set the header to support. Something like ’header("Content-type: application/pdf");’
php reads file using the full path name - so you can, with the right permissions, even put the files outside of the Apache base directory. The only advantage of putting them in Apache subdirectory is you can view them online if you know the password.