Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/Blocks/Block_status.php
<?php
/*
*****************************************************************

 Block_status.php
 
*****************************************************************
LSP: Lunabyte Systems Portal
Open-Source Project Inspired by Zef Hemel (hide@address.com)
*****************************************************************
Software Version:                  LSP 2.0 "Enigma 2"
Software by:                         Lunabyte Systems (http://www.lunabyte.net)
Copyright 2002-2005 by:       Lunabyte Systems (http://www.lunabyte.net)
Support, News, Updates at:    http://www.lunabyte.net
*****************************************************************
This program is free software; you may redistribute it and/or modify it 
under the terms of the provided license as published by Lunabyte Systems.

This program is distributed in the hope that it is and will be useful,                  
but WITHOUT ANY WARRANTIES; without even any implied warranty of           
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        

See the "LSP_license.txt" file for details of the LSP license.
The latest version can always be found at http://www.lunabyte.net.
*****************************************************************
*/

if (!defined('ENIGMA'))
	die('<b>Access Violation</b><br />Direct Access to this location is not allowed.');

// set this so the load Blocks functions knows there's a template file for this block
$blockTemplate = true;

// Show current status of the admins
function Block_status()
{
	global $db_prefix, $txt, $scripturl, $context;

	$request = db_query("
		SELECT astatus, realName
		FROM {$db_prefix}members
		WHERE ID_GROUP IN (1) OR additionalGroups IN (1)
		AND astatus IS NOT NULL", __FILE__, __LINE__);

	while ($admins = mysql_fetch_assoc($request))
     {
		$context['admins'][] = array(
						'realName' =>	$admins['realName'],
						'astatus' =>	empty($admins['astatus']) ? '' : DoUBBC($admins['astatus']),
						);

	}

	mysql_free_result($request);

	// setup up the URL Location to return to after performing an action.
	// but check if we're already calling the change status function
	$context['status_return'] = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];

}

function change_status()
{
	global $db_prefix, $ID_MEMBER;

	// Check for permissions.
	isAllowedTo('admin_forum');

	db_query("
		UPDATE {$db_prefix}members
		SET astatus='$_POST[status]'
		WHERE (ID_MEMBER='$ID_MEMBER')
		LIMIT 1", __FILE__, __LINE__);

	redirectexit($_REQUEST['loc'], false);
}

?>
Return current item: Enigma