diff -urN cahier-de-prepa4.1.2/admin/cdt.php cahier-de-prepa4.1.3/admin/cdt.php
--- cahier-de-prepa4.1.2/admin/cdt.php	2014-08-27 02:21:43.109465991 +0200
+++ cahier-de-prepa4.1.3/admin/cdt.php	2015-02-26 00:51:56.246977011 +0100
@@ -66,11 +66,10 @@
   if ( isset($_REQUEST['n']) && is_numeric($n = $_REQUEST['n']) )
     while ( !in_array($n,$sid) )
       $n = ( $n < $ntotal ) ? $n+1 : 1;
-  // Sans argument, on souhaite afficher la semaine actuelle
+  // Sans argument, on souhaite afficher la dernière semaine de cours passée
   else {
     $date = ( isset($_REQUEST['date']) && preg_match('/\d{4}-\d{2}-\d{2}/',$_REQUEST['date']) ) ? '\''.trim($_REQUEST['date'],'\'').'\'' : 'NOW()';
-    $resultat = $mysqli->query("SELECT IF(vacances,(SELECT id FROM semaines WHERE debut > $date AND vacances = 0 LIMIT 1),id) AS id
-                                FROM semaines WHERE debut < $date ORDER BY debut DESC LIMIT 1");
+    $resultat = $mysqli->query("SELECT id FROM semaines WHERE $date > debut AND vacances = 0 ORDER BY debut DESC LIMIT 1");
     if ( $resultat->num_rows )  {
       $r = $resultat->fetch_assoc();
       $n = $r['id'];
diff -urN cahier-de-prepa4.1.2/admin/colles.php cahier-de-prepa4.1.3/admin/colles.php
--- cahier-de-prepa4.1.2/admin/colles.php	2014-08-26 10:21:56.059623198 +0200
+++ cahier-de-prepa4.1.3/admin/colles.php	2015-02-26 00:45:11.781356947 +0100
@@ -62,11 +62,10 @@
 if ( isset($_REQUEST['n']) && is_numeric($n = $_REQUEST['n']) )
   while ( !in_array($n,$sid) )
     $n = ( $n < count($sid) ) ? $n+1 : 1;
-// Sans argument, on souhaite afficher le programme de colles de la semaine actuelle
+// Sans argument, on souhaite afficher le programme de colles de la semaine actuelle, jusqu'au mercredi inclus
 else {
   $date = ( isset($_REQUEST['date']) && preg_match('/\d{4}-\d{2}-\d{2}/',$_REQUEST['date']) ) ? '\''.trim($_REQUEST['date'],'\'').'\'' : 'NOW()';
-  $resultat = $mysqli->query("SELECT IF(vacances,(SELECT id FROM semaines WHERE debut > ADDDATE($date,3) AND vacances = 0 LIMIT 1),id) AS id
-                              FROM semaines WHERE debut < ADDDATE($date,3) ORDER BY debut DESC LIMIT 1");
+  $resultat = $mysqli->query("SELECT id FROM semaines WHERE $date < ADDDATE(debut,5-DAYOFWEEK(debut)) AND vacances = 0 LIMIT 1");
   if ( $resultat->num_rows )  {
     $r = $resultat->fetch_assoc();
     $n = $r['id'];
diff -urN cahier-de-prepa4.1.2/admin/download.php cahier-de-prepa4.1.3/admin/download.php
--- cahier-de-prepa4.1.2/admin/download.php	2014-08-04 17:59:12.243675325 +0200
+++ cahier-de-prepa4.1.3/admin/download.php	2015-02-25 23:40:12.697223570 +0100
@@ -15,10 +15,12 @@
     $resultat->free();
     $mysqli->close();
 
-    // Définition du type de fichier (entête HTML à envoyer)
+    // Définition du type de fichier et du type d'attachement (entête HTML à envoyer)
+    $attachment = 'attachment';
     switch ( $f['ext'] )  {
       case '.pdf':
         $type = 'application/pdf';
+        $attachment = 'inline';
         break;
       case '.doc':
         $type = 'application/msword';
@@ -138,7 +140,7 @@
 
     // Mise à disposition du fichier
     header("Content-Type: $type");
-    header('Content-Disposition: attachment; filename="'.rawurlencode($f['nom']).$f['ext'].'"');
+    header("Content-Disposition: $attachment; filename=\"".rawurlencode($f['nom']).$f['ext'].'"');
     header("Location: ../documents/${f['lien']}/".rawurlencode($f['nom']).$f['ext']);
   }
   else  {
diff -urN cahier-de-prepa4.1.2/cdt.php cahier-de-prepa4.1.3/cdt.php
--- cahier-de-prepa4.1.2/cdt.php	2014-09-21 00:04:50.774323462 +0200
+++ cahier-de-prepa4.1.3/cdt.php	2015-02-26 00:50:12.352631739 +0100
@@ -92,11 +92,10 @@
   if ( isset($_REQUEST['n']) && is_numeric($n = $_REQUEST['n']) )
     while ( !in_array($n,$sid) )
       $n = ( $n < $ntotal ) ? $n+1 : 1;
-  // Sans argument, on souhaite afficher la semaine actuelle
+  // Sans argument, on souhaite afficher la dernière semaine de cours passée
   else {
     $date = ( isset($_REQUEST['date']) && preg_match('/\d{4}-\d{2}-\d{2}/',$_REQUEST['date']) ) ? '\''.trim($_REQUEST['date'],'\'').'\'' : 'NOW()';
-    $resultat = $mysqli->query("SELECT IF(vacances,(SELECT id FROM semaines WHERE debut > $date AND vacances = 0 LIMIT 1),id) AS id
-                                FROM semaines WHERE debut < $date ORDER BY debut DESC LIMIT 1");
+    $resultat = $mysqli->query("SELECT id FROM semaines WHERE $date > debut AND vacances = 0 ORDER BY debut DESC LIMIT 1");
     if ( $resultat->num_rows )  {
       $r = $resultat->fetch_assoc();
       $n = $r['id'];
diff -urN cahier-de-prepa4.1.2/CHANGELOG.php cahier-de-prepa4.1.3/CHANGELOG.php
--- cahier-de-prepa4.1.2/CHANGELOG.php	2014-12-26 00:31:51.739574341 +0100
+++ cahier-de-prepa4.1.3/CHANGELOG.php	2015-07-11 15:58:41.212483270 +0200
@@ -1,4 +1,4 @@
-Version actuelle : 4.1.2 (27/12/14)
+Version actuelle : 4.1.3 (26/02/15)
 ===================
 Changements :
 1.0   31/08/11 Première version
@@ -148,6 +148,7 @@
   * Correction d'une faille de sécurité XSS dans le nom/prénom/login
 4.1.1 24/10/14 Correction d'un bug sur la modifications des préférences d'élèves
 4.1.2 27/12/14 Corrections de bugs multiples (merci A. Lenormand)
+4.1.3 26/02/15 Affichage des pdf en ligne, correction de bug (merci A. Tétar)
 ===================
 
 Todo :
@@ -172,3 +173,9 @@
   * Paramétrage des styles pour les titres, des couleurs
   * Copié/collé depuis Word
   * Tags dans les cahiers de texte
+  * Ajout multiple d'utilisateurs
+  * Possibilité de restreindre l'accès des élèves à certaines matières
+  * Possibilité de suspendre la création de nouveau compte
+  * Impression du cahier de texte mise en avant ?
+  * Visualisation des pdf en live avec pdf.js -> propriété de document
+  * Modification sans rechargement en ajax
diff -urN cahier-de-prepa4.1.2/colles.php cahier-de-prepa4.1.3/colles.php
--- cahier-de-prepa4.1.2/colles.php	2014-09-21 00:13:38.042340335 +0200
+++ cahier-de-prepa4.1.3/colles.php	2015-02-26 00:45:19.625234885 +0100
@@ -79,17 +79,16 @@
 if ( isset($_REQUEST['n']) && is_numeric($n = $_REQUEST['n']) )
   while ( !in_array($n,$sid) )
     $n = ( $n < count($sid) ) ? $n+1 : 1;
-// Sans argument, on souhaite afficher le programme de colles de la semaine actuelle
+// Sans argument, on souhaite afficher le programme de colles de la semaine actuelle, jusqu'au samedi inclus
 else {
   $date = ( isset($_REQUEST['date']) && preg_match('/\d{4}-\d{2}-\d{2}/',$_REQUEST['date']) ) ? '\''.trim($_REQUEST['date'],'\'').'\'' : 'NOW()';
-  $resultat = $mysqli->query("SELECT IF(vacances,(SELECT id FROM semaines WHERE debut > ADDDATE($date,3) AND vacances = 0 LIMIT 1),id) AS id
-                              FROM semaines WHERE debut < ADDDATE($date,3) ORDER BY debut DESC LIMIT 1");
+  $resultat = $mysqli->query("SELECT id FROM semaines WHERE $date < ADDDATE(debut,7-DAYOFWEEK(debut)) AND vacances = 0 LIMIT 1");
   if ( $resultat->num_rows )  {
     $r = $resultat->fetch_assoc();
     $n = $r['id'];
     $resultat->free();
   }
-  // Aucun résultat : l'année n'a pas encore commencé
+  // Aucun résultat : l'année est terminée
   else
     $n = 0;
 }
@@ -191,7 +190,7 @@
   echo $nav;
 }
 else
-  echo "  <h2>L'année n'a pas encore commencé... Revenez à la rentrée&nbsp;!</h2>\n\n";
+  echo "  <h2>L'année est terminée... Bonnes vacances&nbsp;!</h2>\n\n";
 $mysqli->close();
 
 // Bas de page
diff -urN cahier-de-prepa4.1.2/download.php cahier-de-prepa4.1.3/download.php
--- cahier-de-prepa4.1.2/download.php	2014-10-18 22:07:46.771513392 +0200
+++ cahier-de-prepa4.1.3/download.php	2015-03-08 22:25:11.462866530 +0100
@@ -34,10 +34,13 @@
     }
     $mysqli->close();
 
-    // Définition du type de fichier (entête HTML à envoyer)
+
+    // Définition du type de fichier et du type d'attachement (entête HTML à envoyer)
+    $attachment = 'attachment';
     switch ( $f['ext'] )  {
       case '.pdf':
         $type = 'application/pdf';
+        $attachment = 'inline';
         break;
       case '.doc':
         $type = 'application/msword';
@@ -151,13 +154,16 @@
       case '.py':
         $type = 'text/x-python';
         break;
+      case '.swf':
+	$type = 'application/x-shockwave-flash';
+        $attachment = 'inline';
       default :
         $type = 'application/octet-stream';
     }
 
     // Mise à disposition du fichier
     header("Content-Type: $type");
-    header('Content-Disposition: attachment; filename="'.rawurlencode($f['nom']).$f['ext'].'"');
+    header("Content-Disposition: $attachment; filename=\"".rawurlencode($f['nom']).$f['ext'].'"');
     header("Location: documents/${f['lien']}/".rawurlencode($f['nom']).$f['ext']);
   }
   else
