diff --git a/out/out.DocumentAccess.php b/out/out.DocumentAccess.php index f517c2585..b18cd4cbe 100644 --- a/out/out.DocumentAccess.php +++ b/out/out.DocumentAccess.php @@ -1,234 +1,242 @@ -\n"; - print "\t\n"; - print "\t\n"; - print "\t\n"; - print "\t\n"; - print "\n"; -} - -if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { - UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); -} - -$documentid = $_GET["documentid"]; -$document = $dms->getDocument($documentid); - -if (!is_object($document)) { - UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); -} - -$folder = $document->getFolder(); -$docPathHTML = getFolderPathHTML($folder, true). " / ".htmlspecialchars($document->getName()).""; - -if ($document->getAccessMode($user) < M_ALL) { - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); +include("../inc/inc.Language.php"); +include("../inc/inc.ClassUI.php"); +include("../inc/inc.Authentication.php"); + +function printAccessModeSelection($defMode) { + print "\n"; } -UI::htmlStartPage(getMLText("document_title", array("documentname" => $document->getName()))); -UI::globalNavigation($folder); +if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) { + UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); +} + +$documentid = $_GET["documentid"]; +$document = $dms->getDocument($documentid); + +if (!is_object($document)) { + UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); +} + +$folder = $document->getFolder(); +$docPathHTML = getFolderPathHTML($folder, true). " / ".htmlspecialchars($document->getName()).""; + +if ($document->getAccessMode($user) < M_ALL) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); +} + +UI::htmlStartPage(getMLText("document_title", array("documentname" => $document->getName()))); +UI::globalNavigation($folder); UI::pageNavigation($docPathHTML, "view_document"); - -?> - - - - + + + +getAllUsers(); -UI::contentHeading(getMLText("edit_document_access")); -UI::contentContainerStart(); - +UI::contentHeading(getMLText("edit_document_access")); +UI::contentContainerStart(); + if ($user->isAdmin()) { - UI::contentSubHeading(getMLText("set_owner")); -?> -
- - - : - "> -
-inheritsAccess()) { - printMLText("inherits_access_msg", array( - "copyurl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=notinherit&mode=copy", - "emptyurl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=notinherit&mode=empty")); - UI::contentContainerEnd(); - UI::htmlEndPage(); - exit(); -} -printMLText("does_not_inherit_access_msg", array("inheriturl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=inherit")); - -$accessList = $document->getAccessList(); - -UI::contentSubHeading(getMLText("default_access")); - -?> -
- - - getDefaultAccess()); ?> - "> -
- - +
+ + + : + "> +
+inheritsAccess()) { + printMLText("inherits_access_msg", array( + "copyurl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=notinherit&mode=copy", + "emptyurl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=notinherit&mode=empty")); + UI::contentContainerEnd(); + UI::htmlEndPage(); + exit(); +} +printMLText("does_not_inherit_access_msg", array("inheriturl" => "../op/op.DocumentAccess.php?documentid=".$documentid."&action=inherit")); + +$accessList = $document->getAccessList(); + +UI::contentSubHeading(getMLText("default_access")); + +?> +
+ + + getDefaultAccess()); ?> + "> +
+ +"; - - foreach ($accessList["users"] as $userAccess) { - $userObj = $userAccess->getUser(); - print "
\n"; - print "\n"; - print "\n"; - print "getID()."\">\n"; - print "\n"; - print "\n"; - print "". htmlspecialchars($userObj->getFullName()) . "\n"; - print "\n"; - printAccessModeSelection($userAccess->getMode()); - print "\n"; - print "\n"; - print "".getMLText("save")." "; - print "getID()."\">".getMLText("delete"); - print "\n"; - print "
\n"; - } - - foreach ($accessList["groups"] as $groupAccess) { - $groupObj = $groupAccess->getGroup(); - $mode = $groupAccess->getMode(); - print "
"; - print ""; - print ""; - print "getID()."\">"; - print ""; - print ""; - print "". htmlspecialchars($groupObj->getName()) . ""; - print ""; - printAccessModeSelection($groupAccess->getMode()); - print "\n"; - print "\n"; - print "".getMLText("save")." "; - print "getID()."\">".getMLText("delete"); - print ""; - print "
"; + + /* memorїze users with access rights */ + $memusers = array(); + foreach ($accessList["users"] as $userAccess) { + $userObj = $userAccess->getUser(); + $memusers[] = $userObj->getID(); + print "
\n"; + print "\n"; + print "\n"; + print "getID()."\">\n"; + print "\n"; + print "\n"; + print "". htmlspecialchars($userObj->getFullName()) . "\n"; + print "\n"; + printAccessModeSelection($userAccess->getMode()); + print "\n"; + print "\n"; + print "".getMLText("save")." "; + print "getID()."\">".getMLText("delete"); + print "\n"; + print "
\n"; + } + + /* memorїze groups with access rights */ + $memgroups = array(); + foreach ($accessList["groups"] as $groupAccess) { + $groupObj = $groupAccess->getGroup(); + $memgroups[] = $groupObj->getID(); + $mode = $groupAccess->getMode(); + print "
"; + print ""; + print ""; + print "getID()."\">"; + print ""; + print ""; + print "". htmlspecialchars($groupObj->getName()) . ""; + print ""; + printAccessModeSelection($groupAccess->getMode()); + print "\n"; + print "\n"; + print "".getMLText("save")." "; + print "getID()."\">".getMLText("delete"); + print ""; + print "
"; } - print "
"; -} -?> -
- - - - - - - - - - - - - - - - - - -
: - -
: - -
: - -
">
-
- - + print "
"; +} +?> +
+ + + + + + + + + + + + + + + + + + +
: + +
: + +
: + +
">
+
+ +