diff --git a/metadata/dbms/login.js b/metadata/dbms/login.js index 2e6ce3c..2630f1f 100644 --- a/metadata/dbms/login.js +++ b/metadata/dbms/login.js @@ -111,7 +111,7 @@ class DBMSUser
\n\ \n\ \n\ -
\n\ +
\n\ \n\ \n\ \n\ @@ -222,223 +222,15 @@ class DBMSUser this.m_ls[i]=null; } }; -} - - -/* - * Login form (not cross-source). - * [^\x00-\x7F]+ - */ -/*function TLogin() -{ - this.showLoginForm = function() - { - this.win.BuildGUI(10,10); - this.win.shadow=true; - this.win.setCaption(document.createTextNode("Enter")); - - var str='
\n\ - \n\ - \n\ - \n\ - \n\ -
\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -
'+trt('Login')+' (E-mail):
Password:
\n\ -
\n\ -
'; - - this.win.setContent(str); - - var e=document.getElementById('TLogin_E'+this.uid); - e.onclick=function(obj){ return function(){obj.onEnter(); };}(this); - e=document.getElementById('tcLogin'+this.uid); - e.onkeydown=function(obj){ return function(e){ if(e.which==13) obj.onEnter(); return true; };}(this); - e=document.getElementById('tcPassword'+this.uid); - e.onkeydown=function(obj){ return function(e){ if(e.which==13) obj.onEnter(); return true; };}(this); - - this.win.setSize("300px","155px"); - this.win.setCenter(); - this.win.obj=this; - - this.win.hide(false); - }; - - - this.onEnter=function() - { - var login=document.getElementById('tcLogin'+this.uid).value; - var password=document.getElementById('tcPassword'+this.uid).value; - if(login=='' || password=='') - { str="Not filled in the required fields: "; - if(login=='') str+='"'+trt('Login')+' (E-mail)"'; - if(login=='' && password=='') str+=', '; - if(password=='') str+='"Password"'; - str+='!'; - alert(str); - }else - this.Login(login,password,document.getElementById('save_'+this.uid).checked); - }; - - this.applyReq=function(req,fn,node) - { -// alert(getXMLNodeSerialisation(node)); - - if (fn==-1) - { - alert(findFirstNode(node,'#cdata-section').nodeValue); - }else if (fn==4) - { - //nodeToTable(node); - }else if (fn==7) - { - var cmd=getCdataValue(findFirstNode(node,"cmd")); -//alert('cmd='+cmd); - if(cmd==='0') - { - this.m_lo=getCdataValue(findFirstNode(node,"login")) == '0' ? false : true; - if(!this.m_lo) - { this.showLoginForm(); - }else - { - var name=getCdataValue(findFirstNode(node,"name")); - var user_name=document.getElementById('user_name'); - if(user_name!=null) user_name.innerHTML=name; - - //Информируем слушатеелй о логине - for(i=0;i\n\ - \n\ - '; - -//alert(xs); - - if(this.request.callServer(ScriptName,xs)) - { - this.win.showProgressBar(); - } - }; - - //logout current user - this.Exit=function() - { - if(this.request.callServer(ScriptName,'')) - { - setCookie('GUID', '', 60, '/','',''); - showProgressBar(document.body); - } - }; - - this.addListener=function(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\n\ + showRestoreForm() + { + var win=new TWin(true); + win.BuildGUI(10,10); + win.setCaption(trt("Password_recovery")); + + str='
\n\ \n\ \n\ \n\ @@ -449,30 +241,30 @@ function showRestoreForm()
'+trt('Login')+' (E-mail)
\n\ \n\
'; - document.getElementById('TWin_Co_'+win.tWinId).innerHTML=str; + document.getElementById('TWin_Co_'+win.tWinId).innerHTML=str; - win.setSize("300px","100px"); + win.setSize("300px","100px"); - //Центрируем окно и отображаем тень - if(win.tbl.offsetHeight>win.div.offsetHeight) win.div.style.height=win.tbl.offsetHeight+"px"; - if(win.tbl.offsetWidth>win.div.offsetWidth) win.div.style.width=win.tbl.offsetWidth+"px"; - win.setCenter(); - win.shadow=true; - win.hide(false); + //Центрируем окно и отображаем тень + if(win.tbl.offsetHeight>win.div.offsetHeight) win.div.style.height=win.tbl.offsetHeight+"px"; + if(win.tbl.offsetWidth>win.div.offsetWidth) win.div.style.width=win.tbl.offsetWidth+"px"; + win.setCenter(); + win.shadow=true; + win.hide(false); - //Click on restore button - var obj=null; - obj=document.getElementById(win.uid+'_restore'); - if(obj!=null) - { - obj.onclick=function(win) - { return function() + //Click on restore button + var obj=null; + obj=document.getElementById(win.uid+'_restore'); + if(obj!=null) + { + obj.onclick=function(win) + { return function() { win.showProgressBar(); //showProgressBar(document.getElementById('TWin_DT_'+win.tWinId),win.uid); - + var 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; } @@ -514,7 +306,7 @@ function showRestoreForm() }else if(fn==7) { - alert(findFirstNode(node,'#cdata-section').nodeValue); + alert(findFirstNode(node,'#cdata-section').nodeValue); this.win.Close(); } } @@ -534,8 +326,11 @@ function showRestoreForm() var call=new myXMLHttpRequest(obj); call.callServer(ScriptName,xml); - + }; - }(win); + }(win); + } } -} \ No newline at end of file + +} + diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php index 1777b40..478a6a5 100644 --- a/metadata/dbms/records.php +++ b/metadata/dbms/records.php @@ -223,7 +223,7 @@ /*if($_SESSION['USER_ID']==null && $_COOKIE['GUID']!=null) { $res = $db->query("select * from ".$Schema."p__Login(null,null,null,'".$_COOKIE['GUID']."');"); - //$res = $db->query("select * from \"p__Login_1\"(null,null,null,'".$_COOKIE['GUID']."');"); + //$res = $db->query("select * from p__Login_1(null,null,null,'".$_COOKIE['GUID']."');"); if($res->rowCount()>0) { $result = $res->fetch(PDO::FETCH_ASSOC); @@ -924,7 +924,6 @@ } }elseif($cmd==1) //Logout { - //filter_input(INPUT_COOKIE, 'S_HASH', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1))); $sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('object',$_SESSION['USER_ID']).';'; try { $db->exec($sql); diff --git a/metadata/dbms/tools.js b/metadata/dbms/tools.js index f8ae8fe..58446b2 100644 --- a/metadata/dbms/tools.js +++ b/metadata/dbms/tools.js @@ -186,7 +186,7 @@ function loadContent(url,obj) } //Вывести текст поверх окон с кнопочкой OK -function alert2(title,text) +function alert2(title,text,okFunc=null) { let win=new TWin(true); win.BuildGUI(10,10); @@ -204,7 +204,7 @@ function alert2(title,text) win.setContent(html); let obj=document.getElementById(win.uid+'_close'); - if(obj!=null) obj.onclick=function(win){return function(){ win.Close(); };}(win); + if(obj!=null) obj.onclick=function(win,okFunc){return function(){ win.Close(); if(okFunc!=null) okFunc(); };}(win,okFunc); win.setSize("300px","150px"); win.setCenter(); win.shadow=true; diff --git a/metadata/tree/treetools.php b/metadata/tree/treetools.php index c30cf44..ab69d38 100644 --- a/metadata/tree/treetools.php +++ b/metadata/tree/treetools.php @@ -502,11 +502,8 @@ function getSiteMap($nParent,$nParams,$db,$first,$path) } $rСol.=''."\n"; - if($url=='') - { $url=getHashFromPath($path.$treeid.';'.$fid.';'); - } $result.=' '."\n"; - $result.=' http://'.$_SERVER["SERVER_NAME"].'/shop/'.$url.'.html'."\n"; + $result.=' http://'.$_SERVER["SERVER_NAME"].$url.''."\n"; $result.=' '.$date.''."\n"; $result.=' daily'."\n"; $result.=' '."\n";