Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by YO ( 13 years ago )
public function dologin(kullanicilar $user){
        $user->where('kullanici_adi',$user->verisis_user);
        $user->where('sifre', md5($user->verisis_pass));
        $user->where('durum' , 1);
        $user->get();
        if(!$user->exists()){
            $userData = array('logged_in' => FALSE);
            $this->CI->session->set_userdata($userData);
            return false;
        }
        
        $userAccess = array();
        $user->kullanici_gruplari->get();
        foreach($user->kullanici_gruplari->grup_yetkiler->get() as $access){
            $yetkiler = new yetkiler($access->yetkiler_id);
            $userAccess[$access->yetkiler_id] = array(
                'id' => $yetkiler->id,
                'name' => $yetkiler->yetki_adi
            );
        }
        
        $userData = array(
            'id'           => $user->id, 
            'name_surname' => $user->ad_soyad,
            'username'     => $user->kullanici_adi,
            'logged_in'    => true,
            'access'       => $userAccess
         );
        
        $user->son_erisim = date('Y-m-d H:i:s');
        $user->son_erisim_ip = $this->CI->input->ip_address();
        $user->save();
        $this->CI->session->set_userdata($userData);
        
        return true;
    }

 

Revise this Paste

Your Name: Code Language: