1pb_show(true); 2var nextLink = $.urlParam('r'); 3var loggedInRid = null; 4var isCanny = $.urlParam('companyID') != null; 5if(isCanny) 6 nextLink = $.urlParam('redirect') 7 8var nextAccount = $.urlParam('new'); 9 10mainData.data = {wt: null, loading: false, nextAccount, nextLink, type: 'login', provider: null, step: null, errorNoaccount: false, data: {email:'', otp:'', first_name: '', last_name: ''}} 11 12var param = {op: "whitelabel", cookies: false}; 13execute_request(param, null, null, false, function (r) { 14 if(r.status == "OK"){ 15 mainData.data.wt = r.data; 16 } 17}) 18 19 20 21function goBack(){ 22 mainData.data.data.otp = ''; 23 if(mainData.data.step === 'validateOTP'){ 24 mainData.data.step = null; 25 }else{ 26 mainData.data.provider = null; 27 mainData.data.data.email = ''; 28 mainData.data.step = null; 29 } 30 31} 32 33function getAuthLink(provider){ 34 pb_show(true); 35 36 37 var param = {op: "login", op1: 'authentication', op2: provider}; 38 39 param.data = {}; 40 if(nextLink) 41 param.data.nextURL = nextLink; 42 43 if(isCanny) 44 param.data.canny = true; 45 46 execute_request(param, null, null, false, function (data) { 47 if(data.status == "OK"){ 48 window.location.href = data.url; 49 }else if(!check_error(data)) 50 pb_show(false); 51 }) 52} 53 54 55function sendOTP(){ 56 mainData.data.errorNoaccount = false; 57 if(!isEmailValid(mainData.data.data.email)) 58 return; 59 60 pb_show(myi18n.t('processing')); 61 var param = {op: "login", op1: 'email', op2: 'sendOTP', data:{email: mainData.data.data.email, next: nextLink}}; 62 if(isCanny) 63 param.data.canny = true; 64 65 execute_request(param, null, null, false, function (data) { 66 if(data.status == "OK"){ 67 loggedInRid = data.rid; 68 mainData.data.step = 'validateOTP'; 69 }else{ 70 if(data.code == 404){ 71 mainData.data.errorNoaccount = true; 72 }else 73 msg_error(); 74 } 75 76 pb_show(false); 77 }) 78} 79 80 81function validateOTP(){ 82 if(mainData.data.data.otp.length != 6) 83 return; 84 85 pb_show(myi18n.t('processing')); 86 var param = {op: "login", op1: 'email', op2: 'validateOTP', rid: loggedInRid, data:{code: mainData.data.data.otp, next: nextLink}}; 87 execute_request(param, null, null, false, function (data) { 88 if(data.status == "OK"){ 89 if(data.newAccount){ 90 pb_show(false); 91 loggedInRid = data.rid; 92 mainData.data.step = 'createAccount'; 93 }else{ 94 if(nextLink) 95 window.location.href = urldecode(nextLink); 96 else 97 statusChangeCallback(); 98 } 99 100 }else{ 101 if(data.code == 404){ 102 mainData.data.errorNoaccount = true; 103 goBack(); 104 } 105 106 msg_error(myi18n.t('invalidData')) 107 pb_show(false); 108 } 109 }) 110} 111 112 113function createAccount(){ 114 pb_show(myi18n.t('processing')); 115 var param = {op: "login", op1: 'email', op2: 'createAccount', rid: loggedInRid, data:{first_name: mainData.data.data.first_name, last_name: mainData.data.data.last_name}}; 116 execute_request(param, null, null, false, function (data) { 117 if(data.status == "OK"){ 118 if(nextLink) 119 window.location.href = urldecode(nextLink); 120 else 121 statusChangeCallback(); 122 123 }else{ 124 msg_error(myi18n.t('invalidData')) 125 pb_show(false); 126 } 127 }) 128} 129 130 131if($.urlParam('me') == 1) 132 $("body").html('<div class="text-center mt-3"><p><b>User ID</b></p><p>'+docCookies.getItem("user_id")+'</p></div>'); 133else if($.urlParam('success') == 1) 134 statusChangeCallback(); 135else{ 136 var param = {op: "login", op1: 'check'}; 137 if(isCanny) 138 param.data = {canny: true, nextURL: nextLink} 139 140 execute_request(param, null, null, false, function (data) { 141 if(data.status == "OK"){ 142 if(!isCanny){ 143 if(nextLink) 144 window.location.href = urldecode(nextLink); 145 else 146 statusChangeCallback(); 147 } 148 149 }else{ 150 pb_show(false); 151 } 152 }) 153} 154
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.