Subversion Repositories eFlore/Applications.cel

Rev

Rev 1840 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1840 Rev 1914
Line -... Line 1...
-
 
1
#!/usr/bin/env php
1
<?php
2
<?php
Line 2... Line 3...
2
 
3
 
3
define('DEFAULT_DOMAIN', 'http://cel');
4
define('DEFAULT_DOMAIN', 'http://cel');
Line 4... Line 5...
4
define('DEFAULT_USER', 22506);
5
define('DEFAULT_USER', 22506);
5
 
6
 
Line 6... Line 7...
6
$options = getopt("hiou:d:e:p:FU:P:",array("help", "images", "obs", "user:", "domain:", "email:", "pass:", "flush", "upload:", "phpsessid"));
7
$options = getopt("hiou:d:e:p:FU:P:D",array("help", "images", "obs", "user:", "domain:", "email:", "pass:", "flush", "upload:", "phpsessid", "debug"));
7
if(isset($options['h']) || isset($options['help'])) die(__help());
8
if(isset($options['h']) || isset($options['help'])) die(__help());
8
 
9
 
9
 
10
 
10
define('USER', isset($options['u']) ? $options['u'] : (isset($options['user']) ? $options['user'] : DEFAULT_USER));
11
define('USER', isset($options['u']) ? $options['u'] : (isset($options['user']) ? $options['user'] : DEFAULT_USER));
-
 
12
define('DOMAIN', isset($options['d']) ? $options['d'] : (isset($options['domain']) ? $options['domain'] : DEFAULT_DOMAIN));
-
 
13
define('EMAIL', isset($options['e']) ? $options['e'] : (isset($options['email']) ? $options['email'] : NULL));
-
 
14
define('PASS', isset($options['p']) ? $options['p'] : (isset($options['pass']) ? $options['pass'] : NULL));
Line 11... Line 15...
11
define('DOMAIN', isset($options['d']) ? $options['d'] : (isset($options['domain']) ? $options['domain'] : DEFAULT_DOMAIN));
15
define('DEBUG', isset($options['D']) ? 1 : (isset($options['debug']) ? 1 : 0));
12
define('EMAIL', isset($options['e']) ? $options['e'] : (isset($options['email']) ? $options['email'] : NULL));
16
 
Line 13... Line 17...
13
define('PASS', isset($options['p']) ? $options['p'] : (isset($options['pass']) ? $options['pass'] : NULL));
17
if (isset($options['P'])) define('COOKIE', $options['P']);
Line 25... Line 29...
25
}
29
}
Line 26... Line 30...
26
 
30
 
27
$upload = isset($options['U']) ? $options['U'] : (isset($options['upload']) ? $options['upload'] : NULL);
31
$upload = isset($options['U']) ? $options['U'] : (isset($options['upload']) ? $options['upload'] : NULL);
Line 28... Line 32...
28
if($upload) cel_upload_image($upload);
32
if($upload) cel_upload_image($upload);
Line 29... Line 33...
29
 
33
 
30
if(! COOKIE) { if(!auth()) die('no auth'); }
34
if(! defined('COOKIE')) { if(!auth()) die('no auth'); }
Line 56... Line 60...
56
Options:
60
Options:
57
%1\$s [-u|--user = %3\$d] [-d|--domain = %2\$s] [-e|--email] [-p|--pass mot de passe] [-P|--phpsessid PHPSESSID]
61
%1\$s [-u|--user = %3\$d] [-d|--domain = %2\$s] [-e|--email] [-p|--pass mot de passe] [-P|--phpsessid PHPSESSID]
58
    La priorité est donnée à -P sur le couple (-e , -p) pour l'authentification, eg:
62
    La priorité est donnée à -P sur le couple (-e , -p) pour l'authentification, eg:
59
    $ sqlite3 .mozilla/firefox/*.default/cookies.sqlite<<<"SELECT * FROM moz_cookies WHERE baseDomain = 'cel' AND name = 'PHPSESSID';"
63
    $ sqlite3 .mozilla/firefox/*.default/cookies.sqlite<<<"SELECT * FROM moz_cookies WHERE baseDomain = 'cel' AND name = 'PHPSESSID';"
Line 60... Line 64...
60
 
64
 
61
%1\$s -u|--upload <file>
65
%1\$s -U|--upload <file>
-
 
66
    Upload le fichier "file".
62
    Upload le fichier "file".
67
 
63
EOF
68
EOF
64
, // */
69
, // */
65
basename(__FILE__),
70
basename(__FILE__),
66
DEFAULT_DOMAIN,
71
DEFAULT_DOMAIN,