#410 Login MRBS with MySQL

open
None
1
2013-11-11
2013-11-06
Diego Matos
No

Hello.
I'm with a problem when I set the MRBS to make login with MySQL.
I follow every steps of documentation and when I try to log show this message User not indentified.
Anybody help me with this problem.

Hugs

1 Attachments

Discussion

  • Campbell Morrison

    When you say "login with MySQL" what have you got $auth['type'] set to?

    Campbell

     
    • Diego Matos

      Diego Matos - 2013-11-06

      $auth["type"]='db_ext"

       
  • Diego Matos

    Diego Matos - 2013-11-06

    $auth["type"]='db_ext"

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2013-11-07

    The best thing to do is probably to put some debugging in authValidateUser($user, $pass) in auth/auth_db_ext.inc

    Campbell

     
    • Comment has been marked as spam. 
      Undo

      You can see all pending comments posted by this user  here

      Anonymous - 2013-11-07

      You could teach me, how to do this?

       
      Last edit: Anonymous 2013-11-07
  • Campbell Morrison

    I've updated auth/auth_db_ext.inc in the trunk to include some better error reporting. I've also posted the file here to save you having to go and retrieve it from the trunk. Use this version of the file and see if it gives you any error information in your error log.

    If you're not getting any error information then add the debugging line

    echo "Number of rows: " . sql_count($r, $conn);
    

    at line 69 in the file. This will tell you how many rows are being retrieved from the external table. If '0' then it means that it can't find the user in the table. If '1' and the login is unsuccessful then it means that it can find the user but the password check is failing for some reason.

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    I'm sorry by the delay.

    I changed the file, but nothing happened, neither error message then I'm pasting the sql code:
    131111 9:35:10 306 Connect root@localhost on
    306 Query select @@version_comment limit 1
    131111 9:35:16 306 Query show databases
    131111 9:35:23 306 Query SELECT DATABASE()
    131111 9:35:24 306 Init DB mbrs
    306 Query show databases
    306 Query show tables
    306 Field List mrbs_area
    306 Field List mrbs_entry
    306 Field List mrbs_repeat
    306 Field List mrbs_room
    306 Field List mrbs_users
    306 Field List mrbs_variables
    306 Field List mrbs_zoneinfo
    131111 9:35:40 306 Query select * from mbrs_users
    131111 9:35:52 306 Query select * from mrbs_users
    131111 9:36:28 295 Init DB mbrs
    295 Query SET NAMES utf8
    295 Query SHOW TABLES LIKE 'mrbs_variables'
    295 Query SELECT variable_content FROM mrbs_variables WHERE variable_name = 'db_version'
    295 Query SELECT variable_content FROM mrbs_variables WHERE variable_name = 'local_db_version'
    307 Connect root@localhost on
    307 Init DB mbrs
    307 Query SET NAMES utf8
    307 Query SELECT password FROM mrbs_users WHERE BINARY name='teste'
    295 Query SELECT area_id
    FROM mrbs_room R, mrbs_area A
    WHERE R.id=0
    AND R.area_id = A.id
    AND R.disabled = 0
    AND A.disabled = 0
    LIMIT 1
    295 Query SELECT id
    FROM mrbs_area
    WHERE disabled=0
    ORDER BY area_name
    LIMIT 1
    295 Query SELECT timezone, resolution, default_duration, default_duration_all_day,
    morningstarts, morningstarts_minutes,
    eveningends, eveningends_minutes,
    private_enabled, private_default, private_mandatory, private_override,
    min_book_ahead_enabled, max_book_ahead_enabled,
    min_book_ahead_secs, max_book_ahead_secs,
    max_per_day_enabled, max_per_day,
    max_per_week_enabled, max_per_week,
    max_per_month_enabled, max_per_month,
    max_per_year_enabled, max_per_year,
    max_per_future_enabled, max_per_future,
    approval_enabled, reminders_enabled, enable_periods,
    confirmation_enabled, confirmed_default
    FROM mrbs_area
    WHERE id=2
    LIMIT 1
    295 Query SELECT COUNT(*) FROM mrbs_area WHERE ((approval_enabled IS NOT NULL) AND (approval_enabled > 0)) AND disabled=0 LIMIT 1
    307 Quit

     
  • Diego Matos

    Diego Matos - 2013-11-11

    After I edited the file adding the error message, then returned 1.
    I don't understand the reason that password check is failing. I'm pasting the system information:
    My server is set with language Portuguese-Br
    Reserva de Salas: MRBS 1.4.10
    Base de Dados: MySQL 5.5.31-0+wheezy1-log
    Sistema operativo: Linux SRVDEBIAN 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686
    Data/Horas no servidor: Seg 11 Nov 2013 09:51:17 BRST
    PHP: 5.4.4-14+deb7u5

     
  • Campbell Morrison

    It looks like the comparison of passwords is failing. What have you got $auth['db_ext']['password_format'] set to? Does this correspond to the method used to encrypt the passwords in the external table?

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    Then, I'm using the default MD5 but I've already tried the others methods without sucess too.
    I didn't not change the method of the encrypt, I used the default script to create database, I didn't change nothing in the database.

    Diego

     
  • Campbell Morrison

    Are you sure you should be using 'db_ext'? It sounds to me as though you should be using 'db'.

    The 'db_ext'authentication method is intended for cases where you already have a database of users and passwords that is generated and maintained by another system. If you just want to use MRBS's own user management tools then use 'db'.

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    I be sure that I'm using db_ext.
    My database is correct, my connection with MRBS and MySQL is Ok.
    The problem is in the authentication when I use db_ext, because if I use any other authentication method the system works ok.

     
  • Campbell Morrison

    Three questions:

    (1) I notice from your SQL query log that the external table is called mrbs_users. Is this a table in a different database to your other mrbs tables?
    (2) When you say you used the default script to create the database, what script do you mean?
    (3) How were the users inserted into the mrbs_users table?

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    Campbell.
    I'm so sorry, I discovered the wrong. The wrong was in the insert of the users in the users table. I'm not inserting the MD5 before of the password.
    I'm sorry one more time, for making you waste your time. When I was wrong.
    Hugs

     
  • Campbell Morrison

    OK, no problem. I'm glad it's working now.

    However I'm still not sure you should be using 'db_ext'. Did you have the database of users before you started using MRBS? If not, then I think you should be using 'db'. Then using the "User list" link in the top right hand corner you can use MRBS to add users and you don't have to worry about creating the md5 hash because MRBS does all that for you.

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    Thanks Campbell.
    The problem was after I created the database and tables, I inserted the users from console MySQL but I didn't know that needed to use the parameter MD5 in the password.
    Now I can explorer others functions.
    I have one more question, how I can to change hours interval?

     
  • Campbell Morrison

    OK, but I still think it would be easier for you to use 'db' and not 'db_ext'. If you use 'db' then you can manage all your users from MRBS and don't have to worry about console MySQL.

    To change the hours interval you need to login to MRBS as an admin, go to the "Rooms" page, select the area you want to change the settings for and then click the Edit icon. The hours interval can be set differently for each area. The default settings for new areas are defined in areadefaults.inc.php. If you want to change them copy them in to your config file and edit them there.

    Campbell

     
  • Diego Matos

    Diego Matos - 2013-11-11

    You are right, to use db is easier than db_ext. Probably you going to follow your advice. Even as I'm not getting to create users with administrator level.

    I'll try to edit the hours interval, because I need less interval.
    I Always copy security of the every files before to edit.

    Diego

     
  • Diego Matos

    Diego Matos - 2013-11-11

    You are right, to use db is easier than db_ext. Probably you going to follow your advice. Even as I'm not getting to create users with administrator level.

    I'll try to edit the hours interval, because I need less interval.
    I Always copy security of the every files before to edit.

    Diego

     
  • Diego Matos

    Diego Matos - 2013-11-11

    You was right Campbell.
    It is very easier to use DB. Now the system is perfect in my application.
    Thanks by help me.
    Now how do I close this ticket?

     
    Last edit: Diego Matos 2013-11-12
  • Diego Matos

    Diego Matos - 2013-11-11
     
    Last edit: Diego Matos 2013-11-11


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks