Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Access denied at log in - How to reset password
06-12-2015, 04:15 AM, (This post was last modified: 06-15-2015, 09:51 PM by MacPhotoBiker.)
#1
[SOLVED] Access denied at log in - How to reset password
Hi,

I get an "access denied" error when logging in (please see attached screenshot). I'm not mistyping the password, but I can't be sure if maybe "somewhere else" I messed up the password.

Is it possible to set the password manually in the database? Would that be in table "www_users"? If so, do I need to encrypt the password first (SHA1, MD5)?

I'd really appreciate some advice. Thank you!


Attached Files Thumbnail(s)
   
MacPhotoBiker
Just Core Business Inc.
[url]http://www.justcorebusiness.com[/url]
Reply
06-12-2015, 05:59 AM, (This post was last modified: 06-12-2015, 06:00 AM by phil.)
#2
RE: Access denied at log in - How to reset password
It is more tricky now... in older versions you could go
UPDATE www_users SET password=sha1('mynewpassword') WHERE userid='me';
you could choose between md5 and sha1 as encryption options in config.php

It is much more secure now ... would need to dig into the code in session.inc and includes to figure out a solution. There is salt (no pepper) and other stuff involved.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
06-12-2015, 06:07 AM,
#3
RE: Access denied at log in - How to reset password
Hi Phil,

thank you for your reply.

Unfortunately, I'm not much of a "coder", I'm truly just a user, and it's most likely pointless (for me) to dig into those files.

Would a "brute force" workaround be to backup the database, and reinstall webERP from scratch? I really need to get access to that database...

Thanks a lot!
MacPhotoBiker
Just Core Business Inc.
[url]http://www.justcorebusiness.com[/url]
Reply
06-12-2015, 07:24 AM,
#4
RE: Access denied at log in - How to reset password
Hi, it now uses the much more secure PHP function password_hash() function. I haven't tried it, but try setting up a file called PasswordReset.php containing the following:

<?php
include('config.php');
$db = mysqli_connect($Host, $DBUser, $DBPassword, 'DatabaseName', $DBPort);
$Result = mysqli_query($db, "UPDATE www_users SET password='".password_hash('weberp',PASSWORD_DEFAULT)."' WHERE userid='admin'");
?>

Replacing DatabaseName with the real name of your database. Run this from the browser and it should just change the password to weberp.

Remove this script once it has run - for obvious reasons Smile

Tim
Reply
06-12-2015, 10:56 PM, (This post was last modified: 06-12-2015, 11:16 PM by MacPhotoBiker.)
#5
RE: Access denied at log in - How to reset password
Hi Tim,

thank you very much for that script!
Unfortunately it didn't do the trick, but I think that's not because of the script.

I noticed that the error message (in the screenshot in the opening post) does not refer to the webERP user, but to the database user (which I set up in my cpanel account).

I think what I need to correct is not is the password for the connection to the database. Sorry, I put that wrong initially.

Could you help me out with that, too, please?

Sorry for the confusion (I trust the script might come handy one day anyway Wink )

Thanks a lot!


Hi,

ok,that's clearly a home made issue Sad I figured out where to define the database connection (config.php).

However, since I tried to "correct" my user password for webERP, I can't log in (and at the login screen it states that the password is wrong).

I ran the script that Tim provided, but when I try to log in now, it tries to run UpgradeDatabase.php automatically, which fails (see attached screenshot):

ERROR Message Report : Security settings have not been defined for your user account. Please advise your system administrator. It could also be that there is a session problem with your PHP web server

Could you please help me out with that, too?

Thank you so much!


Attached Files Thumbnail(s)
   
MacPhotoBiker
Just Core Business Inc.
[url]http://www.justcorebusiness.com[/url]
Reply
06-13-2015, 05:03 PM,
#6
RE: Access denied at log in - How to reset password
Well if you have access to the host's control panel you should be able to reset it ... or is it your own server..
you could reinstall mysql - default user is root with a blank password ... but many distributions make you install it with a more secure password now.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
06-13-2015, 05:31 PM,
#7
RE: Access denied at log in - How to reset password
Hi Gert,

Did you try clicking the logout link and trying again?
Did you make any other changes to config.php specifically to the line where the $SessionSavePath is set?

My script only changed the password, and didn't make any changes to the security settings so my guess is it is something else that was done.

Thanks
Tim
Reply
06-14-2015, 01:22 AM, (This post was last modified: 06-14-2015, 01:30 AM by MacPhotoBiker.)
#8
RE: Access denied at log in - How to reset password
Hi Tim,

thank you very much again! I was rather confident that I did try to log out.... But after reading your comment, I just tried again - and it did the trick!

Thank you very much again for the script to change the password! I deleted it from my server, but I will definitely keep a copy Smile

Very best regards from Canada

Gert


(06-13-2015, 05:03 PM)phil Wrote: Well if you have access to the host's control panel you should be able to reset it ... or is it your own server..
you could reinstall mysql - default user is root with a blank password ... but many distributions make you install it with a more secure password now.

Hi Phil,

thanks a lot for looking into it. My server is a dedicated WHM/ cpanel server, and webERP runs on one of the cpanel accounts. Fortunately Tim's script indeed changed the password successfully, and the initial "Security settings" warning also "healed".

Thank you very much again for all the support - although it was clearly not a "webERP issue".

Gert
MacPhotoBiker
Just Core Business Inc.
[url]http://www.justcorebusiness.com[/url]
Reply
11-15-2015, 11:36 AM, (This post was last modified: 11-15-2015, 12:12 PM by cyrilca0001.)
#9
RE: [SOLVED] Access denied at log in - How to reset password
Hi, got myself in a similar trouble. Tryed Tim's solution, I am afraid I am not getting it right...

1) Created a file password.php, and saved it in weberp folder
2) Is 'weberp' my database name? (i mostly used default installation settings)
3) http://localhost/weberp/password.php
4) Result:

Fatal error: Call to undefined function password_hash() in /Library/WebServer/Documents/weberp/password.php on line 4

What am I doing wrong?
(11-15-2015, 11:36 AM)cyrilca0001 Wrote: Hi, got myself in a similar trouble. Tryed Tim's solution, I am afraid I am not getting it right...

1) Created a file password.php, and saved it in weberp folder
2) Is 'weberp' my database name? (i mostly used default installation settings)
3) http://localhost/weberp/password.php
4) Result:

Fatal error: Call to undefined function password_hash() in /Library/WebServer/Documents/weberp/password.php on line 4

What am I doing wrong?

OK, found the solution:
1) Update PHP to 5.5 or newer
Link for Mac OS X: http://php-osx.liip.ch/
2) Create php script - from Tim's post
3) The php file is to be saved in weberp folder
4) Run the file from browser - in my case: http://localhost/weberp/password.php
5) If script worked, you see a blanc page!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)