Exemple #1
0
                            // Leave the 'email' and 'password' blank. These will be filled after
                            // the user activates their account
                            $values['email'] = '';
                            $values['password'] = '';
                            $values['created'] = $values['lastaccess'] = NOW;
                            $values['createdipaddress'] = $values['lastaccessipaddress'] = $_SERVER['REMOTE_ADDR'];
                            // When the account is activated, these will be moved to 'password' and
                            // 'email', respectively.
                            $values['newpassword'] = md5($values['password']);
                            $values['newemail'] = $values['email'];
                            $values['activationkey'] = generate_random_string($config['activation']['keyLength']);
                            $values['activated'] = 0;
                            $values['token'] = '';
                            $values['tokendate'] = 0;
                            // Insert the player into the database
                            $data['insertid'] = $dl->Player_Insert($values);
                            if ($data['insertid'] !== false) {
                                // Generate the nice welcome email for the user.
                                $email = 'Welcome to the BZFlag community! Your new account has been created.
Please keep this email for your records. Your account information is as follows:

Username: '******'username'] . '
Password: '******'password'] . '

Before you begin, you need to activate your account. Please follow the link below:
<a href="http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?action=CONFIRM&username='******'username']) . '&activationkey=' . urlencode($values['activationkey']) . '">http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?action=CONFIRM&username='******'username']) . '&activationkey=' . urlencode($values['activationkey']) . '</a>

If the above link does not work, copy and paste the following URL into your address bar:
http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?action=CONFIRM&username='******'username']) . '&activationkey=' . urlencode($values['activationkey']) . '