⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netdisk.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
📖 第 1 页 / 共 4 页
字号:
			else if ( !is_dir( "{$location}/{$file}" ) )
			{
				if ( file_exists( "{$location}/{$file}" ) )
				{
					unlink( "{$location}/{$file}" );
				}
				unset( $file );
			}
		}
		closedir( $all );
		rmdir( $location );
	}
	else if ( file_exists( "{$location}" ) )
	{
		unlink( "{$location}" );
	}
}

function enlever_controlm( $fichier )
{
	$fic = file( $fichier );
	$fp = fopen( $fichier, "w" );
	while ( list( $cle, $val ) = each( $fic ) )
	{
		$val = str_replace( chr( 10 ), "", $val );
		$val = str_replace( chr( 13 ), "", $val );
		fputs( $fp, "{$val}\n" );
	}
	fclose( $fp );
}

function traite_nom_fichier( $nom )
{
	global $max_caracteres;
	$nom = stripslashes( $nom );
	$nom = str_replace( "'", "", $nom );
	$nom = str_replace( "\"", "", $nom );
	$nom = str_replace( "\"", "", $nom );
	$nom = str_replace( "&", "", $nom );
	$nom = str_replace( ",", "", $nom );
	$nom = str_replace( ";", "", $nom );
	$nom = str_replace( "/", "", $nom );
	$nom = str_replace( "\\", "", $nom );
	$nom = str_replace( "`", "", $nom );
	$nom = str_replace( "<", "", $nom );
	$nom = str_replace( ">", "", $nom );
	$nom = str_replace( ":", "", $nom );
	$nom = str_replace( "*", "", $nom );
	$nom = str_replace( "|", "", $nom );
	$nom = str_replace( "@", "", $nom );
	$nom = str_replace( "!", "", $nom );
	$nom = str_replace( "+", "", $nom );
	$nom = str_replace( "^", "", $nom );
	$nom = str_replace( "=", "", $nom );
	$nom = str_replace( "\$", "", $nom );
	$nom = str_replace( "%", "", $nom );
	return $nom;
}

include_once( "inc/auth.php" );
if ( $DISK_ID == "" )
{
	header( "location: index.php" );
}
$connection = openconnection( );
$query = "select * from NETDISK where DISK_ID={$DISK_ID} and (DISK_TYPE='1' or (DISK_TYPE='2' and DEPT_ID={$LOGIN_DEPT_ID}) or (DISK_TYPE='3' and (InStr(USER_ID,',{$LOGIN_USER_ID},')>0 or InStr(USER_ID,'{$LOGIN_USER_ID},')=1)))";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$NEW_USER = $ROW['NEW_USER'];
	$MANAGE_USER = $ROW['MANAGE_USER'];
	$DISK_PATH = $ROW['DISK_PATH'];
	$DISK_NAME = $ROW['DISK_NAME'];
	$DISK_TYPE = $ROW['DISK_TYPE'];
	$USER_ID = $ROW['USER_ID'];
	$DEPT_ID = $ROW['DEPT_ID'];
}
else
{
	exit( );
}
ob_end_clean( );
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: ".gmdate( "D, d M Y H:i:s" )." GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
include( "prive/conf.php" );
$racine = $DISK_PATH;
if ( $langue == "" )
{
	$langue = $dft_langue;
}
require( "include/{$langue}.php" );
if ( file_exists( "logs/{$id}.php" ) )
{
	include( "logs/{$id}.php" );
}
switch ( $action )
{
case "aide" :
	include( $hautpage );
	include( "include/{$langue}_help.htm" );
	break;
case "telecharger" :
	$NomFichier = basename( $fichier );
	$taille = filesize( "{$racine}/{$fichier}" );
	ob_end_clean( );
	header( "Content-Type: application/force-download; name=\"{$NomFichier}\"" );
	header( "Content-Transfer-Encoding: binary" );
	header( "Content-Length: {$taille}" );
	header( "Content-Disposition: attachment; filename=\"{$NomFichier}\"" );
	header( "Expires: 0" );
	header( "Cache-control: private" );
	header( "Pragma: no-cache" );
	readfile( "{$racine}/{$fichier}" );
	exit( );
case "editer" :
	if ( !connecte( $id ) )
	{
		header( "Location:netdisk.php" );
		exit( );
	}
	include( $hautpage );
	$code = stripslashes( $code );
	if ( $save == 1 )
	{
		$code = str_replace( "&lt;", "<", $code );
		$fp = fopen( "{$racine}/{$fic}", "w" );
		fputs( $fp, $code );
		fclose( $fp );
		enlever_controlm( "{$racine}/{$fic}" );
		echo "\t";
		echo "<s";
		echo "cript>alert('文件已保存!');</script>\r\n";
	}
	echo "<div align=center class=TableHeader>\n";
	echo "{$mess['52']} {$fic}<br>";
	echo "</div>";
	echo "<div align=center>";
	echo "<form name=\"form1\" action=\"netdisk.php\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
	echo "<input type=\"hidden\" name=\"fic\" value=\"{$fic}\">\n";
	echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
	echo "<input type=\"hidden\" name=\"save\" value=\"1\">\n";
	echo "<input type=\"hidden\" name=\"action\" value=\"editer\">\n";
	echo "<input type=\"hidden\" name=\"ordre\" value=\"{$ordre}\">\n";
	echo "<input type=\"hidden\" name=\"sens\" value=\"{$sens}\">\n";
	echo "<TEXTAREA NAME=\"code\" rows=\"20\" cols=\"80\" wrap=\"OFF\" class=BigInput >\n";
	$fp = fopen( "{$racine}/{$fic}", "r" );
	while ( !feof( $fp ) )
	{
		$tmp = fgets( $fp, 4096 );
		$tmp = str_replace( "<", "&lt;", $tmp );
		echo "{$tmp}";
	}
	fclose( $fp );
	echo "{$fichier}";
	echo "</TEXTAREA>\n";
	echo "<br><br>\n";
	echo "<input type=\"button\" onclick='javascript:document.form1.submit()' value=\"{$mess['53']}\" class=\"SmallButton\">\n";
	echo "<input type=\"button\" onclick=\"location.replace('netdisk.php?DISK_ID={$DISK_ID}&id={$id}&rep={$rep}&ordre={$ordre}&sens={$sens}')\" value=\"{$mess['86']}\" class=\"SmallButton\">\n";
	echo "</form>\n";
	echo "</div>\n";
	break;
case "copier" :
	if ( !connecte( $id ) )
	{
		header( "Location:netdisk.php" );
		exit( );
	}
	include( $hautpage );
	echo "<div>\n";
	echo "<table border='0' cellspacing='1' width='100%'  cellpadding='5'>\n";
	echo "<tr><td width=20% class=TableLine2><img src=\"images/copier.gif\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\"> {$mess['67']} : </td><td class=TableLine1><b>{$fic}</b></td></tr>\n";
	echo "<tr><td class=TableLine2><img src=\"images/coller.gif\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\"> {$mess['68']} : </td><td class=TableLine1>";
	if ( $dest == "" )
	{
		echo "/";
	}
	else
	{
		echo "{$dest}";
	}
	echo "</td></tr>\n";
	echo "</table>\n";
	echo "<br><b>{$mess['69']} :</b><br><br>\n";
	echo "<table border='0' cellspacing='1' width='100%'  cellpadding='5' class=TableLine2>";
	$handle = opendir( "{$racine}/{$dest}" );
	while ( $fichier = readdir( $handle ) )
	{
		if ( $fichier == ".." )
		{
			$up = dirname( $dest );
			if ( $up == $dest || $up == "." )
			{
				$up = "";
			}
			if ( $up != $dest )
			{
				echo "<td width=5%><img src=\"images/parent.gif\"></td><td><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&action=copier&ordre={$ordre}&sens={$sens}&dest={$up}&fic={$fic}&rep={$rep}\">{$mess['24']}</td>";
			}
		}
		else if ( $fichier != ".." && $fichier != "." && is_dir( "{$racine}/{$dest}/{$fichier}" ) )
		{
			$liste_dir[] = $fichier;
		}
	}
	closedir( $handle );
	if ( is_array( $liste_dir ) )
	{
		asort( $liste_dir );
		while ( list( $cle, $val ) = each( $liste_dir ) )
		{
			echo "<tr><td width=5%><img src=\"images/dossier.gif\"></td><td><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&action=copier&dest=";
			if ( $dest != "" )
			{
				echo "{$dest}/";
			}
			echo "{$val}&rep={$rep}&ordre={$ordre}&sens={$sens}&fic={$fic}\">{$val}</a></tr>\n";
		}
	}
	echo "</table><br>";
	echo "<table>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "<form action=\"netdisk.php\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
	echo "<input type=\"hidden\" name=\"action\" value=\"copier_suite\">\n";
	echo "<input type=\"hidden\" name=\"fic\" value=\"{$fic}\">\n";
	echo "<input type=\"hidden\" name=\"dest\" value=\"{$dest}\">\n";
	echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
	echo "<input type=\"hidden\" name=\"sens\" value=\"{$sens}\">\n";
	echo "<input type=\"hidden\" name=\"ordre\" value=\"{$ordre}\">\n";
	echo "<input type=\"submit\" class=SmallButton value=\"确定\">&nbsp;\n";
	echo "</form>\n";
	echo "</td>\n";
	echo "<td>\n";
	echo "<form action=\"netdisk.php\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
	echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
	echo "<input type=\"hidden\" name=\"ordre\" value=\"{$ordre}\">\n";
	echo "<input type=\"hidden\" name=\"sens\" value=\"{$sens}\">\n";
	echo "<input type=\"submit\" class=SmallButton value=\"{$mess['54']}\">\n";
	echo "</form>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "</table>\n";
	echo "</div>\n";
	break;
case "copier_suite" :
	if ( !connecte( $id ) )
	{
		header( "Location:netdisk.php" );
		exit( );
	}
	$destination = "{$racine}/";
	if ( $dest != "" )
	{
		$destination .= "{$dest}/";
	}
	$destination .= basename( $fic );
	if ( file_exists( "{$racine}/{$fic}" ) && "{$racine}/{$fic}" != $destination )
	{
		copy( "{$racine}/{$fic}", $destination );
	}
	header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}" );
	exit( );
case "voir" :
	$nomdufichier = basename( $fichier );
	$fichier = file_exists( $fichier ) ? $fichier : $racine."/".$fichier;
	if ( is_image( $fichier ) )
	{
		if ( strtolower( substr( $fichier, -3 ) ) == "doc" || strtolower( substr( $fichier, -3 ) ) == "xls" || strtolower( substr( $fichier, -3 ) ) == "ppt" )
		{
			$NomFichier = basename( $fichier );
			$taille = filesize( $fichier );
			header( "Content-Type: application/force-download; name=\"{$NomFichier}\"" );
			header( "Content-Transfer-Encoding: binary" );
			header( "Content-Length: {$taille}" );
			header( "Content-Disposition: attachment; filename=\"{$NomFichier}\"" );
			header( "Expires: 0" );
			header( "Cache-control: private" );
			header( "Pragma: no-cache" );
		}
		readfile( $fichier );
		exit( );
	}
	if ( substr( $fichier, -3 ) == "htm" || substr( $fichier, -4 ) == "html" )
	{
		readfile( $fichier );
		exit( );
	}
	echo "<html>\n";
	echo "<head><title>{$mess['23']} : ".$nomdufichier."</title></head>\n";
	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/theme/1/style.css\">";
	$fp = @fopen( "{$hautpage}", "r" );
	if ( $fp )
	{
		while ( !feof( $fp ) )
		{
			$buffer = fgets( $fp, 4096 );
			if ( eregi( "<body", $buffer ) )
			{
				$tmp = split( "<", $buffer );
				while ( list( $cle, $val ) = each( $tmp ) )
				{
					if ( eregi( "body", $val ) )
					{
						$val = str_replace( ">", "", $val );
						$val = str_replace( chr( 10 ), "", $val );
						$val = str_replace( chr( 13 ), "", $val );
						echo "<{$val} onload=\"self.focus()\">\n";
					}
				}
				break;
			}
		}
		fclose( $fp );
	}
	$strHtml = "<table border=\"0\" width=\"100%\" cellspacing=\"1\"  cellpadding=\"0\">\r\n   <tr class=\"tablehead1\">\r\n    <td ><img src=\"/images/notify_new.gif\" align=\"absmiddle\"> {$mess['23']} : {$nomdufichier}\r\n    </td>\r\n  </tr>\r\n  <tr class=\"tablehead2\"><td>\r\n  <a href=\"javascript:window.print()\" style=\"cursor:hand\"><img src=\"/images/button/print.gif\" border=\"0\" title=\"打印\"></a> \r\n\t<a href=\"javascript:window.close()\" style=\"cursor:hand\"><img src=\"/images/button/shut.gif\" border=\"0\" title=\"关闭\"></a>\r\n  </td></tr>\r\n</table>";
	echo $strHtml;
	echo "<br>";
	$tableHtmlS = "\t<table border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"5\">\r\n\t  <tr>\r\n\t   <td class=\"TableLine1\">";
	echo $tableHtmlS;
	$fp = @fopen( "{$fichier}", "r" );
	if ( $fp )
	{
		echo "\n";
		while ( !feof( $fp ) )
		{
			$buffer = fgets( $fp, 4096 );
			$buffer = txt_vers_html( $buffer );
			$buffer = str_replace( "\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $buffer );
			echo $buffer."<br>";
		}
		fclose( $fp );
		echo "\n";
	}
	$tableHtmlE = "\t     </td>\r\n\t   </tr>\r\n\t </table>";
	echo $tableHtmlE;
	echo "</body>\n";
	echo "</html>\n";
	exit( );
case "deplacer" :
	if ( !connecte( $id ) )
	{
		header( "Location:netdisk.php" );
		exit( );
	}
	include( $hautpage );
	echo "<div>\n";
	echo "<table border='0' cellspacing='1' width='100%'  cellpadding='5'>\n";
	echo "<tr><td class=TableLine2 width=20%><img src=\"images/couper.gif\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\"> {$mess['67']} : </td><td class=TableLine1><b>{$fic}</b></td></tr>\n";
	echo "<tr><td class=TableLine2><img src=\"images/coller.gif\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\"> {$mess['68']} : </td><td class=TableLine1>";
	if ( $dest == "" )
	{
		echo "/";
	}
	else
	{
		echo "{$dest}";
	}
	echo "</td></tr>\n";
	echo "</table>\n";
	echo "<br><b>{$mess['69']} :</b><br><br>\n";
	echo "<table border='0' cellspacing='1' width='100%' cellpadding='5' class=TableLine2>";
	$handle = opendir( "{$racine}/{$dest}" );
	while ( $fichier = readdir( $handle ) )
	{
		if ( $fichier == ".." )
		{
			$up = dirname( $dest );
			if ( $up == $dest || $up == "." )
			{
				$up = "";
			}
			if ( $up != $dest )
			{
				echo "<td width=5%><img src=\"images/parent.gif\"></td><td><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&ordre={$ordre}&sens={$sens}&action=deplacer&dest={$up}&fic={$fic}&rep={$rep}\">{$mess['24']}";
			}
		}
		else if ( $fichier != ".." && $fichier != "." && is_dir( "{$racine}/{$dest}/{$fichier}" ) )
		{
			$liste_dir[] = $fichier;
		}
	}
	closedir( $handle );
	if ( is_array( $liste_dir ) )
	{
		asort( $liste_dir );
		while ( list( $cle, $val ) = each( $tmp ) )
		{
			echo "<tr><td width=5%><img src=\"images/dossier.gif\"></td><td><a href=\"netdisk.php?DISK_ID={$DISK_ID}&id={$id}&action=deplacer&dest=";
			if ( $dest != "" )
			{
				echo "{$dest}/";
			}
			echo "{$val}&rep={$rep}&ordre={$ordre}&sens={$sens}&fic={$fic}\">{$val}</a></tr>\n";
		}
	}
	echo "</table><br>";
	echo "<table>\n";
	echo "<tr>\n";
	echo "<td>\n";
	echo "<form action=\"netdisk.php\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
	echo "<input type=\"hidden\" name=\"action\" value=\"deplacer_suite\">\n";
	echo "<input type=\"hidden\" name=\"fic\" value=\"{$fic}\">\n";
	echo "<input type=\"hidden\" name=\"dest\" value=\"{$dest}\">\n";
	echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
	echo "<input type=\"hidden\" name=\"ordre\" value=\"{$ordre}\">\n";
	echo "<input type=\"hidden\" name=\"sens\" value=\"{$sens}\">\n";
	echo "<input type=\"submit\" class=SmallButton value=\"确定\">&nbsp;\n";
	echo "</form>\n";
	echo "</td>\n";
	echo "<td>\n";
	echo "<form action=\"netdisk.php\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
	echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n";
	echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
	echo "<input type=\"hidden\" name=\"ordre\" value=\"{$ordre}\">\n";
	echo "<input type=\"hidden\" name=\"sens\" value=\"{$sens}\">\n";
	echo "<input type=\"submit\" class=SmallButton value=\"取消\">\n";
	echo "</form>\n";
	echo "</td>\n";
	echo "</tr>\n";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -