Committer: akanashin
LJSUP-12885: SMS notification - Add TajikistanU trunk/bin/misc/smsru_stats.pl U trunk/htdocs/manage/profile/index.bml.text.local
Modified: trunk/bin/misc/smsru_stats.pl =================================================================== --- trunk/bin/misc/smsru_stats.pl 2012-08-01 13:46:51 UTC (rev 12394) +++ trunk/bin/misc/smsru_stats.pl 2012-08-01 13:52:37 UTC (rev 12395) @@ -16,7 +16,7 @@ my $SECONDS_IN_DAY = 86400; my $DAYS_IN_PERIOD = 7; -my @OPERATORS = qw(ksell beeline megafon mts total); +my @OPERATORS = qw(ksell beeline megafon megafon_tj mts total); my @stat_recipients = ('sergey.lobin@sup.com', 'dnikolaev@sup.com', 'lj_rusms_notifications_stats@sup.com'); @@ -263,24 +263,33 @@ return $PHONES{$number} if exists $PHONES{$number}; - my ($def) = $number =~ /^7(\d\d\d)\d{7}$/; - unless ($def) { - warn "Invalid phone number: '$number'\n"; - $PHONES{$number} = undef; - return undef; + my $provider_name; + for my $provider (keys %{$LJ::SMSRU{provider}}) { + my $code = $provider->{code}; + + my ($def) = $number =~ /^$code(\d\d\d)\d{7}$/; + + unless ($def) { + warn "Invalid phone number: '$number'\n"; + $PHONES{$number} = undef; + return undef; + } + + $provider_name = $LJ::SMSRU{provider_by_code_def}->{$code.$def}; + if ($provider_name) { + $PHONES{$number} = $provider_name; + return $provider_name; + } } - my $provider_name = $LJ::SMSRU{provider_by_def}->{$def}; unless ($provider_name) { warn "Invalid phone DEF code: '$number'\n"; $PHONES{$number} = undef; return undef; } - - $PHONES{$number} = $provider_name; - return $provider_name; } + sub to_date { my $time_stamp = shift; my @t = gmtime($time_stamp); Modified: trunk/htdocs/manage/profile/index.bml.text.local =================================================================== --- trunk/htdocs/manage/profile/index.bml.text.local 2012-08-01 13:46:51 UTC (rev 12394) +++ trunk/htdocs/manage/profile/index.bml.text.local 2012-08-01 13:52:37 UTC (rev 12395) @@ -104,6 +104,9 @@ .section.textmsg.example_kz|staleness=1 .section.textmsg.example_kz=E.g.: +7xxx1234567 +.section.textmsg.example_tj|staleness=1 +.section.textmsg.example_tj=E.g.: +992xxx1234567 + .section.textmsg.example_ru=E.g.: +7xxx1234567 .section.textmsg.example_us=+1xxx1234567 @@ -116,6 +119,8 @@ .section.textmsg.info.badnum.kz=Incorrect number. You can receive SMS notifications for LiveJournal events to Kazakhstan/KCell numbers. +.section.textmsg.info.badnum.tj=Incorrect number. You can receive SMS notifications for LiveJournal events to Tajikistan/Megafon numbers. + .section.textmsg.info.badtrans|staleness=1 .section.textmsg.info.badtrans=Bad transaction @@ -123,6 +128,8 @@ .section.textmsg.info.kz=Subscribers of Kazakhstan/Kcell mobile services can receive free SMS notifications for LiveJournal events. Please, enter your phone number to start using the service. +.section.textmsg.info.tj=Subscribers of Tajikistan/Megafon mobile services can receive free SMS notifications for LiveJournal events. Please, enter your phone number to start using the service. + .section.textmsg.info.linkexpired=Your verification code has expired. Please click on the Resend button to get another SMS with a new validation code. .section.textmsg.info.notasubscriber=Sorry, a technical error occurred. @@ -141,6 +148,8 @@ .section.textmsg.info.unsupporteddef.kz=Sorry, this phone number is not currently supported by the service. You can receive SMS notifications for LiveJournal events to Kazakhstan/KCell numbers. +.section.textmsg.info.unsupporteddef.tj=Sorry, this phone number is not currently supported by the service. You can receive SMS notifications for LiveJournal events to Tajikistan/Megafon numbers. + .section.textmsg.info.verified=Your phone number has been validated. Please <a href='http://www.livejournal.com/manage/settings/?cat=notifications'>select the event types</a> to which you’d like to subscribe. .section.textmsg.info.wrongcode=You entered the wrong validation code. Please reenter the code or click the Resend button to request another SMS validation code.