aboutsummaryrefslogtreecommitdiff
path: root/Html/activate.php
diff options
context:
space:
mode:
authorcitizenz7 <citizenz7@protonmail.com>2017-04-20 18:50:55 +0200
committercitizenz7 <citizenz7@protonmail.com>2017-04-20 18:50:55 +0200
commit5fd9fa480f302902328b81f912dd67ce378284f8 (patch)
tree66234843ae2857fda12442e4f7577c527d48977c /Html/activate.php
parentebe731862c7c741171138b1083906f391fc35aff (diff)
downloadfreetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.tar.xz
freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.zip
V.1.4.6
Diffstat (limited to 'Html/activate.php')
-rw-r--r--Html/activate.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/Html/activate.php b/Html/activate.php
new file mode 100644
index 0000000..777f640
--- /dev/null
+++ b/Html/activate.php
@@ -0,0 +1,40 @@
+<?php
+require_once('includes/config.php');
+
+//collect values from the url
+$memberID = trim($_GET['x']);
+$active = trim($_GET['y']);
+
+//if id is number and the active token is not empty carry on
+if(is_numeric($memberID) && !empty($active)){
+
+ //update users record set the active column to Yes where the memberID and active value match the ones provided in the array
+ $stmt = $db->prepare("UPDATE blog_members SET active = 'yes' WHERE memberID = :memberID AND active = :active");
+ $stmt->execute(array(
+ ':memberID' => $memberID,
+ ':active' => $active
+ ));
+
+ //if the row was updated redirect the user
+ if($stmt->rowCount() == 1){
+
+ $stmt = $db->prepare("SELECT username FROM blog_members WHERE memberID = :memberID");
+ $stmt->execute(array(
+ ':memberID' => $memberID,
+ ));
+ $row = $stmt->fetch();
+
+ $username = $row['username'];
+
+ //redirect to login page
+ write_log('<span style="color:#00cc99; font-weight:bold;">Nouveau membre :</span> '.$username, $db);
+ header('Location: '.SITEURL.'/admin/login.php?action=active');
+ exit;
+
+ } else {
+ header('Location: '.SITEURL.'/admin/login.php?action=echec');
+ exit;
+ }
+
+}
+?>