fix
This commit is contained in:
@@ -106,7 +106,7 @@ class Auth extends Start_Controller {
|
||||
public function resetpass() {
|
||||
$data = array();
|
||||
$out = array();
|
||||
$data["next_page"] = 0;
|
||||
$data["next_page"] = 50;
|
||||
$data["error_message"] = "";
|
||||
if ($_POST) {
|
||||
$data['username'] = trim($this->input->post('username'));
|
||||
@@ -128,4 +128,80 @@ class Auth extends Start_Controller {
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function passreset() {
|
||||
$data = array();
|
||||
$out = array();
|
||||
$data["next_page"] = 0;
|
||||
$data["error_message"] = '';
|
||||
|
||||
if ($_GET) {
|
||||
$data['reset_key'] = trim($this->input->get('rlink'));
|
||||
$data["mode"] = RESET_CONFIRM;
|
||||
if ($data['reset_key'] != '') {
|
||||
$this->coregrade_webapi(COREGRADE_START_RESET_PASSWORD, $data, $out);
|
||||
|
||||
// print_r($out);
|
||||
if (isset($out["reset_id"]) && isset($out["reset_id"]) > 0) {
|
||||
|
||||
$data["next_page"] = 5500;
|
||||
$data["reset_id"] = $out["reset_id"];
|
||||
$data["username"] = $out["username"];
|
||||
}
|
||||
} else {
|
||||
$data["error_message"] = "Please enter a valis username to continue";
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('auth/view_head');
|
||||
$this->load->view('auth/view_reset_password', $data);
|
||||
$this->load->view('auth/view_foot');
|
||||
}
|
||||
|
||||
public function completereset() {
|
||||
|
||||
$data = array();
|
||||
$out = array();
|
||||
$data["next_page"] = 5500;
|
||||
$data["error_message"] = '';
|
||||
|
||||
if ($_POST) {
|
||||
$data['reset_key'] = trim($this->input->post('rlink'));
|
||||
$data['reset_id'] = trim($this->input->post('reset_id'));
|
||||
$data['username'] = trim($this->input->post('username'));
|
||||
|
||||
$data['pass1'] = trim($this->input->post('pass1'));
|
||||
$data['pass2'] = trim($this->input->post('pass2'));
|
||||
|
||||
$allow_next = false;
|
||||
|
||||
if ( strlen($data['pass1']) >7 && $data['pass1'] == $data['pass2']){
|
||||
$allow_next = true;
|
||||
}
|
||||
else{
|
||||
$data["error_message"] = "Please enter a valis username to continue";
|
||||
}
|
||||
|
||||
|
||||
$data["mode"] = RESET_COMPLETE;
|
||||
if ($data['reset_key'] != '' && isset($out["reset_id"]) && isset($out["reset_id"]) > 0 && $allow_next == true) {
|
||||
$this->coregrade_webapi(COREGRADE_START_RESET_PASSWORD, $data, $out);
|
||||
|
||||
// print_r($out);
|
||||
if (0) {
|
||||
|
||||
$data["next_page"] = 5500;
|
||||
$data["reset_id"] = $out["reset_id"];
|
||||
$data["username"] = $out["username"];
|
||||
}
|
||||
} else {
|
||||
$data["error_message"] = "Please enter a valid username to continue";
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('auth/view_head');
|
||||
$this->load->view('auth/view_reset_password', $data);
|
||||
$this->load->view('auth/view_foot');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user