Add check_authorized_number boolean option
Benjamin Renard

Benjamin Renard commited on 2012-11-29 15:43:42
Showing 1 changed files, with 2 additions and 1 deletions.

... ...
@@ -22,6 +22,7 @@ use Encode qw/encode decode/;
22 22
 
23 23
 # Configuration
24 24
 $smsc="+33609001390";
25
+$check_authorized_number=undef;
25 26
 @authorized_number=("0612345678","0033600000000");
26 27
 $gnokii_config="/etc/gnokiirc";
27 28
 
... ...
@@ -90,7 +91,7 @@ sub in_array {
90 91
 }
91 92
 
92 93
 # Envoie du SMS
93
-if ($mob ne '' && in_array(\@authorized_number,$mob)){
94
+if (not $check_authorized_number or $mob ne '' && in_array(\@authorized_number,$mob)){
94 95
 	`echo "$subject" | gnokii --config $gnokii_config --sendsms $mob --smsc $smsc`;
95 96
 	if($? != 0){
96 97
 		print "Error sending SMS";
97 98