Re: Execute shell script from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



shell_exec()

Tom
Khan wrote:

Hello,

I have a shell script for ading users to LDAP. It looks like this:

#!/bin/bash
MUID=userlogin
FULLNAME="First Last"
LASTNAME="Last"
DOMAIN=example.org
SERVER=qmail.example.org
PASS=userpass
cat > .ldif.tmp.$MUID << EOF
dn: uid=$MUID,ou=accounts,dc=example,dc=org
cn: $FULLNAME
sn: $LASTNAME
objectclass: top
objectclass: person
objectclass: inetOrgPerson
objectclass: qmailUser
mail: $MUID@$DOMAIN
mailhost: $DOMAIN
mailMessageStore: /var/qmail/maildirs/$MUID/Maildir
userPassword: $PASS
uid: $MUID
accountStatus: enabled
EOF
ldapadd -x -v -w secret -D "cn=Manager,dc=example,dc=org" \
            -f .ldif.tmp.$MUID
rm .ldif.tmp.$MUID

How Can I run (trigger) this script from PHP so I could create web form for adding users.

TNX


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux