1<!DOCTYPE html> 2 3 4<html lang="en" ng-app="myApp" ng-controller="loginController" ng-cloak data-theme=" "> 5 6<head> 7 <meta charset="utf-8" /> 8 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> 9 <meta name="robots" content="noindex, nofollow"> 10 <title>Vitelglobal::Login</title> 11 12 <meta name="description" content=" " /> 13 <meta name="keywords" content=" "> 14 <!-- Canonical SEO --> 15 16 <!-- Favicon --> 17 <link rel="icon" type="image/x-icon" href="https://customer.vitelglobal.com/assets/img/favicon.png" /> 18 <!-- Fonts --> 19 20 <link rel="preconnect" href="https://fonts.googleapis.com/"> 21 <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> 22 <link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet"> 23 24 <!-- Icons --> 25 26 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/fonts/fontawesome.css" /> 27 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/fonts/tabler-icons.css"/> 28 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/fonts/flag-icons.css" /> 29 30 <!-- Core CSS --> 31 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/css/core.css" class="template-customizer-core-css" /> 32 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/css/theme-default.css" class="template-customizer-theme-css" /> 33 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/css/demo.css" /> 34 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/css/bs-stepper.css" /> 35 <!-- <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/css/select2.css" /> --> 36 37 38 <!-- Vendors CSS --> 39 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" /> 40 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/libs/typeahead-js/typeahead.css" /> 41 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.css"> 42 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.css"> 43 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.css"> 44 <!-- Row Group CSS --> 45 46 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/css/flatpickr.css" /> 47 <!-- Form Validation --> 48 49 <!-- Page CSS --> 50 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/vendor/css/login.css"> 51 <!-- Angular JS Plugin --> 52
52<script src="https://customer.vitelglobal.com/plugin/js/angular.min.js" type="text/javascript"></script>
52 53
53<script src="https://customer.vitelglobal.com/plugin/js/angular-route.js" type="text/javascript"></script>
53 54
54<script src="https://customer.vitelglobal.com/plugin/js/textAngular.min.js" type="text/javascript"></script>
54 55
55<script src="https://customer.vitelglobal.com/plugin/js/checklist-model.js" type="text/javascript"></script>
55 56
56<script src="https://customer.vitelglobal.com/plugin/js/dirPagination.js" type="text/javascript"></script>
56 57
57<script src="https://customer.vitelglobal.com/plugin/js/angular-datepicker.js" type="text/javascript"></script>
57 58
58<script src="https://customer.vitelglobal.com/plugin/js/sanitize.js" type="text/javascript"></script>
58 59
59<script src="https://customer.vitelglobal.com/plugin/js/ng-infinite-scroll.js" type="text/javascript"></script>
59 60
60<script src="https://customer.vitelglobal.com/plugin/js/myapp.js" type="text/javascript"></script>
60 61
61<script src="https://customer.vitelglobal.com/plugin/js/myapp-pbx.js" type="text/javascript"></script>
61 62 63
63<script src="https://customer.vitelglobal.com/plugin/js/fusioncharts.js"></script>
63 64
64<script src="https://customer.vitelglobal.com/plugin/js/angular-fusioncharts.min.js"></script>
64 65
65<script src="https://customer.vitelglobal.com/plugin/js/fusioncharts.theme.fusion.js"></script>
65 66 67 <!-- Angular JS Plugin --> 68 <!-- Helpers --> 69 70
70<script src="https://customer.vitelglobal.com/assets/vendor/js/helpers.js"></script>
70 71
71<script src="https://customer.vitelglobal.com/assets/vendor/js/template-customizer.js"></script>
71 72
72<script src="https://customer.vitelglobal.com/assets/js/config.js"></script>
72 73 74 <link rel="stylesheet" href="https://customer.vitelglobal.com/assets/css/sweetalert2.css" /><style type="text/css"> 75.carousel img{max-height:400px; width:auto;} 76 77.inputs input { 78 width: 40px; 79 height: 40px 80} 81 82input[type=number]::-webkit-inner-spin-button, 83input[type=number]::-webkit-outer-spin-button 84{ 85 -webkit-appearance: none; 86 -moz-appearance: none; 87 appearance: none; 88 margin: 0 89} 90 91 92.validate { 93 border-radius: 20px; 94 height: 40px; 95 border: 1px solid white; 96 width: 140px 97} 98 99.modal-dialog { 100 max-width: fit-content !important; 101} 102</style> 103</head> 104 105<body style="background:white !important;"> 106 107 108 109<div class="authentication-wrapper authentication-cover authentication-bg"> 110 <div class="authentication-inner row"> 111 112 <!-- /Left Text --> 113 <div class=" d-lg-flex col-lg-7 p-0 order-2 xs-mt-5"> 114 <div class="auth-cover-bg auth-cover-bg-color d-flex justify-content-center align-items-center"> 115 <!-- Carousel --> 116 <div id="carouselExampleCaptions" class="carousel slide p-3" data-bs-ride="carousel"> 117 <div class="carousel-indicators"> 118 <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button> 119 <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button> 120 <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2" aria-label="Slide 3"></button> 121 </div> 122 <div class="carousel-inner"> 123 <div class="carousel-item active"> 124 <img src="plugin/images/vitel-login.png" class="d-block img-fluid m-auto" alt="..."> 125 <div class="carousel-caption d-none d-md-block mt-5"> 126 <h5>Connect and Collaborate with your freedom</h5> 127 <p>Regardless of your location, communication services like messages, <br>video, and phone calls are at your fingertip<br><br></p> 128 </div> 129 </div> 130 <div class="carousel-item text-center"> 131 <img src="plugin/images/vitel-portal.png" class="d-block img-fluid m-auto" alt="..."> 132 <div class="carousel-caption d-none d-md-block mt-5"> 133 <h5>Introducing vOS for effectual Voice Administration</h5> 134 <p>vOS enables the users to engage in operating multiple tasks with <br>a single and friendly user interface. Virtual Operating System<br> refers to our applications on various platforms.<br></p> 135 </div> 136 </div> 137 <div class="carousel-item text-center"> 138 <img src="plugin/images/vitel-user.png" class="d-block img-fluid m-auto" alt="..."> 139 <div class="carousel-caption d-none d-md-block mt-5"> 140 <h5>Unbeatable features that adopts the way you communicate</h5> 141 <p>Cloud PBX systems from Vitel Global Communications come with a variety<br> of cost effective phone features to help you maintain a well-organized<br> and cost effective communication system for your business.</p> 142 </div> 143 </div> 144 </div> 145 146 147 148</div> 149 150 </div> 151 </div> 152 <!-- /Left Text --> 153 154 <!-- Register --> 155 <div class="d-flex col-12 col-lg-5 align-items-center p-4 order-md-2"> 156 <div class="authentication-wrapper authentication-basic "> 157 <div class="authentication-inner py-4"> 158 <!-- Login --> 159 <div class="card"> 160 <div class="card-body"> 161 <!-- Logo --> 162 <div class="app-brand justify-content-center mb-4 mt-2"> 163 <a href=" " class="app-brand-link gap-2"> 164 <span class="demo"> 165 <img src="assets/img/logo.svg" alt="" class="img-fluid" width="290"> 166 167</span> 168 </a> 169 170 171<!-- Edit User Modal --> 172 <!-- Modal --> 173<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> 174 <div class="modal-dialog"> 175 <div class="modal-content"> 176 <div class="modal-header"> 177 <h5 class="modal-title" id="exampleModalLabel">Forget Password</h5> 178 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 179 </div> 180 <div class="modal-body"> 181 <div class="row g-4" data-select2-id="20"> 182 183 184 <div class="col-md-12 "> 185 <label class="form-label" for="collapsible-fullname">Enter Login Username</label> 186 <!-- <input type="text" id="collapsible-fullname" class="form-control" placeholder="Enter Login Username"> --> 187 <input type="text" class="form-control" id="forgot_username" placeholder="Enter Login Username" ng-model="forget.username" required> 188 </div> 189 190 <div class="col-md-12"> 191 <div class="mb-12 d-flex align-items-center"> 192 <div class=""> 193 <img id="fimg" src="" align="absmiddle" width="100px" >
194 <span class="mx-3" onClick="javascript:refreshCaptcha()"> 195 <svg width="30px" height="30px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 489.645 489.645" style="enable-background:new 0 0 489.645 489.645" xml:space="preserve"><g><path d="M460.656,132.911c-58.7-122.1-212.2-166.5-331.8-104.1c-9.4,5.2-13.5,16.6-8.3,27c5.2,9.4,16.6,13.5,27,8.3 196 c99.9-52,227.4-14.9,276.7,86.3c65.4,134.3-19,236.7-87.4,274.6c-93.1,51.7-211.2,17.4-267.6-70.7l69.3,14.5 197 c10.4,2.1,21.8-4.2,23.9-15.6c2.1-10.4-4.2-21.8-15.6-23.9l-122.8-25c-20.6-2-25,16.6-23.9,22.9l15.6,123.8 198 c1,10.4,9.4,17.7,19.8,17.7c12.8,0,20.8-12.5,19.8-23.9l-6-50.5c57.4,70.8,170.3,131.2,307.4,68.2 199 C414.856,432.511,548.256,314.811,460.656,132.911z"/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg></span> 200 <!-- <i style="color:#00CA00; font-size:20px; cursor:pointer;" class="glyphicon glyphicon-refresh" onClick="javascript:refreshCaptcha()"></i> --> 201 </div> 202 <div class=""> 203 <input type="text" class="form-control input-lg" placeholder="Verification Code" id="forgot_captcha" ng-model="forget.captcha" required> 204 </div> 205 </div> 206 </div> 207 208 <!-- <div class="col-md-7 col-xs-12"> 209 210 <div class=""> 211 <input type="text" class="form-control input-lg " placeholder="Verification Code" ng-model=" " required=""> 212 </div> 213 </div> 214 --> 215 216 </div> 217 </div> 218 <div class="modal-footer"> 219 <!-- <button type="button" class="btn btn-dark" data-bs-dismiss="modal">Cancel</button> 220 <button type="button" class="btn btn-primary ">Submit</button> --> 221 <button type="submit" data-bs-dismiss="modal" class="btn btn-dark">Cancel</button> 222 <button type="submit" data-dismiss="modal" ng-click="forgetPass(forget,'ajaxResult');" class="btn btn-primary" ng-disabled="forgetForm.$invalid">Submit</button> 223 </div> 224 </div> 225 </div> 226</div> 227<!--/ Edit User Modal --> 228 </div> 229 <!-- /Logo --> 230 231 232 233 234 235 <form ng-show="showForm1" role="form" name="personForm" ng-submit="loginData(formdata, 'ajaxResult')" novalidate> 236 <h4 class="mb-1 pt-2">Login To Your Account</h4> 237 <p class="mb-4">Please sign-in to your account and start the adventure</p> 238 <div class="mb-3"> 239 <label for="email" class="form-label mb-2">Username</label> 240 <!-- <input type="text" class="form-control" id="email" name="email-username" placeholder="Enter your email or username" autofocus=""> --> 241 <input type="text" class="form-control" placeholder="Username" autocomplete="off" ng-model="formdata.username" placeholder="Enter your email or username" required> 242 </div> 243 <div class="mb-3 form-password-toggle"> 244 <div class="d-flex justify-content-between mb-2"> 245 <label class="form-label" for="password">Password</label> 246 <a href=" " data-bs-toggle="modal" data-bs-target="#exampleModal"> 247 <small>Forgot Password?</small> 248 </a> 249 </div> 250 <div class="input-group input-group-merge"> 251 <!-- <input type="password" id="password" class="form-control" name="password" placeholder="············" aria-describedby="password"> --> 252 <input type="password" class="form-control input-lg" id="password-field" placeholder="Password" ng-model="formdata.password" autocomplete="off" required> 253 <span toggle="#password-field" class="input-group-text cursor-pointer bi-eye field-icon toggle-password hoverable"></span> 254 </div> 255 </div> 256 <div class="mb-3"> 257 <div class="form-check-"> 258 <!-- <input class="form-check-input" type="checkbox" id="remember-me"> 259 <label class="form-check-label" for="remember-me"> 260 Remember Me 261 </label> --> 262 <div class="fv-row mb-10 fv-plugins-icon-container d-flex align-items-center"> 263 <div class="w-auto" > 264 <img id="vimg" src="" align="absmiddle" style="width:100px; height:auto;"> 265 <!-- <i style="color:#00CA00; font-size:20px; cursor:pointer;" class="fas fa-refresh" onClick="javascript:refreshCaptcha()"></i>
265 --> </div> 266 267 <span class="mx-3" onClick="javascript:refreshCaptcha()"> 268 <svg width="30px" height="30px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 489.645 489.645" style="enable-background:new 0 0 489.645 489.645" xml:space="preserve"><g><path d="M460.656,132.911c-58.7-122.1-212.2-166.5-331.8-104.1c-9.4,5.2-13.5,16.6-8.3,27c5.2,9.4,16.6,13.5,27,8.3 269 c99.9-52,227.4-14.9,276.7,86.3c65.4,134.3-19,236.7-87.4,274.6c-93.1,51.7-211.2,17.4-267.6-70.7l69.3,14.5 270 c10.4,2.1,21.8-4.2,23.9-15.6c2.1-10.4-4.2-21.8-15.6-23.9l-122.8-25c-20.6-2-25,16.6-23.9,22.9l15.6,123.8 271 c1,10.4,9.4,17.7,19.8,17.7c12.8,0,20.8-12.5,19.8-23.9l-6-50.5c57.4,70.8,170.3,131.2,307.4,68.2 272 C414.856,432.511,548.256,314.811,460.656,132.911z"/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg></span> 273 <div class="col-xs-12 col-sm-12 col-md-6 no-padding"> 274 <input type="text" class="form-control" placeholder="Verification Code" ng-model="formdata.captcha" required> 275 </div> 276 </div> 277 </div> 278 </div> 279 <div class="mb-3"> 280 <!-- <button class="btn btn-primary d-grid w-100" type="submit">Sign in</button> --> 281 <button type="submit" class="btn btn-primary d-grid w-100" ng-disabled="personForm.$invalid">Sign In</button> 282 </div> 283 </form> 284 285 <!-- <p class="text-center "> 286 <span>Sign In to Acess Your Account New Here? </span> 287 <a href=" "> 288 <span>Create an Account</span> 289 </a> 290 </p> --> 291 292 <form ng-show="showForm2" role="form" name="otherForm" class="form-horizontal"> 293 294 <h3 class="mb-1 fw-bold text-center">Two-Factor Authentication</h3> 295 296 <div class="col-md-12 text-center"> 297 <h6>Please enter the code you received at your registered email address</h6> 298 <b> OTP has been sent to your email <strong class="text-success">{{user_emaila}}</strong> </b> 299 </div> 300 301 <div class="col-md-12 text-center mt-2" ng-show="showErrorMessage"> 302 <p class="text-danger text-center" style="border: 1px solid red;padding: 10px;"> 303 <b> <i class="fas fa-exclamation-circle"></i> Incorrect code</b> 304 <br/> 305 Incorrect verification code. Please try again or contact support if you are unable to access your account 306 </p> 307 </div> 308 309 <!-- <div class="col-md-12 text-center mt-2" ng-show="showErrorMessagee"> 310 <p class="text-success text-center" style="border: 1px solid green;padding: 10px;"> 311 <b> Resent OTP </b> 312 </p> 313 </div> --> 314 315 <!-- <div class="col-md-12 text-center"> 316 <div id="otp" class="inputs d-flex flex-row justify-content-center mt-2 mb-2"> 317 <input class="m-2 text-center form-control rounded" type="text" id="first" maxlength="1" ng-model="otp.first" ng-keyup="moveFocus($event, 'second')"> 318 <input class="m-2 text-center form-control rounded" type="text" id="second" maxlength="1" ng-model="otp.second" ng-keyup="moveFocus($event, 'third')"> 319 <input class="m-2 text-center form-control rounded" type="text" id="third" maxlength="1" ng-model="otp.third" ng-keyup="moveFocus($event, 'fourth')"> 320 <input class="m-2 text-center form-control rounded" type="text" id="fourth" maxlength="1" ng-model="otp.fourth" ng-keyup="moveFocus($event, 'fifth')"> 321 <input class="m-2 text-center form-control rounded" type="text" id="fifth" maxlength="1" ng-model="otp.fifth" ng-keyup="moveFocus($event, 'sixth')"> 322 <input class="m-2 text-center form-control rounded" type="text" id="sixth" maxlength="1" ng-model="otp.sixth" ng-keyup="moveFocus($event, null)"> 323 </div>
324 <span ng-show="verificationCodeError" class="text-danger">Verification Code is required.</span> 325 </div> --> 326 327 <div class="col-md-12 text-center"> 328 <div id="otp" class="inputs d-flex flex-row justify-content-center mt-2 mb-2"> 329 <input class="m-2 text-center form-control rounded" type="text" id="first" maxlength="1" ng-model="otp.first" ng-keyup="moveFocus($event, 'second', null)"> 330 <input class="m-2 text-center form-control rounded" type="text" id="second" maxlength="1" ng-model="otp.second" ng-keyup="moveFocus($event, 'third', 'first')"> 331 <input class="m-2 text-center form-control rounded" type="text" id="third" maxlength="1" ng-model="otp.third" ng-keyup="moveFocus($event, 'fourth', 'second')"> 332 <input class="m-2 text-center form-control rounded" type="text" id="fourth" maxlength="1" ng-model="otp.fourth" ng-keyup="moveFocus($event, 'fifth', 'third')"> 333 <input class="m-2 text-center form-control rounded" type="text" id="fifth" maxlength="1" ng-model="otp.fifth" ng-keyup="moveFocus($event, 'sixth', 'fourth')"> 334 <input class="m-2 text-center form-control rounded" type="text" id="sixth" maxlength="1" ng-model="otp.sixth" ng-keyup="moveFocus($event, null, 'fifth')"> 335 </div> 336 <span ng-show="verificationCodeError" class="text-danger">Verification Code is required.</span> 337</div> 338 339 <div class="col-md-12 text-center mt-2"> 340 <div class="form-group"> 341 <button type="submit" ng-click="twofacAuth(formdata, 'ajaxResult');" class="btn btn-primary validate" ng-disabled="isButtonDisabled">Verify</button> 342 </div> 343 </div> 344 345 346 <!-- <div class="col-md-12"> 347 <div class="form-group"> 348 <label for="exampleInput" class="form-label mb-2">Verification Code</label> 349 <input type="number" class="form-control" placeholder="Enter Verification Code" id="verificationCode" ng-model="formdata.two_fac_otp"> 350 <span ng-show="verificationCodeError" class="text-danger">Verification Code is required.</span> 351 </div> 352 </div> --> 353 354 <input type="hidden" ng-model="formdata.username"> 355 356 <div class="col-md-12 timer text-success text-center mt-2"> 357 <p> Time Left {{ timerDisplay }} Seconds</p> 358 </div> 359 360 361 <div class="col-md-12 text-center" ng-show="isButtonDisabled"> 362 <p>Didn't receive Authentication code ? 363 <a class="text-danger" ng-click="resend()" style="cursor:pointer;">Resend</a> 364 </p> 365 </div> 366 367 368 <div class="modal-footer"> 369 <button type="button" class="btn btn-warning" ng-click="closeModal()">Cancel</button> 370 </div> 371 </form> 372 373 374 </div> 375 </div> 376 <!-- /Register --> 377 </div> 378 </div> 379 </div> 380 <!-- /Register --> 381 </div> 382</div> 383 384<!-- / Content --> 385 386 387
388<script src="assets/vendor/libs/jquery/jquery.js"></script>
388
389<script src="assets/vendor/js/bootstrap.js"></script>
389
390<script src="https://customer.vitelglobal.com/assets/js/sweetalert2.js"></script>
390
391<script src="https://customer.vitelglobal.com/assets/js/sweetalert.js"></script>
391 392
393<script> 394function refreshCaptcha() 395{ 396 var ct=(new Date()).getTime(); 397 document.getElementById("vimg").src = "https://customer.vitelglobal.com/index.php/captcha?"+ct; 398 document.getElementById("fimg").src = "https://customer.vitelglobal.com/index.php/captcha?"+ct; 399} 400refreshCaptcha(); 401 402 403myapp.controller("loginController", function($scope,$http,$window,$timeout,myService) 404{ 405 406 407 $scope.showForm1 = true; 408 $scope.showForm2 = false; 409 $scope.totalSeconds = 180; 410 $scope.timerDisplay = formatTime($scope.totalSeconds); 411 $scope.isButtonDisabled = false; 412 413 var timerPromise; 414 415 // $scope.loginData = function (formdata, varResult) 416 // { 417 // $scope.username = formdata.username; 418 // $scope.formdata = formdata; 419 // $scope.loader = true; 420 // var config = { params: { formdata: formdata } }; 421 422 // $http.post(base_url + "Login/checkl2FA", null, config).then(function(response) { 423 // //console.log(response); 424 // if (response.data.errcode == 200) 425 // { 426 // $http.post(base_url + "Login/checklogin", null, config).then(function(response) { 427 // if (response.data.errcode == 200) { 428 // // Uncomment and adjust if needed 429 // // $window.location.href = base_url + response.data.errmsg; 430 // } 431 // else { 432 // myService.resMessage($scope, $timeout, response.data.errcode, response.data.errmsg); 433 // } 434 // }); 435 // } 436 // else if(response.data.errcode == 201) 437 // { 438 // $http.post(base_url + "Login/checklogin1", null, config).then(function(response) 439 // { 440 // $scope.user_emaila = response.data.email; 441 // if (response.data.errcode == 200) 442 // { 443 // startTimer(); 444 // $scope.showForm1 = false; 445 // $scope.showForm2 = true; 446 // } else { 447 // myService.resMessage($scope, $timeout, response.data.errcode, response.data.errmsg); 448 // } 449 // }); 450 // } 451 // else { 452 // myService.resMessage($scope, $timeout, response.data.errcode, response.data.errmsg); 453 // } 454 // $scope.loader = false; 455 // }, 456 // function(error) { 457 // // Handle error for the first request 458 // $scope.loader = false; 459 // myService.resMessage($scope, $timeout, 500, 'An error occurred. Please try again.'); 460 // }); 461 // }; 462 463 $scope.loginData = function (formdata, varResult) 464 { 465 //console.log('dd',formdata); 466 $scope.username = formdata.username; 467 $scope.formdata = formdata; 468 $scope.loader = true; 469 470 var config = { params: { formdata : formdata } }; 471 $http.post(base_url+"Login/checklogin2", null, config).then(function(response) 472 { 473 $scope.user_emaila = response.data.email; 474 if(response.data.errcode == 200) 475 { 476 if(response.data.errmsg == "N") 477 { 478 $http.post(base_url+"Login/checklogin1", null, config).then(function(response) 479 { 480 $scope.user_emaila = response.data.email; 481 if(response.data.errcode == 200) 482 { 483 startTimer(); 484 $scope.showForm1 = false; 485 $scope.showForm2 = true; 486 } 487 else 488 { 489 myService.resMessage($scope,$timeout,response.data.errcode,response.data.errmsg); 490 } 491 $scope.loader = false; 492 }); 493 } 494 else 495 { 496 $http.post(base_url + "Login/checklogin", null, config).then(function(response) 497 { 498 if (response.data.errcode == 200) 499 { 500 $window.location.href = base_url + response.data.errmsg; 501 } 502 else 503 { 504 myService.resMessage($scope, $timeout, response.data.errcode, response.data.errmsg); 505 } 506 }); 507 } 508 } 509 else 510 { 511 myService.resMessage($scope,$timeout,response.data.errcode,response.data.errmsg); 512 } 513 $scope.loader = false; 514 }); 515 516 517 }; 518 519 520 $scope.verificationCodeError = false; 521 $scope.showErrorMessage = false; 522 $scope.showErrorMessagee = false; 523 524 525 526 // $scope.moveFocus = function(event, nextFieldId) { 527 // if (event.target.value.length === 1 && nextFieldId) { 528 // var nextField = document.getElementById(nextFieldId); 529 // if (nextField) { 530 // nextField.focus(); 531 // } 532 // } 533 // }; 534 535 $scope.moveFocus = function(event, nextFieldId, prevFieldId) { 536 var input = event.target; 537 538 // Handle moving forward when typing a character 539 if (input.value.length === 1 && nextFieldId && event.key !== "Backspace") { 540 var nextField = document.getElementById(nextFieldId); 541 if (nextField) { 542 nextField.focus(); 543 } 544 } 545 546 // Handle backspace: clear current input and move to the previous field 547 if (event.key === "Backspace" && input.value === '') { 548 if (prevFieldId) { 549 var prevField = document.getElementById(prevFieldId); 550 if (prevField) { 551 prevField.value = ''; // Clear the previous input value 552 prevField.focus(); // Move focus to the previous input 553 } 554 } 555 } else if (event.key === "Backspace") { 556 input.value = ''; // Clear the current input value 557 } 558}; 559 560 561 562 $scope.otp = {}; 563 564 $scope.getOtpValue = function() { 565 var otpValue = $scope.otp.first + $scope.otp.second + $scope.otp.third + 566 $scope.otp.fourth + $scope.otp.fifth + $scope.otp.sixth; 567 return otpValue; 568 }; 569 570 $scope.twofacAuth = function (formdata, varResult) 571 { 572 573 var otpValue = $scope.getOtpValue(); 574 575 formdata.two_fac_otp = otpValue; 576 577 if (!formdata.two_fac_otp) 578 { 579 $scope.verificationCodeError = true; 580 return; 581 } 582 583 $scope.verificationCodeError = false; 584 585 var config = { params: { formdata:formdata } }; 586 587 $http.post(base_url+"Login/checklogin", null, config).then(function(response) 588 { 589 if(response.data.errcode == 200) 590 { 591 //$('#myModal').modal('hide'); 592 $window.location.href = base_url+response.data.errmsg; 593 //myService.resMessage($scope,$timeout,response.data.errcode,response.data.errmsg); 594 } 595 else{ 596 597 //$('#myModal').modal('show'); 598 $scope.showErrorMessage = true; 599 $scope.showErrorMessagee = false; 600 //myService.resMessage($scope,$timeout,response.data.errcode,response.data.errmsg); 601 } 602 603 }); 604 605 }; 606 607 608 $scope.closeModal = function() 609 { 610 $timeout.cancel(timerPromise); // Cancel the timer 611 $scope.totalSeconds = 180; // Reset timer seconds 612 $scope.timerDisplay = formatTime($scope.totalSeconds); 613 $scope.formdata = {"username":"","password":"","formdata":""}; 614 $scope.showForm1 = true; 615 $scope.showForm2 = false; 616 $scope.isButtonDisabled = false; // Re-enable the button 617 $scope.showErrorMessage = false; 618 $scope.otp = {}; 619 }; 620 621 function startTimer() 622 { 623 if ($scope.totalSeconds > 0) { 624 $scope.totalSeconds--; 625 $scope.timerDisplay = formatTime($scope.totalSeconds); 626 timerPromise = $timeout(startTimer, 1000); 627 } else { 628 $scope.isButtonDisabled = true; // Disable button when timer ends 629 } 630 } 631 632 // Function to format time into MM:SS 633 function formatTime(seconds) { 634 var minutes = Math.floor(seconds / 60); 635 var remainingSeconds = seconds % 60; 636 return padZero(minutes) + ':' + padZero(remainingSeconds); 637 } 638 639 // Function to pad single-digit numbers with a leading zero 640 function padZero(number) { 641 return number < 10 ? '0' + number : number; 642 } 643 644 645 $scope.resend = function() 646 { 647 $scope.otp = {}; 648 $scope.loginData($scope.formdata); 649 $scope.showErrorMessagee = true; 650 $scope.showErrorMessage = false; 651 $timeout.cancel(timerPromise); 652 $scope.totalSeconds = 180; 653 $scope.timerDisplay = formatTime($scope.totalSeconds); 654 $scope.isButtonDisabled = false; 655 //startTimer(); 656 657 }; 658 659
660 $('#myModal').on('shown.bs.modal', function () 661 { 662 $scope.totalSeconds = 180; 663 $scope.timerDisplay = formatTime($scope.totalSeconds); 664 $timeout.cancel(timerPromise); 665 $scope.isButtonDisabled = false; 666 startTimer(); 667 }); 668 669 $scope.forgetPass = function (forget, varResult) 670 { 671 var config = { params: { formdata : forget } }; 672 $http.post(base_url+"Login/forget_password", null, config).then(function(response){ 673 if(response.data.errcode == 200){ 674 $('#exampleModal').modal('hide'); 675 $('#forgot_username').val(''); 676 $('#forgot_captcha').val(''); 677 } 678 $scope[varResult] = response.data.errmsg; 679 myService.resMessage($scope,$timeout,response.data.errcode,response.data.errmsg); 680 681 }); 682 }; 683 684}); 685 686</script>
686 687</body> 688 689</html> 690 691 692
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.