in case you didn't see this

Derek Atkins warlord@MIT.EDU
16 Mar 2001 12:23:12 -0500


<linas@linas.org> writes:

> The plan is to move most remaining globals into gnc-book.

*nods* ok.

> > The way I would fix this would be to change xaccMallocTransaction() to
> > take either an AccountGroup or a a GNCBook argument.  Then you could
> > obtain the Backend from there.
> 
> Between these two, GNCBook, of course.  Any other possiblities? 
> Opinions, anyone?

Another choice would be an Account..  But I don't think it really
matters in the end.  A GNCBook is probably safest, as you can always
get back the 'current GNCBook' pretty much from any other state.

> > True.  However currently I still need to go through the engine, since
> > there is no way to have one Backend call another Backend directly..
> > The backends are specifically designed to interface to an engine.
> 
> Right. Now you're confusing me.  On the client side, you've implemented
> rpc versions of the backend callbacks, right?
> 
> One the server side, you've implemented the called functions with calls
> to the engine, right?

Yes, this is what I've implemented.  Once we get rid of the rest of
the engine globals, most of my problems will go away.  My issue what
that part of me feels it would be "cleaner" for the RPC Server to just
call the e.g. Postgres backend functions directly, instead of requring
the engine in the middle.  But honestly I don't care either way.

Also we still need to deal with things like authentication.  I
realized that having a global 'gnc_authenticate()' function doesn't
work; instead I'd like to see a Backend callback where the 'UI' can
register the authentication callback when it begins a book...  I was
thinking something like:

	int gnc_authenticate (???);

	gnc_book_begin (...);
	gnc_book_set_auth (gnc_authenticate, ...);
	gnc_book_load (...);

Where gnc_authenticate is the gnome authentication UI dialog, or
something that calls that if necessary.  Then the RPC Server could do
something like:

	gnc_book_begin (..);
	gnc_book_set_auth (gncRPCServ_authenticate, ...);
	gnc_book_load (...);

This way the RPC subsystem can theoretically perform it's own
authentication without requiring the user to supply a username and
password as a part of the e.g. postgres URL.

> --linas

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available