| 1 | #!/usr/bin/perl | 
|---|
| 2 | use strict; | 
|---|
| 3 | use FindBin qw($Bin); | 
|---|
| 4 | use lib $Bin; | 
|---|
| 5 | use onserver_star; | 
|---|
| 6 | use File::Path | 
|---|
| 7 |  | 
|---|
| 8 | setup(); | 
|---|
| 9 |  | 
|---|
| 10 | my $dir = "/mit/$USER/scripts-gallery2/$sqldb"; | 
|---|
| 11 | if (-e $dir) { | 
|---|
| 12 | print STDERR "ERROR: The directory $dir already exists.\nTry selecting a different name."; | 
|---|
| 13 | exit 1; | 
|---|
| 14 | } | 
|---|
| 15 | mkpath($dir); | 
|---|
| 16 |  | 
|---|
| 17 | system("patch", "install/steps/AuthenticateStep.class", | 
|---|
| 18 | "/mit/scripts/deploy$scriptsdev/gallery2.patch"); | 
|---|
| 19 |  | 
|---|
| 20 | $ua->cookie_jar({file => '.cookies'}); | 
|---|
| 21 |  | 
|---|
| 22 | fetch_uri('install/index.php'); | 
|---|
| 23 | fetch_uri('install/index.php', {step => 1}, | 
|---|
| 24 | {language => 'en_US'}); | 
|---|
| 25 | fetch_uri('install/index.php', {step => 2}, {}); | 
|---|
| 26 | fetch_uri('install/index.php', {step => 3}, {}); | 
|---|
| 27 |  | 
|---|
| 28 | my $post4 = {isMultisite => 0, | 
|---|
| 29 | dir => $dir, | 
|---|
| 30 | action => 'save'}; | 
|---|
| 31 | fetch_uri('install/index.php', {step => 4}, $post4); | 
|---|
| 32 | fetch_uri('install/index.php', {step => 4}, $post4); | 
|---|
| 33 |  | 
|---|
| 34 | my $post5 = {type => 'mysql', | 
|---|
| 35 | hostname => $sqlhost, | 
|---|
| 36 | action => 'save', | 
|---|
| 37 | confirmReuseTables => '', | 
|---|
| 38 | confirmCleanInstall => '', | 
|---|
| 39 | username => $sqluser, | 
|---|
| 40 | password => $sqlpass, | 
|---|
| 41 | database => $sqldb, | 
|---|
| 42 | tablePrefix => 'g2_', | 
|---|
| 43 | columnPrefix => 'g_'}; | 
|---|
| 44 | fetch_uri('install/index.php', {step => 5}, $post5); | 
|---|
| 45 | fetch_uri('install/index.php', {step => 5}, $post5); | 
|---|
| 46 |  | 
|---|
| 47 | fetch_uri('install/index.php', {step => 6}, | 
|---|
| 48 | {adminName => $admin_username, | 
|---|
| 49 | passwordA => $admin_password, | 
|---|
| 50 | action => 'create', | 
|---|
| 51 | passwordB => $admin_password, | 
|---|
| 52 | email => $email, | 
|---|
| 53 | fullName => $USER}); | 
|---|
| 54 | fetch_uri('install/index.php', {step => 7}, {}); | 
|---|
| 55 | fetch_uri('install/index.php', {step => 8}, {}); | 
|---|
| 56 | fetch_uri('install/index.php', {step => 9}, | 
|---|
| 57 | {'module[imagemagick]' => 'on', | 
|---|
| 58 | activate => 1}); | 
|---|
| 59 | fetch_uri('install/index.php', {step => 10}, {}); | 
|---|
| 60 | fetch_uri('install/index.php', {step => 11}, {}); | 
|---|
| 61 |  | 
|---|
| 62 | unlink '.cookies'; | 
|---|