A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Intercepting cancelled prompt request for secured page

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    2,467
    Hi:

    I'm using password protected files/directories (.htaccess/.htpassword). If click on client login and then don't enter a password, there is a default "Autorization Required" page that appears. I've asked my host if I can customize this page, but they don't offer that ability. Moreover, it appears on my site within a frame, and doesn't look very good

    See here:

    http://www.ekigroup.com
    (click on "client login")

    Okay, so tech support indicated that I could intercept the cancelled request with Javascript, I guess for the purpose of supplying my own "Authorization Required" page. I've dabbled in Javascript a bit, but I have no idea how I might go about doing this. Does anyone have any idea???


    James
    He is risen!!!


  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    there is no way to "intercept" with javascript - once the server asks for the pass, you will see the auth dialog.
    What you could do is show a html form of yours for logging in that requests the next page from
    http://user:[email protected]/protected.html
    This way the auth dialog only shows up if visitor types in wrong pass the first time
    Better yet, use php or perl based system to control access

    Musicman

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    2,467
    "there is no way to "intercept" with javascript - once the server asks for the pass, you will see the auth dialog.

    Hi Musicman:

    Yeah, I found that out in another [javascript] forum I posted the same question in. I didn't really think it could be done. At least, I had no clue as to how it might be done, but I now realize that it is not possible.

    Anyway, someone else suggested coding custom error pages using the following tut:
    http://www.javascriptkit.com/howto/htaccess2.shtml

    Unfortunately, I don't have permission to change the .htaccess files, or to change permissions for these files. I was able to rename them, then upload my own version, but they were just overwritten to the original, so I guess I'm stuck with the default pages--I kinda link the standard password prompt, so I'm not interested in cutomizing one.

    As always, thanks for your expert advise.

    James
    He is risen!!!

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    would you be able to rewrite the htpasswd file by a php or cgi script?

    Musicman

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    2,467
    Hi Musicman:

    Ummm, I'd say, I don't know

    My host does support CGI, PERL5, and PHP4, if that's what you mean, but I still don't know how I'd rewrite these pages. I tried creating my own protected directory, instead of through my control panel, uploading my own .htaccess/.htpassword files, but, again, they are being overwritten.

    ?


    James
    He is risen!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center