|
4 | 4 |
|
5 | 5 | class RainLoop
|
6 | 6 | {
|
7 |
| - |
8 |
| - public static function getLoginCredentials($sUID, $config) : ?array |
9 |
| - { |
10 |
| - $sEmail = \trim($config->getUserValue($sUID, 'rainloop', 'rainloop-email')); |
11 |
| - if ($sEmail) { |
12 |
| - $sPassword = $config->getUserValue($sUID, 'rainloop', 'rainloop-password', ''); |
13 |
| - return [ |
14 |
| - $sEmail, |
15 |
| - $sPassword ? static::decodePassword($sPassword, \md5($sEmail)) : '' |
16 |
| - ]; |
17 |
| - } |
18 |
| - return null; |
19 |
| - } |
20 |
| - |
21 | 7 | /**
|
22 | 8 | * Imports data from RainLoop
|
23 | 9 | * skips: /data/rainloop-storage/_data_/_default_/configs/application.ini
|
@@ -82,47 +68,4 @@ public static function import() : array
|
82 | 68 |
|
83 | 69 | return $result;
|
84 | 70 | }
|
85 |
| - |
86 |
| - /** |
87 |
| - * @param string $sPassword |
88 |
| - * @param string $sSalt |
89 |
| - * |
90 |
| - * @return string |
91 |
| - */ |
92 |
| - public static function decodePassword($sPassword, $sSalt) |
93 |
| - { |
94 |
| - $sPassword = \base64_decode(\trim($sPassword)); |
95 |
| - |
96 |
| - $method = 'AES-256-CBC'; |
97 |
| - if (\function_exists('openssl_encrypt') |
98 |
| - && \function_exists('openssl_decrypt') |
99 |
| - && \function_exists('openssl_random_pseudo_bytes') |
100 |
| - && \function_exists('openssl_cipher_iv_length') |
101 |
| - && \function_exists('openssl_get_cipher_methods') |
102 |
| - && \defined('OPENSSL_RAW_DATA') |
103 |
| - && \defined('OPENSSL_ZERO_PADDING') |
104 |
| - && \in_array($method, \openssl_get_cipher_methods()) |
105 |
| - ) { |
106 |
| - $aParts = \explode('|', $sPassword, 2); |
107 |
| - if (\is_array($aParts) && !empty($aParts[0]) && !empty($aParts[1])) { |
108 |
| - $sData = \base64_decode($aParts[0]); |
109 |
| - $iv = \base64_decode($aParts[1]); |
110 |
| - return \base64_decode(\trim( |
111 |
| - \openssl_decrypt($sData, $method, \md5($sSalt), OPENSSL_RAW_DATA, $iv) |
112 |
| - )); |
113 |
| - } |
114 |
| - } |
115 |
| - |
116 |
| - if (\function_exists('mcrypt_encrypt') |
117 |
| - && \function_exists('mcrypt_decrypt') |
118 |
| - && \defined('MCRYPT_RIJNDAEL_256') |
119 |
| - && \defined('MCRYPT_MODE_ECB') |
120 |
| - ) { |
121 |
| - return \base64_decode(\trim( |
122 |
| - \mcrypt_decrypt(MCRYPT_RIJNDAEL_256, \md5($sSalt), $sPassword, MCRYPT_MODE_ECB) |
123 |
| - )); |
124 |
| - } |
125 |
| - |
126 |
| - return $sPassword; |
127 |
| - } |
128 | 71 | }
|
0 commit comments