]> git.wh0rd.org Git - tt-rss.git/commitdiff
only enable OTPHP on php version 5.3+
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 13 Sep 2012 22:52:49 +0000 (02:52 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 13 Sep 2012 22:52:49 +0000 (02:52 +0400)
classes/auth/internal.php
classes/pref/prefs.php

index 37014ce47846e5c6e6f30308c92987c63b9443b6..92c19eb64bf89176afee3a62828616f8b2ec0f31 100644 (file)
@@ -9,7 +9,7 @@ class Auth_Internal extends Auth_Base {
                $otp = db_escape_string($_REQUEST["otp"]);
 
                if (get_schema_version($this->link) > 96) {
-                       if (!defined('AUTH_DISABLE_OTP') || !AUTH_DISABLE_OTP) {
+                       if (version_compare(PHP_VERSION, '5.3.0') >= 0 && !defined('AUTH_DISABLE_OTP') || !AUTH_DISABLE_OTP) {
                                $result = db_query($this->link, "SELECT otp_enabled,salt FROM ttrss_users WHERE
                                        login = '$login'");
 
index e9f420774b9fad2e57d469dd9c503a53566074e2..f4a663dbde9bfc41f6f19b62b0c6e9621aa505df 100644 (file)
@@ -258,7 +258,7 @@ class Pref_Prefs extends Handler_Protected {
 
                        print "</form>";
 
-                       if ($_SESSION["auth_module"] == "internal") {
+                       if (version_compare(PHP_VERSION, '5.3.0') >= 0 && $_SESSION["auth_module"] == "internal") {
 
                                print "<h2>" . __("One time passwords / Authenticator") . "</h2>";