bug 1192: Store oldlocation for convenience of the user and improve coding
authorMichael Tänzer <neo@nhng.de>
Wed, 26 Feb 2014 03:42:04 +0000 (04:42 +0100)
committerMichael Tänzer <neo@nhng.de>
Wed, 26 Feb 2014 03:42:04 +0000 (04:42 +0100)
style

Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/loggedin.php

index cfd064f..4054f5f 100644 (file)
                exit;
        }
 
-       if (!isset($_SESSION['profile']['ccaagreement']) || !$_SESSION['profile']['ccaagreement'] == True) {
+       if (!isset($_SESSION['profile']['ccaagreement']) || !$_SESSION['profile']['ccaagreement']) {
                $_SESSION['profile']['ccaagreement']=get_user_agreement_status($_SESSION['profile']['id'],'CCA');
-               if ($_SESSION['profile']['ccaagreement'] == FALSE) {
-                       header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=52");
+               if (!$_SESSION['profile']['ccaagreement']) {
+                       $_SESSION['_config']['oldlocation'] = $_SERVER['REQUEST_URI'];
+                       header("Location: https://{$_SERVER['HTTP_HOST']}/index.php?id=52");
                        exit;
                }
        }