• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Problem logging in to web interface when user name contains a "-"

Scheduled Pinned Locked Moved Solved
Bug Reports
2
4
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    tian
    last edited by Jan 9, 2017, 4:32 PM

    Server
    • FOG Version: 1.3.0 stable (revision 6050)
    • OS: Ubuntu 14.04
    Client
    • Service Version: n/a
    • OS: n/a
    Description

    I upgraded a server (from 1.3.0 RC25, revision 6020), where the user name contains a “-”. In RC25 the login worked correctly, in 1.3.0 final it won’t anymore and gives the message “invalid login” back.

    After trying to find out why it doesn’t work for some time I simply removed the “-” from the user name by editing it in the database directly and it worked instantly with the edited username.

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Jan 9, 2017, 8:45 PM

      If you want to download to give this a shot:

      Immediately would be:

      wget -O /var/www/fog/lib/fog/user.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working-RC-6/packages/web/lib/fog/user.class.php

      If you also use ldap plugin you might need:
      wget -O /var/www/fog/lib/plugins/ldap/class/ldap.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working-RC-6/packages/web/lib/plugins/ldap/class/ldap.class.php

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      T 1 Reply Last reply Jan 10, 2017, 9:02 AM Reply Quote 0
      • T
        Tom Elliott
        last edited by Jan 9, 2017, 8:27 PM

        Typically speaking, usernames don’t contain dashes and I’ve been working to improve checking of things so we have more suitable allowances for things.

        I’ve updated the regex and this new regex should work for ldap and the main username now.

        The regex I’m using is:
        /(?=^.{3,40}$)^[\w][\w0-9]*[._-]?[\w0-9]*[.]?[\w0-9]+$/

        What this translates too:
        Must be at least 3 characters.
        Must be no greater than 40 characters.
        Must start with a word character (not number, character, etc…)
        Can have up to two periods (non-contiguous) test.user.decimals is valid. test…userdecimals is not.
        Only one underscore or - in the username.

        Hopefully this will address the issues you saw and let you log back in.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 2
        • T
          Tom Elliott
          last edited by Jan 9, 2017, 8:45 PM

          If you want to download to give this a shot:

          Immediately would be:

          wget -O /var/www/fog/lib/fog/user.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working-RC-6/packages/web/lib/fog/user.class.php

          If you also use ldap plugin you might need:
          wget -O /var/www/fog/lib/plugins/ldap/class/ldap.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working-RC-6/packages/web/lib/plugins/ldap/class/ldap.class.php

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          T 1 Reply Last reply Jan 10, 2017, 9:02 AM Reply Quote 0
          • T
            tian @Tom Elliott
            last edited by Jan 10, 2017, 9:02 AM

            @Tom-Elliott Thanks for the solution. I’m using the new user.class.php now (renamed the not working one before) and the login with the previous user name (only letters and one “-” in the middle) is ok again.

            (Since we don’t use the ldap integration I didn’t test the ldap.class.php)

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              3/4
              Last post

            168

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project