public function index()
 {
     $this->autoRender = false;
     //$tempUserId = null;
     $tempUserId = $this->request->query("userid");
     $info = base64_decode($this->request->query('info'));
     $ip = "113.193.128.35";
     //$this->request->clientIp();
     \Cake\Log\Log::debug('DownloadDb request input querystring info : ' . $info);
     if (empty($tempUserId) or empty($info)) {
         $this->response->body(DTO\ClsErrorDto::prepareError(101));
         \Cake\Log\Log::error("User requested with blank user id :" . $tempUserId);
         return;
     }
     $networkDeviceInfoDto = DTO\ClsNetworkDeviceInfoDto::Deserialize($info);
     $ipInfo = new Component\Ipinfo();
     $fullDetails = $ipInfo->getFullIpDetails($tempUserId, $networkDeviceInfoDto, $ip);
     $networkDeviceInfoTable = new Table\NetworkDeviceInfoTable();
     $networkDeviceInfoTable->saveNetworkDeviceInfo($fullDetails);
     $userDto = new DTO\ClsUserDto($tempUserId);
     \Cake\Log\Log::debug('TempUserId is send to Validate' . $tempUserId . " userIP : " . $ip);
     if ($this->isValid($userDto->userId)) {
         \Cake\Log\Log::debug("User validate");
         $sqliteController = new SqliteController();
         $sqliteController->getDB($userDto->userId);
         \Cake\Log\Log::debug("Sqlite database sended to user");
     } else {
         $userController = new UserController();
         \Cake\Log\Log::debug('UserId send to save in database');
         if ($userController->userSignUp($userDto->userId)) {
             $sqliteController = new SqliteController();
             $sqliteController->getDB($userDto->userId);
             \Cake\Log\Log::debug("sqlite file sended  to user after userid saving");
         }
     }
 }