Viewing file: adminpage_old.php (26.27 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();
require('../config.php');
require('../functions.php');
//check for administrative rights
if (allow_access(Administrators) != "yes")
{
include ('../no_access.html');
exit;
}
//make connection to dbase
$connection = @mysql_connect($server, $dbusername, $dbpassword)
or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)
or die(mysql_error());
//build and issue the query
$sql ="SELECT * FROM $table_name";
$result = @mysql_query($sql,$connection) or die(mysql_error());
?>
<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="adminpage.css">
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table border="0" width="100%" id="table1">
<tr>
<td align="center">
<table border="0" width="900" id="table2" cellspacing="0" cellpadding="3">
<tr>
<td width="280"><b><font size="2">Login - Panel de Control</font></b></td>
<td align="right"> <a href="../logs/index.php">Logs de acceso</a><i> |
</i><a href="../listado_experiencias.php?id=<?php echo $_SESSION[id]; ?>">Ver
experiencias registradas</a><i> | </i><a href="../logout.php">Cerrar
sesión</a></td>
</tr>
<tr>
<td width="280">Logueado como <?php echo $_SESSION[user_name]; ?></td>
<td align="right">Archivos: <a href="../informacion_local/">Ver archivos
publicados en información local</a> | <a href="../archivos/">Ver
archivos publicados en oferta</a> </td>
</tr>
<tr>
<td width="280"> </td>
<td> <p align="right"> </td>
</tr>
<tr>
<td width="280" valign="top"> <table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td width="38%" valign="top"> <table border="0" width="100%" id="table38" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php
if ($_POST[alter2] == "add")
{
?>
<form method="POST" action="<?php $PHP_SELF; ?>">
<p>
<input type="hidden" name="alterup2" value="up">
<input name="submit" type="submit" value="Agregar usuario">
</p>
</form>
<?php
}else
{
?>
<form method="POST" action="<?php $PHP_SELF; ?>">
<p>
<input type="hidden" name="alter2" value="add">
<input name="submit" type="submit" value="Agregar usuario">
</p>
</form>
<?php
}
?>
</td>
</tr>
<tr>
<td>
<?php
if ($_POST[alter2] == "add")
{
?>
<form method="POST" action="<? echo "adduser.php?page=$page&max_results=$max_results"; ?>">
<font size="1" face="Tahoma">
<table border="0" width="100%" id="table44" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<tr>
<td width="140">Nombre:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="firstname" size="20">
</font></td>
</tr>
<tr>
<td width="140">Apellido:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="lastname" size="20">
</font></td>
</tr>
<tr>
<td width="140">Usuario:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="username" size="20">
</font></td>
</tr>
<tr>
<td width="140">Password:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="password" size="20" maxlength="667">
</font></td>
</tr>
<tr>
<td width="140">E-Mail:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="email" size="20">
</font></td>
</tr>
<tr>
<td width="140">Grupo:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="group1">
<?php
echo "<option>Users</option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140"> </td>
<td><font size="1" face="Tahoma">
<select size="1" name="group2">
<?php
echo "<option></option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140"> </td>
<td><font size="1" face="Tahoma">
<select size="1" name="group3">
<?php
echo "<option></option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Redirect to:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="redirect" size="20" value="http://">
</font></td>
</tr>
<tr>
<td width="140">Change Password Next Login:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="pchange">
<option value="0" selected>No</option>
<option value="1">Yes</option>
</select>
</font></td>
</tr>
<tr>
<td width="140">E-Mail User Account Information:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="email_user">
<option value="No" selected>No</option>
<option value="Yes">Yes</option>
</select>
</font></td>
</tr>
<tr>
<td width="140"><font size="1" face="Tahoma">
<input type="submit" value="Submit" name="B4">
</font></td>
<td> </td>
</tr>
</table>
</font> </form></td>
</tr>
<tr>
<?php
}
?>
</tr>
<tr>
<td><font size="1" face="Tahoma">
<?php
if ($_POST[alter1] == "modify" || $_POST[username] != "")
{
?>
<form method="POST" action="<? $PHP_SELF; ?>">
<p>
<input type="hidden" name="alter1" size="20" value="up">
<input name="submit" type="submit" value="Modificar usuario">
</p>
</form>
<?php
}
else{
?>
<form method="POST" action="<? $PHP_SELF; ?>">
<p>
<input type="hidden" name="alter1" size="20" value="modify">
<input name="submit" type="submit" value="Modificar usuario">
</p>
</form>
<?php
}
?>
</font></td>
<?
if (($_POST[alter1] == "modify") || ($_POST[username] != ""))
{
?>
<tr>
<td> <font size="1" face="Tahoma">
<form name="myform" id="myform" action="<? $PHP_SELF; ?>" method="POST">
<table border="0" width="100%" id="table41" cellspacing="0" cellpadding="0" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<tr>
<td width="140">Username:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="username" onChange="document.myform.submit()">
<?
if ($_POST[username] != "")
{
echo "<option>$_POST[username]</option>";
echo "<option value=\"\"></option>";
}
else
{
echo "<option></option>";
}
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT * FROM $table_name";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$uname = $sql -> username;
echo "<option value=\"$uname\">$uname</option>";
}
?>
</select>
</font></td>
</tr>
</table>
</form>
</font> </td>
</tr>
<?php
if ($_POST[username] != "")
{
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT * FROM $table_name WHERE username = '$_POST[username]'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$m_first = $sql -> firstname;
$m_last = $sql -> lastname;
$g_1 = $sql -> group1;
$g_2 = $sql -> group2;
$g_3 = $sql -> group3;
$chng = $sql -> pchange;
$m_email = $sql -> email;
$direct = $sql -> redirect;
}
?>
<tr>
<td> <form method="POST" action="mod_user.php">
<font size="1" face="Tahoma">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<tr>
<td width="140">Nombre:</td>
<td><font size="1" face="Tahoma">
<input type="hidden" name="username" value="<? echo $_POST[username]; ?>">
<input type="text" name="mod_first" value="<? echo $m_first; ?>" size="20">
</font></td>
</tr>
<tr>
<td width="140">Apellido:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="mod_last" value="<? echo $m_last; ?>" size="20">
</font></td>
</tr>
<tr>
<td width="140"> Password:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="mod_pass" size="20" value="Same as Old">
</font></td>
</tr>
<tr>
<td width="140"> E-Mail Address:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="mod_email" value="<? echo $m_email; ?>" size="20">
</font></td>
</tr>
<tr>
<td width="140"> Grupo:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="mod_group1">
<?php
echo "<option>$g_1</option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140"> </td>
<td><font size="1" face="Tahoma">
<select size="1" name="mod_group2">
<?php
echo "<option>$g_2</option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140"> </td>
<td><font size="1" face="Tahoma">
<select size="1" name="mod_group3">
<?php
echo "<option>$g_3</option>";
$i = 0;
while ($i < $num_groups)
{
echo "<option value=\"$group_array[$i]\">$group_array[$i]</option>";
$i++;
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140"> Redirect to:</td>
<td><font size="1" face="Tahoma">
<input type="text" name="mod_redirect" value="<? echo $direct; ?>" size="20">
</font></td>
</tr>
<tr>
<td width="140"> Change Password Next Logon:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="mod_chng">
<option value="0" selected>No</option>
<option value="1">Yes</option>
</select>
</font></td>
</tr>
<tr>
<td width="140"> E-Mail User Account Information:</td>
<td><font size="1" face="Tahoma">
<select size="1" name="mod_send">
<option value="No" selected>No</option>
<option value="Yes">Yes</option>
</select>
</font></td>
</tr>
<tr>
<td width="140"> <font size="1" face="Tahoma">
<input type="submit" value="Submit" name="B5">
</font></td>
<td> </td>
</tr>
</table>
</font> </form></td>
</tr>
<?php
}
?>
<?
}
?>
</table></td>
</tr>
<tr>
<td width="38%">
<?php
if ($_POST[alter] == "options")
{
?>
<form method="POST" action="<?php $PHP_SELF; ?>">
<p>
<input type="hidden" name="alter" value="up">
<input name="submit" type="submit" value="Opciones administrativas">
</p>
</form>
<?php
}
else
{
?>
<form method="POST" action="<?php $PHP_SELF; ?>">
<p>
<input type="hidden" name="alter" value="options">
<input name="submit" type="submit" value="Opciones administrativas">
</p>
</form>
<?php
}
?>
</td>
</tr>
<tr>
<td width="33%" valign="top" height="0">
<?php
if ($_POST[alter] == "options")
{
?>
<form method="POST" action="mod_user.php">
<table border="0" width="100%" id="table43" cellspacing="0" cellpadding="3" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<tr>
<td width="140">Delete User</td>
<td> <font size="1" face="Tahoma">
<select size="1" name="del_user">
<option></option>
<?php
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT username FROM $table_name ORDER BY username";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$uname = $sql -> username;
if ($uname != $_SESSION[user_name])
{
echo "<option value=\"$uname\">$uname</option>";
}
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Restore User</td>
<td> <font size="1" face="Tahoma">
<select size="1" name="restore">
<option></option>
<?php
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT username FROM trash ORDER BY username";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$uname = $sql -> username;
if ($uname != $_SESSION[user_name])
{
echo "<option value=\"$uname\">$uname</option>";
}
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Ban User</td>
<td> <font size="1" face="Tahoma">
<select size="1" name="ban_user">
<option></option>
<?php
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT username FROM $table_name ORDER BY username";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$uname = $sql -> username;
if ($uname != $_SESSION[user_name])
{
echo "<option value=\"$uname\">$uname</option>";
}
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Block IP Address</td>
<td> <font size="1" face="Tahoma">
<input type="text" name="oct1" size="3" maxlength="3">
</font>.<font size="1" face="Tahoma">
<input type="text" name="oct2" size="3" maxlength="3">
</font><font face="Tahoma">.</font><font size="1" face="Tahoma">
<input type="text" name="oct3" size="3" maxlength="3">
<font face="Tahoma">.</font>
<input type="text" name="oct4" size="3" maxlength="3">
</font></td>
</tr>
<tr>
<td width="140">Lift User Ban</td>
<td> <font size="1" face="Tahoma">
<select size="1" name="lift_user_ban">
<option></option>
<?php
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT * FROM banned WHERE type = 'user'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$banned = $sql -> no_access;
echo "<option value=\"$banned\">$banned</option>";
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Lift IP Ban</td>
<td> <font size="1" face="Tahoma">
<select size="1" name="lift_ip_ban">
<option></option>
<?php
//require the config file
require ("../config.php");
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//build and issue the query
$sql ="SELECT * FROM banned WHERE type = 'ip'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($sql = mysql_fetch_object($result))
{
$banned = $sql -> no_access;
echo "<option value=\"$banned\">$banned</option>";
}
?>
</select>
</font></td>
</tr>
<tr>
<td width="140">Empty Trash</td>
<td><font size="1" face="Tahoma">
<select size="1" name="empt_trash">
<option></option>
<option value="yes">Yes</option>
</select>
</font></td>
</tr>
<tr>
<td width="140">Purge Accounts Inactive for</td>
<td><select size="1" name="amt_time">
<option></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select> <font size="1" face="Tahoma">
<select size="1" name="incr_time">
<option></option>
<option value="DAY">Days</option>
<option value="MONTH">Months</option>
<option value="YEAR">Years</option>
</select>
</font></td>
</tr>
<tr>
<td width="140"><font size="1" face="Tahoma">
<input type="submit" value="Submit" name="B6">
</font></td>
<td> </td>
</tr>
</table>
</form>
<?php
}
?>
</td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
<tr>
<td width="38%"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<br>
<hr noshade height=1 color="#cccccc" width="90%">
<div align="center">Secretaria Distrital de Ambiente </div>
|