We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11041
    • 82 Posts
    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.
      • 3749
      • 24,544 Posts
      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?).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28042 ☆ 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
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 10449
          • 956 Posts
          MODx being MODx, there’s always more than one way to swing a cat smiley

          It would be interesting to know how these invoices (PDFs) are being generated. By another web-based script on the same server? An off-the-shelf e-commerce script, or a custom PHP script? How is it integrated into MODx at this stage? Foxycart, TreasureChest?

          If you’re using a desktop program and generate the PDFs there, and manually upload the invoices via FTP, it’s a completely different scenario. I guess the invoices are generated on the fly from data stored in mySQL.

          MODx is certainly up to the job, but I guess a bit more infos would be necessary to suggest an "ideal" method for this.
            • 34017
            • 898 Posts
            It’s a pretty interesting idea. I like it.
              Chuck the Trukk
              ProWebscape.com :: Nashville-WebDesign.com
              - - - - - - - -
              What are TV's? Here's some info below.
              http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
              http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
              • 7231
              • 4,205 Posts
              A project management method in MODx would be cool. I have toyed with it but have not had the time.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 11041
                • 82 Posts
                Many thanks to everyone that has replied.

                Every suggestion is being taken on board, as feedback is important after all.

                But to answer a couple of questions asked;

                Quote from: ganeshXL at Jan 21, 2009, 03:43 PM

                It would be interesting to know how these invoices (PDFs) are being generated. By another web-based script on the same server? An off-the-shelf e-commerce script, or a custom PHP script? How is it integrated into MODx at this stage? Foxycart, TreasureChest?

                If you’re using a desktop program and generate the PDFs there, and manually upload the invoices via FTP, it’s a completely different scenario. I guess the invoices are generated on the fly from data stored in mySQL.

                The invoices, quotes and reports are all generated from Microsoft Word, and Excel respectively. I mean I use save as PDF, but occassionally import it into Adobe. After this then the invoices would ideally be uploaded as records are being created by an inline upload mechanism.

                I have been speaking to someone about this today and a few things were raised, discussed and so forth. If permitted at a later stage im sure I will be able to supply an update, but for the moment I cannot say anything for sure or if (if at all) this would lead anywhere.

                Many thanks,

                Tom.
                  • 20400
                  • 37 Posts
                  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.