WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Password Protected Form Issue (7 posts)

  1. spokhariyal
    Member
    Posted 1 year ago #

    Hello Friends,

    I have a password protected form which takes three passwords to redirect a user to a different page according what password he /she enters.

    Now the problem is if I change the passwords (Passwords are hard-coded in wp-login.php) or add new passwords. The form stops responding (submitting) with new one or changed ones but working with old ones.

    You can check at what i am saying
    http://www.aunoir.com/en/password-protected/

    filling password: aunoir redirects to page
    while filling promodor1 not fires the form
    or if i change aunoir to aunoirs even then it stops firing the form
    same code for both
    I am coding in the wp-login.php?action=postpass

    As I am new to wordpress. Any help would be appreciated.

    Thanks in advance

  2. jholder83864
    Member
    Posted 1 year ago #

    This is gonna be a hard one for us to help you solve.

    Is this something that you created, or is it a plugin or patch of somekind?

    Can you post the file on pastebin and link it here?

  3. spokhariyal
    Member
    Posted 1 year ago #

    This is a simple password protected form code in functions.php under themes folder which is used for customs forms
    In wp-login.php?action=postpass, I am checking user input with hardcoded passwords.
    if a match found , i redirects the user to that particular location.

    What i want is on password protected page , if an user enters any of predefined passwords, user should be redirected to corresponding page.

    Is there any other way of doing this than what i am doing now.
    This is the URL on which i got problem
    http://www.aunoir.com/en/password-protected/

    Thanks

  4. spokhariyal
    Member
    Posted 1 year ago #

    Any Help will be appreciated on the issue. Please Help Need to solve it ASAP.

    Thanks

  5. bcworkz
    Member
    Posted 1 year ago #

    You would need to supply the code you are using to get any help with why new or changed passwords do not work.

    I think using passwords as a navigation device is a poor idea. In addition, hard coding passwords is actually a bad idea. I don't know your reasoning for this approach. Just guessing from what you are attempting, I think you should leave the user/password system alone. Instead, you could add a field to the user form, storing the selected value in usermeta. This would be the assigned redirect destination when ever the user logs in. You can use capabilities to control whether users can select this or only admins can.

    Instead of giving users a common password based on where they should go, just add the user to the system (or they can add themselves, but they cannot login until an admin approves their signup and selects the destination). They will be emailed their password, and when they login with it, they will be redirected to the assigned page automatically.

  6. spokhariyal
    Member
    Posted 1 year ago #

    Hello bcworkz

    Thanks for your reply.

    Actually there is nothing for user's to sign up. I want a simple functionality for which my colleagues can enter the assigned password and go to respective page.

    Also I am new to wordpress so acquired this approach to hard code passwords

    Now the situation is: When I comment the wp_head(); All passwords(old or new or changed ) works well.

    But I can't comment wp_head(); as it affects some other functionality

    Any Idea from This?

  7. spokhariyal
    Member
    Posted 1 year ago #

    Done Some Changes in Theme file (functions.php and header.php and in include folders)

    upgraded wordpress to 3.5.1

    These things solved issues

    By the way Thanks to all who gave their time here.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic