Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

ajout de la lib Encoding et mise en place de la class caracter du projet VLAN

FIXME: appel curl ou fopen d'une methode http depuis une action ou un controlleur.

TODO: sécuriser les accès HTTP1.1 par un fichier config similaire a l'applet Discourse faite pour Tinternet

TODO: ajouter un plug-in symfony permettant de charger un utilisateur dans les apps a partir de l'authentification multiple

TODO: lire les documentation officielles provenant des 4 plate-formes tranquillement afin de comprendre commet doit on tester ces type d'auth quitte a créé un sous domaine particulier directement hebergé sur gittea
-->Sécuriser le serveur de dev

Emmanuel ROY authored on 04/12/2019 15:52:04
Showing 1 changed files
... ...
@@ -11,12 +11,12 @@ class Bdd
11 11
         switch($bdd) {
12 12
             case 'bdd1':
13 13
                 $this->bdd = new PDO(DSN_BDD1, USER_BDD1, PASS_BDD1);
14
-            break;
14
+                break;
15 15
             case 'bdd2':
16 16
                 $this->bdd = new PDO(DSN_BDD2, USER_BDD2, PASS_BDD2);
17
-            break;
17
+                break;
18 18
             default:
19
-                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
19
+                $this->bdd = new PDO(DSN_BDD_DEFAULT, USER_BDD_DEFAULT, PASS_BDD_DEFAULT);
20 20
         }
21 21
     }
22 22
 
... ...
@@ -30,6 +30,9 @@ class Bdd
30 30
 
31 31
         $tab = array();
32 32
         foreach($res as $key => $row){
33
+            if (is_string($row)) {
34
+                $row = Caracter::normalise_ChaineDeCaracteresDownload($row);
35
+            }
33 36
             $tab[$key] = $row;
34 37
         }
35 38
         return $tab;
Browse code

initial commmit de la branche Nude with composer

git authored on 14/03/2019 16:48:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+<?php
2
+
3
+namespace MVC\Classe;
4
+
5
+class Bdd
6
+{
7
+    public $bdd;
8
+
9
+    public function __construct($bdd = 'bdd1')
10
+    {
11
+        switch($bdd) {
12
+            case 'bdd1':
13
+                $this->bdd = new PDO(DSN_BDD1, USER_BDD1, PASS_BDD1);
14
+            break;
15
+            case 'bdd2':
16
+                $this->bdd = new PDO(DSN_BDD2, USER_BDD2, PASS_BDD2);
17
+            break;
18
+            default:
19
+                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
20
+        }
21
+    }
22
+
23
+    public function faireUneRequete($sql)
24
+    {
25
+        $req = $this->bdd->query($sql, PDO::FETCH_ASSOC);
26
+        return $req;
27
+    }
28
+
29
+    public function creerTableau($res){
30
+
31
+        $tab = array();
32
+        foreach($res as $key => $row){
33
+            $tab[$key] = $row;
34
+        }
35
+        return $tab;
36
+    }
37
+}
0 38
\ No newline at end of file