netdisk.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 1,855 行 · 第 1/5 页
PHP
1,855 行
<?
function get_basename ($file_path)
{
if (strstr ($file_path, '/'))
{
$filename = substr ($file_path, (strrpos ($file_path, '/') + 1));
}
else
{
if (strstr ($file_path, '\\'))
{
$filename = substr ($file_path, (strrpos ($file_path, '\\') + 1));
}
else
{
$filename = $file_path;
}
}
return $filename;
}
function get_filesize ($filename)
{
return sprintf ('%u', filesize ($filename));
}
function connecte ($id)
{
global $installurl;
global $users;
global $HTTP_REFERER;
$retour = 0;
if (($users == 0))
{
$retour = 1;
}
else
{
if (($id != ''))
{
if (file_exists ((((''.'logs/').$id).'.php')))
{
$retour = 1;
}
if (!eregi ((''.$installurl), $HTTP_REFERER))
{
$retour = 0;
}
}
}
return $retour;
}
function is_editable ($fichier)
{
$retour = 0;
if (eregi ((''.'\\.log$|\\.bat$|\\.txt$|\\.sql$|\\.php$|\\.jsp$|\\.asp$|\\.ini$|\\.phtml$|\\.cgi$|\\.pl$|\\.js$|\\.css$|\\.inc$'), $fichier))
{
$retour = 1;
}
return $retour;
}
function creer_id ($chemin, $url, $user)
{
global $id;
$taille = 20;
$lettres = 'abcdefghijklmnopqrstuvwxyz0123456789';
srand (time ());
for ($i = 0; ($i < $taille); ++$i)
{
($id .= substr ($lettres, (rand () % strlen ($lettres)), 1));
}
$fp = fopen ((((''.'logs/').$id).'.php'), 'w');
if ($fp)
{
fputs ($fp, (((((((''.'<? $racine="').$chemin).'"; $url_racine="').$url).'"; $user="').$user).'"; ?>'));
fclose ($fp);
}
else
{
exit ();
}
}
function taille ($fichier)
{
global $size_unit;
$taille = get_filesize ($fichier);
if ((1073741824 <= $taille))
{
$taille = (((round ((($taille / 1073741824) * 100)) / 100).' G').$size_unit);
}
else
{
if ((1048576 <= $taille))
{
$taille = (((round ((($taille / 1048576) * 100)) / 100).' M').$size_unit);
}
else
{
if ((1024 <= $taille))
{
$taille = (((round ((($taille / 1024) * 100)) / 100).' K').$size_unit);
}
else
{
$taille = (($taille.' ').$size_unit);
}
}
}
if (($taille == 0))
{
$taille = '-';
}
return $taille;
}
function date_modif ($fichier)
{
$tmp = filemtime ($fichier);
return date ('Y-m-d H:i:s', $tmp);
}
function mimetype ($fichier, $quoi)
{
global $mess;
global $HTTP_USER_AGENT;
if (!eregi ('MSIE', $HTTP_USER_AGENT))
{
$client = 'netscape.gif';
}
else
{
$client = 'html.gif';
}
if (is_dir ($fichier))
{
$image = 'dossier.gif';
$nom_type = $mess[8];
}
else
{
if (eregi ((''.'\\.mid$'), $fichier))
{
$image = 'mid.gif';
$nom_type = $mess[9];
}
else
{
if (eregi ((''.'\\.txt$'), $fichier))
{
$image = 'txt.gif';
$nom_type = $mess[10];
}
else
{
if (eregi ((''.'\\.ini$'), $fichier))
{
$image = 'txt.gif';
$nom_type = $mess[10];
}
else
{
if (eregi ((''.'\\.log$'), $fichier))
{
$image = 'txt.gif';
$nom_type = $mess[10];
}
else
{
if (eregi ((''.'\\.bat$'), $fichier))
{
$image = 'txt.gif';
$nom_type = $mess[10];
}
else
{
if (eregi ((''.'\\.sql$'), $fichier))
{
$image = 'txt.gif';
$nom_type = $mess[10];
}
else
{
if (eregi ((''.'\\.js$'), $fichier))
{
$image = 'js.gif';
$nom_type = $mess[11];
}
else
{
if (eregi ((''.'\\.gif$'), $fichier))
{
$image = 'gif.gif';
$nom_type = $mess[12];
}
else
{
if (eregi ((''.'\\.jpg$'), $fichier))
{
$image = 'jpg.gif';
$nom_type = $mess[13];
}
else
{
if (eregi ((''.'\\.html$'), $fichier))
{
$image = $client;
$nom_type = $mess[14];
}
else
{
if (eregi ((''.'\\.htm$'), $fichier))
{
$image = $client;
$nom_type = $mess[15];
}
else
{
if (eregi ((''.'\\.rar$'), $fichier))
{
$image = 'rar.gif';
$nom_type = $mess[60];
}
else
{
if (eregi ((''.'\\.gz$'), $fichier))
{
$image = 'zip.gif';
$nom_type = $mess[61];
}
else
{
if (eregi ((''.'\\.tgz$'), $fichier))
{
$image = 'zip.gif';
$nom_type = $mess[61];
}
else
{
if (eregi ((''.'\\.z$'), $fichier))
{
$image = 'zip.gif';
$nom_type = $mess[61];
}
else
{
if (eregi ((''.'\\.ra$'), $fichier))
{
$image = 'ram.gif';
$nom_type = $mess[16];
}
else
{
if (eregi ((''.'\\.ram$'), $fichier))
{
$image = 'ram.gif';
$nom_type = $mess[17];
}
else
{
if (eregi ((''.'\\.rmvb$'), $fichier))
{
$image = 'ram.gif';
$nom_type = $mess[17];
}
else
{
if (eregi ((''.'\\.rm$'), $fichier))
{
$image = 'ram.gif';
$nom_type = $mess[17];
}
else
{
if (eregi ((''.'\\.pl$'), $fichier))
{
$image = 'pl.gif';
$nom_type = $mess[18];
}
else
{
if (eregi ((''.'\\.zip$'), $fichier))
{
$image = 'zip.gif';
$nom_type = $mess[19];
}
else
{
if (eregi ((''.'\\.wav$'), $fichier))
{
$image = 'wav.gif';
$nom_type = $mess[20];
}
else
{
if (eregi ((''.'\\.php$'), $fichier))
{
$image = 'php.gif';
$nom_type = $mess[22];
}
else
{
if (eregi ((''.'\\.phtml$'), $fichier))
{
$image = 'php.gif';
$nom_type = $mess[22];
}
else
{
if (eregi ((''.'\\.exe$'), $fichier))
{
$image = 'exe.gif';
$nom_type = $mess[50];
}
else
{
if (eregi ((''.'\\.bmp$'), $fichier))
{
$image = 'bmp.gif';
$nom_type = $mess[56];
}
else
{
if (eregi ((''.'\\.png$'), $fichier))
{
$image = 'gif.gif';
$nom_type = $mess[57];
}
else
{
if (eregi ((''.'\\.css$'), $fichier))
{
$image = 'css.gif';
$nom_type = $mess[58];
}
else
{
if (eregi ((''.'\\.mp3$'), $fichier))
{
$image = 'mp3.gif';
$nom_type = $mess[59];
}
else
{
if (eregi ((''.'\\.wma$'), $fichier))
{
$image = 'mp3.gif';
$nom_type = $mess[96];
}
else
{
if (eregi ((''.'\\.wmv$'), $fichier))
{
$image = 'mp3.gif';
$nom_type = $mess[96];
}
else
{
if (eregi ((''.'\\.asf$'), $fichier))
{
$image = 'mp3.gif';
$nom_type = $mess[96];
}
else
{
if (eregi ((''.'\\.xls$'), $fichier))
{
$image = 'xls.gif';
$nom_type = $mess[64];
}
else
{
if (eregi ((''.'\\.doc$'), $fichier))
{
$image = 'doc.gif';
$nom_type = $mess[65];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?