{"action":"created","issue":{"url":"https://api.github.com/repos/AlternC/AlternC/issues/149","repository_url":"https://api.github.com/repos/AlternC/AlternC","labels_url":"https://api.github.com/repos/AlternC/AlternC/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/AlternC/AlternC/issues/149/comments","events_url":"https://api.github.com/repos/AlternC/AlternC/issues/149/events","html_url":"https://github.com/AlternC/AlternC/issues/149","id":218541356,"number":149,"title":"piwik 3.0 ne fonctionne plus avec AlternC","user":{"login":"quenenni","id":3638408,"avatar_url":"https://avatars0.githubusercontent.com/u/3638408?v=3","gravatar_id":"","url":"https://api.github.com/users/quenenni","html_url":"https://github.com/quenenni","followers_url":"https://api.github.com/users/quenenni/followers","following_url":"https://api.github.com/users/quenenni/following{/other_user}","gists_url":"https://api.github.com/users/quenenni/gists{/gist_id}","starred_url":"https://api.github.com/users/quenenni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quenenni/subscriptions","organizations_url":"https://api.github.com/users/quenenni/orgs","repos_url":"https://api.github.com/users/quenenni/repos","events_url":"https://api.github.com/users/quenenni/events{/privacy}","received_events_url":"https://api.github.com/users/quenenni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-31T15:45:45Z","updated_at":"2017-06-09T12:09:33Z","closed_at":null,"body":"Bonjour,\r\n\r\nJe viens vers vous pour comprendre qu'elle est la meilleure piste à suivre pour résoudre ce problème.\r\n\r\nOn a mis à jour notre serveur piwik vers la version 3.0 et depuis lors, les connexions vers piwik (créer un utilisateur, un site, se connecter à piwik depuis AlternC) ne fonctionne plus.\r\n\r\nL'erreur qu'on a en arrivant sur la page de piwik depuis AlternC est:\r\n\"The password parameter is expected to be a MD5 hash of the password\"\r\n\r\nIls ont fait des changements au niveau du format du mdp lors des appels à piwik, et il leur faut maintenant le format md5 du mdp, ce que AlternC ne peut pas connaître car il ne garde pas le format en clair ou md5.\r\n\r\nJe peux patcher AlternC pour que ça refonctionne (créer un nouvelle table piwik_mdp dans lequel je garde le format md5 du mdp et que je peux ré-utiliser lors des appels), mais avant de me lancer dans ça, j'aimerais savoir si vous n'avez pas de meilleures pistes.\r\n\r\nEt surtout, ce que j'aimerais comprendre, c'est pourquoi la communauté piwik a décidé d'utiliser le chiffrage par md5 qui n'est plus considéré comme sécurisé depuis longtemps.\r\nJ'ai l'impression de ne pas comprendre qqch..\r\n\r\nLien vers la discussion chez Piwik qui parle de ce changement:\r\nhttps://github.com/piwik/piwik/issues/11094  (en anglais)\r\nLien vers la faq:\r\nhttps://piwik.org/faq/how-to/faq_30/\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/AlternC/AlternC/issues/comments/307372053","html_url":"https://github.com/AlternC/AlternC/issues/149#issuecomment-307372053","issue_url":"https://api.github.com/repos/AlternC/AlternC/issues/149","id":307372053,"user":{"login":"quenenni","id":3638408,"avatar_url":"https://avatars0.githubusercontent.com/u/3638408?v=3","gravatar_id":"","url":"https://api.github.com/users/quenenni","html_url":"https://github.com/quenenni","followers_url":"https://api.github.com/users/quenenni/followers","following_url":"https://api.github.com/users/quenenni/following{/other_user}","gists_url":"https://api.github.com/users/quenenni/gists{/gist_id}","starred_url":"https://api.github.com/users/quenenni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quenenni/subscriptions","organizations_url":"https://api.github.com/users/quenenni/orgs","repos_url":"https://api.github.com/users/quenenni/repos","events_url":"https://api.github.com/users/quenenni/events{/privacy}","received_events_url":"https://api.github.com/users/quenenni/received_events","type":"User","site_admin":false},"created_at":"2017-06-09T12:09:33Z","updated_at":"2017-06-09T12:09:33Z","body":"Voici toutes mes modifs faites pour faire fonctioner alternc et piwik 3.x + qqes améliorations d'utilisation & graphiques:\r\n\r\n- Fichier admin/piwik_addaccount.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_addaccount.php   2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_addaccount.php  2017-06-09 13:06:22.955838392 +0200\r\n@@ -51,21 +51,16 @@\r\n <hr id=\"topbar\"/>\r\n <br />\r\n <?php\r\n-$infos = $piwik->user_add($account_name);\r\n-if (!$infos)\r\n-{\r\n-    $error = $err->errstr();\r\n-    //if (isset($error) && $error) {\r\n-    echo \"<p class=\\\"alert alert-danger\\\">$error</p>\";\r\n-    if (isset($fatal) && $fatal) {\r\n-      include_once(\"foot.php\");\r\n-      exit();\r\n-    }\r\n+if (empty($account_name)) {\r\n+  $error=(\"Error: missing arguments.\");\r\n+} elseif (! $piwik->user_add($account_name) ) {\r\n+  $error = $err->errstr();\r\n+} else {\r\n+  $error=_('Successfully added piwik user');\r\n+  // Ajout de cette variable ré-utilisée plus tard pour que l'affichage de succès\r\n+  // soit correctement affiché (pas en rouge avec un icône d'alerte)\r\n+  // Testée / Utilisée dans admin/piwik_userlist.php\r\n+  $bln_success=true;\r\n }\r\n-else\r\n-{\r\n-       printf(\"%s %s\\n\", _('Successfully added piwik user'), $account_name);\r\n-}\r\n-\r\n-include_once(\"foot.php\"); \r\n+include_once(\"piwik_userlist.php\");\r\n```\r\n\r\n- Fichier admin/piwik_addsites.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_addsites.php     2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_addsites.php    2017-06-08 15:30:43.513501550 +0200\r\n@@ -44,6 +44,10 @@\r\n   $error=_(\"Error while adding website.<br/>\".$err->errstr());\r\n } else {\r\n   $error=_(\"Website added Successfully\");\r\n+  // Ajout de cette variable ré-utilisée plus tard pour que l'affichage de succès\r\n+  // soit correctement affiché (pas en rouge avec un icône d'alerte)\r\n+  // Testée / utilisée dans admin/piwik_sitelist.php\r\n+  $bln_success=true;\r\n }\r\n include_once(\"piwik_sitelist.php\");\r\n```\r\n\r\n- Fichier admin/piwik_site_dodel.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_site_dodel.php   2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_site_dodel.php  2017-06-08 15:28:47.944885845 +0200\r\n@@ -47,7 +47,10 @@\r\n     $error=$err->errstr();\r\n   } else {\r\n     include_once('head.php');\r\n+    // Ajout de style au message de succès lorsqu'on efface un site\r\n+    echo \"<p class=\\\"alert alert-success\\\">\";\r\n     __(\"Site successfully deleted\");\r\n+    echo \"</p>\";\r\n   }\r\n \r\n   include('piwik_sitelist.php'); \r\n```\r\n\r\n- Fichier admin/piwik_sitelist.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_sitelist.php     2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_sitelist.php    2017-06-09 13:16:18.370578873 +0200\r\n@@ -69,7 +69,12 @@\r\n\r\n /* If something went wrong, display error message, but continue with the page rendering */\r\n if (isset($error) && $error) {\r\n-       echo \"<p class=\\\"alert alert-danger\\\">$error</p>\";\r\n+       // Changé le style pour quand le msg \"d'erreur\" est un msg de succès\r\n+        // $bln_success est défini dans le fichier admin/piwik_addsites.php\r\n+        if ($bln_success)\r\n+          echo \"<p class=\\\"alert alert-success\\\">$error</p>\";\r\n+        else\r\n+          echo \"<p class=\\\"alert alert-danger\\\">$error</p>\";\r\n }\r\n\r\n /* Does current user still has quota ? */\r\n@@ -118,18 +123,43 @@\r\n ?>\r\n\r\n <table class=\"tlist\">\r\n-    <tr><th/><th><?php __(\"Site name\");?></th><th align=center><?php __(\"Site url\"); ?></th><th>Javascript Code</th></tr>\r\n+    <tr><th/><th><?php __(\"Site name\");?></th><th align=center><?php __(\"Site url\"); ?></th><th>Javascript Code</th><th>Interface</th></tr>\r\n <?php\r\n\r\n+// Rajout de cet appel afin de pouvoir placer le bouton connect à côté de chaque site.\r\n+foreach ($sitelist as $site ){\r\n+        foreach ($site->rights as $k => $v) {\r\n+           $piwik_login = $k;\r\n+           break;\r\n+        }\r\n+        unset($piwik_pwd);\r\n+        $db->query(\"SELECT mdp FROM piwik_mdp as mdp INNER JOIN piwik_users as users ON mdp.piwik_id = users.id WHERE users.login = '$piwik_login'\");\r\n+        if ($db->next_record()) {\r\n+          $piwik_pwd = $db->f('mdp');\r\n+        }\r\n+        break;\r\n+}\r\n+\r\n $col=1;\r\n foreach ($sitelist as $site ){\r\n        $col=3-$col;\r\n        ?>\r\n        <tr class=\"lst_clic<?php echo $col; ?>\">\r\n           <td><div class=\"ina\"><a href=\"/piwik_site_dodel.php?siteid=<?php echo $site->id; ?>\"><img src=\"images/delete.png\" alt=\"<?php __(\"Delete\"); ?>\" /><?php __(\"Delete\"); ?></a></div></td>\r\n-          <td align=right><?php echo $site->name ?></td>\r\n+          <td><?php echo $site->name ?></td>\r\n            <td><?php echo $site->main_url ?></td>\r\n           <td><textarea><?php echo $piwik->site_js_tag($site->id); ?></textarea></td>\r\n+          <td>\r\n+            <?php\r\n+            if ($piwik_pwd) {\r\n+            ?>\r\n+              <div class=\"ina\"><a href=\"<?php printf('%s?module=Login&action=logme&login=%s&password=%s&idSite=%s', $piwik->url(), $piwik_login, $piwik_pwd, $site->id); ?>\" target=\"_blank\"><?php __('Connect'); ?></a>\r\n+            <?php\r\n+            } else {\r\n+            ?>\r\n+              <div class=\"ina\"><img src=\"images/warning.png\" onmouseover='$(\"#alert_div_msg\").show();' onmouseout='$(\"#alert_div_msg\").hide();'></div>\r\n+            <?php } ?>\r\n+          </td>\r\n        </tr>\r\n        <?php\r\n } // foreach sitelist\r\n@@ -144,7 +174,10 @@\r\n ?>\r\n </table>\r\n \r\n-\r\n-<h3><?php __(\"Credentials management\"); ?></h3>\r\n-\r\n-<form method=\"get\">\r\n-<select name=\"site_id\">\r\n-\r\n-<?php\r\n-       foreach ($sitelist as $site)\r\n-               printf ('<option value=\"%d\"%s>%s</option>', $site->id, ($site->id == $site_id) ? ' selected ' : '', $site->name);\r\n-?>\r\n-\r\n-</select>&nbsp;\r\n-<input type=\"submit\" class=\"inb\" value=\"ok\" /> \r\n-</form>\r\n-\r\n+<!--\r\n+// Désactivé le \"Credentials management car ça n'a pas de sens.\r\n+// On ne peut pas créer plusieurs comptes car alternC essaie d'enregistrer chaque compte piwik avec la même adresse mail,\r\n+// celle du compte alternc, et piwik refuse ça.\r\n+-->\r\n <?php\r\n-       // If a site was selected\r\n-       if ($site_id != -1 && in_array($site_id, $piwik_alternc_sites)) {\r\n-               echo '<form method=\"post\">';\r\n-               csrf_get();\r\n-               echo '<dl>';\r\n-               foreach ($piwik->get_users_access_from_site($site_id) AS $piwik_user => $cred) {\r\n-                       printf(\"<dt>%s:</dt>\\n\\t<dd>%s</dd>\\n\", $piwik_user, piwik_right_widget('right', $piwik_user, $cred));\r\n-               }\r\n-               echo '</dl>';\r\n-               echo '<input type=\"submit\" name=\"valid\" class=\"inb\" value=\"' , _(\"submit\"), '\" />';\r\n-               echo '</form>';\r\n-       }\r\n } // empty userlist\r\n ?>\r\n```\r\n- Fichier admin/piwik_user_dodel.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_user_dodel.php   2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_user_dodel.php  2017-06-08 15:26:07.540029724 +0200\r\n@@ -42,11 +42,18 @@\r\n } \r\n \r\n if(!empty($confirm_del)) {\r\n-  if (! $piwik->user_delete($login) ) {\r\n+  // Ajout de l'appel à la fonction qui check si ce compte piwik a encore des sites associés\r\n+  // et on accepte d'effacer l'utilisateur que s'il n'en a plus\r\n+  if ($piwik->user_has_sites()) {\r\n+    $error=\"Vous devez d'abord effacer tous les sites piwik associés à cet utilisateur avant de pouvoir l'effacer\";\r\n+  } else if (! $piwik->user_delete($login) ) {\r\n     $error=$err->errstr();\r\n   } else {\r\n     include_once('head.php');\r\n+    // Ajout de style pour le msg de succès\r\n+    echo \"<p class=\\\"alert alert-success\\\">\";\r\n     printf(\"Utilisateur %s supprimé avec succès\\n\", $login);\r\n+    echo \"</p>\";\r\n   }\r\n \r\n   include('piwik_userlist.php');\r\n```\r\n- Fichier admin_piwik_userlist.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/admin/piwik_userlist.php     2017-06-07 16:42:50.000000000 +0200\r\n+++ admin/piwik_userlist.php    2017-06-09 13:39:39.889040132 +0200\r\n@@ -31,45 +31,42 @@\r\n include_once(\"head.php\");\r\n\r\n if (isset($error) && $error) {\r\n-       echo \"<p class=\\\"alert alert-danger\\\">$error</p>\";\r\n+        // Changé le style pour quand le msg \"d'erreur\" est un msg de succès\r\n+        // $bln_success est défini dans le fichier admin/piwik_addaccount.php\r\n+        if ($bln_success)\r\n+          echo \"<p class=\\\"alert alert-success\\\">$error</p>\";\r\n+        else\r\n+          echo \"<p class=\\\"alert alert-danger\\\">$error</p>\";\r\n }\r\n\r\n+// Déplacé cette varable ici car j'en ai besoin plus tôt\r\n+$userslist = $piwik->users_list();\r\n+\r\n //Mail creation.\r\n if ($quota->cancreate(\"piwik\")) {\r\n       $quotapiwik=$quota->getquota('piwik');\r\n+  if (empty($userslist)){\r\n ?>\r\n <h3><?php __(\"Create a new piwik account\");?></h3>   \r\n <form method=\"post\" action=\"piwik_addaccount.php\" id=\"main\" name=\"addaccount\" >\r\n  <?php csrf_get(); ?>\r\n-       <input type=\"text\" class=\"int\" name=\"account_name\" size=\"20\" id=\"account_name\" maxlength=\"32\" value=\"<?php if ($quotapiwik['u']==0) {echo $mem->user[\"login\"];}?>\"/>\r\n+        <input type=\"text\" class=\"int\" name=\"account_name\" size=\"20\" id=\"account_name\" maxlength=\"32\" value=\"<?php echo $mem->user[\"login\"];?>\"/>\r\n        <input type=\"submit\" name=\"submit\" class=\"inb\" value=\"<?php __(\"Create\"); ?>\" />\r\n </form>\r\n\r\n <br/>\r\n <hr/>\r\n <?php\r\n+  }\r\n\r\n-if ($quotapiwik['u']>0) {\r\n-?>\r\n-<h3><?php __(\"Add a new website\");?></h3>\r\n-<form method=\"post\" action=\"piwik_addsites.php\" id=\"main\" name=\"addsites\" >\r\n-<?php csrf_get(); ?>\r\n-       <input type=\"text\" class=\"int\" name=\"site_urls\" size=\"50\" id=\"site_name\" maxlength=\"255\" value=\"\" placeholder=\"<?php __(\"URL of the website\")?>\"/>\r\n-       <input type=\"submit\" name=\"submit\" class=\"inb\" value=\"<?php __(\"Create\"); ?>\" />\r\n-</form>\r\n-\r\n-<br/>\r\n-<hr/>\r\n-<?php\r\n-} // quota > 0\r\n+// Désactivé l'affichage de la création d'un site piwik dans la page de gestion des comptes piwik car ça embrouille\r\n } // cancreate piwik\r\n ?>\r\n\r\n <h3><?php __(\"Existing Piwik accounts\"); ?></h3>\r\n <?php\r\n\r\n-$userslist = $piwik->users_list();\r\n-\r\n // printVar($piwik->dev());\r\n\r\n if (empty($userslist)){\r\n@@ -83,12 +80,28 @@\r\n\r\n $col=1;\r\n foreach ($userslist as $user ){\r\n+       unset($piwik_pwd);\r\n+        $db->query(\"SELECT mdp FROM piwik_mdp as mdp INNER JOIN piwik_users as users ON mdp.piwik_id = users.id WHERE users.login = '$user->login'\");\r\n+        if ($db->next_record()) {\r\n+          $piwik_pwd = $db->f('mdp');\r\n+        }\r\n+\r\n        $col=3-$col;\r\n        ?>\r\n        <tr class=\"lst_clic<?php echo $col; ?>\">\r\n                <td><div class=\"ina\"><a href=\"piwik_user_dodel.php?login=<?php echo urlencode($user->login); ?>\"><img src=\"images/delete.png\" alt=\"<?php __(\"Delete\"); ?>\" /><?php __(\"Delete\"); ?></a></div></td>\r\n-       <td align=right><?php echo $user->login ?></td>\r\n-          <td><div class=\"ina\"><a href=\"<?php printf('%s?module=Login&action=logme&login=%s&password=%s', $piwik->url(), $user->login, $user->password); ?>\" target=\"_blank\"><?php __('Connect'); ?></a></td>\r\n+       <td><?php echo $user->login ?></td>\r\n+          <td>\r\n+            <?php\r\n+            if ($piwik_pwd) {\r\n+            ?>\r\n+              <div class=\"ina\"><a href=\"<?php printf('%s?module=Login&action=logme&login=%s&password=%s', $piwik->url(), $user->login, $piwik_pwd); ?>\" target=\"_blank\"><?php __('Connect'); ?></a>\r\n+            <?php\r\n+            } else {\r\n+            ?>\r\n+              <div class=\"ina\"><img src=\"images/warning.png\" onmouseover='$(\"#alert_div_msg\").show();' onmouseout='$(\"#alert_div_msg\").hide();'></div>\r\n+            <?php } ?>\r\n+          </td>\r\n        </tr>\r\n        <?php\r\n } // foreach userlist\r\n@@ -96,4 +109,9 @@\r\n ?>\r\n\r\n </table>\r\n+<div class=\"ina\" id=\"alert_div_msg\" style=\"display:none;background-color:yellow;padding:5px;border:2px solid black;margin-top:3em;\";>\r\n+  Une erreur s'est produite qui empêche de vous proposer l'accès à l'intereface de piwik.\r\n+  <br>\r\n+  Veuillez contacter les administrateurs de XXX\r\n+</div>\r\n <?php include_once(\"foot.php\"); ?>\r\n```\r\n- Fichier class/m_piwik.php\r\n```\r\n--- alternc_modified/usr/share/alternc/panel/class/m_piwik.php    2017-06-07 16:42:50.000000000 +0200\r\n+++ class/m_piwik.php   2017-06-08 16:31:51.006225085 +0200\r\n@@ -110,8 +110,17 @@\r\n          if ($api_data->result === 'success') {\r\n            $user = $this->get_user($user_login);\r\n            $user_creation_date = $user->date_registered;\r\n-           return $db->query(\"INSERT INTO piwik_users (uid, login, created_date) VALUES ( ?, ?, ?,);\", array($cuid, $user_login, $user_creation_date));\r\n+           // Ajout de l'insertion du mdp dans la table piwik_mdp\r\n+           $ret_value = $db->query(\"INSERT INTO piwik_users (uid, login, created_date) VALUES ( ?, ?, ?,);\", array($cuid, $user_login, $user_creation_date));\r\n+\r\n+            if ($ret_value) {\r\n+              $piwik_id = $db->lastid();\r\n+              $ret_value = $db->query(\"INSERT INTO piwik_mdp (piwik_id, mdp) VALUES ('$piwik_id', md5('$user_pass'))\");\r\n+            }\r\n+           return $ret_value;\r\n          }\r\n+         return FALSE;\r\n        } else { // api_data = false -> error is already filled\r\n          return FALSE;\r\n        } \r\n@@ -175,6 +184,18 @@\r\n\r\n        return $alternc_users;\r\n   }\r\n+\r\n+  // Regarde si l'utilisateur a des sites piwik configurés dans AlternC\r\n+  function user_has_sites() {\r\n+    global $db, $cuid, $err;\r\n+\r\n+    $db->query(\"SELECT id FROM piwik_sites WHERE uid='$cuid'\");\r\n+    if ($db->num_rows() > 0)\r\n+      return true;\r\n+\r\n+    return false;\r\n+  }\r\n+\r\n   // Supprime l'utilisateur Piwik passé en parametre \r\n   // Ne le supprime pas localement tant que pas supprimé en remote\r\n   function user_delete($piwik_user_login) {\r\n@@ -186,6 +207,8 @@\r\n     if ($db->f('cnt') == 1) {\r\n        $api_data = $this->call_privileged_page('API', 'UsersManager.deleteUser', array('userLogin' => $piwik_user_login));\r\n        if ($api_data->result == 'success') {\r\n+               // Quand on efface l'utilisateur, il faut aller aussi effacer le mdp associé au compte piwik\r\n+                $db->query(\"DELETE FROM piwik_mdp WHERE piwik_id IN (SELECT id FROM piwik_users WHERE uid= ? AND login= ? );\", array($cuid, $piwik_user_login));\r\n                return $db->query(\"DELETE FROM piwik_users WHERE uid= ? AND login= ? ;\", array($cuid, $piwik_user_login));\r\n        }\r\n        else {\r\n@@ -291,11 +314,32 @@\r\n   // Ajoute un site à Piwik\r\n   // can't figure out how to pass multiple url through the API\r\n   function site_add($siteName, $urls, $ecommerce = FALSE) {\r\n-    global $db, $cuid;\r\n+    global $db, $cuid, $piwik;\r\n     $urls = is_array($urls) ? implode(',', $urls) : $urls;\r\n     $api_data = $this->call_privileged_page('API', 'SitesManager.addSite', array('siteName' => $siteName, 'urls' => $urls));\r\n-    $db->query(\"INSERT INTO piwik_sites set uid= ? , piwik_id= ? \", array($cuid, $api_data->value));\r\n-    return TRUE;\r\n+\r\n+    // Modifié le reste de la fonction (et ai aussi rajouté la variable globale $piwik à la fonction)\r\n+\r\n+    if ($api_data->value) {\r\n+      $id_site = $api_data->value;\r\n+\r\n+      // Ajout de donner auto les droits de lecture à ce nouvel utilisateur pour le site qu'il a ajouté\r\n+      $userslist = $piwik->users_list();\r\n+      $api_data = $this->call_privileged_page('API', 'UsersManager.setUserAccess', array('userLogin' => $userslist[0]->login, 'idSites' => $id_site, 'access' => 'view'));\r\n+\r\n+      if ($api_data->result == 'success') {\r\n+        // On enregistre le site dans alternC\r\n+       $db->query(\"INSERT INTO piwik_sites set uid= ? , piwik_id= ? \", array($cuid, $id_site));\r\n+\r\n+        // Permet de prendre en compte le site qu'on vient de créer dans la page quis'affiche\r\n+        $this->alternc_sites = $this->get_alternc_sites();\r\n+        return TRUE;\r\n+      }\r\n+      return TRUE;\r\n+    } else\r\n+      return FALSE;\r\n   }\r\n```\r\n\r\n- Structure de la table piwik_mdp\r\n```\r\n--\r\n-- Host: 127.0.0.1\r\n-- Generation Time: Jun 09, 2017 at 02:00 PM\r\n-- Server version: 5.5.55-0+deb8u1\r\n-- PHP Version: 5.6.30-0+deb8u1\r\n\r\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\r\nSET time_zone = \"+00:00\";\r\n\r\n--\r\n-- Database: `alternc`\r\n--\r\n\r\n-- --------------------------------------------------------\r\n\r\n--\r\n-- Table structure for table `piwik_mdp`\r\n--\r\n\r\nCREATE TABLE IF NOT EXISTS `piwik_mdp` (\r\n`id` int(11) NOT NULL,\r\n  `piwik_id` int(11) NOT NULL,\r\n  `mdp` varchar(255) NOT NULL\r\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\r\n\r\n--\r\n-- Indexes for table `piwik_mdp`\r\n--\r\nALTER TABLE `piwik_mdp`\r\n ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uniq_user` (`mdp`);\r\n\r\n--\r\n-- AUTO_INCREMENT for table `piwik_mdp`\r\n--\r\nALTER TABLE `piwik_mdp`\r\nMODIFY `id` int(11) NOT NULL AUTO_INCREMENT;\r\n```"}}
{"actor":{"display_login":"quenenni"}}