<!--
Copyright by Thomas Bley 2002-2003
thomas.bley@simple-groupware.de

http://www.simple-groupware.de
-->
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset={$charset}">
	<title>Admin2</title>
	<link rel="SHORTCUT ICON" href="{$imgpathmaster}/favicon.ico">
	<link rel="icon" href="{$imgpathmaster}/favicon.ico" type="image/ico">
<style type="text/css">
{literal}
<!--
body {scrollbar-face-color: #E4E4E4; scrollbar-shadow-color: #000000;scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #999999;scrollbar-darkshadow-color: #999999; scrollbar-track-color: #F3F3F3;scrollbar-arrow-color: #000000;
  BORDER-LEFT:#434343 1px solid;
}
td {  font-family: Arial, Helvetica,sans-serif; font-size: 10pt; font-variant: normal; text-transform: none; color: #000000}
a:hover {  color: #CC0000; text-decoration: underline}
-->
{/literal}
</style>

<script>
{literal}
function return_height() {
  Browser = navigator.appName;
  if (navigator.appName.substring(0,9) == "Microsoft") Browser = 'MSIE';
  if (Browser != 'MSIE') {
      return (innerHeight-4);
    } else {
      return (document.body.clientHeight-2);
      }
}


function move_to_left_users() {
  for (var i=document.rightsform["deny_users[]"].length-1;i>=0;i--) {
    if (document.rightsform["deny_users[]"].options[i].selected) {
	  document.rightsform["allow_users[]"].options[document.rightsform["allow_users[]"].length] = new Option(document.rightsform["deny_users[]"].options[i].text, document.rightsform["deny_users[]"].options[i].value);
      document.rightsform["deny_users[]"].remove(i);
	}
  };
}

function move_to_right_users() {
  for (var i=document.rightsform["allow_users[]"].length-1;i>=0;i--) {
    if (document.rightsform["allow_users[]"].options[i].selected) {
	  document.rightsform["deny_users[]"].options[document.rightsform["deny_users[]"].length] = new Option(document.rightsform["allow_users[]"].options[i].text, document.rightsform["allow_users[]"].options[i].value);
	  document.rightsform["allow_users[]"].remove(i);
	}
  };
}

function move_to_left_groups() {
  for (var i=document.rightsform["deny_groups[]"].length-1;i>=0;i--) {
    if (document.rightsform["deny_groups[]"].options[i].selected) {
	  document.rightsform["allow_groups[]"].options[document.rightsform["allow_groups[]"].length] = new Option(document.rightsform["deny_groups[]"].options[i].text, document.rightsform["deny_groups[]"].options[i].value);
      document.rightsform["deny_groups[]"].remove(i);
	}
  };
}

function move_to_right_groups() {
  for (var i=document.rightsform["allow_groups[]"].length-1;i>=0;i--) {
    if (document.rightsform["allow_groups[]"].options[i].selected) {
	  document.rightsform["deny_groups[]"].options[document.rightsform["deny_groups[]"].length] = new Option(document.rightsform["allow_groups[]"].options[i].text, document.rightsform["allow_groups[]"].options[i].value);
	  document.rightsform["allow_groups[]"].remove(i);
	}
  };
}

function select_all() {
  for (var i=document.rightsform["allow_users[]"].length-1;i>=0;i--) {
    if (!document.rightsform["allow_users[]"].options[i].selected) {
	  document.rightsform["allow_users[]"].options[i].selected = true;
	}
  }
  for (var i=document.rightsform["deny_users[]"].length-1;i>=0;i--) {
    if (!document.rightsform["deny_users[]"].options[i].selected) {
	  document.rightsform["deny_users[]"].options[i].selected = true;
	}
  }

  for (var i=document.rightsform["allow_groups[]"].length-1;i>=0;i--) {
    if (!document.rightsform["allow_groups[]"].options[i].selected) {
	  document.rightsform["allow_groups[]"].options[i].selected = true;
	}
  }
  for (var i=document.rightsform["deny_groups[]"].length-1;i>=0;i--) {
    if (!document.rightsform["deny_groups[]"].options[i].selected) {
	  document.rightsform["deny_groups[]"].options[i].selected = true;
	}
  }
}

{/literal}
</script>

</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="#1F4687" vlink="#1F4687" alink="#1F4687" bgcolor="#F3F3F3">
<center>

<table border="0" cellpadding="0" cellspacing="0" height="100%" width="98%"><tr><td>
<script>
document.write('<img src="templates/default/media/spacer.gif" width="1" height="'+return_height()+'">');
</script>
</td><td valign="top" align="center">

<img src="templates/default/media/spacer.gif" alt="" width="1" height="10" border="0"><br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="main.php" method="post">
<input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
<input type="hidden" name="id" value="{$id_string}">
<input type="hidden" name="return" value="{$return}">

<tr bgcolor="#D1D1D1"><td>
&nbsp;<font color="#4E4E4E"><b> {$username2} - {$hashmap.rightsmanager} {if $id_string neq "" && $username neq "admin"}({$hashmap.object}: {$query_str}){/if}{if $id_string neq "" && $username eq "admin"}({$hashmap.object}: {$id_string}){/if}</b></font>
</td>
{if $username eq "admin" && !$access_to_node}
<td nowrap>
	<select name="highlight_user">
		{section name=key loop=$users_all}
		<option value="{$users_all[key]}" {if $username3 eq $users_all[key]}selected{/if}>{$users_all[key]}
		{/section}
	</select>
	<input type="Submit" value="{$hashmap.highlight}"><input type="Submit" name="showonly" value="{$hashmap.showonly}">
</td>
{/if}
<td>&nbsp;</td>
<td align="right" nowrap>{if $id_string neq "" && $username eq "admin" && !$access_to_node}<a href="tree.php?startnode={$id_string}&{$SESSION}" target="treeframe">{$hashmap.reduce_tree}</a> / <a href="tree.php?{$SESSION}" target="treeframe">{$hashmap.full_tree}</a>{/if}</td>
</tr></form></table>

{if $access_to_node}

{if $cuser neq ""}
<br>
<center>{$hashmap.last_change}: {$cuser}, {$cdate}</center>
{/if}

<form name="rightsform" action="main.php" method="post">
<input type="hidden" name="{$SESSIONNAME}" value="{$SESSIONID}">
<input type="hidden" name="id" value="{$id_string}">
<input type="hidden" name="return" value="{$return}">

  <br>
  <table width="80%">
    <tr>
      <td align="center" bgcolor="#008000" width="50%">{$hashmap.allow}</td>
      <td>&nbsp; &nbsp; </td>
      <td align="center" bgcolor="#ff0000" width="50%">{$hashmap.deny}</td>
    </tr>
    <tr>
      <td align="center" width="250">
	    <select name="allow_users[]" size="10" multiple style="width: 250">
		{section name=key loop=$allow_users}
		  <option value="{$allow_users[key][0]}"> {$allow_users[key][1]}
		{/section}
		</select>
	  </td>
      <td valign="middle" align="center"><input type="Button" name="" value="<-<-" onclick="move_to_left_users();"><br><br>&nbsp;&nbsp;&nbsp;{$hashmap.users}&nbsp;&nbsp;&nbsp;<br><br><input type="Button" name="" value="->->" onclick="move_to_right_users()"></td>
      <td align="center" width="250">
	    <select name="deny_users[]" size="10" multiple style="width: 250">
		{section name=field loop=$deny_users}
		  <option value="{$deny_users[field][0]}"> {$deny_users[field][1]}
		{/section}
		</select>
	  </td>
    </tr>
  </table>
  <br>
  
  <br>
  <table width="80%">
    <tr>
      <td align="center" bgcolor="#008000" width="50%">{$hashmap.allow}</td>
      <td>&nbsp; &nbsp; </td>
      <td align="center" bgcolor="#ff0000" width="50%">{$hashmap.deny}</td>
    </tr>
    <tr>
      <td align="center" width="250">
	    <select name="allow_groups[]" size="10" multiple style="width: 250">
		{section name=key loop=$allow_groups}
		  <option value="{$allow_groups[key][0]}"> {$allow_groups[key][1]}
		{/section}
		</select>
	  </td>
      <td valign="middle" align="center"><input type="Button" name="" value="<-<-" onclick="move_to_left_groups();"><br><br>&nbsp;&nbsp;&nbsp;{$hashmap.groups}&nbsp;&nbsp;&nbsp;<br><br><input type="Button" name="" value="->->" onclick="move_to_right_groups();"></td>
      <td align="center" width="250">
	    <select name="deny_groups[]" size="10" multiple style="width: 250">
		{section name=field loop=$deny_groups}
		  <option value="{$deny_groups[field][0]}"> {$deny_groups[field][1]}
		{/section}
		</select>
	  </td>
    </tr>
  </table>

  <br>
  
  <br>
  <table width="80%">
    <tr>
	  <td align="center">
	    <input type="Submit" value="{$hashmap.save_changes}" name="save" onclick="select_all();" style="width: 250px">
	  </td>
    </tr>
  </table>

</form>
{/if}

{if $display_objects}
  <br>
  <table width="10%">
  <tr>
    <td align="center" bgcolor="#008000">{$hashmap.allow}</td>
	<td>&nbsp;&nbsp;</td>
    <td width="1"></td>
	<td>&nbsp;</td>
    <td align="center" bgcolor="#ff0000">{$hashmap.deny}</td>
  </tr>
  {section name=field loop=$objects}
	<tr>
	  <td colspan="5" align="center" nowrap>
	    <br><a href="main.php?return={$id_string}&id={$objects[field][0]}&{$SESSION}"><img src="templates/default/media/edit.gif" alt="" border="" align="top"></a> <a href="main.php?return={$id_string}&id={$objects[field][0]}&{$SESSION}">{$hashmap.object}</a>: {$objects[field][5]}
		<br><br>
	  </td>
	</tr>
	<tr>
	  <td valign="top" width="250" align="right">
	    {section name=field2 loop=$objects[field][1]}
		  {if $objects[field][1][field2][1] eq $username3}
		    <b><!-- <a href="main.php?id=root_users_{$objects[field][1][field2][0]}&{$SESSION}"> -->
			{$objects[field][1][field2][1]}
			<!-- </a> -->
			</b>
	      {else}
		    <!-- <a href="main.php?id=root_users_{$objects[field][1][field2][0]}&{$SESSION}"> -->
			{$objects[field][1][field2][1]}
			<!-- </a> -->
		  {/if}
		  <br>
		{/section}
	  </td>
	  <td></td>
	  <td style="border-left: 1px solid black">&nbsp;</td>
	  <td></td>
	  <td valign="top" width="250">
	    {section name=field2 loop=$objects[field][2]}
		  {if $objects[field][2][field2][1] eq $username3}
		    <b><!-- <a href="main.php?id=root_users_{$objects[field][2][field2][0]}&{$SESSION}"> -->
			{$objects[field][2][field2][1]}
			<!-- </a> -->
			</b>
		  {else}
		    <!-- <a href="main.php?id=root_users_{$objects[field][2][field2][0]}&{$SESSION}"> -->
			{$objects[field][2][field2][1]}
			<!-- </a>-->
		  {/if}
		  <br>
		{/section}
	  </td>
	</tr>
	{if $objects[field][3] neq ""}
	<tr>
	  <td colspan="5" align="center">
  		<br>({$hashmap.last_change}: {$objects[field][3]}, {$objects[field][4]})
	  </td>
	</tr>
	{/if}
	<tr><td colspan="5" style="border-bottom: 1px solid black" height="1"><img src="templates/default/media/spacer.gif" alt="" width="1" height="5" border="0"><br></td></tr>
  {/section}
  </table>
{/if}
<br>
</td></tr></table>
</center>
</body>
</html>
