2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2017-06-18 16:45:57 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
----------------------------------------------------------------------
|
2014-03-26 17:51:22 +00:00
|
|
|
*/
|
2017-10-12 15:54:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the list of all accounts on AlternC, or those created by a subadmin
|
|
|
|
* allow to impersonate, edit the account, change the quotas
|
|
|
|
*
|
|
|
|
* @copyright AlternC-Team 2000-2017 https://alternc.com/
|
|
|
|
*/
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
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) {
|
2017-10-06 16:04:36 +00:00
|
|
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
2014-03-26 17:51:22 +00:00
|
|
|
include_once('foot.php');
|
|
|
|
exit();
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
$fields = array(
|
|
|
|
"show" => array("request", "string", ""),
|
|
|
|
"creator" => array("request", "integer", 0),
|
|
|
|
"short" => array("request", "integer", -1),
|
2016-05-23 13:03:13 +00:00
|
|
|
"pattern" => array("request", "string", "*"),
|
|
|
|
"pattern_type" => array("request", "string", "login"),
|
2009-09-08 05:29:38 +00:00
|
|
|
);
|
|
|
|
getFields($fields);
|
2009-01-28 20:02:01 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
if (empty($pattern))
|
|
|
|
$pattern = "*";
|
2010-04-29 12:37:54 +00:00
|
|
|
|
2014-03-26 17:51:22 +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
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
$subadmin = variable_get("subadmin_restriction", 0);
|
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
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($show == "all" && !$subadmin == 1 && $cuid != 2000) {
|
2017-10-06 16:04:36 +00:00
|
|
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
2014-03-26 17:51:22 +00:00
|
|
|
include('foot.php');
|
|
|
|
exit();
|
2009-09-08 05:29:38 +00:00
|
|
|
}
|
|
|
|
|
2016-02-23 11:02:58 +00:00
|
|
|
// show all accounts by default for admin-like accounts
|
2016-03-03 11:07:38 +00:00
|
|
|
if (($show=="")&&($subadmin == 1 || $cuid == 2000)) $show="all";
|
2016-02-23 11:02:58 +00:00
|
|
|
|
2013-09-23 10:11:59 +00:00
|
|
|
if ($pattern && $pattern_type) {
|
2014-03-26 17:51:22 +00:00
|
|
|
$accountList = $admin->get_list($show == 'all' ? 1 : 0, $creator, $pattern, $pattern_type);
|
2013-09-23 13:37:02 +00:00
|
|
|
} else {
|
2014-03-26 17:51:22 +00:00
|
|
|
$accountList = 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"/>
|
2013-09-21 15:03:59 +00:00
|
|
|
|
2013-10-18 13:01:30 +00:00
|
|
|
<?php
|
|
|
|
// Depending on the admin's choice, let's show a short list or a long list.
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($mem->user["admlist"] == 0) { // Normal (large) mode
|
|
|
|
?>
|
|
|
|
<p><span class="ina" style="float: right;"><a href="adm_list.php?short=1"><?php __("Minimal view"); ?></a></span></p>
|
|
|
|
<?php
|
2013-10-18 13:01:30 +00:00
|
|
|
} else {
|
2014-03-26 17:51:22 +00:00
|
|
|
?>
|
|
|
|
<p><span class="ina" style="float:right;"><a href="adm_list.php?short=0"><?php __("Complete view"); ?></a></span></p>
|
|
|
|
<?php
|
2013-10-18 13:01:30 +00:00
|
|
|
}
|
|
|
|
?>
|
2013-09-21 15:03:59 +00:00
|
|
|
|
2013-10-18 13:01:30 +00:00
|
|
|
<fieldset style="clear:both;">
|
2014-03-26 17:51:22 +00:00
|
|
|
<legend><?php __("Filters"); ?></legend>
|
2016-02-23 11:02:58 +00:00
|
|
|
<form method="post" action="adm_list.php">
|
2016-05-20 12:21:47 +00:00
|
|
|
<?php csrf_get(); ?>
|
2014-03-26 17:51:22 +00:00
|
|
|
<p>
|
2016-02-23 11:02:58 +00:00
|
|
|
<label>
|
|
|
|
<input type="radio" name="pattern_type" value="login" id="pattern_type_login" <?php if (!$pattern_type || $pattern_type === 'login') echo ' checked="checked" '; ?>/>
|
|
|
|
<?php __("Search for a Login"); ?>
|
|
|
|
</label>
|
|
|
|
<label>
|
|
|
|
<input type="radio" name="pattern_type" value="domaine" id="pattern_type_domain" <?php if ($pattern_type === 'domaine') echo ' checked="checked" '; ?>/>
|
|
|
|
<?php __("Search for a Domain"); ?>
|
|
|
|
</label>
|
2016-05-22 18:14:26 +00:00
|
|
|
<input type="text" id="pattern" name="pattern" value="<?php ehe($pattern); ?>"/>
|
2016-02-23 11:02:58 +00:00
|
|
|
<input type="submit" class="inb filter" value="<?php __("submit"); ?>" />
|
2016-05-22 18:14:26 +00:00
|
|
|
<input type="hidden" name="show" value="<?php ehe($show); ?>" />
|
2016-02-23 11:02:58 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
$list_creators = $admin->get_creator_list();
|
2013-09-21 15:03:59 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($subadmin == 1 || $cuid == 2000) {
|
2016-02-23 11:02:58 +00:00
|
|
|
$class=($show=="all") ? "inb" : "ina";
|
|
|
|
echo '<p><span class="'.$class.' filter"><a href="adm_list.php?show=all">' . _('List all AlternC accounts') . '</a></span>';
|
2013-10-18 13:01:30 +00:00
|
|
|
|
2016-02-23 11:02:58 +00:00
|
|
|
$class=($show!="all") ? "inb" : "ina";
|
|
|
|
echo ' <span class="'.$class.' filter"><a href="adm_list.php?show=me">' . _('List only my accounts') . '</a></span></p>';
|
2014-03-26 17:51:22 +00:00
|
|
|
|
2016-02-23 11:02:58 +00:00
|
|
|
if ($show != 'all') {
|
|
|
|
$infos_creators = array();
|
2013-10-18 13:01:30 +00:00
|
|
|
|
2016-02-23 11:02:58 +00:00
|
|
|
foreach ($list_creators as $key => $val) {
|
|
|
|
$infos_creators[] = '<a href="adm_list.php?creator=' . $val['uid'] . '">' . $val['login'] . '</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($infos_creators)) {
|
|
|
|
echo ' (' . _("Or only the accounts of:") . " " . implode(', ', $infos_creators) . ')';
|
|
|
|
}
|
2013-10-18 13:01:30 +00:00
|
|
|
}
|
2014-03-26 17:51:22 +00:00
|
|
|
}// END ($subadmin==1 || $cuid==2000)
|
|
|
|
?>
|
2013-10-18 13:01:30 +00:00
|
|
|
</fieldset>
|
2014-03-26 17:51:22 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
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>
|
2016-02-23 11:02:58 +00:00
|
|
|
<?php __("Here is the list of hosted AlternC accounts"); ?> (<?php printf(_("%s accounts"), $accountList? count($accountList) : 0); ?>)
|
2013-04-19 07:18:25 +00:00
|
|
|
</p>
|
2012-11-08 09:01:11 +00:00
|
|
|
|
2013-10-18 13:01:30 +00:00
|
|
|
<p><span class="ina add"><a href="adm_add.php"><?php __("Create a new AlternC account"); ?></a></span></p>
|
2010-04-29 12:43:08 +00:00
|
|
|
|
2013-10-18 13:01:30 +00:00
|
|
|
<?php
|
2014-03-26 17:51:22 +00:00
|
|
|
if (!is_array($accountList) || empty($accountList)) {
|
2017-10-06 16:04:36 +00:00
|
|
|
$msg->raise("ERROR", "admin", _("No account defined for now"));
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
2014-03-26 17:51:22 +00:00
|
|
|
include('foot.php');
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<form method="post" action="adm_dodel.php">
|
2016-05-20 12:21:47 +00:00
|
|
|
<?php csrf_get(); ?>
|
2014-03-26 17:51:22 +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.
|
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($mem->user["admlist"] == 0) { // Normal (large) mode
|
|
|
|
?>
|
|
|
|
<p>
|
|
|
|
<?php if (count($accountList) > 5) { ?>
|
|
|
|
<input type="submit" class="inb delete" name="submit" value="<?php __("Delete checked accounts"); ?>" />
|
|
|
|
<?php } ?>
|
|
|
|
</p>
|
|
|
|
<table class="tlist" style="clear:both;">
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th><?php __("Account"); ?></th>
|
|
|
|
<th><?php __("Manager"); ?></th>
|
|
|
|
<th><?php __("Created by") ?></th>
|
|
|
|
<th><?php __("Created on") ?></th>
|
|
|
|
<th><?php __("Quotas") ?></th>
|
|
|
|
<th><?php __("Last login"); ?></th>
|
|
|
|
<th><?php __("Last ip"); ?></th>
|
|
|
|
<th><?php __("Fails"); ?></th>
|
|
|
|
<th><?php __('Expiry') ?></th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
reset($accountList);
|
2010-04-29 12:37:54 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
$col = 1;
|
|
|
|
while (list($key, $val) = each($accountList)) {
|
|
|
|
$col = 3 - $col;
|
|
|
|
?>
|
2018-06-22 10:43:07 +00:00
|
|
|
<tr class="lst">
|
2010-04-29 12:37:54 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
<?php if ($val["su"]) { ?>
|
|
|
|
<td id="user_<?php echo $val["uid"]; ?>"> </td>
|
|
|
|
<?php } else { ?>
|
2016-05-22 18:14:26 +00:00
|
|
|
<td><input type="checkbox" class="inc" name="accountList[]" id="user_<?php ehe($val["uid"]); ?>" value="<?php ehe($val["uid"]); ?>" /></td>
|
2014-03-26 17:51:22 +00:00
|
|
|
<?php } // val['su'] ?>
|
2016-05-22 18:14:26 +00:00
|
|
|
<td <?php if ($val["su"]) echo 'style="color: red"'; ?>><label for="user_<?php ehe($val["uid"]); ?>"><b><?php ehe($val["login"]); ?></b></label></td>
|
|
|
|
<td><a title="<?php __("Send an email"); ?>" href="mailto:<?php eue($val["mail"]); ?>"><?php ehe($val["nom"] . " " . $val["prenom"]); ?></a> </td>
|
|
|
|
<td><?php ehe($val["parentlogin"]); ?></td>
|
|
|
|
<td><?php ehe(format_date(_('%3$d-%2$d-%1$d'), $val["created"])); ?></td>
|
|
|
|
<td><?php ehe($val["type"]); ?></td>
|
|
|
|
<td><?php ehe($val["lastlogin"]); ?></td>
|
|
|
|
<td><?php ehe($val["lastip"]); ?></td>
|
|
|
|
<td><?php ehe($val["lastfail"]); ?></td>
|
|
|
|
<td><div class="<?php echo 'exp' . $admin->renew_get_status($val['uid']) ?>"><?php ehe($admin->renew_get_expiry($val['uid'])); ?></div></td>
|
2014-03-26 17:51:22 +00:00
|
|
|
</tr>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2018-06-22 10:43:07 +00:00
|
|
|
<tr class="lst" >
|
2014-03-26 17:51:22 +00:00
|
|
|
<td/><td ><i><?php echo _("DB:") . ' ' . $val['db_server_name'] ?></i></td>
|
|
|
|
<td colspan="8" >
|
|
|
|
<div id="admlistbtn">
|
|
|
|
<span class="ina<?php if ($col == 2) echo "v"; ?>">
|
|
|
|
<a href="adm_login.php?id=<?php echo $val["uid"]; ?>"><?php __("Connect as"); ?></a>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span class="ina<?php if ($col == 2) echo "v"; ?>" >
|
|
|
|
<a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("Edit"); ?></a>
|
|
|
|
</span>
|
|
|
|
<span class="ina<?php if ($col == 2) echo "v"; ?>" >
|
|
|
|
<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"; ?>" >
|
|
|
|
<a href="adm_deactivate.php?uid=<?php echo $val["uid"] ?>"><?php __("Disable"); ?></a>
|
|
|
|
</span>
|
|
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
} // while (list($key,$val)=each($accountList)) {
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
|
|
<p>
|
|
|
|
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" /></p>
|
|
|
|
</form>
|
|
|
|
<?php
|
2010-04-29 12:37:54 +00:00
|
|
|
} // NORMAL MODE
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($mem->user["admlist"] == 1) { // SHORT MODE
|
|
|
|
?>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
[ <?php __("C"); ?> ] <?php __("Connect as"); ?>
|
|
|
|
[ <?php __("E"); ?> ] <?php __("Edit"); ?>
|
|
|
|
[ <?php __("Q"); ?> ] <?php __("Quotas"); ?>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
<p>
|
|
|
|
<?php if (count($accountList) > 50) { ?>
|
|
|
|
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" />
|
|
|
|
<?php } // finc count > 50 ?>
|
|
|
|
</p>
|
2013-09-23 13:37:02 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
<table class="tlist" style="clear:both;">
|
|
|
|
<tr>
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
|
|
|
<th colspan="2"> </th><th><?php __("Account"); ?></th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
reset($accountList);
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
$count_r = 0;
|
|
|
|
foreach ($accountList as $val) {
|
|
|
|
if (($count_r % 3) == 0) {
|
|
|
|
echo '<tr class="lst">';
|
|
|
|
}
|
2013-09-23 13:37:02 +00:00
|
|
|
|
2014-03-26 17:51:22 +00:00
|
|
|
if ($val["su"]) {
|
|
|
|
echo '<td> </td>';
|
|
|
|
} else {
|
2014-03-27 15:28:17 +00:00
|
|
|
echo '<td align="center"><input type="checkbox" class="inc" name="accountList[]" value="' . $val["uid"] . '" id="id_c_' . $val["uid"] . '" /></td>';
|
2014-03-26 17:51:22 +00:00
|
|
|
} // 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>
|
2016-02-23 11:02:58 +00:00
|
|
|
<?php if ($admin->checkcreator($val['uid'])||($show=="all")) { ?>
|
2014-03-26 17:51:22 +00:00
|
|
|
<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 $accountList
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
<p><input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" /></p>
|
|
|
|
</form>
|
|
|
|
<?php
|
2013-09-23 13:37:02 +00:00
|
|
|
} // SHORT MODE
|
2014-03-26 17:51:22 +00:00
|
|
|
include_once("foot.php");
|
2006-05-25 13:09:19 +00:00
|
|
|
?>
|