title = get_string('login'); $this->version = 2007101509; } function applicable_formats() { return array('site' => true); } function get_content () { global $USER, $CFG; $wwwroot = ''; $signup = ''; if ($this->content !== NULL) { return $this->content; } if (empty($CFG->loginhttps)) { $wwwroot = $CFG->wwwroot; } else { // This actually is not so secure ;-), 'cause we're // in unencrypted connection... $wwwroot = str_replace("http://", "https://", $CFG->wwwroot); } if (!empty($CFG->registerauth)) { $authplugin = get_auth_plugin($CFG->registerauth); if ($authplugin->can_signup()) { $signup = $wwwroot . '/login/signup.php'; } } // TODO: now that we have multiauth it is hard to find out if there is a way to change password $forgot = $wwwroot . '/login/forgot_password.php'; $username = get_moodle_cookie() === 'nobody' ? '' : get_moodle_cookie(); $this->content->footer = ''; $this->content->text = ''; if (!isloggedin() or isguestuser()) { // Show the block $this->content->text .= "\n".'
'; $this->content->text .= '
'; $this->content->text .= '
'; $this->content->text .= '
'; $this->content->text .= '
'; $this->content->text .= '
'; $this->content->text .= "
\n"; if (!empty($signup)) { $this->content->footer .= '
'.get_string('startsignup').'
'; } if (!empty($forgot)) { $this->content->footer .= '
'.get_string('forgotaccount').'
'; } } return $this->content; } } ?>