Changeset 27307

Show
Ignore:
Timestamp:
06.05.2013 16:30:00 (6 years ago)
Author:
ak19
Message:

Removed the javascript for logout, and put back the basic logout link that was commented out.

Location:
main/trunk/greenstone2/macros
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/document.dm

    r27297 r27307  
    165165<label id="usercommentfeedback"></label> 
    166166 
    167 <!--<div id="usercommentlogoutlink"><a href="_doc-url_&amp;un=">_text-usercomment-logout_</a></div>--> 
    168 <div id="usercommentlogoutlink"><a href="#" onclick="javascript:logout(); return false;">_text-usercomment-logout_</a></div> 
     167<div id="usercommentlogoutlink"><a href="_doc-url_&amp;un=">_text-usercomment-logout_</a></div> 
    169168</form> 
    170169 
  • main/trunk/greenstone2/macros/style.dm

    r27297 r27307  
    240240    \} 
    241241 
     242    var un = "_cgiargun_"; 
     243    var pw = "_cgiargpw_"; 
     244    var ky = "_cgiargky_"; 
     245    alert ("Username : " + un); 
     246//    alert ("Password : " + pw); 
     247    alert ("Key : " + ky); 
     248 
    242249    var gsapi = new GSAjaxAPI("_gwcgi_","_cgiargc_"); 
    243250     
     
    248255      var date = new Date(int_timestamp); 
    249256      return date.toLocaleDateString() + " " + date.toLocaleTimeString();    
    250    \} 
    251  
    252    // Logout is the following operation 
    253    // _gwcgi_?e=_compressedoptions_&amp;a=_cgiarga_&amp;c=_cgiargc_&amp;cl=_cgiargcl_&amp;d=_cgiargd_&un= 
    254    // Maybe this is better done as a post? 
    255    // http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/ 
    256    function logout() \{ 
    257      var logoutForm = document.createElement("form"); 
    258      logoutForm.method="post" ; 
    259      logoutForm.action = "_gwcgi_"; 
    260  
    261      var params = \{ 
    262          e: "_compressedoptions_", 
    263          a: "_cgiarga_",  
    264          c: "_cgiargc_", 
    265          cl: "_cgiargcl_", 
    266          d: "_cgiargd_", 
    267          un: null 
    268      \}; 
    269  
    270      for (var param in params) \{ 
    271          var myInput = document.createElement("input") ; 
    272              myInput.setAttribute("name", param) ; 
    273          myInput.setAttribute("value", params[param]); 
    274          logoutForm.appendChild(myInput) ; 
    275       \} 
    276       document.body.appendChild(logoutForm) ; 
    277       logoutForm.submit() ; 
    278       document.body.removeChild(logoutForm) ; 
    279257   \} 
    280258