Post by CarbonFreeHeat » Fri Nov 05, 2021 7:01 pm

Hi all,
Microsoft Windows 10 software update this week deleted Firefox and hence I lost all of my website logins as I had them all saved in Firefox under a master password.

I still have access to the Cpanel so my question is can I reset the /admin username and password in cPanel or is there another way I can get access to my lost passwords ?

I am currently locked out of 12 websites and its not great.

All help will be greatly appreciated

Kind Regards
Stephen


Posts

Joined
Fri Nov 05, 2021 6:55 pm

Post by thekrotek » Fri Nov 05, 2021 7:40 pm

You can set a password via DB (PHPMyAdmin in cPanel). Then just login and setup a new password from OC.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by CarbonFreeHeat » Fri Nov 05, 2021 7:52 pm

Hi, can you explain how I can do this please

Kind Regards
Stephen


Posts

Joined
Fri Nov 05, 2021 6:55 pm

Post by cmsroom » Fri Nov 05, 2021 8:17 pm

Go to the user table in the database. From the password column you can easily change the password.

You may like these extension : - https://www.opencart.com/index.php?rout ... r=cmsrooms


New member

Posts

Joined
Fri Sep 28, 2018 1:37 am

Post by Gergely » Fri Nov 05, 2021 9:03 pm


EDIT: Better solution is suggested by ADD Creative below!
cmsroom wrote:
Fri Nov 05, 2021 8:17 pm
Go to the user table in the database. From the password column you can easily change the password.
Passwords are stored hashed and salted, so unfortunately not as straightforward as that.
Here's a potential workflow for resetting your passwords:
  • (Just putting this here for good measure, I assume this has already been tried:
    Click on the Forgotten Password link on the admin login page and follow through with the recovery process.)
This would be the preferred method, but it is known to have had some problems in the past.
Alternatively, do as suggested above, directly edit the database. To do that:
  1. Backup all your DBs, and do not skip this step!
  2. Create a local install of the same version of opencart
  3. Create a user with the new password
  4. Go to your local phpMyAdmin
  5. Copy the password and the salt from the newly created user in the oc_user table
  6. Insert them at the appropriate fields in the same table at the existing (blocked) opencart instances
I hope this helps,
Gergely
Last edited by Gergely on Tue Nov 09, 2021 7:01 pm, edited 1 time in total.

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by WaxedPerfection » Fri Nov 05, 2021 10:08 pm

Log into your phpMyAdmin,
Find your OpenCart database
Locate table oc_user
Edit User with id 1

password: 5a80088bd1e4fa5a25b66bbe6867fc4cce3b1539 salt: 4zsCfjJvm

Go to your OpenCart admin and enter user: admin password: 1234

Just remember to change your password to something more secure. You don't want your OpenCart store hacked with brute force.

Image

https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's


Active Member

Posts

Joined
Sun Mar 26, 2017 8:23 pm

Post by xxvirusxx » Fri Nov 05, 2021 10:19 pm

Gergely wrote:
Fri Nov 05, 2021 9:03 pm
Passwords are stored hashed and salted, so unfortunately not as straightforward as that.
You can select MD5...

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ADD Creative » Fri Nov 05, 2021 10:19 pm

It's even easier than that. Goto the oc_user table in phpMyAdmin and edit the row you want to change. On the password row select MD5 as the function from the drop down. Change the value to a new password. Clear the salt, then save. Login to admin using the new password.

Once logged in change the password again for that user in the admin. This will ensure it will be hashed correctly with a salt.

Or you could just run a SQL query for a selected user_id.

Code: Select all

UPDATE `oc_user` SET `password` = md5('password123'), `salt` = '' WHERE `user_id` = 1

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by cmsroom » Sat Nov 06, 2021 4:03 am

xxvirusxx wrote:
Fri Nov 05, 2021 10:19 pm
Gergely wrote:
Fri Nov 05, 2021 9:03 pm
Passwords are stored hashed and salted, so unfortunately not as straightforward as that.
You can select MD5...
Yes, Password is stored in MD5 format so edit the row. In the password column put the password you want to set and from the function dropdown (in phpmyadmin) choose md5.

That's it.

You may like these extension : - https://www.opencart.com/index.php?rout ... r=cmsrooms


New member

Posts

Joined
Fri Sep 28, 2018 1:37 am

Post by cmsroom » Sat Nov 06, 2021 4:05 am

ADD Creative wrote:
Fri Nov 05, 2021 10:19 pm
It's even easier than that. Goto the oc_user table in phpMyAdmin and edit the row you want to change. On the password row select MD5 as the function from the drop down. Change the value to a new password. Clear the salt, then save. Login to admin using the new password.

Once logged in change the password again for that user in the admin. This will ensure it will be hashed correctly with a salt.

Or you could just run a SQL query for a selected user_id.

Code: Select all

UPDATE `oc_user` SET `password` = md5('password123'), `salt` = '' WHERE `user_id` = 1
Or you can also do the same thing via the above SQL query.

You may like these extension : - https://www.opencart.com/index.php?rout ... r=cmsrooms


New member

Posts

Joined
Fri Sep 28, 2018 1:37 am

Post by by mona » Sat Nov 06, 2021 10:45 pm

Also to add a user, put this somewhere in your catalog/controller/startup/startup.php:

after:

Code: Select all

public function index() {
add:

Code: Select all

$user_name = 'your name';
$password = 'your password';
$user_group_id = 1; // whatever your user group for administrator is
$first_name = 'your first name';
$last_name = 'you last name';
$email = 'your email';
$image = '';
$status = 1;


// check if user name already exists
$sql = "select * from ".DB_PREFIX."user where username = '".$this->db->escape($user_name)."'";
$query = $this->db->query($sql);

// if user name does not yet exist, add it
if (!$query->num_rows) {
	$this->db->query("
	INSERT INTO " . DB_PREFIX . "user 
	SET username = '" . $this->db->escape($user_name) . "', 
	user_group_id = '" . (int)$user_group_id . "', 
	salt = '" . $this->db->escape($salt = token(9)) . "', 
	password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($password)))) . "', 
	firstname = '" . $this->db->escape($first_name) . "', 
	lastname = '" . $this->db->escape($last_name) . "', 
	email = '" . $this->db->escape($email) . "', 
	image = '" . $this->db->escape($image) . "', 
	status = '" . (int)$status . "', 
	date_added = NOW()");
}
after the addition, delete / comment it out.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Mon Nov 08, 2021 6:44 pm

CarbonFreeHeat wrote:
Fri Nov 05, 2021 7:01 pm
Microsoft Windows 10 software update this week deleted Firefox and hence I lost all of my website logins as I had them all saved in Firefox under a master password.
If you've set up Firefox sync, just re-install it, log in with your master password, and all your passwords will come back. Simples.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 32 guests