Rev 1773 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
$options = getopt("hiou:d:e:p:FU:P:",array("help", "images", "obs", "user:", "domain:", "email:", "pass:", "flush", "upload:", "phpsessid"));
if(isset($options['h']) || isset($options['help'])) {
die(basename(__FILE__) . ' -i|--images -o|--obs [-u|--user = 22506] [-d|--domain = http://cel]');
}
define('USER', isset($options['u']) ? $options['u'] : (isset($options['user']) ? $options['user'] : 22506));
define('DOMAIN', isset($options['d']) ? $options['d'] : (isset($options['domain']) ? $options['domain'] : 'http://cel'));
define('EMAIL', isset($options['e']) ? $options['e'] : (isset($options['email']) ? $options['email'] : NULL));
define('PASS', isset($options['p']) ? $options['p'] : (isset($options['pass']) ? $options['pass'] : NULL));
define('COOKIE', isset($options['P']) ? $options['P'] : (isset($options['phpsessid']) ? $options['phpsessid'] : NULL));
// API::auth() define()'s COOKIE
require_once('api.php');
if(isset($options['o']) || isset($options['obs']) || isset($options['F']) || isset($options['flush'])) {
cel_delete_all_obs();
}
if(isset($options['i']) || isset($options['images']) || isset($options['F']) || isset($options['flush'])) {
cel_delete_all_images();
}
$upload = isset($options['U']) ? $options['U'] : (isset($options['upload']) ? $options['upload'] : NULL);
if($upload) cel_upload_image($upload);
if(! COOKIE) { if(!auth()) die('no auth'); }
// $csv = genCSV(array('ordre' => 1, 'Date' => '23/06/1991', 'rien' => 'rien'));
var_dump(getCSV_line(export(), 1));