users.php
changeset 71 e1b918eaf69a
parent 69 025700cc92cd
child 75 a53200a76f9d
equal deleted inserted replaced
70:47248e2af079 71:e1b918eaf69a
    52 
    52 
    53 include_once("inc/header.inc.php");
    53 include_once("inc/header.inc.php");
    54 if ($error != "") 
    54 if ($error != "") 
    55 {
    55 {
    56 ?>
    56 ?>
    57 	<div class="error"><? echo $error ; ?></div>
    57 	<div class="error"><?php echo $error ; ?></div>
    58 <?
    58 <?php
    59 }
    59 }
    60 ?>
    60 ?>
    61     <h2><? echo _('User admin'); ?></h2>
    61     <h2><?php echo _('User admin'); ?></h2>
    62 <?
    62 <?php
    63 if (!level(10)) 
    63 if (!level(10)) 
    64 {
    64 {
    65 	error(ERR_LEVEL_10);
    65 	error(ERR_LEVEL_10);
    66 }
    66 }
    67 ?>
    67 ?>
    68      <h3><? echo _('Current users'); ?></h3>
    68      <h3><?php echo _('Current users'); ?></h3>
    69 <?
    69 <?php
    70 $users = show_users('');
    70 $users = show_users('');
    71 ?>  
    71 ?>  
    72 
    72 
    73       <table>
    73       <table>
    74        <tr>
    74        <tr>
    75         <th>&nbsp;</th>
    75         <th>&nbsp;</th>
    76         <th><? echo _('Name'); ?></th>
    76         <th><?php echo _('Name'); ?></th>
    77         <th><? echo _('Zones'); ?> (<? echo _('access'); ?>)</th>
    77         <th><?php echo _('Zones'); ?> (<?php echo _('access'); ?>)</th>
    78         <th><? echo _('Zones'); ?> (<? echo _('owner'); ?>)</th>
    78         <th><?php echo _('Zones'); ?> (<?php echo _('owner'); ?>)</th>
    79         <th><? echo _('Zone list'); ?></th>
    79         <th><?php echo _('Zone list'); ?></th>
    80         <th><? echo _('Level'); ?></th>
    80         <th><?php echo _('Level'); ?></th>
    81         <th><? echo _('Status'); ?></th>
    81         <th><?php echo _('Status'); ?></th>
    82        </tr>
    82        </tr>
    83 <?
    83 <?php
    84 $users = show_users('',ROWSTART,ROWAMOUNT);
    84 $users = show_users('',ROWSTART,ROWAMOUNT);
    85 foreach ($users as $c)
    85 foreach ($users as $c)
    86 {
    86 {
    87         $domains = get_domains_from_userid($c["id"]);
    87         $domains = get_domains_from_userid($c["id"]);
    88 	$num_zones_access = count($domains);
    88 	$num_zones_access = count($domains);
    89 ?>
    89 ?>
    90        <tr>
    90        <tr>
    91         <td class="n"><a href="delete_user.php?id=<? echo $c["id"] ?>"><img src="images/delete.gif" alt="[ <? echo _('Delete user'); ?> ]"></a></td>
    91         <td class="n"><a href="delete_user.php?id=<?php echo $c["id"] ?>"><img src="images/delete.gif" alt="[ <?php echo _('Delete user'); ?> ]"></a></td>
    92         <td class="n"><a href="edit_user.php?id=<? echo $c["id"] ?>"><? echo $c["fullname"] ?></A> (<? echo $c["username"] ?>)</td>
    92         <td class="n"><a href="edit_user.php?id=<?php echo $c["id"] ?>"><?php echo $c["fullname"] ?></A> (<?php echo $c["username"] ?>)</td>
    93         <td class="n"><? echo $num_zones_access ?></td>
    93         <td class="n"><?php echo $num_zones_access ?></td>
    94         <td class="n"><? echo $c["numdomains"] ?></td>
    94         <td class="n"><?php echo $c["numdomains"] ?></td>
    95         <td class="n">
    95         <td class="n">
    96         <?
    96         <?php
    97         foreach ($domains as $d)
    97         foreach ($domains as $d)
    98         {
    98         {
    99                 ?><a href="delete_domain.php?id=<? echo $d["id"] ?>"><img src="images/delete.gif" alt="[ <? echo _('Delete domain'); ?> ]"></a>&nbsp;<a href="edit.php?id=<? echo $d["id"] ?>"><? echo $d["name"] ?><? if ($d["partial"] == "1") { echo " *"; } ; ?></a><br><?
    99                 ?><a href="delete_domain.php?id=<?php echo $d["id"] ?>"><img src="images/delete.gif" alt="[ <?php echo _('Delete domain'); ?> ]"></a>&nbsp;<a href="edit.php?id=<?php echo $d["id"] ?>"><?php echo $d["name"] ?><?php if ($d["partial"] == "1") { echo " *"; } ; ?></a><br><?php
   100         }
   100         }
   101         ?></td>
   101         ?></td>
   102 	<td class="n"><? echo $c["level"] ?></td>
   102 	<td class="n"><?php echo $c["level"] ?></td>
   103 	<td class="n"><? echo get_status($c["active"]) ?></td>
   103 	<td class="n"><?php echo get_status($c["active"]) ?></td>
   104        </tr><?
   104        </tr><?php
   105         print "\n";
   105         print "\n";
   106 }
   106 }
   107 ?>
   107 ?>
   108        
   108        
   109       </table>
   109       </table>
   110       <p><? echo _('Users may only change some of the records of zones marked with an (*).'); ?></p>
   110       <p><?php echo _('Users may only change some of the records of zones marked with an (*).'); ?></p>
   111       <p><? echo _('Number of users') ;?>: <? echo count($users); ?>.</p>
   111       <p><?php echo _('Number of users') ;?>: <?php echo count($users); ?>.</p>
   112       <div class="showmax">
   112       <div class="showmax">
   113 <?
   113 <?php
   114 show_pages(count($users),ROWAMOUNT);
   114 show_pages(count($users),ROWAMOUNT);
   115 ?>
   115 ?>
   116       </div> <? // eo div showmax ?>
   116       </div> <?php // eo div showmax ?>
   117 
   117 
   118       <h3><? echo _('Create new user'); ?></h3>
   118       <h3><?php echo _('Create new user'); ?></h3>
   119       <form method="post" action="users.php">
   119       <form method="post" action="users.php">
   120        <table>
   120        <table>
   121         <tr>
   121         <tr>
   122          <td class="n"><? echo _('User name'); ?>:</td>
   122          <td class="n"><?php echo _('User name'); ?>:</td>
   123          <td class="n"><input type="text" class="input" name="username" value="<? if ($error) print $_POST["username"]; ?>"></td>
   123          <td class="n"><input type="text" class="input" name="username" value="<?php if ($error) print $_POST["username"]; ?>"></td>
   124 	</tr>
   124 	</tr>
   125 	<tr>
   125 	<tr>
   126 	 <td class="n"><? echo _('Full name'); ?>:</td>
   126 	 <td class="n"><?php echo _('Full name'); ?>:</td>
   127 	 <td class="n"><input type="text" class="input" NAME="fullname" VALUE="<? if ($error) print $_POST["fullname"]; ?>"></td>
   127 	 <td class="n"><input type="text" class="input" NAME="fullname" VALUE="<?php if ($error) print $_POST["fullname"]; ?>"></td>
   128 	</tr>
   128 	</tr>
   129 	<tr>
   129 	<tr>
   130 	 <td class="n"><? echo _('Password'); ?>:</td>
   130 	 <td class="n"><?php echo _('Password'); ?>:</td>
   131 	 <td class="n"><input type="password" class="input" NAME="password" VALUE="<? if ($error) print $_POST["password"]; ?>"></td>
   131 	 <td class="n"><input type="password" class="input" NAME="password" VALUE="<?php if ($error) print $_POST["password"]; ?>"></td>
   132 	</tr>
   132 	</tr>
   133 	<tr>
   133 	<tr>
   134 	 <td class="n"><? echo _('E-mail'); ?>:</td>
   134 	 <td class="n"><?php echo _('E-mail'); ?>:</td>
   135 	 <td class="n"><input type="text" class="input" NAME="email" VALUE="<? if ($error) print $_POST["email"]; ?>"></td>
   135 	 <td class="n"><input type="text" class="input" NAME="email" VALUE="<?php if ($error) print $_POST["email"]; ?>"></td>
   136 	</tr>
   136 	</tr>
   137 	<tr>
   137 	<tr>
   138 	 <td class="n"><? echo _('User level'); ?>:</td>
   138 	 <td class="n"><?php echo _('User level'); ?>:</td>
   139 	 <td class="n">
   139 	 <td class="n">
   140 	  <select name="level">
   140 	  <select name="level">
   141 	   <option value="1">1 (<? echo leveldescription(1) ?>)</option>
   141 	   <option value="1">1 (<?php echo leveldescription(1) ?>)</option>
   142 	   <option value="5">5 (<? echo leveldescription(5) ?>)</option>
   142 	   <option value="5">5 (<?php echo leveldescription(5) ?>)</option>
   143 	   <option value="10">10 (<? echo leveldescription(10) ?>)</option>
   143 	   <option value="10">10 (<?php echo leveldescription(10) ?>)</option>
   144 	  </select>
   144 	  </select>
   145 	 </td>
   145 	 </td>
   146 	</tr>
   146 	</tr>
   147         <tr>
   147         <tr>
   148 	 <td class="n"><? echo _('Description'); ?>:</td>
   148 	 <td class="n"><?php echo _('Description'); ?>:</td>
   149 	 <td class="n"><textarea rows="6" cols="30" class="inputarea" name="description"><? if ($error) print $_POST["description"]; ?></textarea></td>
   149 	 <td class="n"><textarea rows="6" cols="30" class="inputarea" name="description"><?php if ($error) print $_POST["description"]; ?></textarea></td>
   150 	</tr>
   150 	</tr>
   151 	<tr>
   151 	<tr>
   152 	 <td class="n"><? echo _('Active'); ?>:</td>
   152 	 <td class="n"><?php echo _('Active'); ?>:</td>
   153 	 <td class="n"><input type="checkbox" name="active" value="1" checked></td>
   153 	 <td class="n"><input type="checkbox" name="active" value="1" checked></td>
   154 	</tr>
   154 	</tr>
   155 	<tr>
   155 	<tr>
   156 	 <td class="n">&nbsp;</td>
   156 	 <td class="n">&nbsp;</td>
   157 	 <td class="n"><input type="submit" class="button" name="submit" value="<? echo _('Add user'); ?>"></td>
   157 	 <td class="n"><input type="submit" class="button" name="submit" value="<?php echo _('Add user'); ?>"></td>
   158 	</tr>
   158 	</tr>
   159        </table>
   159        </table>
   160       </form>
   160       </form>
   161 <?
   161 <?php
   162 include_once("inc/footer.inc.php");
   162 include_once("inc/footer.inc.php");
   163 ?>
   163 ?>