From 5a0bd14476382a169e958464b12dd9c7ca56934d Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Sat, 21 Jul 2007 21:12:31 +0000 Subject: [PATCH] Added 'Allow access from Macro's' setting to Database Links --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.3.21-7.4.0.pl | 12 ++++++++++++ lib/WebGUI/Operation/DatabaseLink.pm | 9 ++++++++- lib/WebGUI/i18n/English/WebGUI.pm | 5 +++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e62630746..299aa5b7c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -77,6 +77,7 @@ http://www.webgui.org/bugs/tracker/macro-not-working-i-httpproxy - fix: navigation shows toolbar for users who can't edit it http://www.webgui.org/bugs/tracker/navigation-shows-edit-button-to-users-without-permission + - add: Database Links now have a 'Allow access from macro's' setting 7.3.21 - fix: Self-deactivation doesn't show login screen after success diff --git a/docs/upgrades/upgrade_7.3.21-7.4.0.pl b/docs/upgrades/upgrade_7.3.21-7.4.0.pl index d1fe76533..90f3388c5 100644 --- a/docs/upgrades/upgrade_7.3.21-7.4.0.pl +++ b/docs/upgrades/upgrade_7.3.21-7.4.0.pl @@ -33,11 +33,23 @@ addNewsletter($session); addHttpProxyUrlPatternFilter($session); addCanStartThreadToCS($session); addPostCaptchaToCS($session); +addMacroAccessToDatabaseLinks($session); finish($session); # this line required #------------------------------------------------- +sub addMacroAccessToDatabaseLinks { + my $session = shift; + print "\tAdding allowMacroAccess setting to Database Links..." unless ($quiet); + + $session->db->write("ALTER TABLE databaseLink add column allowMacroAccess integer NOT NULL default 0"); + + print "OK\n"; + return; +} +#------------------------------------------------- + sub addPostCaptchaToCS { my $session = shift; print "\tAdding useCaptcha setting to Collaboration Systems..." unless ($quiet); diff --git a/lib/WebGUI/Operation/DatabaseLink.pm b/lib/WebGUI/Operation/DatabaseLink.pm index c5b315141..3fbeab77f 100644 --- a/lib/WebGUI/Operation/DatabaseLink.pm +++ b/lib/WebGUI/Operation/DatabaseLink.pm @@ -202,7 +202,13 @@ sub www_editDatabaseLink { -hoverHelp => $i18n->get('allowed keywords description'), -value => $db{allowedKeywords}, ); - $f->submit; + $f->yesNo( + -name => "allowMacroAccess", + -label => $i18n->get('allow access from macros'), + -defaultValue=>0, + -value => $db{allowMacroAccess}, + ); + $f->submit; $output .= $f->print; return _submenu($session,$output,"990","database link add/edit"); } @@ -230,6 +236,7 @@ sub www_editDatabaseLinkSave { identifier=>$session->form->process("dbidentifier"), DSN=>$session->form->process("DSN"), allowedKeywords=>$allowedKeywords, + allowMacroAccess=>$session->form->process("allowMacroAccess"), }; if ($session->form->process("dlid") eq "new") { WebGUI::DatabaseLink->create($session,$params); diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 3cb5f3580..7f9e5f783 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -3315,6 +3315,11 @@ a user.|, lastUpdated => 1165511447, }, + 'allow access from macros' => { + message => q|Allow access from Macro's|, + lastUpdated => 0, + }, + 'preview' => { message => q|Preview|, context => q|alternate image text displayed when a thumbnail cannot be found for an image. The image is being previewed.|,