예제 #1
0
                }
            }
        }
        if ($error === null) {
            require "classes/class.upload.php";
            $my_uploader = new uploader();
            $my_uploader->max_filesize(ini_maxupload());
            $my_uploader->file_types($supportedextentions);
            $my_uploader->set_path($path);
            if ($my_uploader->upload('file')) {
                $my_uploader->save_file();
            }
            if ($my_uploader->upload_failed()) {
                $error = $my_uploader->get_error();
            }
            $image_file = $path . $my_uploader->fileinfo('filename');
            if (!file_exists($image_file)) {
                $error = $lang->phrase('admin_cms_file_does_not_exist');
            }
            $image_file = str_replace(realpath($config['fpath']) . DIRECTORY_SEPARATOR, '', $image_file);
            $image_file = str_replace(DIRECTORY_SEPARATOR, '/', $image_file);
        }
    }
    $filesize = formatFilesize(ini_maxupload());
    $htmlhead .= '<script type="text/javascript" src="templates/editor/wysiwyg-popup.js"></script>';
    echo head(' onLoad="loadImage();"');
    ?>
<form method="post" action="admin.php?action=cms&amp;job=doc_insert_image&amp;wysiwyg=<?php 
    echo $wysiwyg;
    ?>
" enctype="multipart/form-data">
예제 #2
0
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($filesize);
     $my_uploader->file_types($filetypes);
     $my_uploader->set_path($dir . DIRECTORY_SEPARATOR);
     if (isset($imgwidth) && isset($imgheight)) {
         $my_uploader->max_image_size($imgwidth, $imgheight);
     }
     if ($my_uploader->upload('upload_' . $i)) {
         $my_uploader->save_file();
     }
     if ($my_uploader->upload_failed()) {
         array_push($inserterrors, $my_uploader->get_error());
     }
     $file = $dir . DIRECTORY_SEPARATOR . $my_uploader->fileinfo('filename');
     if (!file_exists($file)) {
         $inserterrors[] = $lang->phrase('admin_explorer_file_does_not_exist');
     } else {
         $success++;
     }
 }
 echo head();
 if ($success == 0) {
     $inserterrors[] = $lang->phrase('admin_explorer_no_file_successfully_uploaded');
 }
 if (count($inserterrors) > 0) {
     error($url, $inserterrors);
 } else {
     if ($cfg == 'captcha_fonts') {
         $n = 1;
예제 #3
0
 $type = $gpc->get('type', int);
 if ($type == 1) {
     $filetypes = array('zip', 'sql');
     $dir = 'temp/';
     $inserterrors = array();
     require "classes/class.upload.php";
     if (empty($_FILES['upload']['name'])) {
         $inserterrors[] = 'No file specified.';
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize(ini_maxupload());
     $my_uploader->file_types($filetypes);
     $my_uploader->set_path($dir);
     if ($my_uploader->upload('upload')) {
         if ($my_uploader->save_file()) {
             $file = $dir . $my_uploader->fileinfo('filename');
             if (!file_exists($file)) {
                 $inserterrors[] = 'File (' . $file . ') does not exist.';
             }
         }
     }
     if ($my_uploader->upload_failed()) {
         array_push($inserterrors, $my_uploader->get_error());
     }
     if (count($inserterrors) > 0) {
         error('admin.php?action=db&job=query', $inserterrors);
     } else {
         $ext = get_extension($file);
         if (($ext == 'zip' || $ext == 'sql') && file_exists($file)) {
             if ($ext == 'zip') {
                 require_once 'classes/class.zip.php';
예제 #4
0
 if ($my->p['usepic'] == 0) {
     errorLogin($lang->phrase('not_allowed'), "editprofile.php");
 }
 $error = array();
 if (isset($_FILES) && is_array($_FILES['upload']) && !empty($_FILES['upload']['name'])) {
     require "classes/class.upload.php";
     $my_uploader = new uploader();
     $my_uploader->max_filesize($config['avfilesize']);
     $my_uploader->max_image_size($config['avwidth'], $config['avheight']);
     $my_uploader->file_types(explode(',', $config['avfiletypes']));
     $my_uploader->set_path('uploads/pics/');
     $my_uploader->rename_file($my->id);
     if ($my_uploader->upload('upload')) {
         removeOldImages('uploads/pics/', $my->id);
         if ($my_uploader->save_file()) {
             $my->pic = 'uploads/pics/' . $my_uploader->fileinfo('filename');
         }
     }
     if ($my_uploader->upload_failed()) {
         $error[] = $my_uploader->get_error();
     }
 } elseif (!empty($pic) && preg_match(URL_REGEXP, $pic)) {
     $my->pic = checkRemotePic($pic, $my->id);
     switch ($my->pic) {
         case REMOTE_INVALID_URL:
             $error[] = $lang->phrase('editprofile_pic_error1');
             $my->pic = '';
             break;
         case REMOTE_CLIENT_ERROR:
             $error[] = $lang->phrase('editprofile_pic_error2');
             $my->pic = '';
예제 #5
0
 require "classes/class.upload.php";
 ($code = $plugins->load('attachments_upload_save_add_start')) ? eval($code) : null;
 for ($i = 0; $i < $config['tpcmaxuploads']; $i++) {
     $field = "upload_{$i}";
     if (empty($_FILES[$field]['name'])) {
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($config['tpcfilesize']);
     $my_uploader->max_image_size($config['tpcwidth'], $config['tpcheight']);
     $my_uploader->file_types(explode(',', $config['tpcfiletypes']));
     $my_uploader->set_path('uploads/topics/');
     ($code = $plugins->load('attachments_upload_add_prepare')) ? eval($code) : null;
     if ($my_uploader->upload($field)) {
         if ($my_uploader->save_file()) {
             array_push($insertuploads, array('file' => $my_uploader->fileinfo('name'), 'source' => $my_uploader->fileinfo('filename')));
         }
     }
     if ($my_uploader->upload_failed()) {
         array_push($inserterrors, $my_uploader->get_error());
     }
 }
 if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
     $upper = $upinfo['name'];
     $tid = $upinfo['id'];
 } else {
     $upper = $my->id;
     $tid = 0;
 }
 ($code = $plugins->load('attachments_upload_save_add_queries')) ? eval($code) : null;
 if (count($insertuploads) > 0 && count($insertuploads) <= $config['tpcmaxuploads']) {
예제 #6
0
    }
    // upload file
    $error = null;
    if (!empty($_FILES['file']['name'])) {
        require "classes/class.upload.php";
        $my_uploader = new uploader();
        $my_uploader->max_filesize(ini_maxupload());
        $my_uploader->file_types($supportedextentions);
        $my_uploader->set_path($leadon);
        if ($my_uploader->upload('file')) {
            $my_uploader->save_file();
        }
        if ($my_uploader->upload_failed()) {
            $error = $my_uploader->get_error();
        }
        $file = $leadon . $my_uploader->fileinfo('filename');
        if (!file_exists($file)) {
            $error = $lang->phrase('admin_cms_file_does_not_exist');
        }
    }
    $htmlhead .= '<script type="text/javascript" src="templates/editor/wysiwyg-popup.js"></script>';
    $htmlhead .= '<script type="text/javascript" src="templates/editor/wysiwyg-color.js"></script>';
    $htmlhead .= '<script type="text/javascript"> function onloader() { WYSIWYG_ColorInst.init(); loadImage(); } </script>';
    echo head(' onLoad="onloader();"');
    ?>
<form method="post" action="admin.php?action=cms&amp;job=doc_insert_image&amp;wysiwyg=<?php 
    echo $wysiwyg;
    ?>
" enctype="multipart/form-data">
<input type="hidden" id="dir" name="dir" value="">
<table class="border" border="0" cellspacing="0" cellpadding="4" align="center" style="width: 700px;">
예제 #7
0
 $folders2 = array_unique($folders2);
 for ($i = 0; $i < $ups; $i++) {
     if (empty($_FILES['upload_' . $i]['name'])) {
         continue;
     }
     $my_uploader = new uploader();
     $my_uploader->max_filesize($filesize);
     if (isset($imgwidth) && isset($imgheight)) {
         $my_uploader->max_image_size($imgwidth, $imgheight);
     }
     if ($my_uploader->upload('upload_' . $i, $filetypes)) {
         $my_uploader->save_file($dir, 2);
         if ($my_uploader->return_error()) {
             $error[] = $my_uploader->return_error();
         } else {
             $has_upload = $gpc->save_str($my_uploader->fileinfo('name'));
         }
     } else {
         $error[] = $my_uploader->return_error();
     }
 }
 if (strlen($gpc->get('code', str)) < 2) {
     $error[] = 'Code ist zu kurz';
 }
 if (!$has_upload && strlen($img) < 5) {
     $error[] = 'Imagepfad zu kurz';
 }
 if (strlen($gpc->get('show', int)) != 1 && $gpc->get('show', int) != 0) {
     $error[] = 'Falsche Angabe(n)';
 }
 if (count($error) > 0) {
예제 #8
0
     $inserterrors[] = 'You have not specified a title.';
 }
 if (count($inserterrors) == 0 && !empty($_FILES['upload']['name'])) {
     require "classes/class.upload.php";
     $dir = realpath('./classes/cron/jobs/');
     $my_uploader = new uploader();
     $my_uploader->max_filesize(100 * 1024);
     $my_uploader->file_types(array('php'));
     $my_uploader->set_path($dir . DIRECTORY_SEPARATOR);
     if ($my_uploader->upload('upload')) {
         $my_uploader->save_file();
     }
     if ($my_uploader->upload_failed()) {
         array_push($inserterrors, $my_uploader->get_error());
     } else {
         $filename = $my_uploader->fileinfo('filename');
     }
     if (empty($filename) || !file_exists('classes/cron/jobs/' . $filename)) {
         $inserterrors[] = 'File could not be uploaded.';
     }
 }
 if (count($inserterrors) > 0) {
     error('admin.php?action=cron&job=add', $inserterrors);
 } else {
     if ($minute > -60 && $minute < -1) {
         $minute *= -1;
         $minute = "*/{$minute}";
     } elseif ($minute >= 0 && $minute < 60) {
     } else {
         $minute = '*';
     }