diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 3c256b96e..b449940d2 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -1,8 +1,16 @@ dsn = DBI:mysql:WebGUI dbuser = webgui dbpass = password + logfile = /data/webgui.log + extrasURL = /extras extrasPath = /data/WebGUI/www/extras + uploadsURL = /uploads uploadsPath = /data/WebGUI/www/uploads + +wobjects = Article, EventsCalendar, ExtraColumn, FAQ, FileManager, HttpProxy, \ + Item, LinkList, MailForm, MessageBoard, Poll, Product, SiteMap, \ + SQLReport, Survey, SyndicatedContent, USS, WobjectProxy + diff --git a/lib/WebGUI/Macro/AdminBar.pm b/lib/WebGUI/Macro/AdminBar.pm index 44179a48d..9f8116015 100644 --- a/lib/WebGUI/Macro/AdminBar.pm +++ b/lib/WebGUI/Macro/AdminBar.pm @@ -30,11 +30,12 @@ sub _replacement { if ($session{user}{uiLevel} >= 7) { $hash{WebGUI::URL::page('op=selectPackageToDeploy')} = WebGUI::International::get(376); } - foreach $key (keys %{$session{wobject}}) { - my $cmd = "\$WebGUI::Wobject::".$key."::name"; - #$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = $session{wobject}{$key}; - $hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = eval($cmd); - WebGUI::ErrorHandler::warn("Could use wobject $key because: ".$@) if ($@); + foreach my $namespace (@{$session{config}{wobjects}}) { + my $cmd = "WebGUI::Wobject::".$namespace."::uiLevel"; + next if (eval($cmd) > $session{user}{uiLevel}); + $cmd = "\$WebGUI::Wobject::".$namespace."::name"; + $hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$namespace)} = eval($cmd); + WebGUI::ErrorHandler::warn("Could use wobject $namespace because: ".$@) if ($@); } %hash = sortHash(%hash); %hash = (%{{WebGUI::URL::page()=>WebGUI::International::get(1)}},%hash); diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index 31b0aa778..4a80b9661 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -213,35 +213,13 @@ sub _loadMacros { #------------------------------------------------------------------- sub _loadWobjects { - my ($dir, @files, $file, $cmd, $namespace, $exclude); - $dir = $session{config}{webguiRoot}.$session{os}{slash}."lib".$session{os}{slash}."WebGUI".$session{os}{slash}."Wobject"; - opendir (DIR,$dir) or WebGUI::ErrorHandler::fatalError("Can't open wobject directory!"); - @files = readdir(DIR); - foreach $file (@files) { - if ($file =~ /(.*?)\.pm$/) { - $namespace = $1; - $cmd = "use WebGUI::Wobject::".$namespace; - eval($cmd); - unless ($@) { - $exclude = $session{config}{excludeWobject}; - $exclude =~ s/ //g; - next if (isIn($namespace, split(/,/,$exclude))); - $cmd = "WebGUI::Wobject::".$namespace."::uiLevel"; - next if (eval($cmd) > $session{user}{uiLevel}); - # $cmd = "\$WebGUI::Wobject::".$namespace."::name"; - # $session{wobject}{$namespace} = eval($cmd); - $session{wobject}{$namespace} = $namespace; - # if ($@) { - # WebGUI::ErrorHandler::warn("No name method in wobject: $namespace. ".$@); - # $session{wobject}{$namespace} = "ERROR: ".$namespace; - # } - } else { - WebGUI::ErrorHandler::warn("Wobject failed to compile: $namespace. ".$@); - $session{wobject}{$namespace} = "ERROR: ".$namespace; - } + foreach my $namespace (@{$session{config}{wobjects}}) { + my $cmd = "use WebGUI::Wobject::".$namespace; + eval($cmd); + if ($@) { + WebGUI::ErrorHandler::warn("Wobject failed to compile: $namespace. ".$@); } } - closedir(DIR); } #-------------------------------------------------------------------