This file is indexed.

/usr/share/perl5/SMS/Send/AQL.pm is in libsms-send-aql-perl 0.03-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package SMS::Send::AQL;

# $Id: AQL.pm 281 2008-03-09 01:54:50Z davidp $

use strict;
use warnings;
use SMS::AQL;
our $VERSION = '0.04';
use base 'SMS::Send::Driver';




=head1 NAME

SMS::Send::AQL - SMS::Send driver to send messages via AQL (www.aql.com)

=head1 SYNOPSIS

  use SMS::Send;
  
  # Create a sender
  my $sender = SMS::Send->new('AQL',
        _login    => 'your_aql_username',
        _password => 'your_aql_password',
        _sender   => 'sender number',
  );
  
  # Send a message
  my $sent = $sender->send_sms(
        text => 'This is a test message',
        to   => '+61 (4) 1234 5678',
  );
  
  if ( $sent ) {
        print "Message sent ok\n";
  } else {
        print "Failed to send message\n";
  }


=head1 DESCRIPTION

A driver for SMS::Send to send SMS text messages via AQL (www.aql.com)

This is not intended to be used directly, but instead called by SMS::Send
(see synopsis above for a basic illustration, and see SMS::Send's documentation
for further information).



=head1 METHODS

=over 4

=item new

Constructor, takes argument pairs passed by SMS::Send, returns an SMS::Send::AQL
object.  See usage synopsis for example, and see SMS::Send documentation for
further info on using SMS::Send drivers.

=cut

sub new {

    my ($class, %args) = @_;

    my $self = bless { %args }, $class;
    
    # Previous versions of this module documented _username as the param name
    # for the username; unfortunately there's no "standard" for SMS::Send
    # drivers, but the general concensus seems to be to use _login, but we'll
    # continue to support _username too.
    if (!exists $args{_login} && exists $args{_username}) {
        $args{_login} = delete $args{_username};
    }
    
    if (grep { ! $args{$_} } qw(_login _password)) {
        die "_login (or _username) and _password required";
    }
    
    
    
    $self->{aql} = new SMS::AQL({
        username => $args{_login},
        password => $args{_password},
        options => {
            sender => $args{_sender} || 'SMS::AQL',
        },
    });
    
    return $self;

}



=item send_sms

Send the message - see SMS::Send for details.

=cut

sub send_sms {

    my ($self, %args) = @_;
    
    # AQL's gateway won't accept numbers in the format +441234567890,
    # it wants to see 00441234567890 instead:
    $args{to} =~ s/^\+/00/;
    
    
    return $self->{aql}->send_sms(@args{ qw (to text) });

}



=back

=head1 AUTHOR

David Precious, E<lt>davidp@preshweb.co.ukE<gt>


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2011  by David Precious

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.


=cut



1;
__END__