не знаю что
This commit is contained in:
@ -18,17 +18,19 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
//import java.util.Iterator;
|
//import java.util.Iterator;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.CRC32;
|
||||||
import java.util.zip.Checksum;
|
import java.util.zip.Checksum;
|
||||||
|
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import io.jsonwebtoken.Jws;
|
||||||
|
import io.jsonwebtoken.Jwts;
|
||||||
import jakarta.servlet.ServletContext;
|
import jakarta.servlet.ServletContext;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.transform.OutputKeys;
|
import javax.xml.transform.OutputKeys;
|
||||||
@ -78,6 +80,7 @@ import org.xml.sax.InputSource;
|
|||||||
|
|
||||||
import tctable.Tools;
|
import tctable.Tools;
|
||||||
import tools.EmailUtility;
|
import tools.EmailUtility;
|
||||||
|
import tools.Translation;
|
||||||
import tools.User;
|
import tools.User;
|
||||||
|
|
||||||
|
|
||||||
@ -105,9 +108,10 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Документация по @RequestBody http://javastudy.ru/spring-mvc/json-xml/ application/xml
|
//Документация по @RequestBody http://javastudy.ru/spring-mvc/json-xml/ application/xml
|
||||||
@RequestMapping(value = "/api/dbms/records.xyz",method = {RequestMethod.POST,RequestMethod.GET}) //,produces = "text/plain; charset=utf-8"
|
@RequestMapping(value = "/api/dbms/v09/records.xyz",method = {RequestMethod.POST,RequestMethod.GET}) //,produces = "text/plain; charset=utf-8"
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<String> ajaxRecords(@ModelAttribute User user, @RequestBody(required = false) byte[] reqData, @RequestParam(required=false,name="lng") String language_id) {
|
public ResponseEntity<String> ajaxRecords(@ModelAttribute User user, @RequestBody(required = false) byte[] reqData, @RequestParam(required=false,name="lng") String language_id) {
|
||||||
|
|
||||||
final HttpHeaders httpHeaders= new HttpHeaders();
|
final HttpHeaders httpHeaders= new HttpHeaders();
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
@ -187,13 +191,11 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
logger.info("Connect is OK!");
|
logger.info("Connect is OK!");
|
||||||
} else {
|
} else {
|
||||||
error=true;
|
error=true;
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[An error occurred while connecting to the database!]]></metadata>";
|
|
||||||
result=sendError(1,"An error occurred while connecting to the database!");
|
result=sendError(1,"An error occurred while connecting to the database!");
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[An error occurred while connecting to the database!]]></metadata>";
|
|
||||||
result=sendError(1,"An error occurred while connecting to the database!");
|
result=sendError(1,"An error occurred while connecting to the database!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +207,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[An set TYPE_SCROLL_SENSITIVE!]]></metadata>";
|
|
||||||
result=sendError(1,"An set TYPE_SCROLL_SENSITIVE!");
|
result=sendError(1,"An set TYPE_SCROLL_SENSITIVE!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +297,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage() + " SQL=" + sql_query);
|
logger.info(ex.getMessage() + " SQL=" + sql_query);
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
}finally {
|
}finally {
|
||||||
@ -324,7 +324,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
}finally {
|
}finally {
|
||||||
@ -352,7 +351,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
}finally {
|
}finally {
|
||||||
@ -380,7 +378,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
}finally {
|
}finally {
|
||||||
@ -395,7 +392,7 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
xml += "<metadata fn=\"0\"></metadata>";
|
xml += "<metadata fn=\"0\"></metadata>";
|
||||||
}
|
}
|
||||||
|
|
||||||
result=getText(conn,xml,user);
|
result=trts(conn,xml,user);
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
|
|
||||||
} else if (fn != null && fn.equals("1")) {
|
} else if (fn != null && fn.equals("1")) {
|
||||||
@ -500,7 +497,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
result=xmlstring;
|
result=xmlstring;
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
//logger.info("xmlstring = " + xmlstring);
|
|
||||||
}
|
}
|
||||||
stt.close();
|
stt.close();
|
||||||
rs.close();
|
rs.close();
|
||||||
@ -508,7 +504,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
rs=null;
|
rs=null;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -616,13 +611,11 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
result=xmlstring;
|
result=xmlstring;
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
//logger.info("xmlstring = " + xmlstring);
|
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
stt.close();
|
stt.close();
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -708,13 +701,11 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
result=xmlstring;
|
result=xmlstring;
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
//logger.info("xmlstring = " + xmlstring);
|
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
stt.close();
|
stt.close();
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -822,7 +813,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -967,7 +957,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result=json.toString();
|
result=json.toString();
|
||||||
//logger.info("json = " + json);
|
|
||||||
|
|
||||||
rs.close();
|
rs.close();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
@ -977,7 +966,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -1066,7 +1054,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
result=xmlstring;
|
result=xmlstring;
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
//logger.info("xmlstring = " + xmlstring);
|
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
stt.close();
|
stt.close();
|
||||||
@ -1074,7 +1061,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
stt=null;
|
stt=null;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -1203,7 +1189,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
result=xmlstring;
|
result=xmlstring;
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
//logger.info("xmlstring = " + xmlstring);
|
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
stt.close();
|
stt.close();
|
||||||
@ -1211,7 +1196,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
stt=null;
|
stt=null;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage()+"\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -1219,7 +1203,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Could not find the requested node!]]></metadata>";
|
|
||||||
result=sendError(1,"Could not find the requested node!");
|
result=sendError(1,"Could not find the requested node!");
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -1552,7 +1535,7 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
|
|
||||||
} else if (fn != null && fn.equals("8")) {
|
} else if (fn != null && fn.equals("8")) {
|
||||||
//Select information about the current user
|
//Select information about the current user for generated report
|
||||||
String uName = "<br>";
|
String uName = "<br>";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1573,7 +1556,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
stt=null;
|
stt=null;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -1721,7 +1703,7 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
expr = xpath.compile("objects-list/@d");
|
expr = xpath.compile("objects-list/@d");
|
||||||
|
|
||||||
writer.write(" <table border=\"1\" cellspacing=\"0\">\n");
|
writer.write(" <table border=\"1\" cellspacing=\"0\">\n");
|
||||||
writer.write(" <caption><b>" + getText(conn,"" + expr.evaluate(nTypeS, XPathConstants.STRING),user) + "</b></caption>\n");
|
writer.write(" <caption><b>" + trts(conn,"" + expr.evaluate(nTypeS, XPathConstants.STRING),user) + "</b></caption>\n");
|
||||||
writer.write(" <thead>\n");
|
writer.write(" <thead>\n");
|
||||||
writer.write(" <tr>");
|
writer.write(" <tr>");
|
||||||
|
|
||||||
@ -1729,7 +1711,7 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
Object exprResult = expr.evaluate(nTypeS, XPathConstants.NODESET);
|
Object exprResult = expr.evaluate(nTypeS, XPathConstants.NODESET);
|
||||||
nodeList = (NodeList) exprResult;
|
nodeList = (NodeList) exprResult;
|
||||||
for (int i = 0; i < nodeList.getLength(); i++) {
|
for (int i = 0; i < nodeList.getLength(); i++) {
|
||||||
writer.write("<td bgcolor=\"#d1d1d1\" width=\"" + nodeList.item(i).getAttributes().getNamedItem("width").getNodeValue() + "px\"><b>" + getText(conn,nodeList.item(i).getAttributes().getNamedItem("d").getNodeValue(),user)
|
writer.write("<td bgcolor=\"#d1d1d1\" width=\"" + nodeList.item(i).getAttributes().getNamedItem("width").getNodeValue() + "px\"><b>" + trts(conn,nodeList.item(i).getAttributes().getNamedItem("d").getNodeValue(),user)
|
||||||
+ "</b></td>");
|
+ "</b></td>");
|
||||||
}
|
}
|
||||||
writer.write(" </tr>\n");
|
writer.write(" </tr>\n");
|
||||||
@ -1755,7 +1737,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage());
|
result=sendError(1,"Error: " + ex.getMessage());
|
||||||
error=true;
|
error=true;
|
||||||
} finally {
|
} finally {
|
||||||
@ -1764,8 +1745,9 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Отправляем название файла на сервер
|
//Отправляем название файла клиенту
|
||||||
result="<metadata fn=\"8\"><file><![CDATA[" + tmpName + "]]></file></metadata>";
|
result="<metadata fn=\"8\"><file><![CDATA[" + tmpName + "]]></file></metadata>";
|
||||||
|
httpHeaders.setContentType(MediaType.APPLICATION_XML);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
stt.close();
|
stt.close();
|
||||||
@ -1773,7 +1755,6 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
stt=null;
|
stt=null;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
logger.info(ex.getMessage());
|
logger.info(ex.getMessage());
|
||||||
//result="<metadata fn=\"-1\"><![CDATA[Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query + "]]></metadata>";
|
|
||||||
result=sendError(1,"Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query);
|
result=sendError(1,"Error: " + ex.getMessage() + "\n\nSQL query: " + sql_query);
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
@ -2265,7 +2246,7 @@ public class DBMSRecords implements ServletContextAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Translate text by patterns
|
//Translate text by patterns
|
||||||
public String getText(Connection conn,String text,User user) {
|
public String trts(Connection conn,String text,User user) {
|
||||||
int pos1 = 0;
|
int pos1 = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
pos1 = text.indexOf("trt('", pos1);
|
pos1 = text.indexOf("trt('", pos1);
|
||||||
|
|||||||
@ -223,27 +223,25 @@ class DBMSUser
|
|||||||
//Функция запрашивает информацию о текущем пользователе с сервера
|
//Функция запрашивает информацию о текущем пользователе с сервера
|
||||||
LoadData()
|
LoadData()
|
||||||
{
|
{
|
||||||
var r = new TRequest(this);
|
let r = new TRequest(this);
|
||||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
let xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||||
if(r.callServer(ScriptName,xs))
|
if(r.callServer(ScriptName,xs))
|
||||||
{
|
{
|
||||||
this.showShadow(true);
|
this.showShadow(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//Check whether the already authorized (+ attempt to log in through "hash").
|
//Check whether the already authorized (+ attempt to log in through "hash").
|
||||||
isLogined()
|
/*isLogined()
|
||||||
{
|
{
|
||||||
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
let xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
|
||||||
var request=new TRequest(this);
|
let request=new TRequest(this);
|
||||||
if(request.callServer(ScriptName,xs))
|
if(request.callServer(ScriptName,xs))
|
||||||
{
|
{
|
||||||
this.showShadow(true);
|
this.showShadow(true);
|
||||||
|
|
||||||
alert(ScriptName+" = "+xs);
|
alert(ScriptName+" = "+xs);
|
||||||
|
|
||||||
//m_winPP.showProgressBar();
|
//m_winPP.showProgressBar();
|
||||||
}
|
}
|
||||||
};
|
};*/
|
||||||
|
|
||||||
addListener(l)
|
addListener(l)
|
||||||
{ if(l.OnLogin==null) alert('Object does not have the function "OnLogin()"!');
|
{ if(l.OnLogin==null) alert('Object does not have the function "OnLogin()"!');
|
||||||
|
|||||||
@ -924,7 +924,7 @@
|
|||||||
header('Content-type: text/xml');
|
header('Content-type: text/xml');
|
||||||
echo $xmlstring;
|
echo $xmlstring;
|
||||||
}else
|
}else
|
||||||
if ($fn==7)//Залогинеться
|
if ($fn==7)//Залогинеться (TODO логин происходит через JWT в другом коде на java)
|
||||||
{
|
{
|
||||||
$cmd=getCdataValue(findFirstNode($reqNode,"cmd"));
|
$cmd=getCdataValue(findFirstNode($reqNode,"cmd"));
|
||||||
$login=getCdataValue(findFirstNode($reqNode,"login"));
|
$login=getCdataValue(findFirstNode($reqNode,"login"));
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
//var ScriptName='../api/dbms/records.xyz'; //POST
|
//var ScriptName='../api/dbms/v09/records.xyz'; //POST
|
||||||
//var ScriptDName='../download';
|
//var ScriptDName='../download';
|
||||||
//var ScriptUName='../upload';
|
//var ScriptUName='../upload';
|
||||||
//var ScriptRName='../reports'; //GET For download reports (?file=name)
|
//var ScriptRName='../reports'; //GET For download reports (?file=name)
|
||||||
|
|||||||
@ -38,7 +38,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": ["mpdf.php", "classes"]
|
"classmap": [
|
||||||
|
"mpdf.php", "classes"]
|
||||||
},
|
},
|
||||||
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
*
|
.gitignore
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
|||||||
2
metadata/include/mpdf-6.1/tmp/.gitignore
vendored
2
metadata/include/mpdf-6.1/tmp/.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
*
|
.gitignore
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
*
|
.gitignore
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
|||||||
@ -1,12 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Из файла file.js делаем file_v123456789.js добавив время
|
// Из файла file.js делаем file_v123456789.js добавив время
|
||||||
function getScript($path)
|
function getScript($path,$pathURL="")
|
||||||
{
|
{
|
||||||
if (file_exists($_SERVER['DOCUMENT_ROOT'].$path))
|
if (file_exists($_SERVER['DOCUMENT_ROOT'].$path))
|
||||||
{
|
{
|
||||||
|
if($pathURL!="")
|
||||||
|
{
|
||||||
|
return '<script src="' . $pathURL.'?v='.filectime($_SERVER['DOCUMENT_ROOT'] . $path). '"></script>' . "\n";
|
||||||
|
}else {
|
||||||
return '<script src="' . beforeLast($path, '.') . '_v' . filectime($_SERVER['DOCUMENT_ROOT'] . $path) . '.' . afterLast($path, '.') . '"></script>' . "\n";
|
return '<script src="' . beforeLast($path, '.') . '_v' . filectime($_SERVER['DOCUMENT_ROOT'] . $path) . '.' . afterLast($path, '.') . '"></script>' . "\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,8 @@
|
|||||||
*/
|
*/
|
||||||
function findFirstNode($node, $nodename)
|
function findFirstNode($node, $nodename)
|
||||||
{
|
{
|
||||||
|
if($node==null) return null;
|
||||||
|
|
||||||
$mas=array();
|
$mas=array();
|
||||||
$pos=0;
|
$pos=0;
|
||||||
$mas[$pos] = $node->firstChild;
|
$mas[$pos] = $node->firstChild;
|
||||||
|
|||||||
@ -285,7 +285,7 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню
|
|||||||
pn=pn.parent;
|
pn=pn.parent;
|
||||||
}
|
}
|
||||||
//Шаблон кнопки по умолчанию
|
//Шаблон кнопки по умолчанию
|
||||||
if(str=='') str='<div style="border: 1px solid #dddddd;" onClick="window.location.href = \'./?path=${path}\'" onMouseOver="this.style.backgroundColor=\'#ffffff\'; this.style.textDecoration=\'underline\';" onMouseOut="this.style.backgroundColor=\'#dddddd\'; this.style.textDecoration=\'none\';"><table style="width: 100%;"><tr><td style="vertical-align: middle;"><nobr> <a href="./?path=${path}" style="${select}">${name}</a> </nobr></td><td style="vertical-align: middle; width: 10px; padding-right: 4px;"><img src="./img/next.gif" alt="" align="right" style="vertical-align: middle; display: ${none};"></td></tr></table></div>';
|
if(str=='') str='<div style="border: 1px solid #dddddd;" onClick="window.location.href = \'./?path=${path}\'" onMouseOver="this.style.backgroundColor=\'#ffffff\'; this.style.textDecoration=\'underline\';" onMouseOut="this.style.backgroundColor=\'#dddddd\'; this.style.textDecoration=\'none\';"><table style="width: 100%;"><tr><td style="vertical-align: middle;"><nobr> <a href="?path=${path}" style="${select}">${name}</a> </nobr></td><td style="vertical-align: middle; width: 10px; padding-right: 4px;"><img src="./img/next.gif" alt="" align="right" style="vertical-align: middle; display: ${none};"></td></tr></table></div>';
|
||||||
|
|
||||||
str=str.replace(/\${path}/g, tn.getTreePath());
|
str=str.replace(/\${path}/g, tn.getTreePath());
|
||||||
str=str.replace(/\${hash}/g, crc32(tn.getTreePath()));
|
str=str.replace(/\${hash}/g, crc32(tn.getTreePath()));
|
||||||
@ -417,7 +417,7 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню
|
|||||||
if(str!='') break;
|
if(str!='') break;
|
||||||
nTmp=nTmp.parentNode;
|
nTmp=nTmp.parentNode;
|
||||||
}
|
}
|
||||||
if(str=='') str='<div style="border: 1px solid #dddddd;" onClick="window.location.href = \'./?path=${path}\'" onMouseOver="this.style.backgroundColor=\'#ffffff\'; this.style.textDecoration=\'underline\';" onMouseOut="this.style.backgroundColor=\'#dddddd\'; this.style.textDecoration=\'none\';"><table style="width: 100%;"><tr><td style="vertical-align: middle;"><nobr> <a href="./?path=${path}">${name}</a> </nobr></td><td style="vertical-align: middle; width: 10px; padding-right: 4px;"><img src="./img/next.gif" alt="" align="right" style="vertical-align: middle; display: ${none};"></td></tr></table></div>';
|
if(str=='') str='<div style="border: 1px solid #dddddd;" onClick="window.location.href = \'./?path=${path}\'" onMouseOver="this.style.backgroundColor=\'#ffffff\'; this.style.textDecoration=\'underline\';" onMouseOut="this.style.backgroundColor=\'#dddddd\'; this.style.textDecoration=\'none\';"><table style="width: 100%;"><tr><td style="vertical-align: middle;"><nobr> <a href="?path=${path}">${name}</a> </nobr></td><td style="vertical-align: middle; width: 10px; padding-right: 4px;"><img src="./img/next.gif" alt="" align="right" style="vertical-align: middle; display: ${none};"></td></tr></table></div>';
|
||||||
str=str.replace(/\${path}/g, this.m_tn[this.m_tn.length-1].getTreePath());
|
str=str.replace(/\${path}/g, this.m_tn[this.m_tn.length-1].getTreePath());
|
||||||
str=str.replace(/\${name}/g, getCdataValue(nodeTree));
|
str=str.replace(/\${name}/g, getCdataValue(nodeTree));
|
||||||
str=str.replace(/\${none}/g, nodeTree.getAttribute("c")=='1' ? 'block' : 'none');
|
str=str.replace(/\${none}/g, nodeTree.getAttribute("c")=='1' ? 'block' : 'none');
|
||||||
|
|||||||
Reference in New Issue
Block a user