]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8096 loginhttps fixes for new advancededit form
authorskodak <skodak>
Fri, 26 Jan 2007 21:45:50 +0000 (21:45 +0000)
committerskodak <skodak>
Fri, 26 Jan 2007 21:45:50 +0000 (21:45 +0000)
admin/settings/users.php
admin/user.php

index e6e2424c70d509fe0fa81726f30df3ebc375e9f4..dbd63a1903518927dc753cedc4c15641e62b3130 100644 (file)
@@ -6,10 +6,15 @@
 $ADMIN->add('users', new admin_externalpage('userauthentication', get_string('authentication','admin'), "$CFG->wwwroot/$CFG->admin/auth.php"));
 
 
+if(empty($CFG->loginhttps)) {
+    $securewwwroot = $CFG->wwwroot;
+} else {
+    $securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
+}
 // stuff under the "accounts" subcategory
 $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
 $ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
-$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$CFG->wwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
+$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
 $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers'), "$CFG->wwwroot/$CFG->admin/uploaduser.php", 'moodle/site:uploadusers'));
 $ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
 
index 190f90f6c0576c6e960b389a0c6a02dd7b640a3c..bd0305ced419fa2ec01e8ce7443d9cf5c560190d 100644 (file)
         }
 
         $mainadmin = get_admin();
+        if(empty($CFG->loginhttps)) {
+            $securewwwroot = $CFG->wwwroot;
+        } else {
+            $securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
+        }
+
         $table->head = array ("$firstname / $lastname", $email, $city, $country, $lastaccess, "", "", "");
         $table->align = array ("left", "left", "left", "left", "left", "center", "center", "center");
         $table->width = "95%";
             }
 
             if (has_capability('moodle/user:update', $sitecontext) and ($user->id==$USER->id or $user->id != $mainadmin->id) and !is_mnet_remote_user($user)) {
-                $editbutton = "<a href=\"../user/editadvanced.php?id=$user->id&amp;course=$site->id\">$stredit</a>";
+                $editbutton = "<a href=\"$securewwwroot/user/editadvanced.php?id=$user->id&amp;course=$site->id\">$stredit</a>";
                 if ($user->confirmed == 0) {
                     $confirmbutton = "<a href=\"user.php?confirmuser=$user->id&amp;sesskey=$USER->sesskey\">" . get_string('confirm') . "</a>";
                 } else {