my_usessionpublic->logged_in ? : false; if ($authorizationHeader['Authorization'] && $login) { if(strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer ') !== 0){ $cek['status'] = false; $cek['message'] = "Wrong number of segments"; $this->my_usessionpublic->set_userdata('pesan', $cek['message']); echo json_encode($cek); redirect('index.php/user/ext_logout'); die; } } else { $cek['status'] = false; $cek['message'] = "Please try login again."; $this->my_usessionpublic->set_userdata('pesan', $cek['message']); echo json_encode($cek); redirect('index.php/user/ext_logout'); die; } $cek = check_auth($authorizationHeader, $login); if(isset($cek['status']) && $cek['status'] == true){ // continue; } else{ $this->my_usessionpublic->set_userdata('pesan', $cek['message']); echo json_encode($cek); redirect('index.php/user/ext_logout'); die; } #end check auth } function get_user(){ $user = $this->session->userdata("username1unla"); if($user != ""){ //$_SESSION['user_id'] = $this->input->post('user_id1unla'); $value["success"]=true; $value["user_id"]=$this->session->userdata("user_id1unla"); $value["username"]=$this->session->userdata("username1unla"); $value["level_member"]=$this->session->userdata("level_member1unla"); $value["nm_klp"]=$this->session->userdata("nm_klp1unla"); $value["client"]=gethostbyaddr($_SERVER['REMOTE_ADDR']); }else{ $value["success"]=false; } echo json_encode($value); } }