Hi,

I suggest you using a bash script using setuidgid/sudo properly. You can
transfer all the needed parameters to it from php :) I use something
like
this in one of my servers to check passwords:

#! /bin/sh
  
password=`sudo -u root setuidgid vpopmail /home/vpopmail/bin/vuserinfo
[EMAIL PROTECTED] | grep clear | awk '{print $3}'`
 
if [ $password = $3 ]; then
  exit 0
else
  exit 1
fi

The /etc/sudoers file is:

root    ALL=(ALL) ALL
www-data  ALL= NOPASSWD: /usr/local/bin/setuidgid vpopmail
/home/vpopmail/bin/vuserinfo [a-zA-Z0-9]*@ [a-zA-Z0-9]*

You can, of course, modify that in order to get users added :) If you
still want
to directly create/modify users or gather info about them, you must use
calls to
the mysql database of vpopmail.

Bests Regards,

Rub�n Cardenal

> -----Mensaje original-----
> De: Metin ZAVRAK [mailto:[EMAIL PROTECTED] 
> Enviado el: jueves, 29 de abril de 2004 9:53
> Para: [EMAIL PROTECTED]
> Asunto: [vqadmin] creating user accounts automatically
> 
> 
> Hi,
> I'm trying to automate to process of creating new user accounts. 
> I wrote a php script that is supposed to run vadduser.
> 
> The main part of the code is simple:
> 
> `/usr/home/vpopmail/bin/vadduser $username $passwd`;
> 
> This code runs in a for loop and supposed to create users 
> such as [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] ....
> 
> all of the users will have the same password. 
> 
> The problem is, when I execute the code, it creates Maildirs 
> for users but Maildirs contains "cur" "new" and "tmp" folders 
> not all of the other necessary folders. 
> 
> Also the folders owner is nobody (apache owner)...It should 
> be vpopmail I guess. Thus it creates a segmentation fault (a 
> weird mistake)
> 
> How can I automate the process of creating new user accounts 
> and do this using a php script. 
> Thanks. 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> =====
> Metin Zavrak
> ******************************
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> ******************************
> 
> 
>       
>               
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 

Reply via email to