Lines 13-23
Link Here
|
13 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
13 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
14 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
14 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
15 |
# |
15 |
# |
16 |
# You should have received a copy of the GNU General Public License along with |
16 |
# You should have received a copy of the GNU General Public License along |
17 |
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
17 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
18 |
# Suite 330, Boston, MA 02111-1307 USA |
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 |
# |
19 |
# |
20 |
|
20 |
|
|
|
21 |
use strict; |
22 |
use warnings; |
23 |
|
21 |
use CGI; |
24 |
use CGI; |
22 |
use C4::Auth; |
25 |
use C4::Auth; |
23 |
use C4::Circulation; |
26 |
use C4::Circulation; |
Lines 30-46
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($cgi, undef);
Link Here
|
30 |
my $result; |
33 |
my $result; |
31 |
|
34 |
|
32 |
if ($status eq 'ok') { # if authentication is ok |
35 |
if ($status eq 'ok') { # if authentication is ok |
33 |
if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them |
36 |
if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them |
34 |
$result = AddOfflineOperation( |
37 |
$result = AddOfflineOperation( |
35 |
$cgi->param('userid') || '', |
38 |
$cgi->param('userid') || '', |
36 |
$cgi->param('branchcode') || '', |
39 |
$cgi->param('branchcode') || '', |
37 |
$cgi->param('timestamp') || '', |
40 |
$cgi->param('timestamp') || '', |
38 |
$cgi->param('action') || '', |
41 |
$cgi->param('action') || '', |
39 |
$cgi->param('barcode') || '', |
42 |
$cgi->param('barcode') || '', |
40 |
$cgi->param('cardnumber') || '', |
43 |
$cgi->param('cardnumber') || '', |
41 |
); |
44 |
); |
42 |
} else { |
45 |
} else { |
43 |
$result = ProcessOfflineOperation( |
46 |
$result = ProcessOfflineOperation( |
44 |
{ |
47 |
{ |
45 |
'userid' => $cgi->param('userid'), |
48 |
'userid' => $cgi->param('userid'), |
46 |
'branchcode' => $cgi->param('branchcode'), |
49 |
'branchcode' => $cgi->param('branchcode'), |
Lines 49-56
if ($status eq 'ok') { # if authentication is ok
Link Here
|
49 |
'barcode' => $cgi->param('barcode'), |
52 |
'barcode' => $cgi->param('barcode'), |
50 |
'cardnumber' => $cgi->param('cardnumber'), |
53 |
'cardnumber' => $cgi->param('cardnumber'), |
51 |
} |
54 |
} |
52 |
); |
55 |
); |
53 |
} |
56 |
} |
54 |
} else { |
57 |
} else { |
55 |
$result = "Authentication failed." |
58 |
$result = "Authentication failed." |
56 |
} |
59 |
} |
57 |
- |
|
|