several bug fixes

added asset type icons to toolbar
added isAdminOn, switchOnAdmin, and switchOffAdmin subs to WebGUI::Session
This commit is contained in:
JT Smith 2005-03-03 22:34:14 +00:00
parent e5f55921ab
commit e9d6c1b4e4
9 changed files with 80 additions and 15 deletions

View file

@ -4,6 +4,9 @@
configure a custom admin username and password for better security.
- Added some indicies to increase performance.
- Added all sorts of caching to increase performance.
- Added asset type icons to the asset toolbar.
- Added isAdminOn(), switchOnAdmin(), and switchOffAdmin() to WebGUI::Session
to eliminate all of the previously cryptic means of doing those things.
- 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.
@ -18,6 +21,12 @@
- bugfix [ 1152826 ] WebGUI.conf.original in source is not complit
- bugfix [ 1145984 ] <tmpl_var session.page.title> is still in Style
Templates
- bugfix [ 1152948 ] Edit Layout changes settings to defaults
- bugfix [ 1151400 ] editSave on Template erases namespace
- bugfix [ 1154211 ] Error: Can't instanciate template on Add Article
- bugfix [ 1153518 ] re-edit forum post error
- bugfix [ 1152819 ] Error when edit fild in Admin console -> user profiling
- bugfix [ 1152047 ] Unable to create new account
6.3.0

View file

@ -1500,7 +1500,7 @@ sub getToolbar {
# .moveTopIcon('func=moveTop&wid='.${$wobject}{wobjectId})
# .moveBottomIcon('func=moveBottom&wid='.${$wobject}{wobjectId})
$toolbar .= shortcutIcon('func=createShortcut',$self->get("url")) unless ($self->get("className") =~ /Shortcut/);
return $toolbar;
return '<img src="'.$self->getIcon(1).'" border="0" title="'.$self->getName.'" alt="'.$self->getName.'" align="absmiddle">'.$toolbar;
}
#-------------------------------------------------------------------

View file

@ -338,7 +338,7 @@ sub view {
my %var = (
isShortcut => 1,
'shortcut.content' => $content,
'shortcut.label' => WebGUI::International::get('3',"Shortcut");
'shortcut.label' => WebGUI::International::get('3',"Shortcut"),
originalURL => $self->getShortcut->getUrl
);
return $self->processTemplate(\%var,$self->getValue("templateId"));

View file

@ -136,7 +136,7 @@ sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
# $tabform->getTab("properties")->raw('<input type="hidden" name="op2" value="'.$session{form}{afterEdit}.'" />');
if ($session{form}{func} eq "add") {
if ($self->getValue("namespace") eq "") {
my $namespaces = WebGUI::SQL->buildHashRef("select distinct(namespace),namespace
from template order by namespace");
$tabform->getTab("properties")->combo(
@ -150,6 +150,10 @@ sub getEditForm {
-label=>WebGUI::International::get('namespace','Template'),
-value=>$self->getValue("namespace")
);
$tabform->getTab("meta")->hidden(
-name=>"namespace",
-value=>$self->getValue("namespace")
);
}
$tabform->getTab("display")->yesNo(
-name=>"showInForms",
@ -312,7 +316,11 @@ sub processRaw {
#-------------------------------------------------------------------
sub view {
my $self = shift;
return $self->getParent->view;
if (WebGUI::Session::isAdminOn()) {
return $self->getToolbar;
} else {
return "";
}
}
@ -324,6 +332,11 @@ sub www_edit {
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get('edit template', 'Template'));
}
#-------------------------------------------------------------------
sub www_view {
my $self = shift;
return $self->getContainer->www_view;
}

View file

@ -34,6 +34,7 @@ use WebGUI::Asset::Template;
use WebGUI::URL;
use WebGUI::Utility;
use WebGUI::Operation::Shared;
use WebGUI::Operation::Profile;
=head1 NAME

View file

@ -25,7 +25,7 @@ sub process {
my ($turnOn,$turnOff,$templateName) = WebGUI::Macro::getParams($_[0]);
$turnOn |= WebGUI::International::get(516);
$turnOff |= WebGUI::International::get(517);
if ($session{var}{adminOn}) {
if (WebGUI::Session::isAdminOn()) {
$var{'toggle.url'} = WebGUI::URL::page('op=switchOffAdmin');
$var{'toggle.text'} = $turnOff;
} else {

View file

@ -14,7 +14,6 @@ use strict;
use WebGUI::AdminConsole;
use WebGUI::Grouping;
use WebGUI::Session;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub www_adminConsole {
@ -26,16 +25,14 @@ sub www_adminConsole {
#-------------------------------------------------------------------
sub www_switchOffAdmin {
return "" unless (WebGUI::Grouping::isInGroup(12));
WebGUI::SQL->write("update userSession set adminOn=0 where sessionId='$session{var}{sessionId}'");
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
WebGUI::Session::switchAdminOff();
return "";
}
#-------------------------------------------------------------------
sub www_switchOnAdmin {
return "" unless (WebGUI::Grouping::isInGroup(12));
WebGUI::SQL->write("update userSession set adminOn=1 where sessionId='$session{var}{sessionId}'");
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
WebGUI::Session::switchAdminOn();
return "";
}

View file

@ -122,6 +122,18 @@ sub www_editSettings {
-label=>$i18n->get(465),
-value=>$session{setting}{textBoxSize}
);
$tabform->getTab("ui")->template(
-name=>"userFunctionStyleId",
-label=>"User Function Style",
-namespace=>"style",
-value=>$session{setting}{userFunctionStyleId}
);
$tabform->getTab("ui")->template(
-name=>"AdminConsoleTemplate",
-label=>"Admin Console Template",
-namespace=>"AdminConsole",
-value=>$session{setting}{AdminConsoleTemplate}
);
# messaging settings
$tabform->getTab("messaging")->text(
-name=>"smtpServer",
@ -210,11 +222,6 @@ sub www_editSettings {
-value=>$session{setting}{passiveProfilingEnabled},
-extras=>' onChange="alert(\''.$i18n->get("Illegal Warning","Asset").'\')" '
);
$tabform->getTab("user")->yesNo(
-name=>"userFunctionStyleId",
-label=>"User Function Style",
-value=>$session{setting}{userFunctionStyleId}
);
# auth settings
WebGUI::Style::setScript($session{config}{extrasURL}."/swapLayers.js",{language=>"Javascript"});
$tabform->getTab("auth")->raw('<script language="JavaScript" > var active="'.$session{setting}{authMethod}.'"; </script>');

View file

@ -275,6 +275,18 @@ sub getScratch {
#-------------------------------------------------------------------
=head2 isAdminOn ( )
Returns a boolean indicating whether admin mode is on or not.
=cut
sub isAdminOn {
return $session{var}{adminOn};
}
#-------------------------------------------------------------------
=head2 open ( webguiRoot, configFile [ , fastcgi ] )
Opens a closed ( or new ) WebGUI session.
@ -490,4 +502,30 @@ sub start {
return $sessionId;
}
#-------------------------------------------------------------------
=head2 switchAdminOff ( )
Disables admin mode.
=cut
sub switchAdminOff {
WebGUI::SQL->write("update userSession set adminOn=0 where sessionId='$session{var}{sessionId}'");
refreshSessionVars($session{var}{sessionId});
}
#-------------------------------------------------------------------
=head2 switchAdminOn ( )
Enables admin mode.
=cut
sub switchAdminOn {
WebGUI::SQL->write("update userSession set adminOn=1 where sessionId='$session{var}{sessionId}'");
refreshSessionVars($session{var}{sessionId});
}
1;