3 if (!isset($frm->enrol_cost
)) $frm->enrol_cost
= '5';
4 if (!isset($frm->enrol_currency
)) $frm->enrol_currency
= 'USD';
5 if (!isset($frm->enrol_mailstudents
)) $frm->enrol_mailstudents
= '';
6 if (!isset($frm->enrol_mailteachers
)) $frm->enrol_mailteachers
= '';
7 if (!isset($frm->enrol_mailadmins
)) $frm->enrol_mailadmins
= '';
9 if (!isset($frm->an_login
)) $frm->an_login
= '';
10 if (!isset($frm->an_tran_key
)) $frm->an_tran_key
= '';
11 if (!isset($frm->an_password
)) $frm->an_password
= '';
12 if (!isset($frm->delete_current
)) $frm->delete_current
= '';
13 if (!isset($frm->an_referer
)) $frm->an_referer
= 'http://';
14 if (!isset($frm->an_avs
)) $frm->an_avs
= '';
15 if (!isset($frm->an_authcode
)) $frm->an_authcode
= '';
16 if (!isset($frm->an_test
)) $frm->an_test
= '';
17 if (!isset($frm->an_review
)) $frm->an_review
= '';
18 if (!isset($frm->an_capture_day
)) $frm->an_capture_day
= '5';
19 if (!isset($frm->an_emailexpired
)) $frm->an_emailexpired
= '2';
20 if (!isset($frm->an_emailexpiredteacher
)) $frm->an_emailexpiredteacher
= '';
21 if (!isset($frm->an_sorttype
)) $frm->an_sorttype
= 'ttl';
23 if (isset($CFG->an_cutoff
)) {
24 $cutoff = intval($CFG->an_cutoff
);
25 $mins = $cutoff %
60; $hrs = ($cutoff - $mins) / 60;
26 $frm->an_cutoff_hour
= $hrs; $frm->an_cutoff_min
= $mins;
28 if (!isset($frm->an_cutoff_hour
)) {
29 $timezone = format_float(get_user_timezone_offset(), 1);
30 $frm->an_cutoff_hour
= intval($timezone);
31 $frm->an_cutoff_min
= (intval(round($timezone)) != intval($timezone)) ?
35 : 5;
34 if (!isset($frm->acceptmethods
)) {
35 $frm->acceptmethods
= get_list_of_payment_methods();
36 $CFG->an_acceptmethods
= implode(',', $frm->acceptmethods
);
39 if (!isset($frm->acceptccs
)) {
40 $frm->acceptccs
= array_keys(get_list_of_creditcards());
41 $CFG->an_acceptccs
= implode(',', $frm->acceptccs
);
44 if (!isset($frm->acceptechecktypes
)) {
45 $frm->acceptechecktypes
= get_list_of_bank_account_types();
46 $CFG->an_acceptechecktypes
= implode(',', $frm->acceptechecktypes
);
51 <table cellspacing
="0" cellpadding
="5" border
="0" class="boxaligncenter">
54 <td colspan
="2" align
="right"><a href
="../enrol/authorize/index.php"><?php
print_string("paymentmanagement", "enrol_authorize") ?
></a
></td
>
57 <tr valign
="top"><td colspan
="2"><h4
><?php
print_string("adminauthorizewide", "enrol_authorize") ?
></h4
></td
></tr
>
60 <td align
="right">enrol_cost
:</td
>
61 <td
><input type
="text" size
="5" name
="enrol_cost" value
="<?php p($frm->enrol_cost) ?>" /><br
/>
62 <?php
print_string("costdefault") ?
>. <?php
print_string("costdefaultdesc", "enrol_authorize") ?
></td
>
66 <td align
="right">enrol_currency
:</td
>
67 <td
><?php
choose_from_menu(get_list_of_currencies(), "enrol_currency", $frm->enrol_currency
, "","", "") ?
><br
/>
68 <?php
print_string("currency") ?
>
72 <?php
if (substr($CFG->wwwroot
, 0, 5) !== 'https') { /* https && loginhttps */ ?
>
74 <td align
="right">loginhttps
:</td
>
76 echo (empty($CFG->loginhttps
) ?
"<span style=\"color:red\"><b>off</b></span>" : "<font color=\"green\">on</font>");
77 $a->url
= "$CFG->wwwroot/$CFG->admin/settings.php?section=httpsecurity";
78 echo '<br />'; print_string("logindesc", "enrol_authorize", $a);
82 <?php
} /* end: https && loginhttps */ ?
>
84 <tr valign
="top"><td colspan
="2"><h4
><?php
print_string("adminauthorizesettings", "enrol_authorize") ?
></h4
></td
></tr
>
87 <td align
="right"> 
; 
;</td
>
88 <td
><?php
print_string("logininfo", "enrol_authorize") ?
></td
>
92 <td align
="right">an_login
:<br
/><?php
echo (isset($mconfig->an_login
)) ?
'<span style="color:green">'.get_string('ok').'</span>' : ''; ?
></td
>
93 <td
><?php
print_string("anlogin", "enrol_authorize") ?
><br
/><input type
="text" name
="an_login" size
="26" value
="" /><sup
>*</sup
></td
>
97 <td align
="right">an_tran_key
:<br
/><?php
echo (isset($mconfig->an_tran_key
)) ?
'<span style="color:green">'.get_string('ok').'</span>' : ''; ?
></td
>
98 <td
><?php
print_string("antrankey", "enrol_authorize") ?
><br
/><input type
="text" name
="an_tran_key" size
="26" value
="" /><sup
>#1</sup></td>
102 <td align
="right">an_password
:<br
/><?php
echo (isset($mconfig->an_password
)) ?
'<span style="color:green">'.get_string('ok').'</span>' : ''; ?
></td
>
103 <td
><?php
print_string("anpassword", "enrol_authorize") ?
><br
/><input type
="text" name
="an_password" size
="26" value
="" /><sup
>#2</sup></td>
107 <td align
="right">delete_current
:</td
>
108 <td
><?php
print_checkbox('delete_current', '1', !empty($frm->delete_current
)) ?
> <br
/>
109 <?php
print_string("deletecheck", "moodle", get_string('oldpassword')) ?
><br
/><hr
/></td
>
113 <td align
="right">an_referer
:</td
>
114 <td
><input type
="text" name
="an_referer" size
="35" value
="<?php p($frm->an_referer) ?>" /><br
/>
115 <?php
print_string("anreferer", "enrol_authorize") ?
></td
>
119 <td align
="right">an_cutoff
:</td
>
120 <td
><?php
print_time_selector("an_cutoff_hour","an_cutoff_min",make_timestamp(2000,1,1,$frm->an_cutoff_hour
,$frm->an_cutoff_min
),5); ?
><br
/>
121 <?php
print_string("cutofftime", "enrol_authorize") ?
></td
>
125 <td align
="right">an_avs
:</td
>
126 <td
><?php
print_checkbox('an_avs', '1', !empty($frm->an_avs
)) ?
><br
/>
127 <?php
print_string("adminavs", "enrol_authorize") ?
></td
>
131 <td align
="right">an_authcode
:</td
>
132 <td
><?php
print_checkbox('an_authcode', '1', !empty($frm->an_authcode
)) ?
>
133 <?php
helpbutton('authcode', '', 'enrol/authorize'); ?
><br
/>
134 <?php
print_string("adminauthcode", "enrol_authorize") ?
></td
>
138 <td align
="right">an_test
:</td
>
139 <td
><?php
print_checkbox('an_test', '1', !empty($frm->an_test
)) ?
><br
/>
140 <?php
print_string("antestmode", "enrol_authorize") ?
></td
>
144 <td align
="right">accepts
:</td
>
145 <td
><?php
print_string("adminaccepts", "enrol_authorize") ?
><br
/><br
/><?php
146 $paymentmethodsenabled = get_list_of_payment_methods();
147 $allpaymentmethods = get_list_of_payment_methods(true);
148 foreach ($allpaymentmethods as $key) {
149 if ($key == AN_METHOD_CC
) {
150 print_checkbox('acceptmethods[]', AN_METHOD_CC
, in_array(AN_METHOD_CC
, $paymentmethodsenabled), get_string('method'.AN_METHOD_CC
,'enrol_authorize'));
151 echo("<ul>"); // blockquote breaks <span> and <br> tags
152 $acceptedccs = array_keys(get_list_of_creditcards());
153 $allccs = get_list_of_creditcards(true);
154 foreach ($allccs as $key => $val) {
156 print_checkbox('acceptccs[]', $key, in_array($key, $acceptedccs), $val);
161 elseif ($key == AN_METHOD_ECHECK
) {
162 print_checkbox('acceptmethods[]', AN_METHOD_ECHECK
, in_array(AN_METHOD_ECHECK
, $paymentmethodsenabled), get_string('method'.AN_METHOD_ECHECK
,'enrol_authorize'));
163 echo("<ul>"); // blockquote breaks <span> and <br> tags
164 $echecktypesenabled = get_list_of_bank_account_types();
165 $allechecktypes = get_list_of_bank_account_types(true);
166 foreach ($allechecktypes as $key) {
168 print_checkbox('acceptechecktypes[]', $key, in_array($key, $echecktypesenabled), get_string('echeck'.strtolower($key),'enrol_authorize'));
177 <tr valign
="top"><td colspan
="2"><h4
><?php
print_string("adminauthorizeccapture", "enrol_authorize") ?
>
178 <?php
helpbutton('orderreview', '', 'enrol/authorize'); ?
>
182 <td align
="right">an_review
:</td
>
183 <td
><?php
print_checkbox('an_review', '1', !empty($frm->an_review
)) ?
>
184 <?php
helpbutton('review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol/authorize'); ?
><br
/>
185 <?php
print_string("adminreview", "enrol_authorize") ?
></td
>
189 <td align
="right">an_capture_day
:</td
>
190 <td
><input type
="text" name
="an_capture_day" size
="2" maxlength
="2" value
="<?php p($frm->an_capture_day) ?>" />
191 <?php
helpbutton('captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol/authorize'); ?
><br
/>
192 <?php
print_string("reviewday", "enrol_authorize", $frm->an_capture_day
) ?
></td
>
195 <tr valign
="top"><td colspan
="2"><h4
><?php
print_string("adminauthorizeemail", "enrol_authorize") ?
></h4
></td
></tr
>
198 <td align
="right">an_emailexpired
:</td
>
199 <td
><input type
="text" name
="an_emailexpired" size
="1" maxlength
="1" value
="<?php p($frm->an_emailexpired) ?>" /><br
/>
200 <?php
print_string("adminemailexpired", "enrol_authorize", $frm->an_emailexpired
) ?
><br
/>
201 <?php
print_string("adminemailexpsetting", "enrol_authorize") ?
></td
>
205 <td align
="right">an_emailexpiredteacher
:</td
>
206 <td
><?php
print_checkbox('an_emailexpiredteacher', '1', !empty($frm->an_emailexpiredteacher
)) ?
><br
/>
207 <?php
print_string("adminemailexpiredteacher", "enrol_authorize") ?
></td
>
211 <td align
="right">an_sorttype
:</td
>
213 $sorts = array('ttl' => get_string('adminemailexpiredsortsum', 'enrol_authorize'),
214 'cnt' => get_string('adminemailexpiredsortcount', 'enrol_authorize'));
215 choose_from_menu($sorts, "an_sorttype", $frm->an_sorttype
, "","", "") ?
><br
/>
216 <?php
print_string("adminemailexpiredsort", "enrol_authorize") ?
></td
>
220 <td align
="right">enrol_mailstudents
:</td
>
221 <td
><?php
print_checkbox('enrol_mailstudents', '1', !empty($frm->enrol_mailstudents
)) ?
><br
/>
222 <?php
print_string("mailstudents") ?
></td
>
226 <td align
="right">enrol_mailteachers
:</td
>
227 <td
><?php
print_checkbox('enrol_mailteachers', '1', !empty($frm->enrol_mailteachers
)) ?
><br
/>
228 <?php
print_string("mailteachers") ?
></td
>
232 <td align
="right">enrol_mailadmins
:</td
>
233 <td
><?php
print_checkbox('enrol_mailadmins', '1', !empty($frm->enrol_mailadmins
)) ?
><br
/>
234 <?php
print_string("mailadmins") ?
></td
>