|
From: Jamie C. <jca...@we...> - 2003-05-23 13:33:45
|
On Fri, 2003-05-23 at 10:05, Clemens Oertel wrote:
> Hi alltogether,
>
> while trying to write some to code to synchronize users among multiple
> machines upon creation/modification/deletion, I noticed that many
> functionality lies in the corresponding .cgi-files, not in the user-lib.pl.
>
> My naive idea was to have a useradmin_update.pl file on the master machine,
> with something like:
>
> &remote_foreign_call('my_user_synchronizer', 'create', %{$user_reference});
>
> and on the client machines a module called my_user_synchronizer with a
> lib-file containing:
>
> sub create {
> my (%user) = @_;
>
> ...
> &foreign_call('useradmin', 'create_user', \%user);
> &foreign_call('useradmin', 'make_changes');
> ...
> }
>
> Works great, user gets created (or deleted or whatever).
> However, this way I'm missing all the extended functionality, such as
> group changes, home dir movings etc. I also don't want to cut'n'paste code out
> of the respective cgi-scripts (maintainability ...).
>
> So it occured to me that clean one-function interfaces for each of the user
> maintenance tasks (create, modify, delete) would be the perfect solution.
> Maybe with an additional parameter to turn on/off all output.
>
> Since I'm not aware of the rationale for the current layout of the useradmin
> module, I'd like to ask for some comments on that issue. MAybe somebody even
> has found a working solution already?
Unfortunately, there is no single clean function for creating a user
with all the extras at the moment. The only good reason for the current
design is that it allows the creation of users without a home directory,
or without a corresponding Samba account. A few other modules do just
this for creating mailboxes and so on.
So anyway, right now you need to call several functions to create a
user. Have a look at the Cluster Users and Groups module's
create_user.cgi script to see how it is done remotely..
- Jamie
|