Skip to content

Add showFeedback function #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,23 @@ public function getUserLoginStatus()
return $this->user_is_logged_in;
}

/**
* Show feedback function, you can custom the way it's shown
*/
private function showFeedback(){
if ($this->feedback) {
echo $this->feedback . "<br/><br/>";
}
}

/**
* Simple demo-"page" that will be shown when the user is logged in.
* In a real application you would probably include an html-template here, but for this extremely simple
* demo the "echo" statements are totally okay.
*/
private function showPageLoggedIn()
{
if ($this->feedback) {
echo $this->feedback . "<br/><br/>";
}
$this->showFeedback();

echo 'Hello ' . $_SESSION['user_name'] . ', you are logged in.<br/><br/>';
echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?action=logout">Log out</a>';
Expand All @@ -368,9 +375,7 @@ private function showPageLoggedIn()
*/
private function showPageLoginForm()
{
if ($this->feedback) {
echo $this->feedback . "<br/><br/>";
}
$this->showFeedback();

echo '<h2>Login</h2>';

Expand All @@ -392,9 +397,7 @@ private function showPageLoginForm()
*/
private function showPageRegistration()
{
if ($this->feedback) {
echo $this->feedback . "<br/><br/>";
}
$this->showFeedback();

echo '<h2>Registration</h2>';

Expand Down