Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Todlerone[/eluser]
[quote author="Todlerone" date="1291699661"]Hello everyone. Sorry for the simple questions. I've successfully implemented Ion Auth as a log in. Works great. Now I'm trying to add some functionality to my website. I have a model that stores personal information (limited). All I'm trying to do is add their username to the table (not through a form) for creating/editing the data. The form doesn't error but the $user['username'] comes up empty. Sorry I don't have the code (it's at work). What is the difference between passing variables with $data['username'] and $this->data['username']?

TY[/quote]

Ty Ben. I worked at this for sometime and eventually got it to work. I now understand what I had done wrong. I am however still stuck at the dropdown menu for the create user. I redid the user login form in code I was familiar with but still don't get anything listed.

Code:
function create_user(){
//other standard code from this controller here
if ($this->form_validation->run() == true && $this->ion_auth->register($username,$password,$email,$additional_data)) { //check to see if we are creating the user
                  //redirect them back to the admin page
                $this->session->set_flashdata('message', "User Created");
               redirect("admin/admin_main/get_users_array", 'refresh');
        }else{ //display the create user form
               //set the flash data error message if there is one
                $this->data['groups'] = $this->ion_auth_model->get_groups();
            
            $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));
            
            $data['user'] = $this->ion_auth->get_user_array();
            $this->title="Create User";    
            $this->thisPage="Admin";
            $this->load->view('header', $data);
            $this->load->view('admin/admin_create_user', $this->data);
            $this->load->view('sidebars/sidebar_admin_main');
            $this->load->view('footer');
        }
    }// end create_user()


//the view form

<div class="post">
        <h1 class="title">Add user to JCC Database. </h1>
        &lt;?php echo validation_errors(); ?&gt;
        &lt;?php echo form_open('admin/admin_main/create_user'); ?&gt;
        <fieldset>
            <legend>Personal Information</legend>
            <label for="first_name">First Name:</label>
                &lt;input type="text" name="first_name" value="&lt;?php echo set_value('first_name'); ?&gt;"/&gt;

            <label for="last_name">Last Name:</label>
                &lt;input type="text" name="last_name" value="&lt;?php echo set_value('last_name'); ?&gt;" /&gt;

            <label for="group_id">Group Member:</label>
                <select name="group_id"><option value=''>Choose a group...</option>
                &lt;?php foreach ($groups as $grp){?&gt;
                &lt;?php echo "<option value='".$grp['id']."' >".$grp['description']."</option>"; ?&gt;
                &lt;?php } ?&gt;</select>
                    
            <label for="jcc_demo_Gender">Password:</label>
                &lt;input type="password" name="password" value="&lt;?php echo set_value('password'); ?&gt;" /&gt;

            <label for="jcc_demo_DOB">Confirm Password:</label>
                &lt;input type="password" name="password_confirm"  value="&lt;?php echo set_value('password_confirm'); ?&gt;" /&gt;
        </fieldset>
        <p>&lt;input type="submit" name="Submit" value="Create User" class="button" /&gt;&lt;/p>
        &lt;/form&gt;
</div>&lt;!-- end #post --&gt;


TY for your time


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 12-07-2010, 03:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB