mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
dacacde524
|
@ -507,7 +507,7 @@ switch($command) {
|
|||
case 'submittranslation': /* {{{ */
|
||||
if($settings->_showMissingTranslations) {
|
||||
if($user && !empty($_POST['phrase'])) {
|
||||
if($fp = fopen('/tmp/newtranslations.txt', 'a+')) {
|
||||
if($fp = fopen($settings->_cacheDir.'/newtranslations.txt', 'a+')) {
|
||||
fputcsv($fp, array(date('Y-m-d H:i:s'), $user->getLogin(), $_POST['key'], $_POST['lang'], $_POST['phrase']));
|
||||
fclose($fp);
|
||||
}
|
||||
|
|
|
@ -132,13 +132,7 @@ if ($user->isAdmin() && ($_SERVER['REMOTE_ADDR'] != $settings->_adminIP ) && ( $
|
|||
|
||||
if($settings->_enable2FactorAuthentication) {
|
||||
if($secret = $user->getSecret()) {
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/IQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/BaseHTTPQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/GoogleQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Rng/IRNGProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Rng/MCryptRNGProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/TwoFactorAuthException.php";
|
||||
require "vendor/robthree/twofactorauth/lib/TwoFactorAuth.php";
|
||||
require "vendor/autoload.php";
|
||||
$tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS');
|
||||
if($tfa->verifyCode($secret, $_POST['twofactauth']) !== true) {
|
||||
_printMessage(getMLText("login_error_title"), getMLText("login_error_text"));
|
||||
|
|
|
@ -28,6 +28,7 @@ if ($user->isGuest()) {
|
|||
}
|
||||
|
||||
if($view) {
|
||||
$view->setParam('sitename', $settings->_siteName);
|
||||
$view->setParam('enable2factauth', $settings->_enable2FactorAuthentication);
|
||||
$view->setParam('accessobject', $accessop);
|
||||
$view($_GET);
|
||||
|
|
|
@ -19,13 +19,7 @@ require_once("class.Bootstrap.php");
|
|||
/**
|
||||
* Include classes for 2-factor authentication
|
||||
*/
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/IQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/BaseHTTPQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Qr/GoogleQRCodeProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Rng/IRNGProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/Providers/Rng/MCryptRNGProvider.php";
|
||||
require "vendor/robthree/twofactorauth/lib/TwoFactorAuthException.php";
|
||||
require "vendor/robthree/twofactorauth/lib/TwoFactorAuth.php";
|
||||
require "vendor/autoload.php";
|
||||
|
||||
/**
|
||||
* Class which outputs the html page for ForcePasswordChange view
|
||||
|
@ -75,6 +69,7 @@ $(document).ready( function() {
|
|||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$sitename = $this->params['sitename'];
|
||||
|
||||
$this->htmlStartPage(getMLText("2_factor_auth"), "forcepasswordchange");
|
||||
$this->globalNavigation();
|
||||
|
@ -94,7 +89,7 @@ $(document).ready( function() {
|
|||
<input id="secret" class="secret" type="text" name="secret" size="30" value="<?php echo $secret; ?>"><br />
|
||||
</div></div>
|
||||
<div class="control-group"><label class="control-label"></label><div class="controls">
|
||||
<img src="<?php echo $tfa->getQRCodeImageAsDataUri('My label', $secret); ?>">
|
||||
<img src="<?php echo $tfa->getQRCodeImageAsDataUri($sitename, $secret); ?>">
|
||||
</div></div>
|
||||
<div class="control-group"><label class="control-label"></label><div class="controls">
|
||||
<input class="btn" type="submit" value="<?php printMLText("submit_2_fact_auth") ?>"><br />
|
||||
|
@ -105,7 +100,7 @@ $(document).ready( function() {
|
|||
$this->contentContainerEnd();
|
||||
$this->contentContainerStart('span6');
|
||||
echo '<div>'.$oldsecret.'</div>';
|
||||
echo '<div><img src="'.$tfa->getQRCodeImageAsDataUri('My label', $oldsecret).'"></div>';
|
||||
echo '<div><img src="'.$tfa->getQRCodeImageAsDataUri($sitename, $oldsecret).'"></div>';
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user