Fixing issue with site login OTP

Temporary fix with SVN path commit issue
master
Nathan Adams 2013-08-10 23:34:51 -05:00
parent 5926f62bd1
commit 3f69ca67b7
3 changed files with 7 additions and 4 deletions

View File

@ -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.'), 'help_text' => __('You will get an email to confirm that you own the address you specify.'),
)); ));
$otp = ""; $otp = "";
if ($user_data->otpkey != "") if ($this->user->otpkey != "")
$otp = Pluf_Utils::convBase($this->user->otpkey, '0123456789abcdef', 'abcdefghijklmnopqrstuvwxyz234567'); $otp = Pluf_Utils::convBase($this->user->otpkey, '0123456789abcdef', 'abcdefghijklmnopqrstuvwxyz234567');
$this->fields['otpkey'] = new Pluf_Form_Field_Varchar( $this->fields['otpkey'] = new Pluf_Form_Field_Varchar(
array('required' => false, array('required' => false,

View File

@ -94,7 +94,9 @@ class IDF_Plugin_SyncSvn
'output' => $output))); 'output' => $output)));
return; 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', exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s',
escapeshellarg($p), escapeshellarg($p),
escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-commit')), escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-commit')),
@ -105,7 +107,8 @@ class IDF_Plugin_SyncSvn
$svn_path.'/'.$shortname.'/hooks/post-commit')); $svn_path.'/'.$shortname.'/hooks/post-commit'));
return; 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', exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s',
escapeshellarg($p), escapeshellarg($p),
escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-revprop-change')), escapeshellarg($svn_path.'/'.$shortname.'/hooks/post-revprop-change')),

View File

@ -271,7 +271,7 @@ class Pluf_User extends Pluf_Model
} else { } else {
$otp = substr($password, 0, 6); $otp = substr($password, 0, 6);
$pass = substr($password, 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))) if ($totp->verify($otp) && $this->password == base64_encode(sha1($pass, TRUE)))
{ {
return true; return true;