2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
AlternC - Web Hosting System
|
|
|
|
|
Copyright (C) 2006 Le r<EFBFBD>seau Koumbit Inc.
|
|
|
|
|
http://koumbit.org/
|
|
|
|
|
Copyright (C) 2002 by the AlternC Development Team.
|
|
|
|
|
http://alternc.org/
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
LICENSE
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License (GPL)
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
Original Author of file: Benjamin Sonntag
|
|
|
|
|
Purpose of file: Show the member list
|
|
|
|
|
TODO : Add a Next / Previous system in case of big lists...
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
require_once("../class/config.php");
|
2009-09-08 05:29:38 +00:00
|
|
|
|
include_once("head.php");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
|
|
if (!$admin->enabled) {
|
2013-09-23 14:44:59 +00:00
|
|
|
|
__("This page is restricted to authorized staff");
|
|
|
|
|
include_once('foot.php');
|
|
|
|
|
exit();
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
|
$fields = array (
|
|
|
|
|
"show" => array ("request", "string", ""),
|
2010-04-11 13:39:24 +00:00
|
|
|
|
"creator" => array("request", "integer", 0),
|
2012-08-21 08:06:04 +00:00
|
|
|
|
"short" => array("request", "integer", -1),
|
2013-09-23 12:48:18 +00:00
|
|
|
|
"pattern" => array("post", "string", "*"),
|
|
|
|
|
"pattern_type" => array("post", "string", "login"),
|
2009-09-08 05:29:38 +00:00
|
|
|
|
);
|
|
|
|
|
getFields($fields);
|
2009-01-28 20:02:01 +00:00
|
|
|
|
|
2010-04-29 12:37:54 +00:00
|
|
|
|
|
|
|
|
|
if ($short!=-1) {
|
|
|
|
|
$mem->adminpref($short);
|
|
|
|
|
$mem->user["admlist"]=$short;
|
2013-09-23 13:37:02 +00:00
|
|
|
|
}
|
2010-04-29 12:37:54 +00:00
|
|
|
|
|
2012-11-08 09:01:11 +00:00
|
|
|
|
$subadmin=variable_get("subadmin_restriction", 0);
|
2010-04-11 13:39:24 +00:00
|
|
|
|
|
2012-11-08 09:01:11 +00:00
|
|
|
|
// If we ask for all account but we aren't "admin" and
|
|
|
|
|
// subadmin var is not 1
|
|
|
|
|
if ($show=="all" && !$subadmin==1 && $cuid != 2000) {
|
2013-09-23 12:48:18 +00:00
|
|
|
|
__("This page is restricted to authorized staff");
|
|
|
|
|
include('foot.php');
|
|
|
|
|
exit();
|
2009-09-08 05:29:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-23 10:11:59 +00:00
|
|
|
|
if ($pattern && $pattern_type) {
|
2013-09-23 13:37:02 +00:00
|
|
|
|
$r=$admin->get_list($show == 'all' ? 1 : 0, $creator, $pattern, $pattern_type);
|
|
|
|
|
} else {
|
|
|
|
|
$r = FALSE;
|
2013-09-23 10:11:59 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<h3><?php __("AlternC account list"); ?></h3>
|
2010-06-02 22:20:39 +00:00
|
|
|
|
<hr id="topbar"/>
|
|
|
|
|
<br />
|
2013-09-21 15:03:59 +00:00
|
|
|
|
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<p><span class="ina"><a href="adm_add.php"><?php __("Create a new AlternC account"); ?></a></span></p>
|
2013-09-21 15:03:59 +00:00
|
|
|
|
|
2013-09-23 14:44:59 +00:00
|
|
|
|
<form method="post" action="adm_list.php" >
|
2013-09-21 15:03:59 +00:00
|
|
|
|
<p>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<span><?php __("Pattern"); ?></span>
|
|
|
|
|
<label for="pattern_type_login">Login</label><input type="radio" name="pattern_type" value="login" id="pattern_type_login" <?php if (!$pattern_type || $pattern_type === 'login') echo ' checked="checked" '; ?>/>
|
|
|
|
|
<label for="pattern_type_domain">Domaine</label><input type="radio" name="pattern_type" value="domaine" id="pattern_type_domain" <?php if ($pattern_type === 'domaine') echo ' checked="checked" '; ?>/>
|
|
|
|
|
<input type="text" id="pattern" name="pattern" value="<?php echo $pattern ?>"/> <input type="submit" class="inb" value="<?php __("submit"); ?>" />
|
2013-09-21 15:03:59 +00:00
|
|
|
|
</p>
|
2013-09-23 14:44:59 +00:00
|
|
|
|
</form>
|
2013-09-21 15:03:59 +00:00
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
2013-09-23 12:48:18 +00:00
|
|
|
|
if ( !empty($error) ) {
|
|
|
|
|
echo '<p class="error">' , $error, '</p>';
|
|
|
|
|
}
|
2013-09-23 13:37:02 +00:00
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<p>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<?php __("Here is the list of hosted AlternC accounts"); ?> (<?php printf(_("%s accounts"),count($r)); ?>)
|
2013-04-19 07:18:25 +00:00
|
|
|
|
</p>
|
2012-11-08 09:01:11 +00:00
|
|
|
|
<?php
|
2013-09-23 12:48:18 +00:00
|
|
|
|
$list_creators = $admin->get_creator_list();
|
2012-11-08 09:01:11 +00:00
|
|
|
|
|
|
|
|
|
if ($subadmin==1 || $cuid==2000) {
|
|
|
|
|
if($show != 'all') {
|
2010-04-29 12:43:08 +00:00
|
|
|
|
echo '<p><span class="ina"><a href="adm_list.php?show=all">' . _('List all AlternC accounts') . '</a></span>';
|
2012-11-08 09:01:11 +00:00
|
|
|
|
if ($subadmin==1 || $cuid==2000) {
|
2009-01-28 20:02:01 +00:00
|
|
|
|
$infos_creators = array();
|
|
|
|
|
|
|
|
|
|
foreach ($list_creators as $key => $val) {
|
2010-04-11 13:39:24 +00:00
|
|
|
|
$infos_creators[] = '<a href="adm_list.php?creator=' . $val['uid'] . '">' . $val['login'] . '</a>';
|
2009-01-28 20:02:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (count($infos_creators)) {
|
2010-04-29 12:43:08 +00:00
|
|
|
|
echo ' ('._("Or only the accounts of:")." ". implode(', ', $infos_creators) . ')';
|
2009-01-28 20:02:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-23 14:44:59 +00:00
|
|
|
|
echo "</p>";
|
2013-09-23 13:37:02 +00:00
|
|
|
|
} else { // if show != all
|
2010-04-29 12:43:08 +00:00
|
|
|
|
echo '<p><span class="ina"><a href="adm_list.php">' . _('List only my accounts') . '</a></span></p>';
|
2013-09-23 13:37:02 +00:00
|
|
|
|
}
|
2012-11-08 09:01:11 +00:00
|
|
|
|
}// END ($subadmin==1 || $cuid==2000)
|
2010-04-29 12:43:08 +00:00
|
|
|
|
|
2013-09-23 13:37:02 +00:00
|
|
|
|
if (!is_array($r) || empty($r) ) {
|
|
|
|
|
echo '<p class="error">'._("No account defined for now").'</p>';
|
2013-10-17 08:43:52 +00:00
|
|
|
|
include('foot.php');
|
2013-09-23 13:37:02 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<form method="post" action="adm_dodel.php">
|
2009-09-08 05:29:38 +00:00
|
|
|
|
<?php
|
2006-04-26 12:28:53 +00:00
|
|
|
|
// Depending on the admin's choice, let's show a short list or a long list.
|
|
|
|
|
|
|
|
|
|
if ($mem->user["admlist"]==0) { // Normal (large) mode
|
|
|
|
|
?>
|
2013-01-30 18:11:58 +00:00
|
|
|
|
<p>
|
|
|
|
|
<span class="ina" style="float: right;"><a href="adm_list.php?short=1"><?php __("Minimal view"); ?></a></span>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<?php if (count($r)>5) { ?>
|
|
|
|
|
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" />
|
2012-08-21 08:06:04 +00:00
|
|
|
|
<?php } ?>
|
2013-01-30 18:11:58 +00:00
|
|
|
|
</p>
|
2013-09-23 14:44:59 +00:00
|
|
|
|
<table class="tlist" style="clear:both;">
|
2009-01-28 19:17:56 +00:00
|
|
|
|
<tr>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<th></th>
|
|
|
|
|
<th><?php __("Account"); ?></th>
|
|
|
|
|
<th><?php __("Manager"); ?></th>
|
2009-01-28 19:17:56 +00:00
|
|
|
|
<th><?php __("Created by") ?></th>
|
2010-04-29 10:27:09 +00:00
|
|
|
|
<th><?php __("Created on") ?></th>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<th><?php __("Quotas") ?></th>
|
2009-01-28 19:17:56 +00:00
|
|
|
|
<th><?php __("Last login"); ?></th>
|
|
|
|
|
<th><?php __("Last ip"); ?></th>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<th><?php __("Fails"); ?></th>
|
2009-01-28 19:17:56 +00:00
|
|
|
|
<th><?php __('Expiry') ?></th>
|
|
|
|
|
</tr>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
|
|
|
|
reset($r);
|
2006-05-25 13:09:19 +00:00
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$col=1;
|
2013-09-23 13:37:02 +00:00
|
|
|
|
while (list($key,$val)=each($r)) {
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$col=3-$col;
|
|
|
|
|
?>
|
|
|
|
|
<tr class="lst<?php echo $col; ?>">
|
2010-04-29 12:37:54 +00:00
|
|
|
|
|
2006-05-16 18:01:32 +00:00
|
|
|
|
<?php
|
|
|
|
|
if ($val["su"]) { ?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<td id="user_<?php echo $val["uid"]; ?>"> </td>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<?php } else { ?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<td><input type="checkbox" class="inc" name="d[]" id="user_<?php echo $val["uid"]; ?>" value="<?php echo $val["uid"]; ?>" /></td>
|
2013-09-25 09:50:53 +00:00
|
|
|
|
<?php } // val['su'] ?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<td <?php if ($val["su"]) echo 'style="color: red"'; ?>><label for="user_<?php echo $val["uid"]; ?>"><b><?php echo $val["login"] ?></b></label></td>
|
|
|
|
|
<td><a href="mailto:<?php echo $val["mail"]; ?>"><?php echo $val["nom"]." ".$val["prenom"] ?></a> </td>
|
|
|
|
|
<td><?php echo $val["parentlogin"] ?></td>
|
|
|
|
|
<td><?php echo format_date(_('%3$d-%2$d-%1$d'),$val["created"]); ?></td>
|
|
|
|
|
<td><?php echo $val["type"] ?></td>
|
|
|
|
|
<td><?php echo $val["lastlogin"] ?></td>
|
|
|
|
|
<td><?php echo $val["lastip"] ?></td>
|
|
|
|
|
<td><?php echo $val["lastfail"] ?></td>
|
|
|
|
|
<td><div class="<?php echo 'exp' . $admin->renew_get_status($val['uid']) ?>"><?php echo $admin->renew_get_expiry($val['uid']) ?></div></td>
|
|
|
|
|
</tr>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
|
|
|
|
|
<tr class="lst<?php echo $col; ?>" >
|
2013-02-21 09:03:08 +00:00
|
|
|
|
<td/><td ><i><?php echo _("DB:").' '.$val['db_server_name']?></i></td>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<td colspan="8" >
|
2013-09-23 14:44:59 +00:00
|
|
|
|
<div id="admlistbtn">
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<span class="ina<?php if ($col==2) echo "v"; ?> lst<?php echo $col; ?>">
|
|
|
|
|
<a href="adm_login.php?id=<?php echo $val["uid"];?>"><?php __("Connect as"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span class="ina<?php if ($col==2) echo "v"; ?> lst<?php echo $col; ?>" >
|
|
|
|
|
<a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("Edit"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="ina<?php if ($col==2) echo "v"; ?> lst<?php echo $col; ?>" >
|
|
|
|
|
<a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><?php __("Quotas"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
<?php if (!$val["su"]) { ?>
|
|
|
|
|
<span class="ina<?php if ($col==2) echo "v"; ?> lst<?php echo $col; ?>" >
|
|
|
|
|
<a href="adm_deactivate.php?uid=<?php echo $val["uid"] ?>"><?php __("Disable"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
2013-09-23 13:37:02 +00:00
|
|
|
|
} // while (list($key,$val)=each($r)) {
|
2013-10-17 12:26:13 +00:00
|
|
|
|
echo '</table></form><br/>';
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
2010-04-29 12:37:54 +00:00
|
|
|
|
} // NORMAL MODE
|
|
|
|
|
if ($mem->user["admlist"]==1) { // SHORT MODE
|
2006-04-26 12:28:53 +00:00
|
|
|
|
?>
|
|
|
|
|
|
2010-04-29 12:37:54 +00:00
|
|
|
|
[ <?php __("C"); ?> ] <?php __("Connect as"); ?>
|
|
|
|
|
[ <?php __("E"); ?> ] <?php __("Edit"); ?>
|
|
|
|
|
[ <?php __("Q"); ?> ] <?php __("Quotas"); ?>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
2013-01-30 18:11:58 +00:00
|
|
|
|
<p>
|
|
|
|
|
<span class="ina" style="float:right;"><a href="adm_list.php?short=0"><?php __("Complete view"); ?></a></span>
|
2010-04-29 12:37:54 +00:00
|
|
|
|
<?php if (count($r)>50) { ?>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" />
|
|
|
|
|
<?php } // finc count > 50 ?>
|
2013-01-30 18:11:58 +00:00
|
|
|
|
</p>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
|
2013-01-30 18:11:58 +00:00
|
|
|
|
<table class="tlist" style="clear:both;">
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<tr>
|
2011-02-09 08:37:23 +00:00
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
reset($r);
|
|
|
|
|
|
2013-09-23 13:37:02 +00:00
|
|
|
|
$count_r = 0;
|
|
|
|
|
foreach ($r as $val) {
|
|
|
|
|
if ( ($count_r % 3) == 0 ) { echo '<tr class="lst">'; }
|
|
|
|
|
|
|
|
|
|
if ($val["su"]) {
|
|
|
|
|
echo '<td> </td>';
|
|
|
|
|
} else {
|
|
|
|
|
echo '<td align="center"><input type="checkbox" class="inc" name="d[]" value="'.$val["uid"].'" id="id_c_'.$val["uid"].'" /></td>';
|
|
|
|
|
} // if $val["su"] ?>
|
|
|
|
|
<td align="center">
|
|
|
|
|
<a href="adm_login.php?id=<?php echo $val["uid"];?>" title="<?php __("Connect as"); ?>">[ <?php __("C"); ?> ]</a>
|
|
|
|
|
<a href="adm_edit.php?uid=<?php echo $val["uid"] ?>" title="<?php __("Edit"); ?>">[ <?php __("E"); ?> ]</a>
|
|
|
|
|
<?php if($admin->checkcreator($val['uid'])) { ?>
|
|
|
|
|
<a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>" title="<?php __("Quotas"); ?>">[ <?php __("Q"); ?> ]</a><?php
|
|
|
|
|
} // $admin->checkcreator
|
|
|
|
|
$creator_name = ( ($val['creator'] == '0')?_("himself"):$list_creators[$val['creator']]['login']) ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td style="padding-right: 2px; border-right: 1px solid black; <?php if ($val["su"]) echo "color: red"; ?>"><b><label title="<?php printf(_("Creator: %s"), $creator_name);?>" for="id_c_<?php echo $val["uid"]; ?>"><?php echo $val["login"] ?></label></b></td>
|
|
|
|
|
<?php
|
|
|
|
|
if ( ($count_r % 3) == 2 ) { echo '</tr>'; }
|
|
|
|
|
++$count_r;
|
|
|
|
|
} // foreach $r
|
2006-04-26 12:28:53 +00:00
|
|
|
|
?>
|
|
|
|
|
</table>
|
2013-01-30 18:11:58 +00:00
|
|
|
|
<p><input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" /></p>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
</form>
|
2006-05-25 13:09:19 +00:00
|
|
|
|
<?php
|
2013-09-23 13:37:02 +00:00
|
|
|
|
} // SHORT MODE
|
|
|
|
|
include_once("foot.php");
|
2006-05-25 13:09:19 +00:00
|
|
|
|
?>
|