]> git.mjollnir.org Git - moodle.git/commitdiff
Some little fixes
authormoodler <moodler>
Thu, 2 Jan 2003 15:25:51 +0000 (15:25 +0000)
committermoodler <moodler>
Thu, 2 Jan 2003 15:25:51 +0000 (15:25 +0000)
admin/auth.php
admin/config.php
course/editsection.php
lib/moodlelib.php
login/change_password.php
login/forgot_password.php
login/signup.php

index ea3da976e1e28a3faefe68f41649b205e1f783ba..cf72f160a775046e347a144bd7fc695f3ca09f5f 100644 (file)
@@ -18,6 +18,7 @@
 
        if ($config = data_submitted()) {
 
+        $config = (array)$config;
         validate_form($config, $err);
 
         if (count($err) == 0) {
@@ -39,7 +40,7 @@
 
 /// Otherwise fill and print the form.
 
-    if (!isset($config)) {
+    if (empty($config)) {
         $config = $CFG;
     }
 
index 48a9b9c1f432459d6cb4a6dd480b456b7380be8d..cb3430e0eb78d62b5af37c4d3316d1e1aad692c0 100644 (file)
 
 /// Otherwise fill and print the form.
 
-    if (!isset($config)) {
+    if (empty($config)) {
         $config = $CFG;
     }
-    if (!isset($focus)) {
+    if (empty($focus)) {
         $focus = "";
     }
 
index 2d2169cf96749f35e5379b0ac88a56862d3d3dc4..eadcdac5f2dc46eba957c9c482ffdeb7f0e24668 100644 (file)
@@ -39,7 +39,7 @@
 
 /// Otherwise fill and print the form.
 
-    if (! $form ) {
+    if (empty($form)) {
         $form = $section;
     }
 
index 599fe5329fbc9f9318e40b43955a6fa0a2b04999..5c9e962befc88ede06b6fd0d3d629b6ae74bb210 100644 (file)
@@ -508,7 +508,7 @@ function authenticate_user_login($username, $password) {
 
     $md5password = md5($password);
 
-    if (!isset($CFG->auth)) {
+    if (empty($CFG->auth)) {
         $CFG->auth = "email";    // Default authentication module
     }
 
index e9a6071e9f01fd4efc25519922a12288e1d032ad..27ce2cf7aee975984cbaf70508e1ee2cd6dd93c6 100644 (file)
         $frm->id = $id;
     }
 
-       if (!$frm->username)
+       if (empty($frm->username)) {
        $frm->username = get_moodle_cookie();
+    }
 
-       if ($frm->username) {
+       if (!empty($frm->username)) {
        $focus = "form.password";
        } else {
        $focus = "form.username";
        }
 
     $strchangepassword = get_string("changepassword");
-    if ($course->id) {
+    if (!empty($course->id)) {
            print_header($strchangepassword, $strchangepassword,
                      "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
                       <A HREF=\"$CFG->wwwroot/user/index.php?id=$course->id\">".get_string("participants")."</A> ->
index 94cf72793a705a71096d2e37969d2cdfc6584e50..ec5ffc73209b5bd603c343c9ebd7148164b21dd1 100644 (file)
@@ -34,8 +34,8 @@
                }
        }
 
-       if ( empty($frm->email) ) {
-               if ( $username = get_moodle_cookie() ) {
+       if (empty($frm->email)) {
+               if ($username = get_moodle_cookie() ) {
                        $frm->email = get_field("user", "email", "username", "$username");
                }
        }
index b3fa090b1fba39b216abb3901c786156a3e7fa55..f07d3c509bcf0e64091644204e389b8c848b1a35 100644 (file)
@@ -37,7 +37,7 @@
         $focus = 'form.' . array_shift(array_flip(get_object_vars($err)));
     }
 
-    if (!$user->country and $CFG->country) {
+    if (empty($user->country) and !empty($CFG->country)) {
         $user->country = $CFG->country;
     }