Ignore:
Timestamp:
2013-05-03T21:28:37+12:00 (11 years ago)
Author:
ak19
Message:

Username field should not be cleared as it's no longer hidden and stores the logged in user. Also added a logout for the add comments feature, but there's probably a better way to do this, though the admin pages don't provide a logout and require you to log in repeatedly.

File:
1 edited

Legend:

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

    r27296 r27297  
    250250   \}
    251251
     252   // Logout is the following operation
     253   // _gwcgi_?e=_compressedoptions_&a=_cgiarga_&c=_cgiargc_&cl=_cgiargcl_&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) ;
     279   \}
    252280
    253281    function loadUserComments() \{
Note: See TracChangeset for help on using the changeset viewer.