Changeset:
c391c0c6e1cd
https://sourceforge.net/p/mrbs/hg-code/ci/c391c0c6e1cd7f39d8cba526924236b4cf29a652
Author:
Campbell Morrison <[email protected]>
Date:
Thu Mar 02 11:49:02 2017 +0000
Log message:
Moved generation of the Logoff button out into a function.
diffstat:
web/session/functions_session.inc | 18 ++++++++++++++++++
web/session/session_cookie.inc | 12 +-----------
web/session/session_joomla.inc | 12 +-----------
web/session/session_php.inc | 12 +-----------
web/session/session_wordpress.inc | 12 +-----------
5 files changed, 22 insertions(+), 44 deletions(-)
diffs (113 lines):
diff -r 2c2f7d0d46ad -r c391c0c6e1cd web/session/functions_session.inc
--- a/web/session/functions_session.inc Thu Mar 02 11:25:32 2017 +0000
+++ b/web/session/functions_session.inc Thu Mar 02 11:49:02 2017 +0000
@@ -67,3 +67,21 @@
"</a>\n";
echo $html;
}
+
+
+function print_logoff_button($target_url)
+{
+ $html = '';
+
+ $html .= "<form method=\"post\" action=\"admin.php\">\n";
+ $html .= "<div>\n";
+ $html .= "<input type=\"hidden\" name=\"target_url\" value=\"" .
htmlspecialchars($target_url) . "\">\n";
+ $html .= "<input type=\"hidden\" name=\"Action\" value=\"SetName\">\n";
+ $html .= "<input type=\"hidden\" name=\"NewUserName\" value=\"\">\n";
+ $html .= "<input type=\"hidden\" name=\"NewUserPassword\" value=\"\">";
+ $html .= "<input type=\"submit\" value=\"" . get_vocab('logoff') . "\">\n";
+ $html .= "</div>\n";
+ $html .= "</form>\n";
+
+ echo $html;
+}
diff -r 2c2f7d0d46ad -r c391c0c6e1cd web/session/session_cookie.inc
--- a/web/session/session_cookie.inc Thu Mar 02 11:25:32 2017 +0000
+++ b/web/session/session_cookie.inc Thu Mar 02 11:49:02 2017 +0000
@@ -273,17 +273,7 @@
if (isset($user))
{
print_report_link($user);
-?>
- <form method="post" action="admin.php">
- <div>
- <input type="hidden" name="target_url" value="<?php echo
htmlspecialchars($target_url) ?>">
- <input type="hidden" name="Action" value="SetName">
- <input type="hidden" name="UserName" value="">
- <input type="hidden" name="UserPassword" value="">
- <input type="submit" value=" <?php echo get_vocab('logoff') ?> ">
- </div>
- </form>
- <?php
+ print_logoff_button($target_url);
}
else
{
diff -r 2c2f7d0d46ad -r c391c0c6e1cd web/session/session_joomla.inc
--- a/web/session/session_joomla.inc Thu Mar 02 11:25:32 2017 +0000
+++ b/web/session/session_joomla.inc Thu Mar 02 11:49:02 2017 +0000
@@ -133,17 +133,7 @@
if (isset($user))
{
print_report_link($user);
- ?>
- <form method="post" action="admin.php">
- <div>
- <input type="hidden" name="target_url" value="<?php echo
htmlspecialchars($target_url) ?>">
- <input type="hidden" name="Action" value="SetName">
- <input type="hidden" name="NewUserName" value="">
- <input type="hidden" name="NewUserPassword" value="">
- <input type="submit" value=" <?php echo
get_vocab('logoff') ?> ">
- </div>
- </form>
-<?php
+ print_logoff_button($target_url);
}
else
{
diff -r 2c2f7d0d46ad -r c391c0c6e1cd web/session/session_php.inc
--- a/web/session/session_php.inc Thu Mar 02 11:25:32 2017 +0000
+++ b/web/session/session_php.inc Thu Mar 02 11:49:02 2017 +0000
@@ -202,17 +202,7 @@
if (isset($user))
{
print_report_link($user);
- ?>
- <form method="post" action="admin.php">
- <div>
- <input type="hidden" name="target_url" value="<?php echo
htmlspecialchars($target_url) ?>">
- <input type="hidden" name="Action" value="SetName">
- <input type="hidden" name="NewUserName" value="">
- <input type="hidden" name="NewUserPassword" value="">
- <input type="submit" value=" <?php echo
get_vocab('logoff') ?> ">
- </div>
- </form>
-<?php
+ print_logoff_button($target_url);
}
else
{
diff -r 2c2f7d0d46ad -r c391c0c6e1cd web/session/session_wordpress.inc
--- a/web/session/session_wordpress.inc Thu Mar 02 11:25:32 2017 +0000
+++ b/web/session/session_wordpress.inc Thu Mar 02 11:49:02 2017 +0000
@@ -139,17 +139,7 @@
if (isset($user))
{
print_report_link($user);
- ?>
- <form method="post" action="admin.php">
- <div>
- <input type="hidden" name="target_url" value="<?php echo
htmlspecialchars($target_url) ?>">
- <input type="hidden" name="Action" value="SetName">
- <input type="hidden" name="NewUserName" value="">
- <input type="hidden" name="NewUserPassword" value="">
- <input type="submit" value=" <?php echo
get_vocab('logoff') ?> ">
- </div>
- </form>
- <?php
+ print_logoff_button($target_url);
}
else
{
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits