summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/newuser
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:00:05 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:00:05 -0700
commitffab3ec34b9fd949a9877d0a19182b58911424da (patch)
tree102fb78c332d7c43d5c3671e4de59bcba25134ca /pinyadmin/sbin/newuser
parent4ac0fd01b73a0b718db3a756866fee121a1615f1 (diff)
parent2a27be477f89b42abb23793c5118b40120b793aa (diff)
downloadpiny-code-ffab3ec34b9fd949a9877d0a19182b58911424da.tar.gz
piny-code-ffab3ec34b9fd949a9877d0a19182b58911424da.zip
Merge branch 'master' of piny.be:/srv/git/piny-code
Conflicts: libpiny/lib/Piny/Repo.pm
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 c463aa9..7b864b7 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, (getgrnam("users"))[2] , $u->home . "/.gitconfig" );
+
print "Your user has been created. Try logging in!\n";
exit 0;