| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 1 | <h1>Sign up for |
| 2 | <?php echo $SERVICE_NAME;?> |
| 3 | </h1> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 4 | |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 5 | <form class="needs-validation" novalidate action="" method="POST"> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 6 | <!-- Username input --> |
| 7 | <div class="form-outline mb-3"> |
| 8 | <label class="form-label font-weight-bold" for="form3Example3">Username*</label> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 9 | <input pattern="[^\s]{<?php echo $VAL_USER->min_username.','.$VAL_USER->max_username;?>}" required |
| 10 | title="At least 5 not whitespace characters" name="username" type="text" id="form3Example0" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 11 | class="form-control <?php if(isset($error) && $error && !isset($_POST['username'])){echo 'border-danger';}?>" |
| Marc Kupietz | b527e64 | 2023-02-23 10:04:21 +0100 | [diff] [blame] | 12 | placeholder="johndoe" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 13 | value="<?php echo isset($_POST['username']) ? htmlspecialchars($_POST['username']) : '' ?>" /> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 14 | <div class="invalid-feedback"> |
| 15 | Please choose a username with at least 5 not whitespace characters. |
| 16 | </div> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 17 | </div> |
| 18 | <!-- 2 column grid layout with text inputs for the first and last names --> |
| 19 | <div class="row mb-3"> |
| 20 | <div class="col"> |
| 21 | <div class="form-outline"> |
| 22 | <label class="form-label font-weight-bold" for="form3Example1">First name*</label> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 23 | <input pattern="[^\s]{<?php echo $VAL_USER->min_first_name.','.$VAL_USER->max_first_name;?>}" required |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 24 | title="At least 2 not whitespace characters" name="name" type="text" id="form3Example1" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 25 | class="form-control <?php if(isset($error) && $error && !isset($_POST['name'])){echo 'border-danger';}?>" |
| Marc Kupietz | b527e64 | 2023-02-23 10:04:21 +0100 | [diff] [blame] | 26 | placeholder="John" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 27 | value="<?php echo isset($_POST['name']) ? htmlspecialchars($_POST['name']) : '' ?>" /> |
| 28 | </div> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 29 | <div class="invalid-feedback"> |
| 30 | Please provide a first name with at least 2 not whitespace characters. |
| 31 | </div> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 32 | </div> |
| 33 | <div class="col"> |
| 34 | <div class="form-outline"> |
| 35 | <label class="form-label font-weight-bold" for="form3Example2">Last name*</label> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 36 | <input pattern="[^\s]{<?php echo $VAL_USER->min_last_name.','.$VAL_USER->max_last_name;?>}" required |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 37 | title="At least 2 not whitespace characters" name="last_name" type="text" id="form3Example2" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 38 | class="form-control <?php if(isset($error) && $error && !isset($_POST['last_name'])){echo 'border-danger';}?>" |
| 39 | placeholder="Doe" |
| 40 | value="<?php echo isset($_POST['last_name']) ? htmlspecialchars($_POST['last_name']) : '' ?>" /> |
| 41 | </div> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 42 | <div class="invalid-feedback"> |
| 43 | Please provide a last name with at least 2 not whitespace characters. |
| 44 | </div> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <!-- Email input --> |
| 49 | <div class="form-outline mb-3"> |
| 50 | <label class="form-label font-weight-bold" for="form3Example3">Email address*</label> |
| 51 | <input required name="email" type="email" id="form3Example3" |
| 52 | class="form-control <?php if(isset($error) && $error && !isset($_POST['email'])){echo 'border-danger';}?>" |
| 53 | placeholder="myemail@example.com" |
| 54 | value="<?php echo isset($_POST['email']) ? htmlspecialchars($_POST['email']) : '' ?>" /> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 55 | <div class="invalid-feedback"> |
| 56 | Please provide a valid email address. |
| 57 | </div> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 58 | </div> |
| 59 | |
| 60 | <!-- Password input --> |
| 61 | <div class="form-outline mb-3"> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 62 | <label class="form-label font-weight-bold" for="pw1">Password*</label> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 63 | <input pattern="[^\s]{<?php echo $VAL_USER->min_password.','.$VAL_USER->max_password;?>}" required |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 64 | title="At least 8 not whitespace characters" name="password" type="password" id="pw1" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 65 | class="form-control <?php if(isset($error) && $error && !isset($_POST['password'])){echo 'border-danger';}?>" |
| 66 | placeholder="********" |
| 67 | value="<?php echo isset($_POST['password']) ? htmlspecialchars($_POST['password']) : '' ?>" /> |
| 68 | </div> |
| 69 | <!-- Password input --> |
| 70 | <div class="form-outline mb-3"> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 71 | <label class="form-label font-weight-bold" for="pw2">Confirm your Password*</label> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 72 | <input pattern="[^\s]{<?php echo $VAL_USER->min_password.','.$VAL_USER->max_password;?>}" required |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 73 | title="At least 8 not whitespace characters" name="password_confirm" type="password" id="pw2" |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 74 | class="form-control <?php if(isset($error) && $error && !isset($_POST['password_confirm'])){echo 'border-danger';}?>" |
| 75 | placeholder="********" |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 76 | oninput="validate_pw2(this)" |
| 77 | /> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 78 | </div> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 79 | <hr class="mt-2 mb-3" /> |
| 80 | <div class="form-outline mb-3"> |
| 81 | <label class="form-label font-weight-bold" for="eula">End User License Agreement*</label> |
| 82 | <div class="form-group form-check"> |
| 83 | <input type="checkbox" class="form-check-input" id="eula" required |
| 84 | title="You need to agree to the EULA in order to proceed"> |
| 85 | <label class="form-check-label" for="eula">I have read and agree to to the |
| 86 | <?php echo $SERVICE_NAME; ?> <a |
| 87 | href="https://www2.ids-mannheim.de/cosmas2/projekt/register/license_agreement.html">End User License |
| 88 | Agreement</a> and will use |
| 89 | <?php echo $SERVICE_NAME; ?> only for academic and non-commercial purposes. |
| 90 | </label> |
| 91 | <div class="invalid-feedback"> |
| 92 | You need to agree to the EULA in order to proceed. |
| 93 | </div> |
| 94 | </div> |
| 95 | </div> |
| 96 | <hr class="mt-2 mb-3" /> |
| 97 | <div class="form-outline mb-3"> |
| 98 | <label class="form-label font-weight-bold" for="privacy_policy">Privacy Policy*</label> |
| 99 | <div class="form-group form-check"> |
| 100 | <input type="checkbox" class="form-check-input" name="privacy_policy" id="privacy_policy" required |
| 101 | title="You need to agree to the privacy policy in order to proceed"> |
| 102 | <label class="form-check-label" for="privacy_policy">I have read and agree |
| 103 | to to the |
| 104 | <?php echo $SERVICE_NAME; ?> <a |
| 105 | href="https://www2.ids-mannheim.de/cosmas2/web-app/datenschutz.html">Privacy Policy</a>. |
| 106 | </label> |
| 107 | <div class="invalid-feedback"> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 108 | You need to agree to the privacy policy in order to proceed. |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 109 | </div> |
| 110 | </div> |
| 111 | </div> |
| 112 | |
| 113 | <hr class="mt-2 mb-3" /> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 114 | <!--captcha here--> |
| 115 | <div class="form-outline mb-3"> |
| 116 | |
| 117 | <label class="form-label font-weight-bold" for="form3Example4">Captcha:</label> |
| 118 | <div class="container mb-2 offset-md-2"> |
| 119 | <img id="captcha" src="<?php echo $BASE_URL.'/captcha.php?token='.$_SESSION['captcha_token']; ?>" /> |
| 120 | <div id="reload_captcha"> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 121 | <button id="reload" class="btn btn-outline-info" type="button"> <span |
| 122 | class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 123 | </div> |
| 124 | </div> |
| Marc Kupietz | 7743428 | 2023-02-24 12:04:47 +0100 | [diff] [blame] | 125 | <input pattern="[^\s]{<?php echo $CAPTCHA_LENGTH; ?>,}" required |
| 126 | title="Please fill the captcha. It has 5 characters" name="captcha" type="text" id="form3Example6" |
| 127 | class="form-control" placeholder="Type what you see on the image above" /> |
| matheusfillipe | abd513e | 2021-05-11 03:29:11 -0300 | [diff] [blame] | 128 | </div> |
| 129 | |
| 130 | <!-- Submit button --> |
| 131 | <button name="type" value="register" type="submit" class="btn btn-primary float-right btn-md">Sign up</button> |
| 132 | |
| 133 | </form> |
| Marc Kupietz | 1f2b2e9 | 2023-02-24 13:04:40 +0100 | [diff] [blame^] | 134 | </div> |
| 135 | |
| 136 | <script> |
| 137 | // Example starter JavaScript for disabling form submissions if there are invalid fields |
| 138 | (function () { |
| 139 | 'use strict'; |
| 140 | window.addEventListener('load', function () { |
| 141 | // Fetch all the forms we want to apply custom Bootstrap validation styles to |
| 142 | var forms = document.getElementsByClassName('needs-validation'); |
| 143 | // Loop over them and prevent submission |
| 144 | var validation = Array.prototype.filter.call(forms, function (form) { |
| 145 | form.addEventListener('submit', function (event) { |
| 146 | if (form.checkValidity() === false) { |
| 147 | event.preventDefault(); |
| 148 | event.stopPropagation(); |
| 149 | } |
| 150 | form.classList.add('was-validated'); |
| 151 | }, false); |
| 152 | }); |
| 153 | }, false); |
| 154 | })(); |
| 155 | function validate_pw2(pw2) { |
| 156 | if (pw2.value !== $("#pw1").val()) { |
| 157 | pw2.setCustomValidity("Passwords do not match"); |
| 158 | } else { |
| 159 | pw2.setCustomValidity(""); // is valid |
| 160 | } |
| 161 | } |
| 162 | </script> |