Location: PHPKode > projects > Sound PHP Engine > s-p-e-0.3.0/s-p-e-0.3.0/data/user.php
<?php
// ===================================================== 
// 
// s-p-e - Content management system. 
// Copyright (C) 2004, 2005, 2010, 2011 Vladimir B. Tsarkov
// 
// This file is part of s-p-e. 
// 
// s-p-e is free software; you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// 
// s-p-e 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. 
// 
// You should have received a copy of the GNU General Public License 
// along with s-p-e. If not, see <http://www.gnu.org/licenses/>.
//
// ------
//
//  You can contact me via e-mail: lipetsk-gnu-lug at bk period ru
//
//  user.php
//
//  Abstract: Information about bindings.
//  
//  Revision History:
// 
//	1  2004-03-27 - 2005-07-02  vbt
//	2  2005-07-17  vbt
//	3  2010-06-24  vbt
//	4  2011-01-22  vbt
//
// =====================================================
header("Content-Type: text/html; charset=UTF-8");

include("configure/specfg.php"); 
include("../include/functions.php");

cache();

session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
session_start();

gc();

redirect(read(session_id()));

if(read(session_id()) == "administrator")
{
        language($cfg["deflangadmin"]);    
        echo "<html>
	<head>
	<title>".(_("Bindings of the user"))."</title>
	</head>
	<link rel='stylesheet' type='text/css' href='../skin/".($cfg["skin"])."/style.css'>
	<body>";		     
	if(isset($_POST['view']))
	{
		$view = $_POST['view'];
	}
	if(isset($view))
	{
  	  $fuser = $_POST['fuser'];
	  $fuser = trim($fuser);		
	
	  if($fuser)
	  {
	    echo "<font class='positive'>
	    ".(_("Bindings of the user"))."
	    </font>
	    &nbsp;$fuser:<br>".str_repeat("-", 5)."<br>";
	    connect($cfg["host"], $cfg["user"], $cfg["password"], $cfg["database"], $connector);
	    $result = mysql_query("select ".($cfg["prefix"])."partition.pnid, ".($cfg["prefix"])."partition.partname
	 		from ".($cfg["prefix"])."lines, ".($cfg["prefix"])."partition 
			where ".($cfg["prefix"])."lines.login='$fuser' 
			and ".($cfg["prefix"])."lines.partnameid=".($cfg["prefix"])."partition.pnid 
			order by ".($cfg["prefix"])."lines.partnameid", $connector);
	    if(mysql_num_rows($result) == 0)
	    {
		echo "error #101-1";
	    }
	    while($row = mysql_fetch_array($result))
	    {
		if(strlen($row["pnid"]) == 10)
		{
			$output = "".(_("News"))."";
		}
		if(strlen($row["pnid"]) == 11)
		{
			$output = "".(_("Articles"))."";
		}
		$output = strtolower($output);
		echo "<table>
		<tr>
		<td width='5'>
		</td>
		<td>";
		echo "<font class='s-normal'>
		&nbsp;&nbsp;".$row["partname"]."&nbsp;&nbsp;&nbsp;($output)<br>
		</font>
		<br>";
		echo "</td>
		<td width='5'>
		</td>
		</tr>
		</table>".str_repeat("-", 5)."<br>";
	    } 
	    mysql_free_result($result);
	    mysql_close($connector);
			
	  } 
	  else 
	  {
			echo "<font class='negative'>".(_("Please, specify the name of the user."))."</font>";
	  }
	}
	echo "<p>
	<font class='s-normal'>
	".(_("Back to the"))." <a href='admin.php'>".(_("s-p-e Administrator's Page"))."</a>
	</font>
	</p>
	</body>
	</html>"; 
}
?>
Return current item: Sound PHP Engine