<?php
if (!defined('_ECRIRE_INC_VERSION')) return;

function action_creer_bien_dist(){
	$securiser_action = charger_fonction('securiser_action', 'inc');
	$arg = $securiser_action();
	$id_article = intval($arg);

	include_spip('inc/autoriser');
	if (! autoriser("creer","article")) {
		return false;
	}
	if (!$id_article) {
		$id_rubrique = lire_config('balint/id_bien');
		include_spip('action/editer_article');
		$set = array(
			'statut' => 'publie'
		);
		$id_article = article_inserer($id_rubrique,$set);
		include_spip('inc/invalideur');
		suivre_invalideur("id='id_article/$id_article'");
	}

	// redirection sur la création de la vidéo
	$retour = 'spip.php?page=editer_bien&id_article='.$id_article;
	include_spip('inc/headers');
	redirige_par_entete($retour);
}

