if ($config = data_submitted()) {
+ $config = (array)$config;
validate_form($config, $err);
if (count($err) == 0) {
/// Otherwise fill and print the form.
- if (!isset($config)) {
+ if (empty($config)) {
$config = $CFG;
}
/// Otherwise fill and print the form.
- if (!isset($config)) {
+ if (empty($config)) {
$config = $CFG;
}
- if (!isset($focus)) {
+ if (empty($focus)) {
$focus = "";
}
/// Otherwise fill and print the form.
- if (! $form ) {
+ if (empty($form)) {
$form = $section;
}
$md5password = md5($password);
- if (!isset($CFG->auth)) {
+ if (empty($CFG->auth)) {
$CFG->auth = "email"; // Default authentication module
}
$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> ->
}
}
- 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");
}
}
$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;
}