Example #1
0
 $user->middle_name = htmlspecialchars($_POST['mname'], ENT_QUOTES);
 $user->password = htmlspecialchars(md5($_POST['epassword']), ENT_QUOTES);
 $user->email = htmlspecialchars($_POST['email'], ENT_QUOTES);
 $user->phone_number = htmlspecialchars($_POST['phone'], ENT_QUOTES);
 $user->date_of_registration = time();
 if ($user->password == md5('pass') || $user->password == md5('password')) {
     sleep(2);
     echo '<h4 class="alert alert-info">Information</h4>';
     echo '<hr>';
     echo 'The password you entered is too predictable. ';
     echo 'Please use the close button to close the window and change your password before you can continue. ';
     echo '<hr>';
 } else {
     $user->save();
     if ($database->affected_rows() == 1) {
         if ($user->sendVerificationMail()) {
             sleep(2);
             echo '<h4 class="alert alert-success">Success</h4>';
             echo '<hr>';
             echo "The information for user with email address <font color=#0000FF>" . $user->email . "</font> has been successfully saved.<br>";
             echo "Check your email for a verification link, if you do not find it in inbox, check your spam.<br>";
             echo "Use the close botton to go back and continue.";
             echo '<br>';
             echo '<hr>';
             echo '<a href="index.php" class="btn btn-primary">Proceed</a>';
         } else {
             sleep(2);
             echo '<h4 class="alert alert-info">Information</h4>';
             echo '<hr>';
             echo 'Your information has been successfully saved but activation mail was not sent.<br>';
             echo 'Please contact us at <span class="label label-success">support@unijos.edu.ng</span> for further enquiries';
Example #2
0
    sleep(2);
    echo '<h4 class="alert alert-error">Error</h4>';
    echo '<hr>';
    echo 'Your information does not exist in our database it may be due to the following reasons.';
    echo '<ol>';
    echo '<li>Your email and password combination is wrong.</li>';
    echo '<li>You have not created an account yet.</li>';
    echo '</ol>';
    echo '<span class="label label-success">Note:</span> Use the create account button below to create an account.';
} else {
    foreach ($user_exists as $user) {
        if ($user->mail_validation == 0) {
            // account not activated
            $user_for_mail = new User();
            $user_for_mail->email = $user->email;
            $user_for_mail->sendVerificationMail();
            sleep(2);
            echo '<h4 class="alert alert-success">Success</h4>';
            echo '<hr>';
            echo 'Your account has not been activated. Activate your account using the link sent to your email.';
            echo '<hr>';
        } else {
            $form_id = $user->form_id;
            /* no access code/pin in the personal details_table.
             * form_id is the relationship and is unique*/
            $sql_payment = "SELECT * FROM `adm_access_code` WHERE `jamb_rem_no`='" . $form_id . "' AND `reg_num`='" . $form_id . "' LIMIT 1";
            $user_payments = User::find_by_sql($sql_payment);
            if (empty($user_payments)) {
                // redirect to buy form
                $session->login($user->applicant_id);
                sleep(2);