В xyz
This commit is contained in:
@ -20,8 +20,8 @@ class DBMSUser
|
||||
{
|
||||
this.showShadow(false);
|
||||
|
||||
if(node.errorCode>0) {
|
||||
alert2(trt('Alert'), node.errorMessage);
|
||||
if(node.error_code>0) {
|
||||
alert2(trt('Alert'), node.error_message);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -98,28 +98,28 @@ class DBMSUser
|
||||
|
||||
this.win.setSize("350px","184px");
|
||||
|
||||
var str='<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">\n\
|
||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
|
||||
<tbody>\n\
|
||||
<tr><td>\n\
|
||||
<table style="width: 100%; height: 100%;">\n\
|
||||
<tr>\n\
|
||||
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+trt('Login')+' (E-mail):</b></td>\n\
|
||||
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td style="padding: 2px;"><b>Password:</b></td>\n\
|
||||
<td style="padding: 2px;"><input type="password" maxlength="33" style="width: 100%; padding: 2px; display: inline;" id="tcPassword'+this.uid+'" name="password"><br></td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td style="padding: 2px;" colspan="2"><table style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/> Remember (<a href="#" onclick="g_user.showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\
|
||||
</tr>\n\
|
||||
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+trt('Log_in')+'"></td></tr>\n\
|
||||
</table>\n\
|
||||
</td></tr>\n\
|
||||
</tbody>\n\
|
||||
</table>\n\
|
||||
</div>';
|
||||
let str=`<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">
|
||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">
|
||||
<tbody>
|
||||
<tr><td>
|
||||
<table style="width: 100%; height: 100%;">
|
||||
<tr>
|
||||
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>`+trt('Login')+` (E-mail):</b></td>
|
||||
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin`+this.uid+`" name="login"><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px;"><b>Password:</b></td>
|
||||
<td style="padding: 2px;"><input type="password" maxlength="33" style="width: 100%; padding: 2px; display: inline;" id="tcPassword`+this.uid+`" name="password"><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px;" colspan="2"><table style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_`+this.uid+`" type="checkbox" style="display: inline;" checked/> Remember (<a href="#" onclick="g_user.showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>
|
||||
</tr>
|
||||
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E`+this.uid+`" type="button" style="display: inline;" value="`+trt('Log_in')+`"></td></tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>`;
|
||||
|
||||
this.win.setContent(str);
|
||||
|
||||
@ -137,14 +137,14 @@ class DBMSUser
|
||||
{
|
||||
obj.onclick=()=>
|
||||
{
|
||||
var xs='<?xml version="1.0" encoding="utf-8"?>\
|
||||
<metadata fn="7">\
|
||||
<cmd><![CDATA[3]]></cmd>\n\
|
||||
<login><![CDATA['+document.getElementById('tcLogin'+this.uid).value+']]></login>\
|
||||
<password><![CDATA['+document.getElementById('tcPassword'+this.uid).value+']]></password>\
|
||||
</metadata>';
|
||||
let xs=`<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata fn="7">
|
||||
<cmd><![CDATA[3]]></cmd>
|
||||
<login><![CDATA[`+document.getElementById('tcLogin'+this.uid).value+`]]></login>
|
||||
<password><![CDATA[`+document.getElementById('tcPassword'+this.uid).value+`]]></password>
|
||||
</metadata>`;
|
||||
|
||||
var request=new TRequest(this);
|
||||
let request=new TRequest(this);
|
||||
if(request.callServer(ScriptName,xs))
|
||||
{
|
||||
this.win.showProgressBar();
|
||||
@ -260,21 +260,21 @@ class DBMSUser
|
||||
//Display password recovery form
|
||||
showRestoreForm()
|
||||
{
|
||||
var win=new TWin(true);
|
||||
let win=new TWin(true);
|
||||
win.BuildGUI(10,10);
|
||||
win.setCaption(trt("Password_recovery"));
|
||||
|
||||
let str='<div style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
|
||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
|
||||
<tr>\n\
|
||||
<td style="padding: 2px; white-space: nowrap"><b>'+trt('Login')+' (E-mail)</b></td>\n\
|
||||
<td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="'+win.uid+'_email" name="login">\n\
|
||||
<table id="'+win.uid+'_phone" style="width: 100%; display: none;" cellpadding="0" cellspacing="0"><tr><td style="white-space: nowrap;"><b>+7 ( </b><input type="text" maxlength="3" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" style="width: 35px; display: inline;" id="'+win.uid+'_phone0" value=""><b> ) </b></td><td style="width: 90%;"><input type="text" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" maxlength="7" style="width: 100%;display: inline;" id="'+win.uid+'_phone1" value=""></td></tr></table><br></td>\n\
|
||||
</tr>\n\
|
||||
<tr><td colspan="2" style="text-align: right; padding: 2px;"><input class="button-secondary" id="'+win.uid+'_restore" type="button" style="display: inline;" value="'+trt('Restore')+'"></td></tr>\n\
|
||||
</table>\n\
|
||||
</td></tr>\n\
|
||||
</div>';
|
||||
let str=`<div style="width: 100%; height: 100%; padding: 4px; text-align: left;">
|
||||
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">
|
||||
<tr>
|
||||
<td style="padding: 2px; white-space: nowrap"><b>`+trt('Login')+` (E-mail)</b></td>
|
||||
<td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="`+win.uid+`_email" name="login">
|
||||
<table id="`+win.uid+`_phone" style="width: 100%; display: none;" cellpadding="0" cellspacing="0"><tr><td style="white-space: nowrap;"><b>+7 ( </b><input type="text" maxlength="3" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" style="width: 35px; display: inline;" id="`+win.uid+`_phone0" value=""><b> ) </b></td><td style="width: 90%;"><input type="text" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" maxlength="7" style="width: 100%;display: inline;" id="`+win.uid+`_phone1" value=""></td></tr></table><br></td>
|
||||
</tr>
|
||||
<tr><td colspan="2" style="text-align: right; padding: 2px;"><input class="button-secondary" id="`+win.uid+`_restore" type="button" style="display: inline;" value="`+trt('Restore')+`"></td></tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</div>`;
|
||||
win.setContent(str);
|
||||
|
||||
//Центрируем окно и отображаем тень
|
||||
@ -294,18 +294,18 @@ class DBMSUser
|
||||
{
|
||||
win.showProgressBar();
|
||||
|
||||
var em=document.getElementById(win.uid+'_email').value;
|
||||
let em=document.getElementById(win.uid+'_email').value;
|
||||
|
||||
if(em==''){ document.getElementById(win.uid+'_email').select(); alert(trt('Not_filled_Email_address')); win.hideProgressBar(); return; }
|
||||
if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(trt('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; }
|
||||
|
||||
//Send AJAX reqwest to server
|
||||
var xml='<?xml version="1.0" encoding="utf-8"?>\
|
||||
<metadata fn="7">\
|
||||
<cmd><![CDATA[0]]></cmd>\
|
||||
<login><![CDATA['+em+']]></login>\
|
||||
<captcha><![CDATA[]]></captcha>\
|
||||
</metadata>';
|
||||
let xml=`<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata fn="7">
|
||||
<cmd><![CDATA[0]]></cmd>
|
||||
<login><![CDATA[`+em+`]]></login>
|
||||
<captcha><![CDATA[]]></captcha>
|
||||
</metadata>`;
|
||||
|
||||
//Anonymous object
|
||||
obj=new function(win)
|
||||
|
||||
Reference in New Issue
Block a user