Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 694 of 807  Not logged in ELOG logo
ID Date Icon Author Author Email Category OSdown ELOG Version Subject
  66320   Wed Apr 15 17:57:19 2009 Question Dennis Seitzdenseitz@comcast.netQuestionAll2.7.5Config so that users can delete only their own entries?
I've tried

Deny_Delete = All
Allow Delete = $author

and just
Allow Delete = $author

But either users can delete anyone's entries, or they can't delete any entries.

Am I missing something? If not, can you add the capability to allow users to delete, but only their own entries?

Thanks as usual for a great piece of code!
  66321   Thu Apr 16 08:34:03 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.7.5Re: Config so that users can delete only their own entries?

Dennis Seitz wrote:
I've tried

Deny_Delete = All
Allow Delete = $author

and just
Allow Delete = $author

But either users can delete anyone's entries, or they can't delete any entries.

Am I missing something? If not, can you add the capability to allow users to delete, but only their own entries?

Thanks as usual for a great piece of code!


You cannot put $author into any Allow or Deny option, only explicit login names (not "full" names). What you want however is
Restrict Edit = 1

which lets only the original author either delete or edit entries. If you use that option, you probably want as well
Preset Author = $long_name
Preset on reply Author = $long_name
Preset on duplicate Author = $long_name
Locked Attributes = Author

So a user cannot pretend to be somebody else. You also need a valid "admin user = ..." statement. Note that the admin user always can delete/edit entries. If no admin user is defined, everybody has automatically admin rights, so Restrict Edit has no effect.
  66323   Sat Apr 18 00:33:53 2009 Reply Dennis Seitzdseitz@berkeley.eduQuestionAll2.7.5Re: Config so that users can delete only their own entries?
Thanks for reminding me of that, it will do fine. A suggestion: Separate Restrict Edit into Restrict Edit and Restrict Delete or some functional equivalent. Then we have the choice to restrict one or the other or both. Is that worth doing?


Stefan Ritt wrote:

Dennis Seitz wrote:
I've tried

Deny_Delete = All
Allow Delete = $author

and just
Allow Delete = $author

But either users can delete anyone's entries, or they can't delete any entries.

Am I missing something? If not, can you add the capability to allow users to delete, but only their own entries?

Thanks as usual for a great piece of code!


You cannot put $author into any Allow or Deny option, only explicit login names (not "full" names). What you want however is
Restrict Edit = 1

which lets only the original author either delete or edit entries. If you use that option, you probably want as well
Preset Author = $long_name
Preset on reply Author = $long_name
Preset on duplicate Author = $long_name
Locked Attributes = Author

So a user cannot pretend to be somebody else. You also need a valid "admin user = ..." statement. Note that the admin user always can delete/edit entries. If no admin user is defined, everybody has automatically admin rights, so Restrict Edit has no effect.
  66346   Tue May 5 01:47:36 2009 Question Rich Sterlingrbsterli@juno.comQuestionAll2.7.6Office 2007 file attachments download as zip due to mime config

Submitted as a question because some folks may consider this a bug in IE (but not MS obviously because IE8 does the same).  When you upload a new open XML attachment (Office 2007 file extension, docx, ppts, xlsx, etc) the attachment is not recognized properly in IE and it tries to download as a zip file (since the OOXML is actually is a zipped set of XML docs).  This is something that is widely recognized on the Internet ( http://www.google.com/search?hl=en&q=docx+internet+explorer+zip&aq=1&oq=docx+internet ) but is typically resolved by adding the mime extensions at the web server level. 

Are there any plans to add the new mime extensions to the elogd.c source? (Instead of forcing users to use FireFox or Right click, save-as and rename?

http://www.bram.us/2007/05/25/office-2007-mime-types-for-iis/

Regards,

rbsterli

   {
   ".AI", "application/postscript"}, {
   ".ASC", "text/plain"}, {
   ".BZ2", "application/x-bzip2"}, {
   ".CFG", "text/plain"}, {
   ".CHRT", "application/x-kchart"}, {
   ".CONF", "text/plain"}, {
   ".CSH", "application/x-csh"}, {
   ".CSS", "text/css"}, {
   ".DOC", "application/msword"}, {
   ".DVI", "application/x-dvi"}, {
   ".EPS", "application/postscript"}, {
   ".GIF", "image/gif"}, {
   ".GZ", "application/x-gzip"}, {
   ".HTM", "text/html"}, {
   ".HTML", "text/html"}, {
   ".ICO", "image/x-icon"}, {
   ".JPEG", "image/jpeg"}, {
   ".JPG", "image/jpeg"}, {
   ".JS", "application/x-javascript"}, {
   ".KPR", "application/x-kpresenter"}, {
   ".KSP", "application/x-kspread"}, {
   ".KWD", "application/x-kword"}, {
   ".MP3", "audio/mpeg"}, {
   ".OGG", "application/x-ogg"}, {
   ".PDF", "application/pdf"}, {
   ".PNG", "image/png"}, {
   ".PS", "application/postscript"}, {
   ".RAM", "audio/x-pn-realaudio"}, {
   ".RM", "audio/x-pn-realaudio"}, {
   ".RM", "audio/x-pn-realaudio"}, {
   ".RM", "audio/x-pn-realaudio"}, {
   ".RPM", "application/x-rpm"}, {
   ".RTF", "application/rtf"}, {
   ".SH", "application/x-sh"}, {
   ".TAR", "application/x-tar"}, {
   ".TCL", "application/x-tcl"}, {
   ".TEX", "application/x-tex"}, {
   ".TGZ", "application/x-gzip"}, {
   ".TIF", "image/tiff"}, {
   ".TIFF", "image/tiff"}, {
   ".TXT", "text/plain"}, {
   ".WAV", "audio/x-wav"}, {
   ".XLS", "application/x-msexcel"}, {
   ".XML", "text/xml"}, {
   ".XSL", "text/xml"}, {
   ".ZIP", "application/x-zip-compressed"},

Attachment 1: TEST_IN_DOC_FORMAT.doc
Attachment 2: TEST_IN_DOCX_FORMAT.docx
  66347   Wed May 6 15:30:24 2009 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.7.6Re: Office 2007 file attachments download as zip due to mime config
Rich Sterling wrote:

Are there any plans to add the new mime extensions to the elogd.c source? (Instead of forcing users to use FireFox or Right click, save-as and rename?

 

 Ok, I added the MIME extensions in ELOG Rev. 2196. The forum runs already the updated version, so can you try with the demo attachments from your entry?

  66355   Thu May 7 13:35:32 2009 Reply Rich Sterlingrbsterli@juno.comQuestionAll2.7.6Re: Office 2007 file attachments download as zip due to mime config

Stefan Ritt wrote:
Rich Sterling wrote:

Are there any plans to add the new mime extensions to the elogd.c source? (Instead of forcing users to use FireFox or Right click, save-as and rename?

 

 Ok, I added the MIME extensions in ELOG Rev. 2196. The forum runs already the updated version, so can you try with the demo attachments from your entry?

 It looks good from here!  Thanks!!

Best Regards,

Rich

  66411   Wed Jun 24 15:02:49 2009 Warning Richard Stamperr.stamper@rl.ac.ukBug fixAll2.7.6-2191Auto-increment substitutions broken with records for multiple days
With a logbook defined by 

 [test]
 Theme = default
 Comment = Test of auto-increment
 Attributes = Batch
 Subst Batch = %Y%m%d-##

the auto-incrementing of the Batch attribute within dates works when the logbook contains only entries for
today's date but otherwise will give a batch number of "01" for each entry.  

Changing line 8714 of elogd.c as follows, from:

      /* if date part changed, start over with index */
      if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) != 0)
         old_index = 0;   
      else
         /* retrieve old index */
      if (atoi(attrib[index] + loc) > old_index)
         old_index = atoi(attrib[index] + loc);
to
      /* if date part changed, start over with index */
      if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) != 0)
         break;            /* <------------- */
      else
         /* retrieve old index */
      if (atoi(attrib[index] + loc) > old_index)
         old_index = atoi(attrib[index] + loc);

appears to fix this bug when I test it.  This code is inside a loop stepping back through all log entries, and
the variable old_index is already set to zero before the loop. The existing code resets old_index whenever the
prefix of the attribute string (containing a date) does not match the "current" value of that prefix as found in
retstr (set using strftime).  So, if there are any records for dates other than today then old_index is reset
and attribute values will be set with the counter = (old_index+1) = 1.  The modified version stops comparisons
once a different date is seen, but assumes that records are date ordered.  An alternative patch:

      /* if date part matches */
      if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) == 0)
          /* retrieve old index */
         if (atoi(attrib[index] + loc) > old_index)
            old_index = atoi(attrib[index] + loc);
  
does not make this assumption and also appears to work OK when I test it.
  66414   Thu Jun 25 10:09:18 2009 Reply Stefan Rittstefan.ritt@psi.chBug fixAll2.7.6-2191Re: Auto-increment substitutions broken with records for multiple days
> An alternative patch:
> 
>       /* if date part matches */
>       if (strlen(attrib[index]) > 0 && strncmp(attrib[index], retstr, loc) == 0)
>           /* retrieve old index */
>          if (atoi(attrib[index] + loc) > old_index)
>             old_index = atoi(attrib[index] + loc);
>   
> does not make this assumption and also appears to work OK when I test it.

Yes, this is the right one, it searches all entries to have the same date than the current one, and then looks for the 
largest index which will be stored in old_index and later incremented by one. I committed your patch to the 
repository. Thanks a lot.
ELOG V3.1.5-3fb85fa6