Example #1
0
$page_title = htmlspecialchars($path);
require $GO_THEME->theme_path . 'header.inc';
echo $popup_feedback;
echo '<form name="filesystem" method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data">';
echo '<input type="hidden" name="path" value="' . $path . '" />';
echo '<input type="hidden" name="return_to_path" value="' . $return_to_path . '" />';
echo '<input type="hidden" name="share_path" />';
switch ($task) {
    case 'mail_files':
        $_SESSION['attach_array'] = array();
        $_SESSION['num_attach'] = 0;
        require $email_module['class_path'] . "email.class.inc";
        $email = new email();
        if (isset($_POST['files'])) {
            while ($file = smartstrip(array_shift($_POST['files']))) {
                if ($fs->has_read_permission2($GO_SECURITY->user_id, $file)) {
                    $tmp_file = $GO_CONFIG->tmpdir . md5(uniqid(time()));
                    if ($fs->chroot_copy_r2($file, $tmp_file)) {
                        $filename = basename($file);
                        $extension = get_extension($filename);
                        if (!($type = $filetypes->get_type($extension))) {
                            $type = $filetypes->add_type($extension);
                        }
                        $email->register_attachment($tmp_file, $filename, $fs->chroot_filesize($file), $type['mime']);
                    }
                } else {
                    $popup_feedback .= access_denied_box(basename($file));
                }
            }
            echo '<script type="text/javascript" language="javascript">';
            echo 'popup("' . $email_module['url'] . 'send.php?email_file=true","' . $GO_CONFIG->composer_width . '","' . $GO_CONFIG->composer_height . '");';