Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
ethem committed Jan 15, 2008
1 parent 7bf7c69 commit 5580a59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
20 changes: 4 additions & 16 deletions enrol/authorize/config_form.php
Expand Up @@ -69,18 +69,6 @@
</td> </td>
</tr> </tr>


<?php if (substr($CFG->wwwroot, 0, 5) !== 'https') { /* https && loginhttps */ ?>
<tr valign="top">
<td align="right">loginhttps:</td>
<td><?php
echo (empty($CFG->loginhttps) ? "<span style=\"color:red\"><b>off</b></span>" : "<font color=\"green\">on</font>");
$a->url = "$CFG->wwwroot/$CFG->admin/settings.php?section=httpsecurity";
echo '<br />'; print_string("logindesc", "enrol_authorize", $a);
?>
</td>
</tr>
<?php } /* end: https && loginhttps */ ?>

<tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizesettings", "enrol_authorize") ?></h4></td></tr> <tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizesettings", "enrol_authorize") ?></h4></td></tr>


<tr valign="top"> <tr valign="top">
Expand Down Expand Up @@ -130,7 +118,7 @@
<tr valign="top"> <tr valign="top">
<td align="right">an_authcode:</td> <td align="right">an_authcode:</td>
<td><?php print_checkbox('an_authcode', '1', !empty($frm->an_authcode)) ?> <td><?php print_checkbox('an_authcode', '1', !empty($frm->an_authcode)) ?>
<?php helpbutton('authcode', '', 'enrol/authorize'); ?><br /> <?php helpbutton('authcode', 'authcode', 'enrol/authorize'); ?><br />
<?php print_string("adminauthcode", "enrol_authorize") ?></td> <?php print_string("adminauthcode", "enrol_authorize") ?></td>
</tr> </tr>


Expand All @@ -148,7 +136,7 @@
foreach ($allpaymentmethods as $key) { foreach ($allpaymentmethods as $key) {
if ($key == AN_METHOD_CC) { if ($key == AN_METHOD_CC) {
print_checkbox('acceptmethods[]', AN_METHOD_CC, in_array(AN_METHOD_CC, $paymentmethodsenabled), get_string('method'.AN_METHOD_CC,'enrol_authorize')); print_checkbox('acceptmethods[]', AN_METHOD_CC, in_array(AN_METHOD_CC, $paymentmethodsenabled), get_string('method'.AN_METHOD_CC,'enrol_authorize'));
echo("<ul>"); // blockquote breaks <span> and <br> tags echo("<ul>"); // blockquote breaks <span> and <br> tags
$acceptedccs = array_keys(get_list_of_creditcards()); $acceptedccs = array_keys(get_list_of_creditcards());
$allccs = get_list_of_creditcards(true); $allccs = get_list_of_creditcards(true);
foreach ($allccs as $key => $val) { foreach ($allccs as $key => $val) {
Expand All @@ -160,7 +148,7 @@
} }
elseif ($key == AN_METHOD_ECHECK) { elseif ($key == AN_METHOD_ECHECK) {
print_checkbox('acceptmethods[]', AN_METHOD_ECHECK, in_array(AN_METHOD_ECHECK, $paymentmethodsenabled), get_string('method'.AN_METHOD_ECHECK,'enrol_authorize')); print_checkbox('acceptmethods[]', AN_METHOD_ECHECK, in_array(AN_METHOD_ECHECK, $paymentmethodsenabled), get_string('method'.AN_METHOD_ECHECK,'enrol_authorize'));
echo("<ul>"); // blockquote breaks <span> and <br> tags echo("<ul>"); // blockquote breaks <span> and <br> tags
$echecktypesenabled = get_list_of_bank_account_types(); $echecktypesenabled = get_list_of_bank_account_types();
$allechecktypes = get_list_of_bank_account_types(true); $allechecktypes = get_list_of_bank_account_types(true);
foreach ($allechecktypes as $key) { foreach ($allechecktypes as $key) {
Expand All @@ -175,7 +163,7 @@
</tr> </tr>


<tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?> <tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?>
<?php helpbutton('orderreview', '', 'enrol/authorize'); ?> <?php helpbutton('orderreview', 'orderreview', 'enrol/authorize'); ?>
</h4></td></tr> </h4></td></tr>


<tr valign="top"> <tr valign="top">
Expand Down
14 changes: 4 additions & 10 deletions enrol/authorize/enrol.php
Expand Up @@ -96,7 +96,6 @@ function print_entry($course) {


if ($course->password) { if ($course->password) {
$password = ''; $password = '';
$teacher = get_teacher($course->id);
include($CFG->dirroot.'/enrol/manual/enrol.html'); include($CFG->dirroot.'/enrol/manual/enrol.html');
} }


Expand Down Expand Up @@ -414,7 +413,7 @@ function config_form($frm)
global $CFG; global $CFG;
$mconfig = get_config('enrol/authorize'); $mconfig = get_config('enrol/authorize');


if (! check_openssl_loaded()) { if (!check_openssl_loaded()) {
notify('PHP must be compiled with SSL support (--with-openssl)'); notify('PHP must be compiled with SSL support (--with-openssl)');
} }


Expand Down Expand Up @@ -524,8 +523,7 @@ function process_config($config)
set_config('an_sorttype', $sorttype); set_config('an_sorttype', $sorttype);


// https and openssl library is required // https and openssl library is required
if ((substr($CFG->wwwroot, 0, 5) !== 'https' and empty($CFG->loginhttps)) or if ((substr($CFG->wwwroot, 0, 5) !== 'https' and empty($CFG->loginhttps)) or !check_openssl_loaded()) {
!check_openssl_loaded()) {
return false; return false;
} }


Expand Down Expand Up @@ -593,10 +591,7 @@ function cron()
} }


mtrace(" scheduled capture", ": "); mtrace(" scheduled capture", ": ");
if (empty($CFG->an_review) or if (empty($CFG->an_review) or (!empty($CFG->an_test)) or (intval($CFG->an_capture_day) < 1) or (!check_openssl_loaded())) {
(!empty($CFG->an_test)) or
(intval($CFG->an_capture_day) < 1) or
(!check_openssl_loaded())) {
mtrace("disabled"); mtrace("disabled");
return; // order review disabled or test mode or manual capture or openssl wasn't loaded. return; // order review disabled or test mode or manual capture or openssl wasn't loaded.
} }
Expand Down Expand Up @@ -724,8 +719,7 @@ function cron_daily()
// get_users_by_capability() does not handling user level resolving // get_users_by_capability() does not handling user level resolving
// After user resolving, get_admin() to get_users_by_capability() // After user resolving, get_admin() to get_users_by_capability()
$adminuser = get_admin(); $adminuser = get_admin();
$select = "status IN(".AN_STATUS_UNDERREVIEW.",".AN_STATUS_APPROVEDREVIEW.") " . $select = "status IN(".AN_STATUS_UNDERREVIEW.",".AN_STATUS_APPROVEDREVIEW.") AND (timecreated<'$onepass') AND (timecreated>'$timediff60')";
"AND (timecreated<'$onepass') AND (timecreated>'$timediff60')";
$count = count_records_select('enrol_authorize', $select); $count = count_records_select('enrol_authorize', $select);
if ($count) { if ($count) {
$a = new stdClass; $a = new stdClass;
Expand Down

0 comments on commit 5580a59

Please sign in to comment.