Commit 5fda9936 authored by Fabian Gabel's avatar Fabian Gabel
Browse files

add german login

parent e41e8982
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<link rel="shortcut icon" href="/webwork.ico"/>
<meta charset="utf-8"/>
<title>WeBWorK Login Request</title>
<style>
body, html {
height: 99%;
}
* {
box-sizing: border-box;
}
.bg-image {
/* The image used */
background-image: url("webwork_bg.png");
/* Add the blur effect */
filter: blur(10px);
-webkit-filter: blur(10px);
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/* Position text in the middle of the page/image */
.bg-text {
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0, 0.4); /* Black w/opacity/see-through */
color: white;
font-weight: bold;
border: 3px solid #f1f1f1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
width: 80%;
max-width: 500px;
padding: 20px;
text-align: center;
}
</style>
</head>
<body style="background-color:black;">
<?php
include 'config.php';
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
function rorand($min, $max){
//generate a random integer between $min and $max (inclusive)
$res = file_get_contents("https://www.random.org/integers/?num=1&min=$min&max=$max&col=1&base=10&format=plain&rnd=new");
return $res;
}
?>
<div class="container">
<div class="bg-image"></div>
<div class="bg-text">
<H1>WeBWorK Login anfordern</H1>
<br>
<hr>
<?php
if(isset($_POST['kerberos']) && isset($_POST['firstname'])) {
if(strcmp(trim($_POST['kerberos']), '') !== 0 &&
strcmp(trim($_POST['firstname']),'') !== 0 &&
strcmp(trim($_POST['lastname']),'') !== 0){
$firstname=$_POST['firstname'];
$user_id = trim(strtolower(str_replace(' ', '', $firstname)) . strval(rorand(1000,9999)));
$password=exec("./crypt_password.pl $user_id");
$data = "INSERT INTO classlist (student_id,last_name,first_name,user_id,password) VALUES ('"
. $_POST['kerberos'] ."', '"
. $_POST['lastname'] . "', '"
. $firstname . "', '"
. $user_id . "', '"
. $password ."');";
#echo $data;
$ret = $conn->query($data);
if($ret === false) {
die('There was an error executing your query.');
} else {
?>
<h1>Vielen Dank!</h1>
Ihre Login-Daten werden Ihnen zugeschickt.
<hr>
<form action="webwork_de.php" method="POST" role="form" class="form-horizontal">
<button type="submit" class="btn btn-primary">Neue Anfrage</button>
</form>
<?php
}
} else {
?>
<h2>Error</h2>
Not all fields were filled out.<br><br>
Please click on <b>New Request</b> and try again.
<hr>
<form action="webwork_de.php" method="POST" role="form" class="form-horizontal">
<button type="submit" class="btn btn-primary">New Request</button>
</form>
<?php
}
} else {
?>
Bitte füllen Sie die folgenden Felder aus:
<hr>
<form action="webwork_de.php" method="POST" role="form" class="form-horizontal">
<div class ="form-group">
<label for="kerberos">Kerberos *</label>
<input type="text" class="form-control" id="kerberos" name="kerberos" placeholder="cab1234">
</div>
<div class ="form-group">
<label for="firstname">Vorname *</label>
<input type="text" class="form-control" id="firstname" name="firstname" placeholder='John'>
</div>
<div class ="form-group">
<label text-align="center" for="lastname">Nachname *</label><br>
<input type="text" class="form-control" id="lastname" name="lastname" placeholder='Doe'>
</div>
<hr>
<p style="text-align:left">* Notwendige Angabe</p>
<hr>
<button type="submit" value="submit" class="btn btn-primary">Login anfordern</button>
</form>
<?php
}
?>
</div>
<!-- Footer -->
<footer class="page-footer font-small blue">
<!-- Copyright -->
<div class="footer-copyright text-center py-3">
<a href="https://webwork.fabian-gabel.de/webwork2"> WeBWorK</a>
|
<a href="/impressum.html">Impressum</a>
|
<a href="https://uberspace.de/en/">Hosted on Asteroids</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
</div>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment