Welcome Guest, Not a member yet? Register   Sign In
Community Auth Password Recovery Validation Variables
#1

(This post was last modified: 01-14-2017, 05:37 PM by escaperadius.)

I'm using Community Auth in my CI project and am now trying to implement the forgotten password methods. After inspecting the Examples/recover Examples/recovery_verification methods I can create a recovery link and change the password. I am however at a loss how certain validation variables are being passed to the choose_password_form.php view.

For example, in the recovery_verification function data is being passed to choose_password_form.php via this line of code:


Code:
echo $this->load->view( 'examples/choose_password_form', $view_data, TRUE );

I assume all the validation variables must be contained in $vew_data. However, I cannot determine from the recovery_verification function (or anywhere in the CA code), where the following variables are being generated:
  • $disabled
  • $recovery_error
  • $validation_passed
  • $validation_errors
My implementation is a bit different than the CA examples as I'm using the CI parser so I need to access these validation parameters before calling the view. 

I'm really at a loss about where these variables are being generated and how I can access them in the controller.

Thanks for any insight.
Reply
#2

(This post was last modified: 01-14-2017, 06:20 PM by skunkbad.)

(01-14-2017, 05:35 PM)escaperadius Wrote: ...
  • $disabled
  • $recovery_error
  • $validation_passed
  • $validation_errors
...

1) $disabled may be generated on line 420 of the examples controller.
2) $recovery_error may be generated on line 459 or line 469 of the examples controller.
3) $validation_passed may be generated on line 118 of the examples model.
4) $validation_errors may be generated on line 129 of the examples model.

So, $disabled and $recovery_error are part of $view_data, but the other vars are loaded with $this->load->vars().

Remember, the examples are just there to show you that something works, and not intended for you to build your whole project from.

I'm using Sublime Text, but I know Notepad++ also has a global search for vars like these. Global search is your friend.
Reply
#3

Thanks, $this->load->get_var('validation_errors') is what I needed!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB