Rev 1189 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1189 | Rev 1201 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | if (OIDplus::getActiveCaptchaPlugin()->isVisible()) echo '<h2>'._L('Step %1: Solve CAPTCHA',$step++).'</h2>'; |
53 | if (OIDplus::getActiveCaptchaPlugin()->isVisible()) echo '<h2>'._L('Step %1: Solve CAPTCHA',$step++).'</h2>'; |
54 | if (isset($_POST['sent'])) { |
54 | if (isset($_POST['sent'])) { |
55 | try { |
55 | try { |
56 | OIDplus::getActiveCaptchaPlugin()->captchaVerify($_POST); |
56 | OIDplus::getActiveCaptchaPlugin()->captchaVerify($_POST); |
57 | } catch (\Exception $e) { |
57 | } catch (\Exception $e) { |
- | 58 | $htmlmsg = $e instanceof OIDplusException ? $e->getHtmlMessage() : htmlentities($e->getMessage()); |
|
58 | echo '<p><font color="red"><b>'.htmlentities($e->getMessage()).'</b></font></p>'; |
59 | echo '<p><font color="red"><b>'.$htmlmsg.'</b></font></p>'; |
59 | $errors_happened = true; |
60 | $errors_happened = true; |
60 | $edits_possible = false; |
61 | $edits_possible = false; |
61 | } |
62 | } |
62 | } |
63 | } |
63 | echo OIDplus::getActiveCaptchaPlugin()->captchaGenerate(_L('Before logging in, please solve the following CAPTCHA'), _L('If the CAPTCHA does not work (e.g. because of wrong keys, please run <a href="%1">setup part 1</a> again or edit %2 manually).',OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/','userdata/baseconfig/config.inc.php')); |
64 | echo OIDplus::getActiveCaptchaPlugin()->captchaGenerate(_L('Before logging in, please solve the following CAPTCHA'), _L('If the CAPTCHA does not work (e.g. because of wrong keys, please run <a href="%1">setup part 1</a> again or edit %2 manually).',OIDplus::webpath(null,OIDplus::PATH_RELATIVE).'setup/','userdata/baseconfig/config.inc.php')); |
Line 101... | Line 102... | ||
101 | */ |
102 | */ |
102 | function step_admin_email(int $step, bool $do_edits, bool &$errors_happened) { |
103 | function step_admin_email(int $step, bool $do_edits, bool &$errors_happened) { |
103 | echo '<h2>'._L('Step %1: Please enter the email address of the system administrator',$step).'</h2>'; |
104 | echo '<h2>'._L('Step %1: Please enter the email address of the system administrator',$step).'</h2>'; |
104 | echo '<input type="text" name="admin_email" value="'; |
105 | echo '<input type="text" name="admin_email" value="'; |
105 | 106 | ||
106 | $msg = ''; |
107 | $htmlmsg = ''; |
107 | if (isset($_POST['sent'])) { |
108 | if (isset($_POST['sent'])) { |
108 | echo htmlentities($_POST['admin_email'] ?? ''); |
109 | echo htmlentities($_POST['admin_email'] ?? ''); |
109 | if ($do_edits) { |
110 | if ($do_edits) { |
110 | try { |
111 | try { |
111 | OIDplus::config()->setValue('admin_email', $_POST['admin_email'] ?? ''); |
112 | OIDplus::config()->setValue('admin_email', $_POST['admin_email'] ?? ''); |
112 | } catch (\Exception $e) { |
113 | } catch (\Exception $e) { |
113 | $msg = $e->getMessage(); |
114 | $htmlmsg = $e instanceof OIDplusException ? $e->getHtmlMessage() : htmlentities($e->getMessage()); |
114 | $errors_happened = true; |
115 | $errors_happened = true; |
115 | } |
116 | } |
116 | } |
117 | } |
117 | } else { |
118 | } else { |
118 | echo htmlentities(OIDplus::config()->getValue('admin_email')); |
119 | echo htmlentities(OIDplus::config()->getValue('admin_email')); |
119 | } |
120 | } |
120 | 121 | ||
121 | echo '" size="25"> <font color="red"><b>'.$msg.'</b></font>'; |
122 | echo '" size="25"> <font color="red"><b>'.$htmlmsg.'</b></font>'; |
122 | } |
123 | } |
123 | step_admin_email($step++, $do_edits, $errors_happened); |
124 | step_admin_email($step++, $do_edits, $errors_happened); |
124 | 125 | ||
125 | # --- |
126 | # --- |
126 | 127 | ||
Line 134... | Line 135... | ||
134 | */ |
135 | */ |
135 | function step_system_title(int $step, bool $do_edits, bool &$errors_happened) { |
136 | function step_system_title(int $step, bool $do_edits, bool &$errors_happened) { |
136 | echo '<h2>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</h2>'; |
137 | echo '<h2>'._L('Step %1: What title should your Registration Authority / OIDplus instance have?',$step).'</h2>'; |
137 | echo '<input type="text" name="system_title" value="'; |
138 | echo '<input type="text" name="system_title" value="'; |
138 | 139 | ||
139 | $msg = ''; |
140 | $htmlmsg = ''; |
140 | if (isset($_POST['sent'])) { |
141 | if (isset($_POST['sent'])) { |
141 | echo htmlentities($_POST['system_title'] ?? ''); |
142 | echo htmlentities($_POST['system_title'] ?? ''); |
142 | if ($do_edits) { |
143 | if ($do_edits) { |
143 | try { |
144 | try { |
144 | OIDplus::config()->setValue('system_title', $_POST['system_title'] ?? ''); |
145 | OIDplus::config()->setValue('system_title', $_POST['system_title'] ?? ''); |
145 | } catch (\Exception $e) { |
146 | } catch (\Exception $e) { |
146 | $msg = $e->getMessage(); |
147 | $htmlmsg = $e instanceof OIDplusException ? $e->getHtmlMessage() : htmlentities($e->getMessage()); |
147 | $errors_happened = true; |
148 | $errors_happened = true; |
148 | } |
149 | } |
149 | } |
150 | } |
150 | } else { |
151 | } else { |
151 | echo htmlentities(OIDplus::config()->getValue('system_title')); |
152 | echo htmlentities(OIDplus::config()->getValue('system_title')); |
152 | } |
153 | } |
153 | 154 | ||
154 | echo '" size="50"> <font color="red"><b>'.$msg.'</b></font>'; |
155 | echo '" size="50"> <font color="red"><b>'.$htmlmsg.'</b></font>'; |
155 | } |
156 | } |
156 | step_system_title($step++, $do_edits, $errors_happened); |
157 | step_system_title($step++, $do_edits, $errors_happened); |
157 | 158 | ||
158 | # --- |
159 | # --- |
159 | 160 |