Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (33 sloc) 0.886 kb
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
#!/usr/bin/env perl

use strict;
use CGI;
use C4::SMS;
use C4::Output;
use C4::Auth;

my $query = new CGI;
my $message = $query->param( 'message' );
my $phone = $query->param( 'phone' );
my $operation = $query->param('operation');
my $result;
my $errorcode;
my ($template, $loggedinuser, $cookie)
    = get_template_and_user({template_name => "sms/sms-home.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
flagsrequired => {circulate => "circulate_remaining_permissions" },
debug => 1,
});
if ($operation eq "sendsms"){
$phone=parse_phone($phone);
if ($phone){
##write to a queue and exit
my $me=C4::Context->userenv;
$result=write_sms($me->{cardnumber},$message,$phone);
} else {
$errorcode=-1104;
}
}
my $error=error_codes($errorcode);
$template->param(error=>$error);
output_html_with_http_headers $query, $cookie, $template->output;
Something went wrong with that request. Please try again.