Permalink
Browse files

Some little fixes

  • Loading branch information...
1 parent 5422d75 commit 14217044a5cc931428efe86ac698ff4f1b139bf2 moodler committed Jan 2, 2003
Showing with 13 additions and 11 deletions.
  1. +2 −1 admin/auth.php
  2. +2 −2 admin/config.php
  3. +1 −1 course/editsection.php
  4. +1 −1 lib/moodlelib.php
  5. +4 −3 login/change_password.php
  6. +2 −2 login/forgot_password.php
  7. +1 −1 login/signup.php
View
3 admin/auth.php
@@ -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;
}
View
4 admin/config.php
@@ -68,10 +68,10 @@
/// Otherwise fill and print the form.
- if (!isset($config)) {
+ if (empty($config)) {
$config = $CFG;
}
- if (!isset($focus)) {
+ if (empty($focus)) {
$focus = "";
}
View
2 course/editsection.php
@@ -39,7 +39,7 @@
/// Otherwise fill and print the form.
- if (! $form ) {
+ if (empty($form)) {
$form = $section;
}
View
2 lib/moodlelib.php
@@ -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
}
View
7 login/change_password.php
@@ -65,17 +65,18 @@
$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> ->
View
4 login/forgot_password.php
@@ -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");
}
}
View
2 login/signup.php
@@ -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;
}

0 comments on commit 1421704

Please sign in to comment.