From ff74fd32c687a0098af28747c2e0a4400b11b051 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 15 Feb 2002 21:34:00 +0000 Subject: [PATCH] WebGUI 3.2.3 release --- docs/create.sql | 10 +++++----- docs/upgrades/upgrade_3.2.2-3.2.3.sql | 7 +++++++ lib/WebGUI.pm | 2 +- lib/WebGUI/Operation/Image.pm | 9 +++++---- lib/WebGUI/Operation/User.pm | 4 ++-- lib/WebGUI/Privilege.pm | 24 ++++++++++++------------ 6 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 docs/upgrades/upgrade_3.2.2-3.2.3.sql diff --git a/docs/create.sql b/docs/create.sql index d65e68d4a..60fa478aa 100644 --- a/docs/create.sql +++ b/docs/create.sql @@ -1475,11 +1475,11 @@ INSERT INTO international VALUES (37,'WebGUI','Dutch','Geen toegang!'); INSERT INTO international VALUES (37,'WebGUI','English','Permission Denied!'); INSERT INTO international VALUES (37,'WebGUI','Español','Permiso Denegado!'); INSERT INTO international VALUES (37,'WebGUI','Português','Permissão negada!'); -INSERT INTO international VALUES (38,'WebGUI','Deutsch','Sie sind nicht berechtigt, diese Aktion auszuführen. Melden Sie sich bitte mit einem Benutzernamen an, der über ausreichende Rechte verfügt.'); -INSERT INTO international VALUES (38,'WebGUI','Dutch','U heeft niet voldoende privileges om deze operatie te doen. Log in als een gebruiker met voldoende privileges.'); -INSERT INTO international VALUES (38,'WebGUI','English','You do not have sufficient privileges to perform this operation. Please log in with an account that has sufficient privileges before attempting this operation.'); -INSERT INTO international VALUES (38,'WebGUI','Español','\"No tiene privilegios suficientes para realizar ésta operación. Por favor ingrese con una cuenta que posea los privilegios suficientes antes de intentar ésta operación.\"'); -INSERT INTO international VALUES (38,'WebGUI','Português','\"Não tem privilégios para essa operação. Identifique-se na entrada com uma conta que permita essa operação.\"'); +INSERT INTO international VALUES (38,'WebGUI','Deutsch','Sie sind nicht berechtigt, diese Aktion auszuführen. ^a(Melden Sie sich bitte mit einem Benutzernamen an);, der über ausreichende Rechte verfügt.'); +INSERT INTO international VALUES (38,'WebGUI','Dutch','U heeft niet voldoende privileges om deze operatie te doen. ^a(Log in); als een gebruiker met voldoende privileges.'); +INSERT INTO international VALUES (38,'WebGUI','English','You do not have sufficient privileges to perform this operation. Please ^a(log in with an account); that has sufficient privileges before attempting this operation.'); +INSERT INTO international VALUES (38,'WebGUI','Español','\"No tiene privilegios suficientes para realizar ésta operación. Por favor ^a(ingrese con una cuenta); que posea los privilegios suficientes antes de intentar ésta operación.\"'); +INSERT INTO international VALUES (38,'WebGUI','Português','\"Não tem privilégios para essa operação. ^a(Identifique-se na entrada); com uma conta que permita essa operação.\"'); INSERT INTO international VALUES (39,'WebGUI','Deutsch','Sie sind nicht berechtigt, diese Seite anzuschauen.'); INSERT INTO international VALUES (39,'WebGUI','Dutch','U heeft niet voldoende privileges om deze pagina op te vragen.'); INSERT INTO international VALUES (39,'WebGUI','English','You do not have sufficient privileges to access this page.'); diff --git a/docs/upgrades/upgrade_3.2.2-3.2.3.sql b/docs/upgrades/upgrade_3.2.2-3.2.3.sql new file mode 100644 index 000000000..36f1e63ff --- /dev/null +++ b/docs/upgrades/upgrade_3.2.2-3.2.3.sql @@ -0,0 +1,7 @@ +delete from international where internationalId=38 and namespace='WebGUI'; +INSERT INTO international VALUES (38,'WebGUI','Deutsch','Sie sind nicht berechtigt, diese Aktion auszuführen. ^a(Melden Sie sich bitte mit einem Benutzernamen an);, der über ausreichende Rechte verfügt.'); +INSERT INTO international VALUES (38,'WebGUI','Dutch','U heeft niet voldoende privileges om deze operatie te doen. ^a(Log in); als een gebruiker met voldoende privileges.'); +INSERT INTO international VALUES (38,'WebGUI','English','You do not have sufficient privileges to perform this operation. Please ^a(log in with an account); that has sufficient privileges before attempting this operation.'); +INSERT INTO international VALUES (38,'WebGUI','Español','\"No tiene privilegios suficientes para realizar ésta operación. Por favor ^a(ingrese con una cuenta); que posea los privilegios suficientes antes de intentar ésta operación.\"'); +INSERT INTO international VALUES (38,'WebGUI','Português','\"Não tem privilégios para essa operação. ^a(Identifique-se na entrada); com uma conta que permita essa operação.\"'); + diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index d8dc6c300..fc333fcea 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,5 +1,5 @@ package WebGUI; -our $VERSION = "3.2.2"; +our $VERSION = "3.2.3"; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2002 Plain Black Software. diff --git a/lib/WebGUI/Operation/Image.pm b/lib/WebGUI/Operation/Image.pm index e4485f322..039ab03b7 100644 --- a/lib/WebGUI/Operation/Image.pm +++ b/lib/WebGUI/Operation/Image.pm @@ -153,9 +153,9 @@ sub www_editImageSave { if ($file ne "") { $file = ", filename=".quote($file); } - WebGUI::SQL->write("update images set imageId=$session{form}{iid}, name=".quote($session{form}{name}). + WebGUI::SQL->write("update images set name=".quote($session{form}{name}). $file.", parameters=".quote($session{form}{parameters}).", userId=$session{user}{userId}, ". - " username=".quote($session{user}{username}).", dateUploaded=".time()); + " username=".quote($session{user}{username}).", dateUploaded=".time()." where imageId=$session{form}{iid}"); return www_listImages(); } else { return WebGUI::Privilege::insufficient(); @@ -164,7 +164,7 @@ sub www_editImageSave { #------------------------------------------------------------------- sub www_listImages { - my ($output, $sth, %data, @row, $dataRows, $prevNextBar, $i, $search); + my ($output, $sth, %data, @row, $dataRows, $prevNextBar, $i, $search, $isAdmin); tie %data, 'Tie::CPHash'; if (WebGUI::Privilege::isInGroup(4)) { $output = helpLink(26); @@ -180,10 +180,11 @@ sub www_listImages { $search = " where (name like '%".$session{form}{keyword}. "%' or filename like '%".$session{form}{keyword}."%') "; } + $isAdmin = WebGUI::Privilege::isInGroup(3); $sth = WebGUI::SQL->read("select * from images $search order by name"); while (%data = $sth->hash) { $row[$i] = ''; - if ($session{user}{userId} == $data{userId}) { + if ($session{user}{userId} == $data{userId} || $isAdmin) { $row[$i] .= ''; $row[$i] .= ''; $row[$i] .= ''; - $row[$i] .= ''.$data[1].''; #$row[$i] .= ''.$data[1].''; $row[$i] .= ''.$data[2].''; $i++; } $sth->finish; - ($dataRows, $prevNextBar) = paginate(50,WebGUI::URL::page('?op=listUsers'),\@row); + ($dataRows, $prevNextBar) = paginate(50,WebGUI::URL::page('op=listUsers'),\@row); $output .= ''; $output .= $dataRows; $output .= '
'; diff --git a/lib/WebGUI/Privilege.pm b/lib/WebGUI/Privilege.pm index b830b9fdb..a81af4799 100644 --- a/lib/WebGUI/Privilege.pm +++ b/lib/WebGUI/Privilege.pm @@ -72,14 +72,10 @@ sub canViewPage { #------------------------------------------------------------------- sub insufficient { my ($output); - if ($session{user}{userId} eq "") { - $output = WebGUI::Operation::Account::displayAccount(); - } else { - $output = '

'.WebGUI::International::get(37).'

'; - $output .= WebGUI::International::get(38); - $output .= '

'; - $output = WebGUI::Macro::process($output); - } + $output = '

'.WebGUI::International::get(37).'

'; + $output .= WebGUI::International::get(38); + $output .= '

'; + $output = WebGUI::Macro::process($output); return $output; } @@ -103,10 +99,14 @@ sub isInGroup { #------------------------------------------------------------------- sub noAccess { my ($output); - $output = '

'.WebGUI::International::get(37).'

'; - $output .= WebGUI::International::get(39); - $output .= '

'; - return $output; + if ($session{user}{userId} <= 1) { + $output = WebGUI::Operation::Account::www_displayAccount(); + } else { + $output = '

'.WebGUI::International::get(37).'

'; + $output .= WebGUI::International::get(39); + $output .= '

'; + } + return $output; } #-------------------------------------------------------------------