diff options
| author | Horus3 | 2014-02-09 17:21:59 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-09 17:21:59 +0100 |
| commit | 65dc06eab2305800ad862b4621807fd7d4f7fe8d (patch) | |
| tree | c8efcc90589d30ecbe838fc7822c8d031cbececa | |
| download | jungegemeinde-65dc06eab2305800ad862b4621807fd7d4f7fe8d.tar.gz | |
Init
| -rw-r--r-- | account.php | 54 | ||||
| -rw-r--r-- | auth.php | 8 | ||||
| -rw-r--r-- | check.php | 108 | ||||
| -rw-r--r-- | config/401.css | 6 | ||||
| -rw-r--r-- | config/404.css | 3 | ||||
| -rwxr-xr-x | config/dead_link.png | bin | 0 -> 51119 bytes | |||
| -rw-r--r-- | config/error-handler-404.html | 13 | ||||
| -rwxr-xr-x | config/favicon.ico | bin | 0 -> 5242 bytes | |||
| -rw-r--r-- | config/fonts/2Q-AW1e_taO6pHwMXcXW5w.ttf | bin | 0 -> 72404 bytes | |||
| -rw-r--r-- | config/fonts/BfQP1MR3mJNaumtWa4Tizg.ttf | bin | 0 -> 56260 bytes | |||
| -rw-r--r-- | config/fonts/Muli.css | 6 | ||||
| -rw-r--r-- | config/fonts/Ubuntu.css | 6 | ||||
| -rw-r--r-- | config/fonts/muli.tff | bin | 0 -> 56260 bytes | |||
| -rw-r--r-- | config/fonts/ubuntu.ttf | bin | 0 -> 72404 bytes | |||
| -rw-r--r-- | config/index.html | 23 | ||||
| -rw-r--r-- | config/status-401.html | 22 | ||||
| -rw-r--r-- | config/test_401.css | 29 | ||||
| -rwxr-xr-x | favicon.ico | bin | 0 -> 5242 bytes | |||
| -rw-r--r-- | files.php | 3 | ||||
| -rw-r--r-- | header.php | 55 | ||||
| -rw-r--r-- | help.php | 7 | ||||
| -rw-r--r-- | hyperstyle.css | 214 | ||||
| -rw-r--r-- | index.php | 47 | ||||
| -rw-r--r-- | inreg.php | 40 | ||||
| -rw-r--r-- | insert.php | 64 | ||||
| -rw-r--r-- | liste.php | 141 | ||||
| -rw-r--r-- | login.php | 65 | ||||
| -rw-r--r-- | logout.php | 5 | ||||
| -rw-r--r-- | lolrndm.php | 39 | ||||
| -rw-r--r-- | member_login.php | 104 | ||||
| -rw-r--r-- | piwik.php | 17 | ||||
| -rw-r--r-- | quote.php | 74 | ||||
| -rw-r--r-- | redirect.php | 5 | ||||
| -rw-r--r-- | register.php | 49 | ||||
| -rw-r--r-- | reset.php | 117 | ||||
| -rwxr-xr-x | robots.txt | 2 | ||||
| -rw-r--r-- | share.php | 21 | ||||
| -rw-r--r-- | to-do-list.php | 51 | ||||
| -rw-r--r-- | update.php | 48 |
39 files changed, 1446 insertions, 0 deletions
diff --git a/account.php b/account.php new file mode 100644 index 0000000..0717182 --- /dev/null +++ b/account.php @@ -0,0 +1,54 @@ +<?php include('auth.php'); +include("header.php"); + +if ($_SESSION["username"] != "jg-adlershof"){ + + $username = $_SESSION["username"]; + $db_check = new SQLite3("/var/www/jungegemeinde/database/share.db"); + + $safe_username = SQLite3::escapeString("$username"); + $email_db = $db_check->query("SELECT email FROM user where name='$safe_username';"); + while($email_array = $email_db->fetchArray(SQLITE3_NUM)){ + foreach($email_array as $thirdelement){ + $email=$thirdelement; + } + } + + /*Anzahl der hochgeladenen Dateien.*/ + $count_db = $db_check->query("SELECT count(*) as count FROM file where fk=(SELECT id from user where name='$safe_username');"); + $count_array = $count_db->fetchArray(); + $count = $count_array["count"]; + + +//echo "$username Test $email"; +echo " +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> + +<br> +<div class='mittlereschrift'> + Verwalte deine Account Informationen hier. +</div> +<br> + + +<table><tr> +<td><p>Name: </td><td align='right'>$username</p></td></tr> +<tr><td><p>E-Mail:</td><td align='right'>$email</p></td></tr> +<tr><td align='left'><p>Stored files:</td> <td align='right'>$count</p></td></tr> +</table> + + +"; + + +} else { +header("Location: member_login.php"); +exit; +} + +?> diff --git a/auth.php b/auth.php new file mode 100644 index 0000000..a63e5ea --- /dev/null +++ b/auth.php @@ -0,0 +1,8 @@ +<?php + session_start(); + + if (!isset($_SESSION['login']) || !$_SESSION['login']) { + header('Location: login.php'); + exit; + } +?> diff --git a/check.php b/check.php new file mode 100644 index 0000000..b3911de --- /dev/null +++ b/check.php @@ -0,0 +1,108 @@ +<?php +/* Copyright Maximilian Möhring, 2013 +Licensed under the GPL. Read LICENSE.txt for more Information.*/ + +session_start(); + +/*___Datenbankabfrage: Login___*/ + $unsafe_username = $_POST["username"]; + $unsafe_passwort = $_POST["password"]; + $username = SQLite3::escapeString("$unsafe_username"); + $passwort = SQLite3::escapeString("$unsafe_passwort"); + + $db_check = new SQLite3("/var/www/jungegemeinde/database/share.db"); + $salt_db = $db_check->query("SELECT salt FROM user WHERE name='$username';"); + while($salt_array = $salt_db->fetchArray(SQLITE3_NUM)){ + foreach($salt_array as $firstelement){ + $salt=$firstelement; + } + } + + $password = "$salt"."$passwort"; + $hash_password = md5($password); + for($i=0;$i<15000;$i++) + $hash_password = md5($hash_password); + + $real_password_db = $db_check->query("SELECT password FROM user WHERE name='$username';"); + while($real_password_array = $real_password_db->fetchArray(SQLITE3_NUM)){ + foreach($real_password_array as $secondelement){ + $real_password=$secondelement; + } + } + +/*___Einloggen___*/ +if ($real_password == $hash_password) { + + $_SESSION["login"] = true; + $_SESSION["username"] = "$username"; + +/*___Datenbankabfrage: Spruch___*/ + $zufall = mt_rand(1,52); + + $db = new SQLite3("/var/www/jungegemeinde/database/jg.db"); + + + $zufall = SQLite3::escapeString("$zufall"); + $ergebnis = $db->query("SELECT * FROM sprueche where id=$zufall;"); + + while($row=$ergebnis->fetchArray()){ + $spruch = $row["spruch"]; + } + + +echo" +<!doctype html public '-//W3C//DTD XHTML 1.0 //EN'> + + +<html> +<head> + <title>Login: Random Quote.</title> +<script type='text/javascript'> + function animiere() { + var ladebalken = document.getElementById('ladebalken'); + var laenge = parseInt(ladebalken.style.width); + + laenge++; + ladebalken.style.width = laenge + 'px'; + + if (laenge < 450) { + window.setTimeout(animiere, 8); + } + if (laenge == 450) { + document.location='/'; + } + } + </script> + <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> + <link rel='stylesheet' type='text/css' href='hyperstyle.css' /> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> +</head> + +<body onload='animiere()' link='#000000' vlink='#000000' alink='#FF0000' > + +<div id='distance' ></div> +<div id='container' align='center' class='mittlereschrift'> +<b>Zitat Nummer #$zufall</b><br><br><div id='bgcolor'> +$spruch +</div> + +<br><br> +<div class='katze'<p> Fortschritt: </p></div> + <div id='balken' align='left'> + <span id='ladebalken' style='display: block; background: #ecece1; width: 0px;'> + </span> + </div> + +<br><br> +<div class='unterstrich'><a href='/'>Überspringen</a></div> + +</div> + +</body> +</html> +"; +header("Refresh: 7; /"); +} else { +header("Location: login.php?failure=1"); +} +?> diff --git a/config/401.css b/config/401.css new file mode 100644 index 0000000..b017224 --- /dev/null +++ b/config/401.css @@ -0,0 +1,6 @@ +h1 { +font-family: Calibri; +font-size: 200%; +color: black; +text-align: center; +} diff --git a/config/404.css b/config/404.css new file mode 100644 index 0000000..08276dd --- /dev/null +++ b/config/404.css @@ -0,0 +1,3 @@ +body { +background: white url("dead_link.png") no-repeat fixed top; +} diff --git a/config/dead_link.png b/config/dead_link.png Binary files differnew file mode 100755 index 0000000..37eb36b --- /dev/null +++ b/config/dead_link.png diff --git a/config/error-handler-404.html b/config/error-handler-404.html new file mode 100644 index 0000000..6264849 --- /dev/null +++ b/config/error-handler-404.html @@ -0,0 +1,13 @@ +<!doctype html public "-//W3C//DTD XHTML 1.0 //EN"> + +<html> +<head> +<title>404 - Dead Link.</title> +<link rel="stylesheet" type="text/css" href="/config/404.css" /> +<meta http-equiv="refresh" content="0; /404"> +</head> + +<body> + +</body> + diff --git a/config/favicon.ico b/config/favicon.ico Binary files differnew file mode 100755 index 0000000..eff0501 --- /dev/null +++ b/config/favicon.ico diff --git a/config/fonts/2Q-AW1e_taO6pHwMXcXW5w.ttf b/config/fonts/2Q-AW1e_taO6pHwMXcXW5w.ttf Binary files differnew file mode 100644 index 0000000..0e35cfb --- /dev/null +++ b/config/fonts/2Q-AW1e_taO6pHwMXcXW5w.ttf diff --git a/config/fonts/BfQP1MR3mJNaumtWa4Tizg.ttf b/config/fonts/BfQP1MR3mJNaumtWa4Tizg.ttf Binary files differnew file mode 100644 index 0000000..cf324e4 --- /dev/null +++ b/config/fonts/BfQP1MR3mJNaumtWa4Tizg.ttf diff --git a/config/fonts/Muli.css b/config/fonts/Muli.css new file mode 100644 index 0000000..4fa7a93 --- /dev/null +++ b/config/fonts/Muli.css @@ -0,0 +1,6 @@ +@font-face { + font-family: 'Muli'; + font-style: normal; + font-weight: 400; + src: local('Muli'), "/config/fonts/muli.ttf" format('truetype'); +} diff --git a/config/fonts/Ubuntu.css b/config/fonts/Ubuntu.css new file mode 100644 index 0000000..6ab025f --- /dev/null +++ b/config/fonts/Ubuntu.css @@ -0,0 +1,6 @@ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu'), "/config/fonts/ubuntu.ttf" format('truetype'); +} diff --git a/config/fonts/muli.tff b/config/fonts/muli.tff Binary files differnew file mode 100644 index 0000000..cf324e4 --- /dev/null +++ b/config/fonts/muli.tff diff --git a/config/fonts/ubuntu.ttf b/config/fonts/ubuntu.ttf Binary files differnew file mode 100644 index 0000000..0e35cfb --- /dev/null +++ b/config/fonts/ubuntu.ttf diff --git a/config/index.html b/config/index.html new file mode 100644 index 0000000..267f175 --- /dev/null +++ b/config/index.html @@ -0,0 +1,23 @@ +<!doctype html public "-//W3C//DTD XHTML 1.0 //EN"> + +<html> +<head> +<title>401 - Acces forbidden.</title> +<link rel="stylesheet" type="text/css" href="/config/401.css" /> +<link rel="shortcut icon" href="/404/favicon.ico" type="image/x-icon"> +</head> + +<body> + +<div align="center"> + <table width="750"> +<tr> + <td align="center"><img src="http://i.imgur.com/CY7ntqP.png" alt="Goddess" vspace="1"></td> +</tr> +<tr> + <td><h1>Access forbidden. Now get the fuck out.</h1></td> +</tr> +</table> +</div> +</body> +</html> diff --git a/config/status-401.html b/config/status-401.html new file mode 100644 index 0000000..e980ac9 --- /dev/null +++ b/config/status-401.html @@ -0,0 +1,22 @@ +<!doctype html public "-//W3C//DTD XHTML 1.0 //EN"> + +<html> +<head> +<title>401 - Acces forbidden.</title> +<link rel="stylesheet" type="text/css" href="/config/401.css" /> +<meta http-equiv="refresh" content="0; /401"> +</head> + +<body> + +<div align="center"> + <table width="750"> +<tr> + <td align="center"><img src="http://i.imgur.com/CY7ntqP.png" alt="Goddess" vspace="1"></td> +</tr +<tr> + <td align="center" valign="top"><h1>Access forbidden. Now get the fuck out.</h1></td> +</tr> + +</body> + diff --git a/config/test_401.css b/config/test_401.css new file mode 100644 index 0000000..80ad4d0 --- /dev/null +++ b/config/test_401.css @@ -0,0 +1,29 @@ +body { +/*background: white url("haruhi.png") no-repeat fixed top;*/ +} + +<style type="text/css"> + div.container {top: 0; left: 0; width: 100%; height: 100%; + position: fixed; display: table} + p {display: table-cell; vertical-align: middle} + + /* Horizontal centering of image: set left & right margins to 'auto' */ + img.displayed {display: block; margin: 1em auto} + + /* Also center the lines in the paragraph */ + p {top: 590px; text-align: center font-size: 300%; font-family: Courier; color: black;} +</style> + +/*<div class=container> + <p>Access forbidden. Now get the fuck out. + <img class=displayed src="./haruhi.png"></p> +</div>*/ + +h1 { +/*position: relative;*/ +top: 590px; +font-family: Courier; +font-size: 300%; +color: black; +text-align: center; +} diff --git a/favicon.ico b/favicon.ico Binary files differnew file mode 100755 index 0000000..41f6475 --- /dev/null +++ b/favicon.ico diff --git a/files.php b/files.php new file mode 100644 index 0000000..ab6cebf --- /dev/null +++ b/files.php @@ -0,0 +1,3 @@ +<?php +#include("auth.php"); +include("header.php"); diff --git a/header.php b/header.php new file mode 100644 index 0000000..c82f36c --- /dev/null +++ b/header.php @@ -0,0 +1,55 @@ +<?php include('auth.php'); + +if ($_SESSION["username"] == "jg-adlershof"){ + $account ="<td><a href='member_login.php'>Login</a></td> + <td>|</td> + <td><a href='register.php'>Register</a></td> + <td>|</td> +" ; +} else { + $account ="<td><a href='account.php'>Account</a></td> + <td>|</td> +"; +} + +?> +<!doctype html public '-//W3C//DTD XHTML 1.0 //EN'> + +<html> +<head> + <title>Junge Gemeinde Adlershof.</title> + <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> + <link rel='stylesheet' type='text/css' href='hyperstyle.css' /> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> +</head> + +<body link='#000000' vlink='#000000' alink='#FF0000'> + +<?php include("piwik.php");?> + +<div class='kleineschrif'> + +<div id='header' class='kleineschrift'> + <table width='700px'><tr> + <td><a href='/'>Home</a></td> + <td>|</td> + <td><a href='liste.php'>Adressliste</a></td> + <td>|</td> + <td><a href='help.php'>Kalender</a></td> + <td>|</td> + <td><a href='help.php'>Share</a></td> + <td>|</td> + <td><a href='quote.php'>Zitat</a></td> + <td>|</td> + <td><a href='to-do-list.html'>to-do</a></td> + <td>|</td> + <td><a href='help.php'>Hilfe</a></td> + <td>|</td> +<?php echo " $account"; ?> + <td><a href='logout.php'>Logout</a></td> + <tr></table> + + <br> + <hr> +</div> + diff --git a/help.php b/help.php new file mode 100644 index 0000000..3fba16b --- /dev/null +++ b/help.php @@ -0,0 +1,7 @@ +<?php include('auth.php'); +include("header.php"); + +echo "<br><br><h1>Noch nicht implementiert.</h1>"; + +header("Refresh: 3; index.php"); +?> diff --git a/hyperstyle.css b/hyperstyle.css new file mode 100644 index 0000000..74176fc --- /dev/null +++ b/hyperstyle.css @@ -0,0 +1,214 @@ +/* +This is a random mess. I'm studying Computer Science, not Art & Design. +*/ + +@import "/config/fonts/Muli.css"; +@import "/config/fonts/Ubuntu.css"; + + +* { +margin:0; +padding:0; +} + +.noscript{ +display: none; +} + +.katze { +font-family: 'Muli'; +font-size: 120%; +color: black; +} + +.hundertfuenfzig { +font-family: 'Muli'; +font-size: 150%; +color: black; +} + +.ueberschrift { +font-family: 'Muli'; +font-size: 350%; +color: black; +text-align: center; +} + +.kleineschrift { +font-family: 'Ubuntu'; +font-size:75%; +color: black; +} + +.mittlereschrift { +font-family: 'Ubuntu'; +font-size: 100%; +color: black; +} + + +/* +#footer { + position:fixed; + bottom:0px; +} +*/ +#content_container{ +/* padding-top:3.00em;*/ + padding-bottom:3em; + padding-left:0; +} +/* +#content_container { + height:95%; + overflow:auto; + } +*/ +#header { + position:; + top:0px; left:0px; right:0px; + background:; + text-align:center; + padding:10px; +/* color: #f0ecde;*/ + width: 700px; + height: 20px; + margin: 0px auto; +} + +html, body { +height: 100%; +width: 100%; +background: #ecece1; +} + +#distance { +width: 10px; +height: 45%; +margin-bottom: -250px; +float: left; +/*background-color: #f00; nur zu Demozwecken*/ +} + +#container { +margin: 0 auto; +position: relative; +height: 500px; +width: 700px; +clear: left; +/*background-color: #ADFF2F;*/ +} + +#behaelter { +margin: 0 auto; +position: relative; +/*height: 500px; +width: 700px;*/ +clear: left; +/*background-color: #ADFF2F;*/ +} + +#balken { +position: relative; +height: 10 px; +width: 450px; +background-color: grey; +} + +#bgcolor { +background-color: #f0ecde; +} + +/*body { +}*/ + +a:link, a:visited { + /*font-family:Arial,Helvetica,sans-serif; + font-size: 12px;*/ + text-decoration: none; +/* color: #009F00;*/ + } + +h1 { +font-family: 'Muli:400'; +/*font-family: Calibri;*/ +font-size: 260%; +color: black; +text-align: center; +} + +h2 { +font-family: 'Muli:400'; +/*font-family: Calibri;*/ +font-size: 130%; +color: black; +text-align: center; +} + + +p2 { +font-family: 'Ubuntu'; +/*font-family: Calibri;*/ +font-size: 100%; +color: grey; +text-align: center; +} + +p3 { +font-family: 'Ubuntu'; +/*font-family: Calibri;*/ +/*font-size: 250%;*/ +color: black; +text-align: center; +} + +p4 { +font-family: 'Ubuntu'; +/*font-family: Calibri;*/ +font-size: 350%; +color: black; +text-align: center; +} + +p5 { +font-family: 'Muli'; +/*font-family: Calibri;*/ +font-size: 270%; +color: black; +text-align: center; +} + + +a2 { +font-family: 'Ubuntu'; +/*font-family: 'Nobile';*/ +/*font-family: Calibri;*/ +font-size: 125%; +color: black; +text-align: grey; +} + +a3 { +font-family: 'Ubuntu'; +/*font-family: Calibri;*/ +font-size: 130%; +color: black; +text-align: grey; +} + +a4 { +font-family: 'Ubuntu'; +/*font-family: Calibri;*/ +font-size: 100%; +color: black; +} + +a5 { +font-family: 'Ubuntu'; +font-size:75%; +/*font-family: Calibri;*/ +color: black; +} + + +.unterstrich {text-decoration: underline;} diff --git a/index.php b/index.php new file mode 100644 index 0000000..25aabb6 --- /dev/null +++ b/index.php @@ -0,0 +1,47 @@ +<?php include('auth.php'); +include("header.php"); +?> + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> +<?php +if($_SESSION["username"] == "jg-adlershof"){ +$name = "Gast"; +} else { +$name = $_SESSION["username"]; +} + echo " +<br> +<div class='kleineschrift'> +<div style='width:800px;' class='katze' id='behaelter' align='center'> + Hallo $name.<br> Willkommen auf der Webpage für die Junge Gemeinde in Adlershof. Für einen persönlichen Zugang, und um alle Features zu nutzen, registriere dich doch <a +style='text-decoration:underline;color:blue;' href='register.php'>hier</a>. Wenn du Probleme bei der Navigation hast, dann schau unter <a style='text-decoration: underline;color:blue;' +href='help.php'>Hilfe</a> nach. <br> + Für Anregungen und Kritik bin ich immer zu haben. Schick mir einfach ne Mail oder sags mir nächsten Donnerstag. ;) + <br><bR> + PS: Du kannst dich nach einer Registrierung auch mit deinem Username einloggen. +</div> +</div> +"; +?> + +<br><br> +<div class='katze' align='center'><pre> + ,/| _.--''^``-...___.._.,; + /, \'. _-' ,--,,,--''' + { \ `_-'' ' /} + `;;' ; ; ; + ._.--'' ._,,, _..' .;.' + (,_....----''' (,..--'' +</pre></div> + + +</div> +</div> +</body> +</html> + diff --git a/inreg.php b/inreg.php new file mode 100644 index 0000000..54bbf28 --- /dev/null +++ b/inreg.php @@ -0,0 +1,40 @@ +<?php include('auth.php'); +/*Registrierung in der Datenbank!*/ + +$name = $_POST["name"]; +$cleartext_password = $_POST["pswd"]; +$email = $_POST["email"]; + +$db = new SQLite3("/var/www/jungegemeinde/database/share.db"); + + $safe_name = SQLite3::escapeString("$name"); + $safe_email = SQLite3::escapeString("$email"); + + $email_db = $db->query("SELECT id FROM user where email='$safe_email';"); + $name_db = $db->query("SELECT id FROM user where name='$safe_name';"); + $name_arr = $name_db->fetchArray(SQLITE3_NUM); + $email_arr = $email_db->fetchArray(SQLITE3_NUM); + $name_int = $name_arr[0]; + $email_int = $email_arr[0]; + + + +if ($_POST["pswd"] == "" || ($email_int > 0 && !$email == "")|| $name_int > 0){ +//echo "1$cleartext_password 2$email_int 3$name_int"; + +header("Location: register.php?false=1"); +} else { + + $salt = uniqid(mt_rand(), true); + $password = "$salt"."$cleartext_password"; + $hash_password = md5($password); + for($i=0;$i<15000;$i++) + $hash_password = md5($hash_password); + + + $result = $db->exec("INSERT INTO user (id, name, salt, password, email) VALUES (NULL, '$safe_name', '$salt', '$hash_password', '$safe_email');"); + + $_SESSION["username"] = $name; + header("Location: account.php?reg=1"); +} +?> diff --git a/insert.php b/insert.php new file mode 100644 index 0000000..cca6118 --- /dev/null +++ b/insert.php @@ -0,0 +1,64 @@ +<?php include('auth.php'); +include("header.php"); + +if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $db = new SQLite3('/var/www/jungegemeinde/database/jg.db'); + + $safe1 = SQLite3::escapeString("$_POST[name]"); + $safe2 = SQLite3::escapeString("$_POST[adresse]"); + $safe3 = SQLite3::escapeString("$_POST[telefonnummer]"); + $safe4 = SQLite3::escapeString("$_POST[handynummer]"); + $safe5 = SQLite3::escapeString("$_POST[email]"); + $safe6 = SQLite3::escapeString("$_POST[geburtstag]"); + $query = "INSERT INTO member(id, name, adresse, telefonnummer, handynummer, email, geburtstag) VALUES(NULL,'$safe1','$safe2','$safe3','$safe4','$safe5','$safe6');"; + $result = $db->exec("$query"); +} + +echo " + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> +"; + if ($_SERVER['REQUEST_METHOD'] == 'POST') { +echo " +<center> +<br> +Vielen Dank, der Eintrag zu $_POST[name] wurde erfolgreich hinzugefügt.<br> +<br> + +<tr> + <td align='center'><img src='http://i.imgur.com/UQDEVQy.png' alt='Teh wizzard'></td> +</tr> +<br> +<br> +Einen Moment, sie werden gleich weitergeleitet. + +"; +header("Refresh: 4; /liste.php"); + + } else { + echo " + <br><a2>Trage einfach die Daten von unserem neuen Mitglied ein: </a2><br> + <form method='post' action='insert.php' ><table><tr> + <td align='right'><a2>Name: <input type='text' name='name' ></a2> </td> + <td align='right'><a2>Adresse: <input type='text' name='adresse' > </a2></td> + <td align='right'><a2>Telefon: <input type='text' name='telefonnummer'></a2> </td></tr> + <tr align='right'><td><a2>Handy: <input type='text' name='handynummer' ></a2> </td> + <td align='right'><a2>E-Mail: <input type='text' name='email' ></a2> </td> + <td align='right'><a2>Geburtstag: <input type='text' name='geburtstag' ></a2> </td></tr> + <tr><td> </td><td align='center'><input type='submit' name='submit' value='Hinzufügen'/></td><td> </td></tr> + </table></form> + "; + +} +/* +</body>"; +*/ + +//echo '<br><a href="login.php?x=$cryptedip">Zurück</a></center>'; + +?> diff --git a/liste.php b/liste.php new file mode 100644 index 0000000..c6fd146 --- /dev/null +++ b/liste.php @@ -0,0 +1,141 @@ +<?php include('auth.php'); +include("header.php"); + +$db = new SQLite3("/var/www/jungegemeinde/database/jg.db"); + +?> + +<script> +// Elemente einblenden +function show_elements() + { + var elementNames = show_elements.arguments; + for (var i=0; i<elementNames.length; i++) + { + var elementName = elementNames[i]; + document.getElementById(elementName).style.display='block'; + } + } +// Elemente ausblenden +function hide_elements() + { + var elementNames = hide_elements.arguments; + for (var i=0; i<elementNames.length; i++) + { + var elementName = elementNames[i]; + document.getElementById(elementName).style.display='none'; + } + } +</script> + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> + +<?php if($_GET["id"] == 0 || $_GET["id"] == "" || !isset($_GET["id"])){ + +echo" +<br><br> + <table height='350' border='1' rules='all' cellpadding='20' cellbording='20' cellspacing='20'> + <!-- Wenn mir mal einer erklären könnte, warum die Zellen trotzdem keinen Abstand haben? --> + <thead> + <tr> + <th><a3> </a3></th> + <th><a3>Name</a3></th> + <th><a3>Adresse</a3></th> + <th><a3>Telefon</a3></th> + <th><a3>Handynummer</a3></th> + <th><a3>E-Mail</a3></th> + <th><a3>Geburtstag</a3></th> + <tr> + </thead> + <tbody cellpadding='20' cellbording='20' cellspacing='20'> + +"; + $ergebnis = $db->query("SELECT * FROM member"); + while($row=$ergebnis->fetchArray(SQLITE3_NUM)){ + $id=$row[0]; + echo "<tr>"; + foreach($row as $element){ + echo "<td align='left'><a href=\"?id=$id\" onclick=\"document.location.href='liste.php?id=$id'\">$element</a></td>"; + } + + echo " + </tr>"; + } + +echo " + </tbody> + </table> + +<br><br> +<div style='width:1000px;' class='mittlereschrift'> +Da es in letzter Zeit doch öfters vorgekommen ist, dass jemand seine Adresse geändert hat, ist es jetzt möglich, einen Eintrag in der Adressliste zu ändern oder zu ergänzen. +Wenn du deine Adresse <b>ändern</b> möchtest, dann drücke einfach auf deinen Namen in der richtigen Zeile. <a href='insert.php'>Möchtest du jemanden <b>hinzufügen</b>, dann drücke bitte <u>hier</u>.</a> +</div> + +<br><br> +"; +} else { + + + $id = $_GET["id"]; + $safe_id = SQLite3::escapeString("$id"); + $ergebnis = $db->query("SELECT * FROM member where id=$safe_id;"); + while($row=$ergebnis->fetchArray()){ + echo "<br><a2>Trage einfach die neuen Daten von $row[name] ein: </a2><br> + <form method='post' action='update.php' ><table><tr>"; + echo "<td align='right'><a2>Name: <input type='text' name='name' value='$row[name]'></a2> </td> + <td align='right'><a2>Adresse: <input type='text' name='adresse' value='$row[adresse]'> </a2></td> + <td align='right'><a2>Telefon: <input type='text' name='telefonnummer' value='$row[telefonnummer]'></a2> </td></tr> + <tr align='right'><td><a2>Handy: <input type='text' name='handynummer' value='$row[handynummer]'></a2> </td> + <td align='right'><a2>E-Mail: <input type='text' name='email' value='$row[email]'></a2> </td> + <td align='right'><a2>Geburtstag: <input type='text' name='geburtstag' value='$row[geburtstag]'></a2> </td></tr> + <tr><td> <input type='hidden' name='id' value='$id'></td><td align='center'><input type='submit' name='submit' value='Update!'/></td><td> </td></tr> + </table></form> + "; + } +} +?> + +<!--AUSKOMMENTIERT################################################################################# +<table width="400px" > +<colgroup width="170" span="3"></colgroup> +<tr align='center'> +<td nowrap> +<div id="show_update" class='unterstrich'> + <a style='color:blue;' href="#" title="Anzeigen" onclick="show_elements('update_db');">Eintrag aktualisieren?</a> + + +</div> +</td> +<td> +oder +</td> +<td nowrap> +<div id="show_update" class='unterstrich'> + <a style='color:blue;' href="#" title="Anzeigen" onclick="show_elements('update_db');">Eintrag ergänzen?</a> +</div> +</td> +</table> + +<div id="update_db" class="noscript"> + +<br><br> + <form method='get' action='index.php' > + <table><tr> + <td><input type=</td> + <td><p>Nummer:</p></td><td><p><input type='text' name='id' size='1'/></p></td> + <td><p><input type='submit' name=submit value='weiter'/></p></td> + </table> + </form> + + +</div> +--> + </div> +</body> +</html> diff --git a/login.php b/login.php new file mode 100644 index 0000000..10e14f3 --- /dev/null +++ b/login.php @@ -0,0 +1,65 @@ +<?php if ($_GET["logout"] == 1) { + $logout = "<br><div style='color:red;'>Ausloggen erfolgreich</div>"; +} +if ($_GET["failure"] == 1) { + $logout = "<br><div style='color:red;'>Name oder Passwort falsch!</div>"; +} + + +?> +<!doctype html public '-//W3C//DTD XHTML 1.0 //EN'> + +<html> +<head> + <title>Junge Gemeinde Adlershof.</title> + <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> + <link rel='stylesheet' type='text/css' href='hyperstyle.css' /> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> +</head> + +<body link='#000000' vlink='#000000' alink='#FF0000'> + +<div class='kleineschrift'> + <div id='header' > + <br><br> + <hr> + </div> + + <div id='content_container' align='center'> + <br> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p></div> + <div id='container' align='center'> + + <?php echo $logout; ?> + <br> + <form method='post' action='check.php' > + <div class='hundertfuenfzig'><p>Login:</p></div> + <p><input type='text' name='username' size='40'/></p> + <p><input type='password' name='password' size='40'/></p> + + + <p><input type='submit' name='submit' value='Miau!'/></p> + + </form><br> + Info: You have five attempts. You will be banned for 6 hours after your login attempts run out.<br> + <a style='text-decoration:underline;' href='reset.php'>Passwort vergessen? Klick hier.</a> + + + <br><br> + <div class='katze' align='center'> +<pre> + _ ___ _.--. + \`.|\..----...-'` `-._.-'_.-'` + / ' ` , __.--' + )/' _/ \ `-_, / + `-''' `''\_,_.-;_.-\_ ', + _.-'_./ {_.' ; / + {_.-``-' {_/ +</pre> + </div> + </div> + </div> +</div> +</body> +</html> + diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..7c527b2 --- /dev/null +++ b/logout.php @@ -0,0 +1,5 @@ +<?php + session_start(); + session_destroy(); + header('Location: login.php?logout=1'); +?> diff --git a/lolrndm.php b/lolrndm.php new file mode 100644 index 0000000..9e73779 --- /dev/null +++ b/lolrndm.php @@ -0,0 +1,39 @@ +<?php include("auth.php"); +include("header.php");?> + +<div id='content_container' align='center'> +<div class='kleineschrift'> + <div style='width:800px;' class='katze' id='behaelter' align='center'> + <br/><br/><br/> + <div class='kleineschrift'> + <div class='ueberschrift'><p>Upps. Das scheint nicht die Seite zu sein, die du gesucht hast.</p> + </div> + </div> + +<br/> +<br/> +<br/> + +<p> + <object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" + codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"> + <param name="movie" value="Gununu_all.swf"> + <param name="quality" value="high"> + <param name="scale" value="exactfit"> + <param name="menu" value="true"> + <param name="bgcolor" value="#000040"> + <embed src="https://cdn.iamfabulous.de/swf/Gununu_all.swf" quality="high" scale="exactfit" menu="false" + bgcolor="#000000" width="600" height="400" swLiveConnect="false" + type="application/x-shockwave-flash" + pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"> + </embed> + </object> +</p> +<br> +<p><a href="/">Zurück zur Startseite.</a></p> +</div> +</div> +</div> +</div> + +</body> diff --git a/member_login.php b/member_login.php new file mode 100644 index 0000000..1d3b6d9 --- /dev/null +++ b/member_login.php @@ -0,0 +1,104 @@ +<?php include('auth.php'); +include("header.php"); + +$name = $_SESSION["username"]; + +if ($_SESSION["username"] == "jg-adlershof"){ + $account ="<td><a href='member_login.php'>Login</a></td> + <td>|</td> + <td><a href='register.php'>Register</a></td> + <td>|</td> +" ; + $name = "Gast"; + +} else { + header("Location: account.php"); + exit; + $account ="<td><a href='account.php'>Account</a></td> + <td>|</td> +"; +} + +if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $username = $_POST["username"]; + $passwort = $_POST["password"]; + + $safe_username = SQLite3::escapeString("$username"); + $safe_passwort = SQLite3::escapeString("$passwort"); + + $db_check = new SQLite3("/var/www/jungegemeinde/database/share.db"); + $salt_db = $db_check->query("SELECT salt FROM user WHERE name='$safe_username';"); + while($salt_array = $salt_db->fetchArray(SQLITE3_NUM)){ + foreach($salt_array as $firstelement){ + $salt=$firstelement; + } + } + + $password = "$salt"."$passwort"; + $hash_password = md5($password); + for($i=0;$i<15000;$i++) + $hash_password = md5($hash_password); + + $real_password_db = $db_check->query("SELECT password FROM user WHERE name='$safe_username';"); + while($real_password_array = $real_password_db->fetchArray(SQLITE3_NUM)){ + foreach($real_password_array as $secondelement){ + $real_password=$secondelement; + } + } + + if ($real_password == $hash_password) { + + $_SESSION["username"] = $_POST["username"]; + header("Location: member_login.php?stat=1"); + + } else { + header("Location: member_login.php?stat=2"); + } + +} else { + +if ($_GET["stat"] == 2) { + $failure="<br><div style='color:red;'>Name und/oder Passwort sind falsch!</div>"; +} else { + if ($_GET["stat"] == 1) { + header("Location: account.php"); + exit; + } +} + + +echo " + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'> + <p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + +<br> + + <div id='behaelter' align='center' class=''> + <div class='katze'> + Hallo $name, <br> + hier kannst du dich für den Mitgliederbereich einloggen. + </div><br> + + Noch kein eigenes Passwort? Dann <a style='text-decoration:underline;' href='register.php'>registrier</a> dich einfach.<br><br> + $failure + <form method='post' action='member_login.php' > + <p><input type='text' name='username' size='40'/></p> + <p><input type='password' name='password' size='40'/></p> + + + <p><input type='submit' name='submit' value='Miau!'/></p> + + </form> + </div> +</div> +</div> +</body> +</html> +"; +} +?> diff --git a/piwik.php b/piwik.php new file mode 100644 index 0000000..86bfb94 --- /dev/null +++ b/piwik.php @@ -0,0 +1,17 @@ +<?php include("auth.php");?> +<!-- Piwik --> +<script type="text/javascript"> + var _paq = _paq || []; + _paq.push(["trackPageView"]); + _paq.push(["enableLinkTracking"]); + + (function() { + var u=(("https:" == document.location.protocol) ? "https" : "http") + "://a.iamfabulous.de/"; + _paq.push(["setTrackerUrl", u+"piwik.php"]); + _paq.push(["setSiteId", "2"]); + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); + })(); +</script> +<noscript><img src="https://a.iamfabulous.de/piwik.php?idsite=2&rec=1" style="border:0" alt="" /></noscript> +<!-- End Piwik Code --> diff --git a/quote.php b/quote.php new file mode 100644 index 0000000..022d2ff --- /dev/null +++ b/quote.php @@ -0,0 +1,74 @@ +<?php include('auth.php'); +include("header.php"); + +$zufall = $_GET["id"]; + +/*__Datenbank___*/ +$db = new SQLite3("/var/www/jungegemeinde/database/jg.db"); +$rows = $db->query("SELECT count(*) as count FROM sprueche;"); +$row = $rows->fetchArray(); +$numRows = $row["count"]; + +if ($zufall == ""){ + $zufall = mt_rand(1,$numRows); +} + + +$safe_zufall = SQLite3::escapeString("$zufall"); +$ergebnis = $db->query("SELECT * FROM sprueche where id=$safe_zufall;"); + +echo" + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p></div> + </div> + <div id='container' align='center'> + +<br><br><br> + +<b>Zitat Nummer #$zufall</b><br><br><div id='bgcolor'>"; + + +if (preg_match('/[0-9]/',$zufall)){ // I really need this hack to get the 404 when /[0-9][a-zA-Z]/ is happening. Bad PHP! + if (preg_match('/[^0-9]/',$zufall)){ + $zufall = 0; + } +} + + + +if ($zufall > 0 && $zufall <= ($numRows)){ + while($row=$ergebnis->fetchArray()){ + echo $row["spruch"]; + } +} else { +echo "\"Sorry, can't find the quote, but a cat is fine too, right?\"<br><br> +<pre> + ,/| _.--''^``-...___.._.,; + /, \'. _-' ,--,,,--''' + { \ `_-'' ' /} + `;;' ; ; ; + ._.--'' ._,,, _..' .;.' + (,_....----''' (,..--'' +</pre><br><br> +<i>404 - Eintrag nicht vorhanden.</i>"; +} + +echo "</div> + +<br><br><br> + ----------------------------------------------------------------- +<div class='kleineschrift'><p>Es sind momentan <b><i>$numRows</i></b> Zitate in der Datenbank enthalten.</p> +Du suchst ein bestimmtes Zitat? Gib hier dessen Nummer ein: <form method='get' action='quote.php' > + <input name='id' type='text' size='2' maxlength='30'> + <input type='submit' style='display:none'/> + + </form> +</div> + +</div></div></div> +</body></html>"; + +?> diff --git a/redirect.php b/redirect.php new file mode 100644 index 0000000..e45e078 --- /dev/null +++ b/redirect.php @@ -0,0 +1,5 @@ +<?php include("auth.php"); + +$location = $_Get["dest"]; +header("Location: $location"); +?> diff --git a/register.php b/register.php new file mode 100644 index 0000000..bdc8178 --- /dev/null +++ b/register.php @@ -0,0 +1,49 @@ +<?php include('auth.php'); +include("header.php"); + +if ($_GET["false"] == 1){ +$failure= "<div style='color:red;'>Fehler! Entweder ist der Nutzer schon registriert oder dein Passwort war leer!</div><br>"; +} + +echo " + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'> + <p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + + + +<br><div style='width:800px;' id='behaelter' align='center' class='katze'> +Registriere dich, um einen persönlichen Zugang zu erhalten. Such dir einen beliebigen Spitznamen und ein geeignetes Passwort aus. Keine Angst, dein Passwort wird sicher verwahrt und nicht im Klartext abgelegt. +<br><br>Die E-Mail Adresse ist keine Pflicht, aber notwendig, wenn du dein Passwort vergessen hast. +<br/><br/> + +$failure + +<div class='katze'> +<form method='post' action='inreg.php'> +<table width='320px'> +<tr> + <td align='left'><p>Name:</td><td align='right'><input name='name' type='text' size='20' maxlength='30'></p></td> +</tr> +<tr> + <td align='left'><p>Passwort:</td><td align='right'><input name='pswd' type='password' size='20' maxlength='30'></p></td> +</tr> +<tr><td align='left'><p>E-Mail:</td> <td align='right'><input name='email' type='text' size='20' maxlength='30'></p></td> +</tr> +</table> +<center><input type='submit' name='submit' value='Register'/></center> +</form> +</div> + +</div> +</body> +</html> +"; + + + +?> diff --git a/reset.php b/reset.php new file mode 100644 index 0000000..9a84e79 --- /dev/null +++ b/reset.php @@ -0,0 +1,117 @@ +<?php session_start() ?> +<!doctype html> + +<html> + <head> + <title>Junge Gemeinde Adlershof.</title> + <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> + <link rel='stylesheet' type='text/css' href='hyperstyle.css' /> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> + </head> + + <body link="#000000" vlink="#000000" alink="#FF0000"> + +<?php + +if($_SESSION["login"]){ + +include("header.php"); + +} else { + echo " + <div id='header' class='kleineschrift'> + <br><br> + <hr> + </div> + "; + +$startseite="<div class='kleineschrift'><a style='text-decoration:underline;' href='login.php'>Zurück zur Startseite.</a></div>"; +} +?> + <div id='content_container' align="center"><br> + + <div align='center'> + <p5>JUNGE GEMEINDE ADLERSHOF</p5> +<br><br><div id='behaelter' align='center'> + +<?php + +$email_post = $_POST["email"]; +$try = $_POST["try"]; + +if (empty($email_post)){ +echo " +<a5>Gib deine E-Mail Adresse ein, um dir ein neues Passwort zuzuschicken.</a5><br><br> +<form action='reset.php' method='post'> +<input type='text' name='email' size='30'/> +</form> +"; +} else { + + /*___Datenbank___*/ + $db_check = new SQLite3("/var/www/jungegemeinde/database/share.db"); + $safe_email = SQLite3::escapeString("$email_post"); + + $email_db = $db_check->query("SELECT email FROM user WHERE email='$safe_email';"); + while($email_array = $email_db->fetchArray(SQLITE3_NUM)){ + foreach($email_array as $thirdelement){ + $email=$thirdelement; + } + } + + if (empty($email)){ + $try = $try +1; + + if ($try > 0){ + header("HTTP/1.0 401 Unauthorized"); + } + $maxtry = 3 - $try; + + if ($maxtry == 0) { + echo "<a4><b>YOU ARE BANNED! ;_;</b></a4><br> "; + header("Refresh: 3; /401"); + + } else { + echo "<a5>Die E-Mail ist nicht in der Datenbank gespeichert. Achte auf Tippfehler und probiere noch einmal.<br> + Du hast noch $maxtry Versuche, bevor du gesperrt wirst.</a5> + <br><br> + <form action='reset.php' method='post'> + <input type='text' name='email' size='30'/> + <input type='hidden' name='try' value='$try'/> + </form> + "; + } + } else { + + $secret = explode(" ", "a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9"); + shuffle($secret); + $secret = substr(implode($secret), 0, 10); + + $salt = uniqid(mt_rand(), true); + $password = "$salt"."$secret"; + $hash_password = md5($password); + for($i=0;$i<15000;$i++) + $hash_password = md5($hash_password); + + $result = $db_check->exec("UPDATE user SET password='$hash_password', salt='$salt' where email='$email';"); + + echo "Wir haben deine E-Mail in der Datenbank. Eine E-Mail mit deinem neuen Passwort wurde soeben verschickt.<br>"; + +// exec('curl -vv --user max:sommer13 -F sender="mailer-daemon@jg-adlershof.de" -F recipient="'.$email.'" -F subject="Angefordertes neues Passwort - BITTE NICHT ANTWORTEN" -F message="Dein neues Passwort lautet: '.$secret.'." http://playground.oweissbarth.de/mail/send.php'); + + + } + + +} + +?> +<br> +<?php echo $startseite; ?> +</div> +</div> +</div> +</body> +</html> +<?php +?> diff --git a/robots.txt b/robots.txt new file mode 100755 index 0000000..1f53798 --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/share.php b/share.php new file mode 100644 index 0000000..7aeaf9c --- /dev/null +++ b/share.php @@ -0,0 +1,21 @@ +<?php include('auth.php'); +include("header.php"); +?> + +<div id='content_container' align='center'> + <br> + <div class='kleineschrift'> + <div class='ueberschrift'><p>JUNGE GEMEINDE ADLERSHOF</p> + </div> + </div> + +<?php +$db = new SQLite3("/var/www/jungegemeinde/database/share_test.db"); + +$show_public_db = $db->query("SELECT filename FROM file WHERE private=0;"); + +while($show_public_array = $show_public_db->fetchArray() ){ + echo " $show_public_array[filename]"; +} + +?> diff --git a/to-do-list.php b/to-do-list.php new file mode 100644 index 0000000..b4e2905 --- /dev/null +++ b/to-do-list.php @@ -0,0 +1,51 @@ +<?php include('auth.php'); ?> +<!DOCTYPE html> +<head> +<title>to-do-list</title> +</head> + +Auf Python umsteigen!<br> +SQL: UPDATE --fix (09.10.13) ENDLICH!!<br> +SQL: .DUMP <br> +SQL: DROP? <br> +email Benachrichtigung bei UPDATE <br> +Javascript for fancy programming <br> +PHP kann in zu PDFs? <br> +verfickte Umlaute reparieren --fix (05.10.13)<br> +Wie siehts aus mit SQL Injections? --wer schaffts?<br> +URL Rewriting? Warum eigentlich nicht. <br> +.csv output fixen ("") <br> +CSS erweitern, zB alternative Schriftarten festlegen, bzw importieren --unwichtig<br> +Mit der Tabelle umziehen, für die führende Null. (Felix hat mich daran erinnert, danke.) --fix (09.10.13) War nicht schwierig, konnte aber so die Seite testen. Trotzdem können wir nun nicht mehr sortiert nach der Quersumme der Handynummern die Liste anzeigen. :/<br> +mailto: Links einfügen -- Ist das wichtig? <br> +Bevor jemand meckert. Die Methoden wieder zur Startseite zu kommen sind bei "aktualisieren" und "neuen Eintrag" unterschiedlich, ist mir bewusst. Stört das den "Flow"? Dann muss ich das kurz umschreiben. Ansonsten gehts bei mir auch so. <br> +Update umschreiben, sodass man nicht mehr den Primärschlüssel manuell eingeben muss, sondern nur noch eine Checkbox drückt und er wird automatisch übergeben.<br> +Design: Formular von UPDATE und INSERT sieht auch nicht gleich aus.<br> +Ich mag Katzen und hab noch ein paar mehr davon:<br><pre> + _ ___ _.--. + \`.|\..----...-'` `-._.-'_.-'` + / ' ` , __.--' + )/' _/ \ `-_, / + `-'" `"\_ ,_.-;_.-\_ ', fsc/as + _.-'_./ {_.' ; / + {_.-``-' {_/ +</pre><br> +Andere folgen eventuell später. + + +<!-- Obligatory Piwik --> +<script type="text/javascript"> + var _paq = _paq || []; + _paq.push(["trackPageView"]); + _paq.push(["enableLinkTracking"]); + + (function() { + var u=(("https:" == document.location.protocol) ? "https" : "http") + "://a.iamfabulous.de/"; + _paq.push(["setTrackerUrl", u+"piwik.php"]); + _paq.push(["setSiteId", "2"]); + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); + })(); +</script> +<noscript><img src="https://a.iamfabulous.de/piwik.php?idsite=2&rec=1" style="border:0" alt="" /></noscript> +<!-- End Piwik Code --> diff --git a/update.php b/update.php new file mode 100644 index 0000000..f3f6b4d --- /dev/null +++ b/update.php @@ -0,0 +1,48 @@ +<?php include('auth.php'); +/*error_reporting(E_ALL); + +ini_set('display_errors', '1');*/ + +$id = $_POST["id"]; +$name = $_POST["name"]; +$adresse = $_POST["adresse"]; +$telefonnummer = $_POST["telefonnummer"]; +$handynummer = $_POST["handynummer"]; +$email = $_POST["email"]; +$bday = $_POST["geburtstag"]; + +//echo "$name<br> $adresse<br>$telefonnummer<br>$handynummer<br>$email<br>$bday<br>$ip<br>$cryptedip"; + + + +$db = new SQLite3('/var/www/jungegemeinde/database/jg.db'); + +$result = $db->exec("UPDATE member SET name='$name' where id=$id;"); +$result = $db->exec("UPDATE member SET adresse='$adresse' where id=$id;"); +$result = $db->exec("UPDATE member SET telefonnummer='$telefonnummer' where id=$id;"); +$result = $db->exec("UPDATE member SET handynummer='$handynummer' where id=$id;"); +$result = $db->exec("UPDATE member SET email='$email' where id=$id;"); +$result = $db->exec("UPDATE member SET geburtstag='$bday' where id=$id;"); + +/*echo " +<!doctype html public '-//W3C//DTD XHTML 1.0 //EN'> + +<html> + <head> + <title>Junge Gemeinde Adlershof - Update erfolgreich!</title> + <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> + <link rel='stylesheet' type='text/css' href='style.css' /> + <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> + </head> + + <body> +<center> +<p5>Update erfolgreich!</p5><br><br> +<a4>Weiterleitung in 3.. 2.. 1..</a4> +</center></body></html>";*/ + +header("Refresh: 0; liste.php"); + + + +?> |
