summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/newuser
diff options
context:
space:
mode:
authorjrayhawk+piny.be@omgwallhack.org <jrayhawk@dev.piny.svcs.cs.pdx.edu>2011-04-20 22:20:09 -0700
committerjrayhawk+piny.be@omgwallhack.org <jrayhawk@dev.piny.svcs.cs.pdx.edu>2011-04-20 22:20:09 -0700
commit3de74678afa78eccb241799e56a90cee31142325 (patch)
treed1e26a0732d6608855667eea9009627b3571fcac /pinyadmin/sbin/newuser
parentb5609ce3f6b3d40f1fc55e8bedc66e50fcf3f686 (diff)
parentd2977669bb388de0a991af6548427e896550e646 (diff)
downloadpiny-code-3de74678afa78eccb241799e56a90cee31142325.tar.gz
piny-code-3de74678afa78eccb241799e56a90cee31142325.zip
Merge branch 'master' of piny.be:/srv/git/piny-code
Diffstat (limited to 'pinyadmin/sbin/newuser')
-rwxr-xr-xpinyadmin/sbin/newuser13
1 files changed, 13 insertions, 0 deletions
diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser
index e38e791..ef61cd7 100755
--- a/pinyadmin/sbin/newuser
+++ b/pinyadmin/sbin/newuser
@@ -5,6 +5,8 @@ use warnings;
use Email::Valid::Loose qw( );
+use Piny::User;
+
my ( $email, $username, $password );
# Configure the strictness of our email checks.
@@ -147,6 +149,17 @@ if ( $ret ) {
exit 1;
};
+my $u = Piny::User->new( $username );
+
+open( GITCONFIG, ">", $u->home . "/.gitconfig" ) or die "Could not open .gitconfig for new user: $!\n";
+print GITCONFIG <<END;
+[user]
+ email = $email
+END
+close( GITCONFIG );
+
+chown( $u->uid, $u->group->gid, $u->home . "/.gitconfig" );
+
print "Your user has been created. Try logging in!\n";
exit 0;