Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 233 of 796  Not logged in ELOG logo
ID Dateup Icon Author Author Email Category OS ELOG Version Subject
  1928   Thu Sep 7 17:17:17 2006 Reply Gerald Ebberinkg.h.p.ebberink@nclr.nlBug reportLinux2.6.2-1714Re: reply option in elog client not working

Gerald Ebberink wrote:
I have made patch witch solves the problem partialy.

If there are not no attachments this patch works.... (But since I have attachments I'll have to dig in deeper in the code.

Attached you will find the diff.

Now I am digging deeper, and I have a question:

In the function retrive_elog near line 427 a start is made with putting the attributes in an array.
As far as I can see there is no exception for the Attachment attribute. Where this attribute can be very large (e.g. many files attached) and overrun to the boundary variable (in the function submit_elog function). At least that is where I find end of my attachment string.

Could Mr. Ritt please shine some light on this, becouse I
  1929   Thu Sep 7 22:06:00 2006 Smile Arno Teunissea.teeling3@chello.nlQuestionWindows elog perl script and the command prompt and eof
hello

Just wrote a quick and dirty perl script ( See Attachment ) that let's you enter a record into the database. Put it into the directory where the config file is located. It look's at the "attributes = " and the "required attributes = "
within a section in the elog configuration file. The script is using elog.exe to accomplish this.

One problem with the script is that you must press Control_Z ( ^Z ) to store the data into the database.
Does anybody know how to prevent this ? It works also when redirecting the data into the script with a file input.txt. ( add2elog.pl confgi.cfg logbook < input.txt )

I Know this is NOT an elog question but maybe someone is happy with the script and has the answer for me.
Attachment 1: add2elog.pl
=pod

elog -h hostname [-p port] [-l logbook]
     [-w password]
     [-u username password]
     -a <attribute1>=<value1>
     -a <attribute2>=<value2>
     ...
     -f attachment1
     -f attachment2
     ...
     -m textfile | text



This little perlscript is intented to enter attributes into elog with elog.exe from 
the command line. 

The script checks the "attributes" and the "required attributes". When a required
attribute is needed the users sees a "*" after the attributes name.



=cut


if ( $#ARGV <1 ) {
	print "Usage : $0 Configfile.cfg logbookname\n"; 
  print "Assumed is that you run this in the directory below the logbooks\n";
  print "directory.\n"; 
  exit;

}


$LOGBOOK = $ARGV[1];

chomp $LOGBOOK;
print "Logbook : $LOGBOOK\n";


$INSTALLDIR='c:/program files/elog';

$LOGBOOK_DIR='c:/program files/elog/logbooks';
# $CFGFILE = 'c:/program files/elog/contacts.cfg' ; # can have multiple logbooks
$CFGFILE = $ARGV[0];
chomp $CFGFILE;
print "Config file : $CFGFILE<< \n";

open ( CFG, "< $CFGFILE") or die "could not find config file\n";

while ( <CFG> ) {
	# find the logbook section
		chomp;
	next if not /^[$LOGBOOK\]/;
	while (<CFG> ) {
		last if /^\s*[.*\]\s*$/ ; # Next section 
		if ( /^attributes\s*=\s*/i ) {
			chomp;
			s/\s*$//;
			s/^Attributes\s*=\s*//i;
			@attributes = split(/\s*,\s*/);
			#print "Found it\n";
			next;
		}elsif ( /^Required\s*Attributes\s*=\s*/i ) {
			 chomp;
			 s/\s*$//;	# remove the last white space if there is one
			 s/^Required Attributes\s*=\s*//i;
			 @RAttributes = split (/\s*,\s*/);
			 # last; # this assumes that "Required Attributes" comes after "Attributes"
    }
   }
 }
close CFG;

## Nothing usefull found , wrong config file ???
if ( scalar (@attributes) == 0 ){
	print "Nothing found\n";
	exit;
}

for ( @RAttributes ) {
		#print "==>$_<==\n";
		$RAttributes{$_} = $_ ;
}
# CHECK the RAttributes hash
#while (( $KEY, $VALUE ) = each %RAttributes ) {
#		print "Required Attribute : $VALUE\n";
#}




for ( @attributes ) { 
		print "$_ " ;
		$ATTR = $_;
	if ( exists( $RAttributes{$_} )) {
		print "* : ";
		$flag=1;
	} else {
		print ": ";
		$flag =0;
	}
	
	$HASH{$_} = <STDIN> ;
	
	chomp $HASH{$_};
	if ( $flag and $HASH{$_} eq ""  ) {
				while ( $HASH{$_} eq "" ) {
						print "This is a Required attribute\n";
						print "$ATTR * : " ;	
						$HASH{$_} = <STDIN> ;
						chomp $HASH{$_};		
		}	
	}
}


# send the info to the elog server
for ( @attributes ) { 
	print "\n -a $_=$HASH{$_}\n" ;
	if ( defined ( $HASH{$_} )) {
	
	$ATTRIBUTES .= " -a \"${_}=$HASH{$_}\"";
	#print "$ATTRIBUTES\n";
}
}

 print "\n$ATTRIBUTES\n";

print "\n";
system 	( "elog.exe -h localhost -p 80 -l $LOGBOOK $ATTRIBUTES" );
  1930   Fri Sep 8 18:42:05 2006 Cool Chris Warnerchristopher_warner@dcd.uscourts.govQuestionLinux2.6Unsubscribe from logbooks
Is there a way for user to unsubscribe from a logbook? Can a user delete their own account?
  1931   Mon Sep 11 16:32:52 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux2.6.2-1714Re: Auto-refresh ELog display

Alan Stone wrote:
We have multiple LCDs at a console, and usually one is dedicated to displaying a browser
with the local ELog. Meanwhile, others are making entries from another machine. If
no one clicks on refresh, the ELog display becomes stale. Is there a method to have
the ELog reload every X minutes?

Thanks, Alan


The JavaScript is one possibility as Steve mentioned correctly. Another possibility is to use the RSS feed capability of ELOG. Use any RSS reader, and it will notify you immediately if there is a new entry in ELOG. Have a look at http://midas.psi.ch/elog/config.html and search for RSS on how to configure this.
  1932   Mon Sep 11 17:25:54 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux2.6Re: Unsubscribe from logbooks

Chris Warner wrote:
Is there a way for user to unsubscribe from a logbook? Can a user delete their own account?


Yes. Yes.

Just click on "Config", and you will see a page where you can unsubscribe from each logbook and a button to remove your account.
  1933   Thu Sep 14 22:59:39 2006 Question Steve Jonessteve.jones@freescale.comQuestionAll2.6.2-1714Why are Preset fields blanked out?
The snippet of code below sets an attribute to a date depending on the selection. Problem is, if attribute ApprovedDate was previously set, selecting any other value for CRStatus will blank out ApprovedDate (the same occurs for CompletedDate). Why would this be occurring when the conditionals are mutually exclusive?
##################################################
# Define CRState
#
Options CRState = PENDING{a}, APPROVED{b}, HOLD{a}, REJECTED{a}, COMPLETED{c}
{a}
{b} Preset ApprovedDate = $date
{c} Preset CompletedDate = $date
  1934   Mon Sep 18 15:21:56 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.6.2-1714Re: Why are Preset fields blanked out?

Steve Jones wrote:
The snippet of code below sets an attribute to a date depending on the selection. Problem is, if attribute ApprovedDate was previously set, selecting any other value for CRStatus will blank out ApprovedDate (the same occurs for CompletedDate). Why would this be occurring when the conditionals are mutually exclusive?
##################################################
# Define CRState
#
Options CRState = PENDING{a}, APPROVED{b}, HOLD{a}, REJECTED{a}, COMPLETED{c}
{a}
{b} Preset ApprovedDate = $date
{c} Preset CompletedDate = $date


I don't understand your problem. If I use following config file:
[demo]
Theme = default
Attributes = Author, CRState, ApprovedDate, CompletedDate

Options CRState = PENDING{a}, APPROVED{b}, HOLD{a}, REJECTED{a}, COMPLETED{c}
{a}
{b} Preset ApprovedDate = $date
{c} Preset CompletedDate = $date

and make an entry, then edit it, selecting approved, then submit, then edit again, then select completed, then I get following:



which looks ok to me (the previous ApprovedDate does not get blanked out). Can you reproduce that behaviour?
  1935   Mon Sep 18 16:53:09 2006 Question frederic poncinfrederic.poncin@trasys.beQuestionWindows2.6.2new entry form - "minimalist" approach
I'm playing with the configuration files in order to produce a "minimal" form.
At this time, I did not succeed in removing the following components:

- the "Fields marked with * are required" field
- the "Entry time:" field
- the "encoding ELCode / plain / HTML" field
- the "preview" button
- the duplication of the Submit/Preview/Back buttons on the top and the bottom of the page.

Is any of this possible?

--
Frédéric Poncin
ELOG V3.1.5-2eba886