Changeset 485 for server/common


Ignore:
Timestamp:
Oct 15, 2007, 8:33:52 AM (15 years ago)
Author:
andersk
Message:
Make new signups go to LDAP!
Location:
server/common/oursrc/accountadm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/common/oursrc/accountadm/configure.in

    r435 r485  
    4444LOCATE(sort)
    4545LOCATE(head)
     46LOCATE(ldapadd)
    4647
    4748dnl Needed by mbash.in
  • server/common/oursrc/accountadm/signup-scripts-backend.in

    r435 r485  
    6565complain("gid already taken") if(getgrgid $gid1);
    6666
    67 # Add user to /etc/passwd
    68 `@sudo_path@ -u root @groupadd_path@ -g '$gid1' '$username'`;
    69 `@sudo_path@ -u root @useradd_path@ -M -d '$homedir' -s '/usr/local/bin/mbash' -u '$uid1' -g '$gid1' -G users '$username'`;
     67my $pid;
     68defined ($pid = open LDAP, '|-') or complain("internal error");
     69if (!$pid) {
     70        close STDOUT;
     71        open STDOUT, '>/dev/null';
     72        exec '@ldapadd_path@', '-c', '-x', '-D', 'cn=Directory Manager', '-y', '/etc/signup-ldap-pw';
     73        exit 1;
     74}
     75print LDAP <<EOF;
     76dn: uid=$username,ou=People,dc=scripts,dc=mit,dc=edu
     77objectClass: posixAccount
     78cn: $username
     79uid: $username
     80uidNumber: $uid1
     81gidNumber: $gid1
     82homeDirectory: $homedir
     83loginShell: /usr/local/bin/mbash
     84
     85dn: cn=$username,ou=Groups,dc=scripts,dc=mit,dc=edu
     86objectClass: posixGroup
     87cn: $username
     88gidNumber: $gid1
     89
     90dn: apacheServerName=$username.scripts.mit.edu,ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
     91objectclass: apacheConfig
     92apacheServerName: $username.scripts.mit.edu
     93apacheServerAlias: $username.scripts
     94apacheDocumentRoot: $homedir
     95apacheSuexecUid: $uid1
     96apacheSuexecGid: $gid1
     97
     98EOF
     99close LDAP or complain("internal error");
    70100# Add disk quota for user
    71 `@sudo_path@ -u root @setquota_path@ '$username' 0 25000 0 10000 -a`;
     101#system('@sudo_path@', '-u', 'root', '/usr/sbin/setquota', $username, '0', '25000', '0', '10000', '-a');
    72102
    73103printexit("done", 0);
Note: See TracChangeset for help on using the changeset viewer.