Compare commits
329 Commits
Author | SHA1 | Date |
---|---|---|
Felix Albrigtsen | e7b66b4bc6 | |
Oystein Kristoffer Tveit | c62f4d4705 | |
Oystein Kristoffer Tveit | 814e5bc6c7 | |
Oystein Kristoffer Tveit | f57edf60c1 | |
Felix Albrigtsen | a29d3fe803 | |
Felix Albrigtsen | 8bcadd1d2d | |
Felix Albrigtsen | 8a82e2795c | |
Felix Albrigtsen | 4ee8b73044 | |
Oystein Kristoffer Tveit | 6580cfe546 | |
Oystein Kristoffer Tveit | a0f9e71d46 | |
Oystein Kristoffer Tveit | 6e4a79ed3d | |
Felix Albrigtsen | ce99b309f8 | |
Felix Albrigtsen | 37445f42b5 | |
Eirik Witterso | 9717c11af5 | |
Adrian Gunnar Lauterer | 2cab4df4b1 | |
Adrian Gunnar Lauterer | 18c8426246 | |
Oystein Kristoffer Tveit | 4890a0af04 | |
Felix Albrigtsen | 7bf2c31db3 | |
Adrian Gunnar Lauterer | 13a6df92ce | |
Adrian Gunnar Lauterer | f87c6820d7 | |
Adrian Gunnar Lauterer | 592c6d46c4 | |
Felix Albrigtsen | 9d9d99e6ba | |
Oystein Kristoffer Tveit | 216e153f89 | |
Felix Albrigtsen | d528df5f99 | |
Felix Albrigtsen | faf93cc45a | |
Felix Albrigtsen | 1aa4f4fc8a | |
Felix Albrigtsen | f1958d9afc | |
Felix Albrigtsen | 7f269f05d6 | |
Oystein Kristoffer Tveit | 7e158c9fc3 | |
Oystein Kristoffer Tveit | d79cd3ad37 | |
Felix Albrigtsen | f5a6868301 | |
Felix Albrigtsen | 310246dd20 | |
Felix Albrigtsen | 151a0d44f6 | |
Felix Albrigtsen | 10c70e89f6 | |
Felix Albrigtsen | 318e9cfe6b | |
Felix Albrigtsen | 1f60b80b98 | |
Felix Albrigtsen | 517f39eee9 | |
Felix Albrigtsen | 2f6553225a | |
Felix Albrigtsen | 1eb84eaec8 | |
Oystein Kristoffer Tveit | 3e1a21741f | |
Oystein Kristoffer Tveit | da6c1963f8 | |
Felix Albrigtsen | 0da5d44ea1 | |
Felix Albrigtsen | 133c4e269d | |
Felix Albrigtsen | 850c8da95a | |
Eirik Witterso | 1ae6356aa5 | |
Felix Albrigtsen | fa4fa9ad7d | |
Felix Albrigtsen | d43e5faf3c | |
Felix Albrigtsen | 57055c9c6f | |
Felix Albrigtsen | 5fbc1dbc00 | |
Felix Albrigtsen | e364a5fee0 | |
Oystein Kristoffer Tveit | a4a6553329 | |
Oystein Kristoffer Tveit | ae81d269fa | |
Felix Albrigtsen | 31d9a955df | |
Felix Albrigtsen | 6bd3ce7731 | |
Felix Albrigtsen | 9f45271b18 | |
Felix Albrigtsen | 567962c947 | |
Felix Albrigtsen | 7defd8b388 | |
Felix Albrigtsen | a7f2c4f2d3 | |
Felix Albrigtsen | 847fe67534 | |
Felix Albrigtsen | 79854aee6f | |
Felix Albrigtsen | 699876405c | |
Felix Albrigtsen | a734fe6bd3 | |
Felix Albrigtsen | c33736a501 | |
Bjornar Orjansen Kaarevik | 3a39ca0f73 | |
Felix Albrigtsen | d8f8aafdd9 | |
Bjornar Orjansen Kaarevik | 79ffb1fff5 | |
Felix Albrigtsen | 29c4c67645 | |
Bjornar Orjansen Kaarevik | 98da6ada23 | |
Felix Albrigtsen | 1c1656c3bc | |
Felix Albrigtsen | c489f303ea | |
Amalie Erdal Mansaker | fc0286c277 | |
Amalie Erdal Mansaker | f4407fde4a | |
Felix Albrigtsen | 9f11d442fe | |
Aleksander Knutsen | 1bc41124c0 | |
Bjornar Orjansen Kaarevik | 72fb9e9915 | |
Bjornar Orjansen Kaarevik | b555f915a0 | |
Felix Albrigtsen | 4b9957e9c5 | |
Felix Albrigtsen | b42214b404 | |
Felix Albrigtsen | fcef05d439 | |
Felix Albrigtsen | 0f8b15715b | |
Felix Albrigtsen | 8a79d9d016 | |
Felix Albrigtsen | f507b0cddd | |
Felix Albrigtsen | 0b25f8d54a | |
Felix Albrigtsen | 4f504e9456 | |
Felix Albrigtsen | 1f32c03d86 | |
Felix Albrigtsen | fc6d5d5f8e | |
Felix Albrigtsen | 1cde0a2a93 | |
Torstein Nordgård-Hansen | 65c0bad9b0 | |
Felix Albrigtsen | 9fa6066724 | |
Felix Albrigtsen | a506dc44cc | |
Felix Albrigtsen | a80114be7a | |
Felix Albrigtsen | ab6edd92e1 | |
Felix Albrigtsen | 6070cf4bd3 | |
Peder Bergebakken Sundt | fdd1d12e9e | |
Peder Bergebakken Sundt | 6cae4cb0e2 | |
Peder Bergebakken Sundt | 15c9431c10 | |
Felix Albrigtsen | 500ea63c77 | |
Torstein Nordgård-Hansen | bbe51e702b | |
Felix Albrigtsen | ab1bbdd3df | |
Felix Albrigtsen | 893f57c9b7 | |
Felix Albrigtsen | 184d40266b | |
Felix Albrigtsen | 516287ee85 | |
Felix Albrigtsen | 3335f5958e | |
Felix Albrigtsen | a7d7ce4da0 | |
Felix Albrigtsen | 1711ce2e5d | |
Felix Albrigtsen | 31e104a150 | |
Felix Albrigtsen | c57276b779 | |
Felix Albrigtsen | 9e7436684c | |
Felix Albrigtsen | a500b5eecc | |
Felix Albrigtsen | fb5b66f12b | |
Peder Bergebakken Sundt | e7f9799285 | |
Felix Albrigtsen | 25212940dd | |
Charlie Root | a1d56570b1 | |
Felix Albrigtsen | 15f2154f6a | |
Charlie Root | 6b81b0785f | |
Felix Albrigtsen | 6b243ad91b | |
Felix Albrigtsen | 63e49417a7 | |
Felix Albrigtsen | 6c891b3f79 | |
Felix Albrigtsen | a4ce890a36 | |
Felix Albrigtsen | 2ba0266fca | |
Felix Albrigtsen | 9f3812b8a5 | |
Felix Albrigtsen | a9ee7cd6f7 | |
Felix Albrigtsen | 1c4eb5cfe4 | |
Felix Albrigtsen | 9162ee70a7 | |
Felix Albrigtsen | bdbab5be9e | |
Felix Albrigtsen | 0d87d37c72 | |
Peder Bergebakken Sundt | 728f8a6179 | |
Peder Bergebakken Sundt | 8fd03c9824 | |
Felix Albrigtsen | fdbbaee175 | |
Felix Albrigtsen | 9dad49738c | |
Eirik Witterso | 0336236fda | |
Peder Bergebakken Sundt | 9a5e444041 | |
Eirik Witterso | cfeba9f8da | |
Eirik Witterso | 9691433917 | |
Peder Bergebakken Sundt | db6af95063 | |
Peder Bergebakken Sundt | cd1792c130 | |
Peder Bergebakken Sundt | dc99df21c2 | |
Peder Bergebakken Sundt | ecf40334e4 | |
Peder Bergebakken Sundt | e1686cd8c5 | |
dependabot[bot] | 06bfa81d6e | |
Torstein Nordgård-Hansen | 5ade47f6dd | |
Torstein Nordgård-Hansen | 7b237f1656 | |
Peder Bergebakken Sundt | 80198d0d98 | |
Torstein Nordgård-Hansen | 3c24435688 | |
Peder Bergebakken Sundt | b50a4a7ad4 | |
Peder Bergebakken Sundt | 523b30d6f5 | |
Peder Bergebakken Sundt | 06e530061d | |
Peder Bergebakken Sundt | c0c324217c | |
Sondre Haugen Elgaaen | 9b3735ea75 | |
Sondre Haugen Elgaaen | 9997b8fca9 | |
Sondre Haugen Elgaaen | 27986e0b1d | |
Emma Lu Eikemo | fe129fe1b0 | |
Emma Lu Eikemo | e08b23be05 | |
dependabot[bot] | 089b34833b | |
dependabot[bot] | 995b8d7ae7 | |
Peder Bergebakken Sundt | d248c94a3d | |
dependabot[bot] | d3584dae44 | |
Peder Bergebakken Sundt | a45eaab050 | |
dependabot[bot] | c6795dc1bf | |
Peder Bergebakken Sundt | d1734e8762 | |
dependabot[bot] | 69582db88f | |
dependabot[bot] | 66eb6f0907 | |
Peder Bergebakken Sundt | 74e86ded33 | |
Peder Bergebakken Sundt | ea7c33cb8e | |
Peder Bergebakken Sundt | 5ad772fc26 | |
Peder Bergebakken Sundt | 39126936b0 | |
Peder Bergebakken Sundt | c549890b7e | |
Peder Bergebakken Sundt | 09d5ebc249 | |
Peder Bergebakken Sundt | ead8f3a19c | |
Peder Bergebakken Sundt | c3ada63c69 | |
Peder Bergebakken Sundt | eb39821f20 | |
Peder Bergebakken Sundt | 59463ebdfb | |
Peder Bergebakken Sundt | d1612e2804 | |
Peder Bergebakken Sundt | 07c1a90845 | |
Peder Bergebakken Sundt | d0613a8734 | |
Peder Bergebakken Sundt | dd2ca22bba | |
Peder Bergebakken Sundt | 69ed1df0d1 | |
Peder Bergebakken Sundt | 386b0bfcbf | |
Markus Wang Halvorsen | 2b3d6d7026 | |
Markus Wang Halvorsen | b29106bcbe | |
Markus Wang Halvorsen | 6cc8e5e0da | |
Peder Bergebakken Sundt | 221f61c496 | |
Peder Bergebakken Sundt | f37919c850 | |
Peder Bergebakken Sundt | d3234d0204 | |
Peder Bergebakken Sundt | 6d13f47815 | |
Peder Bergebakken Sundt | e54142021a | |
Peder Bergebakken Sundt | cc2241f71a | |
Peder Bergebakken Sundt | cb9283be16 | |
Peder Bergebakken Sundt | 22a08bfb04 | |
Peder Bergebakken Sundt | 2f22451fa6 | |
Peder Bergebakken Sundt | 7dc892b757 | |
Peder Bergebakken Sundt | 7b08ea6a22 | |
Peder Bergebakken Sundt | fc35b804e4 | |
Peder Bergebakken Sundt | 376c7ad890 | |
Peder Bergebakken Sundt | 9f7ef8bdb1 | |
Peder Bergebakken Sundt | d4bdad8d5e | |
Peder Bergebakken Sundt | 7669566f81 | |
Peder Bergebakken Sundt | 023b53fa95 | |
Peder Bergebakken Sundt | 17ef9288ef | |
Peder Bergebakken Sundt | a600f8170a | |
Peder Bergebakken Sundt | 1540292458 | |
Peder Bergebakken Sundt | 3dc3b37044 | |
Peder Bergebakken Sundt | 52a50017c6 | |
Peder Bergebakken Sundt | fbcae7b67d | |
Peder Bergebakken Sundt | 69dcc15bea | |
Peder Bergebakken Sundt | 31a7470b37 | |
Peder Bergebakken Sundt | 79e413d194 | |
Peder Bergebakken Sundt | 307eba4218 | |
Peder Bergebakken Sundt | 5ef3bc68a0 | |
Peder Bergebakken Sundt | 5205a3f095 | |
Peder Bergebakken Sundt | 309e308518 | |
Yorin Anne De Jong | 90297af982 | |
Yorin Anne De Jong | e1e053af27 | |
Yorin Anne De Jong | e72bd066be | |
Yorin Anne De Jong | 474895c2a3 | |
Yorin Anne De Jong | 1066f42861 | |
Yorin Anne De Jong | 928647e6cc | |
Yorin Anne De Jong | 47c8ac90cb | |
Yorin Anne De Jong | 618c7c3eef | |
Yorin Anne De Jong | 2c2d1ab446 | |
Peder Bergebakken Sundt | 88e258a0fb | |
Peder Bergebakken Sundt | 29a41f5ad8 | |
Peder Bergebakken Sundt | 13518f7fff | |
Peder Bergebakken Sundt | 90ece46dd7 | |
Peder Bergebakken Sundt | d92e53f0b7 | |
Peder Bergebakken Sundt | b965da0a6c | |
Peder Bergebakken Sundt | a63bc3e6a9 | |
Peder Bergebakken Sundt | 1147c1a7af | |
Peder Bergebakken Sundt | 34668cb0ea | |
Peder Bergebakken Sundt | adab82964d | |
Peder Bergebakken Sundt | 21390d8ce8 | |
Peder Bergebakken Sundt | 6601ec041e | |
Peder Bergebakken Sundt | 4445f659a7 | |
Peder Bergebakken Sundt | 202f2ce12a | |
Peder Bergebakken Sundt | 734a3b023f | |
Peder Bergebakken Sundt | be5b1d7b81 | |
Peder Bergebakken Sundt | cb3949f6e8 | |
Peder Bergebakken Sundt | f5c088fdc1 | |
Peder Bergebakken Sundt | 6c7241a2ac | |
Peder Bergebakken Sundt | 8dcc899c34 | |
Peder Bergebakken Sundt | 32cc4ec27f | |
Peder Bergebakken Sundt | 29ac0ece7e | |
Peder Bergebakken Sundt | 3117f466b5 | |
Markus Wang Halvorsen | 9fec2d56f4 | |
Markus Wang Halvorsen | e60195d431 | |
Markus Wang Halvorsen | 54467ab9b9 | |
Markus Wang Halvorsen | 30c8aa2032 | |
Markus Wang Halvorsen | d984dfb89c | |
Markus Wang Halvorsen | 63200f863b | |
Markus Wang Halvorsen | 2a3f0d7be7 | |
Markus Wang Halvorsen | 5412414ce1 | |
Markus Wang Halvorsen | ebe3ce0e1e | |
Markus Wang Halvorsen | 43fb843b17 | |
Markus Wang Halvorsen | 3ccaf69549 | |
Markus Wang Halvorsen | ec69d5f724 | |
Markus Wang Halvorsen | 6777048dac | |
Markus Wang Halvorsen | 3832d3fde0 | |
Markus Wang Halvorsen | 32f9653a6d | |
Peder Bergebakken Sundt | 48d79f2635 | |
Peder Bergebakken Sundt | 54428c2bab | |
Peder Bergebakken Sundt | 4ca408b8fe | |
Peder Bergebakken Sundt | 550161bba2 | |
Peder Bergebakken Sundt | f6174706f8 | |
Peder Bergebakken Sundt | c2374d999d | |
Peder Bergebakken Sundt | 66504057b2 | |
Peder Bergebakken Sundt | f3b95fe641 | |
Peder Bergebakken Sundt | b016d27adb | |
Markus Wang Halvorsen | d44cf95736 | |
Markus Wang Halvorsen | cf058dc7a9 | |
Markus Wang Halvorsen | 9f935cd810 | |
Yorin Anne De Jong | e88411eea4 | |
Yorin Anne De Jong | 0bce2053cf | |
Yorin Anne De Jong | 1d65cab11d | |
Yorin Anne De Jong | 8f2299cee5 | |
Yorin Anne De Jong | ba0fe09d06 | |
Yorin Anne De Jong | 73efba625b | |
Yorin Anne De Jong | f2b75c81c1 | |
Yorin Anne De Jong | 060d37c040 | |
Yorin Anne De Jong | 24b6af1799 | |
Yorin Anne De Jong | edde8b6927 | |
Yorin Anne De Jong | 528ea62f38 | |
Markus Wang Halvorsen | 87c6523f35 | |
Yorin Anne De Jong | a4b01d1259 | |
Yorin Anne De Jong | f811286e52 | |
Yorin Anne De Jong | c38932046a | |
Markus Wang Halvorsen | f2a14f3791 | |
Yorin Anne De Jong | 53af8dae44 | |
Markus Wang Halvorsen | 1db31b9e56 | |
Markus Wang Halvorsen | af97383e01 | |
Yorin Anne De Jong | c12f38f133 | |
Yorin Anne De Jong | e7f11aee54 | |
Markus Wang Halvorsen | 98f882233c | |
Markus Wang Halvorsen | 5e10d53c36 | |
Yorin Anne De Jong | fe1e012db3 | |
Yorin Anne De Jong | e93b07f890 | |
Yorin Anne De Jong | 46eed1c223 | |
Yorin Anne De Jong | 1e973c31b2 | |
Yorin Anne De Jong | 84b6b60a37 | |
Markus Wang Halvorsen | 774f2754a0 | |
Markus Wang Halvorsen | 89ce6773a8 | |
Yorin Anne De Jong | 1f2de139eb | |
Yorin Anne De Jong | 4efe0aaefa | |
Markus Wang Halvorsen | 05dee57ded | |
Yorin Anne De Jong | 2d850c719d | |
Yorin Anne De Jong | 0d0305cf04 | |
Yorin Anne De Jong | 02f54c4458 | |
Yorin Anne De Jong | 39dfafd538 | |
Yorin Anne De Jong | 6162e2662c | |
Peder Bergebakken Sundt | 8a47ad96de | |
Peder Bergebakken Sundt | 61e7c73901 | |
Peder Bergebakken Sundt | e98084aaf4 | |
Peder Bergebakken Sundt | 9f38e2af1a | |
Yorin Anne De Jong | 8b148fe0e3 | |
Yorin Anne De Jong | ebedc31fb6 | |
Peder Bergebakken Sundt | 25da4a80f2 | |
Peder Bergebakken Sundt | b914590ea8 | |
Peder Bergebakken Sundt | 5dd2260948 | |
Peder Bergebakken Sundt | 6f2ab1ac00 | |
Markus Wang Halvorsen | 689428241c | |
Markus Wang Halvorsen | 0b0707eafe | |
Markus Wang Halvorsen | c4c5389fe8 | |
Markus Wang Halvorsen | 32aa9e077c | |
Markus Wang Halvorsen | 56e6766520 | |
Markus Wang Halvorsen | b1623f9da1 | |
Markus Wang Halvorsen | 1ea96f5c0d | |
Markus Wang Halvorsen | 2ee9a98277 | |
Markus Wang Halvorsen | 1f47b3849e | |
Markus Wang Halvorsen | ede224c2f2 | |
Markus Wang Halvorsen | c6cd02486d |
|
@ -0,0 +1,2 @@
|
|||
*.sh text eol=lf
|
||||
*.bat text eol=crlf
|
|
@ -1,5 +1,5 @@
|
|||
/sql_config.php
|
||||
/dataporten_config.php
|
||||
/result
|
||||
/config.php
|
||||
*.sqlite
|
||||
/test.sql
|
||||
/vendor/
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# this is a development container, not hardened for hosting
|
||||
FROM php:7.4-cli
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
sqlite3 \
|
||||
unzip \
|
||||
git
|
64
README.md
|
@ -1,4 +1,4 @@
|
|||
# Programvareverkstedet nettside
|
||||
# Programvareverkstedets nettside
|
||||
|
||||
A website created with the latest and greatest web technologies.
|
||||
May contain blackjack and other things one tends to include in awesome projects.
|
||||
|
@ -11,11 +11,69 @@ Put it in a folder your webserver can find.
|
|||
|
||||
## Development setup
|
||||
|
||||
Make sure you have sqlite3 and PHP installed, with pdo-sqlite module.
|
||||
Make sure you have `sqlite3`, `php` and `pdo-sqlite` installed.
|
||||
These can be obtained from your package manager.
|
||||
Then make sure PHP has the `curl`, `pdo-sqlite`, `ext-dom` and `sqlite3` extensions enabled, see `/etc/php/php.ini`.
|
||||
|
||||
To install all mentioned requirements on debian: `apt install composer sqlite3 php8.1-sqlite3 simplesamlphp php-xml`, followed by `composer update`.
|
||||
|
||||
./dev.sh
|
||||
|
||||
or on Windows, if you have PHP and sqlite3 available in path:
|
||||
On Windows you can use chocolatey and git bash to run `./dev.sh`.
|
||||
Install `php` and `sqlite`, then enable these extensions in `C:\tools\php80\php.ini`:
|
||||
`mbstring`, `openssl`, `curl`, `pdo-sqlite` and `sqlite3`
|
||||
|
||||
Alternatively you may use `cmd` on Windows.
|
||||
In this case you'll have to perform a `composer install` manually beforehand.
|
||||
Good luck.
|
||||
|
||||
dev.bat
|
||||
|
||||
|
||||
### Dependency management
|
||||
|
||||
`dev.sh` will ensure the git submodules have been properly pulled, then download the `composer` package manager to a php archive file named `composer.phar`, then run it.
|
||||
Composer will then check for the php extensions needed, such as `pdo_sqlite`, which must be enabled on your system.
|
||||
This usually includes installing a php-sqlite3 package and enabling it in `/etc/php/php.ini`:
|
||||
|
||||
[PHP]
|
||||
extension=pdo_sqlite
|
||||
extension=sqlite3
|
||||
extension=ext-curl
|
||||
|
||||
Composer is used as such:
|
||||
|
||||
php composer.phar update
|
||||
php composer.phar install
|
||||
|
||||
|
||||
### Docker
|
||||
|
||||
We provide a simple docker-compose setup for local development.
|
||||
First ensure that docker is running:
|
||||
|
||||
sudo systemctl start docker
|
||||
|
||||
then
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose up
|
||||
|
||||
|
||||
### Admin account
|
||||
|
||||
Login goes through `idp.pvv.ntnu.no` via SAML, so you have to use your PVV account.
|
||||
(This only works if you use access the local development site via the the hostname `localhost`)
|
||||
To make your account into an admin account, run:
|
||||
|
||||
sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
If using docker, when already running:
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose exec nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
If not already running:
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose run nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
|
||||
## Hosting
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
{
|
||||
"require": {
|
||||
"simplesamlphp/simplesamlphp": "~1"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-pdo_sqlite": "*"
|
||||
}
|
||||
"name": "programvareverkstedet/nettsiden",
|
||||
"description": "Programvareverkstedets nettside",
|
||||
"license": "proprietary",
|
||||
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"simplesamlphp/composer-module-installer": true
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"simplesamlphp/simplesamlphp": "^2.2",
|
||||
"erusev/parsedown": "^1.7"
|
||||
}
|
||||
}
|
11
dev.bat
|
@ -1,11 +0,0 @@
|
|||
REM php og sqlite3 må være tilgjengelig i PATH
|
||||
|
||||
IF EXIST "sql_config.php" goto config_end
|
||||
cp sql_config_example.php sql_config.php
|
||||
:config_end
|
||||
|
||||
IF EXIST "pvv.sqlite" goto sqlite_end
|
||||
sqlite3 pvv.sqlite < pvv.sql
|
||||
:sqlite_end
|
||||
|
||||
php -S [::1]:1080 -t www/ -c php.ini
|
19
dev.sh
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
which sqlite3 > /dev/null 2>&1 && test \! -e pvv.sqlite && sqlite3 pvv.sqlite < dist/pvv.sql
|
||||
test \! -e sql_config.php && cp -v dist/sql_config_example.php sql_config.php
|
||||
|
||||
test \! -e dataporten_config.php && cp -v dist/dataporten_config.php dataporten_config.php
|
||||
|
||||
test -e composer.phar || curl -O https://getcomposer.org/composer.phar
|
||||
|
||||
if test \! -d vendor; then
|
||||
php composer.phar install
|
||||
cp -v dist/authsources_example.php vendor/simplesamlphp/simplesamlphp/config/authsources.php
|
||||
cp -v dist/saml20-idp-remote.php vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
|
||||
# cp -v vendor/simplesamlphp/simplesamlphp/config-templates/config.php vendor/simplesamlphp/simplesamlphp/config/config.php
|
||||
sed -e "s/'trusted.url.domains' => array()/'trusted.url.domains' => array('localhost:1080')/g" < vendor/simplesamlphp/simplesamlphp/config-templates/config.php > vendor/simplesamlphp/simplesamlphp/config/config.php
|
||||
ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml
|
||||
fi
|
||||
|
||||
php -S [::1]:1080 -d error_reporting=E_ALL -d display_errors=1 -t www/
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
$DB_DSN = 'sqlite:'.__DIR__.DIRECTORY_SEPARATOR.'pvv.sqlite';
|
||||
$DB_USER = null;
|
||||
$DB_PASS = null;
|
||||
|
||||
$DOOR_SECRET = "changeme";
|
||||
|
||||
$GALLERY_DIR = __DIR__.DIRECTORY_SEPARATOR.'www'.DIRECTORY_SEPARATOR.'galleri'.DIRECTORY_SEPARATOR.'bilder'.DIRECTORY_SEPARATOR.'gallery';
|
||||
$GALLERY_SERVER_PATH = '/images/gallery/';
|
||||
|
||||
$SLIDESHOW_DIR = __DIR__.DIRECTORY_SEPARATOR.'www'.DIRECTORY_SEPARATOR.'galleri'.DIRECTORY_SEPARATOR.'bilder'.DIRECTORY_SEPARATOR.'slideshow';
|
||||
$SLIDESHOW_SERVER_PATH = '/images/slideshow/';
|
||||
|
||||
$SAML_COOKIE_SALT = 'changeme';
|
||||
$SAML_COOKIE_SECURE = false;
|
||||
$SAML_TRUSTED_DOMAINS = array("localhost:1080");
|
||||
$SAML_ADMIN_PASSWORD = "changeme";
|
||||
$SAML_ADMIN_NAME = 'PVV Drift';
|
||||
$SAML_ADMIN_EMAIL = 'drift@pvv.ntnu.no';
|
||||
|
||||
$CACHE_DIRECTORY = __DIR__.DIRECTORY_SEPARATOR.'cache';
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
$configFile = getenv('PVV_CONFIG_FILE');
|
||||
require_once($configFile);
|
||||
|
||||
?>
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
# go to https://auth.dataporten.no/
|
||||
|
||||
$dataportenConfig = [
|
||||
'client_id' => "",
|
||||
'client_secret' => "",
|
||||
//'redirect_uri' => "https://pvv.ntnu.no/paamelding/",
|
||||
'redirect_uri' => "http://localhost:1080/paamelding/",
|
||||
'auth' => "https://auth.dataporten.no/oauth/authorization",#Authorization endpoint
|
||||
'token' => "https://auth.dataporten.no/oauth/token",#Token endpoint
|
||||
|
||||
/* OPTIONAL */
|
||||
|
||||
# 'authorization_type' => "Bearer",
|
||||
# 'session' => false,
|
||||
# 'verify' => 1,
|
||||
# 'grant_type' => "authorization_code",
|
||||
# 'response_type' => "code",
|
||||
# 'scope' => "",
|
||||
];
|
|
@ -11,13 +11,40 @@ CREATE TABLE "events" (
|
|||
CREATE TABLE "projects" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"name" TEXT,
|
||||
"owner" TEXT,
|
||||
"owneruname" TEXT,
|
||||
"description" TEXT,
|
||||
"active" BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE "projectmembers" (
|
||||
"projectid" INTEGER,
|
||||
"name" TEXT,
|
||||
"uname" TEXT,
|
||||
"mail" TEXT,
|
||||
"role" TEXT,
|
||||
"lead" BOOLEAN DEFAULT 0,
|
||||
"owner" BOOLEAN DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"uname" TEXT,
|
||||
"groups" INT DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE "motd" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"title" TEXT,
|
||||
"content" TEXT
|
||||
);
|
||||
INSERT INTO motd (title, content)
|
||||
VALUES ('MOTD ./dev.sh', 'du kan endre motd i admin panelet');
|
||||
|
||||
CREATE TABLE "door" (
|
||||
"time" INTEGER PRIMARY KEY,
|
||||
"open" BOOLEAN
|
||||
);
|
||||
INSERT INTO door (time, open)
|
||||
VALUES (0, FALSE);
|
||||
|
||||
|
||||
INSERT INTO users (uname, groups)
|
||||
VALUES ('min_test_bruker', 1);
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
CREATE TABLE events (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`start` TEXT,
|
||||
`stop` TEXT,
|
||||
`organiser` TEXT,
|
||||
`location` TEXT,
|
||||
`description` TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE projects (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`description` TEXT,
|
||||
`active` BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE projectmembers (
|
||||
`projectid` INTEGER,
|
||||
`name` TEXT,
|
||||
`uname` TEXT,
|
||||
`mail` TEXT,
|
||||
`role` TEXT,
|
||||
`lead` BOOLEAN DEFAULT 0,
|
||||
`owner` BOOLEAN DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE users (
|
||||
`uname` TEXT,
|
||||
`groups` INT DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE motd (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`title` TEXT,
|
||||
`content` TEXT
|
||||
);
|
||||
/*
|
||||
INSERT INTO motd (title, content)
|
||||
VALUES ("MOTD ./dev.sh", "du kan endre motd i admin panelet");
|
||||
*/
|
||||
|
||||
CREATE TABLE door (
|
||||
`time` INTEGER PRIMARY KEY,
|
||||
`open` BOOLEAN
|
||||
);
|
||||
INSERT INTO door(time, open) VALUES (0, FALSE);
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
$metadata['https://www.pvv.ntnu.no/idp'] = array (
|
||||
'metadata-set' => 'saml20-idp-remote',
|
||||
'entityid' => 'https://www.pvv.ntnu.no/idp',
|
||||
'SingleSignOnService' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
|
||||
'Location' => 'https://www.pvv.ntnu.no/idp/saml2/idp/SSOService.php',
|
||||
),
|
||||
),
|
||||
'SingleLogoutService' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
|
||||
'Location' => 'https://www.pvv.ntnu.no/idp/saml2/idp/SingleLogoutService.php',
|
||||
),
|
||||
),
|
||||
'certData' => 'MIICgDCCAemgAwIBAgIJAP13Q5w2R3KgMA0GCSqGSIb3DQEBBQUAMDUxCzAJBgNVBAYTAk5PMRgwFgYDVQQIFA9Tw7hyLVRyw7huZGVsYWcxDDAKBgNVBAoTA1BWVjAeFw0xNDAzMTMxODIzNTVaFw0yNDAzMTIxODIzNTVaMDUxCzAJBgNVBAYTAk5PMRgwFgYDVQQIFA9Tw7hyLVRyw7huZGVsYWcxDDAKBgNVBAoTA1BWVjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzckfyofefuJr/gDl0vj7gbIGiwXD825c3YidWK2Cg37ZmSycVk3mng4OqZkQbKY8wRaHg/fruqicDhodCPq9dF7/+QmYAG8PMKmpCIvnKaT7EjOGQtCnxv2+17CF0c7IuLjlwNZG8m0xDBZZp8ymj6QK+mJfVEahBPbkMaCBGIsCAwEAAaOBlzCBlDAdBgNVHQ4EFgQUNEuP7yZVDneEA4uTfJv/UFA9gjcwZQYDVR0jBF4wXIAUNEuP7yZVDneEA4uTfJv/UFA9gjehOaQ3MDUxCzAJBgNVBAYTAk5PMRgwFgYDVQQIFA9Tw7hyLVRyw7huZGVsYWcxDDAKBgNVBAoTA1BWVoIJAP13Q5w2R3KgMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAg8hx8aRy/Fz9PK9UckOQ92WSoRCyr/ldQSf0OTRTMyG+zsSrzVsDX3+BFWbMAFrEu7SZAakd9FQajTUw0d930iaDP+ptX1uIxb64OOY0glLOW3Ru/CL309JwUIkDADa8drpRK4IFDvzs5nVpaj75X1pp583e+psuNST8f+mLspw=',
|
||||
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
|
||||
);
|
|
@ -4,6 +4,6 @@ $config = array(
|
|||
/* This is the name of this authentication source, and will be used to access it later. */
|
||||
'default-sp' => array(
|
||||
'saml:SP',
|
||||
'idp' => 'https://www.pvv.ntnu.no/idp',
|
||||
'idp' => 'https://idp.pvv.ntnu.no/',
|
||||
),
|
||||
);
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
$metadata['https://idp.pvv.ntnu.no/'] = array (
|
||||
'metadata-set' => 'saml20-idp-remote',
|
||||
'entityid' => 'https://idp.pvv.ntnu.no/',
|
||||
'SingleSignOnService' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
|
||||
'Location' => 'https://idp.pvv.ntnu.no/simplesaml/saml2/idp/SSOService.php',
|
||||
),
|
||||
),
|
||||
'SingleLogoutService' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
|
||||
'Location' => 'https://idp.pvv.ntnu.no/simplesaml/saml2/idp/SingleLogoutService.php',
|
||||
),
|
||||
),
|
||||
'certData' => 'MIIDpTCCAo2gAwIBAgIJAJIgibrB7NvsMA0GCSqGSIb3DQEBCwUAMGkxCzAJBgNVBAYTAk5PMR4wHAYDVQQKDBVQcm9ncmFtdmFyZXZlcmtzdGVkZXQxGDAWBgNVBAMMD2lkcC5wdnYubnRudS5ubzEgMB4GCSqGSIb3DQEJARYRZHJpZnRAcHZ2Lm50bnUubm8wHhcNMTcxMTEzMjI0NTQyWhcNMjcxMTEzMjI0NTQyWjBpMQswCQYDVQQGEwJOTzEeMBwGA1UECgwVUHJvZ3JhbXZhcmV2ZXJrc3RlZGV0MRgwFgYDVQQDDA9pZHAucHZ2Lm50bnUubm8xIDAeBgkqhkiG9w0BCQEWEWRyaWZ0QHB2di5udG51Lm5vMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAveLujCsgVCRA360y5yezy8FcSPhaqodggDqY12UTkYOMQLBFaph6uUL4oCUlXZqxScrAYVRt9yw+7BYpcm0p51VZzVCsfMxRVkn+O1eUvsaXq3f13f87QHKYP2f0uqkGf5PvnKIdSaI/ix8WJhD8XT+h0OkHEcaBvUtSG7zbEhvG21WPHwgw2rvZSneArQ8tOitZC0u8VXSfdhtf6ynRseo0xC95634UwQAZivhQ2v4A6Tp57QG5DCXIJ9/z3PkINx3KB/hOeh0EP6Dpbp+7V0/t9778E3whpm4llrH144kzROhA7EgUgkZOjAVjxGCYlcj3xQPnnItihVOZ5B5qLwIDAQABo1AwTjAdBgNVHQ4EFgQUPLhrB+Qb/Kzz7Car9GJkKmEkz6swHwYDVR0jBBgwFoAUPLhrB+Qb/Kzz7Car9GJkKmEkz6swDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAd+4E6t0j8/p8rbZE8y/gZ9GsiRhxkR4l6JbMRUfEpqHKi415qstChRcP2Lo3Yd5qdmj9tLDWoPsqet1QgyTTmQTgUmPhhMOQDqSh90LuqEJseKWafXGS/SfWLH6MWVmzDV5YofJEw2ThPiU58GiS06OLS2poq1eAesa2LQ22J8yYisXM4sxImIFte+LYQ1+1evfBWcvU1vrGsQ0VLJHdef9WoXp1swUFhq4Zk0c7gjHiB1CFVlExAAlk9L6W3CVXmKIYlf4eUnEBGkC061Ir42+uhAMWO9Y/L1NEuboTyd2KAI/6JdKdzpmfk7zPVxWlNxNCZ7OPNuvOKp6VlpB2EA==',
|
||||
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
|
||||
);
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
$dbDsn = 'sqlite:'.__DIR__.DIRECTORY_SEPARATOR.'pvv.sqlite';
|
||||
$dbUser = null;
|
||||
$dbPass = null;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
version: "3.9"
|
||||
|
||||
# cleanup:
|
||||
|
||||
# docker container prune -f && docker volume prune -f
|
||||
# docker system prune -a
|
||||
|
||||
services:
|
||||
nettside: # https://hub.docker.com/_/php
|
||||
#image: php:7.4-cli
|
||||
build: .
|
||||
volumes:
|
||||
- .:/usr/src/nettside
|
||||
working_dir: /usr/src/nettside
|
||||
command: ./dev.sh
|
||||
environment:
|
||||
- DOCKER_HOST=0.0.0.0
|
||||
- DOCKER_PORT=1080
|
||||
ports:
|
||||
- 1080:1080
|
||||
user: "${DOCKER_USER}"
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1707939175,
|
||||
"narHash": "sha256-D1xan0lgxbmXDyzVqXTiSYHLmAMrMRdD+alKzEO/p3w=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f7e8132daca31b1e3859ac0fb49741754375ac3d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
description = "Programvareverkstedet/nettsiden PHP environment";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in f system pkgs);
|
||||
in {
|
||||
packages = forAllSystems (system: pkgs: {
|
||||
default = self.packages.${system}.pvv-nettsiden;
|
||||
pvv-nettsiden = pkgs.callPackage ./nix/package.nix { php = pkgs.php82; };
|
||||
});
|
||||
|
||||
overlays.default = final: prev: {
|
||||
inherit (self.packages.${final.system}) pvv-nettsiden;
|
||||
formats = prev.formats // {
|
||||
php = import ./nix/php-generator.nix { pkgs = prev; lib = prev.lib; };
|
||||
};
|
||||
};
|
||||
|
||||
nixosModules.default = nix/module.nix;
|
||||
|
||||
devShells = forAllSystems (system: pkgs: {
|
||||
default = pkgs.callPackage ./nix/shell.nix { inherit pkgs; };
|
||||
});
|
||||
};
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
require __DIR__ . '/../src/_autoload.php';
|
||||
require __DIR__ . '/../config.php';
|
||||
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$agenda = new \pvv\side\Agenda([
|
||||
new \pvv\side\social\NerdepitsaActivity,
|
||||
new \pvv\side\social\AnimekveldActivity,
|
||||
new \pvv\side\DBActivity($pdo),
|
||||
]);
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
// Set up database and user system,
|
||||
// and include common files such as HTML includes or SimplSAMLphp.
|
||||
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'agenda.php';
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'navbar.php';
|
||||
|
||||
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'config.php']);
|
||||
|
||||
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'src', '_autoload.php']);
|
||||
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'vendor', 'simplesamlphp', 'simplesamlphp', 'lib', '_autoload.php']);
|
||||
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
$sp = 'default-sp';
|
||||
$as = new \SimpleSAML\Auth\Simple($sp);
|
||||
|
||||
use \pvv\side\Agenda;
|
||||
$agenda = new \pvv\side\Agenda([
|
||||
// new \pvv\side\social\NerdepitsaActivity,
|
||||
// new \pvv\side\social\AnimekveldActivity,
|
||||
new \pvv\side\social\HackekveldActivity,
|
||||
new \pvv\side\social\BrettspillActivity,
|
||||
new \pvv\side\social\DriftkveldActivity,
|
||||
new \pvv\side\DBActivity($pdo),
|
||||
]);
|
||||
|
||||
$months_translations = ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'];
|
|
@ -1,20 +1,28 @@
|
|||
<?php
|
||||
function navbar($depth, $active = NULL) {
|
||||
$result = "\n\t<ul>\n";
|
||||
$result = "\n\t<ul id=\"menu\">\n";
|
||||
$menuItems = [
|
||||
'hjem' => '',
|
||||
'kalender' => 'kalender',
|
||||
'aktiviteter' => 'aktiviteter',
|
||||
'prosjekter' => 'prosjekt',
|
||||
'kontakt' => 'kontakt',
|
||||
'webmail' => 'https://webmail.pvv.ntnu.no/',
|
||||
'wiki' => 'pvv',
|
||||
'Hjem' => '',
|
||||
'Hendelser' => 'hendelser',
|
||||
//'Kalender' => 'kalender',
|
||||
//'Aktiviteter' => 'aktiviteter',
|
||||
'Prosjekter' => 'prosjekt',
|
||||
'Kontakt' => 'kontakt',
|
||||
'Webmail' => 'https://webmail.pvv.ntnu.no/roundcube/',
|
||||
'Galleri' => 'galleri',
|
||||
'Wiki' => 'https://wiki.pvv.ntnu.no/',
|
||||
'Git' => 'https://git.pvv.ntnu.no/',
|
||||
'Tjenester' => 'tjenester',
|
||||
];
|
||||
foreach($menuItems as $caption => $link) {
|
||||
if ($caption !== 'webmail') {
|
||||
$isActive = $active === $link;
|
||||
if (substr( $link, 0, 4 ) != "http") {
|
||||
$link = rtrim(str_repeat('../', $depth) . $link, '/') . '/';
|
||||
}
|
||||
$result .= "\t\t<li" . ($active === $link ? ' class="active"' : '') . '>'
|
||||
|
||||
//if ($isActive) $link = '#';
|
||||
|
||||
$result .= "\t\t<li" . ($isActive ? ' class="active"' : '') . '>'
|
||||
. '<a href="' . $link . '">'
|
||||
. $caption
|
||||
. "</a></li>\n"
|
||||
|
@ -23,18 +31,40 @@ function navbar($depth, $active = NULL) {
|
|||
return $result . "\t</ul>\n";
|
||||
}
|
||||
|
||||
function loginBar($sp = 'default-sp') {
|
||||
function loginBar($sp = null, $pdo = null) {
|
||||
if (is_null($sp)) $sp = 'default-sp';
|
||||
$result = "\n";
|
||||
require_once(__DIR__ . '/../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple($sp);
|
||||
$as = new \SimpleSAML\Auth\Simple($sp);
|
||||
|
||||
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 64 64">
|
||||
<circle cx="32" cy="27" r="14" stroke-width="0" />
|
||||
<ellipse cx="32" cy="66" rx="24" ry="28" stroke-width="0" />
|
||||
</svg>
|
||||
';
|
||||
|
||||
$attr = $as->getAttributes();
|
||||
if($attr) {
|
||||
$uname = $attr['uid'][0];
|
||||
$result .= "\t<p class=\"login\">logget inn som: " . htmlspecialchars($uname) . "</p>\n";
|
||||
$isAdmin = false;
|
||||
if (isset($pdo)) {
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
$isAdmin = $userManager->isAdmin($uname);
|
||||
}
|
||||
$result .= "\t<a id=\"login\" href=\"#usermenu\" aria-hidden=\"true\">{$svg}" . htmlspecialchars($uname) . "</a>\n";
|
||||
|
||||
$result .= "\n\t<ul id=\"usermenu\">\n";
|
||||
$result .= "\n\t\t<li><a id=\"login\" href=\"#\">{$svg}" . htmlspecialchars($uname) . "</a></li>\n";
|
||||
if ($isAdmin) {
|
||||
$result .= "\n\t\t<li><a href=\"/admin/\">Admin</a></li>\n";
|
||||
}
|
||||
$result .= "\n\t\t<li><a href=\"" . htmlspecialchars($as->getLogoutURL()) . "\">Logg ut</a></li>\n";
|
||||
$result .= "\n\t</ul>\n";
|
||||
} else {
|
||||
$result .= "\t<a class=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">logg inn</a>\n";
|
||||
$result .= "\t<a id=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">{$svg}Logg inn</a>\n";
|
||||
}
|
||||
|
||||
$result .= "\n\t<a href=\"#menu\" id=\"menu_toggle\" aria-hidden=\"true\"><big>☰ </big>MENU</a>\n";
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
<ul id="ticker">
|
||||
<?php
|
||||
{
|
||||
require __DIR__ . '/../src/_autoload.php';
|
||||
require __DIR__ . '/../sql_config.php';
|
||||
$translation = ['i dag', 'i morgen', 'denne uken', 'neste uke', 'denne måneden', 'neste måned'];
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$agenda = new \pvv\side\Agenda([
|
||||
new \pvv\side\social\NerdepitsaActivity,
|
||||
new \pvv\side\social\AnimekveldActivity,
|
||||
new \pvv\side\DBActivity($pdo),
|
||||
]);
|
||||
|
||||
$test = true;
|
||||
foreach($agenda->getNextDays() as $period => $events) {
|
||||
if (!$events) continue;
|
||||
$i = 0;
|
||||
$n = count($events);
|
||||
foreach($events as $event){
|
||||
if ($i == 0){
|
||||
echo '<li style="text-align: center;"><span style="text-transform: uppercase;">' . $translation[$period] . '</span>: ';
|
||||
} else if ($i < $n-1) {
|
||||
echo '<i style="opacity:0.7;">, </i>';
|
||||
} else{
|
||||
echo '<i style="opacity:0.7;"> og </i>';
|
||||
}
|
||||
echo '<a href="' . $event->getURL() . '">' . $event->getName() . '</a>';
|
||||
$i = $i + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 7b2dc91100becd0c3d15de8764ad279ded0d3a58
|
|
@ -0,0 +1,254 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.pvv-nettsiden;
|
||||
inherit (lib) mkDefault mkEnableOption mkPackageOption mkIf mkOption types mdDoc;
|
||||
format = pkgs.formats.php { };
|
||||
in
|
||||
{
|
||||
options.services.pvv-nettsiden = {
|
||||
enable = mkEnableOption (lib.mdDoc "Enable pvv-nettsiden");
|
||||
|
||||
package = mkPackageOption pkgs "pvv-nettsiden" { };
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "pvv-nettsiden";
|
||||
description = mdDoc "User to run php-fpm and own the image directories";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "pvv-nettsiden";
|
||||
description = mdDoc "Group to run php-fpm and own the image directories";
|
||||
};
|
||||
|
||||
domainName = mkOption {
|
||||
type = types.str;
|
||||
default = "www.pvv.no";
|
||||
description = mdDoc "Domain name for the website";
|
||||
};
|
||||
|
||||
enableNginx = mkEnableOption "nginx" // { default = true; };
|
||||
useSSL = mkEnableOption "secure cookies" // { default = true; };
|
||||
|
||||
settings = mkOption {
|
||||
description = "Settings for the website";
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = format.type;
|
||||
options = lib.mapAttrsRecursiveCond
|
||||
(attrs: !(attrs ? "type"))
|
||||
(_: option: option // { type = types.either option.type format.lib.types.raw; })
|
||||
{
|
||||
DOOR_SECRET = mkOption {
|
||||
type = types.str;
|
||||
description = mdDoc "Secret for the door sensor API";
|
||||
};
|
||||
|
||||
GALLERY = {
|
||||
DIR = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/pvv-nettsiden/gallery";
|
||||
description = mdDoc "Directory where the gallery is located. See documentation at TODO";
|
||||
};
|
||||
|
||||
SERVER_PATH = mkOption {
|
||||
type = types.str;
|
||||
default = "/static/gallery";
|
||||
description = mdDoc "Path to the gallery on the server";
|
||||
};
|
||||
};
|
||||
|
||||
SLIDESHOW = {
|
||||
DIR = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/pvv-nettsiden/slideshow";
|
||||
description = mdDoc "Directory where the slideshow is located. See documentation at TODO";
|
||||
};
|
||||
|
||||
SERVER_PATH = mkOption {
|
||||
type = types.str;
|
||||
default = "/static/slideshow";
|
||||
description = mdDoc "Path to the slideshow on the server";
|
||||
};
|
||||
};
|
||||
|
||||
DB = {
|
||||
DSN = mkOption {
|
||||
type = types.str;
|
||||
default = "sqlite:/var/lib/pvv-nettsiden/pvv-nettsiden.db";
|
||||
example = "pgsql:host=localhost;port=5432;dbname=testdb;user=bruce;password=mypass";
|
||||
description = mdDoc "Database connection string, see https://www.php.net/manual/en/pdo.construct.php";
|
||||
};
|
||||
|
||||
USER = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
example = "pvv-nettsiden";
|
||||
description = mdDoc "Database user";
|
||||
};
|
||||
|
||||
PASS = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
description = mdDoc "Database password. Recommends: null, set in extraConfig";
|
||||
};
|
||||
};
|
||||
|
||||
SAML = {
|
||||
COOKIE_SALT = mkOption {
|
||||
type = types.str;
|
||||
description = mdDoc "Salt for the SAML cookies";
|
||||
};
|
||||
|
||||
COOKIE_SECURE = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = mdDoc "Whether to set the secure flag on the SAML cookies";
|
||||
};
|
||||
|
||||
ADMIN_NAME = mkOption {
|
||||
type = types.str;
|
||||
description = mdDoc "Name for the admin user";
|
||||
};
|
||||
|
||||
ADMIN_EMAIL = mkOption {
|
||||
type = types.str;
|
||||
description = mdDoc "Email for the admin user";
|
||||
};
|
||||
|
||||
ADMIN_PASSWORD = mkOption {
|
||||
type = types.str;
|
||||
description = mdDoc "Password for the admin user";
|
||||
};
|
||||
|
||||
TRUSTED_DOMAINS = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ cfg.domainName ];
|
||||
description = mdDoc "List of trusted domains for the SAML service";
|
||||
};
|
||||
};
|
||||
|
||||
CACHE_DIRECTORY = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/cache/pvv-nettsiden/simplesamlphp";
|
||||
description = mdDoc "List of trusted domains for the SAML service";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable (let
|
||||
# NOTE: This should absolutely not be necessary, but for some reason this file refuses to import
|
||||
# the toplevel configuration file.
|
||||
# NOTE: Nvm, don't this this was the problem after all?
|
||||
finalPackage = cfg.package.overrideAttrs (_: _: {
|
||||
postInstall = let
|
||||
f = x: lib.escapeShellArg (format.lib.valueToString x);
|
||||
in cfg.package.postInstall + ''
|
||||
substituteInPlace $out/${cfg.package.passthru.simplesamlphpPath}/config/config.php \
|
||||
--replace '$SAML_COOKIE_SECURE' ${f cfg.settings.SAML.COOKIE_SECURE} \
|
||||
--replace '$SAML_COOKIE_SALT' ${f cfg.settings.SAML.COOKIE_SALT} \
|
||||
--replace '$SAML_ADMIN_PASSWORD' ${f cfg.settings.SAML.ADMIN_PASSWORD} \
|
||||
--replace '$SAML_ADMIN_NAME' ${f cfg.settings.SAML.ADMIN_NAME} \
|
||||
--replace '$SAML_ADMIN_EMAIL' ${f cfg.settings.SAML.ADMIN_EMAIL} \
|
||||
--replace '$SAML_TRUSTED_DOMAINS' ${f cfg.settings.SAML.TRUSTED_DOMAINS} \
|
||||
--replace '$CACHE_DIRECTORY' ${f cfg.settings.CACHE_DIRECTORY}
|
||||
'';
|
||||
});
|
||||
in {
|
||||
users.users = mkIf (cfg.user == "pvv-nettsiden") {
|
||||
"pvv-nettsiden" = {
|
||||
description = "PVV Website Service User";
|
||||
group = cfg.group;
|
||||
createHome = false;
|
||||
isSystemUser = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.groups = mkIf (cfg.group == "pvv-nettsiden") {
|
||||
"pvv-nettsiden" = { };
|
||||
};
|
||||
|
||||
systemd.tmpfiles.settings."10-pvv-nettsiden".${cfg.settings.CACHE_DIRECTORY}.d = {
|
||||
inherit (cfg) user group;
|
||||
mode = "0770";
|
||||
};
|
||||
|
||||
services.nginx = mkIf cfg.enableNginx {
|
||||
enable = true;
|
||||
|
||||
recommendedGzipSettings = mkDefault true;
|
||||
recommendedProxySettings = mkDefault true;
|
||||
|
||||
virtualHosts."${cfg.domainName}" = {
|
||||
forceSSL = mkDefault cfg.useSSL;
|
||||
enableACME = mkDefault true;
|
||||
locations = {
|
||||
"/" = {
|
||||
root = "${finalPackage}/share/php/pvv-nettsiden/www/";
|
||||
index = "index.php";
|
||||
};
|
||||
|
||||
"~ \\.php$".extraConfig = ''
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME ${finalPackage}/share/php/pvv-nettsiden/www$fastcgi_script_name;
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."pvv-nettsiden".socket};
|
||||
'';
|
||||
|
||||
# based on https://simplesamlphp.org/docs/stable/simplesamlphp-install.html#configuring-nginx
|
||||
"^~ /simplesaml/" = {
|
||||
alias = "${finalPackage}/${finalPackage.passthru.simplesamlphpPath}/public/";
|
||||
index = "index.php";
|
||||
|
||||
extraConfig = ''
|
||||
location ~ ^/simplesaml/(?<phpfile>.+?\.php)(?<pathinfo>/.*)?$ {
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."pvv-nettsiden".socket};
|
||||
fastcgi_param SCRIPT_FILENAME ${finalPackage}/${finalPackage.passthru.simplesamlphpPath}/public/$phpfile;
|
||||
|
||||
# Must be prepended with the baseurlpath
|
||||
fastcgi_param SCRIPT_NAME /simplesaml/$phpfile;
|
||||
|
||||
fastcgi_param PATH_INFO $pathinfo if_not_empty;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
"^~ ${cfg.settings.GALLERY.SERVER_PATH}" = {
|
||||
root = cfg.settings.GALLERY.DIR;
|
||||
extraConfig = ''
|
||||
rewrite ^${cfg.settings.GALLERY.SERVER_PATH}/(.*)$ /$1 break;
|
||||
'';
|
||||
};
|
||||
|
||||
"^~ ${cfg.settings.SLIDESHOW.SERVER_PATH}" = {
|
||||
root = cfg.settings.SLIDESHOW.DIR;
|
||||
extraConfig = ''
|
||||
rewrite ^${cfg.settings.SLIDESHOW.SERVER_PATH}/(.*)$ /$1 break;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
services.phpfpm.pools.pvv-nettsiden = {
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
|
||||
phpEnv.PVV_CONFIG_FILE = toString (format.generate "pvv-nettsiden-conf.php" cfg.settings);
|
||||
|
||||
settings = {
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"pm" = mkDefault "ondemand";
|
||||
"pm.max_children" = mkDefault 32;
|
||||
"pm.process_idle_timeout" = mkDefault "10s";
|
||||
"pm.max_requests" = mkDefault 500;
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{ lib
|
||||
, php
|
||||
, extra_files ? { }
|
||||
}:
|
||||
|
||||
php.buildComposerProject rec {
|
||||
src = ./..;
|
||||
pname = "pvv-nettsiden";
|
||||
version = "0.0.1";
|
||||
vendorHash = "sha256-sWC5E60toa95re2NugvHVPT+vKYXc1I6Z3rSqXxTUu0=";
|
||||
|
||||
passthru.simplesamlphpPath = "share/php/pvv-nettsiden/vendor/simplesamlphp/simplesamlphp";
|
||||
|
||||
postInstall = ''
|
||||
install -Dm644 dist/simplesamlphp-config.php $out/${passthru.simplesamlphpPath}/config/config.php
|
||||
install -Dm644 dist/simplesamlphp-authsources.php $out/${passthru.simplesamlphpPath}/config/authsources.php
|
||||
install -Dm644 dist/simplesamlphp-idp.php $out/${passthru.simplesamlphpPath}/metadata/saml20-idp-remote.php
|
||||
install -Dm644 dist/config.source-env.php $out/share/php/pvv-nettsiden/config.php
|
||||
|
||||
${lib.pipe extra_files [
|
||||
(lib.mapAttrsToList (target_path: source_path: ''
|
||||
mkdir -p $(dirname "$out/${target_path}")
|
||||
cp -r "${source_path}" "$out/${target_path}"
|
||||
''))
|
||||
(lib.concatStringsSep "\n")
|
||||
]}
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
{ pkgs, lib }:
|
||||
|
||||
with lib;
|
||||
|
||||
{ }: let
|
||||
valueToString = val:
|
||||
if val == null then
|
||||
"null"
|
||||
else if isString val then
|
||||
builtins.toJSON val
|
||||
else if isBool val then
|
||||
boolToString val
|
||||
else if isInt val || isFloat val then
|
||||
toString val
|
||||
else if isList val then
|
||||
"array(${concatMapStringsSep ", " valueToString val})"
|
||||
else if isAttrs val && val ? value && (val._type or "") == "raw" then
|
||||
val.value
|
||||
else if isAttrs val then
|
||||
throw "Found unexpected attrs, that were not created by mkRaw. Have you put attrs in an array?\n${val}"
|
||||
else throw "unsupported :')";
|
||||
in {
|
||||
inherit (pkgs.formats.json { }) type;
|
||||
|
||||
generate = name: value: let
|
||||
flattenStructuredSettings = attrs: let
|
||||
partitionAttrs = pred: attrs: lib.pipe attrs [
|
||||
attrsToList
|
||||
(partition ({ name, value }: pred name value))
|
||||
(mapAttrs (_: listToAttrs))
|
||||
];
|
||||
|
||||
partitionedAttrs = partitionAttrs (_: v: isAttrs v && !(v ? value && (v._type or "") == "raw")) attrs;
|
||||
|
||||
flattenedAttrs = lib.pipe partitionedAttrs.right [
|
||||
(mapAttrs (n1: mapAttrs' (n2: v2: nameValuePair "${n1}_${n2}" v2)))
|
||||
attrValues
|
||||
(map flattenStructuredSettings)
|
||||
(foldl recursiveUpdate { })
|
||||
];
|
||||
in recursiveUpdate flattenedAttrs partitionedAttrs.wrong;
|
||||
|
||||
content = lib.pipe value [
|
||||
flattenStructuredSettings
|
||||
(mapAttrs (_: valueToString))
|
||||
(mapAttrsToList (n: v: ''''$${n} = ${v};''))
|
||||
(concatStringsSep "\n")
|
||||
(content: "<?php\n${content}\n?>")
|
||||
];
|
||||
in pkgs.writeText name content;
|
||||
|
||||
lib = {
|
||||
inherit valueToString;
|
||||
|
||||
mkRaw = value: {
|
||||
inherit value;
|
||||
_type = "raw";
|
||||
};
|
||||
|
||||
types.raw = lib.types.attrs;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
{ pkgs }:
|
||||
let
|
||||
phpEnv = pkgs.php82.buildEnv {
|
||||
extensions = { enabled, all }: enabled ++ (with all; [ iconv mbstring pdo_mysql pdo_sqlite ]);
|
||||
};
|
||||
in
|
||||
pkgs.mkShellNoCC {
|
||||
buildInputs = with pkgs; [
|
||||
phpEnv
|
||||
php82Packages.composer
|
||||
|
||||
sqlite
|
||||
git
|
||||
];
|
||||
shellHook = ''
|
||||
alias runDev='php -S localhost:1080 -d error_reporting=E_ALL -d display_errors=1 -t www/'
|
||||
|
||||
# Prepare dev environment with sqlite and config files
|
||||
test -e pvv.sqlite || sqlite3 pvv.sqlite < dist/pvv.sql
|
||||
test -e config.php || cp -v dist/config.local.php config.php
|
||||
|
||||
|
||||
if [ ! -d www/galleri/bilder/slideshow ] ; then
|
||||
mkdir -p www/galleri/bilder/slideshow
|
||||
fi
|
||||
|
||||
if [ ! -d vendor ] ; then
|
||||
composer install || exit $?
|
||||
|
||||
cp dist/simplesamlphp-authsources.php vendor/simplesamlphp/simplesamlphp/config/authsources.php
|
||||
cp dist/simplesamlphp-idp.php vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
|
||||
cp dist/simplesamlphp-config.php vendor/simplesamlphp/simplesamlphp/config/config.php
|
||||
|
||||
cp dist/config.local.php config.php
|
||||
|
||||
ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml
|
||||
fi
|
||||
'';
|
||||
}
|
23
pvv.sql
|
@ -1,23 +0,0 @@
|
|||
CREATE TABLE "events" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"name" TEXT,
|
||||
"start" TEXT,
|
||||
"stop" TEXT,
|
||||
"organiser" TEXT,
|
||||
"location" TEXT,
|
||||
"description" TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE "projects" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"name" TEXT,
|
||||
"owner" TEXT,
|
||||
"owneruname" TEXT,
|
||||
"description" TEXT,
|
||||
"active" BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"uname" TEXT,
|
||||
"groups" INT DEFAULT 0
|
||||
);
|
|
@ -32,7 +32,7 @@ class UserManager{
|
|||
}
|
||||
|
||||
public function addGroup($uname, $group){
|
||||
$userFlags = $this->getUsergroups();
|
||||
$userFlags = $this->getUsergroups($uname);
|
||||
|
||||
if($userFlags){
|
||||
$newFlags = ($group | $userFlags);
|
||||
|
@ -41,7 +41,7 @@ class UserManager{
|
|||
}
|
||||
|
||||
public function removeGroup($uname, $group){
|
||||
$userFlags = $this->getUsergroups();
|
||||
$userFlags = $this->getUsergroups($uname);
|
||||
|
||||
if($userFlags){
|
||||
$newFlags = ($userFlags & (~ $group));
|
||||
|
@ -96,7 +96,9 @@ class UserManager{
|
|||
$statement->bindParam(':uname', $uname, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
return $statement->fetch()[0];
|
||||
$row = $statement->fetch();
|
||||
if ($row == false) return 0;
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
public function getUsergroupNames($uname){
|
||||
|
|
|
@ -6,6 +6,8 @@ use \DateInterval;
|
|||
|
||||
class Agenda {
|
||||
|
||||
private $activities;
|
||||
|
||||
const TODAY = 0;
|
||||
const TOMORROW = 1;
|
||||
const THIS_WEEK = 2;
|
||||
|
@ -18,7 +20,7 @@ class Agenda {
|
|||
}
|
||||
|
||||
public static function getFormattedDate($date) {
|
||||
return trim(strftime('%A %e. %b %H.%M', $date->getTimeStamp()));
|
||||
return $date->format("l j. M H.i");
|
||||
}
|
||||
|
||||
public function getEventsBetween(DateTimeImmutable $from, DateTimeImmutable $to) {
|
||||
|
@ -51,8 +53,8 @@ class Agenda {
|
|||
public function getNextDays() {
|
||||
$result = [[], [], [], [], [], []];
|
||||
$events = $this->getEventsBetween(
|
||||
(new DateTimeImmutable)->sub(new DateInterval('PT1H')),
|
||||
(new DateTimeImmutable)->add(new DateInterval('P1M'))
|
||||
(new DateTimeImmutable)->setTime(0, 0),
|
||||
(new DateTimeImmutable)->setTime(23, 59)->add(new DateInterval('P1M'))
|
||||
);
|
||||
foreach ($events as $event) {
|
||||
$index = self::NEXT_MONTH;
|
||||
|
|
|
@ -5,13 +5,14 @@ use \DateTimeImmutable;
|
|||
use \PDO;
|
||||
|
||||
class DBActivity implements Activity {
|
||||
private $pdo;
|
||||
|
||||
public function __construct(PDO $pdo) {
|
||||
$this->pdo = $pdo;
|
||||
}
|
||||
|
||||
public function getAllEvents() {
|
||||
$query = 'SELECT * FROM events ORDER BY id ASC';
|
||||
$query = 'SELECT * FROM events ORDER BY id DESC';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->execute();
|
||||
|
||||
|
@ -54,12 +55,12 @@ class DBActivity implements Activity {
|
|||
|
||||
|
||||
public function getNextEventFrom(DateTimeImmutable $date) {
|
||||
$query = 'SELECT name,start,stop,organiser,location,description FROM events WHERE start > :date ORDER BY start ASC LIMIT 1';
|
||||
$query = 'SELECT id,name,start,stop,organiser,location,description FROM events WHERE start > :date ORDER BY start ASC LIMIT 1';
|
||||
return $this->retrieve($date, $query);
|
||||
}
|
||||
|
||||
public function getPreviousEventFrom(DateTimeImmutable $date) {
|
||||
$query = 'SELECT name,start,stop,organiser,location,description FROM events WHERE start < :date ORDER BY start DESC LIMIT 1';
|
||||
$query = 'SELECT id,name,start,stop,organiser,location,description FROM events WHERE start < :date ORDER BY start DESC LIMIT 1';
|
||||
return $this->retrieve($date, $query);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
namespace pvv\side;
|
||||
|
||||
use \PDO;
|
||||
|
||||
class Door{
|
||||
private $pdo;
|
||||
|
||||
public function __construct(PDO $pdo){
|
||||
$this->pdo = $pdo;
|
||||
}
|
||||
|
||||
public function getAll() {
|
||||
$query = 'SELECT time, open FROM door ORDER BY time DESC';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->execute();
|
||||
|
||||
$doorEvents = [];
|
||||
foreach($statement->fetchAll() as $row){
|
||||
$doorEvents[] = [
|
||||
'time' => (int)$row['time'],
|
||||
'open' => (bool)$row['open']
|
||||
];
|
||||
}
|
||||
|
||||
return $doorEvents;
|
||||
}
|
||||
|
||||
public function getEntriesAfter($startTime) {
|
||||
$query = 'SELECT time, open FROM door WHERE time > :startTime ORDER BY time DESC';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':startTime', $startTime, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$doorEvents = [];
|
||||
foreach($statement->fetchAll() as $row){
|
||||
$doorEvents[] = [
|
||||
'time' => (int)$row['time'],
|
||||
'open' => (bool)$row['open']
|
||||
];
|
||||
}
|
||||
|
||||
return $doorEvents;
|
||||
}
|
||||
|
||||
public function getCurrent() {
|
||||
$query = 'SELECT time, open FROM door ORDER BY time DESC LIMIT 1';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->execute();
|
||||
$row = $statement->fetch();
|
||||
return [
|
||||
'time' => (int)$row['time'],
|
||||
'open' => (bool)$row['open']
|
||||
];
|
||||
}
|
||||
|
||||
private function removeOld() {
|
||||
$firstValidTime = time() - 60*60*24*7; //One week before now
|
||||
$query = 'DELETE FROM door WHERE time < :firstValid';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':firstValid', $firstValidTime, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
}
|
||||
|
||||
public function createEvent($time, $open) {
|
||||
$query = 'INSERT INTO door(time, open) VALUES (:time, :open)';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':time', $time, PDO::PARAM_STR);
|
||||
$statement->bindParam(':open', $open, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$this->removeOld();
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ abstract class Event {
|
|||
return 'i morgen';
|
||||
}
|
||||
if (Agenda::isThisWeek($this->getStart()) || $this->getStart()->sub(new DateInterval('P4D'))->getTimestamp() < time()) {
|
||||
return strftime('%A', $this->getStart()->getTimestamp());
|
||||
return $this->getStart()->format("l");
|
||||
}
|
||||
if (Agenda::isNextWeek($this->getStart())) {
|
||||
return 'neste uke';
|
||||
|
@ -32,7 +32,7 @@ abstract class Event {
|
|||
if (Agenda::isThisMonth($this->getStart())) {
|
||||
return 'denne måneden';
|
||||
}
|
||||
return trim(strftime('%e. %B', $this->getStart()->getTimestamp()));
|
||||
return $this->getStart()->format("j. F");
|
||||
}
|
||||
|
||||
public abstract function getStop(); /* : DateTimeImmutable */
|
||||
|
@ -49,4 +49,5 @@ abstract class Event {
|
|||
|
||||
public abstract function getDescription(); /* : string */
|
||||
|
||||
public abstract function getColor(); /* : string */
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
namespace pvv\side;
|
||||
|
||||
use \PDO;
|
||||
|
||||
class MOTD{
|
||||
private $pdo;
|
||||
|
||||
public function __construct($pdo){
|
||||
$this->pdo = $pdo;
|
||||
}
|
||||
|
||||
public function setMOTD($title, $content) {
|
||||
if (is_array($content)) {
|
||||
$content = implode("_", $content);
|
||||
}
|
||||
$query = 'INSERT INTO motd(title, content) VALUES (:title, :content);';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':content', $content, PDO::PARAM_STR);
|
||||
|
||||
$statement->execute();
|
||||
}
|
||||
|
||||
public function getMOTD() {
|
||||
$query = 'SELECT motd.title, motd.content FROM motd ORDER BY motd.id DESC LIMIT 1';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->execute();
|
||||
|
||||
$data = $statement->fetch();
|
||||
$motd = array("title" => $data[0], "content" => explode("\n", $data[1]));
|
||||
|
||||
return $motd;
|
||||
}
|
||||
|
||||
public function getMOTD_history($limit = 5) {
|
||||
$query = 'SELECT motd.title, motd.content FROM motd ORDER BY motd.id DESC LIMIT :limit';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':limit', $limit, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$data = $statement->fetch();
|
||||
$motd = array("title" => $data[0], "content" => explode("\n", $data[1]));
|
||||
|
||||
return $motd;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,14 +2,12 @@
|
|||
namespace pvv\side;
|
||||
|
||||
class Project{
|
||||
private $id, $name, $owner, $owneruname, $descr, $active;
|
||||
private $id, $name, $descr, $active;
|
||||
|
||||
public function __construct($id, $name, $descr, $owner, $owneruname, $active){
|
||||
public function __construct($id, $name, $descr, $active){
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->descr = $descr;
|
||||
$this->owner = $owner;
|
||||
$this->owneruname = $owneruname;
|
||||
$this->descr = explode("\n", $descr);
|
||||
$this->active = $active;
|
||||
}
|
||||
|
||||
|
@ -25,14 +23,6 @@ class Project{
|
|||
return $this->descr;
|
||||
}
|
||||
|
||||
public function getOwner(){
|
||||
return $this->owner;
|
||||
}
|
||||
|
||||
public function getOwnerUName(){
|
||||
return $this->owneruname;
|
||||
}
|
||||
|
||||
public function getActive(){
|
||||
return $this->active;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ class ProjectManager{
|
|||
$dbProj['id'],
|
||||
$dbProj['name'],
|
||||
$dbProj['description'],
|
||||
$dbProj['owner'],
|
||||
$dbProj['owneruname'],
|
||||
$dbProj['active']
|
||||
);
|
||||
$projects[] = $project;
|
||||
|
@ -38,37 +36,86 @@ class ProjectManager{
|
|||
$statement->execute();
|
||||
|
||||
$dbProj = $statement->fetch();
|
||||
if (!$dbProj) {
|
||||
return false;
|
||||
}
|
||||
$project = new Project(
|
||||
$dbProj['id'],
|
||||
$dbProj['name'],
|
||||
$dbProj['description'],
|
||||
$dbProj['owner'],
|
||||
$dbProj['owneruname'],
|
||||
$dbProj['active']
|
||||
);
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
||||
public function getByUName($uname){
|
||||
$query = 'SELECT * FROM projects WHERE owneruname=:uname';
|
||||
public function getByOwner($uname){
|
||||
$query = 'SELECT projectid FROM projectmembers WHERE uname=:uname';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':uname', $uname, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$projectIDs = $statement->fetchAll();
|
||||
$projects = [];
|
||||
foreach($statement->fetchAll() as $dbProj){
|
||||
$project = new Project(
|
||||
$dbProj['id'],
|
||||
$dbProj['name'],
|
||||
$dbProj['description'],
|
||||
$dbProj['owner'],
|
||||
$dbProj['owneruname'],
|
||||
$dbProj['active']
|
||||
);
|
||||
$projects[] = $project;
|
||||
foreach($projectIDs as $id){
|
||||
$id = $id['projectid'];
|
||||
|
||||
$query = 'SELECT * FROM projects WHERE id=:id';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
$statement->execute();
|
||||
|
||||
foreach($statement->fetchAll() as $dbProj){
|
||||
$project = new Project(
|
||||
$dbProj['id'],
|
||||
$dbProj['name'],
|
||||
$dbProj['description'],
|
||||
$dbProj['active']
|
||||
);
|
||||
$projects[] = $project;
|
||||
}
|
||||
}
|
||||
|
||||
return $projects;
|
||||
}
|
||||
|
||||
public function getProjectMembers($id){
|
||||
$query = 'SELECT * FROM projectmembers WHERE projectid=:id';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$members = [];
|
||||
foreach($statement->fetchAll() as $dbUsr){
|
||||
$members[] = [
|
||||
'name' => $dbUsr['name'],
|
||||
'uname' => $dbUsr['uname'],
|
||||
'mail' => $dbUsr['mail'],
|
||||
'role' => $dbUsr['role'],
|
||||
'lead' => $dbUsr['lead'],
|
||||
'owner' => $dbUsr['owner']
|
||||
];
|
||||
}
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
public function getProjectOwner($id){
|
||||
$query = 'SELECT * FROM projectmembers WHERE (projectid=:id AND owner=1)';
|
||||
$statement = $this->pdo->prepare($query);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_STR);
|
||||
$statement->execute();
|
||||
|
||||
$dbOwner = $statement->fetch();
|
||||
$owner = [
|
||||
'name' => $dbOwner['name'],
|
||||
'uname' => $dbOwner['uname'],
|
||||
'mail' => $dbOwner['mail'],
|
||||
'role' => $dbOwner['role'],
|
||||
'lead' => $dbOwner['lead'],
|
||||
'owner' => $dbOwner['owner']
|
||||
];
|
||||
|
||||
return $owner;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ class SimpleEvent extends Event {
|
|||
|
||||
private $id, $name, $descr, $start, $end, $org, $loc;
|
||||
|
||||
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $isDBEvent = false){
|
||||
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $_isDBEvent = false){
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->start = $start;
|
||||
|
@ -13,7 +13,6 @@ class SimpleEvent extends Event {
|
|||
$this->org = $org;
|
||||
$this->loc = $loc;
|
||||
$this->descr = explode("\n", $descr);
|
||||
$this->isDBEvent = $isDBEvent;
|
||||
}
|
||||
|
||||
public function getID(){
|
||||
|
@ -41,7 +40,7 @@ class SimpleEvent extends Event {
|
|||
}
|
||||
|
||||
public function getURL() {
|
||||
return '';
|
||||
return ('/hendelser/info.php?id=' . $this->id);
|
||||
}
|
||||
|
||||
public function getImageURL() {
|
||||
|
@ -52,8 +51,8 @@ class SimpleEvent extends Event {
|
|||
return $this->descr;
|
||||
}
|
||||
|
||||
public function isDBEvent() {
|
||||
return $this->isDBEvent;
|
||||
public function getColor() {
|
||||
return "#3b7";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class AnimekveldEvent extends Event {
|
|||
}
|
||||
|
||||
public function getOrganiser() /* : User */ {
|
||||
return "Liang Zhu";
|
||||
return "Christoffer Viken";
|
||||
}
|
||||
|
||||
public function getURL() /* : string */ {
|
||||
|
@ -33,12 +33,16 @@ class AnimekveldEvent extends Event {
|
|||
|
||||
public function getDescription() {
|
||||
return [
|
||||
'<p>Er du glad i japansk tegnefilm eller er du bare nysgjerrige på hva anime er?' . "\n" .
|
||||
'Bli med oss! Hver fredag finner vi de nyeste episodene for sesongen.' . "\n" .
|
||||
'Vi viser denne senongens nye animeer.',
|
||||
|
||||
'<p>Alle kan være med på å anbefale eller veto serier.'
|
||||
'Er du glad i japanske tegneserier eller bare nysgjerrig på hva anime er?',
|
||||
'Bli med oss hver fredag, der vi finner frem de nyeste episodene for sesongen!',
|
||||
'',
|
||||
'Alle kan være med på å anbefale eller veto serier.',
|
||||
'',
|
||||
];
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#35a";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,20 +8,25 @@ use \DateInterval;
|
|||
class BrettspillActivity implements Activity {
|
||||
|
||||
public function nextDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(19, 30, 0));
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if ($date->format('N') != 4)
|
||||
if ($date->format('H') > 17 || $date->format('H') == 16 && $date->format('i') > 15)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(16, 15, 0));
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 7)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2 - 1)
|
||||
return $this->nextDate($date->add(new DateInterval('P7D')));
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function prevDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(19, 30, 0));
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if ($date->format('N') != 4)
|
||||
if ($date->format('H') < 16 || $date->format('H') == 17 && $date->format('i') < 15)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(16, 15, 0));
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 7)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2 - 1)
|
||||
return $this->prevDate($date->sub(new DateInterval('P7D')));
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ class BrettspillEvent extends Event {
|
|||
}
|
||||
|
||||
public function getLocation() /* : Location */ {
|
||||
return "Koserommet";
|
||||
return "Programvareverkstedet";
|
||||
}
|
||||
|
||||
public function getOrganiser() /* : User */ {
|
||||
return "Robert Maikher";
|
||||
return "Programvareverkstedet";
|
||||
}
|
||||
|
||||
public function getURL() /* : string */ {
|
||||
|
@ -33,31 +33,33 @@ class BrettspillEvent extends Event {
|
|||
|
||||
public function getDescription() {
|
||||
return [
|
||||
'<p>Er du en hardcore brettspillentusiast eller en nybegynner som har så vidt spilt ludo?' . "\n" .
|
||||
'Da er vår brettspillkveld noe for deg!' . "\n" .
|
||||
'Er du en hardcore brettspillentusiast eller en nybegynner som har så vidt spilt ludo? '.
|
||||
'Da er vår brettspillkveld noe for deg! ' .
|
||||
'Vi tar ut et par spill fra vårt samling of spiller så mye vi orker. Kom innom!',
|
||||
|
||||
'<p><a class="btn" href="#b_spill">Vår samling</a>',
|
||||
|
||||
'<div id="b_spill" class="collapsable">' . "\n" .
|
||||
'<ul>' . "\n" .
|
||||
'<li>Dominion*' . "\n" .
|
||||
'<li>Three cheers for master' . "\n" .
|
||||
'<li>Avalon' . "\n" .
|
||||
'<li>Hanabi' . "\n" .
|
||||
'<li>Cards aginst humanity*' . "\n" .
|
||||
'<li>Citadels' . "\n" .
|
||||
'<li>Munchkin**' . "\n" .
|
||||
'<li>Exploding kittens**' . "\n" .
|
||||
'<li>Aye dark overlord' . "\n" .
|
||||
'<li>Settlers of catan*' . "\n" .
|
||||
'<li>Risk**' . "\n" .
|
||||
'<li>og mange flere...' . "\n" .
|
||||
'</ul>',
|
||||
'<p>* Vi har flere ekspansjoner til spillet',
|
||||
'<p>** Vi har flere varianter av spillet',
|
||||
'</div>'
|
||||
'',
|
||||
'## Vår samling',
|
||||
'',
|
||||
'* Dominion\*',
|
||||
'* Three cheers for master',
|
||||
'* Avalon',
|
||||
'* Hanabi',
|
||||
'* Cards aginst humanity\*',
|
||||
'* Citadels',
|
||||
'* Munchkin\*\*',
|
||||
'* Exploding kittens\*\*',
|
||||
'* Aye dark overlord',
|
||||
'* Settlers of catan\*',
|
||||
'* Risk\*\*',
|
||||
'* og mange flere...',
|
||||
'',
|
||||
'\* Vi har flere ekspansjoner til spillet',
|
||||
'',
|
||||
'\*\* Vi har flere varianter av spillet',
|
||||
];
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#000";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?php //declare(strict_types=1);
|
||||
namespace pvv\side\social;
|
||||
|
||||
use \pvv\side\Activity;
|
||||
use \DateTimeImmutable;
|
||||
use \DateInterval;
|
||||
|
||||
class DriftkveldActivity implements Activity {
|
||||
|
||||
public function nextDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2 - 1)
|
||||
return $this->nextDate($date->add(new DateInterval('P7D')));
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function prevDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2 - 1)
|
||||
return $this->prevDate($date->sub(new DateInterval('P7D')));
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function getNextEventFrom(DateTimeImmutable $date) /* : Event */ {
|
||||
return new DriftkveldEvent($this->nextDate($date));
|
||||
}
|
||||
|
||||
public function getPreviousEventFrom(DateTimeImmutable $date) /* : Event */ {
|
||||
return new DriftkveldEvent($this->prevDate($date));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?php //declare(strict_types=1);
|
||||
namespace pvv\side\social;
|
||||
|
||||
use \pvv\side\Event;
|
||||
|
||||
use \DateInterval;
|
||||
|
||||
class DriftkveldEvent extends Event {
|
||||
|
||||
public function getStop() {
|
||||
return $this->getStart()->add(new DateInterval('PT4H1800S'));
|
||||
}
|
||||
|
||||
public function getName() /* : string */ {
|
||||
return "Driftkveld";
|
||||
}
|
||||
|
||||
public function getLocation() /* : Location */ {
|
||||
return "Terminalrommet / Discord / IRC";
|
||||
}
|
||||
|
||||
public function getOrganiser() /* : User */ {
|
||||
return "Torstein Nordgård-Hansen";
|
||||
}
|
||||
|
||||
public function getURL() /* : string */ {
|
||||
return '/driftkveld/';
|
||||
}
|
||||
|
||||
public function getImageURL() {
|
||||
return '/sosiale/drift.jpg';
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return [
|
||||
'Vil du drifte?',
|
||||
'Vil du være kul kis TM?',
|
||||
'Kom på driftkveld!',
|
||||
'',
|
||||
'Vi møtes annenhver uke for å ta unna driftarbeid og drikke kaffe.',
|
||||
'Alle PVVere er velkommene, enten de er erfarne driftere eller helt utenforstående!'
|
||||
];
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#35a";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php //declare(strict_types=1);
|
||||
namespace pvv\side\social;
|
||||
|
||||
use \pvv\side\Activity;
|
||||
use \DateTimeImmutable;
|
||||
use \DateInterval;
|
||||
|
||||
class HackekveldActivity implements Activity {
|
||||
|
||||
public function nextDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 6)
|
||||
return $this->nextDate($date->add(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2)
|
||||
return $this->nextDate($date->add(new DateInterval('P7D')));
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function prevDate(DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6)
|
||||
return $this->prevDate($date->sub(new DateInterval('P1D')));
|
||||
if ($date->format('W') % 2)
|
||||
return $this->prevDate($date->sub(new DateInterval('P7D')));
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function getNextEventFrom(DateTimeImmutable $date) /* : Event */ {
|
||||
return new HackekveldEvent($this->nextDate($date));
|
||||
}
|
||||
|
||||
public function getPreviousEventFrom(DateTimeImmutable $date) /* : Event */ {
|
||||
return new HackekveldEvent($this->prevDate($date));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
<?php //declare(strict_types=1);
|
||||
namespace pvv\side\social;
|
||||
|
||||
use \pvv\side\Event;
|
||||
|
||||
use \DateInterval;
|
||||
|
||||
class HackekveldEvent extends Event {
|
||||
|
||||
public function getStop() {
|
||||
return $this->getStart()->add(new DateInterval('PT4H1800S'));
|
||||
}
|
||||
|
||||
public function getName() /* : string */ {
|
||||
return "Hackekveld";
|
||||
}
|
||||
|
||||
public function getLocation() /* : Location */ {
|
||||
return "Terminalrommet / Discord / IRC";
|
||||
}
|
||||
|
||||
public function getOrganiser() /* : User */ {
|
||||
return "PVV";
|
||||
}
|
||||
|
||||
public function getURL() /* : string */ {
|
||||
return '#';
|
||||
}
|
||||
|
||||
public function getImageURL() {
|
||||
return '/pvv-logo.png';
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return [
|
||||
'Mange PVV-medlemmer liker å programmere.',
|
||||
'Hvis du også liker å programmere, så bli med! Her kan du jobbe med dine egne prosjekter eller starte noe med andre nerder her på huset. Vi møtes for en hyggelig prat, mye god programmering og delsponset pizza.'
|
||||
];
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#35a";
|
||||
}
|
||||
|
||||
}
|
|
@ -33,14 +33,18 @@ class NerdepitsaEvent extends Event {
|
|||
|
||||
public function getDescription() {
|
||||
return [
|
||||
'<p>Hei, har du lyst til å bli med på pizzaspising på Peppes i Kjøpmannsgata annenhver fredag klokken 19.00?',
|
||||
|
||||
'<p>Vi er en gjeng hvis eneste gjennomgående fellestrekk er en viss interesse for data, samt at vi har eller har hatt en tilknytning til studentmiljøet ved NTNU. For å treffe andre som også faller inn under disse kriteriene treffes vi over pizza på Peppes annenhver fredag. (Definisjon: En fredag er annenhver dersom den ligger i en partallsuke). Vi har reservasjon under navnet Christensen.',
|
||||
|
||||
'<p>Det er ikke noe krav at du er nerd ... noen av oss virker faktisk nesten normale. Det er heller ikke noe krav at du kjenner noen fra før. Det er ikke engang et krav at du må like pizza (selv om det hjelper). Dersom du har lyst til å treffe personer fra datamiljøet ved NTNU så still opp, vi biter ikke (vel, bortsett fra pizzaen da ...)',
|
||||
|
||||
'<p>Strategien er at vi bestiller så mye pizza som vi i fellesskap klarer å stappe ned, for deretter splitte pizza-regningen broderlig; mens hver enkelt betaler for sin egen drikke, dessert mm. '
|
||||
'Hei, har du lyst til å bli med på pizzaspising annenhver fredag? Vi møtes på Peppes i Kjøpmannsgata fredag klokken 19.00 hver partallsuke!',
|
||||
'',
|
||||
'Vi er en trivelig gjeng hvis der fellestrekk er en viss interesse for data, samt har eller har hatt en tilknytning til studentmiljøet ved NTNU. For å treffe andre som også faller inn under disse kriteriene treffes vi over pizza på Peppes annenhver fredag. (Definisjon: En fredag er annenhver dersom den ligger i en partallsuke). Vi har reservasjon under navnet Christensen med storkunderabatt.',
|
||||
'',
|
||||
'Det er ikke noe krav at du er nerd... noen av oss virker faktisk nesten normale! Det er heller ikke noe krav at du kjenner noen fra før. Det er ikke engang et krav at du må like pizza! (selv om det hjelper) Dersom du har lyst til å treffe personer fra datamiljøet ved NTNU så bare still opp! Vi biter ikke, vel, bortsett fra pizzaen da.',
|
||||
'',
|
||||
'Vi bestiller så mye pizza som vi i fellesskap klarer å stappe i oss, og splitter dermed pizza-regningen broderlig, mens hver enkelt betaler for sin egen drikke, dessert mm. Vell møtt!'
|
||||
];
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#c35";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0"?>
|
||||
<clientConfig version="1.1">
|
||||
<emailProvider id="pvv.ntnu.no">
|
||||
<domain>pvv.ntnu.no</domain>
|
||||
<domain>pvv.org</domain>
|
||||
|
||||
<displayName>Programvareverkstedet</displayName>
|
||||
|
||||
<incomingServer type="imap">
|
||||
<hostname>imap.pvv.ntnu.no</hostname>
|
||||
<port>993</port>
|
||||
<socketType>SSL</socketType>
|
||||
<username>%EMAILLOCALPART%</username>
|
||||
<authentication>password-cleartext</authentication>
|
||||
</incomingServer>
|
||||
|
||||
<outgoingServer type="smtp">
|
||||
<hostname>smtp.pvv.ntnu.no</hostname>
|
||||
<port>587</port>
|
||||
<socketType>STARTTLS</socketType>
|
||||
<username>%EMAILLOCALPART%</username>
|
||||
<authentication>password-cleartext</authentication>
|
||||
<useGlobalPreferredServer>true</useGlobalPreferredServer>
|
||||
</outgoingServer>
|
||||
|
||||
<documentation url="https://www.pvv.ntnu.no/pvv/Drift/Mail/IMAP_POP3">
|
||||
<descr lang="en">Setup programvareverkstedet email user with IMAP or POP3</descr>
|
||||
<descr lang="nb">Sett opp programvareverkstedet email bruker med IMAP eller POP3</descr>
|
||||
</documentation>
|
||||
</emailProvider>
|
||||
</clientConfig>
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"m.server": "matrix.pvv.ntnu.no:443"
|
||||
}
|
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 52 KiB |
|
@ -0,0 +1,141 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 800 800"
|
||||
style="enable-background:new 0 0 800 800;"
|
||||
xml:space="preserve"
|
||||
id="svg45"
|
||||
sodipodi:docname="Pvv logoBW.svg"
|
||||
inkscape:version="0.92.2 5c3e80d, 2017-08-06"><metadata
|
||||
id="metadata51"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs49" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1027"
|
||||
id="namedview47"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.834386"
|
||||
inkscape:cx="590.94635"
|
||||
inkscape:cy="338.49599"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_5" /><style
|
||||
type="text/css"
|
||||
id="style2">
|
||||
.st0{fill:#ffffff;}
|
||||
.st1{fill:none;stroke:#ffffff;stroke-width:2;stroke-miterlimit:10;}
|
||||
.st2{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
|
||||
.st3{fill:none;}
|
||||
.st4{stroke:#000000;stroke-miterlimit:10;}
|
||||
.st5{font-family:'OCRAStd';}
|
||||
.st6{font-size:126px;}
|
||||
</style><g
|
||||
id="Layer_2"><rect
|
||||
y="0"
|
||||
class="st0"
|
||||
width="800"
|
||||
height="800"
|
||||
id="rect4" /></g><g
|
||||
id="Layer_4"><path
|
||||
class="st1"
|
||||
d="M294.6,720.3"
|
||||
id="path7" /><line
|
||||
class="st1"
|
||||
x1="478.4"
|
||||
y1="720.3"
|
||||
x2="313.2"
|
||||
y2="720.3"
|
||||
id="line9" /><path
|
||||
class="st1"
|
||||
d="M478.4,720.3"
|
||||
id="path11" /><polyline
|
||||
class="st2"
|
||||
points="717.1,223.3 717.1,720.3 497.3,720.3 "
|
||||
id="polyline13" /><path
|
||||
class="st2"
|
||||
d="M498.3,720.3c0-5.6-4.5-10.1-10.1-10.1c-5.6,0-10.1,4.5-10.1,10.1H314.3c0-5.6-4.5-10.1-10.1-10.1 c-5.6,0-10.1,4.5-10.1,10.1h0.6H76.5V79.7h640.5v120.8v-0.8h-17.3v24.8h17.3"
|
||||
id="path15" /></g><g
|
||||
id="Layer_3"><circle
|
||||
class="st2"
|
||||
cx="396.8"
|
||||
cy="400"
|
||||
r="320.3"
|
||||
id="circle18" /></g><g
|
||||
id="Layer_1"><polyline
|
||||
class="st2"
|
||||
points="514.5,173.5 170.2,173.5 170.3,626.6 623.3,626.5 623.3,215.7 584.4,173.4 557,173.4 548,180.6 526.5,180.7 "
|
||||
id="polyline21" /><path
|
||||
class="st1"
|
||||
d="M396.8,173.5"
|
||||
id="path23" /><path
|
||||
class="st1"
|
||||
d="M396.8,173.3"
|
||||
id="path25" /><path
|
||||
class="st2"
|
||||
d="M526.5,331.8c0,7.6-5.4,13.7-12,13.7H227.7c-6.6,0-12-6.1-12-13.7V187.2c0-7.6,5.4-13.7,12-13.7h286.8 c6.6,0,12,6.1,12,13.7V331.8z"
|
||||
id="path27" /><path
|
||||
class="st2"
|
||||
d="M526.7,333.6c0,6.6-5.4,12-12,12H296.8c-6.6,0-12-5.4-12-12V185.5c0-6.6,5.4-12,12-12h217.9 c6.6,0,12,5.4,12,12V333.6z"
|
||||
id="path29" /><path
|
||||
class="st2"
|
||||
d="M577.9,613.7c0,6.6-5.4,12-12,12H227.7c-6.6,0-12-5.4-12-12V381.1c0-6.6,5.4-12,12-12h338.2 c6.6,0,12,5.4,12,12V613.7z"
|
||||
id="path31" /><rect
|
||||
x="179.9"
|
||||
y="590.2"
|
||||
class="st2"
|
||||
width="25.7"
|
||||
height="23"
|
||||
id="rect33" /><rect
|
||||
x="587.6"
|
||||
y="590.2"
|
||||
class="st2"
|
||||
width="25.7"
|
||||
height="23"
|
||||
id="rect35" /><rect
|
||||
x="433.6"
|
||||
y="193.5"
|
||||
class="st2"
|
||||
width="64.9"
|
||||
height="137.8"
|
||||
id="rect37" /></g><g
|
||||
id="Layer_5"><rect
|
||||
x="258"
|
||||
y="442.5"
|
||||
class="st3"
|
||||
width="277.5"
|
||||
height="109.7"
|
||||
id="rect40" /><g
|
||||
aria-label="PVV"
|
||||
transform="matrix(1 0 0 1 260.7021 547.998)"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:126px;font-family:OCRA;-inkscape-font-specification:OCRA;stroke:#000000;stroke-miterlimit:10"
|
||||
id="text42"><path
|
||||
d="m 14.238,-6.426 c 0,3.528 2.772,6.426 6.3,6.426 3.528,0 6.426,-2.898 6.426,-6.426 v -30.996 h 30.87 c 10.458,0 19.152,-8.694 19.152,-19.152 v -22.68 c 0,-10.332 -8.694,-19.026 -19.152,-19.026 H 14.238 Z m 12.726,-43.722 v -35.406 h 30.87 c 3.276,0 6.426,2.898 6.426,6.3 v 22.68 c 0,3.528 -3.024,6.426 -6.426,6.426 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:126px;font-family:OCRA;-inkscape-font-specification:OCRA;stroke:#000000;stroke-miterlimit:10"
|
||||
id="path55" /><path
|
||||
d="m 105.29269,-69.174 25.326,65.142 c 1.008,2.394 3.276,4.032 6.048,4.032 2.646,0 4.914,-1.638 5.922,-4.032 l 25.452,-65.268 v -22.68 c 0,-3.402 -2.898,-6.3 -6.426,-6.3 -3.528,0 -6.3,2.898 -6.3,6.3 v 20.286 l -18.648,47.628 -18.648,-47.628 V -91.98 c 0,-3.402 -2.898,-6.3 -6.426,-6.3 -3.528,0 -6.3,2.898 -6.3,6.3 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:126px;font-family:OCRA;-inkscape-font-specification:OCRA;stroke:#000000;stroke-miterlimit:10"
|
||||
id="path57" /><path
|
||||
d="m 196.34737,-69.174 25.326,65.142 c 1.008,2.394 3.276,4.032 6.048,4.032 2.646,0 4.914,-1.638 5.922,-4.032 l 25.452,-65.268 v -22.68 c 0,-3.402 -2.898,-6.3 -6.426,-6.3 -3.528,0 -6.3,2.898 -6.3,6.3 v 20.286 l -18.648,47.628 -18.648,-47.628 V -91.98 c 0,-3.402 -2.898,-6.3 -6.426,-6.3 -3.528,0 -6.3,2.898 -6.3,6.3 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:126px;font-family:OCRA;-inkscape-font-specification:OCRA;stroke:#000000;stroke-miterlimit:10"
|
||||
id="path59" /></g></g></svg>
|
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 7.1 KiB |
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
$name = $attrs['cn'][0];
|
||||
|
||||
if(!$userManager->hasGroup($uname, 'aktiviteter')){
|
||||
echo 'Her har du ikke lov\'t\'å\'værra!!!';
|
||||
|
@ -36,77 +37,107 @@ if(isset($_GET['id'])){
|
|||
}
|
||||
|
||||
$today = new DateTimeImmutable;
|
||||
$defaultStart = $today->format("Y-m-d H:00:00");
|
||||
$inOneHour = $today->add(new DateInterval('PT1H'));
|
||||
$defaultEnd = $inOneHour->format("Y-m-d H:00:00");
|
||||
$today = $today->setTime(18, 15);
|
||||
$defaultStart = $today->format("Y-m-d H:15:00");
|
||||
$inTwoHours = $today->add(new DateInterval('PT1H45M'));
|
||||
$defaultEnd = $inTwoHours->format("Y-m-d H:00:00");
|
||||
|
||||
$event = new \pvv\side\SimpleEvent(
|
||||
0,
|
||||
'Kul Hendelse',
|
||||
$today,
|
||||
$inOneHour,
|
||||
'PVV',
|
||||
'Norge et sted',
|
||||
'her skjer det noe altså'
|
||||
);
|
||||
$event;
|
||||
if($new == 0){
|
||||
$event = $customActivity->getEventByID($eventID);
|
||||
}
|
||||
?>
|
||||
else {
|
||||
$event = new \pvv\side\SimpleEvent(
|
||||
0,
|
||||
'',
|
||||
$today,
|
||||
$inTwoHours,
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no" locale="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/nav.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Adminverkstedet</title>
|
||||
|
||||
<header class="admin">Aktivitets­administrasjon</header>
|
||||
<header>Admin­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
|
||||
<article>
|
||||
<h2><?= ($new == 1 ? "Ny hendelse" : "Rediger hendelse"); ?></h2>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(3, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<form action="update.php", method="post" class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $event->getName(). '" class="boxinput">' ?><br>
|
||||
<main>
|
||||
<h2>Aktivietsadministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($event->getDescription(), "\n"); ?></textarea>
|
||||
</div>
|
||||
<h2><?= ($new == 1 ? "Ny hendelse" : "Rediger hendelse"); ?></h2>
|
||||
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Starttid (YYYY-MM-DD HH:MM:SS)</p>
|
||||
<?= '<input name="start" type="text" class="boxinput" value="' . $event->getStart()->format('Y-m-d H:00:00') . '"><br>' ?>
|
||||
<form action="update.php", method="post" class="gridsplit fullwidth_inputs">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<input type="text" name="title" value="<?= $event->getName() ?>" class="boxinput" required placeholder="En kul hendelse"><br>
|
||||
|
||||
<p class="subtitle">Sluttid (YYYY-MM-DD HH:MM:SS)</p>
|
||||
<?= '<input name="end" type="text" class="boxinput" value="' . $event->getStop()->format('Y-m-d H:00:00') . '"><br>' ?>
|
||||
<div class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Arrangør</p>
|
||||
<input type="text" name="organiser" value="<?= $event->getOrganiser() ?>" class="boxinput" required placeholder="<?= $name ?>"><br>
|
||||
</div>
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Sted</p>
|
||||
<input type="text" name="location" value="<?= $event->getLocation() ?>" class="boxinput" required placeholder="Terminalrommet"><br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="subtitle">Organisert av</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $event->getOrganiser(). '" class="boxinput">' ?><br>
|
||||
<p class="subtitle">Beskrivelse (<i>markdown</i>)</p>
|
||||
<textarea name="desc" rows="8" class="boxinput" placeholder="Beskrivelse" required><?= implode("\n", $event->getDescription()); ?></textarea>
|
||||
|
||||
<p class="subtitle">Hvor?</p>
|
||||
<?= '<input type="text" name="location" value="' . $event->getLocation(). '" class="boxinput">' ?><br>
|
||||
</div>
|
||||
|
||||
<?= '<input type="hidden" name="id" value="' . $event->getID() . '" />' ?>
|
||||
</div>
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
<div class="gridr" style="line-height: 1.3em;">
|
||||
<h4>Starttid</h4><br>
|
||||
<i>Måned:</i><br>
|
||||
<input name="start_mon" type="month" class="boxinput" required value="<?= $event->getStart()->format('Y-m') ?>"><br>
|
||||
<i>Dag:</i><br>
|
||||
<input name="start_day" type="number" min="1" max="31" required class="boxinput" value="<?= $event->getStart()->format('d') ?>"><br>
|
||||
<i>Klokkeslett:</i><br>
|
||||
<input name="start_time" type="time" class="boxinput" required value="<?= $event->getStart()->format('H:i:s') ?>"><br>
|
||||
<br>
|
||||
<h4>Varighet</h4><br>
|
||||
<?php $diff = $event->getStart()->diff($event->getStop()); ?>
|
||||
<i>Timer:</i><br>
|
||||
<input name="lasts_hours" type="number" min="0" class="boxinput" required value="<?= $diff->h ?>"><br>
|
||||
<i>Minutter:</i><br>
|
||||
<input name="lasts_minutes" type="number" min="0" max="59" class="boxinput" required value="<?= $diff->i ?>"><br>
|
||||
|
||||
<input type="submit" class="btn" value="Lagre"></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="<?= $event->getID() ?>" />
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
<input type="submit" class="btn" value="Lagre"></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<p>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -29,13 +29,13 @@ if(isset($_GET['page'])){
|
|||
}
|
||||
|
||||
$filterTitle = '';
|
||||
if(isset($_POST['title'])){
|
||||
$filterTitle = $_POST['title'];
|
||||
if(isset($_GET['title'])){
|
||||
$filterTitle = $_GET['title'];
|
||||
}
|
||||
|
||||
$filterOrganiser = '';
|
||||
if(isset($_POST['organiser'])){
|
||||
$filterOrganiser = $_POST['organiser'];
|
||||
if(isset($_GET['organiser'])){
|
||||
$filterOrganiser = $_GET['organiser'];
|
||||
}
|
||||
|
||||
// filter
|
||||
|
@ -46,91 +46,103 @@ $events = array_values(array_filter(
|
|||
}
|
||||
));
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/nav.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Aktivitetsadministrasjonsverkstedet</title>
|
||||
|
||||
<header class="admin">Aktivitets­administrasjon</header>
|
||||
<header>Aktivitets­administrasjons­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
<body>
|
||||
|
||||
<article class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Aktive aktiviteter</h2>
|
||||
<p class="subnote">Gjentagende aktiviteter vises ikke</p>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
<main>
|
||||
<h2>Aktivitetsadministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
<div class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Aktive aktiviteter</h2>
|
||||
<p class="subnote">Gjentagende aktiviteter vises ikke</p>
|
||||
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 10;
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
}
|
||||
|
||||
$event = $events[$i];
|
||||
$eventID = $event->getID();
|
||||
?>
|
||||
|
||||
<li>
|
||||
<div class="event admin">
|
||||
<div class="event-info">
|
||||
<h3 class="no-chin"><?= $event->getName() . " (ID: " . $eventID . ")"; ?></h3>
|
||||
<p class="subnote">
|
||||
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
|
||||
</p>
|
||||
<?php
|
||||
$Parsedown = new \Parsedown();
|
||||
echo $Parsedown->text(implode("\n", $event->getDescription()));
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="event-actions">
|
||||
<a class="btn" href="edit.php?id=<?= $eventID ?>">Rediger</a><br>
|
||||
<a class="btn" href="delete.php?id=<?= $eventID ?>" onclick="return confirm('Knallsikker? (ID: <?= $eventID ?>)');">Slett</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$counter++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if($page != 1){
|
||||
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '&title=' . urlencode($filterTitle) . '&organiser=' . urlencode($filterOrganiser) . '">Forrige side</a>';
|
||||
}
|
||||
|
||||
$event = $events[$i];
|
||||
$eventID = $event->getID();
|
||||
?>
|
||||
|
||||
<li>
|
||||
<div class="event admin">
|
||||
<div class="event-info">
|
||||
<h3 class="no-chin"><?= $event->getName() . " (ID: " . $eventID . ")"; ?></h3>
|
||||
<p class="subnote">
|
||||
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
|
||||
</p>
|
||||
<p><?= implode($event->getDescription(), "</p>\n<p>"); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="event-actions">
|
||||
<!-- emojis are for big boys -->
|
||||
<?= '<a href="edit.php?id=' . $eventID . '">🖊</a>'; ?>
|
||||
<?= '<a href="delete.php?id=' . $eventID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $eventID . ')\');">🗑</a>'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$counter++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if($page != 1){
|
||||
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
|
||||
}
|
||||
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($events))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="gridr">
|
||||
<h2>Verktøy</h2>
|
||||
<a class="btn adminbtn" href="edit.php?new=1">Legg inn ny aktivitet</a>
|
||||
<h2>Filter</h2>
|
||||
<form action="." method="post">
|
||||
<p class="no-chin">Navn</p>
|
||||
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
|
||||
<p class="no-chin">Organisator</p>
|
||||
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
|
||||
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($events))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '&title=' . urlencode($filterTitle) . '&organiser=' . urlencode($filterOrganiser) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
<div class="gridr">
|
||||
<h2>Verktøy</h2>
|
||||
<a class="btn adminbtn" href="edit.php?new=1">Legg inn ny aktivitet</a>
|
||||
<h2>Filter</h2>
|
||||
<form action="." method="get">
|
||||
<p class="no-chin">Navn</p>
|
||||
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
|
||||
<p class="no-chin">Organisator</p>
|
||||
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -18,7 +18,15 @@ if(!$userManager->hasGroup($uname, 'aktiviteter')){
|
|||
exit();
|
||||
}
|
||||
|
||||
if(!isset($_POST['title']) or !isset($_POST['desc']) or !isset($_POST['start']) or !isset($_POST['end']) or !isset($_POST['organiser']) or !isset($_POST['location'])){
|
||||
if((!isset($_POST['title']))
|
||||
or (!isset($_POST['desc']))
|
||||
or (!isset($_POST['organiser']))
|
||||
or (!isset($_POST['location']))
|
||||
or (!isset($_POST['start_mon']))
|
||||
or (!isset($_POST['start_day']))
|
||||
or (!isset($_POST['start_time']))
|
||||
or (!isset($_POST['lasts_hours']))
|
||||
or (!isset($_POST['lasts_minutes']))) {
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
exit();
|
||||
}
|
||||
|
@ -30,11 +38,36 @@ if(isset($_POST['id'])){
|
|||
|
||||
$title = $_POST['title'];
|
||||
$desc = $_POST['desc'];
|
||||
$start = $_POST['start'];
|
||||
$stop = $_POST['end'];
|
||||
//$start = $_POST['start'];
|
||||
//$stop = $_POST['end'];
|
||||
$organiser = $_POST['organiser'];
|
||||
$location = $_POST['location'];
|
||||
|
||||
$date_part_start_mon = $_POST['start_mon'];
|
||||
$date_part_start_day = $_POST['start_day'];
|
||||
$date_part_start_time = $_POST['start_time'];
|
||||
$date_part_lasts_hours = $_POST['lasts_hours'];
|
||||
$date_part_lasts_minutes = $_POST['lasts_minutes'];
|
||||
|
||||
while (strlen($date_part_start_day) < 2) {
|
||||
$date_part_start_day = "0" . $date_part_start_day;
|
||||
}
|
||||
|
||||
$start = ($date_part_start_mon . "-" . $date_part_start_day . " " . $date_part_start_time);
|
||||
if (sizeof(explode(":", $date_part_start_time))==2) {
|
||||
$start .= ":00";
|
||||
}
|
||||
|
||||
$start_date = DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $start);
|
||||
$stop_date = $start_date->add(new DateInterval('PT' . $date_part_lasts_hours . 'H' . $date_part_lasts_minutes . 'M'));
|
||||
$start = $start_date->format('Y-m-d H:i:s');
|
||||
$stop = $stop_date->format('Y-m-d H:i:s');
|
||||
|
||||
if ($start_date >= $stop_date) {
|
||||
echo 'Invalid dates. End date must come after the start date!';
|
||||
exit();
|
||||
}
|
||||
|
||||
$statement;
|
||||
if($id == 0){
|
||||
$query = 'INSERT INTO events (name, start, stop, organiser, location, description) VALUES (:title, :start, :stop, :organiser, :loc, :desc)';
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
<?php
|
||||
ini_set('display_errors', '1');
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
error_reporting(E_ALL);
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$attrs = $as->getAttributes();
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -26,80 +27,73 @@ if(!$userManager->isAdmin($uname)){
|
|||
|
||||
$users = $userManager->getAllUserData();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Brukeradministrasjonsverkstedet</title>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<li class="active"><a href="index.php">hjem</a></li>
|
||||
<li><a href="aktiviteter/">aktiviteter</a></li>
|
||||
<li><a href="../prosjekt/">prosjekter</a></li>
|
||||
<li><a href="kontakt">kontakt</a></li>
|
||||
<li><a href="pvv/">wiki</a></li>
|
||||
</ul>
|
||||
<header>Bruker­administrasjons­verk­stedet</header>
|
||||
|
||||
<?php
|
||||
$attr = $as->getAttributes();
|
||||
if($attr){
|
||||
$uname = $attr["uid"][0];
|
||||
echo '<p class="login">logget inn som: ' . $uname . '</p>';
|
||||
}else{
|
||||
echo '<a class="login" href="' . $as->getLoginURL() . '">logg inn</a>';
|
||||
}
|
||||
?>
|
||||
</nav>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<header class="admin">Bruker­administrasjon</header>
|
||||
<main>
|
||||
<h2>Brukeradministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<main>
|
||||
<article>
|
||||
<form action="./update.php" method="post">
|
||||
<table class="userlist">
|
||||
<tr>
|
||||
<th>Brukernavn</th>
|
||||
<th>Brukergrupper</th>
|
||||
</tr>
|
||||
|
||||
<form action="./update.php" method="post">
|
||||
<table class="userlist">
|
||||
<tr><th>Brukernavn</th><th>Brukergrupper</th></tr>
|
||||
|
||||
<?php
|
||||
$users_value = '';
|
||||
foreach($users as $i => $data){
|
||||
$uname = $data['name'];
|
||||
$groupFlag = $userManager->getUsergroups($uname);
|
||||
|
||||
if(!$users_value){
|
||||
$users_value = $uname;
|
||||
}else{
|
||||
$users_value = $users_value . '_' . $uname;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $uname ?></td>
|
||||
<?php
|
||||
foreach($userManager->usergroups as $name => $group){
|
||||
echo '<td><input type="checkbox" ' . (($groupFlag & $group) ? 'checked' : '') . ' name="' . $uname . '_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
|
||||
}
|
||||
$users_to_update = array();
|
||||
foreach($users as $i => $data){
|
||||
$uname = $data['name'];
|
||||
$groupFlag = $userManager->getUsergroups($uname);
|
||||
|
||||
array_push($users_to_update, $uname);
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
echo '<input type="hidden" name="users" value="' . $users_value . '" />';
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $uname ?></td>
|
||||
<?php
|
||||
foreach($userManager->usergroups as $name => $group){
|
||||
echo '<td><input type="checkbox" ' . (($groupFlag & $group) ? 'checked' : '') . ' name="' . $uname . '_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<tr class="newuserrow">
|
||||
<td class="newuserelement"><input type="text" name="newuser" class="newuserinput"></td>
|
||||
<?php
|
||||
foreach($userManager->usergroups as $name => $group){
|
||||
echo '<td><input type="checkbox" name="newuser_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
|
||||
<?php
|
||||
}
|
||||
foreach($users_to_update as $uname) {
|
||||
echo '<input type="hidden" name="user_to_update" value="' . $uname . '" />';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</form>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
?>
|
||||
|
||||
<tr class="newuserrow">
|
||||
<td class="newuserelement"><input type="text" name="newuser" class="newuserinput"></td>
|
||||
<?php
|
||||
foreach($userManager->usergroups as $name => $group){
|
||||
echo '<td><input type="checkbox" name="newuser_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
ini_set('display_errors', '1');
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
error_reporting(E_ALL);
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -26,8 +26,13 @@ if(isset($_POST['newuser'])){
|
|||
unset($_POST['newuser']);
|
||||
}
|
||||
|
||||
$updatingUsers = explode('_', $_POST['users']);
|
||||
unset($_POST['users']);
|
||||
//$updatingUsers = explode('_', $_POST['users']);
|
||||
$updatingUsers = array();
|
||||
foreach ($_POST as $key => $value) { if ($key === "user_to_update") {
|
||||
array_push($updatingUsers, $value);
|
||||
}
|
||||
}
|
||||
unset($_POST['user_to_update']);
|
||||
|
||||
// 2d array of usernames and their corresponding group flags
|
||||
$userFlags = [];
|
||||
|
@ -37,22 +42,24 @@ if($newUser){
|
|||
|
||||
foreach($_POST as $namegroup => $info){
|
||||
$data = explode('_', $namegroup);
|
||||
if($data[0] == 'newuser'){
|
||||
$group = array_pop($data);
|
||||
$uname = implode("_", $data);
|
||||
if($uname == 'newuser'){
|
||||
if(!$newUser){
|
||||
continue;
|
||||
}
|
||||
|
||||
$data[0] = $newUser;
|
||||
$uname = $newUser;
|
||||
}
|
||||
|
||||
if(!isset($userFlags[$data[0]])){
|
||||
$userFlags[$data[0]] = 0;
|
||||
if(!isset($userFlags[$uname])){
|
||||
$userFlags[$uname] = 0;
|
||||
}
|
||||
|
||||
$userFlags[$data[0]] = ($userFlags[$data[0]] | $userManager->usergroups[$data[1]]);
|
||||
$userFlags[$uname] = ($userFlags[$uname] | $userManager->usergroups[$group]);
|
||||
}
|
||||
|
||||
foreach($updatingUsers as $uname){
|
||||
foreach($updatingUsers as $uname) {
|
||||
if(!array_key_exists($uname, $userFlags)){
|
||||
$userFlags[$uname] = 0;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
<?php
|
||||
require __DIR__ . '/../../inc/navbar.php';
|
||||
require __DIR__ . '/../../src/_autoload.php';
|
||||
require_once __DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php';
|
||||
require __DIR__ . '/../../sql_config.php';
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -18,41 +15,52 @@ $projectGroup = $userManager->hasGroup($uname, 'prosjekt');
|
|||
$activityGroup = $userManager->hasGroup($uname, 'aktiviteter');
|
||||
|
||||
if(!($isAdmin | $projectGroup | $activityGroup)){
|
||||
echo 'Her har du ikke lov\'t\'å\'værra!!!';
|
||||
header('Content-Type: text/plain', true, 403);
|
||||
echo "Her har du ikke lov't'å'værra!!!\r\n";
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../css/normalize.css">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<link rel="stylesheet" href="../css/events.css">
|
||||
<link rel="stylesheet" href="../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Administrasjonsverkstedet</title>
|
||||
|
||||
<header class="admin">Stor-­gutt-­leketøy</header>
|
||||
<header>Administrasjons­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
|
||||
<article>
|
||||
<h2>Verktøy</h2>
|
||||
<?php
|
||||
if($isAdmin | $activityGroup){
|
||||
echo '<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>';
|
||||
}
|
||||
<body>
|
||||
<nav id="navbar">
|
||||
<?php echo navbar(1, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
if($isAdmin | $projectGroup){
|
||||
echo '<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>';
|
||||
}
|
||||
<main>
|
||||
<h2>Administrasjon</h2>
|
||||
<ul class="tools">
|
||||
<?php
|
||||
if($isAdmin | $activityGroup){
|
||||
echo '<li><a class="btn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a></li>';
|
||||
}
|
||||
|
||||
if($isAdmin){
|
||||
echo '<a class="btn adminbtn" href="brukere/">Brukere</a>';
|
||||
}
|
||||
?>
|
||||
</article>
|
||||
if($isAdmin | $projectGroup){
|
||||
echo '<li><a class="btn" href="prosjekter/">Prosjekter</a></li>';
|
||||
}
|
||||
|
||||
</main>
|
||||
if($isAdmin) {
|
||||
echo '<li><a class="btn" href="motd/">Dagens melding</a></li>';
|
||||
}
|
||||
|
||||
<nav>
|
||||
<?= navbar(1); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
if($isAdmin){
|
||||
echo '<li><a class="btn" href="brukere/">Brukerrettigheter</a></li>';
|
||||
}
|
||||
?>
|
||||
<ul>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
ini_set('display_errors', '1');
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
error_reporting(E_ALL);
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$attrs = $as->getAttributes();
|
||||
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
||||
if(!$userManager->isAdmin($uname)){
|
||||
echo 'Her har du ikke lov\'t\'å\'værra!!!';
|
||||
exit();
|
||||
}
|
||||
|
||||
$motdfetcher = new \pvv\side\MOTD($pdo);
|
||||
$motd = $motdfetcher->getMOTD();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/nav.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>MOTDadministrasjonsverkstedet</title>
|
||||
|
||||
<header>MOTD­administrasjons­verk­stedet</header>
|
||||
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<h2>Dagens melding</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<form action="update.php", method="post">
|
||||
<p class="subtitle no-chin">Tittel</p>
|
||||
<p class="subnote">Ikke nødvendig</p>
|
||||
<input type="text" name="title" value="<?= $motd['title'] ?>" class="boxinput" style="width:66%;"><br>
|
||||
|
||||
<p class="subtitle no-chin">Innhold (<i>markdown</i>)</p>
|
||||
<textarea name="content" style="width:100%" rows="8" class="boxinput"><?= implode("\n", $motd["content"]) ?></textarea>
|
||||
|
||||
<div style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<?= '<input type="submit" class="btn" value="Lagre endringer"></a>'; ?>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
ini_set('display_errors', '1');
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
error_reporting(E_ALL);
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
||||
if(!isset($_POST['title']) or !isset($_POST['content'])){
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!$userManager->isAdmin($uname)){
|
||||
echo 'Her har du ikke lov\'t\'å\'værra!!!';
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$motdfetcher = new \pvv\side\MOTD($pdo);
|
||||
$motdfetcher->setMOTD($_POST['title'], $_POST['content']);
|
||||
|
||||
header('Location: .');
|
||||
?>
|
||||
|
||||
<a href=".">Om du ikke ble automatisk omdirigert tilbake klikk her</a>
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -42,60 +42,107 @@ $project = new \pvv\side\Project(
|
|||
'',
|
||||
'kåre knoll',
|
||||
'pvvadmin',
|
||||
'drift@pvv.ntnu.no',
|
||||
0
|
||||
);
|
||||
if($new == 0){
|
||||
$project = $projectManager->getByID($projectID);
|
||||
}
|
||||
?>
|
||||
|
||||
$members = $projectManager->getProjectMembers($projectID);
|
||||
$owner = [
|
||||
'name' => '',
|
||||
'uname' => '',
|
||||
'mail' => '',
|
||||
];
|
||||
foreach($members as $i => $data){
|
||||
if($data['owner']){
|
||||
$owner = $data;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Prosjektadministrasjonsverkstedet</title>
|
||||
|
||||
<header class="admin">Prosjekt­administrasjon</header>
|
||||
<header>Prosjekt­administrasjons­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(3, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<article>
|
||||
<h2><?= ($new == 1 ? "Nytt prosjekt" : "Rediger prosjekt"); ?></h2>
|
||||
<main>
|
||||
<h2>Prosjektadministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<form action="update.php", method="post" class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
|
||||
<h2><?= ($new == 1 ? "Nytt prosjekt" : "Rediger prosjekt"); ?></h2>
|
||||
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= $project->getDescription(); ?></textarea>
|
||||
</div>
|
||||
<form action="update.php", method="post" class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
|
||||
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Prosjekteier (Brukernavn)</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $project->getOwnerUName(). '" class="boxinput">' ?><br>
|
||||
<p class="subtitle">Beskrivelse (<i>markdown</i>)</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode("\n", $project->getDescription()); ?></textarea>
|
||||
</div>
|
||||
|
||||
<p class="subtitle">Prosjekteier (Navn)</p>
|
||||
<?= '<input type="text" name="organisername" value="' . $project->getOwner(). '" class="boxinput">' ?>
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Prosjektleder (Brukernavn)</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $owner['uname'] . '" class="boxinput">' ?><br>
|
||||
|
||||
<p class="subtitle">Aktiv</p>
|
||||
<?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?>
|
||||
</div>
|
||||
<p class="subtitle">Prosjektleder (Navn)</p>
|
||||
<?= '<input type="text" name="organisername" value="' . $owner['name'] . '" class="boxinput">' ?>
|
||||
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
<p class="subtitle">Prosjektleder E-post</p>
|
||||
<?= '<input type="text" name="organiseremail" value="' . $owner['mail'] . '" class="boxinput">' ?><br>
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
<p class="subtitle">Aktiv</p>
|
||||
<?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</div>
|
||||
</form>
|
||||
<p>
|
||||
</article>
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
|
||||
</main>
|
||||
<?php if(!$new){ ?>
|
||||
<div style="grid-column: span 2;">
|
||||
<hr class="ruler">
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<h2 style="grid-column: span 2">Prosjektmedlemmer</h2>
|
||||
|
||||
<table class="userlist" style="grid-column: span 2;">
|
||||
<tr><th>Brukernavn</th><th>Navn</th><th>Rolle</th></tr>
|
||||
<?php foreach($members as $i => $data) { ?>
|
||||
<tr>
|
||||
<td><?= $data['uname']; ?></td>
|
||||
<td><?= $data['name']; ?></td>
|
||||
<td><?= $data['role']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr class="newuserrow">
|
||||
<td class="newuserelement"><input type="text" name="newuser_uname"></td>
|
||||
<td class="newuserelement"><input type="text" name="newuser_name"></td>
|
||||
<td class="newuserelement"><input type="text" name="newuser_role"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</div>
|
||||
</form>
|
||||
<p>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../inc/navbar.php';
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
require __DIR__ . '/../../../config.php';
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -33,100 +33,116 @@ if(isset($_POST['title'])){
|
|||
$filterTitle = $_POST['title'];
|
||||
}
|
||||
|
||||
/* Temporarily out of service :<
|
||||
$filterOrganiser = '';
|
||||
if(isset($_POST['organiser'])){
|
||||
$filterOrganiser = $_POST['organiser'];
|
||||
}
|
||||
*/
|
||||
|
||||
// filter
|
||||
$projects = array_values(array_filter(
|
||||
$projects,
|
||||
function($project) use ($filterTitle, $filterOrganiser){
|
||||
return (preg_match('/.*'.$filterTitle.'.*/i', $project->getName()) and preg_match('/.*'.$filterOrganiser.'.*/i', $project->getOwner()));
|
||||
function($project) use ($filterTitle){
|
||||
return (preg_match('/.*'.$filterTitle.'.*/i', $project->getName()));
|
||||
}
|
||||
));
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/nav.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Prosjektadministrasjonsverkstedet</title>
|
||||
|
||||
<header class="admin">Prosjekt­administrasjon</header>
|
||||
<header>Prosjekt­administrasjons­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<article class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Prosjekter</h2>
|
||||
<main>
|
||||
<h2>Prosjektadministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
<div class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Prosjekter</h2>
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
}
|
||||
|
||||
$project = $projects[$i];
|
||||
$projectID = $project->getID();
|
||||
$owner = $projectManager->getProjectOwner($projectID);
|
||||
?>
|
||||
|
||||
<li>
|
||||
<div class="event admin">
|
||||
<div class="event-info">
|
||||
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
|
||||
<p class="subnote"><?= 'Organisert av: ' . $owner['name']; ?></p>
|
||||
<?php
|
||||
$Parsedown = new \Parsedown();
|
||||
echo $Parsedown->text(implode("\n", $project->getDescription()));
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="event-actions">
|
||||
<?= '<a href="edit.php?id=' . $projectID . '">🖊</a>'; ?>
|
||||
<?= '<a href="delete.php?id=' . $projectID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $projectID . ')\');">🗑</a>'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$counter++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if($page != 1){
|
||||
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
|
||||
}
|
||||
|
||||
$project = $projects[$i];
|
||||
$projectID = $project->getID();
|
||||
?>
|
||||
|
||||
<li>
|
||||
<div class="event admin">
|
||||
<div class="event-info">
|
||||
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
|
||||
<p class="subnote"><?= 'Organisert av: ' . $project->getOwner(); ?></p>
|
||||
<p><?= $project->getDescription(); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="event-actions">
|
||||
<?= '<a href="edit.php?id=' . $projectID . '">🖊</a>'; ?>
|
||||
<?= '<a href="delete.php?id=' . $projectID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $projectID . ')\');">🗑</a>'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$counter++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if($page != 1){
|
||||
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
|
||||
}
|
||||
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="gridr">
|
||||
<h2>Verktøy</h2>
|
||||
<a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a>
|
||||
<h2>Filter</h2>
|
||||
<form action="." method="post">
|
||||
<p class="no-chin">Navn</p>
|
||||
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
|
||||
<p class="no-chin">Organisator</p>
|
||||
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
|
||||
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
<div class="gridr">
|
||||
<h2>Verktøy</h2>
|
||||
<a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a>
|
||||
<h2>Filter</h2>
|
||||
<form action="." method="post">
|
||||
<p class="no-chin">Prosjektnavn</p>
|
||||
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
|
||||
<p class="no-chin">Leders brukernavn</p>
|
||||
<?= '<input type="text" name="organiser" class="boxinput" value="">' ?><br>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
setlocale(LC_ALL, 'nb_NO');
|
||||
require __DIR__ . '/../../../src/_autoload.php';
|
||||
require __DIR__ . '/../../../sql_config.php';
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
require __DIR__ . '/../../../config.php';
|
||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
|
||||
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
||||
$as = new SimpleSAML_Auth_Simple('default-sp');
|
||||
$as = new \SimpleSAML\Auth\Simple('default-sp');
|
||||
$as->requireAuth();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -30,33 +30,49 @@ if(isset($_POST['id'])){
|
|||
|
||||
$title = $_POST['title'];
|
||||
$desc = $_POST['desc'];
|
||||
$owner = $_POST['organisername'];
|
||||
$name = $_POST['organisername'];
|
||||
$uname = $_POST['organiser'];
|
||||
$mail = $_POST['organiseremail'];
|
||||
$active = (isset($_POST['active']) ? $_POST['active'] : 0);
|
||||
|
||||
$statement;
|
||||
if($id == 0){
|
||||
$query = 'INSERT INTO projects (name, owner, owneruname, description, active) VALUES (:title, :owner, :uname, :desc, :active)';
|
||||
$query = 'INSERT INTO projects (name, description, active) VALUES (:title, :desc, :active)';
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owner', $owner, PDO::PARAM_STR);
|
||||
$statement->bindParam(':uname', $uname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_INT);
|
||||
|
||||
$statement->execute();
|
||||
|
||||
$ownerQuery = 'INSERT INTO projectmembers (projectid, name, uname, mail, role, lead, owner) VALUES (last_insert_rowid(), :owner, :owneruname, :owneremail, \'Prosjektleder\', 1, 1)';
|
||||
$statement = $pdo->prepare($ownerQuery);
|
||||
$statement->bindParam(':owner', $name, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneruname', $uname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneremail', $mail, PDO::PARAM_STR);
|
||||
|
||||
$statement->execute();
|
||||
}else{
|
||||
$query = 'UPDATE projects SET name=:title, owner=:owner, owneruname=:uname, description=:desc, active=:active WHERE id=:id';
|
||||
$query = 'UPDATE projects SET name=:title, description=:desc, active=:active WHERE id=:id';
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owner', $owner, PDO::PARAM_STR);
|
||||
$statement->bindParam(':uname', $uname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_INT);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
}
|
||||
|
||||
$statement->execute();
|
||||
$statement->execute();
|
||||
|
||||
$query = 'UPDATE projectmembers SET name=:name, uname=:uname, mail=:mail';
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':name', $name, PDO::PARAM_STR);
|
||||
$statement->bindParam(':uname', $uname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':mail', $mail, PDO::PARAM_STR);
|
||||
|
||||
$statement->execute();
|
||||
}
|
||||
|
||||
header('Location: .');
|
||||
?>
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
require_once __DIR__ . '/../../inc/navbar.php';
|
||||
require_once __DIR__ . '/../../src/_autoload.php';
|
||||
require_once __DIR__ . '/../../sql_config.php';
|
||||
|
||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
use \pvv\side\Agenda;
|
||||
$agenda = new \pvv\side\Agenda([
|
||||
new \pvv\side\social\NerdepitsaActivity,
|
||||
new \pvv\side\social\AnimekveldActivity,
|
||||
new \pvv\side\DBActivity($pdo),
|
||||
]);
|
||||
<?php namespace pvv\side;
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
|
||||
$year = (isset($_GET['year']))
|
||||
? $_GET['year']
|
||||
|
@ -27,58 +14,65 @@ $day = (isset($_GET['day']))
|
|||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Aktivitetsverkstedet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../css/normalize.css">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<link rel="stylesheet" href="../css/events.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Aktivitetsverkstedet</title>
|
||||
|
||||
<header>Aktivitets­verk­stedet</header>
|
||||
|
||||
<main>
|
||||
|
||||
<?php
|
||||
$events = ($day==-1)
|
||||
? $agenda->getNextOfEach(new \DateTimeImmutable)
|
||||
: $agenda->getEventsBetween(
|
||||
new DateTimeImmutable("$year-$month-$day 00:00:00"),
|
||||
new DateTimeImmutable("$year-$month-$day 23:59:59"));
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(1, 'aktiviteter'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<?php
|
||||
use \DateTimeImmutable;
|
||||
$events = ($day==-1)
|
||||
? $agenda->getNextOfEach(new \DateTimeImmutable)
|
||||
: $agenda->getEventsBetween(
|
||||
new DateTimeImmutable("$year-$month-$day 00:00:00"),
|
||||
new DateTimeImmutable("$year-$month-$day 23:59:59"));
|
||||
|
||||
$limit = 0;
|
||||
foreach($events as $event) {
|
||||
?>
|
||||
<article>
|
||||
<h2>
|
||||
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
||||
<em><?= $event->getRelativeDate() ?></em>
|
||||
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
<?php if ($event->getURL()) { ?>
|
||||
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
|
||||
<?php } else { ?>
|
||||
<?= $event->getName() ?>
|
||||
<?php } ?>
|
||||
<?php if ($event->getImageURL()) { ?>
|
||||
<img src="<?= $event->getImageURL() ?>">
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong></li>
|
||||
<li>Sted: <strong><?= $event->getLocation() ?></strong></li>
|
||||
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong></li>
|
||||
</ul>
|
||||
|
||||
<?php $description = $event->getDescription(); ?>
|
||||
<?php if ($limit) array_splice($description, $limit); ?>
|
||||
<?php
|
||||
$Parsedown = new \Parsedown();
|
||||
echo $Parsedown->text(implode("\n", $description));
|
||||
?>
|
||||
</article>
|
||||
|
||||
$limit = 0;
|
||||
foreach($events as $event) {
|
||||
?>
|
||||
<article>
|
||||
<h2>
|
||||
<?php if ($event->getImageURL()) { ?>
|
||||
<img src="<?= $event->getImageURL() ?>">
|
||||
<?php } ?>
|
||||
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
||||
<em><?= $event->getRelativeDate() ?></em>
|
||||
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
<?php if ($event->getURL()) { ?>
|
||||
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
|
||||
<?php } else { ?>
|
||||
<?= $event->getName() ?>
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong>
|
||||
<li>Sted: <strong><?= $event->getLocation() ?></strong>
|
||||
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong>
|
||||
</ul>
|
||||
</main>
|
||||
|
||||
<?php $description = $event->getDescription(); ?>
|
||||
<?php if ($limit) array_splice($description, $limit); ?>
|
||||
<?= implode($description, "</p>\n<p>") ?>
|
||||
</article>
|
||||
|
||||
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
|
||||
<?php } ?>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1, 'aktiviteter'); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
</body>
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
require __DIR__ . '/../../src/_autoload.php';
|
||||
require __DIR__ . '/../../sql_config.php';
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
use \pvv\side\Agenda;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Sosialverkstedet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../css/normalize.css">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<link rel="stylesheet" href="../css/nav.css">
|
||||
<link rel="stylesheet" href="../css/events.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Animeverkstedet</title>
|
||||
|
||||
<header>Sosial­verk­stedet</header>
|
||||
|
||||
|
||||
<main>
|
||||
|
||||
<?php
|
||||
|
@ -24,7 +25,11 @@ $nextEvent = $activity->getNextEventFrom(new DateTimeImmutable);
|
|||
?>
|
||||
|
||||
<article>
|
||||
<h2><img src="../sosiale/animekveld.jpg"><em><?= $nextEvent->getRelativeDate()?></em> Animekveld</h2>
|
||||
<h2><em><?= $nextEvent->getRelativeDate()?></em> Animekveld
|
||||
<?php if ($nextEvent->getImageURL()) { ?>
|
||||
<img src="<?= $nextEvent->getImageURL() ?>">
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
<li>Tid:
|
||||
<strong>
|
||||
|
@ -40,17 +45,15 @@ $nextEvent = $activity->getNextEventFrom(new DateTimeImmutable);
|
|||
</strong>
|
||||
</ul>
|
||||
|
||||
<?= implode($nextEvent->getDescription(), "<p>\n</p>")?>
|
||||
<?php
|
||||
$Parsedown = new \Parsedown();
|
||||
echo $Parsedown->text(implode("\n", $nextEvent->getDescription()));
|
||||
?>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav><ul>
|
||||
<li><a href="../">hjem</a></li>
|
||||
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
|
||||
<li><a href="../kalender/">kalender</a></li>
|
||||
<li class="active"><a href="../aktiviteter/">aktiviteter</a></li>
|
||||
<li><a href="../prosjekt/">prosjekter</a></li>
|
||||
<li><a href="../kontakt/">kontakt</a></li>
|
||||
<li><a href="../pvv/">wiki</a></li>
|
||||
<nav>
|
||||
<?= navbar(1, 'aktiviteter'); ?>
|
||||
<?= loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<?php
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
setlocale(LC_ALL, 'no_NO');
|
||||
require __DIR__ . '/../../src/_autoload.php';
|
||||
require __DIR__ . '/../../sql_config.php';
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
use \pvv\side\Agenda;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Sosialverkstedet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="../css/normalize.css">
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<link rel="stylesheet" href="../css/nav.css">
|
||||
<link rel="stylesheet" href="../css/events.css">
|
||||
<meta name="theme-color" content="#024" />
|
||||
<title>Sosialverkstedet</title>
|
||||
|
||||
<header>Sosial­verk­stedet</header>
|
||||
|
||||
|
||||
<main>
|
||||
|
||||
<?php
|
||||
|
@ -25,11 +26,11 @@ $nextEvent = $activity->getNextEventFrom(new DateTimeImmutable);
|
|||
|
||||
<article>
|
||||
|
||||
<h2><em><?= $nextEvent->getRelativeDate()?></em> Brettspillkveld
|
||||
<?php if ($nextEvent->getImageURL()) { ?>
|
||||
<img src="<?= $nextEvent->getImageURL() ?>">
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<h2><em><?= $nextEvent->getRelativeDate()?></em> Brettspillkveld
|
||||
<?php if ($nextEvent->getImageURL()) { ?>
|
||||
<img src="<?= $nextEvent->getImageURL() ?>">
|
||||
<?php } ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
<li>Tid:
|
||||
<strong>
|
||||
|
@ -45,17 +46,15 @@ $nextEvent = $activity->getNextEventFrom(new DateTimeImmutable);
|
|||
</strong>
|
||||
</ul>
|
||||
|
||||
<?= implode($nextEvent->getDescription(), "<p>\n</p>")?>
|
||||
<?php
|
||||
$Parsedown = new \Parsedown();
|
||||
echo $Parsedown->text(implode("\n", $nextEvent->getDescription()));
|
||||
?>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav><ul>
|
||||
<li><a href="../">hjem</a></li>
|
||||
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
|
||||
<li><a href="../kalender/">kalender</a></li>
|
||||
<li class="active"><a href="../aktiviteter/">aktiviteter</a></li>
|
||||
<li><a href="../prosjekt/">prosjekter</a></li>
|
||||
<li><a href="../kontakt/">kontakt</a></li>
|
||||
<li><a href="../pvv/">wiki</a></li>
|
||||
<nav>
|
||||
<?= navbar(1, 'aktiviteter'); ?>
|
||||
<?= loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
header.admin {
|
||||
margin-top: 3rem;
|
||||
height: 16rem;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
padding: 1rem;
|
||||
font-size: 4em;
|
||||
background: url('ja.png') no-repeat 1% 50% #024;
|
||||
background-size: contain;
|
||||
.tools {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.tools li {
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
.event-list {
|
||||
|
@ -18,7 +16,8 @@ header.admin {
|
|||
|
||||
.event {
|
||||
display: grid;
|
||||
grid-template-columns: 90% 10%;
|
||||
grid-template-columns: auto 5em;
|
||||
|
||||
margin-bottom: 2em;
|
||||
padding-bottom: .5em;
|
||||
border-bottom: 1px dotted rgba(0,0,0,0.5);
|
||||
|
@ -26,6 +25,8 @@ header.admin {
|
|||
|
||||
.event-info {
|
||||
grid-column: 1;
|
||||
overflow-x: hidden; /*force text wrap*/
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.event-info h3 {
|
||||
|
@ -48,45 +49,16 @@ header.admin {
|
|||
|
||||
.event-actions {
|
||||
grid-column: 2;
|
||||
text-align: center;
|
||||
text-align: right;
|
||||
}
|
||||
.event-actions .btn {
|
||||
margin: 0.3em 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.event-actions a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.gridsplit {
|
||||
padding-top: 1.3em;
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 1fr;
|
||||
}
|
||||
|
||||
.gridsplit5050 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.gridl {
|
||||
height: 100%;
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.gridr {
|
||||
height: 100%;
|
||||
padding: 0 1em;
|
||||
margin-left: 1em;
|
||||
border-left: 1px dotted rgba(0,0,0,0.5);
|
||||
grid-column: 2;
|
||||
}
|
||||
|
||||
.gridsplit h1:first-child,
|
||||
.gridsplit h2:first-child,
|
||||
.gridsplit h3:first-child,
|
||||
.gridsplit h4:first-child,
|
||||
.gridsplit h5:first-child,
|
||||
.gridsplit h6:first-child {
|
||||
margin-top: 0;
|
||||
.fullwidth_inputs input,
|
||||
.fullwidth_inputs textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.allgrids {
|
||||
|
@ -101,27 +73,6 @@ header.admin {
|
|||
float: left;
|
||||
}
|
||||
|
||||
.btn {
|
||||
text-decoration: none;
|
||||
border: 1px solid #048;
|
||||
color: #048;
|
||||
padding: .2em 1em;
|
||||
border-radius: .2em;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
.btn:hover {
|
||||
border-color: #084;
|
||||
background: #eee;
|
||||
color: #084;
|
||||
}
|
||||
.btn:active {
|
||||
border-color: #084;
|
||||
background: #084;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.userlist {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.01 14.258" enable-background="new 0 0 17.01 14.258"><style type="text/css">.st0{fill:#004166;}</style><path class="st0" d="M14.009 8.551l.01-.019.005-.023.003-.014-.001-.006-.004-.022-.007-.021-.002-.006-4.629-8.382-.006-.006-.009-.013-.01-.01-.012-.009-.006-.005-.006-.002-.013-.005-.015-.004-.016-.002-.006-.002h-1.642l-.015.003-.021.004-.02.01-.017.012-.015.017-.009.011-4.233 7.425-.002.006-.007.021-.005.022-.001.006v2.86l.003.014.005.023.009.019.012.018.017.015.011.009.008.003.009.004.039.008h1.421l.038-.008.009-.004.031-.021.001-.001.019-.025 1.017-1.844h5.067l1.007 1.844.019.025.002.001.03.02.009.004.038.008h1.125l.04-.008.011-.005.023-.015.01-.009.015-.023.006-.011.002-.004.649-1.869.009-.014zm-.843 1.734h-.859l.582-1.678h.859l-.582 1.678zm-1.996-1.855l-.015-.018-.017-.012-.019-.01-.023-.005-.014-.003h-5.2l-.015.003-.023.005-.019.01-.018.012-.015.018-.01.011-1.017 1.844h-1.161l5.679-9.944 4.44 8.041h-.846l-3.426-6.236-.006-.007-.014-.017-.018-.015-.006-.006-.012-.003-.022-.007-.021-.002-.021.002-.021.007-.012.003-.007.006-.017.014-.014.018-.006.006-2.776 5.035-.002.005-.006.021-.005.023-.001.005.003.014.005.024.009.018.012.018.017.015.012.01.007.003.008.003.039.007h3.788l.039-.008.009-.004.007-.003.011-.009.018-.015.012-.017.01-.019.005-.023.003-.015-.001-.006-.004-.022-.007-.022-.002-.005-1.842-3.315-.037-.038.768-1.392 3.335 6.073-.572 1.649-.936-1.714-.01-.011zm-7.647-.863l4.186-7.342h1.383l-5.569 9.75v-2.408zm3.619-1.127h2.653l.378.682h-3.407l.376-.682zm.124-.225l1.198-2.173 1.206 2.173h-2.404zM1.197 14.258l-.13-.325h-.729l-.13.325h-.208l.588-1.464h.226l.591 1.464h-.208zm-.494-1.276l-.312.788h.621l-.309-.788zM2.123 14.258v-1.464h.959v.162h-.776v.472h.762v.162h-.762v.667h-.183zM4.22 14.258v-1.302h-.463v-.162h1.111v.162h-.465v1.302h-.183zM5.637 14.258v-1.464h.959v.162h-.777v.472h.762v.162h-.762v.505h.777v.162h-.959zM8.261 14.258l-.373-.582h-.292v.582h-.183v-1.464h.588c.268 0 .459.171.459.441 0 .263-.18.408-.38.426l.395.597h-.214zm.011-1.023c0-.165-.119-.279-.292-.279h-.384v.56h.384c.173 0 .292-.117.292-.281zM9.275 14.258v-1.464h.182v1.302h.681v.162h-.863zM10.613 13.527c0-.433.292-.757.727-.757.432 0 .727.325.727.757 0 .433-.294.758-.727.758-.435-.001-.727-.326-.727-.758zm1.264 0c0-.342-.211-.595-.538-.595-.329 0-.538.252-.538.595 0 .34.209.595.538.595.328 0 .538-.255.538-.595zM12.644 13.527c0-.454.336-.757.753-.757.259 0 .439.114.569.275l-.145.09c-.092-.119-.248-.202-.424-.202-.321 0-.564.246-.564.595 0 .347.244.597.564.597.176 0 .321-.086.393-.158v-.299h-.503v-.162h.685v.529c-.136.151-.336.252-.575.252-.417-.001-.753-.306-.753-.76zM14.84 14.258v-1.464h.182v1.464h-.182zM15.699 13.527c0-.45.332-.757.753-.757.259 0 .439.125.555.29l-.154.086c-.083-.123-.235-.213-.402-.213-.321 0-.564.246-.564.595 0 .347.244.595.564.595.167 0 .318-.088.402-.213l.156.086c-.123.167-.299.29-.558.29-.421-.002-.752-.309-.752-.759z"/></svg>
|
After Width: | Height: | Size: 2.9 KiB |
|
@ -1,9 +1,24 @@
|
|||
.pagination_bar {
|
||||
display: grid;
|
||||
grid-template-columns: 8em auto 8em;
|
||||
grid-template-areas: "left . right";
|
||||
text-align: center;
|
||||
}
|
||||
.pagination_bar >*:nth-child(1) {
|
||||
grid-area: left;
|
||||
}
|
||||
.pagination_bar >*:nth-child(2) {
|
||||
grid-area: right;
|
||||
}
|
||||
|
||||
figure.calendar {
|
||||
margin: 0;
|
||||
padding:0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.calendar ul {
|
||||
min-width: 43em;
|
||||
list-style-type: none;
|
||||
padding-left:0;
|
||||
|
||||
|
@ -35,7 +50,7 @@ figure.calendar {
|
|||
min-height: 4.8em;
|
||||
font-size: 0.8em;
|
||||
color: #444;
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.calendar ul li.header {
|
||||
|
@ -57,7 +72,7 @@ figure.calendar {
|
|||
|
||||
.calendar ul li.active {
|
||||
color: #222;
|
||||
border-color: #456;
|
||||
border-color: #679;
|
||||
box-shadow: 0 0 3px #89f;
|
||||
}
|
||||
|
||||
|
@ -65,8 +80,34 @@ figure.calendar {
|
|||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.calendar ul li section::before {
|
||||
content: "\26AB ";
|
||||
color: #038;
|
||||
.calendar ul li .day{
|
||||
display: inline-block;
|
||||
width: 1.75em;
|
||||
height: 1.75em;
|
||||
text-align: center;
|
||||
line-height: 1.75em;
|
||||
background: #9ab;
|
||||
color: white;
|
||||
border-radius: 0.875em;
|
||||
margin-bottom: 0.1em;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.calendar ul li.active .day{
|
||||
background: #248;
|
||||
}
|
||||
|
||||
.calendar ul li section {
|
||||
line-height: 1.5em;
|
||||
background: #038;
|
||||
color: white;
|
||||
border-radius: 0.75em;
|
||||
text-align: center;
|
||||
padding: 0 0.2em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.calendar ul li section + section {
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
h2 a {
|
||||
h2 a, h4 a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
h2 a:hover {
|
||||
h2 a:hover, h4 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
h2 em {
|
||||
|
@ -24,17 +24,28 @@ h2 strong em {
|
|||
}
|
||||
h2 img {
|
||||
float: right;
|
||||
max-width: 5em;
|
||||
border: .2em solid white;
|
||||
box-shadow: 0 2px 2px black;
|
||||
margin-left: 1em;
|
||||
}
|
||||
article:first-child h2 img {
|
||||
max-width: 10em;
|
||||
border: .1em solid white;
|
||||
border-radius: 0.1em;
|
||||
box-shadow: 0 2px 2px gray;
|
||||
margin-left: 1em;
|
||||
clear: right;
|
||||
margin-bottom: 0.8em;
|
||||
clear: left;
|
||||
}
|
||||
h4 {
|
||||
margin-top: 0;
|
||||
margin-bottom: -0.6em;
|
||||
}
|
||||
|
||||
.subtext {
|
||||
|
||||
h2 + .subtext {
|
||||
margin: -1.5em 0 1em 0;
|
||||
}
|
||||
p + .subtext {
|
||||
margin: -0.5em 0 1em 0;
|
||||
}
|
||||
.subtext {
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
clear: left;
|
||||
|
@ -51,14 +62,75 @@ article:first-child h2 img {
|
|||
font-weight: normal;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 50rem) {
|
||||
h2 img {
|
||||
display: none;
|
||||
}
|
||||
.subtext {
|
||||
margin-top: -1em;
|
||||
}
|
||||
.subtext li {
|
||||
display: block;
|
||||
.events:before {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
content: " ";
|
||||
background-image: -webkit-linear-gradient(left, transparent, rgba(0,0,0,.1), transparent);
|
||||
background-image: -moz-linear-gradient(left, transparent, rgba(0,0,0,.1), transparent);
|
||||
background-image: -o-linear-gradient(left, transparent, rgba(0,0,0,.1), transparent);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
.events {
|
||||
margin-top: -1.5em;
|
||||
margin-left: 0.3em;
|
||||
margin-bottom: 2em;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
.events >li {
|
||||
padding-left: 0.5em;
|
||||
border-left: 4px solid #35a;
|
||||
margin-top: 0.9em;
|
||||
}
|
||||
|
||||
.events li p {
|
||||
text-align: left;
|
||||
line-height: 1.5em;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.events .subtext {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.events li h4 +.subtext {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 50rem) {
|
||||
article:first-child h2 img {
|
||||
max-width: 12em;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 50rem) {
|
||||
h2 {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
border-bottom-left-radius: 0.3em;
|
||||
border-bottom-right-radius: 0.3em;
|
||||
max-height: 30vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
h2 em {
|
||||
display: block;
|
||||
top:0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
h2 img {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0.3em;
|
||||
float: none;
|
||||
margin: 0;
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
}
|
||||
article >.subtext {
|
||||
margin-top: -1em !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
body, main, html {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
main {
|
||||
background-color: #ddd;
|
||||
margin-top: 3em;
|
||||
margin-left: 0 !important; /* Override style.css */
|
||||
margin-right: 0 !important;
|
||||
padding: 4em;
|
||||
}
|
||||
.gallery-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));;
|
||||
width: 100%;
|
||||
grid-gap: 20px;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-radius: 1.5em;
|
||||
background-color: #f1f1f1;
|
||||
width: 100%;
|
||||
}
|
||||
.card-image-div {
|
||||
margin: auto 0;
|
||||
max-height: 45vh;
|
||||
overflow: hidden;
|
||||
border-radius: 1.5em;
|
||||
}
|
||||
.card-image {
|
||||
max-width: 100%;
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
vertical-align: center;
|
||||
}
|
||||
|
||||
.card-body, .card-footer {
|
||||
font-family: monospace;
|
||||
text-align: left;
|
||||
width: 90%;
|
||||
margin: 0;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.modal-target:hover {opacity: 0.7;}
|
||||
|
||||
/* Modal Background */
|
||||
.modal {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 1; /* Sit on top */
|
||||
padding-top: 5vh;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto; /* Enable scroll if needed */
|
||||
background-color: rgb(0,0,0); /* Fallback color */
|
||||
background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
margin: auto;
|
||||
display: block;
|
||||
object-fit: scale-down;
|
||||
overflow: visible;
|
||||
|
||||
min-width: 60vw;
|
||||
max-width: 90vw !important;
|
||||
min-height: 60vh;
|
||||
max-height: 80vh !important;
|
||||
|
||||
width: auto;
|
||||
height: auto;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.modal-caption {
|
||||
margin: auto;
|
||||
display: block;
|
||||
width: 80%;
|
||||
max-width: 90vw;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-weight: 700;
|
||||
font-size: 1em;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.modal-content, .modal-caption {
|
||||
-webkit-animation-name: zoom;
|
||||
-webkit-animation-duration: 0.6s;
|
||||
animation-name: zoom;
|
||||
animation-duration: 0.6s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes zoom {
|
||||
from {-webkit-atransform:scale(0)}
|
||||
to {-webkit-transform:scale(1)}
|
||||
}
|
||||
|
||||
@keyframes zoom {
|
||||
from {transform:scale(0)}
|
||||
to {transform:scale(1)}
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 35px;
|
||||
color: #f1f1f1;
|
||||
font-size: 4em;
|
||||
font-weight: bold;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.modal-close:hover, .modal-close:focus {
|
||||
color: #bbb;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media only screen and (min-width:320px) {
|
||||
.gallery-container { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
|
||||
main { padding: 1em; }
|
||||
}
|
||||
@media only screen and (min-width: 641px) {
|
||||
.gallery-container { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
|
||||
main { padding: 1em; }
|
||||
}
|
||||
@media only screen and (min-width: 961px) {
|
||||
.gallery-container { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
|
||||
}
|
||||
@media only screen and (min-width: 1281px) {
|
||||
.gallery-container { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
|
||||
}
|
BIN
www/css/ja.png
Before Width: | Height: | Size: 1.3 MiB |
|
@ -0,0 +1,131 @@
|
|||
header.landing {
|
||||
display: block;
|
||||
margin: 0;
|
||||
margin-top: 3em;
|
||||
padding: 3vh 15vw;
|
||||
width: 70vw;
|
||||
background-color: #002244;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
header.landing .logo {
|
||||
display: block;
|
||||
width: 24vh;
|
||||
height: 24vh;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.essentials {
|
||||
width: 100%;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.essentials li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.essentials a {
|
||||
margin: 0 2em;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.essentials .focus {
|
||||
padding: 0.8em;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
img.float-right {
|
||||
float: right;
|
||||
max-width: 12em;
|
||||
max-height: 12em;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.calendar-events {
|
||||
padding: 0;
|
||||
margin-bottom: 1.5em;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.calendar-events ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.calendar-events a {
|
||||
color: rgba(0,0,0, 0.85);
|
||||
}
|
||||
|
||||
.calendar-events ul .datetime {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
float: right;
|
||||
margin-left: 0.2em;
|
||||
}
|
||||
|
||||
.calendar-events ul li {
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
|
||||
main.contentsplit {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
.contentsplit {
|
||||
display: grid;
|
||||
grid-template-columns: 2.5fr 2fr;
|
||||
}
|
||||
|
||||
.gridr {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 50rem) {
|
||||
.essentials {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.essentials a {
|
||||
margin: 0.2em 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 65rem) {
|
||||
.contentsplit {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.gridr {
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin-left: 0;
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
|
||||
.gridr br {
|
||||
margin: 0;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.gridl {
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 52 KiB |
|
@ -0,0 +1,73 @@
|
|||
ul#webmail {
|
||||
margin-top: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
table-layout: fixed;
|
||||
display: table;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
ul#webmail li {
|
||||
display: table-cell;
|
||||
text-align: center;
|
||||
}
|
||||
ul#webmail li .mailname {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 980px) {
|
||||
ul#webmail {
|
||||
max-width: 1280px;
|
||||
}
|
||||
ul#webmail li {
|
||||
display: table-cell;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 980px) {
|
||||
ul#webmail {
|
||||
max-width: 650px;
|
||||
}
|
||||
ul#webmail li {
|
||||
display: table-row;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
ul#webmail li div {
|
||||
position: relative;
|
||||
background: white;
|
||||
margin: 1em 1em;
|
||||
box-shadow: rgba(0,0,0,.3) 0 .1em .17em;
|
||||
border-radius: .5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
ul#webmail li:hover div {
|
||||
box-shadow: rgba(0,0,0,.5) 0 .15em .2em;
|
||||
}
|
||||
ul#webmail li div a {
|
||||
padding-top: 10em;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
ul#webmail li#afterlogic div {
|
||||
background: white url('afterlogic.png') no-repeat;
|
||||
background: white url('afterlogic.svg') no-repeat;
|
||||
background-size: auto 8em;
|
||||
background-position: 50% 60%;
|
||||
}
|
||||
ul#webmail li#squirrelmail div {
|
||||
background: white url('squirrelmail.png') no-repeat;
|
||||
background-size: auto 10em;
|
||||
background-position: 50% 0;
|
||||
}
|
||||
ul#webmail li#roundcube div {
|
||||
background: white url('roundcube.png') no-repeat;
|
||||
background-size: auto 10em;
|
||||
background-position: 50% 0;
|
||||
}
|
||||
ul#webmail li#rainloop div {
|
||||
background: white url('rainloop.png') no-repeat;
|
||||
background-size: auto 10em;
|
||||
background-position: 50% 0;
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
a.nostyle {
|
||||
text-decoration: none;
|
||||
color:inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.project-card {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border-radius: .15em;
|
||||
border: 0 solid #048;
|
||||
border-left-width: .3em;
|
||||
box-shadow: 0 .1em .3em -.1em rgba(0,0,0,0.5);
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
min-height: 6em;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.project-card:hover {
|
||||
box-shadow: 0.1em 0.2em 0.5em 0em rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.project-title {
|
||||
padding-bottom: .1em;
|
||||
margin: 0;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
display: block;
|
||||
margin: .6em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-content p {
|
||||
line-height: 1.25em;
|
||||
}
|
||||
|
||||
.card-content * {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.project-organizer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
font-size: .8em;
|
||||
text-align: right;
|
||||
font-style: italic;
|
||||
opacity: 0.5;
|
||||
padding: 0.1em 0.4em;
|
||||
}
|
||||
|
||||
.projects-container {
|
||||
margin-top: 2em;
|
||||
margin-bottom: 3em;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-column-gap: 0.5em;
|
||||
grid-row-gap: 1.3em;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 60em) {
|
||||
.projects-container {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 50rem) {
|
||||
.contentsplit {
|
||||
display: grid;
|
||||
grid-template-columns: 17em 2.7fr;
|
||||
grid-template-areas: "left right";
|
||||
grid-column-gap: 0.9em;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 50rem) {
|
||||
.contentsplit {
|
||||
display: grid;
|
||||
grid-template-rows: auto auto;
|
||||
grid-template-areas: "right"
|
||||
"left";
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 33rem) and (max-width: 50rem) {
|
||||
.projectmember-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: auto auto;
|
||||
grid-template-areas: "organizers members"
|
||||
"join join";
|
||||
}
|
||||
}
|
||||
|
||||
.gridl {
|
||||
grid-area: left;
|
||||
}
|
||||
|
||||
.projectmember-container {
|
||||
padding: 0.1em 1em;
|
||||
box-shadow: 0 2px 10px 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
.projectmember-container h2 {
|
||||
text-align: center;
|
||||
}
|
||||
.projectmember-container >form {
|
||||
text-align: center;
|
||||
grid-area: join;
|
||||
}
|
||||
|
||||
.gridr {
|
||||
border-left: 0;
|
||||
grid-area: right;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.projectmember {
|
||||
margin-bottom: 1em;
|
||||
padding: 0 .5em 0 .5em;
|
||||
overflow: hidden;
|
||||
border-left: 4px solid #35a;
|
||||
}
|
||||
|
||||
.projectmember p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.projectmember p {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.projectmember p:first-child {
|
||||
font-size: 1em;
|
||||
margin-bottom: .2em;
|
||||
}
|
||||
|
||||
.memberuname, .memberemail {
|
||||
display: inline-block;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.memberuname {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.memberemail {
|
||||
float: right;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 50rem) {
|
||||
.projects {
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* edit */
|
||||
form .wide {
|
||||
min-width: 66%;
|
||||
}
|
||||
form .tall {
|
||||
min-height: calc(100vh - 28em);
|
||||
}
|
||||
@media screen and (max-width: 50rem) {
|
||||
form .wide {
|
||||
width: calc(100% - 2em);
|
||||
margin: 0 1em;
|
||||
}
|
||||
}
|