Proyectos de Subversion LeadersLinked - Services

Rev

Rev 228 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 228 Rev 250
Línea 138... Línea 138...
138
        return new JsonModel(['ok' => false]);
138
        return new JsonModel(['ok' => false]);
139
    }
139
    }
Línea 140... Línea 140...
140
    
140
    
141
    public function signoutAction()
141
    public function signoutAction()
142
    {
142
    {
143
        $currentUser = $this->plugin('currentUserPlugin');
143
        $currentUserPlugin = $this->plugin('currentUserPlugin');
144
        if($currentUser->hasIdentity()) {
144
        if($currentUserPlugin->hasIdentity()) {
145
            $device_uuid = $currentUser->getDeviceId();
145
            $device_uuid = $currentUserPlugin->getDeviceId();
146
            if($device_uuid) {
146
            if($device_uuid) {
147
                $deviceMapper = DeviceMapper::getInstance($this->adapter);
147
                $deviceMapper = DeviceMapper::getInstance($this->adapter);
148
                $device = $deviceMapper->fetchOne($device_uuid);
148
                $device = $deviceMapper->fetchOne($device_uuid);
149
                if($device) {
149
                if($device) {
150
                    $deviceMapper->signout($device);
150
                    $deviceMapper->signout($device);
151
                }
151
                }
Línea 152... Línea 152...
152
            }
152
            }
153
            
153
            
154
            
154
            
155
            $this->logger->info('Desconexión del mobile', ['user_id' => $currentUser->getUserId(), 'ip' => Functions::getUserIP()]);
155
            $this->logger->info('Desconexión del mobile', ['user_id' => $currentUserPlugin->getUserId(), 'ip' => Functions::getUserIP()]);
Línea 156... Línea 156...
156
        }
156
        }
Línea 980... Línea 980...
980
        
980
        
Línea 981... Línea 981...
981
        if($request->isPost()) {
981
        if($request->isPost()) {
982
            
982
            
983
           
983
           
984
            $rawdata = file_get_contents("php://input");
984
            $rawdata = file_get_contents("php://input");
Línea 985... Línea 985...
985
            error_log('url = ' . $_SERVER['REQUEST_URI']);
985
            //error_log('url = ' . $_SERVER['REQUEST_URI']);
986
            error_log('query = ' . $_SERVER['QUERY_STRING']);
986
            //error_log('query = ' . $_SERVER['QUERY_STRING']);
987
            error_log('$rawdata = ' . $rawdata );
987
            //error_log('$rawdata = ' . $rawdata );
Línea 1059... Línea 1059...
1059
                    'success' => false,
1059
                    'success' => false,
1060
                    'data' => 'ERROR_DEVICE_NOT_FOUND',
1060
                    'data' => 'ERROR_DEVICE_NOT_FOUND',
1061
                ]);
1061
                ]);
1062
            }
1062
            }
Línea 1063... Línea -...
1063
 
-
 
1064
            
1063
 
1065
        
1064
  
Línea 1066... Línea 1065...
1066
            if($encrypter == 'CryptoJsAes') {
1065
            if($encrypter == 'CryptoJsAes') {
1067
                
1066
                
Línea 1073... Línea 1072...
1073
                ob_start();
1072
                ob_start();
Línea 1074... Línea 1073...
1074
                
1073
                
1075
                $email      = CryptoJsAes::decrypt($email, $device->aes);
1074
                $email      = CryptoJsAes::decrypt($email, $device->aes);
Línea -... Línea 1075...
-
 
1075
                $password   = CryptoJsAes::decrypt($password, $device->aes);
1076
                $password   = CryptoJsAes::decrypt($password, $device->aes);
1076
                
Línea 1077... Línea 1077...
1077
                
1077
        
1078
                ob_end_clean();
1078
                ob_end_clean();
1079
                
1079
                
1080
                if(!$email || !$password) {
1080
                if(!$email || !$password) {
1081
                    return new JsonModel([
1081
                    return new JsonModel([
1082
                        'success' => false,
1082
                        'success' => false,
1083
                        'data' => 'ERROR_WEBSERVICE_PASSWORD_ENCRYPTION_FAILED 1',
1083
                        'data' => 'ERROR_WEBSERVICE_PASSWORD_ENCRYPTION_FAILED 1',
Línea 1084... Línea 1084...
1084
                    ]);
1084
                    ]);
1085
                } 
1085
                } 
1086
            } else if($encrypter == 'RNCryptor') {
1086
            } else if($encrypter == 'RNCryptor') {
1087
                
1087
                
1088
                error_log("RNCryptor");
1088
                //error_log("RNCryptor");
Línea 1089... Línea 1089...
1089
                error_log("Device UUID : " . $device->id);
1089
                //error_log("Device UUID : " . $device->id);
1090
                error_log("AES : " . $device->aes);
1090
                //error_log("AES : " . $device->aes);
1091
                error_log("Email Encrypted : " . $email);
1091
                //error_log("Email Encrypted : " . $email);
Línea 1092... Línea 1092...
1092
                error_log("Password Encrypted : " . $password);
1092
                //error_log("Password Encrypted : " . $password);
1093
                
1093
                
Línea 1094... Línea 1094...
1094
                $cryptor = new \RNCryptor\RNCryptor\Decryptor;
1094
                $cryptor = new \RNCryptor\RNCryptor\Decryptor;
1095
                $email = $cryptor->decrypt($email, $device->aes);
1095
                $email = $cryptor->decrypt($email, $device->aes);
1096
                $password = $cryptor->decrypt($password, $device->aes);
1096
                $password = $cryptor->decrypt($password, $device->aes);
1097
                
1097
                
Línea 1106... Línea 1106...
1106
                } 
1106
                } 
Línea 1107... Línea 1107...
1107
                
1107
                
Línea -... Línea 1108...
-
 
1108
               
1108
               
1109
            } else if($encrypter == 'EasyAES') {
1109
            } else if($encrypter == 'EasyAES') {
1110
                
1110
                
1111
                /*
1111
                error_log("AesEncryption");
1112
                error_log("AesEncryption");
1112
                error_log("Device UUID : " . $device->id);
1113
                error_log("Device UUID : " . $device->id);
1113
                error_log("AES : " . $device->aes);
-
 
-
 
1114
                error_log("AES : " . $device->aes);
Línea 1114... Línea 1115...
1114
                error_log("Email Encrypted : " . $email);
1115
                error_log("Email Encrypted : " . $email);
1115
                error_log("Password Encrypted : " . $password);
1116
                error_log("Password Encrypted : " . $password);
1116
                
1117
                */