Welcome Guest, Not a member yet? Register   Sign In
I Can't Get My Sessions To Work Right
#4

[eluser]ShoeLace1291[/eluser]
member model continued...
Code:
'contact' => array(
                        'email' => ($member['member_emails'] == '1') ? $member['email_address'] : NULL,
                        'website' => ($member['website'] != '') ? $member['website'] : NULL,
                        'facebook' => ($member['facebook_username'] != '') ? 'http://www.facebook.com/'.$member['facebook_username'] : NULL,
                        'steam' => ($member['steam_username'] != '') ? 'http://www.steamcommunity.com/id/'.$member['steam_username'] : NULL,                        
                        ),
                    'gaming' => array(
                     'xboxlive' => $member['xboxlive_gamertag'],
                     'psn' => $member['psn_id'],
                     'steam' => $member['steam_username']
                     ),
                    'friend_status' => $friend_status,
                    'statistics' => array('post_count' => $member['forum_count']),
                    'avatar' => array(
                     'attachment_id' => $member['attachment_id'],
                     'url' => base_url('attachments/'.$member['file_name'])
                     ),
                    'banner' => $banner,
                    'friends' => $this->friend_results($member_id)
                    );
                        
                
                show_error(var_dump($info));
                //$info['friend_results'] = $this->friend_results($member_id);
                
                $this->info = $info;
                
            } else {
                
                $this->info = $this->default_info();
                
            }
            
        }
        
    }

  public function login($remember = FALSE){
        
        $this->db->select('*');
        $this->db->where('email_address', $this->input->post('email_address'));
        $query = $this->db->get('members');
        
        if($query->num_rows() > 0){
            
            $member = $query->row_array();
            
            if(sha1($this->input->post('password')) == $member['password']){
                
                if($member['status'] > 0){
                
                 $this->session->set_userdata('member_id', $member['member_id']);
                    
                    $data = array(
                        'last_active' => time()
                    );
                    
                    $this->db->where('member_id', $member['member_id']);
                    if(!$this->db->update('members', $data)){
                        
                        $this->error = $this->db->_error_message();
                        
                    }
                    
                } else {
                    
                    $this->error = 'You haven\'t validated your email address.  We sent an email message to the address that you provided when you created your account.  Follow the directions in this message to validate your email address.';
                    
                }
                
            } else {
                
                $this->error = 'The password you entered does not match the one that we have on record for your account.';
                
            }
            
        } else {
            
            $this->error = 'The email address \''.$this->input->post('email_address').'\' does not match any accounts that we have on record.';
            
        }
        
    }[


Messages In This Thread
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:49 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:50 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:59 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:00 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:02 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:02 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-19-2014, 05:11 AM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 05:39 AM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:22 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:41 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:52 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB