Пример #1
0
                    ?>
        <p class="info smallspace success"><?php 
                    _e("Your service logo has been successfully changed!");
                    ?>
</p>
    <?php 
                }
            }
        } else {
            if (isset($_POST['background_upload'])) {
                // Get the file path
                $name_background_image = $_FILES['background_image_upload']['name'];
                $temp_background_image = $_FILES['background_image_upload']['tmp_name'];
                $path_background_image = JAPPIX_BASE . '/store/backgrounds/' . $name_background_image;
                // An error occured?
                if (!isSafeAllowed($name_background_image) || $_FILES['background_image_upload']['error'] || !move_uploaded_file($temp_background_image, $path_background_image)) {
                    ?>

        <p class="info smallspace fail"><?php 
                    _e("The image could not be received, would you mind retry?");
                    ?>
</p>

    <?php 
                } else {
                    if (!isImage($name_background_image)) {
                        // Remove the image file
                        if (file_exists($path_background_image)) {
                            unlink($path_background_image);
                        }
                        ?>
Пример #2
0
        $tmp_filename = $_FILES['file']['tmp_name'];
        $filename = $_FILES['file']['name'];
        // Get the location
        if (HOST_UPLOAD) {
            $location = HOST_UPLOAD . '/';
        } else {
            $location = $_POST['location'];
        }
        // Get the file new name
        $ext = getFileExt($filename);
        $new_name = preg_replace('/(^)(.+)(\\.)(.+)($)/i', '$2', $filename);
        // Define some vars
        $name = sha1(time() . $filename);
        $path = JAPPIX_BASE . '/tmp/send/' . $name . '.' . $ext;
        // Forbidden file?
        if (!isSafeAllowed($filename) || !isSafeAllowed($name . '.' . $ext)) {
            exit('<jappix xmlns=\'jappix:file:send\'>
    <error>forbidden-type</error>
    <id>' . htmlspecialchars($_POST['id']) . '</id>
</jappix>');
        }
        // File upload error?
        if (!is_uploaded_file($tmp_filename) || !move_uploaded_file($tmp_filename, $path)) {
            exit('<jappix xmlns=\'jappix:file:send\'>
    <error>move-error</error>
    <id>' . htmlspecialchars($_POST['id']) . '</id>
</jappix>');
        }
        // Return the path to the file
        exit('<jappix xmlns=\'jappix:file:send\'>
    <url>' . htmlspecialchars($location . 'server/send.php?id=' . urlencode($name) . '.' . urlencode($ext) . '&name=' . urlencode($filename)) . '</url>
Пример #3
0
        // Add the music title
        $name_music .= $_POST['music_title'];
        // Add the album name?
        if (isset($_POST['music_album']) && !empty($_POST['music_album'])) {
            // Add a form var
            $music_album = $_POST['music_album'];
            // Add the current POST var to the global string
            $name_music .= ' [' . $_POST['music_album'] . ']';
        }
        // Add the extension
        $name_music .= '.' . $ext_music;
    }
    // Music path with new name
    $path_music = JAPPIX_BASE . '/store/music/' . $name_music;
    // An error occured?
    if (!isSafeAllowed($name_music) || $_FILES['music_file']['error'] || !move_uploaded_file($temp_music, $path_music)) {
        ?>
    
        <p class="info smallspace fail"><?php 
        _e("The music could not be received, please retry!");
        ?>
</p>
    
    <?php 
    } else {
        if (!preg_match('/^(.+)(\\.(og(g|a)|mp3|wav))$/i', $name_music)) {
            // Remove the image file
            if (file_exists($path_music)) {
                unlink($path_music);
            }
            ?>