Esempio n. 1
0
 public function reset_password($user_id = '')
 {
     $current_id = $this->_getUserId($user_id);
     $this->user_model->result_model = 'object';
     $user = $this->user_model->load($current_id);
     if ($user) {
         $email = FCPATH . APPPATH . 'views/account/reset_password_' . get_lang() . '.tpl';
         send_admin_email($user->email_address, lang('Reset Password Request'), @file_get_contents($email));
         $this->addAlert(array('type' => 'info', 'message' => lang('Has sent the reset password email!')));
     }
     $this->less('account/reset_password_css');
     $this->render('account/reset_password', array('account_menus' => $this->_build_menu($user_id)));
 }
Esempio n. 2
0
function process_seasonregistration_form($smarty)
{
    global $SEASON;
    include 'database_connect.php';
    $errors = array();
    $playerid = 0;
    if (isset($_POST['firstname']) && $_POST['firstname']) {
        $fname = format_uppercase_text($_POST['firstname']);
    }
    // Required
    if (isset($_POST['lastname']) && $_POST['lastname']) {
        $lname = format_uppercase_text($_POST['lastname']);
    }
    // Required
    if (isset($_POST['addressOne']) && $_POST['addressOne']) {
        $addy1 = format_text($_POST['addressOne']);
    }
    // Required
    if (isset($_POST['addressTwo']) && $_POST['addressTwo']) {
        $addy2 = format_text($_POST['addressTwo']);
    } else {
        $addy2 = "";
    }
    if (isset($_POST['city']) && $_POST['city']) {
        $city = format_uppercase_text($_POST['city']);
    }
    //Required
    if (isset($_POST['state']) && $_POST['state']) {
        $state = format_text($_POST['state']);
    }
    //Required
    if (isset($_POST['postalCode']) && $_POST['postalCode']) {
        $postalcode = format_text($_POST['postalCode']);
    }
    //Required
    if (isset($_POST['email']) && $_POST['email']) {
        $email = format_text(strtolower($_POST['email']));
    } else {
        $email = "";
    }
    if (isset($_POST['homePhone']) && $_POST['homePhone']) {
        $homephone = format_text($_POST['homePhone']);
    } else {
        $homephone = "";
    }
    if (isset($_POST['workPhone']) && $_POST['workPhone']) {
        $workphone = format_text($_POST['workPhone']);
    } else {
        $workphone = "";
    }
    if (isset($_POST['cellPhone']) && $_POST['cellPhone']) {
        $cellphone = format_text($_POST['cellPhone']);
    } else {
        $cellphone = "";
    }
    if (isset($_POST['goalie']) && $_POST['goalie'] == "on") {
        $goalie = "Y";
    } else {
        $goalie = "N";
    }
    if (isset($_POST['defense']) && $_POST['defense'] == "on") {
        $defense = "Y";
    } else {
        $defense = "N";
    }
    if (isset($_POST['center']) && $_POST['center'] == "on") {
        $center = "Y";
    } else {
        $center = "N";
    }
    if (isset($_POST['wing']) && $_POST['wing'] == "on") {
        $wing = "Y";
    } else {
        $wing = "N";
    }
    if (isset($_POST['jerseySize']) && $_POST['jerseySize']) {
        $jerseysize = $_POST['jerseySize'];
    }
    //Required
    if (isset($_POST['jerseyNumChoiceOne']) && $_POST['jerseyNumChoiceOne'] || $_POST['jerseyNumChoiceOne'] == 0) {
        $jersey1 = $_POST['jerseyNumChoiceOne'];
    }
    //Required
    if (isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo'] || $_POST['jerseyNumChoiceTwo'] == 0) {
        $jersey2 = $_POST['jerseyNumChoiceTwo'];
    }
    //Required
    if (isset($_POST['jerseyNumChoiceThree']) && $_POST['jerseyNumChoiceThree'] || $_POST['jerseyNumChoiceThree'] == 0) {
        $jersey3 = $_POST['jerseyNumChoiceThree'];
    }
    //Required
    if (isset($_POST['travelWith']) && $_POST['travelWith']) {
        $travelwith = format_text($_POST['travelWith']);
    } else {
        $travelwith = "";
    }
    if (isset($_POST['additionalNotes']) && $_POST['additionalNotes']) {
        $additionalnotes = format_text($_POST['additionalNotes']);
    } else {
        $additionalnotes = "";
    }
    if (isset($_POST['skillLevel']) && $_POST['skillLevel']) {
        $skilllevel = $_POST['skillLevel'];
    }
    //Required
    if (isset($_POST['willSub']) && $_POST['willSub'] == "Y") {
        $willSub = 1;
        if (isset($_POST['sunSub']) && $_POST['sunSub'] == "on") {
            $sunSub = 1;
        } else {
            $sunSub = 0;
        }
        if (isset($_POST['monSub']) && $_POST['monSub'] == "on") {
            $monSub = 1;
        } else {
            $monSub = 0;
        }
        if (isset($_POST['tueSub']) && $_POST['tueSub'] == "on") {
            $tueSub = 1;
        } else {
            $tueSub = 0;
        }
        if (isset($_POST['wedSub']) && $_POST['wedSub'] == "on") {
            $wedSub = 1;
        } else {
            $wedSub = 0;
        }
        if (isset($_POST['thuSub']) && $_POST['thuSub'] == "on") {
            $thuSub = 1;
        } else {
            $thuSub = 0;
        }
        if (isset($_POST['friSub']) && $_POST['friSub'] == "on") {
            $friSub = 1;
        } else {
            $friSub = 0;
        }
        if (isset($_POST['satSub']) && $_POST['satSub'] == "on") {
            $satSub = 1;
        } else {
            $satSub = 0;
        }
    } else {
        $willSub = 0;
        $sunSub = 0;
        $monSub = 0;
        $tueSub = 0;
        $wedSub = 0;
        $thuSub = 0;
        $friSub = 0;
        $satSub = 0;
    }
    if (isset($_POST['teamRep']) && $_POST['teamRep'] == "Y") {
        $teamrep = 1;
    } else {
        $teamrep = 0;
    }
    if (isset($_POST['referee']) && $_POST['referee'] == "Y") {
        $willref = 1;
    } else {
        $willref = 0;
    }
    if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == "1") {
        $payment = 1;
    } else {
        if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == "2") {
            $payment = 2;
        } else {
            if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == "3") {
                $payment = 3;
            } else {
                if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == "4") {
                    $payment = 4;
                }
            }
        }
    }
    #Setup the positions comma separated value
    $positions = "";
    if ($goalie == "Y") {
        if ($defense == "Y" || $center == "Y" || $wing == "Y") {
            $positions .= "G, ";
        } else {
            $positions .= "G";
        }
    }
    if ($defense == "Y") {
        if ($center == "Y" || $wing == "Y") {
            $positions .= "D, ";
        } else {
            $positions .= "D";
        }
    }
    if ($center == "Y") {
        if ($wing == "Y") {
            $positions .= "C, ";
        } else {
            $positions .= "C";
        }
    }
    if ($wing == "Y") {
        $positions .= "W";
    }
    if (isset($_POST['drilLeague']) && $_POST['drilLeague']) {
        $drilLeague = $_POST['drilLeague'];
    }
    //Required
    $registrationColumns = '`seasonId`,`fName`,`lName`,`addressOne`,`addressTwo`,`city`,`state`,`postalCode`,`';
    $registrationColumns .= 'eMail`,`position`,`jerseySize`,`jerseyNumberOne`,`jerseyNumberTwo`,`jerseyNumberThree`,`';
    $registrationColumns .= 'homePhone`,`workPhone`,`cellPhone`,`skillLevel`,`wantToSub`,`subSunday`,`subMonday`,`subTuesday`,`';
    $registrationColumns .= 'subWednesday`,`subThursday`,`subFriday`,`subSaturday`,`travelingWithWho`,`wantToBeATeamRep`,`';
    $registrationColumns .= 'wantToBeARef`,`paymentPlan`,`notes`,`drilLeague`';
    $registrationInsert = 'INSERT INTO ' . REGISTRATION . ' (' . $registrationColumns . ') ';
    $registrationInsert .= 'VALUES(' . $SEASON . ',';
    $registrationInsert .= '"' . $fname . '",';
    $registrationInsert .= '"' . $lname . '",';
    $registrationInsert .= '"' . $addy1 . '",';
    $registrationInsert .= '"' . $addy2 . '",';
    $registrationInsert .= '"' . $city . '",';
    $registrationInsert .= '"' . $state . '",';
    $registrationInsert .= '"' . $postalcode . '",';
    $registrationInsert .= '"' . $email . '",';
    $registrationInsert .= '"' . $positions . '",';
    $registrationInsert .= '"' . $jerseysize . '",';
    $registrationInsert .= '' . $jersey1 . ',';
    $registrationInsert .= '' . $jersey2 . ',';
    $registrationInsert .= '' . $jersey3 . ',';
    $registrationInsert .= '"' . $homephone . '",';
    $registrationInsert .= '"' . $workphone . '",';
    $registrationInsert .= '"' . $cellphone . '",';
    $registrationInsert .= '' . $skilllevel . ',';
    $registrationInsert .= '' . $willSub . ',';
    $registrationInsert .= '' . $sunSub . ',';
    $registrationInsert .= '' . $monSub . ',';
    $registrationInsert .= '' . $tueSub . ',';
    $registrationInsert .= '' . $wedSub . ',';
    $registrationInsert .= '' . $thuSub . ',';
    $registrationInsert .= '' . $friSub . ',';
    $registrationInsert .= '' . $satSub . ',';
    $registrationInsert .= '"' . $travelwith . '",';
    $registrationInsert .= '' . $teamrep . ',';
    $registrationInsert .= '' . $willref . ',';
    $registrationInsert .= '' . $payment . ',';
    $registrationInsert .= '"' . $additionalnotes . '",';
    $registrationInsert .= '' . $drilLeague . '';
    $registrationInsert .= ')';
    $result = mysql_query($registrationInsert, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    //Notify league that there is a new league registration.
    send_admin_email();
    return $errors;
}
Esempio n. 3
0
 public function forget_password()
 {
     $this->load->library('session');
     $this->session->set_userdata('need_to_redirect_url', current_url());
     if (!isset($_POST['__nouse__'])) {
         $email = FCPATH . APPPATH . 'views/account/reset_password_' . get_lang() . '.tpl';
         send_admin_email($this->input->post('email_address'), lang('Reset Password Request'), @file_get_contents($email));
         $this->addAlert(array('type' => 'info', 'message' => lang('Send reset email successfully, please check your email!')));
     }
     $this->init_responsive();
     $this->less('home/forget_password_css');
     $this->render('home/forget_password');
 }
Esempio n. 4
0
function process_registration_form($smarty)
{
    global $Link;
    $errors = array();
    $fname = format_uppercase_text($_POST['firstname']);
    $lname = format_uppercase_text($_POST['lastname']);
    $email = format_trim(strtolower($_POST['email']));
    $pass = md5($_POST['password']);
    $verificationKey = createVerificationKey($email);
    //Check if user exists with accessLevel > 0.  If true, then we will just error out registration and explain that user exists.
    $query = 'SELECT email, accessLevel FROM ' . USER . ' WHERE email = "' . $email . '" AND accessLevel > 0';
    $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    if ($result && mysql_num_rows($result) > 0) {
        $errors[] = 'User already exists.  If you forgot your password, <a href="resetpassword.php">click here</a> to have it reset.';
        handle_errors($errors);
        handle_reposts();
    }
    if (count($errors) == 0) {
        //Check if user exists with accessLevel 0.  If true, then we will just resend validation email
        $query = 'SELECT email, accessLevel, verificationKey FROM ' . USER . ' WHERE email = "' . $email . '" AND accessLevel = 0';
        $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
        if ($result && mysql_num_rows($result) > 0 && ($row = mysql_fetch_array($result))) {
            $verificationKey = $row['verificationKey'];
            send_validation_email($email, $verificationKey);
            header("Location: pending.php");
        } else {
            // Insert new user query
            $query = "INSERT INTO " . USER . " (firstname, lastname, email, password, verificationKey) ";
            $query .= "VALUES ('{$fname}', '{$lname}', '{$email}', '{$pass}', '{$verificationKey}')";
            $result = mysql_query($query, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
            if ($result) {
                send_validation_email($email, $verificationKey);
                send_admin_email();
            } else {
                $errors[] = "No user was created.";
            }
        }
        // End of else
    }
    // if (!errors)
    return $errors;
}