-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from dzadikdev/bug/hot-fixes
Fixes to Linked Objects, Progressive Profile
- Loading branch information
Showing
5 changed files
with
202 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{% extends templatename+"/template.html" %} | ||
|
||
{% block content %} | ||
<section class="bg-light py-5"> | ||
<div class="container"> | ||
<div class="d-flex align-items-center mb-5"> | ||
<div class="icon-stack icon-stack-lg bg-primary text-white"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg></div> | ||
<div class="ml-3"> | ||
<h2 class="mb-0">Account</h2> | ||
<p class="lead mb-0">Manage Users</p> | ||
</div> | ||
</div> | ||
<div class="card border-bottom"> | ||
<div class="card-body"> | ||
<div class="separator-2"></div> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th style="text-align:center">User Status</th> | ||
<th style="text-align:center">Temporary MFA Passcode</th> | ||
<th style="text-align:center">User Verification Passcode</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for i in userlist %} | ||
<tr> | ||
<td>{{ i['profile']['firstName']}} {{ i['profile']['lastName']}}</td> | ||
<td>{{ i['profile']['email']}}</td> | ||
<td style="text-align:center">{{ i['status'] }}</td> | ||
<td style="text-align:center"><a href="temporarypasscode?user_id={{ i.id}}"><i class="fa fa-clock"></i></a></td> | ||
<td style="text-align:center"><a href="#" onclick="getfactors('{{ i['profile']['firstName']}} {{ i['profile']['lastName']}}','{{ i['id']}}')"><i class="fa fa-key"></i></a></td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<!-- Modal --> | ||
<div class="modal fade" id="validateuser" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="ValidateModalLabel">Validate User</h5> | ||
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
</div> | ||
<div class="modal-body"> | ||
<div id="selectverification" class="form-group"> | ||
<label for="factordropdown">Select a Factor: (This sample supports SMS and Email)</label> | ||
<select class="form-control" id="factordropdown"> | ||
</select><br> | ||
<button class="btn btn-primary" type="button" onclick="sendFactor()">Send Code</button> | ||
</div> | ||
<div id="inputverification" class="form-group" style="display: none;"> | ||
<div class="form-group"><label for="userCode">Enter User's Code</label> | ||
<input class="form-control" id="userCode" type="text"></div> | ||
<div id="apiResponse" class="alert alert-primary" role="alert" style="display: none;"> | ||
</div> | ||
<button class="btn btn-primary" type="button" onclick="verifyFactor()">Verify User Code</button> | ||
<button class="btn btn-primary" type="button" onclick="gobackFactor()">Back</button> | ||
</div> | ||
<div id="completeverification" class="form-group" style="display: none;"> | ||
User is Verified! | ||
</div> | ||
<input type="hidden" id="userid"> | ||
|
||
</div> | ||
<div class="modal-footer"><button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
function getfactors(name, id) { | ||
$.ajax({ | ||
url:'/admin/getfactors?user_id='+id, | ||
type: "GET", | ||
complete: function (response) { | ||
factors = JSON.parse(response.responseText); | ||
dropdownhtml = ""; | ||
for (let step = 0; step < factors.length; step++) | ||
{ | ||
console.log(factors[step]._links.verify); | ||
if (factors[step].factorType == "sms" && factors[step].status == "ACTIVE") | ||
{ | ||
dropdownhtml = dropdownhtml + "<option id='verifysms' value='" + factors[step].id + "'>SMS</option>" | ||
} | ||
else if (factors[step].factorType == "email" && factors[step].status == "ACTIVE") | ||
{ | ||
dropdownhtml = dropdownhtml + "<option id='verifyemail' value='" + factors[step].id + "'>Email</option>" | ||
} | ||
} | ||
$("#ValidateModalLabel").html("Validate User: "+ name); | ||
$("#factordropdown").html(dropdownhtml); | ||
$("#userid").val(id); | ||
$("#validateuser").modal("show"); | ||
}, | ||
error: function () { | ||
alert('No Factors Exist'); | ||
}, | ||
}); | ||
return false; | ||
}; | ||
|
||
function sendFactor() { | ||
factorid = $("#factordropdown").val(); | ||
user_id = $("#userid").val(); | ||
$.ajax({ | ||
url:'/admin/sendfactor?user_id='+ user_id +"&factor_id=" + factorid, | ||
type: "GET", | ||
complete: function (response) { | ||
myresponse = JSON.parse(response.responseText); | ||
alert("Code Sent"); | ||
$("#selectverification").hide(); | ||
$("#inputverification").show(); | ||
}, | ||
error: function () { | ||
myresponse = JSON.parse(response.responseText); | ||
alert(myresponse.errorSummary); | ||
}, | ||
}); | ||
}; | ||
|
||
function verifyFactor() { | ||
verifyCode = $("#userCode").val(); | ||
factorid = $("#factordropdown").val(); | ||
user_id = $("#userid").val(); | ||
$.ajax({ | ||
url:'/admin/verifyfactor?user_id='+ user_id +"&factor_id=" + factorid + "&code=" + verifyCode, | ||
type: "GET", | ||
complete: function (response) { | ||
myresponse = JSON.parse(response.responseText); | ||
if (myresponse.hasOwnProperty('errorSummary')) | ||
{ | ||
$("#apiResponse").html(myresponse.errorSummary); | ||
$("#apiResponse").show(); | ||
} | ||
else | ||
{ | ||
$("#selectverification").hide(); | ||
$("#inputverification").hide(); | ||
$("#completeverification").show(); | ||
} | ||
}, | ||
error: function () { | ||
myresponse = JSON.parse(response.responseText); | ||
alert(myresponse.errorSummary); | ||
}, | ||
}); | ||
}; | ||
|
||
function gobackFactor() { | ||
$("#selectverification").show(); | ||
$("#inputverification").hide(); | ||
$("#completeverification").hide(); | ||
}; | ||
|
||
|
||
</script> | ||
{% endblock %} | ||
|
||
{% block footer %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters