Post by 64057 » Thu Oct 20, 2016 11:14 pm

hello everyone

i just deleted admin privileges by mistake on opencart panel. and whenever i log in admin on panelit just shows dashboard. nothing else.
so checked phpmyadmin oc_user group and oc user and its looking as it would be.
so i think i have to do something on ftp please someone! illuminate me

Newbie

Posts

Joined
Thu Oct 20, 2016 9:21 pm

Post by Johnathan » Fri Oct 21, 2016 11:26 pm

Log in using FTP, and then make this edit:

Code: Select all

IN:
/system/library/user.php OR /system/library/cart/user.php

AFTER:
public function hasPermission($key, $value) {

ADD:
return true; 
That will enable all areas for all users, so you can then go to your admin panel and re-save the permissions in Users > User Groups. Don't forget to remove the edit after you've done that, or permissions will not be checked at all.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by frishops » Mon Jul 10, 2017 5:30 am

Hey, thanks a lot. this just helped me!

Image

Your Local Store.
http://www.frishops.ca
http://www.frishops.cn


New member

Posts

Joined
Tue Sep 15, 2015 5:58 am
Location - Quebec, Canada

Post by myanno » Tue Oct 10, 2017 10:38 am

i can't solved my problem , please help

Newbie

Posts

Joined
Wed Sep 06, 2017 2:32 pm

Post by Johnathan » Tue Oct 10, 2017 10:36 pm

Is this related to admin permissions? If so, you need to follow the steps I've outlined above. If you can't, then you should ask someone you know who could do it for you, or hire someone to fix the issue.

If this isn't related to admin permissions, then post a new topic.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by mrblond » Wed Oct 18, 2017 11:44 pm

Hi,
can you please clarify where exactly to put return true; in the code you specified:

Code: Select all

public function hasPermission($key, $value) {
		if (isset($this->permission[$key])) {
			return in_array($value, $this->permission[$key]);
		} else {
			return false;
		}
	}

Active Member

Posts

Joined
Fri Oct 13, 2017 4:43 pm

Post by Johnathan » Wed Oct 18, 2017 11:57 pm

After this line:

Code: Select all

public function hasPermission($key, $value) {

You add a new line with this code:

Code: Select all

return true; 

Don't forget to remove the line you added after you're able to re-save your permissions.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by pixelhaus » Mon Feb 12, 2018 6:07 pm

Hi there,
I'm having a similar issue after a client removed his permissions. I've added the extra line (as shown in the screenshot) to system/library/cart/user.php (v2.3.0.2) but it's not making any difference. Is there anything else I might have missed ?
Image

New member

Posts

Joined
Mon Sep 26, 2011 3:57 pm

Post by Johnathan » Tue Feb 13, 2018 11:27 pm

If you have an ocMod that affects that file, the edit won't activate until you refresh your ocMod cache in Extensions > Modifications.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by sameverything » Mon Jul 30, 2018 8:37 am

Johnathan wrote:
Wed Oct 18, 2017 11:57 pm
After this line:

Code: Select all

public function hasPermission($key, $value) {

You add a new line with this code:

Code: Select all

return true; 

Don't forget to remove the line you added after you're able to re-save your permissions.
Hi, Thanks for this

I too by accident deleted my admin permissions, I am on OpenCart 3
I added the line on cart/user.php
And now I can Select All permissions, and Save, with no issues, however, it is not really "saved"
Once I revisit the User Group permissions, all the vital permissions are unchecked.
I tried refreshing and clearing mods etc.

Any suggestions?

Thanks
Sam

Newbie

Posts

Joined
Mon Oct 16, 2017 1:00 am

Post by Johnathan » Tue Jul 31, 2018 10:47 pm

Sounds like you have something more going on, then. I'd suggest uninstalling any mods you have installed (especially ones with ocMod or vQmod files, since those are likely to be the cause) and see if that helps.

If not, you may need to hire someone to take a look for you. If you need to find a developer, you should post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Moel » Fri Sep 13, 2019 12:19 pm

Johnathan wrote:
Wed Oct 18, 2017 11:57 pm
After this line:

Code: Select all

public function hasPermission($key, $value) {

You add a new line with this code:

Code: Select all

return true; 

Don't forget to remove the line you added after you're able to re-save your permissions.
This code helping, but all permission become enable with or without checking the lists. Any suggestion how to make permission can be arrangeable like opencart normally do without error issue?

Newbie

Posts

Joined
Sat Feb 16, 2019 5:48 am
Who is online

Users browsing this forum: No registered users and 23 guests