summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-11-26 11:45:12 -0500
committerFreya Murphy <freya@freyacat.org>2024-11-26 11:45:12 -0500
commit82f911cf18c615d23d7a6934c36879e75f2cf46e (patch)
tree5171b3dbdedf96aee4740eeae03fec23b8d878aa /src
parentadd logout, better router (diff)
downloadldap_forwardauth-82f911cf18c615d23d7a6934c36879e75f2cf46e.tar.gz
ldap_forwardauth-82f911cf18c615d23d7a6934c36879e75f2cf46e.tar.bz2
ldap_forwardauth-82f911cf18c615d23d7a6934c36879e75f2cf46e.zip
new style, add redirect support
Diffstat (limited to '')
-rw-r--r--src/public/bg.jpgbin375672 -> 0 bytes
-rw-r--r--src/public/bg/0001.jpgbin0 -> 292263 bytes
-rw-r--r--src/public/bg/0002.jpgbin0 -> 972557 bytes
-rw-r--r--src/public/bg/0003.jpgbin0 -> 701659 bytes
-rw-r--r--src/public/bg/0004.jpgbin0 -> 3232092 bytes
-rw-r--r--src/public/bg/0005.jpgbin0 -> 697801 bytes
-rw-r--r--src/public/bg/0006.jpgbin0 -> 2246869 bytes
-rw-r--r--src/public/bg/0007.jpgbin0 -> 567141 bytes
-rw-r--r--src/public/bg/0008.jpgbin0 -> 581858 bytes
-rw-r--r--src/public/bg/0009.jpgbin0 -> 329394 bytes
-rw-r--r--src/public/bg/0010.jpgbin0 -> 876388 bytes
-rw-r--r--src/public/bg/0011.jpgbin0 -> 826411 bytes
-rw-r--r--src/public/bg/0012.jpgbin0 -> 1713099 bytes
-rw-r--r--src/public/bg/0013.jpgbin0 -> 383242 bytes
-rw-r--r--src/public/bg/0014.jpgbin0 -> 853377 bytes
-rw-r--r--src/public/bg/0015.jpgbin0 -> 1077746 bytes
-rw-r--r--src/public/bg/0016.jpgbin0 -> 298351 bytes
-rw-r--r--src/public/bg/0017.jpgbin0 -> 176187 bytes
-rw-r--r--src/public/bg/0018.jpgbin0 -> 201450 bytes
-rw-r--r--src/public/bg/0019.jpgbin0 -> 1920339 bytes
-rw-r--r--src/public/bg/0020.jpgbin0 -> 435255 bytes
-rw-r--r--src/public/bg/0021.jpgbin0 -> 1376229 bytes
-rw-r--r--src/public/bg/0022.jpgbin0 -> 189340 bytes
-rw-r--r--src/public/bg/0023.jpgbin0 -> 160591 bytes
-rw-r--r--src/public/bg/0024.jpgbin0 -> 186170 bytes
-rw-r--r--src/public/bg/0025.jpgbin0 -> 187031 bytes
-rw-r--r--src/public/bg/0026.jpgbin0 -> 570904 bytes
-rw-r--r--src/public/bg/0027.jpgbin0 -> 404926 bytes
-rw-r--r--src/public/bg/0028.jpgbin0 -> 790571 bytes
-rw-r--r--src/public/bg/0029.jpgbin0 -> 1250915 bytes
-rw-r--r--src/public/bg/0030.jpgbin0 -> 788146 bytes
-rw-r--r--src/public/bg/0031.jpgbin0 -> 1390417 bytes
-rw-r--r--src/public/bg/0032.jpgbin0 -> 874898 bytes
-rw-r--r--src/public/bg/0033.jpgbin0 -> 583597 bytes
-rw-r--r--src/public/bg/0034.jpgbin0 -> 451506 bytes
-rw-r--r--src/public/bg/0035.jpgbin0 -> 181638 bytes
-rw-r--r--src/public/bg/0036.jpgbin0 -> 158299 bytes
-rw-r--r--src/public/bg/0037.jpgbin0 -> 410963 bytes
-rw-r--r--src/public/bg/0038.jpgbin0 -> 449906 bytes
-rw-r--r--src/public/bg/0039.jpgbin0 -> 760648 bytes
-rw-r--r--src/public/bg/0040.jpgbin0 -> 581424 bytes
-rw-r--r--src/public/bg/0041.jpgbin0 -> 516970 bytes
-rw-r--r--src/public/bg/0042.jpgbin0 -> 726774 bytes
-rw-r--r--src/public/bg/0043.jpgbin0 -> 752305 bytes
-rw-r--r--src/public/bg/0044.jpgbin0 -> 320943 bytes
-rw-r--r--src/public/bg/0045.jpgbin0 -> 222990 bytes
-rw-r--r--src/public/bg/0046.jpgbin0 -> 987261 bytes
-rw-r--r--src/public/bg/0047.jpgbin0 -> 261181 bytes
-rw-r--r--src/public/bg/0048.jpgbin0 -> 421702 bytes
-rw-r--r--src/public/bg/0049.jpgbin0 -> 121040 bytes
-rw-r--r--src/public/bg/0050.jpgbin0 -> 250313 bytes
-rw-r--r--src/public/bg/0051.jpgbin0 -> 160861 bytes
-rw-r--r--src/public/bg/0052.jpgbin0 -> 578427 bytes
-rw-r--r--src/public/bg/0053.jpgbin0 -> 555419 bytes
-rw-r--r--src/public/bg/0054.jpgbin0 -> 439157 bytes
-rw-r--r--src/public/bg/0055.jpgbin0 -> 1696144 bytes
-rw-r--r--src/public/bg/0056.jpgbin0 -> 617640 bytes
-rw-r--r--src/public/bg/0057.jpgbin0 -> 357429 bytes
-rw-r--r--src/public/bg/0058.jpgbin0 -> 1358426 bytes
-rw-r--r--src/public/bg/0059.jpgbin0 -> 192383 bytes
-rw-r--r--src/public/bg/0060.jpgbin0 -> 219424 bytes
-rw-r--r--src/public/bg/0061.jpgbin0 -> 419496 bytes
-rw-r--r--src/public/bg/0062.jpgbin0 -> 171851 bytes
-rw-r--r--src/public/bg/0063.jpgbin0 -> 358778 bytes
-rw-r--r--src/public/bg/0064.jpgbin0 -> 1341817 bytes
-rw-r--r--src/public/bg/0065.jpgbin0 -> 565468 bytes
-rw-r--r--src/public/bg/0066.jpgbin0 -> 266503 bytes
-rw-r--r--src/public/bg/0067.jpgbin0 -> 396761 bytes
-rw-r--r--src/public/bg/0068.jpgbin0 -> 1399625 bytes
-rw-r--r--src/public/bg/0069.jpgbin0 -> 416106 bytes
-rw-r--r--src/public/bg/0070.jpgbin0 -> 447779 bytes
-rw-r--r--src/public/main.css148
-rw-r--r--src/public/opensans.ttfbin0 -> 529700 bytes
-rw-r--r--src/web/helpers/html.php21
-rw-r--r--src/web/index.php1
-rw-r--r--src/web/router.php52
-rw-r--r--src/web/views/error.php10
-rw-r--r--src/web/views/footer.php5
-rw-r--r--src/web/views/header.php8
-rw-r--r--src/web/views/login.php39
-rw-r--r--src/web/views/message.php2
81 files changed, 217 insertions, 69 deletions
diff --git a/src/public/bg.jpg b/src/public/bg.jpg
deleted file mode 100644
index 6f8314a..0000000
--- a/src/public/bg.jpg
+++ /dev/null
Binary files differ
diff --git a/src/public/bg/0001.jpg b/src/public/bg/0001.jpg
new file mode 100644
index 0000000..0ff8146
--- /dev/null
+++ b/src/public/bg/0001.jpg
Binary files differ
diff --git a/src/public/bg/0002.jpg b/src/public/bg/0002.jpg
new file mode 100644
index 0000000..4e5a0e4
--- /dev/null
+++ b/src/public/bg/0002.jpg
Binary files differ
diff --git a/src/public/bg/0003.jpg b/src/public/bg/0003.jpg
new file mode 100644
index 0000000..2d82fd9
--- /dev/null
+++ b/src/public/bg/0003.jpg
Binary files differ
diff --git a/src/public/bg/0004.jpg b/src/public/bg/0004.jpg
new file mode 100644
index 0000000..541578a
--- /dev/null
+++ b/src/public/bg/0004.jpg
Binary files differ
diff --git a/src/public/bg/0005.jpg b/src/public/bg/0005.jpg
new file mode 100644
index 0000000..8b58607
--- /dev/null
+++ b/src/public/bg/0005.jpg
Binary files differ
diff --git a/src/public/bg/0006.jpg b/src/public/bg/0006.jpg
new file mode 100644
index 0000000..583e4fc
--- /dev/null
+++ b/src/public/bg/0006.jpg
Binary files differ
diff --git a/src/public/bg/0007.jpg b/src/public/bg/0007.jpg
new file mode 100644
index 0000000..77dea69
--- /dev/null
+++ b/src/public/bg/0007.jpg
Binary files differ
diff --git a/src/public/bg/0008.jpg b/src/public/bg/0008.jpg
new file mode 100644
index 0000000..baa0568
--- /dev/null
+++ b/src/public/bg/0008.jpg
Binary files differ
diff --git a/src/public/bg/0009.jpg b/src/public/bg/0009.jpg
new file mode 100644
index 0000000..19c924f
--- /dev/null
+++ b/src/public/bg/0009.jpg
Binary files differ
diff --git a/src/public/bg/0010.jpg b/src/public/bg/0010.jpg
new file mode 100644
index 0000000..864c074
--- /dev/null
+++ b/src/public/bg/0010.jpg
Binary files differ
diff --git a/src/public/bg/0011.jpg b/src/public/bg/0011.jpg
new file mode 100644
index 0000000..ebfda51
--- /dev/null
+++ b/src/public/bg/0011.jpg
Binary files differ
diff --git a/src/public/bg/0012.jpg b/src/public/bg/0012.jpg
new file mode 100644
index 0000000..e7ce9cd
--- /dev/null
+++ b/src/public/bg/0012.jpg
Binary files differ
diff --git a/src/public/bg/0013.jpg b/src/public/bg/0013.jpg
new file mode 100644
index 0000000..8ef8658
--- /dev/null
+++ b/src/public/bg/0013.jpg
Binary files differ
diff --git a/src/public/bg/0014.jpg b/src/public/bg/0014.jpg
new file mode 100644
index 0000000..c3989fd
--- /dev/null
+++ b/src/public/bg/0014.jpg
Binary files differ
diff --git a/src/public/bg/0015.jpg b/src/public/bg/0015.jpg
new file mode 100644
index 0000000..117a684
--- /dev/null
+++ b/src/public/bg/0015.jpg
Binary files differ
diff --git a/src/public/bg/0016.jpg b/src/public/bg/0016.jpg
new file mode 100644
index 0000000..e6aec55
--- /dev/null
+++ b/src/public/bg/0016.jpg
Binary files differ
diff --git a/src/public/bg/0017.jpg b/src/public/bg/0017.jpg
new file mode 100644
index 0000000..8a3fa8c
--- /dev/null
+++ b/src/public/bg/0017.jpg
Binary files differ
diff --git a/src/public/bg/0018.jpg b/src/public/bg/0018.jpg
new file mode 100644
index 0000000..86f9ac1
--- /dev/null
+++ b/src/public/bg/0018.jpg
Binary files differ
diff --git a/src/public/bg/0019.jpg b/src/public/bg/0019.jpg
new file mode 100644
index 0000000..b67060f
--- /dev/null
+++ b/src/public/bg/0019.jpg
Binary files differ
diff --git a/src/public/bg/0020.jpg b/src/public/bg/0020.jpg
new file mode 100644
index 0000000..01b63fd
--- /dev/null
+++ b/src/public/bg/0020.jpg
Binary files differ
diff --git a/src/public/bg/0021.jpg b/src/public/bg/0021.jpg
new file mode 100644
index 0000000..c34702e
--- /dev/null
+++ b/src/public/bg/0021.jpg
Binary files differ
diff --git a/src/public/bg/0022.jpg b/src/public/bg/0022.jpg
new file mode 100644
index 0000000..32ab2f9
--- /dev/null
+++ b/src/public/bg/0022.jpg
Binary files differ
diff --git a/src/public/bg/0023.jpg b/src/public/bg/0023.jpg
new file mode 100644
index 0000000..120ab71
--- /dev/null
+++ b/src/public/bg/0023.jpg
Binary files differ
diff --git a/src/public/bg/0024.jpg b/src/public/bg/0024.jpg
new file mode 100644
index 0000000..e2200cd
--- /dev/null
+++ b/src/public/bg/0024.jpg
Binary files differ
diff --git a/src/public/bg/0025.jpg b/src/public/bg/0025.jpg
new file mode 100644
index 0000000..e1ebc9c
--- /dev/null
+++ b/src/public/bg/0025.jpg
Binary files differ
diff --git a/src/public/bg/0026.jpg b/src/public/bg/0026.jpg
new file mode 100644
index 0000000..fe7244c
--- /dev/null
+++ b/src/public/bg/0026.jpg
Binary files differ
diff --git a/src/public/bg/0027.jpg b/src/public/bg/0027.jpg
new file mode 100644
index 0000000..e40dcf2
--- /dev/null
+++ b/src/public/bg/0027.jpg
Binary files differ
diff --git a/src/public/bg/0028.jpg b/src/public/bg/0028.jpg
new file mode 100644
index 0000000..602df1f
--- /dev/null
+++ b/src/public/bg/0028.jpg
Binary files differ
diff --git a/src/public/bg/0029.jpg b/src/public/bg/0029.jpg
new file mode 100644
index 0000000..f9f652f
--- /dev/null
+++ b/src/public/bg/0029.jpg
Binary files differ
diff --git a/src/public/bg/0030.jpg b/src/public/bg/0030.jpg
new file mode 100644
index 0000000..6f24103
--- /dev/null
+++ b/src/public/bg/0030.jpg
Binary files differ
diff --git a/src/public/bg/0031.jpg b/src/public/bg/0031.jpg
new file mode 100644
index 0000000..cda7b71
--- /dev/null
+++ b/src/public/bg/0031.jpg
Binary files differ
diff --git a/src/public/bg/0032.jpg b/src/public/bg/0032.jpg
new file mode 100644
index 0000000..43b0672
--- /dev/null
+++ b/src/public/bg/0032.jpg
Binary files differ
diff --git a/src/public/bg/0033.jpg b/src/public/bg/0033.jpg
new file mode 100644
index 0000000..39510c4
--- /dev/null
+++ b/src/public/bg/0033.jpg
Binary files differ
diff --git a/src/public/bg/0034.jpg b/src/public/bg/0034.jpg
new file mode 100644
index 0000000..f724db1
--- /dev/null
+++ b/src/public/bg/0034.jpg
Binary files differ
diff --git a/src/public/bg/0035.jpg b/src/public/bg/0035.jpg
new file mode 100644
index 0000000..ca31ff5
--- /dev/null
+++ b/src/public/bg/0035.jpg
Binary files differ
diff --git a/src/public/bg/0036.jpg b/src/public/bg/0036.jpg
new file mode 100644
index 0000000..5c7daeb
--- /dev/null
+++ b/src/public/bg/0036.jpg
Binary files differ
diff --git a/src/public/bg/0037.jpg b/src/public/bg/0037.jpg
new file mode 100644
index 0000000..27865c9
--- /dev/null
+++ b/src/public/bg/0037.jpg
Binary files differ
diff --git a/src/public/bg/0038.jpg b/src/public/bg/0038.jpg
new file mode 100644
index 0000000..9378daa
--- /dev/null
+++ b/src/public/bg/0038.jpg
Binary files differ
diff --git a/src/public/bg/0039.jpg b/src/public/bg/0039.jpg
new file mode 100644
index 0000000..9b9487f
--- /dev/null
+++ b/src/public/bg/0039.jpg
Binary files differ
diff --git a/src/public/bg/0040.jpg b/src/public/bg/0040.jpg
new file mode 100644
index 0000000..5fe91ca
--- /dev/null
+++ b/src/public/bg/0040.jpg
Binary files differ
diff --git a/src/public/bg/0041.jpg b/src/public/bg/0041.jpg
new file mode 100644
index 0000000..eb77cc3
--- /dev/null
+++ b/src/public/bg/0041.jpg
Binary files differ
diff --git a/src/public/bg/0042.jpg b/src/public/bg/0042.jpg
new file mode 100644
index 0000000..ce857a2
--- /dev/null
+++ b/src/public/bg/0042.jpg
Binary files differ
diff --git a/src/public/bg/0043.jpg b/src/public/bg/0043.jpg
new file mode 100644
index 0000000..8d1c961
--- /dev/null
+++ b/src/public/bg/0043.jpg
Binary files differ
diff --git a/src/public/bg/0044.jpg b/src/public/bg/0044.jpg
new file mode 100644
index 0000000..cbcacbb
--- /dev/null
+++ b/src/public/bg/0044.jpg
Binary files differ
diff --git a/src/public/bg/0045.jpg b/src/public/bg/0045.jpg
new file mode 100644
index 0000000..1852910
--- /dev/null
+++ b/src/public/bg/0045.jpg
Binary files differ
diff --git a/src/public/bg/0046.jpg b/src/public/bg/0046.jpg
new file mode 100644
index 0000000..0e491f3
--- /dev/null
+++ b/src/public/bg/0046.jpg
Binary files differ
diff --git a/src/public/bg/0047.jpg b/src/public/bg/0047.jpg
new file mode 100644
index 0000000..18a6b92
--- /dev/null
+++ b/src/public/bg/0047.jpg
Binary files differ
diff --git a/src/public/bg/0048.jpg b/src/public/bg/0048.jpg
new file mode 100644
index 0000000..32b6422
--- /dev/null
+++ b/src/public/bg/0048.jpg
Binary files differ
diff --git a/src/public/bg/0049.jpg b/src/public/bg/0049.jpg
new file mode 100644
index 0000000..0760400
--- /dev/null
+++ b/src/public/bg/0049.jpg
Binary files differ
diff --git a/src/public/bg/0050.jpg b/src/public/bg/0050.jpg
new file mode 100644
index 0000000..c203587
--- /dev/null
+++ b/src/public/bg/0050.jpg
Binary files differ
diff --git a/src/public/bg/0051.jpg b/src/public/bg/0051.jpg
new file mode 100644
index 0000000..1b8d855
--- /dev/null
+++ b/src/public/bg/0051.jpg
Binary files differ
diff --git a/src/public/bg/0052.jpg b/src/public/bg/0052.jpg
new file mode 100644
index 0000000..e91914e
--- /dev/null
+++ b/src/public/bg/0052.jpg
Binary files differ
diff --git a/src/public/bg/0053.jpg b/src/public/bg/0053.jpg
new file mode 100644
index 0000000..82cbd0f
--- /dev/null
+++ b/src/public/bg/0053.jpg
Binary files differ
diff --git a/src/public/bg/0054.jpg b/src/public/bg/0054.jpg
new file mode 100644
index 0000000..26a3992
--- /dev/null
+++ b/src/public/bg/0054.jpg
Binary files differ
diff --git a/src/public/bg/0055.jpg b/src/public/bg/0055.jpg
new file mode 100644
index 0000000..687f3c9
--- /dev/null
+++ b/src/public/bg/0055.jpg
Binary files differ
diff --git a/src/public/bg/0056.jpg b/src/public/bg/0056.jpg
new file mode 100644
index 0000000..d63123f
--- /dev/null
+++ b/src/public/bg/0056.jpg
Binary files differ
diff --git a/src/public/bg/0057.jpg b/src/public/bg/0057.jpg
new file mode 100644
index 0000000..29e0e78
--- /dev/null
+++ b/src/public/bg/0057.jpg
Binary files differ
diff --git a/src/public/bg/0058.jpg b/src/public/bg/0058.jpg
new file mode 100644
index 0000000..0573f0b
--- /dev/null
+++ b/src/public/bg/0058.jpg
Binary files differ
diff --git a/src/public/bg/0059.jpg b/src/public/bg/0059.jpg
new file mode 100644
index 0000000..b8f509c
--- /dev/null
+++ b/src/public/bg/0059.jpg
Binary files differ
diff --git a/src/public/bg/0060.jpg b/src/public/bg/0060.jpg
new file mode 100644
index 0000000..221b115
--- /dev/null
+++ b/src/public/bg/0060.jpg
Binary files differ
diff --git a/src/public/bg/0061.jpg b/src/public/bg/0061.jpg
new file mode 100644
index 0000000..2493e91
--- /dev/null
+++ b/src/public/bg/0061.jpg
Binary files differ
diff --git a/src/public/bg/0062.jpg b/src/public/bg/0062.jpg
new file mode 100644
index 0000000..264caa1
--- /dev/null
+++ b/src/public/bg/0062.jpg
Binary files differ
diff --git a/src/public/bg/0063.jpg b/src/public/bg/0063.jpg
new file mode 100644
index 0000000..47a25c8
--- /dev/null
+++ b/src/public/bg/0063.jpg
Binary files differ
diff --git a/src/public/bg/0064.jpg b/src/public/bg/0064.jpg
new file mode 100644
index 0000000..28932ca
--- /dev/null
+++ b/src/public/bg/0064.jpg
Binary files differ
diff --git a/src/public/bg/0065.jpg b/src/public/bg/0065.jpg
new file mode 100644
index 0000000..2477bac
--- /dev/null
+++ b/src/public/bg/0065.jpg
Binary files differ
diff --git a/src/public/bg/0066.jpg b/src/public/bg/0066.jpg
new file mode 100644
index 0000000..4e8fbe9
--- /dev/null
+++ b/src/public/bg/0066.jpg
Binary files differ
diff --git a/src/public/bg/0067.jpg b/src/public/bg/0067.jpg
new file mode 100644
index 0000000..aafede1
--- /dev/null
+++ b/src/public/bg/0067.jpg
Binary files differ
diff --git a/src/public/bg/0068.jpg b/src/public/bg/0068.jpg
new file mode 100644
index 0000000..e4fde22
--- /dev/null
+++ b/src/public/bg/0068.jpg
Binary files differ
diff --git a/src/public/bg/0069.jpg b/src/public/bg/0069.jpg
new file mode 100644
index 0000000..e7d5ec4
--- /dev/null
+++ b/src/public/bg/0069.jpg
Binary files differ
diff --git a/src/public/bg/0070.jpg b/src/public/bg/0070.jpg
new file mode 100644
index 0000000..c7e1e6f
--- /dev/null
+++ b/src/public/bg/0070.jpg
Binary files differ
diff --git a/src/public/main.css b/src/public/main.css
index 2c5ecf2..ddaa7ce 100644
--- a/src/public/main.css
+++ b/src/public/main.css
@@ -1,68 +1,150 @@
+@font-face {
+ font-family: 'Open Sans';
+ src: url('opensans.ttf');
+}
+
:root {
+ --white: #fff;
+ --grey: #F5F5F5;
+ --black: #2D2D2F;
+
+ --text: var(--black);
+ --font: 'Playfair Display';
--blue: rgb(0, 102, 204);
+
+ --font-size: 140%;
+ --font-small: 60%;
+
+ --radius: 7px;
}
* {
box-sizing: border-box;
}
-html, body {
+html,
+body,
+main {
+ min-height: 100vh;
height: 100%;
- padding: 0;
- margin: 0;
}
body {
+ background: var(--white);
+ color: var(--text);
+ font-family: 'Open Sans', Helvetica, Arial, sans-serif;
+ font-size: var(--font-size);
+ margin: 0;
+}
+
+.row {
display: flex;
+ flex-direction: row;
+ flex: 1;
+}
+
+.col {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
justify-content: center;
- background: url('./bg.jpg')
- 50% 50%/cover no-repeat fixed;
- color: #fff;
- font-family: "Open Sans", Helvetica, Arial, sans-serif;
- font-weight: 100;
- font-size: 14px;
}
main {
- margin-top: 20vh;
- height: fit-content;
- width: 400px;
+ justify-content: center;
+ align-items: center;
background: #fff;
color: #000;
}
-main .heading {
- border-top: 5px solid var(--blue);
- font-size: 1.5rem;
- text-align: center;
- padding: 10px;
+main .content-box {
+ margin: auto 0;
+ height: 100%;
+ align-items: center;
}
main .content {
- padding: 10px;
+ padding: 40px;
+ min-width: 400px;
}
-main .content, form {
- display: flex;
- flex-direction: column;
+.btn {
+ background: var(--grey);
+ color: var(--black);
+ text-decoration: none;
+ font-size: var(--font-small);
+ padding: 10px 60px;
+ border-radius: var(--radius);
+ cursor: pointer;
}
-main label,
-main #submit {
- margin-top: 10px;
+.btn:hover {
+ outline: 1px solid var(--black);
+ transition: all 0.2s ease-out;
}
-main input {
- border: 1px solid #ddd;
+main .banner {
+ width: 100%;
+ height: 100%;
+}
+
+main .banner img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border-radius: 30px 0 0 30px;
+}
+
+input {
outline: none;
- padding: 7px;
- font-size: 14px;
- border-bottom-color: black;
+ border: none;
}
-main #submit {
- background: var(--blue);
- color: white;
- cursor: pointer;
+form input:not(.btn) {
+ display: block;
+ outline: 2px solid var(--grey);
+ margin-bottom: 10px;
+ padding: 10px;
+ min-width: 350px;
+ border-radius: var(--radius);
+ font-size: var(--font-small);
+}
+
+form input:not(.btn):focus {
+ outline-color: var(--blue);
+}
+
+form > div {
+ position: relative;
+}
+
+form label {
+ position: absolute;
+ top: 50%;
+ font-size: var(--font-small);
+ transform: translate(10px, -50%);
+ pointer-events: none;
+}
+
+input:focus + label,
+input:not(:placeholder-shown) + label {
+ top: 0;
+ padding: 2px;
+ background-color: var(--white);
+ transition: all 0.2s ease-out;
+}
+
+@media (max-width: 1200px) {
+ .row {
+ flex-direction: column !important;
+ }
+
+ main .banner {
+ height: 50% !important;
+ }
+
+ main .banner img {
+ border-radius: 30px 30px 0 0;
+ }
}
diff --git a/src/public/opensans.ttf b/src/public/opensans.ttf
new file mode 100644
index 0000000..ac587b4
--- /dev/null
+++ b/src/public/opensans.ttf
Binary files differ
diff --git a/src/web/helpers/html.php b/src/web/helpers/html.php
new file mode 100644
index 0000000..dc38e3a
--- /dev/null
+++ b/src/web/helpers/html.php
@@ -0,0 +1,21 @@
+<?php /* Copyright (c) 2024 Freya Murphy */
+
+function is_base64(string $data): bool {
+ return base64_encode(base64_decode($data, true)) === $data;
+}
+
+function maybe_base64_encode(string $data): string {
+ if (is_base64($data)) {
+ return $data;
+ } else {
+ return base64_encode($data);
+ }
+}
+
+function esc(string $data): string {
+ $data = trim(preg_replace('/\s\s+/', ' ', $data));
+ $data = str_replace('&', '&amp;', $data);
+ $data = str_replace('<', '&lt;', $data);
+ $data = str_replace('>', '&gt;', $data);
+ return $data;
+}
diff --git a/src/web/index.php b/src/web/index.php
index d4271c9..c4417ea 100644
--- a/src/web/index.php
+++ b/src/web/index.php
@@ -6,6 +6,7 @@ $webroot = dirname(__FILE__);
$publicroot = realpath(dirname(__FILE__) . '/../public');
// load stuff
+require($webroot . '/helpers/html.php');
require($webroot . '/helpers/schema.php');
require($webroot . '/helpers/ldap.php');
require($webroot . '/helpers/auth.php');
diff --git a/src/web/router.php b/src/web/router.php
index ce30f8b..536e228 100644
--- a/src/web/router.php
+++ b/src/web/router.php
@@ -17,12 +17,13 @@ class Router {
/**
* Displays a page to the user
* @param string $file
- * @param array<string,mixed> $data
- */
- private function send_page(
+ * @param array<string,mixed> $data
+ */
+ private function send_page(
string $file,
array $data = array()
): void {
+ $data['bg'] = random_int(1, 70);
extract($data);
$webroot = $GLOBALS['webroot'];
require($webroot . '/views/header.php');
@@ -35,7 +36,7 @@ class Router {
* @param string $title
* @param string $msg
* @param int $code
- */
+ */
private function send_message(
string $title,
string $msg
@@ -50,15 +51,16 @@ class Router {
* Gets the HTTP request information
*/
private function get_req(): array {
- $path = $_SERVER['REQUEST_URI'];
+ $uri = $_SERVER['REQUEST_URI'];
+ $path = parse_url($uri)['path'];
$method = $_SERVER['REQUEST_METHOD'];
return [$method, $path];
}
- /**
- * @param array<string> $fields
- */
- private function get_post_info(
+ /**
+ * @param array<string> $fields
+ */
+ private function get_post_info(
string ...$fields
): ?array {
$values = array();
@@ -88,10 +90,18 @@ class Router {
return;
}
+ $redirect = $this->get_post_info('redirect') ?? '';
+ if (is_array($redirect)) {
+ $redirect = $redirect['redirect'];
+ $redirect = base64_decode($redirect);
+ }
+
$user = $this->ldap->search($info['username']);
if ($user == NULL || !count($user)) {
http_response_code(400);
- $this->send_message('Error', 'User does not exist');
+ $this->send_page('error', array(
+ 'title' => 'Error',
+ 'redirect' => $redirect));
return;
}
@@ -108,9 +118,18 @@ class Router {
$session = $this->auth->create_session($user);
- http_response_code(200);
- $session->write_headers();
- $this->send_message('Success', 'Authenticated. You can now go back to your content');
+ if ($redirect == '') {
+ http_response_code(200);
+ $session->write_headers();
+ $this->send_message('Success', 'Authenticated. You can now go back to your content');
+ } else {
+ if (!str_starts_with($redirect, 'http')) {
+ $redirect = 'http://' . $redirect;
+ }
+ http_response_code(303);
+ $session->write_headers();
+ header("Location: $redirect");
+ }
}
private function handle_logout(): void {
@@ -131,7 +150,7 @@ class Router {
'You have been logged out successfully.');
}
- private function handle_auth(): void {
+ private function handle_auth(): void {
$session = $this->auth->get_session();
if ($session == NULL) {
// redirect them to login
@@ -145,14 +164,15 @@ class Router {
http_response_code(200);
$session->write_headers();
$this->send_message('Authenticated',
- 'You are already logged in.<br><br><a href="logout">Log Out</a>');
+ '<a class="btn" href="logout">Log Out</a>');
}
}
private function page_login(): void {
http_response_code(200);
$this->send_page('login', array(
- 'title' => 'Login'
+ 'title' => 'Login',
+ 'redirect' => $_GET['redirect'] ?? ''
));
}
diff --git a/src/web/views/error.php b/src/web/views/error.php
new file mode 100644
index 0000000..2860336
--- /dev/null
+++ b/src/web/views/error.php
@@ -0,0 +1,10 @@
+<?php /* Copyright (c) 2024 Freya Murphy */ ?>
+<form method="post" autocomplete="off">
+<span>Authentication failed</span>
+<br>
+<br>
+<a
+ class="btn"
+ href="/login?redirect=<?=maybe_base64_encode(esc($redirect))?>">
+ Go Back
+</a>
diff --git a/src/web/views/footer.php b/src/web/views/footer.php
index eb7ee28..bac99a3 100644
--- a/src/web/views/footer.php
+++ b/src/web/views/footer.php
@@ -1,4 +1,9 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
+ </div>
+ </div>
+ <div class="banner col">
+ <img src="/public/bg/<?=sprintf("%04d", $bg)?>.jpg">
+ </div>
</main>
</body>
</html>
diff --git a/src/web/views/header.php b/src/web/views/header.php
index befa190..3a608c3 100644
--- a/src/web/views/header.php
+++ b/src/web/views/header.php
@@ -4,13 +4,11 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&amp;subset=latin" rel="stylesheet">
<link rel="stylesheet" href="/public/main.css">
<title><?=$title?></title>
</head>
<body>
- <main id="main" role="main">
- <div class="heading">
- <span><?=$title?></span>
- </div>
+ <main id="main" role="main" class="row">
+ <div class="content-box col">
<div class="content">
+ <h1><?=$title?></h1>
diff --git a/src/web/views/login.php b/src/web/views/login.php
index 98d69af..ca38066 100644
--- a/src/web/views/login.php
+++ b/src/web/views/login.php
@@ -1,22 +1,33 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
-<form method="post">
-<label for="username">Username</label>
-<input
- type="text"
- id="username"
- name="username"
- autofocus="true"
->
-<label fot="password">Password</label>
-<input
- type="password"
- id="password"
- name="password"
->
+<form method="post" autocomplete="off">
+<div>
+ <input
+ type="text"
+ id="username"
+ name="username"
+ autofocus="true"
+ autocomplete="off"
+ placeholder=" ">
+ <label for="username">Username</label>
+</div>
+<div>
+ <input
+ type="password"
+ id="password"
+ name="password"
+ autocomplete="off"
+ placeholder=" ">
+ <label fot="password">Password</label>
+</div>
<input
type="submit"
role="button"
id="submit"
value="Sign In"
+ class="btn"
>
+<input
+ type="hidden"
+ name="redirect"
+ value="<?=maybe_base64_encode(esc($redirect))?>">
<form>
diff --git a/src/web/views/message.php b/src/web/views/message.php
index a071409..a8c074a 100644
--- a/src/web/views/message.php
+++ b/src/web/views/message.php
@@ -1 +1 @@
-<center><?=$msg?></center>
+<div class="inner"><?=$msg?></div>