Exemplo n.º 1
0
 public function index()
 {
     $this->data['pagebody'] = 'signup';
     if (isset($_SESSION['signup_error'])) {
         $this->data['message'] = $_SESSION['signup_error'];
     } else {
         $this->data['message'] = '';
     }
     $user = $this->restore_signup_session();
     $this->data['username'] = makeTextField('Username', 'username', $user->username);
     $this->data['password'] = makePasswordField('Password', 'password', '');
     $this->data['password2'] = makePasswordField('Password', 'password2', '');
     $this->data['email'] = makeTextField('Email', 'email', $user->email);
     $this->data['submit'] = makeSubmitButton('Sign Up', "Click here to validate the user data", 'btn-success');
     //unset sign in error
     unset($_SESSION['login_error']);
     $this->render();
 }
Exemplo n.º 2
0
 public function index()
 {
     $this->data['pagebody'] = 'signin';
     $this->load->helper('ffields');
     $user = $this->users->create();
     $this->data['username'] = makeTextField('Username', 'username', $user->username);
     $this->data['password'] = makePasswordField('Password', 'password', $user->password);
     $this->data['submit'] = makeSubmitButton('Sign In', "Click here to validate the user data", 'button floatLeft');
     $this->data['signup'] = makeButton("/SignUp", "Sign Up", "button floatLeft");
     if (isset($_SESSION['login_error']) == 'wrongcredentials') {
         $this->data['message'] = 'Wrong Login Information';
     } else {
         $this->data['message'] = '';
     }
     //unset sign up error
     unset($_SESSION['signup_error']);
     $this->render();
 }
Exemplo n.º 3
0
 /** Editing your account details **/
 public function edit()
 {
     //Security redirect
     if (!isset($_SESSION['edit_profile_username'])) {
         redirect('../');
     }
     //Loading button helper
     $this->load->helper('button');
     //Pagebody
     $this->data['pagebody'] = 'account_edit';
     //Getting User's info from User table
     $query = $this->users->get_by_username($_SESSION['edit_profile_username']);
     //Setting data to empty strings
     $this->data['form_username'] = '';
     $this->data['form_email'] = '';
     $this->data['form_password'] = '';
     $this->data['save'] = '';
     $this->data['cancel'] = '';
     $this->data['form_confirm_password'] = '';
     //Set the username Textbox to edit
     //$this->data['form_username'] = makeTextField('User Name','username',$query->username );
     //Set the password Textbox to edit
     $this->data['form_password'] = makePasswordField('New Password', 'password', '*****');
     //Set the password confirmation Textbox to edit
     $this->data['form_confirm_password'] = makePasswordField('Confirm New Password', 'confirm_password', '*****');
     //Making the submit button
     $this->data['save'] = makeSubmitButton('Save', 'save_button', 'button floatLeft');
     //Making the cancel button
     $this->data['cancel'] = '<div class="button"> ' . '<a href="../profile/' . $_SESSION['edit_profile_username'] . '">Cancel</a></div>';
     $this->render();
 }