diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 02a5edc65..d3c3ee736 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -3,10 +3,15 @@ fixed. - fix: Column Layout seems a little messed up - Fixed the EMS default templates to expose all functionality. - - Fixed a problem in the EMS where it wouldn't let you add any events. - fix: FieldName incorrect after adding profile field - fix: preload.perl for other roots than /data/WebGUI - Fixed a bug where polls weren't distributing karma. + - fix: Asset menu + - fix: Event Manager - can't add event + - fix: v6.99.1, security: Spectre listens to INADDR_ANY (profo) + - fix: Manage groups in this group doesn't work + - Fixed a problem where the not found page would not display. + - fix: New page layout instead of not found 6.99.2 - fix - demo.plainblack.com getting started diff --git a/docs/upgrades/upgrade_6.99.2-6.99.3.pl b/docs/upgrades/upgrade_6.99.2-6.99.3.pl index 4894b4e18..521579f2f 100644 --- a/docs/upgrades/upgrade_6.99.2-6.99.3.pl +++ b/docs/upgrades/upgrade_6.99.2-6.99.3.pl @@ -22,10 +22,18 @@ my $session = start(); # this line required fixCs(); fixCss(); +fixSpectre(); finish($session); # this line required +#------------------------------------------------- +sub fixSpectre { + print "\tAdding more security to Spectre.\n" unless ($quiet); + my $config = WebGUI::Config->new("../..","spectre.conf"); + $config->set("ip","127.0.0.1"); +} + #------------------------------------------------- sub fixCss { print "\tUpdating CSS.\n" unless ($quiet); diff --git a/etc/spectre.conf.original b/etc/spectre.conf.original index 00b02a045..284d6dbbf 100644 --- a/etc/spectre.conf.original +++ b/etc/spectre.conf.original @@ -2,6 +2,11 @@ { +# Define the IP address that Spectre should run on. If WebGUI and +# Spectre are on the same machine, you should leave this as is. + +"ip" : "127.0.0.1", + # Define a port for Spectre to run on between 1024 and 65000. "port" : 32133, diff --git a/lib/Spectre/Admin.pm b/lib/Spectre/Admin.pm index a0fc48367..12a4f6b29 100644 --- a/lib/Spectre/Admin.pm +++ b/lib/Spectre/Admin.pm @@ -142,7 +142,9 @@ sub new { my $self = {_debug=>$debug, _config=>$config, _logger=>$logger}; bless $self, $class; $self->runTests(); + $self->debug("Trying to bind to ".$config->get("ip").":".$config->get("port")); create_ikc_server( + ip => $config->get("ip"), port => $config->get("port"), name => 'Spectre', ); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 81c0bff75..4b3c10ced 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -197,10 +197,10 @@ sub page { $output = tryAssetMethod($session,$asset,$method); $output = tryAssetMethod($session,$asset,"view") unless ($output || ($method eq "view")); } - if (defined($output) and $output eq "") { + if ($output eq "") { if ($session->var->isAdminOn) { # they're expecting it to be there, so let's help them add it my $asset = WebGUI::Asset->newByUrl($session, $session->url->getRefererUrl) || WebGUI::Asset->getDefault($session); - $session->http->setRedirect($asset->getUrl("func=add;class=WebGUI::Asset::Wobject::Layout;url=".$assetUrl)) unless $session->url->getRequestedUrl eq $session->url->getRefererUrl; + $output = $asset->addMissing($assetUrl); } else { # not in admin mode, so can't create it, so display not found $session->http->setStatus("404","Page Not Found"); my $notFound = WebGUI::Asset->getNotFound($session); diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index cbf16e8d0..b80e78e42 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -54,6 +54,32 @@ These methods are available from this class: =cut +#------------------------------------------------------------------- + +=head2 addMissing ( url ) + +Displays a message to the admin that they have requested a non-existent page and give them an option to create it. + +=head3 url + +The missing URL. + +=cut + +sub addMissing { + my $self = shift; + my $assetUrl = shift; + return undef unless ($self->session->var->isAdminOn); + my $ac = $self->getAdminConsole; + my $i18n = WebGUI::International->new($self->session, "Asset"); + my $output = $i18n->get("missing page query"); + $output .= ''; + return $ac->render($output); +} + #------------------------------------------------------------------- =head2 canAdd ( session, [userId, groupId] ) @@ -479,7 +505,6 @@ sub getContainer { } } - #------------------------------------------------------------------- =head2 getDefault ( session ) @@ -916,18 +941,24 @@ sub getToolbar { my $output = ''.$toolbar; @@ -1829,7 +1854,6 @@ sub www_add { return $newAsset->www_edit(); } - #------------------------------------------------------------------- =head2 www_ajaxInlineView ( ) diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 59fc9d88c..59b53e91b 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -149,7 +149,7 @@ sub walkGroups { .$session->icon->delete('op=deleteGroupGrouping;gid='.$parentId.';delete='.$id) .$session->icon->edit('op=editGroup;gid='.$id) .' '.$name.'
'; - $output .= $session->walkGroups($id,$indent."    "); + $output .= walkGroups($session, $id,$indent."    "); } $sth->finish; return $output; @@ -159,7 +159,7 @@ sub walkGroups { sub www_addGroupsToGroupSave { my $session = shift; return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session,$session->form->process("gid"))); - my $group = WebGUI::Group->new($session,$_[0]); + my $group = WebGUI::Group->new($session,$session->form->process("gid")); my @groups = $session->form->group('groups'); $group->addGroups(\@groups); return www_manageGroupsInGroup($session); @@ -635,7 +635,7 @@ sub www_manageGroupsInGroup { $f->submit; my $output = $f->print; $output .= '

'; - $output .= $session->walkGroups($session->form->process("gid")); + $output .= walkGroups($session, $session->form->process("gid")); return _submenu($session,$output,'813'); } diff --git a/lib/WebGUI/i18n/English/Asset.pm b/lib/WebGUI/i18n/English/Asset.pm index f1b9b1851..c54a1ab2d 100644 --- a/lib/WebGUI/i18n/English/Asset.pm +++ b/lib/WebGUI/i18n/English/Asset.pm @@ -1,6 +1,18 @@ package WebGUI::i18n::English::Asset; our $I18N = { + 'add the missing page' => { + message => q|Add the missing page.|, + lastUpdated => 0, + context => q|the question asked of the admin when they click on a missing page| + }, + + 'missing page query' => { + message => q|The page you have requested does not exist. What would you like to do?|, + lastUpdated => 0, + context => q|the question asked of the admin when they click on a missing page| + }, + 'package corrupt' => { message => q|The package you tried to import appears to be corrupt. We imported up to the point where we detected corruption. If you won't want this portion, roll back your current version tag.|, lastUpdated => 0,