fixed bug 729711

This commit is contained in:
JT Smith 2003-05-17 01:42:47 +00:00
parent 3531838ace
commit 15aa3403bb
6 changed files with 54 additions and 6 deletions

View file

@ -32,6 +32,7 @@ $macros->{SpecificDropMenu} = "SpecificDropMenu";
$macros->{LastModified} = "LastModified";
$macros->{PreviousDropMenu} = "PreviousDropMenu";
$macros->{TopDropMenu} = "TopDropMenu";
$macros->{EditableToggle} = "EditableToggle";
$macros->{SI} = "SI_scaledImage";
$conf->set("macros"=>$macros);
my $wobjects = $conf->get("wobjects");

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
package WebGUI::Macro::EditableToggle;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2003 Plain Black LLC.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::URL;
#-------------------------------------------------------------------
sub process {
my ($temp, @param, $turnOn, $turnOff);
if (WebGUI::Privilege::canEditPage()) {
@param = WebGUI::Macro::getParams($_[0]);
if ($session{var}{adminOn}) {
$turnOff = $param[1] || WebGUI::International::get(517);
$temp = '<a href="'.WebGUI::URL::page('op=switchOffAdmin').'">'.$turnOff.'</a>';
} else {
$turnOn = $param[0] || WebGUI::International::get(516);
$temp = '<a href="'.WebGUI::URL::page('op=switchOnAdmin').'">'.$turnOn.'</a>';
}
}
return $temp;
}
1;

View file

@ -258,7 +258,9 @@ If specified the wobject will be duplicated to this pageId, otherwise it will be
=cut
sub duplicate {
my %properties = %{$_[0]->get};
my %properties;
tie %properties, 'Tie::CPHash';
%properties = %{$_[0]->get};
$properties{pageId} = $_[1] || 2;
if ($properties{pageId} == 2) {
$properties{bufferUserId} = $session{user}{userId};

View file

@ -149,6 +149,8 @@ sub www_view {
$redirect=0;
return $output unless ($proxiedUrl ne "");
until($redirect == 5) { # We follow max 5 redirects to prevent bouncing/flapping
$userAgent = new LWP::UserAgent;
$userAgent->agent($session{env}{HTTP_USER_AGENT});
@ -168,9 +170,8 @@ sub www_view {
$header = new HTTP::Headers;
$header->referer($_[0]->get("proxiedUrl")); # To get around referrer blocking
if($session{env}{REQUEST_METHOD}=~/GET/i
|| $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're
# not posting the same data over and over again.
if($session{env}{REQUEST_METHOD}=~/GET/i || $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're
# not posting the same data over and over again.
if($redirect == 0 && $session{form}{wid} == $_[0]->get("wobjectId")) {
foreach my $input_name (keys %{$session{form}}) {
next if ($input_name !~ /^HttpProxy_/); # Skip non proxied form var's

View file

@ -90,6 +90,7 @@ function returnSelected(in_values) {
<option value='^CanEditText("You can edit this page.");'>Can Edit Page Message</option>
<option value='^AdminText("You are in admin mode!");'>Admin Mode Message</option>
<option value='^GroupText("Visitors","You need an account to do anything cool on this site!");'>Group Message</option>
<option value='^EditableToggle;'>Page Editable Toggle</option>
<option value='^AdminToggle;'>Admin Toggle</option>
<option value='^LoginToggle;'>Login Toggle</option>
<option value='^@;'>Username</option>