séparation de la configuration spécifique à la liaison...
...sms/action
... | ... |
@@ -434,7 +434,7 @@ sub from_gtalksms_parse { |
434 | 434 |
}, |
435 | 435 |
$cfg::user{"test intro pour action"} => sub { |
436 | 436 |
my $intro = $1; |
437 |
- my $intro_file = $cfg::config{flag_prefix} . $intro . $cfg::config{flag_suffix}; |
|
437 |
+ my $intro_file = $cfg::sms_action{flag_prefix} . $intro . $cfg::sms_action{flag_suffix}; |
|
438 | 438 |
if (! -r $intro_file) { |
439 | 439 |
$to_gtalksms_queue->enqueue([$request{phone}, "l'intro $intro n'existe pas, abandon"]); |
440 | 440 |
return; |
... | ... |
@@ -446,8 +446,8 @@ sub from_gtalksms_parse { |
446 | 446 |
$time_left = $1 if defined $1; |
447 | 447 |
$time_left .= $2 if defined $2; |
448 | 448 |
} |
449 |
- if (-r $cfg::config{flagdir} . "/" . $cfg::config{flag}) { |
|
450 |
- open FLAG, $cfg::config{flagdir} . "/" . $cfg::config{flag}; |
|
449 |
+ if (-r $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}) { |
|
450 |
+ open FLAG, $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}; |
|
451 | 451 |
my $locker = ''; |
452 | 452 |
my $intro_ = ''; |
453 | 453 |
while (<FLAG>) { |
... | ... |
@@ -463,12 +463,12 @@ sub from_gtalksms_parse { |
463 | 463 |
} |
464 | 464 |
else { |
465 | 465 |
log_bot("demande envoi du mail des actions avec intro $intro depuis $request{phone} $request{phone_owner} à $request{address}"); |
466 |
- mkdir $cfg::config{flagdir}; |
|
467 |
- chmod 0770, $cfg::config{flagdir}; |
|
468 |
- open(FLAG, ">" . $cfg::config{flagdir} . "/" . $cfg::config{flag}); |
|
466 |
+ mkdir $cfg::sms_action{flagdir}; |
|
467 |
+ chmod 0770, $cfg::sms_action{flagdir}; |
|
468 |
+ open(FLAG, ">" . $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}); |
|
469 | 469 |
print FLAG "to:" . $request{address} . "\nintro:" . $intro . "\nfirstname:" . $request{phone} . " " . $request{phone_owner}; |
470 | 470 |
close FLAG; |
471 |
- chmod 0666, $cfg::config{flagdir} . "/" . $cfg::config{flag}; |
|
471 |
+ chmod 0666, $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}; |
|
472 | 472 |
$to_gtalksms_queue->enqueue([$request{phone}, "le mail de test des actions avec intro $intro partira dans $time_left sur $request{address}"]); |
473 | 473 |
} |
474 | 474 |
}, |
... | ... |
@@ -480,8 +480,8 @@ sub from_gtalksms_parse { |
480 | 480 |
$time_left = $1 if defined $1; |
481 | 481 |
$time_left .= $2 if defined $2; |
482 | 482 |
} |
483 |
- if (-r $cfg::config{flagdir} . "/" . $cfg::config{flag}) { |
|
484 |
- open FLAG, $cfg::config{flagdir} . "/" . $cfg::config{flag}; |
|
483 |
+ if (-r $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}) { |
|
484 |
+ open FLAG, $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}; |
|
485 | 485 |
my $locker = ''; |
486 | 486 |
my $intro_ = ''; |
487 | 487 |
while (<FLAG>) { |
... | ... |
@@ -496,10 +496,10 @@ sub from_gtalksms_parse { |
496 | 496 |
} |
497 | 497 |
else { |
498 | 498 |
log_bot("demande envoi du mail des actions depuis $request{phone} $request{phone_owner}"); |
499 |
- mkdir $cfg::config{flagdir}; |
|
500 |
- chmod 0770, $cfg::config{flagdir}; |
|
501 |
- open(FLAG, ">" . $cfg::config{flagdir} . "/" . $cfg::config{flag}); |
|
502 |
- chmod 0666, $cfg::config{flagdir} . "/" . $cfg::config{flag}; |
|
499 |
+ mkdir $cfg::sms_action{flagdir}; |
|
500 |
+ chmod 0770, $cfg::sms_action{flagdir}; |
|
501 |
+ open(FLAG, ">" . $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}); |
|
502 |
+ chmod 0666, $cfg::sms_action{flagdir} . "/" . $cfg::sms_action{flag}; |
|
503 | 503 |
$to_gtalksms_queue->enqueue([$request{phone}, "le mail des actions partira dans $time_left"]); |
504 | 504 |
} |
505 | 505 |
}, |