php - codeigniter tank_auth error in userinterface page -
my login interface starts error message.
a php error encountered
severity: notice
message: undefined variable: login_by_username
filename: auth/register_form.php
line number: 10
php error encountered
severity: notice
message: undefined variable: login_by_username
filename: auth/register_form.php
line number: 12
if press login button without out passing values , tank_auth doesn't promt me error.instead redirected me welcome page error.
hi,
php error encountered
severity: notice
message: undefined variable: username
filename: views/welcome.php
line number: 3
! logged in now. logout
auth.php file
function login() { if ($this->tank_auth->is_logged_in()) { // logged in redirect(''); } elseif ($this->tank_auth->is_logged_in(false)) { // logged in, not activated redirect('/auth/send_again/'); } else { $data['login_by_username'] = ($this->config->item('login_by_username', 'tank_auth') , $this->config->item('use_username', 'tank_auth')); $data['login_by_email'] = $this->config->item('login_by_email', 'tank_auth'); $this->form_validation->set_rules('login', 'login', 'trim|required|xss_clean'); $this->form_validation->set_rules('password', 'password', 'trim|required|xss_clean'); $this->form_validation->set_rules('remember', 'remember me', 'integer'); // login counting attempts login if ($this->config->item('login_count_attempts', 'tank_auth') , ($login = $this->input->post('login'))) { $login = $this->security->xss_clean($login); } else { $login = ''; } $data['use_recaptcha'] = $this->config->item('use_recaptcha', 'tank_auth'); if ($this->tank_auth->is_max_login_attempts_exceeded($login)) { if ($data['use_recaptcha']) $this->form_validation->set_rules('recaptcha_response_field', 'confirmation code', 'trim|xss_clean|required|callback__check_recaptcha'); else $this->form_validation->set_rules('captcha', 'confirmation code', 'trim|xss_clean|required|callback__check_captcha'); } $data['errors'] = array(); if ($this->form_validation->run()) { // validation ok if ($this->tank_auth->login( $this->form_validation->set_value('login'), $this->form_validation->set_value('password'), $this->form_validation->set_value('remember'), $data['login_by_username'], $data['login_by_email'])) { // success redirect(''); } else { $errors = $this->tank_auth->get_error_message(); if (isset($errors['banned'])) { // banned user $this->_show_message($this->lang->line('auth_message_banned').' '.$errors['banned']); } elseif (isset($errors['not_activated'])) { // not activated user redirect('/auth/send_again/'); } else { // fail foreach ($errors $k => $v) $data['errors'][$k] = $this->lang->line($v); echo "test6"; } } } $data['show_captcha'] = false; if ($this->tank_auth->is_max_login_attempts_exceeded($login)) { $data['show_captcha'] = false;//captcha on , off control true show captcha.............sajad. if ($data['use_recaptcha']) { $data['recaptcha_html'] = $this->_create_recaptcha(); } else { $data['captcha_html'] = $this->_create_captcha(); } } $data['title']= 'home'; $this->load->view('header_view',$data); $this->load->view('welcome', $data); $this->load->view('footer_view',$data); } } register_form.php file. <?php $login = array( 'name' => 'login', 'id' => 'login', 'value' => set_value('login'), 'maxlength' => 80, 'size' => 30, ); if ($login_by_username , $login_by_email) { $login_label = 'email or login'; } else if ($login_by_username) { $login_label = 'login'; } else { $login_label = 'email'; } $password = array( 'name' => 'password', 'id' => 'password', 'size' => 30, ); $remember = array( 'name' => 'remember', 'id' => 'remember', 'value' => 1, 'checked' => set_value('remember'), 'style' => 'margin:0;padding:0', ); $captcha = array( 'name' => 'captcha', 'id' => 'captcha', 'maxlength' => 8, );?> <?php echo form_open('auth/login'); ?><br /><br /> <?php echo form_label('login', $login['id']); ?> <?php echo form_input($login); ?> <?php echo form_label('password', $password['id']); ?> <?php echo form_password($password); ?> <?php echo form_submit('submit', 'let me in'); ?><br /><br /> <?php echo form_error($login['name']); ?><?php echo isset($errors[$login['name']])? $errors[$login['name']]:''; ?> <?php echo form_error($password['name']); ?><?php echo isset($errors[$password['name']])?$errors[$password['name']]:''; ?> <?php echo form_close(); ?>
please upload version of following files:
1) auth/register_form.php
2) views/welcome.php
-- seekers01
Comments
Post a Comment