@@ -256,7 +256,7 @@ |
||
| 256 | 256 | <dd> |
| 257 | 257 | <select name="cookielength" id="cookielength">'; |
| 258 | 258 | |
| 259 | - if(!empty($context['login_cookie_times'])) |
|
| 259 | + if (!empty($context['login_cookie_times'])) |
|
| 260 | 260 | foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
| 261 | 261 | echo ' |
| 262 | 262 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
@@ -28,15 +28,17 @@ discard block |
||
| 28 | 28 | <form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">'; |
| 29 | 29 | |
| 30 | 30 | // Did they make a mistake last time? |
| 31 | - if (!empty($context['login_errors'])) |
|
| 32 | - echo ' |
|
| 31 | + if (!empty($context['login_errors'])) { |
|
| 32 | + echo ' |
|
| 33 | 33 | <div class="errorbox">', implode('<br>', $context['login_errors']), '</div> |
| 34 | 34 | <br>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // Or perhaps there's some special description for this time? |
| 37 | - if (isset($context['description'])) |
|
| 38 | - echo ' |
|
| 38 | + if (isset($context['description'])) { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="information">', $context['description'], '</div>'; |
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | // Now just get the basic information - username, password, etc. |
| 42 | 44 | echo ' |
@@ -55,19 +57,21 @@ discard block |
||
| 55 | 57 | <dd> |
| 56 | 58 | <select name="cookielength" id="cookielength">'; |
| 57 | 59 | |
| 58 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
| 59 | - echo ' |
|
| 60 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) { |
|
| 61 | + echo ' |
|
| 60 | 62 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
| 63 | + } |
|
| 61 | 64 | |
| 62 | 65 | echo ' |
| 63 | 66 | </select> |
| 64 | 67 | </dd>'; |
| 65 | 68 | |
| 66 | 69 | // If they have deleted their account, give them a chance to change their mind. |
| 67 | - if (isset($context['login_show_undelete'])) |
|
| 68 | - echo ' |
|
| 70 | + if (isset($context['login_show_undelete'])) { |
|
| 71 | + echo ' |
|
| 69 | 72 | <dt class="alert">', $txt['undelete_account'], ':</dt> |
| 70 | 73 | <dd><input type="checkbox" name="undelete"></dd>'; |
| 74 | + } |
|
| 71 | 75 | |
| 72 | 76 | echo ' |
| 73 | 77 | </dl> |
@@ -85,8 +89,8 @@ discard block |
||
| 85 | 89 | document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus(); |
| 86 | 90 | }, 150);'; |
| 87 | 91 | |
| 88 | - if (!empty($context['from_ajax'])) |
|
| 89 | - echo ' |
|
| 92 | + if (!empty($context['from_ajax'])) { |
|
| 93 | + echo ' |
|
| 90 | 94 | form = $("#frmLogin"); |
| 91 | 95 | form.submit(function(e) { |
| 92 | 96 | e.preventDefault(); |
@@ -119,16 +123,18 @@ discard block |
||
| 119 | 123 | |
| 120 | 124 | return false; |
| 121 | 125 | });'; |
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | echo ' |
| 124 | 129 | </script> |
| 125 | 130 | </form>'; |
| 126 | 131 | |
| 127 | 132 | // It is a long story as to why we have this when we're clearly not going to use it. |
| 128 | - if (!empty($context['from_ajax'])) |
|
| 129 | - echo ' |
|
| 133 | + if (!empty($context['from_ajax'])) { |
|
| 134 | + echo ' |
|
| 130 | 135 | <br> |
| 131 | 136 | <a href="javascript:self.close();"></a>'; |
| 137 | + } |
|
| 132 | 138 | |
| 133 | 139 | echo ' |
| 134 | 140 | </div><!-- .roundframe --> |
@@ -151,11 +157,12 @@ discard block |
||
| 151 | 157 | </div> |
| 152 | 158 | <div class="roundframe">'; |
| 153 | 159 | |
| 154 | - if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) |
|
| 155 | - echo ' |
|
| 160 | + if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) { |
|
| 161 | + echo ' |
|
| 156 | 162 | <div class="error"> |
| 157 | 163 | ', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], ' |
| 158 | 164 | </div>'; |
| 165 | + } |
|
| 159 | 166 | |
| 160 | 167 | echo ' |
| 161 | 168 | <form action="', $context['tfa_url'], '" method="post" id="frmTfa"> |
@@ -183,8 +190,8 @@ discard block |
||
| 183 | 190 | <script> |
| 184 | 191 | form = $("#frmTfa");'; |
| 185 | 192 | |
| 186 | - if (!empty($context['from_ajax'])) |
|
| 187 | - echo ' |
|
| 193 | + if (!empty($context['from_ajax'])) { |
|
| 194 | + echo ' |
|
| 188 | 195 | form.submit(function(e) { |
| 189 | 196 | // If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page |
| 190 | 197 | if (form.find("input[name=tfa_backup]:first").val().length > 0) |
@@ -203,6 +210,7 @@ discard block |
||
| 203 | 210 | |
| 204 | 211 | return false; |
| 205 | 212 | });'; |
| 213 | + } |
|
| 206 | 214 | |
| 207 | 215 | echo ' |
| 208 | 216 | form.find("input[name=backup]").click(function(e) { |
@@ -234,10 +242,11 @@ discard block |
||
| 234 | 242 | <p class="information centertext"> |
| 235 | 243 | ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>'; |
| 236 | 244 | |
| 237 | - if ($context['can_register']) |
|
| 238 | - echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 239 | - else |
|
| 240 | - echo $txt['login_below']; |
|
| 245 | + if ($context['can_register']) { |
|
| 246 | + echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 247 | + } else { |
|
| 248 | + echo $txt['login_below']; |
|
| 249 | + } |
|
| 241 | 250 | |
| 242 | 251 | // And now the login information. |
| 243 | 252 | echo ' |
@@ -256,10 +265,11 @@ discard block |
||
| 256 | 265 | <dd> |
| 257 | 266 | <select name="cookielength" id="cookielength">'; |
| 258 | 267 | |
| 259 | - if(!empty($context['login_cookie_times'])) |
|
| 260 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
| 268 | + if(!empty($context['login_cookie_times'])) { |
|
| 269 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
| 261 | 270 | echo ' |
| 262 | 271 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
| 272 | + } |
|
| 263 | 273 | |
| 264 | 274 | echo ' |
| 265 | 275 | </select> |
@@ -316,9 +326,10 @@ discard block |
||
| 316 | 326 | <dd> |
| 317 | 327 | <select name="cookielength" id="cookielength">'; |
| 318 | 328 | |
| 319 | - foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) |
|
| 320 | - echo ' |
|
| 329 | + foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt) { |
|
| 330 | + echo ' |
|
| 321 | 331 | <option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>'; |
| 332 | + } |
|
| 322 | 333 | |
| 323 | 334 | echo ' |
| 324 | 335 | </select> |
@@ -352,9 +363,10 @@ discard block |
||
| 352 | 363 | </div> |
| 353 | 364 | <div class="roundframe centertext">'; |
| 354 | 365 | |
| 355 | - if (!empty($context['incorrect_password'])) |
|
| 356 | - echo ' |
|
| 366 | + if (!empty($context['incorrect_password'])) { |
|
| 367 | + echo ' |
|
| 357 | 368 | <div class="error">', $txt['admin_incorrect_password'], '</div>'; |
| 369 | + } |
|
| 358 | 370 | |
| 359 | 371 | echo ' |
| 360 | 372 | <strong>', $txt['password'], ':</strong> |
@@ -395,10 +407,11 @@ discard block |
||
| 395 | 407 | <dl>'; |
| 396 | 408 | |
| 397 | 409 | // You didn't even have an ID? |
| 398 | - if (empty($context['member_id'])) |
|
| 399 | - echo ' |
|
| 410 | + if (empty($context['member_id'])) { |
|
| 411 | + echo ' |
|
| 400 | 412 | <dt>', $txt['invalid_activation_username'], ':</dt> |
| 401 | 413 | <dd><input type="text" name="user" size="30"></dd>'; |
| 414 | + } |
|
| 402 | 415 | |
| 403 | 416 | echo ' |
| 404 | 417 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
@@ -435,13 +448,14 @@ discard block |
||
| 435 | 448 | <dd><input type="password" name="passwd" size="30"></dd> |
| 436 | 449 | </dl>'; |
| 437 | 450 | |
| 438 | - if ($context['can_activate']) |
|
| 439 | - echo ' |
|
| 451 | + if ($context['can_activate']) { |
|
| 452 | + echo ' |
|
| 440 | 453 | <p>', $txt['invalid_activation_known'], '</p> |
| 441 | 454 | <dl> |
| 442 | 455 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
| 443 | 456 | <dd><input type="text" name="code" size="30"></dd> |
| 444 | 457 | </dl>'; |
| 458 | + } |
|
| 445 | 459 | |
| 446 | 460 | echo ' |
| 447 | 461 | <p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p> |