Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

register.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. var Unibase;
  2. (function (Unibase) {
  3. let Themes;
  4. (function (Themes) {
  5. let Compact;
  6. (function (Compact) {
  7. let Components;
  8. (function (Components) {
  9. class Register extends Unibase.Platform.Core.BaseComponent {
  10. submit() {
  11. }
  12. jsFiles() {
  13. return ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "platform/core/helpers/navigation/navigationhelper.js", "libs/passwordrequirement/passwordrequirement.js"];
  14. }
  15. cssFiles() {
  16. return ["libs/passwordrequirement/passwordrequirement.css"];
  17. }
  18. html(id, containerid) {
  19. if (jQuery("#external-form").length === 0) {
  20. var index = new Components.Index_Anonymous();
  21. index.init(null);
  22. }
  23. const html = `<div>
  24. <form id="frm_Register">
  25. <div id="bizgaze_SpiltErrorMessages"></div>
  26. <div id="div_CreatePswd">
  27. <h1 class="display-4 mb-30 text-dark-100 text-center">Register</h1>
  28. <div class="alert alert-primary">We will send link to your <a href=""><u>Email</u></a> to create your password.</div>
  29. <div class="form-group">
  30. <label class="control-label" id="lbl_Email">Email Address</label>
  31. <input id="signupEmail" value="" class="form-control input-lg text-dark" disabled="disabled">
  32. </div>
  33. <div class="form-group">
  34. <label class="control-label">Password</label>
  35. <input type="password" id="signupPassword" placeholder="Type a password" class="pr-password signupPassword form-control input-lg" autocomplete="new-password">
  36. </div>
  37. <div class="form-group">
  38. <label class="control-label">Confirm Password</label>
  39. <input type="password" id="ConfirmPassword" placeholder="Type a password" class="ConfirmPassword form-control input-lg" autocomplete="new-password">
  40. </div>
  41. <button class="btn btn-primary btn-block mb-20"
  42. type="button" id="btnSignUp">Register</button><p class="text-right"><a href="Index.html#/login">
  43. Back to login</a></p>
  44. </div>
  45. </div>
  46. <div id="div_SuccessMsg" class="d-none">
  47. <div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i>
  48. </div>
  49. <h1 class="display-4 mb-20 text-center">Password Created Successfully</h1>
  50. <p class="text-center"><a href="Index.html#/login">Click here to Login</a></p>
  51. </div>
  52. </form>`;
  53. return html;
  54. }
  55. load(id, containerid, callback) {
  56. var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
  57. jQuery(".preloader-it").delay(500).fadeOut("slow");
  58. jQuery("#external-container").delay(500).fadeIn("slow");
  59. jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
  60. $("#div_modalbody").removeAttr("style");
  61. this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
  62. $(".pr-password").click(function () {
  63. var signUpPswd = $(".pr-password");
  64. signUpPswd.passwordRequirements({
  65. numCharacters: 8,
  66. useLowercase: true,
  67. useUppercase: true,
  68. useNumbers: true,
  69. useSpecial: true
  70. });
  71. });
  72. }
  73. register(obj) {
  74. var instance = this;
  75. $("#signupEmail").val(obj.email);
  76. $(document).bind('keypress', function (e) {
  77. if (e.keyCode == 13) {
  78. $('#btnSignUp').trigger('click');
  79. }
  80. });
  81. $("#btnSignUp").click(function () {
  82. instance.signupregister(obj.userid, obj.tenant, obj.email, obj.phonenumber);
  83. });
  84. }
  85. signupregister(unibseid, tenantid, email, phonenumber) {
  86. var instance = this;
  87. var ConfirmPassword = $(".ConfirmPassword").val().toString();
  88. var password = $(".signupPassword").val().toString();
  89. var tenantid = tenantid;
  90. var unibaseid = unibseid;
  91. var email = email;
  92. var phonenumber = phonenumber;
  93. if (password == '' || ConfirmPassword == '') {
  94. MessageHelper.Instance().showError("Password cannot be empty", "bizgaze_SpiltErrorMessages");
  95. return false;
  96. }
  97. if ($(".signupPassword").val().toString().length < 6 || $(".ConfirmPassword").val().toString().length < 6) {
  98. MessageHelper.Instance().showError("Password must be atleast 6 characters !", "bizgaze_SpiltErrorMessages");
  99. return false;
  100. }
  101. if (password != ConfirmPassword) {
  102. MessageHelper.Instance().showError("New and Confirm passwords does not match", "bizgaze_SpiltErrorMessages");
  103. return false;
  104. }
  105. var postData = {
  106. ConfirmPassword: ConfirmPassword,
  107. Password: password,
  108. UserId: unibaseid,
  109. TenantId: Number(tenantid),
  110. UserName: unibaseid,
  111. Email: email,
  112. ContactNumber: phonenumber
  113. };
  114. instance._accountManager.register(postData).then(function (response) {
  115. $("#div_CreatePswd").addClass('d-none');
  116. $("#div_SuccessMsg").removeClass('d-none');
  117. MessageHelper.Instance().showSuccess("Password Created Successfully", 'bizgaze_SpiltErrorMessages');
  118. });
  119. }
  120. static Instance() {
  121. return new Register();
  122. }
  123. }
  124. Components.Register = Register;
  125. })(Components = Compact.Components || (Compact.Components = {}));
  126. })(Compact = Themes.Compact || (Themes.Compact = {}));
  127. })(Themes = Unibase.Themes || (Unibase.Themes = {}));
  128. })(Unibase || (Unibase = {}));