Permalink
Browse files

Fixed 2.0 bugs

  • Loading branch information...
1 parent 755ee6d commit 64d187aa12f89f86b4767037228c26233310e942 ethem evlice committed Jan 28, 2010
@@ -59,7 +59,7 @@ public static function settled($order)
public static function expired(&$order)
{
global $DB;
- static $timediff30;
+ static $timediff30 = 0;
if ($order->status == AN_STATUS_EXPIRE) {
return true;
@@ -68,7 +68,7 @@ public static function expired(&$order)
return false;
}
- if (empty($timediff30)) {
+ if (0 == $timediff30) {
$timediff30 = self::getsettletime(time()) - (30 * 24 * 3600);
}
@@ -95,10 +95,10 @@ public static function expired(&$order)
public static function process(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $cctype=NULL)
{
global $CFG, $DB;
- static $constpd;
+ static $constpd = array();
require_once($CFG->libdir.'/filelib.php');
- if (!isset($constpd)) {
+ if (empty($constpd)) {
$mconfig = get_config('enrol/authorize');
$constpd = array(
'x_version' => '3.1',
@@ -25,7 +25,7 @@
$PAGE->set_url($url);
/// Get course
- if (! $course = $DB->get_record('course', array('id'=>$courseid))) {
+ if (!($course = $DB->get_record('course', array('id'=>$courseid)))) {
print_error('invalidcourseid', '', '', $courseid);
}
@@ -120,8 +120,8 @@ function message_to_admin($subject, $data)
$admin = get_admin();
$data = (array)$data;
- $message = "$SITE->fullname: Transaction failed.\n\n$subject\n\n";
- $message .= print_r($data, true);
+ $emailmessage = "$SITE->fullname: Transaction failed.\n\n$subject\n\n";
+ $emailmessage .= print_r($data, true);
$eventdata = new object();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
@@ -265,7 +265,7 @@ function authorize_print_order($orderid)
}
}
- if (SITEID != $courseid) {
+ if (SITEID != $course->id) {
$PAGE->navbar->add($course->shortname, new moodle_url('/course/view.php', array('id'=>$course->id)));
}
$PAGE->navbar->add($authstrs->paymentmanagement, 'index.php?course='.$course->id);
@@ -522,9 +522,9 @@ function authorize_print_order($orderid)
function authorize_get_status_action($order)
{
global $CFG;
- static $newordertime;
+ static $newordertime = 0;
- if (empty($newordertime)) {
+ if (0 == $newordertime) {
$newordertime = time() - 120; // -2 minutes. Order may be still in process.
}

0 comments on commit 64d187a

Please sign in to comment.