📄 netdisk.php
字号:
if ( "{$racine}/{$fic}" != $destination && file_exists( "{$racine}/{$fic}" ) )
{
unlink( "{$racine}/{$fic}" );
}
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&ordre={$ordre}&sens={$sens}&id={$id}" );
exit( );
case "supprimer" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
include( $hautpage );
echo "<div align=center class=big1>\n";
if ( is_dir( "{$racine}/{$fic}" ) )
{
$mime = $mess[45];
}
else
{
$mime = $mess[46];
}
echo "{$mess['47']} <br><br>{$mime} <b>{$fic}</b> ?";
echo "<br><br>";
$fic = str_replace( "+", "%2B", $fic );
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&action=supprimer_suite&rep={$rep}&fic={$fic}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['48']}</span></a> \n";
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['49']}</span></a>\n";
echo "<br>";
echo "</div>\n";
break;
case "supprimer_suite" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
$messtmp = "";
$a_effacer = "{$racine}/{$fic}";
if ( file_exists( $a_effacer ) )
{
if ( is_dir( $a_effacer ) )
{
deldir( $a_effacer );
$messtmp .= "{$mess['38']} <b>{$fic}</b> {$mess['44']}.";
}
else
{
unlink( $a_effacer );
$messtmp .= "{$mess['34']} <b>{$fic}</b> {$mess['44']}.";
}
}
else
{
$messtmp .= $mess[76];
}
$messtmp .= "<br><br><a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
$messtmp .= "";
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}" );
exit( );
case "rename" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
include( $hautpage );
echo "<div align=center class=big1>\n";
$nom_fic = basename( $fic );
echo "";
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=\"rename_suite\">\n";
echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
echo "<input type=\"hidden\" name=\"fic\" value=\"{$fic}\">\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 "{$mess['6']} <b>{$nom_fic}</b> {$mess['42']} ";
echo "<input type=\"text\" class=BigInput name=\"fic_new\" value=\"{$nom_fic}\">\n";
echo "<input type=\"submit\" class=BigButton value=\"{$mess['6']}\">\n";
echo "</form>";
echo "<a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
echo "<br>";
echo "</div>\n";
break;
case "rename_suite" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
$err = "";
$nom_fic = basename( $fic );
$messtmp = "";
$fic_new = traite_nom_fichier( $fic_new );
$old = "{$racine}/{$fic}";
$new = dirname( $old )."/".$fic_new;
if ( $fic_new == "" )
{
$messtmp .= "{$mess['37']}";
$err = 1;
}
else
{
if ( file_exists( $new ) )
{
$messtmp .= "<b>{$fic_new}</b> {$mess['43']}";
$err = 1;
}
else
{
if ( file_exists( $old ) )
{
rename( $old, $new );
}
$messtmp .= "<b>{$fic}</b> {$mess['41']} <b>{$fic_new}</b>";
}
}
$messtmp .= "<br><br><a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
$messtmp .= "";
if ( $err == "" )
{
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&ordre={$ordre}&sens={$sens}&id={$id}" );
exit( );
}
include( $hautpage );
echo "<div align=center class=big1>\n";
echo "{$messtmp}";
echo "</div>\n";
break;
case "mkdir" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
$err = "";
$messtmp = "";
$nomdir = traite_nom_fichier( $nomdir );
if ( $nomdir == "" )
{
$messtmp .= "{$mess['37']}";
$err = 1;
}
else if ( file_exists( "{$racine}/{$rep}/{$nomdir}" ) )
{
$messtmp .= "{$mess['40']}";
$err = 1;
}
else
{
mkdir( "{$racine}/{$rep}/{$nomdir}", 509 );
$messtmp .= "{$mess['38']} <b>{$nomdir}</b> {$mess['39']} <b>";
if ( $rep == "" )
{
$messtmp .= "/";
}
else
{
$messtmp .= "{$rep}";
}
$messtmp .= "</b>";
}
$messtmp .= "<br><br><a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
$messtmp .= "";
if ( $err == "" )
{
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}" );
exit( );
}
include( $hautpage );
echo "<div align=center class=big1>\n";
echo "{$messtmp}";
echo "</div>\n";
break;
case "creer_fichier" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
$err = "";
$messtmp = "";
$nomfic = traite_nom_fichier( $nomfic );
if ( $nomfic == "" )
{
$messtmp .= "{$mess['37']}";
$err = 1;
}
else if ( file_exists( "{$racine}/{$rep}/{$nomfic}" ) )
{
$messtmp .= "{$mess['71']}";
$err = 1;
}
else
{
$fp = fopen( "{$racine}/{$rep}/{$nomfic}", "w" );
if ( eregi( "\\.html\$", $nomfic ) || eregi( "\\.htm\$", $nomfic ) )
{
fputs( $fp, "<html>\n<head>\n<title>Document sans titre</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n</head>\n<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n\n</body>\n</html>\n" );
}
fclose( $fp );
$messtmp .= "{$mess['34']} <b>{$nomfic}</b> {$mess['39']} <b>";
if ( $rep == "" )
{
$messtmp .= "/";
}
else
{
$messtmp .= "{$rep}";
}
$messtmp .= "</b>";
}
$messtmp .= "<br><br><a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
$messtmp .= "";
if ( $err == "" )
{
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}" );
exit( );
}
include( $hautpage );
echo "<div align=center class=big1>\n";
echo "{$messtmp}";
echo "</div>\n";
break;
case "upload" :
ob_start( );
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
$messtmp = "";
if ( $rep != "" )
{
$rep_source = "/{$rep}";
}
$destination = $racine.$rep_source;
if ( $userfile_size != 0 )
{
$taille_ko = $userfile_size / 1024;
}
else
{
$taille_ko = 0;
}
if ( $userfile == "none" )
{
$message = $mess[31];
}
if ( $userfile != "none" && $userfile_size != 0 )
{
if ( !copy( $userfile, "{$destination}/{$userfile_name}" ) )
{
$message = "<br>{$mess['33']}<br>{$userfile_name}";
}
else
{
if ( is_editable( $userfile_name ) )
{
enlever_controlm( "{$destination}/{$userfile_name}" );
}
$message = "{$mess['34']} <b>{$userfile_name}</b> {$mess['35']} <b>{$rep}</b>";
if ( $SMS_REMIND == "on" || $SMS2_REMIND == "on" )
{
if ( $DISK_TYPE == "1" )
{
$query = "SELECT * from USER";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$TO_ID_STR .= $ROW['USER_ID'].",";
}
}
else if ( $DISK_TYPE == "2" )
{
$query = "SELECT * from USER where DEPT_ID={$DEPT_ID}";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$TO_ID_STR .= $ROW['USER_ID'].",";
}
}
else
{
$TO_ID_STR = $USER_ID;
}
$query = "select * from USER where USER_ID='{$LOGIN_USER_ID}'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_NAME = $ROW['USER_NAME'];
}
$SMS_CONTENT = $USER_NAME."在网络硬盘".$DISK_NAME."/".$rep."上传文件:".$userfile_name;
}
if ( $SMS_REMIND == "on" )
{
send_sms( "", $LOGIN_USER_ID, $TO_ID_STR, 17, $SMS_CONTENT );
}
if ( $SMS2_REMIND == "on" )
{
send_mobile_sms_user( "", $LOGIN_USER_ID, $TO_ID_STR, $SMS_CONTENT, 17 );
}
}
}
$messtmp .= "{$message}<br>";
$messtmp .= "<br><br><a href=\"netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&id={$id}&ordre={$ordre}&sens={$sens}\"><span class=Big1>{$mess['32']}</span></a>";
$messtmp .= "";
ob_end_clean( );
header( "Location:netdisk.php?DISK_ID={$DISK_ID}&rep={$rep}&ordre={$ordre}&sens={$sens}&id={$id}" );
exit( );
case "deconnexion" :
if ( !connecte( $id ) )
{
header( "Location:netdisk.php" );
exit( );
}
if ( file_exists( "logs/{$id}.php" ) )
{
unlink( "logs/{$id}.php" );
}
$now = time( );
$eff = $now - 86400;
$handle = opendir( "logs" );
while ( $fichier = readdir( $handle ) )
{
if ( $fichier != "." && $fichier != ".." )
{
$tmp = filemtime( "logs/{$fichier}" );
if ( $tmp < $eff )
{
unlink( "logs/{$fichier}" );
}
}
}
closedir( $handle );
header( "Location:netdisk.php" );
break;
default :
include( $hautpage );
lister_rep( $nom_rep );
if ( find_id( $NEW_USER, $LOGIN_USER_ID ) )
{
$NEW_PRIV = 1;
}
if ( find_id( $MANAGE_USER, $LOGIN_USER_ID ) )
{
$MANAGE_PRIV = 1;
}
if ( !( $NEW_PRIV == 1 || $MANAGE_PRIV == 1 ) )
{
break;
}
echo "\t<table border=\"0\" cellspacing=\"1\" width=\"95%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=center>\r\n\t<tr>\r\n\t<td class=\"TableHeader\" colspan=\"2\">\r\n\t<b>当前目录:";
if ( $rep == "" )
{
echo $DISK_NAME;
}
else
{
echo $DISK_NAME."/".$rep;
}
echo "</b>\r\n\t</td>\r\n\t</tr>\r\n\r\n";
if ( $NEW_PRIV == 1 )
{
echo "<tr class=TableContent>\n";
echo "<td width=150><img src=\"images/upload.gif\" align=\"ABSMIDDLE\"> \n";
echo "{$mess['25']}</td><td>";
echo "<form enctype=\"multipart/form-data\" action=\"netdisk.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
echo " \n";
echo "<input type=\"file\" class=BigInput size=40 name=\"userfile\" size=\"30\">\n";
echo "<INPUT TYPE=\"hidden\" name=\"action\" value=\"upload\">\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=BigButton name=\"Submit\" value=\"{$mess['27']}\">\n";
echo "</td></tr>\n";
echo " <tr class=TableContent>\r\n <td nowrap><img src=\"/images/menu/sms.gif\" align=\"ABSMIDDLE\"> 使用短信提醒用户:</td>\r\n <td>\r\n <input type=\"checkbox\" name=\"SMS_REMIND\" id=\"SMS_REMIND\"><label for=\"SMS_REMIND\">使用内部短信提醒用户</label>\r\n";
$query = "select * from SMS2_PRIV";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$TYPE_PRIV = $ROW['TYPE_PRIV'];
}
if ( find_id( $TYPE_PRIV, 17 ) )
{
echo " <input type=\"checkbox\" name=\"SMS2_REMIND\" id=\"SMS2_REMIND\"><label for=\"SMS2_REMIND\">使用手机短信提醒用户</label>\r\n";
}
echo " </td>\r\n </tr>\r\n";
echo "</form>\n";
}
if ( $MANAGE_PRIV == 1 )
{
echo "<tr class=TableContent><td>\n";
echo "<img src=\"images/defaut.gif\" align=\"ABSMIDDLE\">\n";
echo "{$mess['28']}</td><td>";
echo "<form method=\"post\" action=\"netdisk.php\">\n";
echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
echo " \n";
echo "<input type=\"text\" class=BigInput name=\"nomfic\" size=\"30\">\n";
echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"creer_fichier\">\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=BigButton name=\"Submit\" value=\"{$mess['29']}\">\n";
echo "</td></tr></form>\n";
echo "<tr class=TableContent><td>\n";
echo "<img src=\"images/dossier.gif\" align=\"ABSMIDDLE\">\n";
echo "{$mess['26']}</td><td>";
echo "<form method=\"post\" action=\"netdisk.php\">\n";
echo "<input type=\"hidden\" name=\"DISK_ID\" value=\"{$DISK_ID}\">\n";
echo " \n";
echo "<input type=\"text\" class=BigInput name=\"nomdir\" size=\"30\">\n";
echo "<input type=\"hidden\" name=\"rep\" value=\"{$rep}\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"mkdir\">\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=BigButton ame=\"Submit\" value=\"{$mess['29']}\">\n";
echo "</td></tr></form>\n";
}
echo "</table>";
break;
}
echo "\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -