diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 51e86f36a..eead743fb 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -4,6 +4,8 @@ - Fixed resetting votes on Poll would crash it. - Fixed not being able to set display title and other yes no questions to no. - Fixed a bug where URLs would become unreachable when using SSL. + - Added an initial configuration wizard which prompts the site owner to + configure a custom admin username and password for better security. 6.3.0 diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index 2501a2533..1fccc4254 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -3323,5 +3323,4 @@ INSERT INTO wobject VALUES (0,NULL,'KZ2UytxNpbF-3Eg3RNvQQQ','PBtmpl0000000000000 INSERT INTO wobject VALUES (0,NULL,'G0wlShbk_XruYVfbXqWq_w','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); INSERT INTO wobject VALUES (1,NULL,'UE5_3bD7kWDLUN2B-iuNuA','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); INSERT INTO wobject VALUES (1,NULL,'RTsbVBEYnn3OPZWmXyIFhQ','PBtmpl0000000000000060','PBtmpl0000000000000111',60,3600); -replace into settings (name,value) values ("specialState","init"); diff --git a/docs/upgrades/upgrade_6.3.0-6.3.1.sql b/docs/upgrades/upgrade_6.3.0-6.4.0.sql similarity index 57% rename from docs/upgrades/upgrade_6.3.0-6.3.1.sql rename to docs/upgrades/upgrade_6.3.0-6.4.0.sql index c1d252518..b6da4e263 100644 --- a/docs/upgrades/upgrade_6.3.0-6.3.1.sql +++ b/docs/upgrades/upgrade_6.3.0-6.4.0.sql @@ -1,4 +1,4 @@ -insert into webguiVersion values ('6.3.1','upgrade',unix_timestamp()); +insert into webguiVersion values ('6.4.0','upgrade',unix_timestamp()); alter table asset add index state_parentId_lineage (state,parentId,lineage); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 573b37d2d..98686ccaf 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,5 +1,5 @@ package WebGUI; -our $VERSION = "6.3.0"; +our $VERSION = "6.4.0"; our $STATUS = "beta"; #------------------------------------------------------------------- @@ -53,6 +53,15 @@ sub _processOperations { return $output; } +#------------------------------------------------------------------- +sub _setup { + require WebGUI::Operation::WebGUI; + my $output = WebGUI::Operation::WebGUI::www_setup(); + $output = WebGUI::HTTP::getHeader().$output; + WebGUI::Session::close(); + return $output; +} + #------------------------------------------------------------------- sub _upgrading { my $webguiRoot = shift; @@ -76,6 +85,7 @@ sub page { my $fastcgi = shift; WebGUI::Session::open($webguiRoot,$configFile,$fastcgi) unless ($useExistingSession); return _upgrading($webguiRoot) if ($session{setting}{specialState} eq "upgrading"); + return _setup() if ($session{setting}{specialState} eq "init"); my $output = _processOperations(); if ($output eq "") { my $asset = WebGUI::Asset->newByUrl($assetUrl); diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index 9d151c0b7..612bdd839 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -177,6 +177,7 @@ sub getOperations { 'editUser' => 'WebGUI::Operation::User', 'editUserSave' => 'WebGUI::Operation::User', 'listUsers' => 'WebGUI::Operation::User', + 'setup' => 'WebGUI::Operation::WebGUI', 'theWg' => 'WebGUI::Operation::WebGUI', 'genesis' => 'WebGUI::Operation::WebGUI', 'deleteSubscription' => 'WebGUI::Operation::Subscription', diff --git a/lib/WebGUI/Operation/WebGUI.pm b/lib/WebGUI/Operation/WebGUI.pm index 0922690a2..ea4695e84 100644 --- a/lib/WebGUI/Operation/WebGUI.pm +++ b/lib/WebGUI/Operation/WebGUI.pm @@ -10,8 +10,15 @@ package WebGUI::Operation::WebGUI; # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- +use Digest::MD5; use strict; +use WebGUI::FormProcessor; +use WebGUI::HTMLForm; +use WebGUI::HTTP; use WebGUI::Session; +use WebGUI::SQL; +use WebGUI::Style; +use WebGUI::User; #------------------------------------------------------------------- sub www_genesis { @@ -31,6 +38,100 @@ sub www_genesis { return $output; } +#------------------------------------------------------------------- +sub www_setup { + unless ($session{setting}{specialState} eq "init") { + if (rand(10)>5) { + return www_genesis(); + } else { + return www_theWg(); + } + } + my $output = ' + +
+
+
+';
+ return $output;
+}
+
+
#-------------------------------------------------------------------
sub www_theWg {
$session{page}{useEmptyStyle} = 1;