]> git.mjollnir.org Git - moodle.git/commitdiff
isguest() to has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTE...
authorethem <ethem>
Fri, 22 Sep 2006 15:31:04 +0000 (15:31 +0000)
committerethem <ethem>
Fri, 22 Sep 2006 15:31:04 +0000 (15:31 +0000)
enrol/authorize/enrol.php
enrol/authorize/index.php

index 1d95f531d39b9cb1343db8de177a47e8648e7239..04edb2ec2c7c41b32748c934a6a7c7dbc1b6da65 100755 (executable)
@@ -45,6 +45,8 @@ class enrolment_plugin_authorize
             return;
         }
 
+        httpsrequired();
+
         if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
             if (empty($CFG->loginhttps)) {
                 error(get_string('httpsrequired', 'enrol_authorize'));
@@ -55,8 +57,6 @@ class enrolment_plugin_authorize
             }
         }
 
-        httpsrequired();
-
         $strcourses = get_string('courses');
         $strloginto = get_string('loginto', '', $course->shortname);
 
@@ -70,7 +70,7 @@ class enrolment_plugin_authorize
         }
 
         print_simple_box_start('center');
-        if (isguest()) {
+        if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)) {
             $curcost = get_course_cost($course);
             echo '<div align="center">';
             echo '<p>'.get_string('paymentrequired').'</p>';
index 894e3315be6e6a6b51f7156ad9f8e51f6eb6b1fd..e806e656f643398c6f3d7b6d486b84a014eeb6cc 100644 (file)
@@ -12,7 +12,7 @@
 /// Only site users can access to this page
     require_login(); // Don't use $courseid! User may want to see old orders.
 
-    if (isguest()) {
+    if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false)) {
         error("Guests cannot use this page.");
     }