Skip to content

Commit 6a23282

Browse files
committed
28 Sep 2023
1 parent 197ed8e commit 6a23282

File tree

11 files changed

+39
-13
lines changed

11 files changed

+39
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ I Was Here is an open-source PHP Student Attendance Management System. Featuring
3232

3333
## :bulb: DOCUMENTATION
3434
1) [How To Use](https://code-boxx.com/i-was-here-php-attendance-system/#sec-use)
35-
2) [FAQ](https://code-boxx.com/i-was-here-php-attendance-system/#sec-faq)
35+
2) [FAQ](https://code-boxx.com/core-boxx-php-framework/#sec-faq)
3636
3) [For The Developers](https://code-boxx.com/i-was-here-php-attendance-system/#sec-dev)
3737

3838
## :electric_plug: FRAMEWORKS
@@ -71,4 +71,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7171
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7272
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7373
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74-
SOFTWARE.
74+
SOFTWARE.

assets/favicon.png

-395 Bytes
Loading

assets/head-iwh.webp

-42.1 KB
Loading

assets/iwh-1.png

-2.2 KB
Loading

assets/users.webp

-7.2 KB
Loading

lib/CORE-Install-HTML.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
if (I_PUSH && I_OPENSSL) {
1313
require PATH_LIB . "webpush/autoload.php";
1414
define("I_VAPID", Minishlink\WebPush\VAPID::createVapidKeys());
15+
if (I_VAPID==null || I_VAPID==false || I_VAPID=="") {
16+
exit("Failed to generate push notification VAPID keys. Make sure that OpenSSL is properly installed and configured.");
17+
}
1518
}
1619

1720
// (C) HTML ?>
@@ -77,8 +80,11 @@
7780
</select>
7881
<label>Enforce HTTPS?</label>
7982
</div>
83+
<div class="text-secondary">
84+
* Once enforced, API will only respond to HTTPS calls. Recommended for live servers.
85+
</div>
8086
<div class="text-secondary mb-2">
81-
* If enforced, API will only respond to HTTPS calls - Recommended to set "yes" for live servers.
87+
* The host URL above need to be set to "HTTPS" if you want to enforce this.
8288
</div>
8389

8490
<div class="form-floating mb-2">
@@ -217,4 +223,4 @@
217223
<input id="gobtn" type="submit" class="btn btn-primary" value="Go!" disabled>
218224
</form>
219225
</div></body>
220-
</html>
226+
</html>

lib/CORE-Install-JS.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
// (E1) LOCK INSTALL FORM
6868
install.toggle(false);
6969

70-
// (E2) DUMMY PROOFING TO THE MAX!
70+
// (E2) URL DUMMY PROOFING TO THE MAX!
7171
let hHost = document.getElementsByName("host")[0],
7272
domain = hHost.value;
7373
domain = domain.trim();
@@ -77,8 +77,17 @@
7777
if (domain.charAt(domain.length-1) != "/") { domain = domain + "/"; }
7878
hHost.value = domain;
7979

80+
// (E3) DUMMY PROOFING - API ENFORCE HTTPS BUT HOST URL IS NOT HTTPS
81+
let https = document.getElementsByName("https")[0].value,
82+
enforce = document.getElementsByName("apihttps")[0].value;
83+
if (enforce==1 && https==0) {
84+
alert("Please set your HOST URL to HTTPS if you want to enforce HTTPS for API calls. Also make sure that you have a valid SSL cert.");
85+
install.toggle(true);
86+
return false;
87+
}
88+
8089
<?php if (I_USER) { ?>
81-
// (E3) ADMIN PASSWORD
90+
// (E4) ADMIN PASSWORD
8291
var pass = document.getElementsByName("apass")[0],
8392
cpass = document.getElementsByName("apassc")[0];
8493
if (pass.value != cpass.value) {
@@ -87,23 +96,23 @@
8796
return false;
8897
}
8998

90-
// (E4) PASSWORD STRENGTH CHECK - AT LEAST 8 CHARACTERS ALPHANUMERIC
99+
// (E5) PASSWORD STRENGTH CHECK - AT LEAST 8 CHARACTERS ALPHANUMERIC
91100
if (!/^(?=.*[0-9])(?=.*[A-Z]).{8,20}$/i.test(pass.value)) {
92101
alert("Password must be at least 8 characters alphanumeric");
93102
install.toggle(true);
94103
return false;
95104
}
96105
<?php } ?>
97106

98-
// (E5) URL PATH
107+
// (E6) URL PATH
99108
let url = (document.getElementsByName("https")[0].value=="0" ? "http" : "https")
100109
+ "://" + domain ;
101110

102-
// (E6) GENERATE HTACCESS
111+
// (E7) GENERATE HTACCESS
103112
install.ajax(url, "E1", () => {
104-
// (E7) VERIFY HTACCESS
113+
// (E8) VERIFY HTACCESS
105114
install.ajax(url + "installer/test/", "E2", () => {
106-
// (E8) PROCEED INSTALLATION
115+
// (E9) PROCEED INSTALLATION
107116
install.ajax(url, "F", () => {
108117
alert("Installation complete, this page will now reload.");
109118
location.href = url;
@@ -119,4 +128,4 @@
119128
install.rnd();
120129
install.toggle(true);
121130
};
122-
</script>
131+
</script>

pages/A-about.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<li><a href="https://code-boxx.com/i-was-here-php-attendance-system/#sec-use" target="_blank">
1212
How To Use?
1313
</a></li>
14-
<li><a href="https://code-boxx.com/i-was-here-php-attendance-system/#sec-faq" target="_blank">
14+
<li><a href="https://code-boxx.com/core-boxx-php-framework/#sec-faq" target="_blank">
1515
FAQ
1616
</a></li>
1717
<li><a href="https://code-boxx.com/i-was-here-php-attendance-system/#sec-dev" target="_blank">
@@ -36,6 +36,9 @@
3636
<a class="my-1 btn btn-danger d-flex-inline" href="https://payhip.com/codeboxx" target="_blank">
3737
<i class="ico-sm icon-cart"></i> Code Boxx Store
3838
</a>
39+
<a class="my-1 btn btn-danger d-flex-inline" href="https://github.com/sponsors/code-boxx" target="_blank">
40+
<i class="ico-sm icon-heart"></i> GitHub Sponsor
41+
</a>
3942
</div>
4043

4144
<h5 class="text-danger mb-2">

pages/PAGE-forgot.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
if (!isset($_GET["i"]) && !isset($_GET["h"])) {
77
$_PMETA = ["load" => [["s", HOST_ASSETS."PAGE-forgot.js", "defer"]]];
88
require PATH_PAGES . "TEMPLATE-top.php"; ?>
9+
<div class="container">
910
<div class="row justify-content-center">
1011
<div class="col-md-10 bg-white border">
1112
<div class="row">
@@ -31,13 +32,15 @@
3132
</div>
3233
</div>
3334
</div>
35+
</div>
3436
<?php require PATH_PAGES . "TEMPLATE-bottom.php"; }
3537

3638
// (C) PART 2 - VALIDATION
3739
else {
3840
$_CORE->load("Forgot");
3941
$pass = $_CORE->Forgot->reset($_GET["i"], $_GET["h"]);
4042
require PATH_PAGES . "TEMPLATE-top.php"; ?>
43+
<div class="container">
4144
<div class="row justify-content-center">
4245
<div class="col-md-10 bg-white border">
4346
<div class="row">
@@ -57,4 +60,5 @@
5760
</div>
5861
</div>
5962
</div>
63+
</div>
6064
<?php require PATH_PAGES . "TEMPLATE-bottom.php"; } ?>

pages/PAGE-login.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<?php } ?>
2020

2121
<!-- (C2) LOGIN FORM -->
22+
<div class="container">
2223
<div class="row justify-content-center">
2324
<div class="col-md-10 bg-white border">
2425
<div class="row">
@@ -62,4 +63,5 @@
6263
</div>
6364
</div>
6465
</div>
66+
</div>
6567
<?php require PATH_PAGES . "TEMPLATE-bottom.php"; ?>

0 commit comments

Comments
 (0)