Trouble with Login Redirect [$_SESSION['PrevUrl']

I'm using the DW functionality to confirm that a user is logged in before allowing access to a page. Everything works except successfully redirecting to the previous URL. Here's the situation:
User accesses a page with a url such as "addtocookbook.php?recipeid=6".
Since the user is not logged in, they are redirected to"login.php".
After successfully logging in, the user is redirected to "addtocookbook.php" without the "recipe=6".
My login page does attempt to direct the user to the previous url (if it exists). I'm not sure if there is a simple way to make the variable $_SESSION['PrevUrl'], used by DW to redirect,  store the entire url.
Any help is appreciated.
Elie Chocron

The problem lies with some obsolete code in the Restrict access to page server behavior. Fortunately, the fix is quite simple.
The affected section of code is as follows:
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
  $MM_referrer .= "?" . $QUERY_STRING;
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo);
  exit;
All that is necessary is to replace the three instances of $QUERY_STRING like this:
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo);
  exit;
The redirect will then work correctly.

Similar Messages

  • Trouble with Ip redirect

    I am having a bit of trouble with ip redirects on an airnet 1042N
    Here is what happens, I turn off ip redirect, everything works fine, turn it on, everything works fine.  The problem is when I apply an ACL to it.
    If I apply an ACL, I can ping web sites, but I can not browse websites or telnet to port 80.  This is simply a test configuration before I move it into production.  10.0.0.0/22 is our subnet.  I want the guest ssid to allow access to the internet, but not the the internal network (with the exception of the gateway (10.0.1.254) , dhcp, and dns servers (same server 10.0.1.221)
    Running config
    Current configuration : 2475 bytes
    version 12.4
    no service pad
    service timestamps debug datetime msec
    service timestamps log datetime msec
    service password-encryption
    hostname testap
    logging rate-limit console 9
    enable secret 5 $1$PBvp$dH8HqNdXBTP7eCzYanRRo.
    no aaa new-model
    dot11 syslog
    dot11 ssid main
       authentication open
       authentication key-management wpa version 2
       wpa-psk ascii 7 1234567890abcdefghi
       ip redirection host 10.0.1.254 access-group 102 in
    dot11 ssid secondary
       authentication open
       authentication key-management wpa version 2
       guest-mode
       wpa-psk ascii 7 075E731F1A5C4F524F4B5B0D06292F212E343D2B
       ip redirection host 10.0.1.254 access-group 103 in
    username Cisco password 7 01300F175804
    bridge irb
    interface Dot11Radio0
    no ip address
    no ip route-cache
    encryption mode ciphers aes-ccm
    ssid main
    ssid secondary
    antenna gain 0
    station-role root
    bridge-group 1
    bridge-group 1 subscriber-loop-control
    bridge-group 1 block-unknown-source
    no bridge-group 1 source-learning
    no bridge-group 1 unicast-flooding
    bridge-group 1 spanning-disabled
    interface Dot11Radio1
    no ip address
    no ip route-cache
    shutdown
    antenna gain 0
    dfs band 3 block
    channel dfs
    station-role root
    bridge-group 1
    bridge-group 1 subscriber-loop-control
    bridge-group 1 block-unknown-source
    no bridge-group 1 source-learning
    no bridge-group 1 unicast-flooding
    bridge-group 1 spanning-disabled
    interface GigabitEthernet0
    ip address 10.0.2.150 255.255.252.0
    no ip route-cache
    duplex auto
    speed auto
    no keepalive
    bridge-group 1
    no bridge-group 1 source-learning
    bridge-group 1 spanning-disabled
    interface BVI1
    ip address 10.0.2.150 255.255.252.0
    no ip route-cache
    ip http server
    no ip http secure-server
    ip http help-path http://www.cisco.com/warp/public/779/smbiz/prodconfig/help/eag
    access-list 101 permit ip any host 10.0.1.254
    access-list 101 permit ip any host 10.0.1.221
    access-list 101 deny   ip 10.0.0.0 0.0.3.255 10.0.0.0 0.0.3.255
    access-list 101 permit ip any any
    access-list 102 permit ip any 10.0.0.0 0.0.3.255
    access-list 103 permit 80 any any
    access-list 103 permit ip any host 10.0.1.254
    access-list 103 permit ip any host 10.0.1.221
    access-list 103 deny   ip 10.0.0.0 0.0.3.255 10.0.0.0 0.0.3.255
    access-list 103 permit ip any any
    access-list 120 permit ip host 10.0.3.41 any
    access-list 120 permit ip any host 10.0.3.41
    bridge 1 route ip
    line con 0
    logging synchronous
    line vty 0 4
    login local
    end

    James:
    Welcome to the forum.
    To enable both encrypted and unencrypted traffic on same radio you need to use VLANs. If you are using only the native VLAN then you are abide by only one encryption method for all SSIDs.
    Check this for multiple SSIDs and multiple VLANs:
    https://supportforums.cisco.com/docs/DOC-14496
    For your network above, you should review the ACL and make sure it allows the needed traffic. Make sure both ports 80 and 23 are opened. Make sure to choose correct ports (udp, tcp) on the ACL.
    You can also try configuring ip redirect from GUI. give a look to the ip redirect doc: http://tiny.cc/gdsekw.
    HTH
    Amjad
    Rating useful replies is more useful than saying "Thank you"

  • Safari produces 404 with login & redirection script, Firefox, IE work fine

    Hi!
    I'm having a bit of trouble with a login script and I was wondering if there were any particular safari bugs I should be aware of?
    The script is a php script that takes login details, redirects the user to an appropriate site based on the login details and logs them into that site automatically... In firefox and IE it works without issue... in safari I get a 404 page not found error...
    The weirdest part is that the script is at:
    www.site.com/script.php
    the 404 not found error appears with:
    www.site.com in the url bar, and if you press refresh the 404 error remains, even though the site can be found... it's really weird...
    Any thoughts would be much appreciated...

    Okay... I've solved it!
    Safari has a little bug/feature: if there is no action specified in a form(meaning the page that will receive the data is the same as the page containing the form) Safari misinterprets it and relocates to... null. I just hardcoded the target in the form and it... worked.

  • X-Fi Xtereme Music mode switching and troubles with channels redirection

    Good Day.
    I have bought a X-Fi sound card and now I have troubles with my speaker system. I have analog stereo system and headphones, I connect them using my amplifier. All cables are connected properly.
    When I use entertainment mode there are no problems with speaker system if 2.0/2.1 is set. But if I set headphones channels become redirected: left becomes right and right becomes left.
    When i use game mode channels are redirected both in 2.0/2.1 and headphones modes.
    If I connect my headphones to sound card directly there are no problems excepting entertainment mode 2.0/2.1 when channels are redirected.
    Please halp me to resolve the problem.
    Thank you.

    Don`t care. I have found the way. Now all clear.:smileyvery-happy:

  • Troubles with login to SubOne portal server

    Hello evrebody,
    at first i'm sorry for my english, it's not good yet :(
    I develope forum based on DiscussionProvider and want to have register users on my forum.
    My trouble:
    I'm trying to login with LoginProvider, and I want that users after login going to another page,
    in the file display.template i wrote
    <form action="http://mainserver.domain.ru/amserver/UI/Login?&goto=http://virtaulsever.ru/portal/dt?provider=SomeProvider" target="_parent" method=post name="userid_form" enctype="application/x-www-form-urlencoded">But when i trying to login i go to the http://virtaulsever.ru/portal/dt?provider=SomeProvider
    but i'm still ANONYMOUS user...
    help me pleaase, how can i register and goto another page.
    Thanks.

    You may specify the module the user have to authenticate with adding in the url parameters module=LDAP for instance.
    Another solution is to specify an authentication level in your authentication module like 0 for anonymous and 1 for LDAP or any other module you are using. Then in the login url, you add the parameter autlevel=1 (require to authenticate against a module for which the level is at least 1).

  • I am having trouble with a redirect virus; how to fix?

    I think I have a virus or spyware on my computer. It redirects me to a third-party site (something like LinkBucks) when I try to visit Facebook, Google or YouTube. This happens in both Safari and in Mozilla Firefox. I have tried scanning with ClamX, MacScan, but they are not finding any viruses. I also downloaded a kit that scans the computer for DNS redirect changer viruses, but it can't find any. What should I do now?

    ComputerUser23483 wrote:
    I think I have a virus or spyware on my computer. It redirects me to a third-party site (something like LinkBucks) when I try to visit Facebook, Google or YouTube. This happens in both Safari and in Mozilla Firefox.
    I have been seeing a few of these over the past few days, so it could be something new, but let me give you a couple of suggestions for what has been discovered in the last couple of weeks.
    Here's an AppleScript written by fane_j which will check for what we know about the last two Flashback Trojans. Open Script Editor (/Applications/Apple Script/) then copy and paste what follows into the window:
    --script begins
    property theItems : {"defaults read ~/.MacOSX/environment", "ls -al /Applications/Safari.app/Contents/Resources/*COAA*", "java -version 2>&1"}
    on run
              set myClip to ""
              repeat with i in theItems
                        try
      do shell script i
                                  set myClip to myClip & result & return & return
                        on error errText
                                  set myClip to myClip & i & " -- " & errText & return & return
                                  set myClip to result
                        end try
              end repeat
      set the clipboard to myClip
    end run
    --script ends
    Press the run button. Results will be on your clipboard which you can paste into a text document, e-mail or back here.
    It performs three checks:
    The first will identify whether or not you have the Flashback.G Trojan (as well as a couple of earlier versions). If you are infected it will look something like this:
       "DYLD_INSERT_LIBRARIES" = "/Users/Shared/.<dylib_filename>.so";
    If it says that, STOP everything and return here for instructions! Do not attempt any file deletions or you can easily lock yourself out of your account.
    If it says anything else or cannot find the file, you are OK on this one.
    The second test looks for the Flashback.N Trojan, but since we have not been able to find anybody who was infected yet and the information on it is incomplete, there's no assurances for this one.
    The third checks to see what version of Java you have. If it says anything less than 1.6.0_29 followed by some other alpha-numerics, you are vulnerable to being infected without any action on your part other than visiting a web site. In such a case use Software Update to get the latest patch.
    The other suggestion would be to check for the old DNSChanger by visiting the site http://www.dcwg.org/checkup.html, click on "Mac OSX" in the left box and follow the directions.
    If that's OK then click on "Checking Via Browser" and follow those directions.
    It's possible that your router is infected, but unfortunately they still have not posted instructions for that.
    To fix any problems you find click on the "Cleanup" tab at the top.
    Feel free to read anything else on the site you might be curious about.

  • Trouble with login password in Keychain Access

    Since upgrading to Snow Leopard, my "Login Password" seems to have changed. Not my account password, thankfully, but the Keychain Access Login Password that enables me to access my Login Keychain. I certainly did not change it, but the password I used in 10.5.8 doesn't work anymore. This has actually happened on two different machines
    I tried the 'First Aid' function in Keychain Access and got this error message:
    Checked password for ~/Library/Keychains/login.keychain
    *Password for ~/Library/Keychains/login.keychain is not the same as login password*, so keychain can't be unlocked automatically
    Login password could not be synchronized with keychain ~/Library/Keychains/login.keychain (-128)
    Unable to read settings for ~/Library/Keychains/login.keychain
    Okay, so how can the Password for the Login Keychain be different from the, uh, Login Password?!?!
    Is there any way to reset a Login Password, or do I just have to start a new one from scratch (really don't want to have to do that)?

    the password for any keychain can be set to anything you want. by default the password for you login keychain is set to be the same as you account password but that's done just for your convenience so that it can be unlocked automatically when you log in. those passwords are completely independent otherwise. changing one has no effect on the other. that said, unless you changed the account password or the keychain password yourself what you are seeing should not be happening.
    did you change your account password? if not your keychain could be corrupt.
    in Keychain Access is your login keychain locked? if it is select it and click on the lock above. if the keychain works ok it should ask you for the keychain password to unlock it. does it work?

  • Trouble with Login

    I can't log in even though I just bought your product.

    Hi temenos1,
    What product did you buy and what error you get while logging in?
    Please contact Customer care ( http://helpx.adobe.com/contact.html ) or Chat with a technical representative ( http://www.adobe.com/support/chat/ivrchat.html ) for all login / Adobe ID related issues.

  • ECC 6.0 - troubles with login password

    Hi, we upgraded the system from 4.6 to ECC 6. and now some of our users have the problems with passwords (login).
    We suspect that more users have the same password. Is it possible that in new verision users need to have different passwords?
    Thanks and BR
    Saso

    Hi
    ECC 6.0 is having case sensitive password
    so we need to enter the same
    regards
    Shiva

  • Trouble with MIDI, redirecting MIDI out to Line-out???

    Hello
    I have yet another question regarding Logic pro and MIDI. I've plugged my keyboard via MIDI to my TC konnekt 8 audio interface, which is then plugged via firewire to my laptop. I've succesfully been able to record a track and now i want to actually hear it. I know im able to hear it via the Midi connection from my interface to the keyboard, but is there a way to "redirect" the output from my MIDI track to the Line-outs on my interface, so that i can hear it on my studio monitors instead??

    I know MIDI has nothing to do with audio, but there might be a way to convert it to audio.
    I just wanna hear my MIDI recorded track without going through the MIDI out/the speakers in my keyboard.
    The keyboard is playing the audio, under instruction from the MIDI commands. To record the audio, or patch it through your interface, you must cable up it's audio output.
    Garageband is a hugely simplified version of Logic. Of course Logic can do anything GB can do.

  • Trouble With Login at startup

    so i had just refreshed my pc due to some issues with the start menu and they cleared so after i updated and rebooted i couldn't type so i tried to use the pop up touchscreen since my laptop has a touch screen and nothing happened so i tried to use the
    on screen keyboard but the ease of access button does absolutely nothing and then begins to lag and then freeze and would like to know if there's a fix or a way to fix it?

    H,
    Do you mean
    that after the updates, you are completely locked out from your machine? Have
    you tried power off the machine, then unplug the keyboard\mouse for moments,
    reconnect again, check the result?
    Yolanda Zhu
    TechNet Community Support

  • Trouble with login -not just a blue screen-

    Ok, here's everything that happened.
    I put my computer to sleep yesterday, everything had been working fine. When I woke it up, I got a kernal panic and had to restart. After restarting, it brought me to the Leopard 'blue screen'. I had already had this upon my initial installation and removed application enhancer -this was months ago-. So, I did my normal thing and booted into windows and tried restarting -this does work sometimes-, didn't work, still get the blue screen. So I booted into safe mode and backed up all my documents and whatnot, I restarted and it actually started successfully, though it was running really hot (173 degrees). So I shut it down for the night and went to bed. Today, I tried starting it again and got the blue screen, I can no longer boot into safe mode, nor can I boot from the Leopard DVD. Only the windows partition works. Any ideas?

    How about trying the things listed here:
    http://docs.info.apple.com/article.html?artnum=303319
    Also, reset PRAM (immediately after pressing power button hold Apple-Option-P-R keys until you hear startup chime three times, then release keys).
    Are you sure you completely got rid of all components of Application Enhancer?
    See http://docs.info.apple.com/article.html?artnum=306857

  • I'm having trouble with something that redirects Google search results when I use Firefox on my PC. It's called the 'going on earth' virus. Do you have a fix that could rectify the vulnerability in your software?

    I'm having trouble with a virus or something which affects Google search results when I use Firefox on my PC ...
    When I search a topic gives me pages of links as normal, but when I click on a link, the page is hijacked to a site called 'www.goingonearth.com' ...
    I've done a separate search and found that other users are affected, but there doesn't seem to be a clear-cut solution ... (Norton, McAfee and Kaspersky don't seem to be able to detect/fix it).
    I'd like to continue using the Firefox/Google combination (nb: the hijack virus also affects IE but not Safari) - do you have a patch/fix that could rectify the vulnerability in your software?
    thanks

    ''' "... vulnerability in your software?" ''' <br />
    And it affects IE, too? Ya probably picked up some malware and you blame it on Firefox.
    Install, update, and run these programs in this order. They are listed in order of efficacy.<br />'''''(Not all programs detect the same Malware, so you may need to run them all to solve your problem.)''''' <br />These programs are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
    ''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
    SuperAntispyware - [http://www.superantispyware.com/] <br />
    AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
    Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]<br />
    Also, if you have a search engine re-direct problem, see this:<br />
    http://deletemalware.blogspot.com/2010/02/remove-google-redirect-virus.html
    If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
    [http://www.spywarewarrior.com/index.php] <br />
    [http://forum.aumha.org/] <br />
    [http://www.spywareinfoforum.com/] <br />
    [http://bleepingcomputer.com]

  • Login User with Dynamic Redirect

    Hi,
    I have used the "Login User with Dynamic Redirect" with asp
    VBScript. But
    now I´m going to make a PHP/MySql site.
    Does anybody know of a extension that can make dynamic
    redirection from
    logon page.??
    /mike.

    Michael wrote:
    > I have used the "Login User with Dynamic Redirect" with
    asp VBScript. But
    > now I�m going to make a PHP/MySql site.
    > Does anybody know of a extension that can make dynamic
    redirection from
    > logon page.??
    You don't need an extension. The built-in Log In User server
    behavior
    does it.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Trouble building login system

    Perhaps this questions is best posed to David Powers, but I'm having some problems with my login system for a site that I'm building with the assistance of "The Essential Guide To Dreamweaver CS4".
    I believe that I have followed his instructions, but when I login using a valid username and password entered into my "users" table in my database, I get redirected to the failed login page.
    I'm using encrypted passwords, and I believe that I have encrypted the password for the login attempt so that it should match the encrypted password in my table.
    Below is the code for my login page:
    <?php require_once('../Connections/aibAdmin.php'); ?>
    <?php
    if (isset($_POST['password'])) {
        $_POST['password'] = sha1($_POST['password']);
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "content_priv";
      $MM_redirectLoginSuccess = "/admin/users/register.php";
      $MM_redirectLoginFailed = "/admin/login.php";
      $MM_redirecttoReferrer = true;
      mysql_select_db($database_aibAdmin, $aibAdmin);
      $LoginRS__query=sprintf("SELECT username, password, content_priv FROM users WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $aibAdmin) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'content_priv');
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;        
        if (isset($_SESSION['PrevUrl']) && true) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Administrator Login</title>
    </head>
    <body>
    <h1>Administrator Login</h1>
    <form action="<?php echo $loginFormAction; ?>" method="POST" name="admin_login" id="adminLogin">
      <p><label for="username">Username:</label>
      <input type="text" name="username" id="username" /></p>
      <p><label for="password">Password:</label>
      <input type="password" name="password" id="password" /></p>
      <input name="submit_button" type="submit" id="submitButton" value="Log In" />
    </form>
    </body>
    </html>
    Any assistance would be greatly appreciated. I'm also eager to learn more, so if there is literature that someone might be willing to suggest, that would be most appreciated as well.
    Thanks!

    Proper Prior Planning Prevents Poor Performance.
    Building a (close to) state of the art machine takes information and patience.
    Components that worked on your previous system will not work on your new one.
    The power supply must have 2 mother board connectors.
    BEFORE YOU RUSH OUT TO BUY A NEW ONE ----
    Make a list of what you plan on having in your new system now and 12 months from now.
    Ok, got the list?
    Find a post from "DANNY"
    Go to the power supply capacity link
    Fill it in
    Buy a power supply that matches your current and future requirements.
    Best of luck

Maybe you are looking for