Changeset:
553b69e54c49
https://sourceforge.net/p/mrbs/hg-code/ci/553b69e54c495a28f5309ba20a671bb315d7777a
Author:
Campbell Morrison <[email protected]>
Date:
Thu Mar 16 11:11:16 2017 +0000
Log message:
Restructured code
diffstat:
web/session/functions_session.inc | 9 ++++++++-
web/session/session_cookie.inc | 8 ++++----
web/session/session_joomla.inc | 8 ++++----
web/session/session_php.inc | 8 ++++----
web/session/session_wordpress.inc | 6 +++---
5 files changed, 23 insertions(+), 16 deletions(-)
diffs (149 lines):
diff -r 60eca9fd7e31 -r 553b69e54c49 web/session/functions_session.inc
--- a/web/session/functions_session.inc Thu Mar 16 10:49:36 2017 +0000
+++ b/web/session/functions_session.inc Thu Mar 16 11:11:16 2017 +0000
@@ -1,11 +1,18 @@
<?php
namespace MRBS;
+
+function print_login_failed()
+{
+ echo "<p>" . get_vocab('unknown_user') . "</p>\n";
+}
+
+
/*
Display the login form.
Will eventually return to $target_url with query string returl=$returl
*/
-function printLoginForm($action, $target_url, $returl)
+function print_login_form($action, $target_url, $returl)
{
$html = '';
diff -r 60eca9fd7e31 -r 553b69e54c49 web/session/session_cookie.inc
--- a/web/session/session_cookie.inc Thu Mar 16 10:49:36 2017 +0000
+++ b/web/session/session_cookie.inc Thu Mar 16 11:11:16 2017 +0000
@@ -75,8 +75,8 @@
if (($valid_username = authValidateUser($NewUserName, $NewUserPassword))
=== false)
{
print_header();
- echo "<p>".get_vocab('unknown_user')."</p>\n";
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_failed();
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
else
@@ -151,7 +151,7 @@
if (isset($Action) && ($Action == "QueryName"))
{
print_header();
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
@@ -175,7 +175,7 @@
{
$target_url = $target_url . "?" . $QUERY_STRING;
}
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
diff -r 60eca9fd7e31 -r 553b69e54c49 web/session/session_joomla.inc
--- a/web/session/session_joomla.inc Thu Mar 16 10:49:36 2017 +0000
+++ b/web/session/session_joomla.inc Thu Mar 16 11:11:16 2017 +0000
@@ -44,8 +44,8 @@
if (!$mainframe->login($credentials))
{
print_header();
- echo "<p>".get_vocab('unknown_user')."</p>\n";
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_failed();
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
}
@@ -83,7 +83,7 @@
if (isset($Action) && ($Action == "QueryName"))
{
print_header();
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
@@ -107,7 +107,7 @@
{
$target_url = $target_url . "?" . $QUERY_STRING;
}
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
diff -r 60eca9fd7e31 -r 553b69e54c49 web/session/session_php.inc
--- a/web/session/session_php.inc Thu Mar 16 10:49:36 2017 +0000
+++ b/web/session/session_php.inc Thu Mar 16 11:11:16 2017 +0000
@@ -103,8 +103,8 @@
if (($valid_username = authValidateUser($NewUserName, $NewUserPassword))
=== false)
{
print_header();
- echo "<p>".get_vocab('unknown_user')."</p>\n";
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_failed();
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
$_SESSION["UserName"] = $valid_username;
@@ -145,7 +145,7 @@
if (isset($Action) && ($Action == "QueryName"))
{
print_header();
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
@@ -170,7 +170,7 @@
{
$target_url = $target_url . "?" . $QUERY_STRING;
}
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
diff -r 60eca9fd7e31 -r 553b69e54c49 web/session/session_wordpress.inc
--- a/web/session/session_wordpress.inc Thu Mar 16 10:49:36 2017 +0000
+++ b/web/session/session_wordpress.inc Thu Mar 16 11:11:16 2017 +0000
@@ -26,7 +26,7 @@
if (isset($Action) && ($Action == "QueryName"))
{
print_header();
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
@@ -53,7 +53,7 @@
$errors = $wp_user; // $errors is a WordPress global
print_header();
echo "<p>" . apply_filters ('login_errors',
$wp_user->get_error_message()) . "</p>\n";
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
}
@@ -105,7 +105,7 @@
{
$target_url = $target_url . "?" . $QUERY_STRING;
}
- printLoginForm(this_page(), $target_url, $returl);
+ print_login_form(this_page(), $target_url, $returl);
exit();
}
------------------------------------------------------------------------------
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