Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration process? #10

Open
mediaramaadmin opened this issue Jun 8, 2013 · 8 comments
Open

Registration process? #10

mediaramaadmin opened this issue Jun 8, 2013 · 8 comments

Comments

@mediaramaadmin
Copy link

Hi,

Maybe its me but the registration process does not seem to validate.

I have tried and tested on at least 3 times from clean install.

If i click register with empty form i get success but no DB entry occurs so that's good

If i register and then use same details i get success but no DB entry occurs so that's good

But i really should get - that user exists or that email exists right?

Has anyone else encountered this?

great script btw.

John

@desynergy
Copy link

I'm having the same problem.
Registering the first user went fine, but after that...
Enter nothing in any of the fields, the message says it was successful, nothing added to DB.
Enter everything in all of the fields, the message says it was successful, nothing added to DB, no validation email sent.

@letens
Copy link

letens commented Jun 15, 2013

I had exactly the same problem but found the error, below you can see the solution:

status) { if($user->username_taken) $errors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username)); if($user->email_taken) $errors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email)); } else { //Attempt to add the user to the database, carry out finishing tasks like emailing the user (if required) if(!$user->userPieAddUser()) { if($user->mail_failure) $errors[] = lang("MAIL_ERROR"); if($user->sql_failure) $errors[] = lang("SQL_ERROR"); } } } if(count($errors) == 0) { if($emailActivation) { $message = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE2"); } else { $message = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE1"); } } } ``` ?> <title>Registration | </title>

Sign Up

    <?php
        if(!empty($_POST))
        {
            if(count($errors) > 0)
            {
        ?>
            <div id="errors">
            <?php errorBlock($errors); ?>
            </div>     
  <?php } else { ?> 
        <div id="success">

           <p><?php echo $message ?></p>

        </div>
    <? } }?>            



        <div id="regbox">
            <form name="newUser" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">

            <p>
                <label>Username:</label>
                <input type="text" name="username" />
            </p>

            <p>
                <label>Password:</label>
                <input type="password" name="password" />
            </p>

            <p>
                <label>Re-type Password:</label>
                <input type="password" name="passwordc" />
            </p>

            <p>
                <label>Email:</label>
                <input type="text" name="email" />
            </p>

  </div>           
  </div>
            </form>
        </div>

        <div class="clear"></div>
        <p style="margin-top:30px; text-align:center;"><a href="login.php">Login</a> / <a href="forgot-password.php">Forgot Password?</a> / <a href="<?php echo $websiteUrl; ?>">Home Page</a></p>

@Markol77
Copy link

Hi Letens,

It's difficult to see the code you have changed from your comment. Did you just change one line or many?

Mark

@letens
Copy link

letens commented Jun 28, 2013

more as one, I'm back next week, I'll check it then.

Regards,

Bob

Op Fri, 28 Jun 2013 15:45:09 +0200 schreef Markol77
notifications@github.com:

Hi Letens,

It's difficult to see the code you have changed from your comment. Did
you just change one line or many?

Mark


Reply to this email directly or view it on GitHub.

Bob Letens

+32 486 24 07 54
letens.be - picsawall.com - mobiyotta.com

@younglepitre
Copy link

Hi Markol77,

I took a look inside the code and I figured out what was the changes (just copy everything to your register.php page, it should work fine). Essentially, he moved if(count($errors) == 0) that was in the first PHP section and modify it.

status) { if($user->username_taken) $errors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username)); if($user->email_taken) $errors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email)); } else { //Attempt to add the user to the database, carry out finishing tasks like emailing the user (if required) if(!$user->userPieAddUser()) { if($user->mail_failure) $errors[] = lang("MAIL_ERROR"); if($user->sql_failure) $errors[] = lang("SQL_ERROR"); } } } if(count($errors) == 0) { if($emailActivation) { $message = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE2"); } else { $message = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE1"); } } } ``` ?> <title>Registration | </title>

Sign Up

    <div id="success">

       <p><?php echo $message ?></p>

    </div>

        <div id="regbox">
            <form name="newUser" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">

            <p>
                <label>Username:</label>
                <input type="text" name="username" />
            </p>

            <p>
                <label>Password:</label>
                <input type="password" name="password" />
            </p>

            <p>
                <label>Re-type Password:</label>
                <input type="password" name="passwordc" />
            </p>

            <p>
                <label>Email:</label>
                <input type="text" name="email" />
            </p>

  </div>           
  </div>
            </form>
        </div>

        <div class="clear"></div>
        <p style="margin-top:30px; text-align:center;"><a href="login.php">Login</a> / <a href="forgot-password.php">Forgot Password?</a> / <a href="<?php echo $websiteUrl; ?>">Home Page</a></p>

@booruguru
Copy link
Owner

Sorry for the late reply, I've been busy with other projects.

Kudos to "etiennelepagel" and "letens" for providing a fix. I have updated the script and it appears to be working correctly. However, I'm baffled as to why the script stopped functioning after working perfectly fine. I don't think I changed anything that would affect the register.php, yet it was broken after working perfectly fine. Strange.

Also, if you take the time to create a patch for a bug, please commit the code to the codebase so I can quickly inspect and update the relevant files.

For example, the "register.php" file can be updated via web browser using the link below:
https://github.com/booruguru/UserPie/blob/master/register.php

Please let me know if there are any further issues.

@Markol77
Copy link

Thank you all for taking the time to fix this.

Mark

@wastubbs
Copy link

Kudos, all!

Now that this is working I'm tempted to retread the project I had intended to use this with, even though it's live in production & perfectly functional, this script would certainly allow me to make simpler and more elegant..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants