<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="Admin_System_2FASettings, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility" TagPrefix="EM" %>
<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="System.Web.UI" TagPrefix="cc1" %>

<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">
    <script type="text/javascript" language="javascript">
        <%--function CallUpdate() {
            var CtrlDDL = document.getElementById('<%=Ddl_SMSVariablesHtml.ClientID%>');
            var CtrlSMSBody = document.getElementById('<%=TxBx_SMSBody.ClientID%>');
            if (CtrlDDL.value != '0') {
                insertTextAtCursor(CtrlSMSBody, CtrlDDL.value);
                setTimeout(function () { CtrlDDL.selectedIndex = 0; $(CtrlDDL).trigger('change'); }, 500);
            }
        }--%>
        function insertTextAtCursor(myField, myValue) {
            //alert(myValue);
            //IE support
            if (document.selection) {
                myField.focus();
                sel = document.selection.createRange();
                sel.text = myValue;
            }
            //MOZILLA and others
            else if (myField.selectionStart || myField.selectionStart == '0') {
                var startPos = myField.selectionStart;
                var endPos = myField.selectionEnd;
                myField.value = myField.value.substring(0, startPos)
                    + myValue
                    + myField.value.substring(endPos, myField.value.length);
                myField.selectionStart = startPos + myValue.length;
                myField.selectionEnd = startPos + myValue.length;
            } else {
                myField.value += myValue;
            }
        }

    </script>

    <div class="col-xs-12">
        <div class="card">
            <%--<div class="header">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" Text="<%$ Resources:Content,thirdPartyAuthentication %>" /></h2>
            </div>--%>
            <div class="body">
                <ajax:UpdatePanel ID="UP_2FASettings" runat="server">
                    <ContentTemplate>
                        <EM:TabContainer ID="TC_Settings" runat="server" OnClientActiveTabChanged="loadTabPanel">
                            <EM:TabPanel ID="Tab_ThirdParty" runat="server" HeaderText="<%$ Resources:Content, Authentication%>">
                                <ContentTemplate>
                                    <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                                    <asp:Panel ID="Pnl_TabContent0" runat="server">

                                        <%--Passwordless Authentication--%>
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <asp:Literal ID="Literal18" runat="server" Text="<%$Resources:Content,PasswordlessAuthentication %>" /></label>
                                                </h3>
                                            </div>
                                            <div class="body">


                                                <div class="row">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                            <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Content,strEnable %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:CheckBox ID="CB_EnablePassworlessAuth" runat="server" Text=" " data-label="Passwordless Authentication Enabled" />
                                                    </div>
                                                </div>
                                                <div class="row" id="Div_PasswordlessAuthSettings" runat="server" style="display: none;">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                            <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,PasswordlessAuthWebUrl %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <div class="form-group">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_PasswordlessAuthWebUrl" runat="server" ValidationGroup="passwordless" data-label="Authentication Web URL" />
                                                                <asp:RequiredFieldValidator ID="RFV_PasswordlessAuthWebUrl" runat="server" ControlToValidate="TxBx_PasswordlessAuthWebUrl"
                                                                    Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:HyperLink ID="HL_PassworlessAuthHelpLink" runat="server" Text="<%$ Resources:Content,HowToConfigPassworlessAuthWebApp %>" NavigateUrl="https://kb.machsol.com/Knowledgebase/55733/MachPanel-PasswordLess-Authentication#middleware-app-installation-and-configuration" Target="_blank" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <br />
                                        <%--Azure Authentication--%>

                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <asp:Literal ID="Literal26" runat="server" Text="<%$Resources:Content,strLoginUsingMicrosoftAccount %>" /></label>
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                    <asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:Content,strEnable %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:CheckBox ID="CB_EnableLoginUsingMSAccount" runat="server" Text=" " data-label="Login using Microsoft Account Enabled" />
                                                    </div>
                                                </div>
                                                <div class="row" id="TR_AzureWebAppId" runat="server" style="display: none;">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                    <asp:Literal ID="Literal10" runat="server" Text="<%$ Resources:Content,azureWebAppId %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <div class="form-group">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_AzureWebAppId" runat="server" data-label="Azure Web Application ID" />
                                                                <asp:RequiredFieldValidator ID="RFV_TxBx_AzureWebAppId" runat="server" ControlToValidate="TxBx_AzureWebAppId"
                                                                    Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:LinkButton ID="LB_HowTo" runat="server" Text="<%$ Resources:Content,howToConfigAzureWebApp %>" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <br />
                                        <%--Custom ADFS Login--%>
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <asp:Literal ID="Literal27" runat="server" Text="<%$Resources:Content,strLoginUsingADFS %>" /></label>
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                    <asp:Literal ID="Literal21" runat="server" Text="<%$Resources:Content,strEnable %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:CheckBox ID="CB_EnableLoginUsingADFS" runat="server" Text=" " data-label="Login using ADFS Enabled" />
                                                    </div>
                                                </div>
                                                <div id="TR_ADFSLoginSettings" runat="server" style="display: none;">
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal22" runat="server" Text="<%$Resources:Content,StrADFSLoginAppUrl %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_ADFSLoginAppUrl" runat="server" data-label="ADFS Login App URL" />
                                                                    <asp:RequiredFieldValidator ID="RFV_TxBx_ADFSLoginUrl" runat="server" ControlToValidate="TxBx_ADFSLoginAppUrl"
                                                                        Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal23" runat="server" Text="<%$Resources:Content,StrAutoSignoutADFSOnPanelSignout %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:CheckBox ID="CB_SignoutADFSOnPanelSignOut" runat="server" Text=" " data-label="Signout from ADFS on panel signout" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <br />
                                        <%--keyCloak--%>
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <asp:Literal ID="Literal28" runat="server" Text="<%$Resources:Content,keyCloak %>" /></label>
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-sm-4 col-xs-12 row-label">
                                                        <label>
                                                            *
                                                    <asp:Literal ID="Literal3" runat="server" Text="<%$Resources:Content,strEnable %>" />:</label>
                                                    </div>
                                                    <div class="col-sm-4 col-xs-12">
                                                        <asp:CheckBox ID="CB_KeyCloak" runat="server" Text=" " data-label="KeyCloak SSO Enabled" />
                                                    </div>
                                                </div>

                                                <div id="Div_KeyCloakSSO" runat="server" style="display: none;">
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal4" runat="server" Text="<%$Resources:Content,IssuerEndPoint %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_KCIssuerEndPoint" runat="server" data-label="Issuer Endpoint" />
                                                                    <asp:RequiredFieldValidator ID="RFV_TxBx_KCIssuerEndPoint" runat="server" ControlToValidate="TxBx_KCIssuerEndPoint"
                                                                        Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal7" runat="server" Text="<%$Resources:Content,ClientId %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_KCClientId" runat="server" data-label="KeyCloak Client Id" />
                                                                    <asp:RequiredFieldValidator ID="RFV_TxBx_KCClientId" runat="server" ControlToValidate="TxBx_KCClientId"
                                                                        Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal8" runat="server" Text="<%$Resources:Content,String142 %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_KCSecret" runat="server" data-label="KeyCloak Secret" />
                                                                    <asp:RequiredFieldValidator ID="RFV_TxBx_KCSecret" runat="server" ControlToValidate="TxBx_KCSecret"
                                                                        Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="3rdParty"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                        <asp:Literal ID="Ltrl_KCAuthUsingCPAccountLabel" runat="server" Text="<%$Resources:Content,StrKCAuthUsingCPAccountLabel %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:CheckBox ID="CB_KCAuthUsingCPAccount" runat="server" Text=" " data-label="Authenticate using Control Panel User name (e-mail address)" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal5" runat="server" Text="<%$Resources:Content,AutoRedirectKeyCloak %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:CheckBox ID="CB_AutoRedirectKeyCloak" runat="server" Text=" " data-label="Auto Redirect to KeyCloak Login" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal17" runat="server" Text="<%$Resources:Content,SignOutKeyCloak %>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:CheckBox ID="CB_SignOutKeyCloak" runat="server" Text=" " data-label="Signout from KeyCloak on panel signout" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-4 col-xs-12 row-label">
                                                            <label>
                                                                *
                                                        <asp:Literal ID="Literal29" runat="server" Text="<%$Resources:Content, SkipKeyCloakIPAddressesLabel%>" />:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:TextBox ID="TxBx_SkipKeyCloakIPAddresses" runat="server" Rows="4" Columns="5" TextMode="MultiLine" data-label="KeyCloak IP Addresses to skip"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>


                                            </div>
                                        </div>
                                        <br />
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <asp:ValidationSummary ID="ValidationSummary3" ValidationGroup="3rdParty" DisplayMode="BulletList"
                                                    ShowSummary="false" ShowMessageBox="true" HeaderText="<%$ Resources:Content,EM000001%>"
                                                    runat="server" />
                                                <asp:Button ID="Btn_Save3rdParty" CausesValidation="true" ValidationGroup="3rdParty" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000949 %>' />
                                            </div>
                                        </div>

                                        <asp:Panel ID="Pnl_AzureConfigSteps" CssClass="width-modal-popup-auto" runat="server" Style="display: none;">
                                            <div class="card">
                                                <div class="header container-fluid">
                                                    <h3 class="pull-left"><%= Resources.Content.howToConfigAzureWebApp %></h3>
                                                    <span>
                                                        <button type="button" class="close" onclick="$find('<%=MPE_AzureConfigSteps.ClientID%>').hide();">&times;</button>
                                                    </span>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <ol class="list-group">
                                                                <li class="list-group-item"><span class="badge pull-left">1</span>&nbsp;Sign in to the <a href="https://portal.azure.com/" target="_blank">Azure portal</a>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">2</span>&nbsp;If your account gives you access to more than one, click your account in the top right corner, and set your portal session to the desired Azure AD tenant.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">3</span>&nbsp;In the left-hand navigation pane, click the <b>Azure Active Directory</b> service, click <b>App registrations</b>, and click <b>New application registration</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">4</span>&nbsp;When the <b>Create</b> page appears, enter your application's registration information:</li>
                                                                <li class="list-group-item">
                                                                    <ol class="list-group" type="a">
                                                                        <li class="list-group-item"><span class="badge pull-left">a</span>&nbsp;<b>Name:</b> Enter a meaningful application name example PortalAuth</li>
                                                                        <li class="list-group-item"><span class="badge pull-left">b</span>&nbsp;<b>Application Type:</b> Select "<b>Web app / API</b>"</li>
                                                                        <li class="list-group-item"><span class="badge pull-left">c</span>&nbsp;<b>Sign-On URL:</b> Provide the base URL of panel. For example, <a href="#">https://cp.hosting.com</a></li>
                                                                        <li class="list-group-item"><span class="badge pull-left">d</span>&nbsp;Click <b>Create</b></li>
                                                                    </ol>
                                                                </li>
                                                                <li class="list-group-item"><span class="badge pull-left">5</span>&nbsp;You are taken to the application's main registration page, which opens up the <b>Settings</b> page for the application.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">6</span>&nbsp;Click <b>Properties</b>, a new window will open, at end of window set <b>Multi-Tenanted</b> to <b>Yes</b>, and click <b>Save</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">7</span>&nbsp;Click <b>Required Permissions</b>, then click <b>Grant Permissions</b>, and click <b>Yes</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">8</span>&nbsp;Click <b>Reply URLs</b>, add all whitelabel urls for resellers and customers under <b>Reply URLs</b> and click <b>Save</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">9</span>&nbsp;Click <b>X</b>, on Settings page to close <b>Settings</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">10</span>&nbsp;Switch to the <b>Edit manifest</b> page, by clicking <b>Manifest</b> from the application's registration page. A web-based manifest editor opens, allowing you to <b>Edit</b> the manifest within the portal. Locate and set the "<b>oauth2AllowImplicitFlow</b>" value to "true." By default, it is set to "false." Click <b>Save</b>.</li>
                                                                <li class="list-group-item"><span class="badge pull-left">11</span>&nbsp;Copy Application Id and specify in <b>Azure Web Application Id</b>.</li>
                                                            </ol>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:Button ID="Btn_Close" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN000150 %>" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                        <EM:ModalPopupExtender runat="server" ID="MPE_AzureConfigSteps" OkControlID="Btn_Close"
                                            CancelControlID="Btn_Close" BackgroundCssClass="modalBackground" DropShadow="false"
                                            PopupControlID="Pnl_AzureConfigSteps" TargetControlID="LB_HowTo">
                                        </EM:ModalPopupExtender>

                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                            <EM:TabPanel ID="Tab_TFAS" runat="server" HeaderText="<%$ Resources:Content, TFAS%>">
                                <ContentTemplate>
                                    <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                                    <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">

                                        <div class="row" id="Tr_Main" runat="server">
                                            <div class="col-xs-12">
                                                <asp:CheckBox ID="Cb_Enabled" AutoPostBack="true" runat="server" Text="<%$ Resources:Content, GN000195%>" data-label="2FA Enabled" />
                                            </div>
                                        </div>
                                        <div class="row" id="Tr_Enable2FA" runat="server" style="display: none;">
                                            <div class="col-xs-12">
                                                <asp:CheckBox runat="server" ID="Chbx_EnabledByDefaultForNewCustomers" Text="<%$ Resources:Content,EnabledByDefaultForNewCustomers %>" data-label="Enabled for New Customers" />
                                                <asp:CheckBox runat="server" ID="Chbx_EnabledByDefaultForNewResellers" Text="<%$ Resources:Content,EnabledByDefaultForNewResellers %>" data-label="Enabled for New Resellers" />
                                                <asp:CheckBox runat="server" ID="Chbx_EnabledByDefaultForNewStaffUsers" Text="<%$ Resources:Content,EnabledByDefaultForNewStaffUsers %>" data-label="Enabled for New Staff Users" />
                                            </div>
                                            <div class="col-sm-2 col-xs-12 row-label">
                                                <label>
                                                    <asp:Literal ID="Literal13" runat="server" Text='<%$ Resources:Content, AuthenticateUsing%>' EnableViewState="false" />:</label>
                                            </div>
                                            <div class="col-sm-8 col-xs-12">
                                                <div class="form-group">
                                                    <%--<asp:RadioButtonList ID="RBL_2FA" RepeatDirection="Horizontal" runat="server" AutoPostBack="true">
                                                        <asp:ListItem Text="<%$Resources:Content,PINThroughEmail%>" Value="0" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,PINThroughSMS%>" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,GoogleAuthenticator%>" Value="2"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,DuoAuthentication%>" Value="3"></asp:ListItem>
                                                    </asp:RadioButtonList>--%>
                                                    <%-- <asp:CheckBoxList ID="RBL_2FA" RepeatDirection="Horizontal" runat="server" AutoPostBack="true">
                                                        <asp:ListItem Text="<%$Resources:Content,PINThroughEmail%>" Value="0" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,PINThroughSMS%>" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,GoogleAuthenticator%>" Value="2"></asp:ListItem>
                                                        <asp:ListItem Text="<%$Resources:Content,DuoAuthentication%>" Value="3"></asp:ListItem>
                                                    </asp:CheckBoxList>--%>
                                                </div>
                                            </div>

                                            <div class="col-xs-12">
                                                <div class="row">
                                                    <div class="col-sm-2 col-xs-12 row-label">
                                                    </div>
                                                    <div class="col-sm-2 col-xs-12">
                                                        <asp:CheckBox runat="server" ID="ChBx_PINThroughEmail" AutoPostBack="true" Text="<%$ Resources:Content,PINThroughEmail %>" data-label="Authenticate using PIN through Email" />
                                                    </div>
                                                    <div class="col-sm-8 col-xs-12">
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-sm-2 col-xs-12 row-label">
                                                    </div>
                                                    <div class="col-sm-2 col-xs-12">
                                                        <asp:CheckBox runat="server" ID="ChBx_PINThroughSMS" AutoPostBack="true" Text="<%$ Resources:Content,PINThroughSMS %>" data-label="Authenticate using PIN through SMS" />
                                                    </div>
                                                    <div class="col-sm-8 col-xs-12">
                                                        <div id="Tr_SMSSettings" runat="server" style="display: none;">
                                                            <div class="row">
                                                                <div class="col-sm-4 col-xs-12 row-label">
                                                                    <label>
                                                                        <asp:Literal ID="Literal25" runat="server" Text='<%$ Resources:Content, strSMSForProvOnly%>' EnableViewState="false" />:</label>
                                                                </div>
                                                                <div class="col-sm-2 col-xs-12">
                                                                    <asp:CheckBox ID="ChBx_SMSForProvOnly" runat="server" Text=" " data-label="SMS for Provider Staff only" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-sm-2 col-xs-12 row-label">
                                                    </div>
                                                    <div class="col-sm-2 col-xs-12">
                                                        <asp:CheckBox runat="server" ID="ChBx_GoogleAuthenticator" AutoPostBack="true" Text="<%$ Resources:Content,GoogleAuthenticator %>" data-label="Authenticate using Authenticator App" />
                                                    </div>
                                                    <div class="col-sm-8 col-xs-12">
                                                        <div class="row" id="Div_GoogleExplain" runat="server" style="display: none;">
                                                            <div class="col-xs-12">
                                                                <asp:Literal ID="Literal14" runat="server" Text='<%$ Resources:Content, GAuthDetail%>' EnableViewState="false" /></label>
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-sm-2 col-xs-12 row-label">
                                                    </div>
                                                    <div class="col-sm-2 col-xs-12">
                                                        <asp:CheckBox runat="server" ID="ChBx_DuoAuthentication" AutoPostBack="true" Text="<%$ Resources:Content,DuoAuthentication %>" data-label="Authenticate using Duo Authentication" />
                                                    </div>
                                                    <div class="col-sm-8 col-xs-12">
                                                        <div id="Div_DuoAuthenticator" runat="server" style="display: none;">
                                                            <div class="row">
                                                                <div class="col-sm-6 col-xs-12 row-label">
                                                                    <label>
                                                                        <asp:Literal ID="Literal24" runat="server" Text='<%$ Resources:Content, strDuoAuthForProvOnly%>' EnableViewState="false" />:</label>
                                                                </div>
                                                                <div class="col-sm-2 col-xs-12">
                                                                    <asp:CheckBox ID="ChBx_DuoAuthForProvOnly" runat="server" Text=" " data-label="Duo Authentication for Provider Staff only" />
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-4 col-xs-12 row-label">
                                                                    <label>
                                                                        *
                                                                        <asp:Literal ID="Literal11" runat="server" Text='<%$ Resources:Content, ClientId%>' EnableViewState="false" />:</label>
                                                                </div>
                                                                <div class="col-sm-6 col-xs-12">
                                                                    <div class="form-group">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_IntegrationKey" MaxLength="50" runat="server" Text="" data-label="Client Id"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="Rfv_7" runat="server" ControlToValidate="TxBx_IntegrationKey"
                                                                                Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="2FA"></asp:RequiredFieldValidator>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-4 col-xs-12 row-label">
                                                                    <label>
                                                                        *
                                                                        <asp:Literal ID="Literal19" runat="server" Text='<%$ Resources:Content, ClientSecret%>' EnableViewState="false" />:</label>
                                                                </div>
                                                                <div class="col-sm-6 col-xs-12">
                                                                    <div class="form-group">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_SecretKey" MaxLength="50" runat="server" Text="" data-label="Client Secret"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="Rfv_8" runat="server" ControlToValidate="TxBx_SecretKey"
                                                                                Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="2FA"></asp:RequiredFieldValidator>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-4 col-xs-12 row-label">
                                                                    <label>
                                                                        *
                                                                        <asp:Literal ID="Literal20" runat="server" Text='<%$ Resources:Content, APIHostName%>' EnableViewState="false" />:</label>
                                                                </div>
                                                                <div class="col-sm-6 col-xs-12">
                                                                    <div class="form-group">
                                                                        <div class="form-line">
                                                                            <asp:TextBox ID="TxBx_APIHostName" MaxLength="50" runat="server" Text="" data-label="API Host Name"></asp:TextBox>
                                                                            <asp:RequiredFieldValidator ID="Rfv_9" runat="server" ControlToValidate="TxBx_APIHostName"
                                                                                Display="None" SetFocusOnError="True" Enabled="false" ValidationGroup="2FA"></asp:RequiredFieldValidator>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-xs-12">
                                                <div class="row" id="Tr_ExpireOn" runat="server" style="display: none;">
                                                    <div class="col-sm-2 col-xs-12 row-label">
                                                        <label>
                                                            <asp:Literal ID="Literal6" runat="server" Text='<%$ Resources:Content, PinExpires%>' EnableViewState="false" />:</label>
                                                    </div>
                                                    <div class="col-sm-3 col-xs-12">
                                                        <div class="form-group">
                                                            <asp:DropDownList ID="Ddl_ExpiryMinutes" runat="server" data-label="PIN Expiry (minutes)">
                                                                <asp:ListItem Text="10"></asp:ListItem>
                                                                <asp:ListItem Text="15"></asp:ListItem>
                                                                <asp:ListItem Text="30"></asp:ListItem>
                                                                <asp:ListItem Text="60"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-2 col-xs-12">
                                                        <label>
                                                            <asp:Literal ID="Literal12" runat="server" Text='<%$ Resources:Content, GN0001132%>' EnableViewState="false" /></label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>



                                        <div id="Div_UpdateExisting" runat="server" style="display: none;">
                                            <%--Update existing 2FA settings of Provider/reseller staff users, customers ad users, endusers--%>
                                            <div class="panel-group" id="AS_UpdateExisting" role="tablist" aria-multiselectable="true">
                                                <div class="panel panel-primary">
                                                    <div class="panel-heading" role="tab" id="heading_UpdateExisting">
                                                        <h2 class="panel-title">
                                                            <a role="button" id="A_UpdateExisting" data-toggle="collapse" data-parent="#AS_UpdateExisting" href="#CSB_UpdateExisting" aria-expanded="false" aria-controls="CSB_UpdateExisting" class="collapsed">
                                                                <%= Resources.Content.UpdateExistingUsers%>
                                                            </a>
                                                        </h2>
                                                    </div>
                                                    <div id="CSB_UpdateExisting" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading_UpdateExisting" aria-expanded="false" style="height: 0px;">
                                                        <div class="panel-body">
                                                            <div class="row">
                                                                <div class="col-sm-3 col-xs-6 row-label">
                                                                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Content,ProviderStaffUsers %>"></asp:Label>:
                                                                </div>
                                                                <div class="col-sm-9 col-xs-6">
                                                                    <asp:RadioButtonList ID="Rbl_ProviderStaffUsers" runat="server" RepeatDirection="Horizontal" data-label="Update Existing Provider Staff Users">
                                                                        <asp:ListItem Text="<%$ Resources:Content,NoChange %>" Value="-1" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,strEnabled %>" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,Disabled %>" Value="0"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-3 col-xs-6 row-label">
                                                                    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Content,ResellerStaffUsers %>"></asp:Label>:
                                                                </div>
                                                                <div class="col-sm-9 col-xs-6">
                                                                    <asp:RadioButtonList ID="Rbl_ResellerStaffUsers" runat="server" RepeatDirection="Horizontal" data-label="Update Existing Reseller Staff Users">
                                                                        <asp:ListItem Text="<%$ Resources:Content,NoChange %>" Value="-1" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,strEnabled %>" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,Disabled %>" Value="0"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-3 col-xs-6 row-label">
                                                                    <asp:Label ID="Label3" runat="server" Text="<%$ Resources:Content,ProviderCustomers %>"></asp:Label>:
                                                                </div>
                                                                <div class="col-sm-9 col-xs-6">
                                                                    <asp:RadioButtonList ID="Rbl_ProviderCustomers" runat="server" RepeatDirection="Horizontal" data-label="Update Existing Provider Customers">
                                                                        <asp:ListItem Text="<%$ Resources:Content,NoChange %>" Value="-1" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,strEnabled %>" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,Disabled %>" Value="0"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-3 col-xs-6 row-label">
                                                                    <asp:Label ID="Label4" runat="server" Text="<%$ Resources:Content,ResellerCustomers %>"></asp:Label>:
                                                                </div>
                                                                <div class="col-sm-9 col-xs-6">
                                                                    <asp:RadioButtonList ID="Rbl_ResellerCustomers" runat="server" RepeatDirection="Horizontal" data-label="Update Existing Reseller Customers">
                                                                        <asp:ListItem Text="<%$ Resources:Content,NoChange %>" Value="-1" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,strEnabled %>" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,Disabled %>" Value="0"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>
                                                            <div class="row">
                                                                <div class="col-sm-3 col-xs-6 row-label">
                                                                    <asp:Label ID="Label5" runat="server" Text="<%$ Resources:Content,EndADUsers %>"></asp:Label>:
                                                                </div>
                                                                <div class="col-sm-9 col-xs-6">
                                                                    <asp:RadioButtonList ID="Rbl_EndADUsers" runat="server" RepeatDirection="Horizontal" data-label="Update Existing Active Directory Users">
                                                                        <asp:ListItem Text="<%$ Resources:Content,NoChange %>" Value="-1" Selected="True"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,strEnabled %>" Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text="<%$ Resources:Content,Disabled %>" Value="0"></asp:ListItem>
                                                                    </asp:RadioButtonList>
                                                                </div>
                                                            </div>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row" id="Tr_SaveMain" runat="server">
                                            <div class="col-xs-12">
                                                <asp:ValidationSummary ID="VS_SaveSettings" ValidationGroup="2FA" DisplayMode="BulletList"
                                                    ShowSummary="false" ShowMessageBox="true" HeaderText="<%$ Resources:Content,EM000001%>"
                                                    runat="server" />
                                                <asp:Button ID="Btn_SaveSettings" ValidationGroup="2FA" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000949 %>' />
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                        </EM:TabContainer>
                    </ContentTemplate>
                </ajax:UpdatePanel>
            </div>
        </div>
    </div>
    <asp:Button ID="Btn_Dummy2" Style="display: none" runat="server" />
    <asp:Panel ID="Pnl_GetPhone" CssClass="width-modal-popup-auto" runat="server" Style="display: none;">
        <div class="card">
            <div class="header">
                <h2>
                    <asp:Literal ID="Literal15" runat="server" Text="<%$ Resources:Content,MobileNumber %>"
                        EnableViewState="false" /></h2>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-sm-4 col-xs-12 row-label">
                        <label>
                            <asp:Literal ID="Literal16" runat="server" Text="<%$ Resources:Content,MobileForTestSMS %>"
                                EnableViewState="false" />:</label>
                    </div>
                    <div class="col-sm-4 col-xs-12">
                        <div class="form-group">
                            <div class="form-line">
                                <asp:TextBox ID="TxBx_MobileNumber" MaxLength="20" runat="server"></asp:TextBox>
                            </div>
                        </div>

                        <div class="form-group row-label">
                            <asp:Literal ID="L1" runat="server" EnableViewState="false" Text="<%$ Resources:Content,E164Format %>"></asp:Literal>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <asp:Button ID="Btn_Pop_OK" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,DGN1110199 %>" />
                        <asp:Button ID="Btn_Pop_Cancel" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000572 %>" />
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <EM:ModalPopupExtender runat="server" ID="MPE_Phone" OkControlID="Btn_Pop_OK"
        CancelControlID="Btn_Pop_Cancel" OnOkScript="onOk()" BackgroundCssClass="modalBackground" DropShadow="false"
        PopupControlID="Pnl_GetPhone" TargetControlID="Btn_Dummy2">
    </EM:ModalPopupExtender>

    <script type="text/javascript">
        function onOk() {
            if (document.getElementById('ctl00_CPH_Content_TxBx_MobileNumber').value != '') {
                __doPostBack('ctl00$CPH_Content$Btn_Pop_OK', '');
            }
            else {
                alert("Please enter mobile number.");
                $find('ctl00_CPH_Content_MPE_Phone').show();
            }

        }

    </script>
</asp:Content>

