We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1764
    • 680 Posts
    I’m not sure if we’re supposed to be using this forum or Flyspray for bug reports at this point, so I’ve entered this bug in both. Feel free to delete one or the other.

    I was working on a manager login snippet when I ran into this problem. Here’s my description from the bug report.

    It appears that the allowed IP addresses for user logins is not being saved.

    If you go to Manage Users, click a username, go to the User Setting tab, enter an IP address and click save, no IP address is actually saved.

    I’m not sure I’m looking in the right places but there seems to be no reference to it in either the userattributes table or the saveuser.processor.php file.

    There’s no real urgency for me, I don’t use the feature. I’d be happy to fix it myself but I’d like to make sure that it’s not slated for removal or improvement before I do.

    UPDATE:

    It seems that the same is true of allowed days. Maybe these features are still under development. If they are it would be good to at least hide them from the manager until they are functional. I submitted the bug report anonymously since I knew that webuser account integration was coming soon. Maybe one of the moderators can make the update to Flyspray for me?
      • 32963
      • 1,732 Posts
      Hi aNoble,

      From the test that I just did both Web user and Manager user screens are working. The allowed_ip/allowed_days is being saved. The values are stored inside the user_settings table
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 1764
        • 680 Posts
        I just tried it on another installation that I have access to and it worked for me.

        The installation I was having problems with was on my laptop at home, so when I get home tonight I’ll see if I can track down exactly what’s causing the problem. I had searched save_user.processor.php for allowed_ip and didn’t get anything but now I see that is beacuse of the way that the saveUserSettings function works by excluding variables instead of including them.

        The install I had at home runs on Windows and the one that worked was a Linux box. That may have something to do with it. Thanks for taking the time to look into it.
          • 1764
          • 680 Posts
          Okay, I think I finally have this figured out. It works fine on a Linux box running Apache but not on a Windows box running Apache. I’m not sure if it would work on IIS or not, I don’t have an IIS installation to test it on. The reason is that $GLOBALS are treated differently.

          I created a simple script to do the seting on both machines. Here it is if anyone wants to run a test on IIS.

          <form action="test.php" method="post">
           <input type="hidden" name="test1" value="hello world" />
           <button>Test</button>
          </form>
          
          <hr />
          
          <pre>
          <?php
          print_r($GLOBALS);
          ?>
          </pre>


          I have attached the results from the two boxes.

          Here is the code that is being thrown off. Line 497 of save_user.processor.php.
          $vl = ($GLOBALS[$n]!=$_POST[$n])? $_POST[$n]: "";


          I’m not really sure what the purpose of this code is. Can somebody enlighten me?

          If you look at the attachments and search for the element "test1" and the value "hello world" you’ll soon see the difference between the two platforms. Windows puts the post varibles in the "root" of the array (example: $GLOBALS[’allowed_ip’]) while Windows does not. Which is of course why the code above works differently depending on the platform.

          Anyway, I hope this helps in getting to the bottom of this issue. I am using XAMPP 1.4.7 which means Apache/2.0.51 and PHP 5.0.1. It is possible that it’s an issue with my configuration settings, so it would be helpful if I could get some other people to help out with some testing and let me know their results. Thanks.

          UPDATE:

          Okay, so the upload feature doesn’t like my windows log for some reason so here’s a link.
            • 32963
            • 1,732 Posts

            $vl = ($GLOBALS[$n]!=$_POST[$n])? $_POST[$n]: "";

            The above checks to see if the gloabl system setting is the same as the user settings. if they are the same then the system will not add those settings to the database. If it’s not then the one specified inside $_POST will be used.

            I’m using Windows XP IIS and it seems to be working fine.

              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 1764
              • 680 Posts
              Okay, that makes sense.

              It could be something that is specific to my XAMPP configuration. I’ll try to go over my php.ini file tomorrow and see if there’s anything that looks suspicious. However, if I’m having the problem someone else is bound to have it also.

              Thanks for the quick reply.