Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function step2()
- {
- if($this->session->userdata('type') != 1){
- redirect('Devolucion/index');
- }
- if($this->session->userdata('step2') ===true){
- redirect('Devolucion/step3');
- }
- echo 'esto es= '.$this->session->userdata('server');
- $data['error'] = '';
- $this->form_validation->set_rules('usuario_old','usuario_old','required|max_length[12]|alpha_numeric');
- $this->form_validation->set_rules('password_old','password_old','required|max_length[12]|alpha_numeric');
- $this->form_validation->set_rules('email_old','email_old','required|max_length[50]|valid_email');
- $this->form_validation->set_rules('character','character','required|max_length[12]|alpha_numeric');
- if($this->form_validation->run() === true){
- // guardamos el servidor antes de comenzar las validaciones de datos para poder designar a cual base de datos nos conectaremos en el modelo de datos.
- $_SESSION['server'] = (int) $this->server;
- if($this->input->post('accion') === 'step2'){
- if($this->Devolucion_model->valDatos($this->user_old,$this->pass_old,$this->email_old)){
- if($this->checKExistsChar($this->user_old,$this->char_old)=== true){
- $rows =$this->Devolucion_model->getMailValidate($this->user_old,'2');
- if($rows['mail_validate'] == '1' && $rows['mail_validate']!= null ){
- $_SESSION['step2'] = (bool) true;
- $_SESSION['emailOld'] = (string) $this->email_old;
- $_SESSION['userOld'] = (string) $this->user_old;
- $_SESSION['server'] = (int) $this->server;
- redirect('devolucion/step4');
- }else{
- $key = strtoupper(bin2hex($this->encryption->create_key(20)));
- // insertamos nueva key
- $this->Devolucion_model->updateKey($this->user_old,$key);
- // notificamos y enviamos key al email
- $this->notificar($this->user_old,$this->email_old,$key);
- $_SESSION['step2'] = (bool) true;
- $_SESSION['emailOld'] = (string) $this->email_old;
- $_SESSION['userOld'] = (string) $this->user_old;
- $_SESSION['server'] = (int) $this->server;
- //redireccionamos step 3
- redirect('Devolucion/step3');
- }
- }else{
- $data['error'] = 'Personaje Inexistente';
- }
- }else{
- $data['error'] = 'Usuario,contraseña o correo incorrectos';
- //$this->load->view()
- }
- }
- }
- $data['user'] = $this->user_activate;
- $this->load->view('devoluciones/step2',$data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement