+ MPDF 6.1
This commit is contained in:
@ -1,8 +1,21 @@
|
||||
|
||||
function TUser()
|
||||
class DBMSUser
|
||||
{
|
||||
constructor(){
|
||||
this.divsh=null;
|
||||
this.id=null;
|
||||
this.name='';
|
||||
this.surname='';
|
||||
this.patronymic='';
|
||||
this.temp=false;
|
||||
this.role='';
|
||||
this.m_ls=new Array(); //Listeners called OnLogin function.
|
||||
|
||||
this.applyReq=function(req,fn,node)
|
||||
//Запрашиваю данные о текущем пользователе с сервера
|
||||
//this.LoadData();
|
||||
}
|
||||
|
||||
applyReq(req,fn,node)
|
||||
{
|
||||
//alert(getXMLNodeSerialisation(node));
|
||||
this.showShadow(false);
|
||||
@ -72,7 +85,7 @@ function TUser()
|
||||
|
||||
};
|
||||
//Display login and registration form
|
||||
this.showLoginForm = function()
|
||||
showLoginForm()
|
||||
{
|
||||
if(this.win==null || this.win.closed)
|
||||
{
|
||||
@ -141,7 +154,7 @@ function TUser()
|
||||
}
|
||||
};
|
||||
//logout current user
|
||||
this.Logout = function()
|
||||
Logout()
|
||||
{
|
||||
xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[1]]></cmd></metadata>';
|
||||
var request=new TRequest(this);
|
||||
@ -152,13 +165,13 @@ function TUser()
|
||||
};
|
||||
|
||||
//Checking the session without its extension, if it is completed, we display the authorization window.
|
||||
this.checkSession = function()
|
||||
checkSession()
|
||||
{
|
||||
$.getJSON('../session',{},function(thiz){return function(data){ if(data.result=='ERROR'){thiz.showLoginForm();} };}(this));
|
||||
setTimeout(function(thiz){return function(){thiz.checkSession();};}(this), 10000);
|
||||
};
|
||||
|
||||
this.showShadow = function(visible)
|
||||
showShadow(visible)
|
||||
{
|
||||
if(visible)
|
||||
{
|
||||
@ -172,7 +185,7 @@ function TUser()
|
||||
};
|
||||
|
||||
//Функция запрашивает информацию о текущем пользователе с сервера
|
||||
this.LoadData = function()
|
||||
LoadData()
|
||||
{
|
||||
var r = new TRequest(this);
|
||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||
@ -182,7 +195,7 @@ function TUser()
|
||||
}
|
||||
};
|
||||
//Check whether the already authorized (+ attempt to log in through "hash").
|
||||
this.isLogined=function()
|
||||
isLogined()
|
||||
{
|
||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||
var request=new TRequest(this);
|
||||
@ -196,30 +209,18 @@ function TUser()
|
||||
}
|
||||
};
|
||||
|
||||
this.addListener=function(l)
|
||||
addListener(l)
|
||||
{ if(l.OnLogin==null) alert('Object does not have the function "OnLogin()"!');
|
||||
this.m_ls[this.m_ls.length]=l;
|
||||
};
|
||||
|
||||
this.remListener=function(l)
|
||||
{ for(i=0;i<this.m_ls.length;i++)
|
||||
{ if(this.m_ls[i]==l)
|
||||
remListener(l){
|
||||
for(let i=0;i<this.m_ls.length;i++){
|
||||
if(this.m_ls[i]==l)
|
||||
this.m_ls[i]=null;
|
||||
}
|
||||
};
|
||||
|
||||
this.divsh=null;
|
||||
this.id=null;
|
||||
this.name='';
|
||||
this.surname='';
|
||||
this.patronymic='';
|
||||
this.temp=false;
|
||||
this.role='';
|
||||
this.m_ls=new Array(); //Listeners called OnLogin function.
|
||||
|
||||
//Запрашиваю данные о текущем пользователе с сервера
|
||||
//this.LoadData();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -493,7 +494,10 @@ function showRestoreForm()
|
||||
|
||||
//загрузился xml документ начинаем его разбирать (по id функции в документе)
|
||||
var xmldoc = xmlHttpRequest.responseXML
|
||||
if(xmldoc==null) alert(_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText);
|
||||
if(xmldoc==null) {
|
||||
alert2(_('Alert'), _('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
var node = xmldoc.documentElement;
|
||||
if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n "+_("No_data")+"!\n"+xmlHttpRequest.responseText);
|
||||
|
||||
Reference in New Issue
Block a user