users.php
changeset 3 64525a2eb098
parent 2 9a485c41cfcf
child 8 47dd15d8bb8c
equal deleted inserted replaced
2:9a485c41cfcf 3:64525a2eb098
    31 		add_user($_POST["username"], $_POST["password"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $_POST["active"]);
    31 		add_user($_POST["username"], $_POST["password"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $_POST["active"]);
    32         	clean_page($BASE_URL . $BASE_PATH . "users.php");
    32         	clean_page($BASE_URL . $BASE_PATH . "users.php");
    33         }
    33         }
    34         else
    34         else
    35         {
    35         {
    36         	$error = _('Usernames cant contain spaces');
    36         	$error = _('Usernames can\'t contain spaces');
    37         }
    37         }
    38 }
    38 }
    39 elseif($_POST["submit"])
    39 elseif($_POST["submit"])
    40 {
    40 {
    41 	$error = _('Please fill in all fields');
    41 	$error = _('Please fill in all fields');
    42 }
    42 }
    43 
    43 
    44 // Dirty hack, maybe revise?
    44 // Dirty hack, maybe revise?
    45 include_once("inc/header.inc.php");
    45 include_once("inc/header.inc.php");
    46 ?>
    46 ?>
    47 <H2><? echo _('User Admin'); ?></H2>
    47 <H2><? echo _('User admin'); ?></H2>
    48 <P CLASS="nav">
    48 <P CLASS="nav">
    49 <A HREF="index.php"><? echo _('DNS Admin'); ?></A>
    49 <A HREF="index.php"><? echo _('DNS Admin'); ?></A>
    50 <?
    50 <?
    51 if (level(10))
    51 if (level(10))
    52 {
    52 {
    53 	?> <A HREF="seq_update.php"><? echo _('Synchronize Database'); ?></A> <?
    53 	?> <A HREF="seq_update.php"><? echo _('Synchronize database'); ?></A> <?
    54 }
    54 }
    55 ?><A HREF="search.php"><? echo _('Search records'); ?></A></P><BR><?
    55 ?><A HREF="search.php"><? echo _('Search records'); ?></A></P><BR><?
    56 // End
    56 // End
    57 
    57 
    58 if (!level(10)) 
    58 if (!level(10)) 
    80 $users = show_users('',ROWSTART,ROWAMOUNT);
    80 $users = show_users('',ROWSTART,ROWAMOUNT);
    81 foreach ($users as $c)
    81 foreach ($users as $c)
    82 {
    82 {
    83         ?>
    83         ?>
    84         <TR>
    84         <TR>
    85         <TD VALIGN="top" CLASS="tdbg"><A HREF="delete_user.php?id=<?= $c["id"] ?>"><IMG SRC="images/delete.gif" ALT="[ <? echo _('delete user'); ?> ]" BORDER="0"></A></TD>
    85         <TD VALIGN="top" CLASS="tdbg"><A HREF="delete_user.php?id=<?= $c["id"] ?>"><IMG SRC="images/delete.gif" ALT="[ <? echo _('Delete user'); ?> ]" BORDER="0"></A></TD>
    86         <TD VALIGN="top" CLASS="tdbg"><A HREF="edit_user.php?id=<?= $c["id"] ?>"><?= $c["fullname"] ?></A> (<?= $c["username"] ?>)</TD>
    86         <TD VALIGN="top" CLASS="tdbg"><A HREF="edit_user.php?id=<?= $c["id"] ?>"><?= $c["fullname"] ?></A> (<?= $c["username"] ?>)</TD>
    87         <TD VALIGN="top" CLASS="tdbg"><?= $c["numdomains"] ?></TD>
    87         <TD VALIGN="top" CLASS="tdbg"><?= $c["numdomains"] ?></TD>
    88         <TD CLASS="tdbg">
    88         <TD CLASS="tdbg">
    89         <?
    89         <?
    90         $domains = get_domains_from_userid($c["id"]);
    90         $domains = get_domains_from_userid($c["id"]);
    91         foreach ($domains as $d)
    91         foreach ($domains as $d)
    92         {
    92         {
    93                 ?><A HREF="delete_domain.php?id=<?= $d["id"] ?>"><IMG SRC="images/delete.gif" ALT="[ <? echo _('delete domain'); ?> ]" BORDER="0"></A>&nbsp;<A HREF="edit.php?id=<?= $d["id"] ?>"><?= $d["name"] ?></A><BR><?
    93                 ?><A HREF="delete_domain.php?id=<?= $d["id"] ?>"><IMG SRC="images/delete.gif" ALT="[ <? echo _('Delete domain'); ?> ]" BORDER="0"></A>&nbsp;<A HREF="edit.php?id=<?= $d["id"] ?>"><?= $d["name"] ?></A><BR><?
    94         }
    94         }
    95         ?></TD><TD CLASS="tdbg"><?= $c["level"] ?></TD><TD VALIGN="middle" CLASS="tdbg"><?= get_status($c["active"]) ?></TD></TR><?
    95         ?></TD><TD CLASS="tdbg"><?= $c["level"] ?></TD><TD VALIGN="middle" CLASS="tdbg"><?= get_status($c["active"]) ?></TD></TR><?
    96         print "\n";
    96         print "\n";
    97 }
    97 }
    98 ?>
    98 ?>