diff --git a/CONTRIBUTORS.MD b/CONTRIBUTORS.MD
new file mode 100644
index 0000000..fe0deb1
--- /dev/null
+++ b/CONTRIBUTORS.MD
@@ -0,0 +1,22 @@
+# loginpagefoo
+## Authors
+- Lara Schradick
+- Miriam Schroth
+
+## License
+
+Written under AGPLv3.
+
+For more infos see [/LICENSE](/LICENSE)
+## External Sources
+### Stylesheets:
+- Bootstrap
+
+### Javascript:
+- Bootstrap
+
+### Database Design:
+- Thies Müller
+
+### PHP Code:
+- contributions from Thies Müller
diff --git a/FEATURES.MD b/FEATURES.MD
deleted file mode 100644
index f739020..0000000
--- a/FEATURES.MD
+++ /dev/null
@@ -1,17 +0,0 @@
-# FEATURES
-
-## Password Login
-
-## PHP Session
-
-## Logout
-
-## Forget Password
-
-## Password Complexibility Check
-
-## Admin Functions
-
-## Activate E-Mail
-
-## More to come
\ No newline at end of file
diff --git a/activatedarea.php b/activatedarea.php
index b73c10e..2dbe19b 100644
--- a/activatedarea.php
+++ b/activatedarea.php
@@ -24,9 +24,9 @@ if(isset($_GET['notimplemented'])) { //if "?notimplemented=1" is received, print
//some html links to other pages
?>
-Change Profile Picture
+Some Feature
-Change Description
+Some other Feature
Back
diff --git a/activation.php b/activation.php
index 9e061fe..ea6f1cb 100644
--- a/activation.php
+++ b/activation.php
@@ -64,10 +64,15 @@ If this mail comes unsolicited, please just ignore the mail.
cheers
loginpagefoo script';
- mail($mailrcpt, $mailsubject, $text, $from); //sending the mail with the build-in mail function.
+echo 'Activation Link: '.$url_activationcode.' ';
+/*
+this would be the prod implementation
+instead we just print the link and never ever use this in prod!
+mail($mailrcpt, $mailsubject, $text, $from); //sending the mail with the build-in mail function.
echo 'Link send. Going back to profile page. ';
//afterwards going back to profile, and dont render the form again.
+ */
$showForm = false;
}
}
diff --git a/adminarea.php b/adminarea.php
index 8113839..7065cc1 100644
--- a/adminarea.php
+++ b/adminarea.php
@@ -12,13 +12,6 @@ session_start();
if($_SESSION['isadmin'] == 0) { //but first a check if you've got admin rights. if not, destroy the session and go back to start.
die ('No rights for you! ');
} //this is purely a cosmetic effect. no harm could be done from here. it's merely a html page with a little check if you've got the right rights.
-echo '
heres the admin world
';
+echo 'heres the admin world. poc of rights management
';
-echo 'User Admin ';
-echo ' ';
-echo 'Session Admin ';
-echo ' ';
-echo 'Admin Admin ';
-echo ' ';
-echo 'Back ';
?>
diff --git a/adminarea_admins.php b/adminarea_admins.php
deleted file mode 100644
index beead48..0000000
--- a/adminarea_admins.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-Admin Area
-
-
-
-
-');
-}
-echo 'heres the admin world
';
-echo 'GIVE ';
-echo 'TAKE ';
-echo " ";
-echo $output;
-echo " ";
-echo "//implement a user search here."; //yeah! Do what the comment says!
-echo ' ';
-
-$showForm = false;
-
-if(isset($_GET['user']) ) {
- if(!isset($_POST['username']) || empty($_POST['username'])) {
- $error = "Enter the username ";
- } else {
- $statement = $pdo->prepare("SELECT * FROM users WHERE username = :username");
- $result = $statement->execute(array('username' => $_POST['username']));
- $user = $statement->fetch();
-
- if($user === false) {
- $error = "no user found ";
- } else {
- echo $user['isadmin'];
- $showForm = false;
-
- }
- }
-}
-
-if($showForm):
-?>
-
-Search for Admin Rights!
-Please enter the username below.
-
-
-
-
-
-
- ';
-echo 'Back ';
-?>
diff --git a/adminarea_admins_give.php b/adminarea_admins_give.php
deleted file mode 100644
index 6f95038..0000000
--- a/adminarea_admins_give.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-Admin Area
-
-
-
-
-');
-}
-echo 'heres the admin world
';
-
-$showForm = true;
-
-if(isset($_GET['user']) ) {
- if(!isset($_POST['username']) || empty($_POST['username'])) {
- $error = "Enter the username ";
- } else {
- $statement = $pdo->prepare("SELECT * FROM users WHERE username = :username");
- $result = $statement->execute(array('username' => $_POST['username']));
- $user = $statement->fetch();
-
- if($user === false) {
- $error = "no user found ";
- } else {
-
-
- //check if theres a code already
- $statement = $pdo->prepare("UPDATE users SET isadmin = '1' WHERE id = :userid");
- $result = $statement->execute(array('userid' => $user['id']));
-
-
- echo 'Successfully granted ';
- echo $user['username'];
- echo ' ADMIN rights.
';
- $showForm = false;
- }
- }
-}
-
-if($showForm):
-?>
-
-Give Admin Rights!
-Please enter the username below.
-
-
-
-
-
-
- ';
-echo 'Back ';
-?>
diff --git a/adminarea_admins_take.php b/adminarea_admins_take.php
deleted file mode 100644
index 2ad807b..0000000
--- a/adminarea_admins_take.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-Admin Area
-
-
-
-
-');
-}
-echo 'heres the admin world
';
-
-$showForm = true;
-
-if(isset($_GET['user']) ) {
- if(!isset($_POST['username']) || empty($_POST['username'])) {
- $error = "Enter the username ";
- } else {
- $statement = $pdo->prepare("SELECT * FROM users WHERE username = :username");
- $result = $statement->execute(array('username' => $_POST['username']));
- $user = $statement->fetch();
-
- if($user === false) {
- $error = "no user found ";
- } else {
-
-
- //check if theres a code already
- $statement = $pdo->prepare("UPDATE users SET isadmin = '0' WHERE id = :userid");
- $result = $statement->execute(array('userid' => $user['id']));
-
-
- echo 'Successfully took the ADMIN rights from ';
- echo $user['username'];
- echo '
';
- $showForm = false;
- }
- }
-}
-
-if($showForm):
-?>
-
-Give Admin Rights!
-Please enter the username below.
-
-
-
-
-
-
- ';
-echo 'Back ';
-?>
diff --git a/adminarea_useradmin.php b/adminarea_useradmin.php
deleted file mode 100644
index ea90687..0000000
--- a/adminarea_useradmin.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-Admin Area
-
-
-
-
-');
-}
-
-echo 'heres the admin world
';
-
-
-
-//create connection
-$connection = mysqli_connect($mysqlhost, $dbuser, $dbpass, $dbname);
-
-//test if connection failed
-if(mysqli_connect_errno()){
- die("connection failed: "
- . mysqli_connect_error()
- . " (" . mysqli_connect_errno()
- . ")");
-}
-
-//get results from database
-$result = mysqli_query($connection,"SELECT * FROM users");
-$all_property = array(); //declare an array for saving property
-
-//showing property
-echo '
- '; //initialize table tag
-while ($property = mysqli_fetch_field($result)) {
- echo '' . $property->name . ' '; //get field name for header
- array_push($all_property, $property->name); //save those to array
-}
-echo ' '; //end tr tag
-
-//showing all data
-while ($row = mysqli_fetch_array($result)) {
- echo "";
- foreach ($all_property as $item) {
- echo '' . $row[$item] . ' '; //get items using property value
- }
- echo ' ';
-}
-echo "
";
-
-echo ' ';
-echo 'Back ';
-?>
diff --git a/backgroundupdate.php b/backgroundupdate.php
index b25df71..df212ff 100644
--- a/backgroundupdate.php
+++ b/backgroundupdate.php
@@ -15,5 +15,4 @@ $_SESSION['lastName'] = $user['lastName'];
$_SESSION['activated'] = $user['activated'];
$_SESSION['updated_at'] = $user['updated_at'];
$_SESSION['isadmin'] = $user['isadmin'];
-$_SESSION['profilepicture'] = $user['profilepicture'];
?>
\ No newline at end of file
diff --git a/changepass.php b/changepass.php
deleted file mode 100644
index b7f092b..0000000
--- a/changepass.php
+++ /dev/null
@@ -1,109 +0,0 @@
-
-prepare("SELECT * FROM users WHERE username = :username");
- $result = $statement->execute(array('username' => $username));
- $user = $statement->fetch();
-
- if ($user !== false && password_verify($oldpassword, $user['password'])) {
- if(isset($_GET['send'])) {
- $password = $_POST['password'];
- $password_confirm = $_POST['password_confirm'];
- //regexes for passvalidation:
- $REuppercase = preg_match('@[A-Z]@', $password);
- $RElowercase = preg_match('@[a-z]@', $password);
- $REnumber = preg_match('@[0-9]@', $password);
- $REspecialChars = preg_match('@[^\w]@', $password);
- if($password != $password_confirm) {
- echo "password or confirmed password wrong";
- }
- if(!$REuppercase || !$RElowercase || !$REnumber || !$REspecialChars || strlen($password) < 8) {
- echo 'Password needs to be more complex. ';
- echo 'Please implement at least 8 chars, upper & downer caser, one number & one special char. ';
- $error = true;
- } else {
- $passwordhash = password_hash($password, PASSWORD_DEFAULT);
- $statement = $pdo->prepare("UPDATE users SET password = :passwordhash, passwordcode = NULL, passwordcode_time = NULL WHERE id = :userid");
- $result = $statement->execute(array('passwordhash' => $passwordhash, 'userid'=> $userid ));
-
- if($result) {
- die('Changed password. Going to start now. ');
- }
- }
- }
- die(' ');
- } else {
- $errorMessage = 'somethings wrong (maybe wrong password or wrong user)
';
- }
-
-}
-
-?>
-
-
-
-
-
- Change Password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-*/
\ No newline at end of file
diff --git a/changeprofilepicture.php b/changeprofilepicture.php
deleted file mode 100644
index 1d09b9c..0000000
--- a/changeprofilepicture.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-Activated Area
-
-
-
-
-
- returning to default picture";
- $statement = $pdo->prepare("UPDATE users SET profilepicture = :imageurl WHERE id = :userid");
- $result = $statement->execute(array('imageurl' => $imageurl, 'userid'=> $userid ));
-
- if($result) {
- die(' Changed Profile Picture. Going to profile now. ');
- }
-}
- else {
- $statement = $pdo->prepare("UPDATE users SET profilepicture = :imageurl WHERE id = :userid");
- $result = $statement->execute(array('imageurl' => $imageurl, 'userid'=> $userid ));
-
- if($result) {
- die(' Changed Profile Picture. Going to profile now. ');
- }
- }
- }
-
-?>
-
-
-
-
Right now you need to upload the picture somewhere and input the URL here.
-
Please be aware that only the following filetypes will work!
-
jpg
-
gif
-
png
-
-
-
-
-
-
Back
-
-
\ No newline at end of file
diff --git a/forgotpass.php b/forgotpass.php
index cb85e48..8e1562d 100644
--- a/forgotpass.php
+++ b/forgotpass.php
@@ -62,9 +62,11 @@ If this mail comes unsolicited, please just ignore the mail.
cheers
loginpagefoo script';
- mail($mailrcpt, $mailsubject, $text, $from);
+ /*mail($mailrcpt, $mailsubject, $text, $from);
echo 'Link send. Going back to login page. ';
+ */
+echo 'Password Reset Link: '.$url_passwordcode.' ';
$showForm = false;
}
}
diff --git a/forlaterpurposemaybe.html b/forlaterpurposemaybe.html
deleted file mode 100644
index dc78c39..0000000
--- a/forlaterpurposemaybe.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
- Profile Page
-
-
-
-
-
-
-
-
-
-
-
- loginpagefoo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/fullinstalldocker.sql b/fullinstalldocker.sql
index 75bfff6..b715b30 100644
--- a/fullinstalldocker.sql
+++ b/fullinstalldocker.sql
@@ -17,6 +17,5 @@ CREATE TABLE `users` (
`activated` VARCHAR(1) NOT NULL ,
`passwordcode` VARCHAR(255) NULL ,
`passwordcode_time` TIMESTAMP NULL ,
- `profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
diff --git a/login.php b/login.php
index a85460e..65272aa 100644
--- a/login.php
+++ b/login.php
@@ -1,11 +1,5 @@
successfull. go to: start page '); //successful login, thats all.
} else {
$errorMessage = 'somethings wrong (maybe wrong password or wrong user)
'; //if password not match or username doesn't exist print this line
diff --git a/profile.php b/profile.php
index 4acc107..26ece1d 100644
--- a/profile.php
+++ b/profile.php
@@ -2,7 +2,7 @@
Please login ');
+ die(' ');
}
//for easier use we shove some of the session array into variables.
$userid = $_SESSION['userid'];
@@ -12,7 +12,6 @@ $usergn = $_SESSION['givenName'];
$userln = $_SESSION['lastName'];
$activated = $_SESSION['activated'];
$isadmin = $_SESSION['isadmin'];
-$profilepicture = $_SESSION['profilepicture'];
//lets build a page:
?>
@@ -26,10 +25,6 @@ $profilepicture = $_SESSION['profilepicture'];
- ';
-
- ?>
diff --git a/register.php b/register.php
index 3a7aa6e..bdbb746 100644
--- a/register.php
+++ b/register.php
@@ -1,12 +1,7 @@
-
Crappy Login POC
+
Login POC
- Git
+
0){ //if the user is logged in (has a userid above 0) then print this:
echo 'Hi '.$_SESSION['username'].' ';
@@ -175,22 +175,19 @@ if ($isadmin == 1) { //if admin rights are granted, print a admin area button
diff --git a/usertable.sql b/usertable.sql
index 06a8a76..494cfea 100644
--- a/usertable.sql
+++ b/usertable.sql
@@ -13,6 +13,5 @@ CREATE TABLE `users` (
`isadmin` VARCHAR(1) NULL ,
`passwordcode` VARCHAR(255) NULL ,
`passwordcode_time` TIMESTAMP NULL ,
- `profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;