Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 37 lines (33 sloc) 0.886 kb
a0b06fb @ctfliblime Prepare for perlbrew usage by changing all script magic to "#!/usr/bin/e...
ctfliblime authored
1 #!/usr/bin/env perl
76064f4 adding SMS stuff so we don't forget about it
Joshua Ferraro authored
2
3 use strict;
4 use CGI;
5 use C4::SMS;
6 use C4::Output;
7 use C4::Auth;
9c8a1e2 SMS - widespread cleanup and moving code away from Cyprus/Turkey-specifi...
Joe Atzberger authored
8
76064f4 adding SMS stuff so we don't forget about it
Joshua Ferraro authored
9 my $query = new CGI;
9c8a1e2 SMS - widespread cleanup and moving code away from Cyprus/Turkey-specifi...
Joe Atzberger authored
10 my $message = $query->param( 'message' );
11 my $phone = $query->param( 'phone' );
12 my $operation = $query->param('operation');
76064f4 adding SMS stuff so we don't forget about it
Joshua Ferraro authored
13 my $result;
14 my $errorcode;
15 my ($template, $loggedinuser, $cookie)
16 = get_template_and_user({template_name => "sms/sms-home.tmpl",
9c8a1e2 SMS - widespread cleanup and moving code away from Cyprus/Turkey-specifi...
Joe Atzberger authored
17 query => $query,
18 type => "intranet",
19 authnotrequired => 0,
c15e120 bug 2874 [3/3] flagsrequired => { circulate => "circulate_remaining_perm...
John Beppu authored
20 flagsrequired => {circulate => "circulate_remaining_permissions" },
9c8a1e2 SMS - widespread cleanup and moving code away from Cyprus/Turkey-specifi...
Joe Atzberger authored
21 debug => 1,
22 });
23 if ($operation eq "sendsms"){
24 $phone=parse_phone($phone);
25 if ($phone){
26 ##write to a queue and exit
27 my $me=C4::Context->userenv;
28 $result=write_sms($me->{cardnumber},$message,$phone);
29 } else {
30 $errorcode=-1104;
31 }
76064f4 adding SMS stuff so we don't forget about it
Joshua Ferraro authored
32 }
33 my $error=error_codes($errorcode);
34 $template->param(error=>$error);
35 output_html_with_http_headers $query, $cookie, $template->output;
36
Something went wrong with that request. Please try again.