function drawWidget() { $s = new session(); if (session::check() != false) { $w = new box($this->logged_in_realm_caption); $w->css_box = "login"; $w->addWidget(html::write($this->logged_in_caption . $s->user->username)); $w->addWidget(new button($this->logout_caption, $this->logouttarget . "?logout=1")); return $w->draw(); } $h = new html(); $h->html .= "\n\t\t\t\t\t\n\t\t\t\t\t<form method=\"post\" action=\"" . $this->target . "\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t\t" . $this->realm_caption . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td>" . $this->username_caption . "</td><td><input type=\"text\" name=\"username\"></td></tr>\t\t\t\n\t\t\t\t\t\t<tr><td>" . $this->password_caption . "</td><td><input type=\"password\" name=\"password\"></td></tr>\n\t\t\t\t\t\t<tr><td><input type=\"submit\" value=\"" . $this->submit_caption . "\"></td></tr></table></form>"; $b = new box($this->realm_caption, $h); $b->css_box = "login"; return $b->draw(); }