summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-06-20 18:27:34 +0300
committerAndrew Dolgov <[email protected]>2018-06-20 18:27:34 +0300
commit310c18e6bbd8e7f78a0a45f0501cb1dc6fab2159 (patch)
tree1aee50612509895272be3d11b32b08f7e8b0e497 /classes
parentdf47100ad10117f67dd0fb86f270cdd2d24b5692 (diff)
move OTPHP to vendor/; additionally move Base32 class to OTPHP namespace
Diffstat (limited to 'classes')
-rw-r--r--classes/pref/prefs.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index f56048b2f..da62ea70c 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -147,7 +147,7 @@ class Pref_Prefs extends Handler_Protected {
$_SESSION["prefs_op_result"] = "reset-to-defaults";
$sth = $this->pdo->prepare("DELETE FROM ttrss_user_prefs
- WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL))
+ WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL))
AND owner_uid = :uid");
$sth->execute([":profile" => $_SESSION['profile'], ":uid" => $_SESSION['uid']]);
@@ -848,9 +848,6 @@ class Pref_Prefs extends Handler_Protected {
}
function otpqrcode() {
- require_once "lib/otphp/vendor/base32.php";
- require_once "lib/otphp/lib/otp.php";
- require_once "lib/otphp/lib/totp.php";
require_once "lib/phpqrcode/phpqrcode.php";
$sth = $this->pdo->prepare("SELECT login,salt,otp_enabled
@@ -860,7 +857,7 @@ class Pref_Prefs extends Handler_Protected {
if ($row = $sth->fetch()) {
- $base32 = new Base32();
+ $base32 = new \OTPHP\Base32();
$login = $row["login"];
$otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
@@ -876,9 +873,6 @@ class Pref_Prefs extends Handler_Protected {
}
function otpenable() {
- require_once "lib/otphp/vendor/base32.php";
- require_once "lib/otphp/lib/otp.php";
- require_once "lib/otphp/lib/totp.php";
$password = clean($_REQUEST["password"]);
$otp = clean($_REQUEST["otp"]);
@@ -894,7 +888,7 @@ class Pref_Prefs extends Handler_Protected {
if ($row = $sth->fetch()) {
- $base32 = new Base32();
+ $base32 = new \OTPHP\Base32();
$secret = $base32->encode(sha1($row["salt"]));
$topt = new \OTPHP\TOTP($secret);
@@ -902,7 +896,7 @@ class Pref_Prefs extends Handler_Protected {
$otp_check = $topt->now();
if ($otp == $otp_check) {
- $sth = $this->pdo->prepare("UPDATE ttrss_users
+ $sth = $this->pdo->prepare("UPDATE ttrss_users
SET otp_enabled = true WHERE id = ?");
$sth->execute([$_SESSION['uid']]);