diff --git a/.DS_Store b/.DS_Store index 9cbe5d2..0adccb5 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/WEB/.DS_Store b/WEB/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/WEB/.DS_Store differ diff --git a/WEB/connectionBD.php b/WEB/connectionBD.php new file mode 100644 index 0000000..1476984 --- /dev/null +++ b/WEB/connectionBD.php @@ -0,0 +1,18 @@ + + + + + Apache2 Debian Default Page: It works + + + +
+ + +
+ + +
+
+ It works! +
+
+

+ This is the default welcome page used to test the correct + operation of the Apache2 server after installation on Debian systems. + If you can read this page, it means that the Apache HTTP server installed at + this site is working properly. You should replace this file (located at + /var/www/html/index.html) before continuing to operate your HTTP server. +

+ + +

+ If you are a normal user of this web site and don't know what this page is + about, this probably means that the site is currently unavailable due to + maintenance. + If the problem persists, please contact the site's administrator. +

+ +
+
+
+ Configuration Overview +
+
+

+ Debian's Apache2 default configuration is different from the + upstream default configuration, and split into several files optimized for + interaction with Debian tools. The configuration system is + fully documented in + /usr/share/doc/apache2/README.Debian.gz. Refer to this for the full + documentation. Documentation for the web server itself can be + found by accessing the manual if the apache2-doc + package was installed on this server. + +

+

+ The configuration layout for an Apache2 web server installation on Debian systems is as follows: +

+
+/etc/apache2/
+|-- apache2.conf
+|       `--  ports.conf
+|-- mods-enabled
+|       |-- *.load
+|       `-- *.conf
+|-- conf-enabled
+|       `-- *.conf
+|-- sites-enabled
+|       `-- *.conf
+          
+
    +
  • + apache2.conf is the main configuration + file. It puts the pieces together by including all remaining configuration + files when starting up the web server. +
  • + +
  • + ports.conf is always included from the + main configuration file. It is used to determine the listening ports for + incoming connections, and this file can be customized anytime. +
  • + +
  • + Configuration files in the mods-enabled/, + conf-enabled/ and sites-enabled/ directories contain + particular configuration snippets which manage modules, global configuration + fragments, or virtual host configurations, respectively. +
  • + +
  • + They are activated by symlinking available + configuration files from their respective + *-available/ counterparts. These should be managed + by using our helpers + + a2enmod, + a2dismod, + + + a2ensite, + a2dissite, + + and + + a2enconf, + a2disconf + . See their respective man pages for detailed information. +
  • + +
  • + The binary is called apache2. Due to the use of + environment variables, in the default configuration, apache2 needs to be + started/stopped with /etc/init.d/apache2 or apache2ctl. + Calling /usr/bin/apache2 directly will not work with the + default configuration. +
  • +
+
+ +
+
+ Document Roots +
+ +
+

+ By default, Debian does not allow access through the web browser to + any file apart of those located in /var/www, + public_html + directories (when enabled) and /usr/share (for web + applications). If your site is using a web document root + located elsewhere (such as in /srv) you may need to whitelist your + document root directory in /etc/apache2/apache2.conf. +

+

+ The default Debian document root is /var/www/html. You + can make your own virtual hosts under /var/www. This is different + to previous releases which provides better security out of the box. +

+
+ +
+
+ Reporting Problems +
+
+

+ Please use the reportbug tool to report bugs in the + Apache2 package with Debian. However, check existing bug reports before reporting a new bug. +

+

+ Please report bugs specific to modules (such as PHP and others) + to respective packages, not to the web server itself. +

+
+ + + + +
+
+
+
+ + + diff --git a/WEB/index.php b/WEB/index.php new file mode 100644 index 0000000..cdf7a10 --- /dev/null +++ b/WEB/index.php @@ -0,0 +1,87 @@ +$erreur

"; + } +} + +function getError($code){ + switch ($code){ + case 1: + return "Adresse mail ou mot de passe invalide."; + } +} + +function authentification($db, $mail, $password){ + $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE mail = $1;", array($mail)); + if ($result){ + $row = pg_fetch_array($result); + return (strcmp($row["passwd"], $password)) == 0; + } + return false; +} + +function init(){ + global $db; + session_start(); + + if(!isset($_SESSION['mail'])){ + if (isset($_POST['mail_field'])){ + + $mail = htmlentities(pg_escape_string ($_POST['mail_field'])); + $password = htmlentities(pg_escape_string($_POST['password'])); + $result = authentification($db, $mail, $password); + if($result) { + $_SESSION['mail'] = $mail; + header('Location: tableauBord/tableauBord.php'); + } + else { + header('Location: index.php?error=1'); + } + } + } + else{ + header('Location: tableauBord/tableauBord.php'); + } +} + +?> + + + + + + Bienvenue sur Upssi'Covoit + + +
+

Bienvenue sur Upssi'Covoit

+
+
+ + +
+
+ + +
+ $erreur

"; + } + ?> + +
+

Si vous n'avez pas de compte cliquez ici.

+
+ + \ No newline at end of file diff --git a/WEB/index_inscription.css b/WEB/index_inscription.css new file mode 100644 index 0000000..b4720b5 --- /dev/null +++ b/WEB/index_inscription.css @@ -0,0 +1,115 @@ +*{ + margin: 0; + padding: 0; + font-family: "Arial"; + font-size: 1em; +} + +body{ + background-image: url("wallpaper.jpg"); + background-attachment: fixed; + padding-top: 5%; + padding-bottom: 5%; +} + +#formulaireMail{ + margin-top: 50vh; + transform: translate(-50%, -50%); +} + +#formulaire{ + transform: translate(-50%); +} + +#formulaire, #formulaireMail{ + background-color: white; + margin-left: 50vw; + border-radius: 10px; + padding: 4em; + width: 40%; +} + +#enregistrer{ + margin-top: 1em; + text-align: center; +} + +h1{ + text-align: center; +} + +form{ + margin-top: 3em; +} + +.form{ + width: 55%; + box-sizing: border-box; + border: 1px solid grey; + margin-bottom: 0.7em; +} + +.button{ + cursor: pointer; + font-weight: bold; + padding: 8px; + color: white; + background-color: rgb(65, 154, 28); + border-radius: 5em; + border: none; +} + +.button:hover{ + background-color: rgb(48, 112, 20); + border-color: rgb(48, 112, 20); +} + +.button:disabled{ + cursor: not-allowed; + background-color: grey; +} + +#submit{ + margin-top: 1em; + margin-left: 50%; + transform: translate(-50%); +} + +.line{ + display: flex; + flex-wrap: wrap; + flex-direction: row; + width: 100%; +} + +#error{ + margin-bottom: 1em; +} + +.error{ + color: red; + text-align: center; +} + +label{ + font-size: 1.1em; + word-break: break-all; + box-sizing: border-box; + display: block; + width: 43%; +} + +input{ + margin-left: 2%; + font-size: 1em; +} + +h1{ + font-size: 2em; +} + +button{ + color: forestgreen; + border-color: forestgreen; + border-radius: 5em; +} diff --git a/WEB/inscription.js b/WEB/inscription.js new file mode 100644 index 0000000..e9e9675 --- /dev/null +++ b/WEB/inscription.js @@ -0,0 +1,25 @@ +let messageAffiche = false; +window.onload = init; + +function init(){ + let password = document.getElementById("password"); + let confirmation = document.getElementById("confirmation"); + + password.oninput = verifPassword; + confirmation.oninput = verifPassword; +} + +function verifPassword() { + let message = "Les mots de passe ne correspondent pas."; + if( !messageAffiche && password.value != "" && confirmation.value!="" && password.value != confirmation.value ){ + confirmation.insertAdjacentHTML("afterend", "

" + message + "

"); + document.getElementById("submit").disabled = true; + messageAffiche = true; + } + else if ( messageAffiche && password.value == confirmation.value ) { + let child = document.getElementById("error"); + child.parentNode.removeChild(child); + document.getElementById("submit").disabled = false; + messageAffiche = false; + } +} \ No newline at end of file diff --git a/WEB/inscription.php b/WEB/inscription.php new file mode 100644 index 0000000..28bb4d2 --- /dev/null +++ b/WEB/inscription.php @@ -0,0 +1,145 @@ +$erreur

"; + } +} + +function getError($code){ + switch ($code){ + case 1: + return "Cette adresse est déjà associée à un compte."; + case 2: + return "Ce login est déjà associé à un compte."; + case 3: + return "Erreur lors de la création du compte."; + case 4: + return "Erreur lors de la vérification de l'unicité de l'adresse mail."; + } +} + +function isMailUnique($db, $mail){ + $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE mail = $1;", array($mail)); + if($result){ + $row = pg_fetch_array($result); + return (strcmp($row['mail'], $mail) != 0); + } + return false; +} + +function isLoginUnique($db, $login){ + $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE login = $1;", array($login)); + if($result){ + $row = pg_fetch_array($result); + return (strcmp($row['login'], $login) != 0); + } + return false; +} + +function creerUtilisateur($db, $mail, $password, $prenom, $nom, $login, $phone, $dateN){ + $result = pg_query_params($db, "INSERT INTO Utilisateur VALUES ($1, $2, $3, $4, $5, $6, to_date($7, 'YYYY/MM/DD'), false);", array($mail, $password, $prenom, $nom, $login, $phone, $dateN)); + return $result; +} + + +function init(){ + global $db; + session_start(); + + if(!isset($_SESSION['mail'])){ + if(isset($_POST['mail_field'])){ + + $login = htmlentities(pg_escape_string ($_POST['login_field'])); + $password = htmlentities(pg_escape_string ($_POST['password'])); + $prenom = htmlentities(pg_escape_string ($_POST['prenom'])); + $nom = htmlentities(pg_escape_string ($_POST['nom'])); + $dateN = htmlentities(pg_escape_string ($_POST['dateN'])); + $mail = htmlentities(pg_escape_string ($_POST['mail_field'])); + $phone = htmlentities(pg_escape_string ($_POST['phone'])); + + if(!isMailUnique($db, $mail)){ + header('Location: inscription.php?error=1'); + } + elseif(!isLoginUnique($db, $mail)){ + header('Location: inscription.php?error=2'); + } + else{ + $result = creerUtilisateur($db, $mail, $password, $prenom, $nom, $login, $phone, $dateN); + if($result){ + header('Location: index.php'); + } + else{ + header('Location: inscription.php?error=3'); + } + } + + } + } + else{ + header('Location: tableauBord/tableauBord.php'); + } +} + +?> + + + + + + + + + Inscription + + + +
+

Inscription

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + +
+

Si vous avez déjà un compte cliquez ici.

+
+ + \ No newline at end of file diff --git a/WEB/tableauBord/tableauBord.css b/WEB/tableauBord/tableauBord.css new file mode 100644 index 0000000..e80738b --- /dev/null +++ b/WEB/tableauBord/tableauBord.css @@ -0,0 +1,49 @@ +*{ + margin: 0; + padding: 0; + font-family: "Calibri Light"; +} + +#content{ + margin-top: 8vh; + background-color: aqua; + margin-left: 50vw; + border-radius: 10px; + padding: 4em; + width: 84%; + transform: translate(-50%); +} + +.menu { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + background-color: rgb(65, 154, 28); +} + +.menuItem { + color: white; + width: 10%; + min-width: 5em; + font-weight: bold; + text-decoration: none; + padding: 0.8em; + border-bottom: 4px solid rgb(65, 154, 28); + font-size: 1.1em; + text-align: center; +} + +.menuItem:hover{ + cursor: pointer; + border-bottom: 4px solid orange; +} + +#imgProfil{ + margin-top: 30px; + margin-left: 50%; + transform: translate(-50%); + max-width: 300px; + max-height: 300px; + border-radius: 10px; +} \ No newline at end of file diff --git a/WEB/tableauBord/tableauBord.js b/WEB/tableauBord/tableauBord.js new file mode 100644 index 0000000..75c631a --- /dev/null +++ b/WEB/tableauBord/tableauBord.js @@ -0,0 +1,10 @@ +window.onload = init; + +function init(){ + let button = document.getElementById('btnDeco'); + button.onclick = deconnexion; +} + +function deconnexion() { + document.getElementById('formDeco').submit(); +} \ No newline at end of file diff --git a/WEB/tableauBord/tableauBord.php b/WEB/tableauBord/tableauBord.php new file mode 100644 index 0000000..c22ff6b --- /dev/null +++ b/WEB/tableauBord/tableauBord.php @@ -0,0 +1,71 @@ + + + + + + + + Tableau de bord + + + + +
+

Bonjour +

+
+ +
+
+ + \ No newline at end of file diff --git a/WEB/wallpaper.jpg b/WEB/wallpaper.jpg new file mode 100644 index 0000000..4ef0920 Binary files /dev/null and b/WEB/wallpaper.jpg differ diff --git a/plannings/plannification_10-04-19_G1_E.mpp b/plannings/plannification_10-04-19_G1_E.mpp index 52b0973..8a471e9 100644 Binary files a/plannings/plannification_10-04-19_G1_E.mpp and b/plannings/plannification_10-04-19_G1_E.mpp differ