Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

static $timediff30. Call once only.

  • Loading branch information...
commit 362bdbf7903f23693da2486b65c54419432284e1 1 parent a2e2bf6
ethem authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 2 enrol/authorize/lib.php
9 enrol/authorize/lib.php
@@ -144,7 +144,8 @@ function print_authorize_orders()
144 144 *
145 145 * @param int $orderno
146 146 */
147   -function print_authorize_order_details($orderno) {
  147 +function print_authorize_order_details($orderno)
  148 +{
148 149 global $CFG, $USER;
149 150 global $strs, $authstrs;
150 151
@@ -471,6 +472,11 @@ function print_authorize_order_details($orderno) {
471 472 function get_status_action($order)
472 473 {
473 474 global $CFG, $USER;
  475 + static $timediff30;
  476 +
  477 + if (empty($timediff30)) {
  478 + $timediff30 = getsettletime(time()) - (30 * 3600 * 24);
  479 + }
474 480
475 481 $ret = new stdClass();
476 482 $ret->actions = array();
@@ -485,7 +491,6 @@ function get_status_action($order)
485 491
486 492 switch ($order->status) {
487 493 case AN_STATUS_AUTH:
488   - $timediff30 = getsettletime(time()) - (30 * 3600 * 24);
489 494 if (getsettletime($order->timecreated) < $timediff30) {
490 495 $order->status = AN_STATUS_EXPIRE;
491 496 update_record("enrol_authorize", $order);

0 comments on commit 362bdbf

Please sign in to comment.
Something went wrong with that request. Please try again.