function fm_fileinfo($d)
{
    $path = $GLOBALS['prepath'] . $d;
    $file = filefrompath($path);
    if (!fm_exists($d)) {
        return FALSE;
    }
    $size = filesize($path);
    $modified = filemtime($path);
    $ext = fext($file);
    return array('name' => $file, 'bname' => endsWith($file, '/') ? substr($file, 0, -1) : $file, 'id' => file2id($file), 'isdir' => filetype($path) == 'dir', 'size' => $size, 'tsize' => textfilesize($size), 'modified' => $modified, 'tmodified' => date("M j, Y g:i:s A", $modified), 'tdmodified' => date("M j, Y", $modified), 'perms' => substr(sprintf('%o', fileperms($path)), -3), 'owner' => fileowner($path), 'group' => filegroup($path), 'ext' => $ext, 'img' => fticon($ext), 'type' => textfiletype($ext), 'ft' => ft($ext), 'writable' => fm_iswritable($d), 'isvimg' => isvimg($ext), 'imgsize' => (isvimg($ext) || $ext == 'psd' || $ext == 'bmp') && $size <= 5242880 ? @getimagesize($path) : FALSE);
}
function fm_mkdir($source, $overwrite = false)
{
    global $ftp, $ftp_prepath;
    if (!fm_ftpconnect()) {
        return false;
    }
    aphp($source);
    if (fm_exists($source)) {
        return $overwrite ? true : false;
    }
    return @ftp_mkdir($ftp, $ftp_prepath . $source);
}
Esempio n. 3
0
                         $buffer .= '<strong style="color:#F00;">Failed, file/folder already exists</strong>';
                         $redir = false;
                     } else {
                         $buffer .= '<strong style="color:#F00;">Failed, permission error</strong>';
                         $redir = false;
                     }
                 }
             }
             if ($_SESSION['cliptype'] == 'm') {
                 $buffer .= "<tr><td>Moving '" . filefrompath($tfilen) . "'...</td><td>";
                 if (fm_rename($tfilen, $d . filefrompath($tfilen), $conflict)) {
                     $buffer .= '<strong style="color:#090;">Successful</strong>';
                     $acted[] = file2id(filefrompath($tfilen));
                     unset($_SESSION['clip'][$i]);
                 } else {
                     if (fm_exists($d . filefrompath($tfilen))) {
                         $buffer .= '<strong style="color:#F00;">Failed, file/folder already exists</strong>';
                         $redir = false;
                     } else {
                         $buffer .= '<strong style="color:#F00;">Failed, permission error</strong>';
                         $redir = false;
                     }
                 }
             }
         }
     }
 }
 if (!count($_SESSION['clip'])) {
     $_SESSION = array();
     if (isset($_COOKIE['fmclip'])) {
         setcookie('fmclip', '', time() - 42000, '/');
Esempio n. 4
0
 * by Zarel of Novawave
 * Text Edit
 *
 * Used to edit text files.
 *
 * Default module - Performs important functionality,
 * but can be deleted if absolutely necessary
 * 
 */
include 'config.inc.php';
include 'fileman.lib.php';
@(include 'session.lib.php');
if (isset($_GET['c'])) {
    die('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Close this window.</title></head><body onload="window.close()">Close this window.</body></html>');
}
if (!fm_exists($d)) {
    die('File doesn\'t exist.');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title><?php 
echo htmlentities($file);
?>
 - FLV Player</title>
    <script type="text/javascript" src="addons/swfobject.js"></script>
    <style type="text/css">
    <!--
Esempio n. 5
0
function fm_unusedfilename($file)
{
    $ofile = $file;
    $i = 1;
    while (fm_exists($file)) {
        $file = addbeforeext($ofile, ' (' . $i . ')');
        $i++;
    }
    return $file;
}
function fm_mkdir($file, $overwrite = false)
{
    global $prepath;
    if (fm_exists($file)) {
        return $overwrite ? true : false;
    }
    return @mkdir($prepath . $file);
}