Commit 7cda02e4 authored by Stephane Crozat's avatar Stephane Crozat
Browse files

Empêchement de la désinscription après validation par URL

parent 11ff9861
...@@ -50,7 +50,8 @@ class DB { ...@@ -50,7 +50,8 @@ class DB {
} }
public function unsubToApi($utclogin, $api) { public function unsubToApi($utclogin, $api) {
$sql = 'DELETE FROM subscribe WHERE utclogin=:utclogin AND api=:api'; /** Testing validation IS NULL prevent from unsubscribing to validated Api **/
$sql = 'DELETE FROM subscribe WHERE utclogin=:utclogin AND api=:api AND validation IS NULL';
$st = $this->conn->prepare($sql); $st = $this->conn->prepare($sql);
$st->bindValue(':utclogin',$utclogin,PDO::PARAM_STR); $st->bindValue(':utclogin',$utclogin,PDO::PARAM_STR);
$st->bindValue(':api',$api,PDO::PARAM_INT); $st->bindValue(':api',$api,PDO::PARAM_INT);
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