Welcome Guest, Not a member yet? Register   Sign In
Help! DX Auth, set_value vs. $this->input->post()
#1

[eluser]Deadly[/eluser]
I've installed DX Auth and everything looks good - except for the fact I cannot register a new user. I fill out the form, submit it and the page simply refreshes with no feedback. After hours of messing around with it, I discovered that, in the advanced example, if i remove the validation rules and initialization:

Code:
$val = $this->form_validation;
            
// Set form validation rules            
$val->set_rules('username', 'Username', 'trim|required|xss_clean|min_length['.$this->min_username.']|max_length['.$this->max_username.']|callback_username_check|alpha_dash');
$val->set_rules('password', 'Password', 'trim|required|xss_clean|min_length['.$this->min_password.']|max_length['.$this->max_password.']|matches[confirm_password]');
$val->set_rules('confirm_password', 'Confirm Password', 'trim|required|xss_clean');
$val->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email|callback_email_check');

and change this line:
Code:
if ($val->run() AND $this->dx_auth->register($val->set_value('username'), $val->set_value('password'), $val->set_value('email')))

to this instead:
Code:
if ($this->dx_auth->register($this->input->post('username'), $this->input->post('password'), $this->input->post('email')))

...it works. sort of. i can now register a new user, but automatically just loading the register page - no need to submit a form! of course, that's of no use either, but it represents some sort of progress to me.

Has anyone else come across this? Is it a DX Auth issue? A CI issue? A combination? I'm lost, any help appreciated...
#2

[eluser]Deadly[/eluser]
Sheesh, I'm 0 for 2 on auth libraries now. Redux 2 kept erroring out without any intervention, and this one has refused to do the simplest of tasks in 2 days now. Going for a bare bones system now then and to hell with the overwrought security implementations.
#3

[eluser]Ben Edmunds[/eluser]
I'm using a modified version of redux 2 and I'm up and running, what problems are you having?
#4

[eluser]Deadly[/eluser]
Hey there, many thanks. I get this on my welcome.php (default controller):

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Welcome::$redux_auth

Filename: controllers/welcome.php

Line Number: 187

Edit: sorry, this is line 187:
Code:
$data['status'] = $this->redux_auth->logged_in();
#5

[eluser]Ben Edmunds[/eluser]
Did you autoload it? Or for that matter load it anywhere?
#6

[eluser]Deadly[/eluser]
Yeah, so I earned a few idiot points there. After checking through the sample app a little more carefully, found a slew of elements I wasn't loading. It's got me almost there now except for... wait for it... I am now exactly where I was with DX, and that's that it won't create a new user.

I'm starting to think it's something to do with form validation, but I can't for the life of me guess what that might be. It's loaded in autoload.php... so I'm lost still.
#7

[eluser]Ben Edmunds[/eluser]
Are you getting any errors?
#8

[eluser]Deadly[/eluser]
No, that's the frustrating part. I have error reporting on and get errors displayed in other situations, but in this case the page just quickly refreshes on submit and nothing is added to the db.
#9

[eluser]Ben Edmunds[/eluser]
OK, so your calling the register method of redux, and you don't get anything back? It should return true or false...

Do you have email_activation turned on in your config?
#10

[eluser]Deadly[/eluser]
I actually just tried turning that off and submitting again. Doesn't appear to have had any effect. I try just submitting the form empty as well to see if any errors are returned from validation but again, nothing.




Theme © iAndrew 2016 - Forum software by © MyBB