Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG, Page 3 of 6  Not logged in ELOG logo
ID Date Authorup Author Email Category Subject Status Last Revision
  35   Tue May 24 22:43:38 2011 JacekKdoctor99@poczta.onet.plScriptJavascript verification of simple attributes with regexpBetaTue May 24 22:46:38 2011 by JacekK

Hi,

I added possibility for a new verification of required fields in generated Javascript "function chkform()". To do this I added new logbook option "ValidPattern", in which you can set regular expression for an attribute, for example

ValidPattern HexDigits=[0-9a-fA-F]+

If there is a pattern set for required field, then in chkform() function is generated additional verification, if value of the field matches validation regexp.

Changes I made should not decrease performance of elogd. Let me know please if you can add it to regular version.

 

Jacek

  149   Sat Jun 15 06:13:07 2019 Johnsecondcomingtechnologies@fastmail.comScriptRe: Custom input forms implementationStableSat Jun 15 06:19:24 2019 by John

I have been trying to get my head around this application module. I assume that after the input is done on this example (ShiftCheck), if goes into the  usual file system directorys for storage? Or is it (or can it) goto another db like sql, flat, etc.?  I also assume that the 'normal' Elog screens we see for input (and output), would be a completely seperate module that you have for (ShiftCheck).. but we do not see them here (as one of the attachments)? I am asking these questions because I am trying to recreate this (type) of input/output system for users, so I would like to know how the 'whole picture' is done with your example here. Thanx again.

Stefan Ritt wrote:

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

 

  150   Fri Feb 21 19:05:18 2020 Laurent Jean-Rigaudlollspam@free.frOtherRPM build process enhancementsStableFri Feb 21 19:14:53 2020 by Laurent Jean-Rigaud

Hi Stefan,

I enclosed a patch for RPM build process available on GIT.

changes :

  • rpmbuild :
    • checks if provider or custom build (the rm/mv are done on your computers only :-))
    • call rpmbuild with version / release given as parameters
  • elog.spec :
    • last changelog entry date is set to build date
    • build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
    • elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists

 

Todo:

  • add RPMbuild options for ldap/pam/...
  • enclosed git log in changelog automatically (the dream :-))
  151   Mon Mar 2 14:31:12 2020 Laurent Jean-Rigaudlollspam@free.frOtherRe: RPM build process enhancementsStableWed Mar 4 18:40:40 2020 by Laurent Jean-Rigaud

Hi Stefan,

2nd patch for RPM build which adds :

  • dynamic build options for krb5/ldap/pam/ssl support :
    • for git / non rpm users : 
      • buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
    • for rpm users using SRPMS (dependances are managed) :
      • rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
  • dynamic 2 last changelog entries :
    • last with build information with
      • dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
      • build options list (KBR5, LDAP, PAM, SSL)
    • before last for product changelog of current ELOG version-release
  • customrel flag for local rebuild :
    • release = %elogrel%{?customrel}%{?dist)
    • so custom builder can add --define 'customrel NSA'  at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
  • elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
  • buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).

 

Tested on EL6 and EL7 x86_64 :-)

Bye

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

I enclosed a patch for RPM build process available on GIT.

changes :

  • rpmbuild :
    • checks if provider or custom build (the rm/mv are done on your computers only :-))
    • call rpmbuild with version / release given as parameters
  • elog.spec :
    • last changelog entry date is set to build date
    • build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
    • elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists

 

Todo:

  • add RPMbuild options for ldap/pam/...
  • enclosed git log in changelog automatically (the dream :-))

 

  152   Wed Mar 4 18:40:57 2020 Laurent Jean-Rigaudlollspam@free.frOtherRe: Re: RPM build process enhancementsStableWed Mar 4 18:45:05 2020 by Laurent Jean-Rigaud

Sorry, the patch is malformed for the template file. Check PJ.

Bye,

Laurent

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

2nd patch for RPM build which adds :

  • dynamic build options for krb5/ldap/pam/ssl support :
    • for git / non rpm users : 
      • buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
    • for rpm users using SRPMS (dependances are managed) :
      • rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
  • dynamic 2 last changelog entries :
    • last with build information with
      • dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
      • build options list (KBR5, LDAP, PAM, SSL)
    • before last for product changelog of current ELOG version-release
  • customrel flag for local rebuild :
    • release = %elogrel%{?customrel}%{?dist)
    • so custom builder can add --define 'customrel NSA'  at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
  • elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
  • buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).

 

Tested on EL6 and EL7 x86_64 :-)

Bye

 

Laurent Jean-Rigaud wrote:

Hi Stefan,

I enclosed a patch for RPM build process available on GIT.

changes :

  • rpmbuild :
    • checks if provider or custom build (the rm/mv are done on your computers only :-))
    • call rpmbuild with version / release given as parameters
  • elog.spec :
    • last changelog entry date is set to build date
    • build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
    • elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists

 

Todo:

  • add RPMbuild options for ldap/pam/...
  • enclosed git log in changelog automatically (the dream :-))

 

 

  19   Sat Oct 21 02:23:17 2006 Leo Souzaleo@leo.comDocumentationteste abcStable1.0
alksjdkajklasjdas
  148   Mon Mar 11 09:28:15 2019 Mauratgm001@free.frScriptCode change for LDAP authenticationStableMon Mar 11 10:15:43 2019 by Maurat

Hi,

I had to change code to authenticate users in my organization's LDAP directory. Indeed, accounts are distributed under several organizational units in my LDAP directory.

The current version of the code can't authenticate accounts when these are in different organizational units. Hence my contribution.

I Use a read account to request LDAP to locate the account that has logged in (with e-mail address in the search filter).

I get the number of LDAP entries. If I have one entry then I call ldap_get_dn function to get the DN account and then I call ldap_simple_bind_s using the account's DN and password to perform LDAP authentication.

I changed configuration file elogd.cfg. I added two parameters:

LDAP DN user = <DN read account>

LDAP PW user = <password read account>

I changed code auth.c too (see attached file)

I had to change Makefile. I added a call to lber library

ifdef USE_LDAP
ifneq ($(USE_LDAP),0)
CFLAGS += -DHAVE_LDAP
LIBS += -lldap -llber
endif
endif

Have good day

 

 

 

 

 

 

  31   Tue Dec 15 20:11:27 2009 Michel Boveybovey (a) slf chDocumentationSorting dates before and after "Sun Sep 9 > 03:46:39 CEST 2001"Alpha 
BACKGROUNG

ELOG is storage date and time in unix time: seconds after epoch (Thu Jan  1 00:00:00 UTC 1970).

    date -u -d @0

On "Sun Sep  9 03:46:39 CEST 2001" the unix time counter is passing from a presentation of 9 digits to 10 digits.

    date -d @999999999
 

ISSUE

For sorting dates ELOG is using the character representation of the unix time. When ELOG contains dates on both
side of this 9 - 10 digits border sorting get confused.

 
WORKAROUND

in adding a leading 0 (zero) to the internal storage of dates in ELOG files we get over this problem.

On unix based system in can be easily achived with a sed command against the .log files:

    sed -i 's/modification: 9/modification: 09/g' *.log
  16   Wed Sep 7 16:52:30 2005 Peter Erikssonpeter@ifm.liu.seOtherSolaris 10 SMF/Greenline management manifest for ELogStable 
Please find enclosed as an attachment a Solaris 10 SMF/Greenline manifest that can be used to manage ELog.
(If you don't know what it is - it replaces init.d/cron/inittab and more stuff)
  22   Wed Jul 11 11:13:16 2007 Peter Rienstrapeter.rienstra@gmail.comOtherCompiling elogd.c on HP-UX 64 bitBetaThu Jul 12 09:38:47 2007 by Peter Rienstra
We succeeded in compiling and running elogd (elog-2.6.5) on HP-UX 64 bit Itanium platform (HP-UX B.11.23 U ia64).

The main problem was we got a core dump after starting elogd. The cause was that the memory has be allocated with a 4 byte boundary. This could be the case on other 64 bit platforms as well. A colleague of mine (Sander Notting) found the solution.

Unzip and untar the zip file (elog-latest.tar.gz)
Go to the src directory (elog-2.6.5/src)

Edit elogd.c

Replace all:

show_selection_page(NULL); => show_selection_page();
seteuid => setuid
setegid => setgid

On line 564:
void *buffer => char *buffer


Line 645, add the text in bold:

void *xmalloc(size_t bytes)
{
char *temp;

/* Align buffer on 4 byte boundery for HP UX and other 64 bit systems to prevent Bus error(core dump)*/
if (bytes & 3)
bytes += 4 - (bytes & 3);


temp = (char *) malloc(bytes + 12);


After that compile:

cc -w -c -o regex.o regex.c
cc -w -c -o mxml.o ../../mxml/mxml.c
cc -w -c -o strlcpy.o ../../mxml/strlcpy.c
cc -I../../mxml -o elogd elogd.c regex.o mxml.o strlcpy.o

We didn't try to run elogd under root yet.
ELOG V3.1.5-2eba886