WHAT DO YOU THINK,
WE ARE STUPID? " ;
$dir = "" ; return 0 ;
} ;
$file = $_POST['file'] ;
if (preg_match("/\.\./",$file,$matches)) {
print "
" ; filebrowse() ; } ; if($action == "mkfile") { $file = $file . $_POST['ext'] ; print "Making $file" ; touch("$topdir/$dir/$file") ; print "
" ;
filebrowse() ;
} ;
if($submode == "browse") { $submode = "browse" ; filebrowse() ; } ;
if($submode == "") { $submode = "browse" ; filebrowse() ; } ;
if($submode == "delete") { deletefile() ; filebrowse() ; } ;
if($submode == "upload") { uploadfile() ; filebrowse() ; } ;
if($submode == "edit") { editfile() ; } ;
if($submode == "htmledit") { editfile() ; } ;
} ;
function deletefile() {
global $systemname, $database, $dbhost, $dblogin, $dbpassword, $sitelogin, $mode, $submode, $action, $script, $topdir, $dir ;
$file = $_POST['file'] ;
print "Deleting $topdir/$dir/$file
" ;
rename("$topdir/$dir/$file","$topdir/$dir/$file.del") ;
} ;
function editfile() {
global $systemname, $database, $dbhost, $dblogin, $dbpassword, $sitelogin, $mode, $submode, $action, $script, $topdir, $dir ;
$file = $_POST['file'] ;
if($action == "Save") {
$data = stripslashes($_POST['filedata']) ;
$zfile = fopen("$topdir/$dir/$file","w") ;
fputs($zfile,"$data") ;
fclose($zfile) ;
} ;
$data = "" ;
$zfile = fopen("$topdir/$dir/$file","r") ;
if(!($zfile)) {
print "
" ;
} else {
while(!feof($zfile)) {
$data .= fgets($zfile,512) ;
} ;
fclose ($zfile) ;
} ;
print << " ;
} else {
$html = "" ;
$textfilename = "$topdir/$dirz/$filename/index.html" ;
$textfile = @fopen("$textfilename","r") ;
if(!($textfile)) {
// print " " ;
} else {
$textfile = @fopen("$textfilename","r") ;
while(!feof($textfile)) {
$html .= fgets($textfile,512) ;
} ;
fclose ($textfile) ;
} ;
$iii = " " ;
# } else {
# $textfile = @fopen("$textfilename","r") ;
# while(!feof($textfile)) {
# $html .= fgets($textfile,512) ;
# } ;
# if(strlen($html) > 200) { $html = substr("$html",0,180) . "..." ; } ;
# fclose ($textfile) ;
# } ;
$zpage = intval(($i / $toshow) + 1) ;
if (
preg_match("/(.*).html$/",$filename,$matches)
or preg_match("/(.*).txt$/",$filename,$matches)
or preg_match("/(.*).htm$/",$filename,$matches)
or preg_match("/(.*).css$/",$filename,$matches)
) {
$files .= "  
The Web based HTML editor is useful, but eccentric. It specifically will not recognize and save the
tags that CybrMall uses in template.html.
" ;
# print "
$dir
EOF
;
} ;
function filebrowse() {
global $systemname, $database, $dbhost, $dblogin, $dbpassword, $sitelogin, $mode, $submode, $action, $script, $topdir, $dir ;
$servername = $_SERVER['SERVER_NAME'] ;
print "Be careful, think.. you can do things here you probably should not. GeekLabs/CybrMall is NOT responsible for changes you make in this or FTP mode.
" ;
$across = 2 ;
$down = 30 ;
$toshow = $across * $down ;
$i = 1 ; $ac = 1 ;
$page = $_POST['page'] ;
if ($page < 1) { $page = 1 ; } ;
$files = "" ;
$dirs = "" ;
if (strlen($dir) > 1 ) {
$dirs .= "
" ;
$archivedir->close() ;
print "$dirs $pageline $files $pageline" ;
if ($_SERVER['PHP_AUTH_USER'] != "guest") {
print << " ;
if (preg_match("/(.*)\/(.*)/",$dir,$dd)) {
$dirminus = $dd[1] ;
$dirs .= "![]()
top " ;
} ;
$dirs .= "![]()
$dirminus " ;
} ;
$archivedir = dir("$topdir$dir") ;
$d = "$topdir$dir" ;
$files .= "\n ![]()
$dir
" ;
$dirs .= "\n" ;
while (FALSE !== ($filename = $archivedir->read())) {
//IF DIRECTORY
if (@filetype("$d/$filename") == "dir" and !preg_match("/(.*).del$/",$filename,$matches) ) {
if($filename == "." or $filename == "..") { } else {
if (strlen($dir) > 1) { $dirz = "$dir/" ; } else { $dirz = "" ; } ;
$ii = @fopen("$topdir/$dirz/$filename/s-index.jpg","r") ;
if(!($ii)) {
#$iii = "$topdir/$dirz/$filename/s-index.jpg" ;
$iii = "" ;
$html = "" ;
//print " error 401f - file $textfilename not found
error 401f - file $textfilename not found
" ;
} ;
$dirs .= " " ;
} ;
} ;
//IF SMALL IMAGE
# if (preg_match("/s-(.*).jpg/",$filename,$matches)) {
if (
preg_match("/(.*).html$/",$filename,$matches)
or preg_match("/(.*).txt$/",$filename,$matches)
or preg_match("/(.*).htm$/",$filename,$matches)
or preg_match("/(.*).pdf$/",$filename,$matches)
or preg_match("/(.*).doc$/",$filename,$matches)
or preg_match("/(.*).jpg$/",$filename,$matches)
or preg_match("/(.*).png$/",$filename,$matches)
or preg_match("/(.*).gif$/",$filename,$matches)
or preg_match("/(.*).css$/",$filename,$matches)
) {
if ($i >= (($page * $toshow) - $toshow) and $i < ($page * $toshow)) {
$file = $matches[1] ;
$file = $filename ;
$html = "" ;
# $textfilename = "$d/$file.html" ;
# $textfile = @fopen("$textfilename","r") ;
# if(!($textfile)) {
# //print " ![]()
$filename $iii $html [ rmdir ] error 401f - file $textfilename not found
delete html/edit " ;
} ;
if (
preg_match("/(.*).pdf$/",$filename,$matches)
or preg_match("/(.*).doc$/",$filename,$matches)
or preg_match("/(.*).jpg$/",$filename,$matches)
or preg_match("/(.*).png$/",$filename,$matches)
or preg_match("/(.*).gif$/",$filename,$matches)
) {
$files .= "![]()
delete " ;
} ;
$files .= "![]()
$file " ;
if ($ac < $across){ } else { $ac = 0 ; $files .= "\n
$html" ; } ;
$ac++ ;
} ;
$i++ ;
} ;
} ;
$files .= " " ;
$pages = ($i / $toshow) + 1 ;
$p = 1 ;
$l = $page - 1 ; if ($l < 1) { $l = 1 ; } ;
$pageline = "\n\n$dir
\n\n" ;
$files .= "Page: " ;
while ($p <= $pages ) {
if ($p == $page) {
$pageline .= "![]()
$p " ;
} else {
$pageline .= "$p " ;
} ;
$p++ ;
} ;
$r = $page + 1 ; if ($r > $pages) { $r = 1 ; } ;
$pageline .= "![]()
Notes:
You may be able to use your Web Browser to browse all files in FTP mode.
This is especially dangerous, and GeekLabs/CybrMall is not responsible
for the things you do in the FileManager or via FTP (File Transfer Protocol).
Only MSIE will allow you to UPLOAD via the web browser. Uploading: n: $name s: $size t: $tempz u: $uploadfile
Uploading: n: $name s: $size - " ;
if (move_uploaded_file($tempz, $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
# @unlink("files/s-$name") ;
# system("/usr/bin/convert -quality 75 -geometry 150x120 $topdir/$dir/$name $topdir/$dir/s-$name") ;
# @unlink("files/m-$name") ;
# system("/usr/bin/convert -quality 85 -geometry 320x240 $topdir/$dir/$name $topdir/$dir/m-$name") ;
# @unlink("files/a-$name") ;
# system("/usr/bin/convert -quality 85 -geometry 640x480 $topdir/$dir/$name $topdir/$dir/a-$name") ;
# print "Here's some more debugging info:\n";
# print_r($_FILES);
} else {
print "File upload Error \nNote: File size limited \n\n" ;
} ;
} ;
?>
\n";
print_r($_FILES);
print "
\n" ;
}
print "