[kronolith] Getting up and running with mcal+kronolith (CVS)

John Soward soward@soward.net
Thu, 19 Apr 2001 20:22:19 -0400


John Soward wrote:
> 
> Chuck Hagenbuch wrote:
> 
> > Quoting John Soward <soward@soward.net>:
> >
> > > Does anyone have any suggestions or maybe a smaller bit of sample
> > > code I could try with the command-line php or anything?
> >
> > Make sure that Horde auth is set up and working; make sure that you are using
> > libmcal from cvs, and not the tarballs (they're over a year old); make sure
> > that you can do $stream = mcal_open('{/mstore}foo', 'username', 'password');
> > with the username and password defined in your config/conf.php file.
> >
> 
> Horde Auth seems to work (using imap), I'm using  the cvs libmcal from about
> maybe
> sunday night or monday. Had to undef the use of PAM since that appears to be
> horribly
> broken, I tried to patch up the pam_conv routine but I don't need it anyway
> since only
> kronolith will use it.
> 
> I was using the following php program to test:
> 
> <?
>  $x=mcal_open("{/mstore}<root>","root","xxxxx");
>  print "x=($x)\n<br>\n";
> print "www<br>\n";
>  $x=mcal_open("{localhost/mstore}<www>","www","xxxxx");
>  print "x=($x)\n<br>\n";
> print "root/blank<br>\n";
>  $x=mcal_open("{/mstore}soward","www","xxxxx");
>  print "x=($x)\n<br>\n";
> ?>
> 
> root and www are the only things in /etc/mpasswd and this appears to work:
> 
> http://rs.soward.net/cal.php
> 
> And I'm using 'www' in the horde/kronolith/config/conf.php
> 
> I'm going to try a fresh cvs of horde just in case I've got an odd-ball typo out
> there, but
> I'm working on two boxes and they are getting the same result, though I did copy
> 
> a few things from one to the other.
> 
I hate to reply to my own message, but just in case anyone else runs
into this, I think I have it solved. As I sorta guessed it was a 
libmcal problem, so I'll take any further related issues to the 
libmcal folx, but using the current libmcal/mstore cvs you'll need 
to alter read_event in mstore.c to look like:

CALEVENT *read_event(FILE *calfile)
{
        char            line[100];
        char            *buf;
        int             size;
        CALEVENT        *event;

        if (fgets(line, sizeof(line), calfile)==NULL)
                return NULL;
        if (sscanf(line, "%d", &size) != 1)
                return NULL;

and remove the -DAUTH_PAM business from the make file. 
Sorry no context diff, made too many other changes with no orig copy...

-- 
John Soward	Lead Systems Programmer     University of Kentucky
e: soward@uky.edu  p: 859-257-2900 w: www.soward.net