Anybody know a script or method to achieve this? (authentication/access related)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim J

    #1

    Anybody know a script or method to achieve this? (authentication/access related)

    I have been trying to find some kind of authentication method or
    script (PHP/perl/javascript or other) to achieve the following, with
    no luck.

    Say there are 100 files at a site. A person can choose which file to
    download from a list, and to do so has to enter a code or password.
    When a valid code or password is used they are redirected to a page
    with a direct link to download the file.

    Once that code or password has been used to download that one file
    (and the same code/password can be used to access any one of the 100
    files), it is then expired/deleted/made invalid and can't be used
    again to download any other file.

    Does anybody know a method or script somewhere that can do this?

    Thanks.

    Jim

  • Chris Smith

    #2
    Re: Anybody know a script or method to achieve this? (authentication/access related)

    Jim J <me@privacy.net > wrote:[color=blue]
    > I have been trying to find some kind of authentication method or
    > script (PHP/perl/javascript or other) to achieve the following, with
    > no luck.[/color]

    Don't bother looking at JavaScript in traditional client-side
    environments. JavaScript can be run on a server, but it's somewhat
    rare. You're probably better off with one of the other languages.
    [color=blue]
    > Say there are 100 files at a site. A person can choose which file to
    > download from a list, and to do so has to enter a code or password.
    > When a valid code or password is used they are redirected to a page
    > with a direct link to download the file.
    >
    > Once that code or password has been used to download that one file
    > (and the same code/password can be used to access any one of the 100
    > files), it is then expired/deleted/made invalid and can't be used
    > again to download any other file.
    >
    > Does anybody know a method or script somewhere that can do this?[/color]

    This is going to require server-side code, a database (relational or
    otherwise), and some mechanism for giving out codes/passwords. It's
    also a fairly specific and unusual requirement. This is probably beyond
    anything you're going to find pre-written.

    As far as writing it, this should be fairly trivial in any server-side
    web environment. However, you haven't told us what you're having
    problems with, so help will be difficult to come by.

    --

    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation

    Comment

    • John Bokma

      #3
      Re: Anybody know a script or method to achieve this? (authentication/access related)

      Jim J wrote:
      [color=blue]
      > Once that code or password has been used to download that one file
      > (and the same code/password can be used to access any one of the 100
      > files), it is then expired/deleted/made invalid and can't be used
      > again to download any other file.[/color]

      How do you know the download went ok? I wouldn't waste to much effort in a
      copy protection scheme (that is how it sounds)

      What sounds better: give a code that makes it possible to download one file
      during 24 hrs. So, as soon as you hand out the access code, you register it
      in a database + current time. When a file link is clicked, you store the
      name of the file unless the user/password combo has already something
      assigned. If it's the same file, and within the 24hrs, allow it, otherwise
      deny.

      Every day you delete all entries that are older than 24 hrs.

      You can use 2 stamps, one for moment of user/password creation, and one for
      the first download attempt. You can do then something like: if combo older
      than 3 days, delete it. If first download attempt was more then 8 hrs ago,
      the combo no longer can be used.

      --
      John Small Perl scripts: http://johnbokma.com/perl/
      Perl programmer available: http://castleamber.com/
      Happy Customers: http://castleamber.com/testimonials.html

      Comment

      • Brian McCauley

        #4
        Re: Anybody know a script or method to achieve this? (authentication/accessrelated)



        John Bokma wrote:[color=blue]
        > Jim J wrote:
        >
        >[color=green]
        >>Once that code or password has been used to download that one file
        >>(and the same code/password can be used to access any one of the 100
        >>files), it is then expired/deleted/made invalid and can't be used
        >>again to download any other file.[/color]
        >
        >
        > How do you know the download went ok? I wouldn't waste to much effort in a
        > copy protection scheme (that is how it sounds)
        >
        > What sounds better: give a code that makes it possible to download one file
        > during 24 hrs. So, as soon as you hand out the access code, you register it
        > in a database + current time. When a file link is clicked, you store the
        > name of the file unless the user/password combo has already something
        > assigned. If it's the same file, and within the 24hrs, allow it, otherwise
        > deny.
        >
        > Every day you delete all entries that are older than 24 hrs.
        >
        > You can use 2 stamps, one for moment of user/password creation, and one for
        > the first download attempt. You can do then something like: if combo older
        > than 3 days, delete it. If first download attempt was more then 8 hrs ago,
        > the combo no longer can be used.[/color]

        I agree with everything John said. I would add that your script
        should not deilver the content directly but rather perform an
        internal redirect within the server so that the server will
        cope with restartable download properly.

        Comment

        Working...