%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# Copyright (c) 2001 Sergey Rusakov. All rights reserved. %# This program is free software; you can redistribute it %# and/or modify it under the same terms as Perl itself. %# %# $Revision: 3.2 $ %# $Date: 2003/04/24 05:36:51 $ %# $Header: /home/cvsroot/ePortal/comp_root/acl.htm,v 3.2 2003/04/24 05:36:51 ras Exp $ %# %#---------------------------------------------------------------------------- % if ($dialog_submit) { % } <% $dlg->dialog_start( title => pick_lang(rus => "Редактор ACL", eng => "ACL editor") , x_button => 0, delete_button => 0, obj => $object, action => '/acl.htm', ) %> <% $dlg->row( pick_lang(rus => "Объект", eng => "Object"), "$objtype:$objid", ) %> % if (exists $object->{Data}->{title}) { <% $dlg->row( pick_lang(rus => "Название", eng => "Title"), $object->title, ) %> % } <% $dlg->row("
") %> <% $dlg->row( pick_lang(rus => "Владелец", eng => "Owner"), CGI::popup_menu( -name => "uid", -default => $object->uid, -labels => $usr_labels, -values => $usr_values, ), ) %> <% $dlg->row("
") %> <% $dlg->row( pick_lang(rus => "Группа", eng => "Group"), CGI::popup_menu( -name => "gid", -default => $object->gid, -labels => $grp_labels, -values => $grp_values, ), ) %> <% $dlg->row( pick_lang(rus => "Права группы", eng => "Group rights"), CGI::checkbox( -name => "gid_r", -checked => $object->gid_r, -label => "R", ) . ' ' . ' ' . CGI::checkbox( -name => "gid_w", -checked => $object->gid_w, -label => "W", ) . ' ' . ' ' . CGI::checkbox( -name => "gid_a", -checked => $object->gid_a, -label => "A", ), ) %> <% $dlg->row("
") %> <% $dlg->row( pick_lang(rus => "Права всех", eng => "ALL rights"), CGI::checkbox( -name => "all_r", -checked => $object->all_r, -label => "R", ) . ' ' . ' ' . CGI::checkbox( -name => "all_w", -checked => $object->all_w, -label => "W", ) . ' ' . ' ' . CGI::checkbox( -name => "all_a", -checked => $object->all_a, -label => "A", ) . '
' . CGI::checkbox( -name => "all_reg", -checked => $object->all_reg, -label => "Registered only", ), ) %> <% $dlg->row("
") %> <% $dlg->row( undef, CGI::checkbox( -name => "recursive", -checked => 0, -label => pick_lang(rus => "Включая подчиненных", eng => "Recursive"), ) ) %> <% $dlg->buttons %> <% $dlg->dialog_end %> %#=== @METAGS init ========================================================= <%init> if (! $objid or ! $objtype) { $m->comp("/message.mc", ErrorMessage => pick_lang( rus => "Не указан объект для редактирования", eng => "Which object to edit?")); $m->comp("SELF:window_close"); return; } my $object; eval { $object = new $objtype; }; if ($@) { logline('crit', $@); $m->comp("/message.mc", ErrorMessage => pick_lang( rus => "Ошибка создания запрошенного объекта", eng => "Cannot create the object")); $m->comp("SELF:window_close"); return; } if (! $object->restore($objid) ) { $m->comp("/message.mc", ErrorMessage => pick_lang( rus => "Ошибка при восстановлении запрошенного объекта", eng => "Cannot find the object")); $m->comp("SELF:window_close"); return; } if (! $object->isa("ePortal::ThePersistent::ACL") ) { $m->comp("/message.mc", ErrorMessage => pick_lang( rus => "Запрошенный объект не поддерживает редактирование прав доступа.", eng => "the object does not support ACL")); $m->comp("SELF:window_close"); return; } if (! $object->acl_check('a')) { $m->comp("/message.mc", ErrorMessage => pick_lang( rus => "Вы не имеете права на изменение списка доступа для этого объекта.", eng => "You don't have admin permission on the object")); $m->comp("SELF:window_close"); return; } # # Process dialog buttons # $dlg = new ePortal::HTML::Dialog; $dlg->handle_request; if ($dlg->isButtonPressed("ok")) { my %new_acl = ( uid => $uid, gid => $gid, gid_r => $gid_r, gid_w => $gid_w, gid_a => $gid_a, all_r => $all_r, all_w => $all_w, all_a => $all_a, all_reg => $all_reg ); if ($recursive) { $object->set_acl_r( %new_acl ); } else { $object->set_acl( %new_acl ); } $object->update; } # # Prepare dialog items # my ($grp_labels, $grp_values); my ($usr_labels, $usr_values); if (!$dlgb_ok and !$dlgb_cancel) { my $grp = new ePortal::epGroup; ($grp_values, $grp_labels) = $grp->restore_all_hash('groupname', 'groupdesc', undef, 'groupdesc'); unshift @$grp_values, ""; $grp_labels->{""} = pick_lang(rus => '-НЕТ-', eng => '-NOBODY-'); my $usr = new ePortal::epUser; ($usr_values, $usr_labels) = $usr->restore_all_hash('username', 'fullname', undef, 'fullname'); unshift @$usr_values, ""; $usr_labels->{""} = pick_lang(rus => '-НЕТ-', eng => '-NOBODY-'); } %#=== @METAGS window_close ==================================================== <%method window_close>

"Close")%>" onclick="window.close()"> %#=== @metags attr ========================================================= <%attr> Title => "Редактор прав доступа" Layout => 'Popup' %#=== @METAGS args ========================================================= <%args> $objid => undef $objtype => undef $dialog_submit => undef $dlgb_ok => undef $dlgb_cancel => undef $recursive => undef $uid => undef $gid => undef $gid_r => undef $gid_w => undef $gid_a => undef $all_r => undef $all_w => undef $all_a => undef $all_reg => undef %#=== @metags once ========================================================= <%once> my ($dlg, $obj); %#=== @metags cleanup ========================================================= <%cleanup> ($dlg, $obj) = ();