Re: [midgard] Session data ?

2000-03-10 Thread David Guerizec

Hi, 

> > Is there an internal functionality for tracking use, or do I have to
> > add the information myself ? Do I save that in the pref table, hard
> > coded ?
> 
> You have to code this yourself.
> 

Or you can look at this, it is already coded ;-)
http://www.midgard-project.org/article/1394.html

> Just set a preference for that user containing a
> timestamp when the page is loaded.
> 

right, just call set_pref (after calling $pref=init_pref($midgard->user); )
set_pref($pref,"userlog","lastaccess",date("Y-m-d H:i:s"));

if you want to check it, do :

if($pref["userlog"]["lastaccess"]<$modifdate)
{ ... }

> > Blixten
> 
> /Bergie
> 

Regards,
david


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]



Re: [midgard] Session data ?

2000-03-10 Thread Emiliano [EMAIL PROTECTED]

On Fri, 10 Mar 2000, Michael Ed wrote:

> ... I did not manage to find the right user id by myself.
> How do I replace the digit 2 with the current users id ?

$midgard->user

> Is there an internal functionality for tracking use, or do I have to
> add the information myself ? Do I save that in the pref table, hard
> coded ?

To update the preference you need to list them to get the id based
on the name, then update the preference with that ID.

I've deviced a possible solution for 1.2.5 extendable records[0] but
I just finished it about 10 minutes ago and it needs testing.

> > # get spank date as MMDD
> > $spankdate=...;
> > 
> > SELECT preference.uid, person.firstname, person.lastname, person.email
> > FROM preference,person
> > WHERE preference.uid=person.id
> >   AND domain='newsreading' AND name='lastread'
> >   AND value<'$spankdate'
> 
> That would be my monthly report ?

Yes. If you demand that news be read at at least every week set the
spankdate to 7 days before the current date in the script. Make sure
that the tracking code in the site stores dates in the same format. You
could have the script scold the perps by mail automatically.

Emile

[0] I keep mistyping this as recordz. Y'all know who to blame.


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]



Re: [midgard] Session data ?

2000-03-10 Thread Henri Bergius

On 10 Mar, Michael Ed wrote:
> ... I did not manage to find the right user id by myself.
> How do I replace the digit 2 with the current users id ?

If the user is authenticated with Midgard, you'll
find it from $midgard->user

> Is there an internal functionality for tracking use, or do I have to
> add the information myself ? Do I save that in the pref table, hard
> coded ?

You have to code this yourself.

Just set a preference for that user containing a
timestamp when the page is loaded.

> Blixten

/Bergie

-- 
-- Henri Bergius -- +358 40 525 1334 -- [EMAIL PROTECTED] --
   http://www.iki.fi/Henri.Bergius


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]



Re: [midgard] Session data ?

2000-03-10 Thread Michael Ed

Emiliano Heyns wrote:
> 
> Michael Ed wrote:
> >
> > Since I force external users to log in to our
> > XtraNet there should be a possibility to identify
> > and log sessions. 

I got echo($REMOTE_USER) to show up on the screen. That works.
But then ...
 2: name); 
 6: ?> 
... I did not manage to find the right user id by myself.
How do I replace the digit 2 with the current users id ?

> 
> You could store a 'preference' setting holding the last read date
> for the user (midgard.user). The page that displays the news section
> should update this. 

I found the preference documentation a bit confusing.

Is there an internal functionality for tracking use, or do I have to
add the information myself ? Do I save that in the pref table, hard
coded ?
I found my pref table empty.
I think the best for me would be to store a separate table, 
on a db server, for tracking purposes ...


> You would then write an offline script that
> would
> 
> # get spank date as MMDD
> $spankdate=...;
> 
> SELECT preference.uid, person.firstname, person.lastname, person.email
> FROM preference,person
> WHERE preference.uid=person.id
>   AND domain='newsreading' AND name='lastread'
>   AND value<'$spankdate'

That would be my monthly report ?


-- 
Regards,
Blixten

Cellular : +46 (0)708-999 105

Linux & KDE & Compaq DPEP !

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]



Re: [midgard] Session data ?

2000-03-10 Thread Emiliano Heyns

Michael Ed wrote:
> 
> Since I force external users to log in to our
> XtraNet there should be a possibility to identify
> and log sessions. In the new agreement with
> our distributors the *must* read news every day.
> (Else I'll send a techie out to spank them.)
> I scanned the documentation on the project site,
> but found nothing pointing towards this (session
> logging - not spanking!).
>
> Please supply me with a hint.
> 
> We do this on the old XtraNet :
> ...
> WHERE
> Users.username = '$REMOTE_USER'
> AND
> ...

You could store a 'preference' setting holding the last read date
for the user (midgard.user). The page that displays the news section
should update this. You would then write an offline script that
would

# get spank date as MMDD
$spankdate=...;

SELECT preference.uid, person.firstname, person.lastname, person.email
FROM preference,person
WHERE preference.uid=person.id
  AND domain='newsreading' AND name='lastread'
  AND value<'$spankdate'

Emile

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]



[midgard] Session data ?

2000-03-09 Thread Michael Ed

Since I force external users to log in to our
XtraNet there should be a possibility to identify
and log sessions. In the new agreement with
our distributors the *must* read news every day.
(Else I'll send a techie out to spank them.)
I scanned the documentation on the project site,
but found nothing pointing towards this (session
logging - not spanking!).

Please supply me with a hint.

We do this on the old XtraNet :
...
WHERE
Users.username = '$REMOTE_USER'
AND  
...


-- 
Regards,
Blixten

Cellular : +46 (0)708-999 105

Linux & KDE & Compaq DPEP !

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]