Auto create TOTP secret (#6670)

* Auto create TOTP secret

Auto create TOTP secret after successful database authentication when the TOTP secret has not been set.
This commit is contained in:
FusionPBX
2023-05-06 12:24:26 -06:00
committed by GitHub
parent fddafec0b6
commit 2bc91f2612
7 changed files with 224 additions and 134 deletions
+25 -33
View File
@@ -1,36 +1,28 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php'>
<title>{$login_title}</title>
<body>
<div id='page' align='center'>
<div id='default_login'>
<!--
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}'/></a><br />
-->
<form method='post' name='frm' action=''>
<div>
{$login_email_description}
<br /><br />
<input class='formfld' type='text' name='authentication_code' maxlength='255' placeholder="{$login_authentication_code}" value="{$authentication_code}">
<br /><br />
</div>
<div>
<input type='hidden' name='{$token_name}' value='{$token_hash}'>
<input type='submit' name='' class='btn' value='{$button_verify}'>
</div>
</form>
<head>
<meta charset='utf-8' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
<title>{$login_title}</title>
</head>
<body>
<div id='page' align='center'>
<div id='default_login'>
<form method='post' name='frm' action=''>
<div>
{$login_email_description}
<br /><br />
<input class='formfld' type='text' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='authentication_code' maxlength='255' placeholder="{$login_authentication_code}" value="{$authentication_code}" />
<br /><br />
</div>
<div>
<input type='submit' name='' class='btn' value='{$button_verify}' />
</div>
</form>
</div>
</div>
</div>
<!--
<div id='footer_login'>
<span class='footer'>{$settings.theme.footer}</span>
</div>
-->
</body>
</html>
</body>
</html>
+23 -28
View File
@@ -1,32 +1,27 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php'>
<title>{$login_title}</title>
<body>
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}'></a><br />
<form method='post' name='frm' action='{$login_destination_url}'>
<div>
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder="{$label_username}"><br />
<input type='password' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password' placeholder="{$label_password}"><br />
</div>
<div>
<!--<input type='hidden' name='{$token_name}' value='{$token_hash}'>-->
<input type='submit' id='btn_login' class='btn' style='width: 100px; margin-top: 15px;' value='{$button_login}'>
</div>
</form>
<head>
<meta charset='utf-8' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
<title>{$login_title}</title>
</head>
<body>
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}' /></a><br />
<form method='post' name='frm' action='{$login_destination_url}'>
<div>
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder="{$label_username}" /><br />
<input type='password' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password' placeholder="{$label_password}" /><br />
</div>
<div>
<input type='submit' id='btn_login' class='btn' style='width: 100px; margin-top: 15px;' value='{$button_login}' />
</div>
</form>
</div>
</div>
</div>
<!--
<div id='footer_login'>
<span class='footer'>{$settings.theme.footer}</span>
</div>
-->
</body>
</body>
</html>
+23 -40
View File
@@ -1,44 +1,27 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php'>
<title>{$login_title}</title>
<body>
<!--
<div class='action_bar' id='action_bar'>
<div class='heading'><b>{$title_authentication_code}</b></div>
<div class='actions'>\n";
<head>
<meta charset='utf-8' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
<title>{$login_title}</title>
</head>
<body>
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}' /></a><br />
<form method='post' name='frm' action=''>
<div>
<input class='formfld' type='text' style='text-align: center;' name='authentication_code' maxlength='255' placeholder="{$login_authentication_code}" value="{$authentication_code}" />
<br /><br />
</div>
<div>
<input type='submit' name='' class='btn' value='{$button_verify}' />
</div>
</form>
</div>
</div>
<div style='clear: both;'></div>
</div>
-->
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}'/></a><br />
<form method='post' name='frm' action=''>
<div>
<input class='formfld' type='text' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='authentication_code' maxlength='255' placeholder="{$login_authentication_code}" value="{$authentication_code}">
<br /><br />
<!--
{$description_authentication_code}
<br /><br />
-->
</div>
<div>
<input type='hidden' name='{$token_name}' value='{$token_hash}'>
<input type='submit' name='' class='btn' value='{$button_verify}'>
</div>
</form>
</div>
</div>
<!--
<div id='footer_login'>
<span class='footer'>{$settings.theme.footer}</span>
</div>
-->
</body>
</body>
</html>
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta charset='utf-8' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
<title>{$login_title}</title>
</head>
<body>
<div id='page' align='center'>
<div id='default_login' style='max-width: 400px;'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}'/></a><br />
<form method='post' name='frm' action=''>
<div id='totp_qr'>
{$totp_secret}<br /><br />
<img src="data:image/jpeg;base64,{$totp_image}" style='margin-top: 0px; padding: 5px; background: white; max-width: 100%;' /><br /><br />
{$totp_description}<br /><br />
</div>
<div>
<input type='submit' name='' class='btn' value='{$button_next}' />
</div>
</form>
</div>
</div>
</body>
</html>
@@ -1,31 +1,26 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php'>
<title>{$login_title}</title>
<body>
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}'></a><br />
<form method='post' name='frm' action='{$login_destination_url}'>
<div>
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder="{$login_username}"><br />
</div>
<div>
<input type='hidden' name='{$token_name}' value='{$token_hash}'>
<input type='submit' id='btn_login' class='btn' style='width: 100px; margin-top: 15px;' value='{$button_login}'>
</div>
</form>
<head>
<meta charset='utf-8' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
<title>{$login_title}</title>
</head>
<body>
<div id='page' align='center'>
<div id='default_login'>
<a href='{$project_path}/'><img id='login_logo' style='width: {$login_logo_width}; height: {$login_logo_height};' src='{$login_logo_source}' /></a><br />
<form method='post' name='frm' action='{$login_destination_url}'>
<div>
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder="{$login_username}" /><br />
</div>
<div>
<input type='submit' id='btn_login' class='btn' style='width: 100px; margin-top: 15px;' value='{$button_login}' />
</div>
</form>
</div>
</div>
</div>
<!--
<div id='footer_login'>
<span class='footer'>{$settings.theme.footer}</span>
</div>
-->
</body>
</body>
</html>