Skip to content

Commit

Permalink
Remove inline HTML
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed May 25, 2020
1 parent 0b9c35a commit dfc53f3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 46 deletions.
36 changes: 16 additions & 20 deletions examples/openid.php
Expand Up @@ -42,27 +42,25 @@
function Show_page($contents)
{
header('Content-Type: text/html; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>' , "\n";
?>
<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<title>phpMyAdmin OpenID signon example</title>
</head>
<body>
<?php

echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
echo '<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<title>phpMyAdmin OpenID signon example</title>
</head>
<body>';

if (isset($_SESSION['PMA_single_signon_error_message'])) {
echo '<p class="error">' , $_SESSION['PMA_single_signon_message'] , '</p>';
echo '<p class="error">' . $_SESSION['PMA_single_signon_message'] . '</p>';
unset($_SESSION['PMA_single_signon_message']);
}

echo $contents;
?>
</body>
</html>
<?php
echo '</body></html>';
}

/**
Expand Down Expand Up @@ -110,9 +108,7 @@ function Die_error($e)
$content = '<form action="openid.php" method="post">
OpenID: <input type="text" name="identifier"><br>
<input type="submit" name="start">
</form>
</body>
</html>';
</form>';
Show_page($content);
exit;
}
Expand Down
50 changes: 24 additions & 26 deletions examples/signon.php
Expand Up @@ -38,35 +38,33 @@
} else {
/* Show simple form */
header('Content-Type: text/html; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>' , "\n";
?>
<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<title>phpMyAdmin single signon example</title>
</head>
<body>
<?php

echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
echo '<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<title>phpMyAdmin single signon example</title>
</head>
<body>';

if (isset($_SESSION['PMA_single_signon_error_message'])) {
echo '<p class="error">';
echo $_SESSION['PMA_single_signon_error_message'];
echo '</p>';
}
?>
<form action="signon.php" method="post">
Username: <input type="text" name="user" autocomplete="username"><br>
Password: <input type="password" name="password" autocomplete="current-password"><br>
Host: (will use the one from config.inc.php by default)
<input type="text" name="host"><br>
Port: (will use the one from config.inc.php by default)
<input type="text" name="port"><br>
<input type="submit">
</form>
</body>
</html>
<?php

echo '<form action="signon.php" method="post">
Username: <input type="text" name="user" autocomplete="username"><br>
Password: <input type="password" name="password" autocomplete="current-password"><br>
Host: (will use the one from config.inc.php by default)
<input type="text" name="host"><br>
Port: (will use the one from config.inc.php by default)
<input type="text" name="port"><br>
<input type="submit">
</form>
</body>
</html>';
}
?>

0 comments on commit dfc53f3

Please sign in to comment.