Rev 1005 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1005 | Rev 1029 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | 39 | ||
40 | return !$oobe_done; |
40 | return !$oobe_done; |
41 | } |
41 | } |
42 | 42 | ||
43 | public function init($html=true) { |
43 | public function init($html=true) { |
44 | OIDplus::config()->delete('reg_wizard_done'); |
44 | OIDplus::config()->delete('reg_wizard_done'); // deprecated name |
45 | OIDplus::config()->prepareConfigKey('oobe_main_done', '"Out Of Box Experience" wizard for the system settings done once?', '0', OIDplusConfig::PROTECTION_HIDDEN, function($value) {}); |
45 | OIDplus::config()->prepareConfigKey('oobe_main_done', '"Out Of Box Experience" wizard for the system settings done once?', '0', OIDplusConfig::PROTECTION_HIDDEN, function($value) {}); |
46 | 46 | ||
47 | // In the OOBE, "get_challenge" of the ViaThinkSoft Captcha will raise the error: |
- | |
48 | // "A plugin has requested that the initialization wizard (OOBE) is shown. Please reload the page." |
- | |
49 | // So we must not continue if the referrer is OOBE. |
- | |
50 | if (isset($_SERVER['HTTP_REFERER']) && (strpos($_SERVER['HTTP_REFERER'],'050_oobe/oobe.php') !== false)) return; |
- | |
51 | - | ||
52 | if ($this->oobeRequired()) { |
47 | if ($this->oobeRequired()) { |
53 | // Show registration/configuration wizard once |
- | |
54 | if ($html) { |
48 | if ($html) { |
- | 49 | // Show registration/configuration wizard once |
|
55 | if (basename($_SERVER['SCRIPT_NAME']) != 'oobe.php') { |
50 | if (basename($_SERVER['SCRIPT_NAME']) != 'oobe.php') { |
56 | header('Location:'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'oobe.php'); |
51 | header('Location:'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'oobe.php'); |
57 | die(_L('Redirecting to Out-Of-Box-Experience wizard...')); |
52 | die(_L('Redirecting to Out-Of-Box-Experience wizard...')); |
58 | } |
53 | } |
59 | } else { |
54 | } else { |
- | 55 | // In the OOBE, "get_challenge" of the ViaThinkSoft Captcha will raise the error: |
|
- | 56 | // "A plugin has requested that the initialization wizard (OOBE) is shown. Please reload the page." |
|
- | 57 | // So we must not continue if the referrer is OOBE. |
|
- | 58 | if (isset($_SERVER['HTTP_REFERER']) && (strpos($_SERVER['HTTP_REFERER'],'050_oobe/oobe.php') !== false)) return; |
|
- | 59 | ||
- | 60 | // This is another very special case... |
|
- | 61 | // When the Registration OOBE is saved, the 'reg_privacy" setting will be |
|
- | 62 | // set, which will call the ViaThinkSoft server. The ViaThinkSoft server |
|
- | 63 | // then calls the "verify pubkey" action, but this fails because |
|
- | 64 | // the system is still in OOBE mode! |
|
- | 65 | if (basename($_SERVER['SCRIPT_NAME']) == 'ajax.php') { |
|
- | 66 | $req = array_merge($_POST,$_GET); |
|
- | 67 | if (($req['plugin'] == '1.3.6.1.4.1.37476.2.5.2.4.3.120') && ($req['action'] = 'verify_pubkey')) { |
|
- | 68 | return; |
|
- | 69 | } |
|
- | 70 | } |
|
- | 71 | ||
60 | // We cannot guarantee that everything works correctly if OOBE never ran once. So abort AJAX and co. |
72 | // We cannot guarantee that everything works correctly if OOBE never ran once. So abort AJAX and co. |
61 | throw new OIDplusException(_L('A plugin has requested that the initialization wizard (OOBE) is shown. Please reload the page.')); |
73 | throw new OIDplusException(_L('A plugin has requested that the initialization wizard (OOBE) is shown. Please reload the page.')); |
62 | } |
74 | } |
63 | } |
75 | } |
64 | } |
76 | } |