Register globals

This commit is contained in:
Alan Garcia 2012-08-21 08:06:04 +00:00
parent 8e9dc2f4bd
commit ede82b141c
2 changed files with 28 additions and 14 deletions

View File

@ -31,13 +31,24 @@ require_once("../class/config.php");
include_once("head.php"); include_once("head.php");
$uid = $_GET['uid']; if (!$admin->enabled) {
__("This page is restricted to authorized staff");
exit;
}
$fields = array (
"uid" => array ("request", "integer", ""),
"submit" => array ("post", "string", ""),
"redirect" => array ("post", "string", ""),
);
getFields($fields);
if (!$uid) { if (!$uid) {
__("Missing uid"); __("Missing uid");
include_once("foot.php"); include_once("foot.php");
exit(); exit();
} }
if (!$admin->enabled || !$admin->checkcreator($uid)) {
if (!$admin->checkcreator($uid)) {
__("This page is restricted to authorized staff"); __("This page is restricted to authorized staff");
include_once("foot.php"); include_once("foot.php");
exit(); exit();
@ -49,12 +60,15 @@ if (!$r=$admin->get($uid)) {
exit(); exit();
} }
if (! ($confirmed = ($_GET['submit'] == _("Confirm")) ) ) { $confirmed = ($submit == _("Confirm"))?true:false;
if (! ($confirmed ) ) {
print '<h2>' . _('WARNING: experimental feature, use at your own risk') . '</h2>'; print '<h2>' . _('WARNING: experimental feature, use at your own risk') . '</h2>';
__("The following domains will be deactivated and redirected to the URL entered in the following box. A backup of the domain configuration will be displayed as a serie of SQL request that you can run to restore the current configuration if you want. Click confirm if you are sure you want to deactivate all this user's domains."); __("The following domains will be deactivated and redirected to the URL entered in the following box. A backup of the domain configuration will be displayed as a serie of SQL request that you can run to restore the current configuration if you want. Click confirm if you are sure you want to deactivate all this user's domains.");
?> ?>
<form action="<?php echo $PHP_SELF?>" method="GET"> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
<input type="hidden" name="uid" value="<?php echo $uid?>" /> <input type="hidden" name="uid" value="<?php echo $uid?>" />
<?php __("Redirection URL:") ?> <input type="text" name="redirect" class="int" value="http://example.com/" /> <?php __("Redirection URL:") ?> <input type="text" name="redirect" class="int" value="http://example.com/" />
<input type="submit" name="submit" class="inb" value="<?php __("Confirm")?>" /> <input type="submit" name="submit" class="inb" value="<?php __("Confirm")?>" />
@ -63,12 +77,10 @@ if (! ($confirmed = ($_GET['submit'] == _("Confirm")) ) ) {
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>"; print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
} else { } else {
if (!$_GET['redirect']) { if (empty($redirect)) {
__("Missing redirect url."); __("Missing redirect url.");
include_once("foot.php"); include_once("foot.php");
exit(); exit();
} else {
$redirect = $_GET['redirect'];
} }
} }

View File

@ -112,11 +112,10 @@ if ($mem->user["admlist"]==0) { // Normal (large) mode
<tr><td colspan="6"> <tr><td colspan="6">
<?php if (count($r)>5) { ?> <?php if (count($r)>5) { ?>
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" /> <input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" />
<?php } ?> <?php } ?>
</td> </td>
<td class="trbtn" colspan="4"> <td class="trbtn" colspan="4">
<span class="inav"><a href="adm_list.php?short=1"><?php __("Minimal view"); ?></a></span> &nbsp; <span class="inav"><a href="adm_list.php?short=1"><?php __("Minimal view"); ?></a></span> &nbsp;
<span class="ina" style="cursor: text"><?php __("Complete view"); ?></span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -196,10 +195,9 @@ if ($mem->user["admlist"]==1) { // SHORT MODE
<tr><td colspan="4"> <tr><td colspan="4">
<?php if (count($r)>50) { ?> <?php if (count($r)>50) { ?>
<input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" /> <input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>" />
<?php } ?> <?php } ?>
</td> </td>
<td class="trbtn" colspan="5"> <td class="trbtn" colspan="5">
<span class="ina" style="cursor: text"><?php __("Minimal view"); ?></span> &nbsp;
<span class="inav"><a href="adm_list.php?short=0"><?php __("Complete view"); ?></a></span> <span class="inav"><a href="adm_list.php?short=0"><?php __("Complete view"); ?></a></span>
</td> </td>
</tr> </tr>
@ -254,7 +252,11 @@ if (is_array($val)) {
} else echo "<td style=\"padding-right: 2px; border-right: 1px solid;\" colspan=\"3\"></td></tr>"; } else echo "<td style=\"padding-right: 2px; border-right: 1px solid;\" colspan=\"3\"></td></tr>";
$val=$r[$z+2*$rz]; $val=null;
if (isset($r[$z+2*$rz])) {
$val=$r[$z+2*$rz];
}
if (is_array($val)) { if (is_array($val)) {
?> ?>
<?php if ($val["su"]) { ?> <?php if ($val["su"]) { ?>