<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
// www.bcoos.net 2006-09 1.0.2 GPL
//v1.9 www.bcoos.net 2006-08 GPL
//v1.8 www.exoops.info 2006/03 
// $Id: admin.php,v 1.7 2003/08/17 20:42:44 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: The Xoops Project
// Author Website : http://www.xoops.org
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
$xoopsOption['pagetype'] = "admin";
include_once("mainfile.php");
include_once(XOOPS_ROOT_PATH."/include/cp_functions.php");
/*********************************************************/
/* Admin Authentication                                  */
/*********************************************************/
$admintest = 0;
if ($xoopsUser) {
	if ( !$xoopsUser->isAdmin() ) {
		redirect_header("index.php", 2, _NOPERM);
		exit();
	}
	$admintest = 1;
	} else {
		redirect_header("index.php", 2, _NOPERM);
		exit();
	}
$op = "list";
if ( !empty($_GET['op']) ) {
	$op = $_GET['op'];
}
if ( !empty($_POST['op']) ) {
	$op = $_POST['op'];
}
if ($admintest == 1) {
switch ($op) {
case "list":
	xoops_cp_header();
	OpenTable();
	if ( @is_writable(XOOPS_ROOT_PATH."/mainfile.php" ) ) {
		echo "<img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."editor_info.gif' /> ".sprintf(_FILEWARN, XOOPS_ROOT_PATH."/mainfile.php")."<br /><br />";
	}
	if ( @is_dir(XOOPS_ROOT_PATH."/_install" ) ) {
		echo "<img src='".XOOPS_URL."/images/icons/".$bcoosConfig['iconset']."editor_info.gif' /> ".sprintf(_INSTALLWARN, XOOPS_ROOT_PATH."/_install/")."";
	}
	$sql = "SELECT * FROM ".$db->prefix("users")." WHERE level>0 ORDER BY uid DESC";
	$result = $db->query($sql, 10, 0);
	echo "<h4>"._AD_LASTTENUSERS."</h4>";
	echo "<table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'><tr><td class='bg2'><table width='100%' border='0' cellpadding='4' cellspacing='1'>
	<tr class='bg3' align='center'><td><b>"._AD_NICKNAME."</b></td><td><b>"._EMAIL."</b></td><td><b>"._AD_AVATAR."</b></td><td><b>"._AD_COMMENTS."</b></td><td><b>"._AD_REGISTERED."</b></td><td><b>"._AD_ACTION."</b></td></tr>";
	while ( $myrow = $db->fetchArray($result) ) {
		$myuser     = new XoopsUser($myrow);
		$user_image = $myuser->getVar("user_avatar") ? "<img src='images/avatar/".$myuser->getVar("user_avatar")."' alt='' />" : '&nbsp;';
		echo "
		<tr class='bg1'>
		<td><a href='userinfo.php?uid=".$myuser->getVar("uid")."'>".$myuser->getVar("uname")."</a></td>
		<td><a href='mailto:".$myuser->getVar("email")."'>".$myuser->getVar("email")."</a></td>
		<td align='center'>".$user_image."</td>
		<td align='center'>".$myuser->getVar("posts")."</td>
		<td align='center'>".formatTimestamp($myuser->getVar("user_regdate"))."</td>
		<td align='right'><a href='modules/system/admin.php?fct=users&amp;op=modifyUser&amp;uid=".$myuser->getVar("uid")."'>"._EDIT."</a>&nbsp;<a href='modules/system/admin.php?fct=users&amp;op=delUser&amp;uid=".$myuser->getVar("uid")."'>"._DELETE."</a></td>
		</tr>";
	}
	echo "</table></td></tr></table><br />";
	?>
	<h4>Contribute to, or support bcoos</h4>
	<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
	<div align="center">
	<input type="hidden" value="_xclick" name="cmd">
	<input type="hidden" value="webmaster@bcoos.net" name="business">
	<input type="hidden" value="bcoos developer help" name="item_name">
	<input type="hidden" value="1" name="item_number">
	<input type="hidden" value="<?php echo XOOPS_URL;?>" name="custom">
	<input type="hidden" name="currency_code" value="USD">
	<input type="image" alt="Make a small donation to say thank's" src="<?php echo XOOPS_URL;?>/images/donate.gif" border="0" name="submit">
	</div><br />
	</form>
	<a href="http://www.bcoos.net/modules/newbb/viewforum.php?forum=12"><b>Feature wishes</b></a><br />
	<a href="http://www.bcoos.net/modules/newbb/viewforum.php?forum=6"><b>Report bugs - bugs@bcoos.net</b></a><br />
	<br /><br />
	
	
	<?php
	CloseTable();
	xoops_cp_footer();
	break;
default:
	break;
}
}
?>
