ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: kucing on February 09, 2014, 07:46:15 pm

Title: Problem with admin access
Post by: kucing on February 09, 2014, 07:46:15 pm
Is there anyway to manually change the password for admin?

After I updated the forum to beta2, I can login the admin account just fine but not to administration centre.
Title: Re: Problem with admin access
Post by: TE on February 09, 2014, 11:01:54 pm
This helped me with that password change:
1) Run upgrade.php, this is nessecearry due to the password size
2) use another browser or alternatively clear the browsers chache and cookies.

This should help you to reset an admin account. First thing you need to to; enable the password conversion, via phpMyadmin :

Code: [Select]
REPLACE INTO elkarte_settings (
[icode]variable[/icode] ,
[icode]value[/icode]
)
VALUES (
'enable_password_conversion',  '1'
);


Then you can reset the admin password to a cleartext password, again via phpMyAdmin:
 (mypassword is your new password, myadmin_name needs to be replaced with your admin login name)
Code: [Select]
UPDATE elkarte_members SET passwrd = 'mypassword,', password_salt ='' WHERE member_name = 'myadim_name';
Title: Re: Problem with admin access
Post by: kucing on February 09, 2014, 11:40:53 pm
Where is this upgrade.php? I search it in the elkarte beta2 folder and cannot found it. Is this an external tool?
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 12:14:16 am
the files are part of the DEV packages (direct download from Github)..

/me thinks we need an upgrade packages as well..
I've attached the neccessary files.
Title: Re: Problem with admin access
Post by: emanuele on February 10, 2014, 01:19:22 am
I think that you can just logout and login again... I think!
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 01:28:34 am
Quote from: emanuele – I think that you can just logout and login again... I think!
IIRC the passwrd column was varchar(32) before the password change and needs to be varchar(64)..
Or am I wrong?
Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 03:48:08 am
Quote from: emanuele – I think that you can just logout and login again... I think!
already tried that before posting the problem. will try the upgrade.php file now.

edit:
upgrade script stopped at aim field and cannot continue,
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 05:21:40 am
ah damn, that's a bug..
Try this one please, should work..
Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 08:47:40 am
I already followed to run upgrade.php, then enable password conversion and manually change the password. but it still not let me enter the administration centre, but I can login to my admin account normally just fine.
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 08:53:43 am
That's the browser caching issue I ran into a couple of days ago.. Clearing the browser's cache should solve it.
Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 09:08:08 am
I already tried using Mozilla Firefox (my default browser), Google Chrome and Internet Explorer, clearing my cache (but I never use Internet Explorer to visit my forum) and still cannot enter the administration centre.

any suggestions?
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 09:14:28 am
have you tried what emanuele suggested?.. completely log out and then log in again,  it should delete the cookie and regenerate it.
Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 09:28:11 am
done relogging multiple times on all browsers :( actually that is the first thing I do when I cannot enter the administration center, I remembered this when reading whoever (Spuds?) said it before when talking about password change for beta2 in the past.

Maybe I should try another computer tomorrow.

side note: Like is still not active even when enabled (well I can't check it while administration is off limit), this I reported before at beta1. Maybe problem in migration from smf2 to elkarte.
Title: Re: Problem with admin access
Post by: Jorin on February 10, 2014, 09:35:44 am
Quote from: kucing – side note: Like is still not active even when enabled (well I can't check it while administration is off limit), this I reported before at beta1. Maybe problem in migration from smf2 to elkarte.

I think not. I migrated a SMF 2.0.7 into Beta 2 (exactly it was a Beta 1 which was updated into a Beta 2 bei @TE  in the second step) and "likes" are working perfectly. So it seems not to be a general problem.
Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 09:39:44 am
About Likes, I don't know what the problem is. If there any difference is I converted from SMF 2.0.6 to ElkArte Beta 1, there is no mods installed at my forum at all.

Maybe I should try to reinstall ElkArte from scratch and import the database.
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 10:28:12 am
Have you tried changing the password via the profile page? Could help as well..
Title: Re: Problem with admin access
Post by: emanuele on February 10, 2014, 01:33:44 pm
Sorry for the split, it's not because I want to keep the release notes clean, more to keep a bit of organization. ;)

So @kucing, to recap a bit:
you migrated from SMF 2.0.6,
you updated to Elk 1.0 Beta 1,
* then you updated to beta 2.
Once on beta 2 you are not able to access the admin panel.

What I would check is, in the database, does your password begin with the following string?
Code: [Select]
$2a$10$
If the answer is yes, then your password has been successfully migrated to the new system and that is nice. If not then your password is still the old one.
Just for a test, try to:
logout,
clean your browser's cache,
reload the page, <= very important
login again.
It may be some javascript file was cached by your browser and not replaced with the new ones.

If this doesn't work, let's try to narrow down the possibilities: try to disable javascript in your browser and see if you can login.

Thank you very much for you patience with this! ;D

Quote from: TE – IIRC the passwrd column was varchar(32) before the password change and needs to be varchar(64)..
AFAIR it was already a varchar(64) since SMF's times.
Title: Re: Problem with admin access
Post by: Spuds on February 10, 2014, 03:48:04 pm
QuoteAFAIR it was already a varchar(64) since SMF's times.
I believe that is correct, and I'd assume that was due to supporting migrations from other systems some of which used sha256 which is 64 ... Our new ones are "some" length, but will always fit in the 64 varchar.

Not being able to get in to the admin area, but being able to log on is very strange  ???

Title: Re: Problem with admin access
Post by: kucing on February 10, 2014, 06:32:15 pm
Will try all the suggestions, stay tuned for the updates. :)

Edit:
It already converted to new password system.

Looks like it's cache problem, I tried with JavaScript disabled and it successfully let me in to Administration Center. Sorry for all the confusion.

Thanks!

Edit2:
I cleared all my browsing history, cache, whatever can be cleaned in Chrome and Internet Explorer but still cannot enter the administration center if JavaScript enabled.

will try to clear elkarte cache now.

Edit3:
Yup, elkarte cache is the problem. cleared and now can login to administration center. :D
Title: Re: Problem with admin access
Post by: TE on February 10, 2014, 10:54:40 pm
that's odd, the upgrade should use a clean_cache() at some point.. ?!°?
I''m glad the problem is solved :)
Title: Re: Problem with admin access
Post by: emanuele on February 11, 2014, 01:10:10 am
Great!
Now we have something to work on.

I suspect you are using the javascript and css minifier, correct?
Title: Re: Problem with admin access
Post by: kucing on February 11, 2014, 06:44:13 am
yes, I enabled level 1 cache (file based).
Title: Re: Problem with admin access
Post by: emanuele on February 11, 2014, 02:39:58 pm
Nope, those are two different things: one is the cache, another one is the "css and javascript minify".
If you go to: amin > configuration > features and options > general
there is an entry named "Minify Javascript and CSS files". Is it checked or not?
Title: Re: Problem with admin access
Post by: kucing on February 11, 2014, 06:14:47 pm
ah sorry, I forgot where is the location of minify setting so I though that caching is doing the same like W3TC for WordPress. Yes, I checked minify.
Title: Re: Problem with admin access
Post by: emanuele on February 13, 2014, 10:01:22 am
Okay, I tried to address the issue here:
https://github.com/emanuele45/Dialogo/commit/6bdd9fe55cb8d480c39531db2fe1d60781655dd3
Title: Re: Problem with admin access
Post by: emanuele on February 15, 2014, 06:04:45 pm
That one should be fixed now.