Hi folks,

I wrote a small patch agains phpsyslog-ng 2.9.2a which improves the user 
experience in the following situation:
1) authentication is enabled and user is currently not logged in
2) she opens a bookmarked search query

The old behaviour was to show the login page and then redirect to the search 
form. Then the user has either to open her bookmark again or build the search 
query in the search form.

The new behaviour is to remember the search query, show the login page and 
upon successful login show the search results.

Attached the patch. If it doesn't make it through this list feel free to 
request it directly.

best regards,

Felix
diff -u -r phpsyslogng.orig/includes/login.php phpsyslogng.patched/includes/login.php
--- phpsyslogng.orig/includes/login.php 2006-09-15 08:30:15.000000000 +0200
+++ phpsyslogng.patched/includes/login.php      2006-09-15 08:34:01.000000000 +0200
@@ -98,9 +98,14 @@
        // CDUKES - Changed click to META redirect
        //echo "<a href=\"index.php\">Success! Click here!</a>";

-       // CDUKES - Changed click to redirect
-       g_redirect(SITEURL . "index.php?pageId=Searchform",JS);
-
+       // CDUKES - Changed click to redirece
+       // F. Leimbach - Add logic to remember the requested query throughout a login
+       $searchQuery = get_input('searchQuery');
+       if (isset($searchQuery) && !empty($searchQuery)) {
+              g_redirect(SITEURL . "index.php?pageId=Searchform&amp;" . $searchQuery, JS);
+       } else {
+              g_redirect(SITEURL . "index.php?pageId=Searchform",JS);
+       }
 }
 //========================================================================
 // END: HANDLE LOGIN REQUEST
@@ -140,6 +145,11 @@
        <tr><td class="darker">
        <input type="submit" name="pageId" value="Login">
        <input type="reset" value="Reset">
+       <?php
+       // F. Leimbach - Add logic to remember the requested query throughout a login
+       if (isset($searchQuery))
+              echo '<input type="hidden" name="searchQuery" value="'.$searchQuery.'">';
+       ?>
        </td></tr></table>
 </td></tr></table>
 </form>
diff -u -r phpsyslogng.orig/index.php phpsyslogng.patched/index.php
--- phpsyslogng.orig/index.php  2006-09-15 08:30:15.000000000 +0200
+++ phpsyslogng.patched/index.php       2006-09-15 08:31:36.000000000 +0200
@@ -50,6 +50,10 @@
        if(strcasecmp($pageId, "about") != 0 && strcasecmp($pageId, "login") != 0 && strcasecmp($pageId, "help") != 0 || ($username && $sessionId)) {

                if(!$sessionVerified = verify_session($username, $sessionId, $dbLink)) {
+                       // F. Leimbach - Add logic to remember the requested query throughout a login
+                       if (strtolower($pageId) == "search" && !empty($_SERVER['QUERY_STRING'])) {
+                              $searchQuery = $_SERVER['QUERY_STRING'];
+                       }
                        $pageId = "login";
                }
        }
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Php-syslog-ng-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/php-syslog-ng-support

Reply via email to