|
From: <hee...@us...> - 2003-08-01 17:23:49
|
Update of /cvsroot/ucomp/ucomp2
In directory sc8-pr-cvs1:/tmp/cvs-serv27260/ucomp2
Modified Files:
installer.pl ucomp.cgi
Log Message:
uComp 2.0-Delta release is finished, everythign but comments and archiving work...small bugs may appear, but the initial bug testing phase is done.
Index: installer.pl
===================================================================
RCS file: /cvsroot/ucomp/ucomp2/installer.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** installer.pl 7 Jun 2003 21:45:36 -0000 1.2
--- installer.pl 1 Aug 2003 17:23:46 -0000 1.3
***************
*** 1,70 ****
! #!/usr/bin/perl
! use lib('./modules');
! use CGI;
! use DBI;
! use Config::General;
!
! #Installer for uComp 2.0
!
! print "uComp 2.0 Installer\nThis script will help you to install uComp 2.0, if you used uComp 1.x, migrate your conifguration and news over from the old version after this installation using migrate.pl in this directory.\n\n\nAlright, lets begin!";
!
!
!
! print "\n\nYour database name: ";
! my $database=<STDIN>;
! chop($database);
! print "\n\nYour database host: ";
! my $database_host=<STDIN>;
! chomp($database_host);
! print "\n\nYour database username: ";
! my $database_user = <STDIN>;
! chomp($database_user);
! print "\n\nYour database password: ";
! my $database_pass=<STDIN>;
! chomp($database_pass);
! print "\n\nUsername: ";
! $username = <STDIN>;
! chomp($username);
! print "\n\nPassword: ";
! $password = <STDIN>;
! chomp($password);
! my $seed="23489NKLSDFJKLMNAFUIHQ234589AFSDFASDFASDF2345";
! $password = crypt($password,($username.$seed));
!
! print "\n\n\nYou entered the following: Username: $database_user\nPassword: $database_pass\nDatabase: $database\nHost: $database_host";
!
!
!
! #DO DATABASE STUFF
! my $dbh = DBI->connect( "dbi:mysql:$database:$database_host", $database_user, $database_pass ) || die "Internal crash, could not connect to database"; #connect to database
!
!
! #DO CONFIGURATION FILE STUFF
!
! open( "CONF", ">conf/.configuration" );
! print ""; #write out to force a file create/overwrite in case it doesn't exist
! close(CONF);
! my $conf = new Config::General("conf/.configuration"); #open configuration file
!
! my %config;
! $config{'user'} = $database_user;
! $config{'pass'} = $database_pass;
! $config{'driver'} = "dbi:mysql:$database:$database_host";
! $conf->save_file( "conf/.configuration", \%config );
! print "\n\nConfiguration file written successfully!\n";
!
!
! #DO TABLE CREATION
! $dbh->do("CREATE TABLE config (name tinytext,value tinytext)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE articles (aid int,subject mediumtext,snippet longtext,articles longtext,date tinytext,uid int,cid int, approved int)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE categories (cid int,name tinytext,template mediumtext,mode int,gids longtext,uids longtext,mods longtext,comments int)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE users (uid int,name mediumtext,pass mediumtext,email mediumtext,avatar mediumtext,profile longtext,superadmin int,post_without_approval int,edit_all_posts int)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE groups (gid int,name mediumtext,uids longtext)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE comments (uid int,ordern int,name tinytext,comment longtext,aid int)") || die "Internal crash, couldn't make table"; #create sessions table
! $dbh->do("CREATE TABLE cusers (uid int,name tinytext,pass tinytext)") || die "Internal crash, couldn't make table";
!
! $dbh->do("INSERT INTO config VALUES ('ccid','0')");
! $dbh->do("INSERT INTO config VALUES ('cuid','1')");
! $dbh->do("INSERT INTO config VALUES ('cgid','0')");
! $dbh->do("INSERT INTO config VALUES ('caid','0')");
! $dbh->do("INSERT INTO users VALUES (0,'$user','$pass','-','-','-',1,1,1)");
\ No newline at end of file
--- 1,81 ----
! #!/usr/bin/perl
! use lib('./modules');
! use CGI;
! use DBI;
! use Config::General;
!
! #Installer for uComp 2.0
!
! print "uComp 2.0 Installer\nThis script will help you to install uComp 2.0, if you used uComp 1.x, migrate your conifguration and news over from the old version after this installation using migrate.pl in this directory.\n\n\nAlright, lets begin!";
!
!
!
! print "\n\nYour database name: ";
! my $database=<STDIN>;
! chop($database);
! print "\n\nYour database host: ";
! my $database_host=<STDIN>;
! chomp($database_host);
! print "\n\nYour database username: ";
! my $database_user = <STDIN>;
! chomp($database_user);
! print "\n\nYour database password: ";
! my $database_pass=<STDIN>;
! chomp($database_pass);
! print "\n\nUsername: ";
! $username = <STDIN>;
! chomp($username);
! print "\n\nPassword: ";
! $password = <STDIN>;
! chomp($password);
! my $seed="23489NKLSDFJKLMNAFUIHQ234589AFSDFASDFASDF2345";
! $password = crypt($password,($username.$seed));
!
! print "\n\n\nYou entered the following: Username: $database_user\nPassword: $database_pass\nDatabase: $database\nHost: $database_host";
!
!
!
! #DO DATABASE STUFF
! my $dbh = DBI->connect( "dbi:mysql:$database:$database_host", $database_user, $database_pass ) || die "Internal crash, could not connect to database"; #connect to database
!
!
! #DO CONFIGURATION FILE STUFF
!
! open( "CONF", ">conf/.configuration" );
! print ""; #write out to force a file create/overwrite in case it doesn't exist
! close(CONF);
! my $conf = new Config::General("conf/.configuration"); #open configuration file
!
! my %config;
! $config{'user'} = $database_user;
! $config{'pass'} = $database_pass;
! $config{'driver'} = "dbi:mysql:$database:$database_host";
! $conf->save_file( "conf/.configuration", \%config );
! print "\n\nConfiguration file written successfully!\n";
!
!
! #DO TABLE CREATION
! $dbh->do("DROP TABLE config");
! $dbh->do("DROP TABLE articles");
! $dbh->do("DROP TABLE categories");
! $dbh->do("DROP TABLE users");
! $dbh->do("DROP TABLE groups");
! $dbh->do("DROP TABLE comments");
! $dbh->do("DROP TABLE cusers");
!
! $dbh->do("CREATE TABLE config (name tinytext,value tinytext)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE articles (aid int,subject mediumtext,snippet longtext,articles longtext,date tinytext,uid int,cid int, approved int)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE categories (cid int,name tinytext,template mediumtext,mode int,gids longtext,uids longtext,mods longtext,comments int, output longtext)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE users (uid int,name mediumtext,pass mediumtext,email mediumtext,avatar mediumtext,profile longtext,superadmin int,post_without_approval int,edit_all_posts int)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE groups (gid int,name mediumtext,uids longtext)") || die "Internal crash, couldn't make table";
! $dbh->do("CREATE TABLE comments (uid int,ordern int,name tinytext,comment longtext,aid int)") || die "Internal crash, couldn't make table"; #create sessions table
! $dbh->do("CREATE TABLE cusers (uid int,name tinytext,pass tinytext)") || die "Internal crash, couldn't make table";
! $dbh->do("INSERT INTO config VALUES ('ccid','0')");
! $dbh->do("INSERT INTO config VALUES ('cuid','3')");
! $dbh->do("INSERT INTO config VALUES ('cgid','0')");
! $dbh->do("INSERT INTO config VALUES ('caid','0')");
! $dbh->do("INSERT INTO users VALUES (2,'$user','$pass','-','-','-',1,1,1)");
!
! print "\n\nuComp tables created successfully!\n";
! print "\n\nAdministrator account created successfully\n";
! print "\n\nuComp installation completed\n";
\ No newline at end of file
Index: ucomp.cgi
===================================================================
RCS file: /cvsroot/ucomp/ucomp2/ucomp.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ucomp.cgi 7 Jun 2003 21:45:36 -0000 1.2
--- ucomp.cgi 1 Aug 2003 17:23:46 -0000 1.3
***************
*** 1,859 ****
! #!/usr/bin/perl
! use strict;
! use CGI::Carp qw(fatalsToBrowser);
! use DBI;
! use lib('./modules');
! use CGI qw(:standard);
! use CGI::Session qw/-ip-match/;
! use HTML::Template;
! use Config::General;
! use DBhandler;
[...2346 lines suppressed...]
!
!
!
!
!
! sub doNavigation {
!
! print<<"EOT";
!
! <br>
! <br>
! <font size="2">uComp Copyright © 2003 Travis McArthur</font>
!
!
! EOT
! }
!
!
!
!
|