From 3f69ca67b789b2324e34372d2965e37de2e42417 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sat, 10 Aug 2013 23:34:51 -0500 Subject: [PATCH] Fixing issue with site login OTP Temporary fix with SVN path commit issue --- indefero/src/IDF/Form/UserAccount.php | 2 +- indefero/src/IDF/Plugin/SyncSvn.php | 7 +++++-- pluf/src/Pluf/User.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/indefero/src/IDF/Form/UserAccount.php b/indefero/src/IDF/Form/UserAccount.php index 7f3381c..4ce075a 100644 --- a/indefero/src/IDF/Form/UserAccount.php +++ b/indefero/src/IDF/Form/UserAccount.php @@ -173,7 +173,7 @@ class IDF_Form_UserAccount extends Pluf_Form 'help_text' => __('You will get an email to confirm that you own the address you specify.'), )); $otp = ""; - if ($user_data->otpkey != "") + if ($this->user->otpkey != "") $otp = Pluf_Utils::convBase($this->user->otpkey, '0123456789abcdef', 'abcdefghijklmnopqrstuvwxyz234567'); $this->fields['otpkey'] = new Pluf_Form_Field_Varchar( array('required' => false, diff --git a/indefero/src/IDF/Plugin/SyncSvn.php b/indefero/src/IDF/Plugin/SyncSvn.php index 1e1b2da..856bfdd 100644 --- a/indefero/src/IDF/Plugin/SyncSvn.php +++ b/indefero/src/IDF/Plugin/SyncSvn.php @@ -94,7 +94,9 @@ class IDF_Plugin_SyncSvn 'output' => $output))); return; } - $p = realpath(dirname(__FILE__).'/../../../scripts/svn-post-commit'); + // FIX ME + //$p = realpath(dirname(__FILE__).'/../../../scripts/svn-post-commit'); + $p = "/home/www/indefero/scripts/svn-post-commit"; exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s', escapeshellarg($p), escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-commit')), @@ -105,7 +107,8 @@ class IDF_Plugin_SyncSvn $svn_path.'/'.$shortname.'/hooks/post-commit')); return; } - $p = realpath(dirname(__FILE__).'/../../../scripts/svn-post-revprop-change'); + //$p = realpath(dirname(__FILE__).'/../../../scripts/svn-post-revprop-change'); + $p = "/home/www/indefero/scripts/svn-post-revprop-change"; exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s', escapeshellarg($p), escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-revprop-change')), diff --git a/pluf/src/Pluf/User.php b/pluf/src/Pluf/User.php index e70adee..fc44b7d 100644 --- a/pluf/src/Pluf/User.php +++ b/pluf/src/Pluf/User.php @@ -271,7 +271,7 @@ class Pluf_User extends Pluf_Model } else { $otp = substr($password, 0, 6); $pass = substr($password, 6); - $totp = new \OTPHP\TOTP(strtoupper($this->otpkey)); + $totp = new \OTPHP\TOTP(strtoupper(Pluf_Utils::convBase($this->otpkey, '0123456789abcdef', 'abcdefghijklmnopqrstuvwxyz234567'))); if ($totp->verify($otp) && $this->password == base64_encode(sha1($pass, TRUE))) { return true;