Rev 380 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 380 | Rev 381 | ||
---|---|---|---|
Line 137... | Line 137... | ||
137 | $out['icon'] = 'img/error_big.png'; |
137 | $out['icon'] = 'img/error_big.png'; |
138 | $out['text'] = _L('JSON reply from ViaThinkSoft decoding error: %1',$res); |
138 | $out['text'] = _L('JSON reply from ViaThinkSoft decoding error: %1',$res); |
139 | return; |
139 | return; |
140 | } |
140 | } |
141 | 141 | ||
142 | if (isset($json['error']) || ($json['status'] != 0)) { |
142 | if (isset($json['error']) || ($json['status'] < 0)) { |
143 | $out['icon'] = 'img/error_big.png'; |
143 | $out['icon'] = 'img/error_big.png'; |
144 | if (isset($json['error'])) { |
144 | if (isset($json['error'])) { |
145 | $out['text'] = _L('Received error status code: %1',$json['error']); |
145 | $out['text'] = _L('Received error status code: %1',$json['error']); |
146 | } else { |
146 | } else { |
147 | $out['text'] = _L('Received error status code: %1',$json['status']); |
147 | $out['text'] = _L('Received error status code: %1',$json['status']); |
Line 163... | Line 163... | ||
163 | 163 | ||
164 | if (!$json) { |
164 | if (!$json) { |
165 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
165 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
166 | } |
166 | } |
167 | 167 | ||
168 | if (isset($json['error']) || ($json['status'] != 0)) { |
168 | if (isset($json['error']) || ($json['status'] < 0)) { |
169 | if (isset($json['error'])) { |
169 | if (isset($json['error'])) { |
170 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
170 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
171 | } else { |
171 | } else { |
172 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
172 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
173 | } |
173 | } |
Line 227... | Line 227... | ||
227 | 227 | ||
228 | if (!$json) { |
228 | if (!$json) { |
229 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
229 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
230 | } |
230 | } |
231 | 231 | ||
232 | if (isset($json['error']) || ($json['status'] != 0)) { |
232 | if (isset($json['error']) || ($json['status'] < 0)) { |
233 | if (isset($json['error'])) { |
233 | if (isset($json['error'])) { |
234 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
234 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
235 | } else { |
235 | } else { |
236 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
236 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
237 | } |
237 | } |
Line 307... | Line 307... | ||
307 | 307 | ||
308 | if (!$json) { |
308 | if (!$json) { |
309 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
309 | return false; // throw new OIDplusException(_L('JSON reply from ViaThinkSoft decoding error: %1',$res)); |
310 | } |
310 | } |
311 | 311 | ||
- | 312 | if (isset($json['error']) || ($json['status'] < 0)) { |
|
- | 313 | if (isset($json['error'])) { |
|
- | 314 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
|
- | 315 | } else { |
|
- | 316 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
|
- | 317 | } |
|
312 | if ($json['status'] == 99/*Hash conflict*/) { |
318 | } else if ($json['status'] == 99/*Hash conflict*/) { |
313 | OIDplus::logger()->log("[WARN]A!", "Removing SystemID and key pair because there is a hash conflict with another OIDplus system!"); |
319 | OIDplus::logger()->log("[WARN]A!", "Removing SystemID and key pair because there is a hash conflict with another OIDplus system!"); |
314 | 320 | ||
315 | // Delete the system ID since we have a conflict with the 31-bit hash! |
321 | // Delete the system ID since we have a conflict with the 31-bit hash! |
316 | OIDplus::config()->setValue('oidplus_private_key', ''); |
322 | OIDplus::config()->setValue('oidplus_private_key', ''); |
317 | OIDplus::config()->setValue('oidplus_public_key', ''); |
323 | OIDplus::config()->setValue('oidplus_public_key', ''); |
Line 320... | Line 326... | ||
320 | OIDplus::getPkiStatus(true); |
326 | OIDplus::getPkiStatus(true); |
321 | 327 | ||
322 | // Enforce a new registration attempt at the next page visit |
328 | // Enforce a new registration attempt at the next page visit |
323 | // We will not try again here, because that might lead to an endless loop if the VTS server would always return 'HASH_CONFLCIT' |
329 | // We will not try again here, because that might lead to an endless loop if the VTS server would always return 'HASH_CONFLCIT' |
324 | OIDplus::config()->setValue('reg_last_ping', 0); |
330 | OIDplus::config()->setValue('reg_last_ping', 0); |
325 | } elseif (isset($json['error']) || ($json['status'] != 0)) { |
- | |
326 | if (isset($json['error'])) { |
- | |
327 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['error'])); |
- | |
328 | } else { |
- | |
329 | return false; // throw new OIDplusException(_L('Received error status code: %1',$json['status'])); |
- | |
330 | } |
- | |
331 | } |
331 | } |
332 | } |
332 | } |
333 | } |
333 | } |
334 | 334 | ||
335 | public function init($html=true) { |
335 | public function init($html=true) { |