You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-03-19 12:07:07

goude
Member
Registered: 2012-03-01
Posts: 30

Can not login anymore, plz help me

Hello everyone

I am trying to login as superuser to GLPI (v80.7) but I get the following message: sad

You do not have access to this application because your account was deactivated or removed.

I have not deactivated or removed my account. hmm

Is there a way to get it back? Is it possible to create a new account in mysql?
If you have any suggestions, please let me know.

Many thanks.

P.S: Please help me! roll

Last edited by goude (2012-03-20 14:17:11)

Offline

#2 2012-03-26 16:09:16

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

Anyone, please? roll

Offline

#3 2012-03-27 10:09:58

Jolly_Swede
Member
Registered: 2012-02-16
Posts: 28

Re: Can not login anymore, plz help me

Can you login is as glpi/glpi or any other of the default accounts?

Offline

#4 2012-03-28 10:35:18

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

No I can not.
I have tried all the default accounts.

glpi/glpi: You do not have access to this application because your account was deactivated or removed
tech/tech: You do not have access to this application because your account was deactivated or removed
normal/normal: You do not have access to this application because your account was deactivated or removed
postonly/postonly: Incorrect username or password

Offline

#5 2012-03-28 13:40:25

eiseli
Member
From: Switzerland
Registered: 2008-06-10
Posts: 148

Re: Can not login anymore, plz help me

Goude,

If your default accounts have been deleted, then testing with them will not work. Is this the reason?

For your regular account: what is the authentication mode? If the authentication mode is say AD through LDAP, then you might be unable to log in because the AD-organization tree has been modified or because the server running the AD cannot be reached (offline, DNS problem?)

I've once had this situation and wrote a script for temporarily changing my authentication mode to glpi internal and password to "glpi". Hope that helps:

#!/bin/bash
. /root/bin/_mysqlauth # contains MYSQL_USER_PASS variable assignment

echo "Interactive Script for changing authentication type of a given user"
echo

read -p "Username (lowercase)          : " s_USERNAME
read -p "Auth-Type (1=password, 3=LDAP): " s_AUTH

case $s_AUTH in
1)
        s_PASS="0915bd0a5c6e56d8f38ca2b390857d4949073f41"
        echo "Password will be set to 'glpi'" ;;
3)
        s_PASS="" ;;
*)
        echo "Wrong Authentication type $s_AUTH"
        exit 1;;
esac

mysql -t --password=$MYSQL_USER_PASS glpi <<EOF

SELECT name, realname, firstname, auths_id, authtype, password
FROM glpi_users
WHERE LOWER(name)="$s_USERNAME";

UPDATE glpi_users
SET authtype=$s_AUTH, password="$s_PASS"
WHERE LOWER(name)="$s_USERNAME";

SELECT name, realname, firstname, auths_id, authtype, password
FROM glpi_users
WHERE LOWER(name)="$s_USERNAME";
;

EOF
exit 0

Working environment: Fedora 22, GLPI 0.90.1, upgraded from 0.72.0, 0.78, 0.83 PHP/5.6.16, MySQL/10.0.21-MariaDB, Apache/2.4.17, Firefox 43
Transifex: https://www.transifex.com/accounts/profile/eiseli/

Offline

#6 2012-03-28 14:53:32

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

Eiseli

Thank you for your reply.

My Glpi was still in a testing environment when it suddenly refused to let me login. I only had one test account created and it was authenticating with IMAP. This account was a simple user account who was able to raise tickets and view ticket progress. That's the only account
I created and if I try to log in with this account now I get the "username or password incorrect" error.

I don't think any of the accounts are deleted because in the mysql database I created for GLPI, I can see all the accounts there (in glpi_users), including their encrypted passwords.

I tried running your script but I get the following:

 line 2: /root/bin/_mysqlauth: No such file or directory
Interactive Script for changing authentication type of a given user

Username (lowercase)          : uttapl01
Auth-Type (1=password, 3=LDAP): 1
Password will be set to 'glpi'
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I installed GLPI on Centos 2.6.18-194.el5 and mysql 5.0.7
Do you know where my _mysqlauth file would be so I can point your script in the right path?

Many thanks for your help.

Offline

#7 2012-03-28 18:16:25

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

I commented out line2, and then manually entered the mysql database_name and password into the script.

The script runs. I enter my
username: glpi
Auth_method: 1

and then the script returned:

+------+----------+-----------+----------+----------+------------------------------------------+
| name | realname | firstname | auths_id | authtype | password                                 |
+------+----------+-----------+----------+----------+------------------------------------------+
| glpi | Admin    | Glpi      |        0 |        1 | 0915bd0a5c6e56d8f38ca2b390857d4949073f41 | 
+------+----------+-----------+----------+----------+------------------------------------------+
+------+----------+-----------+----------+----------+------------------------------------------+
| name | realname | firstname | auths_id | authtype | password                                 |
+------+----------+-----------+----------+----------+------------------------------------------+
| glpi | Admin    | Glpi      |        0 |        1 | 0915bd0a5c6e56d8f38ca2b390857d4949073f41 | 
+------+----------+-----------+----------+----------+------------------------------------------+

but I still can not login and get the same error.

I also tried entering a blank password using

s_PASS=""

but now GLPI instead
of telling me that the account has been deactivated or removed I get the "empty login or password" error.

This is what the script returned when I deleted the glpi password and left it blank.

Interactive Script for changing authentication type of a given user

Username (lowercase)          : glpi
Auth-Type (1=password, 3=LDAP): 1
Password will be set to 'glpi'
+------+----------+-----------+----------+----------+----------+
| name | realname | firstname | auths_id | authtype | password |
+------+----------+-----------+----------+----------+----------+
| glpi | Admin    | Glpi      |        0 |        1 |          | 
+------+----------+-----------+----------+----------+----------+
+------+----------+-----------+----------+----------+----------+
| name | realname | firstname | auths_id | authtype | password |
+------+----------+-----------+----------+----------+----------+
| glpi | Admin    | Glpi      |        0 |        1 |          | 
+------+----------+-----------+----------+----------+----------+

It looks like I have 2 glpi accounts.....:0. Even though the password is deleted, it still does not let me login.:(
I am tempted to re-install GLPI but I spend so much time entering almost all inventory information (printers, pc's, etc) and I really don't want to go through this again. If you have any more suggestions that will help me to avoid re-installing the software, please let me know.

Thank you for the help

Last edited by goude (2012-03-28 18:24:12)

Offline

#8 2012-03-28 18:26:01

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

By the way, your script is quite cool.

Thanks for sharing.

Offline

#9 2012-03-29 08:58:10

eiseli
Member
From: Switzerland
Registered: 2008-06-10
Posts: 148

Re: Can not login anymore, plz help me

Hi Goude,

No, you don't have 2 glpi accounts. The script first shows the record _before_ the update, then _after the update.

The output of the script shows that when you "changed" the auth method to "1" it actually didn't change anything. So obviously it was not an LDAP issue.

Changing the password to "empty" will not work either, because GLPI needs a password for logging in, that's why you get that error.

I now think that the reason of your problem is the following: the user GLPI has no profile and no territory assigned, that's why it doesn't let you in.

Try the following code on the shell

mysql -p glpi

mysql> select u.id, u.name, u.authtype, u.password, p.id pid, p.name pname, u.is_active, u.is_deleted from glpi_users u left join glpi_profiles_users pu on u.id=pu.users_id left join glpi_profiles p on pu.profiles_id=p.id where u.name='glpi';

if pid and pname right of the password show NULL, it means you have no profile assigned to the user glpi. Then try this:

mysql> insert into glpi_profiles_users (users_id,profiles_id,entities_id,is_recursive,is_dynamic) values (2,1,0,1,0);

if the column is_active is 0 and/or is_deleted is 1 then do this:

mysql> update glpi_users set is_active=1, is_deleted=0 where id=2;

Good luck!


Working environment: Fedora 22, GLPI 0.90.1, upgraded from 0.72.0, 0.78, 0.83 PHP/5.6.16, MySQL/10.0.21-MariaDB, Apache/2.4.17, Firefox 43
Transifex: https://www.transifex.com/accounts/profile/eiseli/

Offline

#10 2012-03-29 09:02:28

eiseli
Member
From: Switzerland
Registered: 2008-06-10
Posts: 148

Re: Can not login anymore, plz help me

by the way, after doing this you will have to reset the password to glpi with my original script then you should be able to log in.


Working environment: Fedora 22, GLPI 0.90.1, upgraded from 0.72.0, 0.78, 0.83 PHP/5.6.16, MySQL/10.0.21-MariaDB, Apache/2.4.17, Firefox 43
Transifex: https://www.transifex.com/accounts/profile/eiseli/

Offline

#11 2012-04-02 11:10:48

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

Hi Eiseli

I followed what you suggested but I still can't login:(  That's what I did:

mysql -p glpibase

(my database name: glpibase)

I got prompted for a password. I tried, glpi, blank, and the initial password I set when I install glpi but access is denied::
ERROR 1045 (28000): Access denied for user 'root'@'localhost'

Then I logged in as root and run your command

mysql> mysql -u root -p
           mysql> use glpibase; 

mysql> select u.id, u.name, u.authtype, u.password, p.id pid, p.name pname, u.is_active, u.is_deleted from glpi_users u left join glpi_profiles_users pu on u.id=pu.users_id left join glpi_profiles p on pu.profiles_id=p.id where u.name='glpi';

The command return:

+----+------+----------+----------+------+-------------+-----------+------------+
| id | name | authtype | password | pid  | pname       | is_active | is_deleted |
+----+------+----------+----------+------+-------------+-----------+------------+
|  2 | glpi |        1 |          |    4 | super-admin |         1 |          0 | 
+----+------+----------+----------+------+-------------+-----------+------------+
1 row in set (0.00 sec)

As you can see pid and pname right of the password does not show NULL, so I didn't continue with the second command you suggested.

Then I run:

update glpi_users set is_active=1, is_deleted=0 where id=2;

then I exited mysql and run your script again with no errors, tried to login but access denied.

Last edited by goude (2012-04-02 11:30:06)

Offline

#12 2012-04-02 12:05:32

eiseli
Member
From: Switzerland
Registered: 2008-06-10
Posts: 148

Re: Can not login anymore, plz help me

Sorry then. It's hard to tell you what got broken when I don't have access to the database. I suggest you make a parallell installation of GLPI and compare the values in the tables, and find out this way where your bug is.


Working environment: Fedora 22, GLPI 0.90.1, upgraded from 0.72.0, 0.78, 0.83 PHP/5.6.16, MySQL/10.0.21-MariaDB, Apache/2.4.17, Firefox 43
Transifex: https://www.transifex.com/accounts/profile/eiseli/

Offline

#13 2012-04-02 13:28:42

goude
Member
Registered: 2012-03-01
Posts: 30

Re: Can not login anymore, plz help me

Eiseli

It works. smile smile smile smile smile smile smile smile smile smile smile smile smile smile

Initially I had commented out the line in your script that sets the password to glpi so I could set a blank password instead.
I had forgotten to uncomment that line. I re-run the script and it works.

Thank you very much for all your help. I really appreciated. I was very close to re-installing.
Many many thanks.

You are star

Last edited by goude (2012-04-02 13:36:59)

Offline

Board footer

Powered by FluxBB