Exemplo n.º 1
0
/**
 * @return String
 * @desc Saves the blosxom post to file and returns the new filename.
 */
function blosxom_save($file, $str)
{
    global $config, $javascript_msg;
    if (stristr($_SESSION['plugin_blosxom_pwd'], $config['plugins'][$_SESSION['plugin']]['datadir']) !== false) {
        save_to_server($_SESSION['plugin_blosxom_pwd'] . $_SESSION['filename'], $str);
        $javascript_msg = 'blosxom post saved successfully.';
        return $file;
    } else {
        $javascript_msg = '@Couldn\'t save your post because it was outside your blog\'s data directory.';
        return $file;
    }
}
Exemplo n.º 2
0
             $_SESSION['operation'] = 'new';
             break;
     }
 } else {
     if ($_SESSION['operation'] == 'save') {
         switch ($_SESSION['save_type']) {
             case 'client':
                 require_once 'locations/server.php';
                 require_once 'locations/client.php';
                 save_to_client($_SESSION['display_filename'], $_POST['wp_document']);
                 $wp_document = $_POST['wp_document'];
                 break;
             case 'server':
                 require_once 'locations/server.php';
                 verify_secure_file($_SESSION['filename'], $config['home_dir']);
                 save_to_server($_SESSION['filename'], $_POST['wp_document']);
                 $wp_document = $_POST['wp_document'];
                 break;
             case 'ftp':
                 require_once 'locations/ftp.php';
                 $server = $config['ftp_servers'][$_SESSION['ftp']];
                 save_to_ftp($server['host'], $server['port'], $server['pasv'], $server['username'], $server['password'], $_SESSION['filename'], $_POST['wp_document']);
                 $wp_document = $_POST['wp_document'];
                 break;
             case 'plugin':
                 if (is_readable('plugins/' . $config['plugins'][$_SESSION['plugin']]['type'] . '/code.php')) {
                     require_once 'plugins/' . $config['plugins'][$_SESSION['plugin']]['type'] . '/code.php';
                     eval($config['plugins'][$_SESSION['plugin']]['type'] . '_save($_POST[\'filename\'], $_POST[\'wp_document\']);');
                 }
                 $wp_document = $_POST['wp_document'];
                 break;