Skip to content

Commit

Permalink
Some little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 2, 2003
1 parent 5422d75 commit 1421704
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion admin/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

if ($config = data_submitted()) {

$config = (array)$config;
validate_form($config, $err);

if (count($err) == 0) {
Expand All @@ -39,7 +40,7 @@

/// Otherwise fill and print the form.

if (!isset($config)) {
if (empty($config)) {
$config = $CFG;
}

Expand Down
4 changes: 2 additions & 2 deletions admin/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
}

Expand Down
2 changes: 1 addition & 1 deletion course/editsection.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

/// Otherwise fill and print the form.

if (! $form ) {
if (empty($form)) {
$form = $section;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 4 additions & 3 deletions login/change_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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> ->
Expand Down
4 changes: 2 additions & 2 deletions login/forgot_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
2 changes: 1 addition & 1 deletion login/signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1421704

Please sign in to comment.