MDL-10181 User Management Improvements: Cron unenrolment of manual should takes place...
authorethem <ethem>
Wed, 6 Feb 2008 08:13:20 +0000 (08:13 +0000)
committerethem <ethem>
Wed, 6 Feb 2008 08:13:20 +0000 (08:13 +0000)
It is time to use own enrolment method when calling funcs enrol_into_course, role_assign, role_unassign.

Zend Studio Warning: Assignment in condition (line XX), Solved, one more ()
Assignments in a conditional statement are sometimes the result of a typo.
In many cases, instead of the assignment operator =, the equality operator ==
should be used. When comparing a variable and a non-variable expression,
it is common practice to put the variable on the right-hand side of the equality
operator, so that if the equality operator is erroneously replaced with the
assignment operator, PHP will report a parse error immediately.
This helps you avoid a big subset of this class of bugs.

Merged from MOODLE_19_STABLE

enrol/authorize/localfuncs.php
enrol/authorize/locallib.php

index 9f0eadedb3f1109251c470a732acff3630b4101b..bbd4536dc708f80be2778e901a3e03188342a07b 100644 (file)
@@ -40,7 +40,7 @@ function prevent_double_paid($course)
         $sql .= 'AND status='.AN_STATUS_NONE;
     }
 
-    if ($recid = get_field_sql($sql)) {
+    if (($recid = get_field_sql($sql))) {
         $a = new stdClass;
         $a->orderid = $recid;
         $a->url = "$CFG->wwwroot/enrol/authorize/index.php?order=$a->orderid";
index 17911d85611d5baeb5544d5a39eaf389f67b1251..3cb3ff8a8afec9dcef3bd91e1a4df774c02e6981 100644 (file)
@@ -53,7 +53,7 @@ function authorize_print_orders($courseid, $userid)
         $sql .= "WHERE (e.userid='$userid') ";
     }
     $sql .= "ORDER BY c.sortorder, c.fullname";
-    if ($popupcrs = get_records_sql_menu($sql)) {
+    if (($popupcrs = get_records_sql_menu($sql))) {
         $popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs;
         echo "<table border='0' width='100%' cellspacing='0' cellpadding='3' class='generaltable generalbox'>";
         echo "<tr>";
@@ -155,7 +155,7 @@ function authorize_print_orders($courseid, $userid)
         $where .= "AND (e.userid = '" . $userid . "') ";
     }
 
-    if ($sort = $table->get_sql_sort()) {
+    if (($sort = $table->get_sql_sort())) {
         $sort = ' ORDER BY ' . $sort;
     }
 
@@ -163,7 +163,7 @@ function authorize_print_orders($courseid, $userid)
     $table->initialbars($totalcount > $perpage);
     $table->pagesize($perpage, $totalcount);
 
-    if ($records = get_records_sql($select . $from . $where . $sort, $table->get_page_start(), $table->get_page_size())) {
+    if (($records = get_records_sql($select . $from . $where . $sort, $table->get_page_start(), $table->get_page_size()))) {
         foreach ($records as $record) {
             $actionstatus = authorize_get_status_action($record);
             $color = authorize_get_status_color($actionstatus->status);
@@ -312,7 +312,7 @@ function authorize_print_order_details($orderno)
         $sql = "SELECT SUM(amount) AS refunded FROM {$CFG->prefix}enrol_authorize_refunds " .
                "WHERE (orderid = '" . $orderno . "') AND (status = '" . AN_STATUS_CREDIT . "')";
 
-        if ($refund = get_record_sql($sql)) {
+        if (($refund = get_record_sql($sql))) {
             $extra->sum = floatval($refund->refunded);
         }
         $upto = round($order->amount - $extra->sum, 2);