Add update script
authorjoshuaruesweg <ruesweg@woltlab.com>
Sat, 13 Jun 2020 14:57:51 +0000 (16:57 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Sat, 13 Jun 2020 14:57:51 +0000 (16:57 +0200)
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_emailConfirmation.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_emailConfirmation.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_emailConfirmation.php
new file mode 100644 (file)
index 0000000..4ad2593
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+use wcf\system\WCF;
+
+/**
+ * @author     Joshua Ruesweg
+ * @copyright  2001-2019 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core
+ */
+
+// HEADS UP: This script must be executed, AFTER the SQL tables are changed. 
+
+$sql = "UPDATE  wcf". WCF_N ."_user 
+       SET     emailConfirmed = activationCode
+       WHERE   activationCode <> 0";
+
+$statement = WCF::getDB()->prepareStatement($sql);
+$statement->execute();