Post by TLEwebdevs » Wed Mar 25, 2015 7:17 pm

This is a bug report, I've found quick and dirty workarounds as detailed below - OC devs need to address the main issue reported ...

Main issues -

1. The install and configuration guide pages on the OpenCart site call for renaming the admin folder as a highly recommended action (I agree with that). However this breaks the modifications installer for ocmod extensions.

1a. If the ocmod extension contains a folder and file set for /admin/ in the upload folder, the main extensions installer does not redirect the upload to the renamed admin folder, instead it creates a new folder called admin and sends the upload there.

1b. The extensions installer does not recognise the renamed admin folder for actioning the install.ocmod.xml file and fails without errors leaving no addition of links and settings in admin for the uploaded extension - also no addition of the extension to Users - User Groups - for setting access and modification permissions.

There are some workarounds I have found through trial and error, but they are not a long term solution and they are certainly not recommended if OC is building towards a WordPress-style solution where modifications can be downloaded and installed direct from the OpenCart repository from within the modifications installer ...

2. Download the extension to your local hard drive and unzip it.
- rename the admin folder to your new name for admin (e.g. if your admin folder is called rottentomato then use the same name to rename the admin folder in the extension package.
- make sure the install.xml is called install.ocmod.xml (I have found too many 2.0.1.1 extensions without this)
- re-zip the package with its original name

2a. upload via the extensions installer and refresh the modifications cache
- first thing you will most probably notice is that EITHER the left menu link in admin does not display where it should be AND / OR the permissions checkboxes in Users-User Groups are missing.
- open the install.ocmod.xml file on your local hard drive ... now hard code the changes into the files and places on your server install that are indicated in the XML code.
- go back to the modifications list page in admin and refresh the modifications cache ... several times - it does not always "take" on the first attempt.
- go back to Users-Users Groups and look for the permissions checkboxes, they should be there now, tick them and save, then back to modifications to refresh the cache several times again.
- now look throughout the left hand admin menu for the settings page link - if it's not there, refresh the cache and if still not there, check again next week when it will mysteriously appear in some illogical position ... at least that's how I've experienced it.

Hope it helps someone, especially the OC Devs - take a look at how vqmod handles renaming the admin folder - ocmod needs something similar.


edited to fix typos

User avatar
Newbie

Posts

Joined
Fri Mar 13, 2015 6:25 pm

Post by ocmobi » Thu Mar 26, 2015 3:21 am

Are you sure you updated your configs properly and changed all pathing on the site and in other areas to reflect your file system changes?

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by fido-x » Thu Mar 26, 2015 9:34 am

We're not mind readers. No offence, but how are we, as developers, supposed to know what you've renamed your admin folder to?

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Venkko » Thu Mar 26, 2015 9:06 pm

Hi!
We're not mind readers. No offence, but how are we, as developers, supposed to know what you've renamed your admin folder to?
It should be an admin panel field where you can write what is your admin folder called at.
This would be the easiest way (for users) to tell opencart what they call their admin folder.

TLEwebdevs: I am quite a sure that there is OpenCart file where developers have commented place where you can change what your admin folder is named. I can't remember where and what file it was but I have seen it on somewhere.

http://www.pikkukoala.fi


Active Member

Posts

Joined
Mon Mar 05, 2012 8:32 pm

Post by ocmobi » Thu Mar 26, 2015 9:20 pm

Changing the admin folder shouldn't be necessary, people do it for security but there's many other ways to achieve the same goal.

You can whitelist ips for your admin section, you can add some vqmod/ocmod to use a key/pass combo on the url ie admin/index.php?key=blah otherwise redirect to the front end so it's as if it's hidden, add brute force protection to admin login, add captcha to admin login, and etc.

So if your motives are security there's other better options than potentially breaking Opencart. Many other systems don't have built in features to change admin folders while some don't care what you call admin folders. It doesn't really matter, it's not the holy grail of solutions to combat security issues...

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by Qphoria » Thu Mar 26, 2015 9:50 pm

vQmod supports admin renaming :)
Jus' Sayin!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Fri Mar 27, 2015 12:34 pm

Administrator index.php not writeable
Yes, vQmod supports a renamed admin folder, as long as you install it BEFORE renaming the admin folder, otherwise you get the above message and vQmod is not installed at all (even on the front-end). You would also have to edit every vQmod .xml file and replace any reference to the old admin folder with the new folder name.

Don't get me wrong, vQmod is a GREAT add-on and, if I wore a hat, I'd take it off to Qphoria for developing it!

However, while the OP is correct when stating that OCMOD does not support a renamed admin folder, it doesn't change the fact that we, as developers, have no way of knowing what the admin folder has been renamed to. There is no way of "automagically" detecting it.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by ocmobi » Fri Mar 27, 2015 7:57 pm

Why do you need it anyway? Use dirname and ma given file constant. why do you need to rely on folder name?

OCMobi - Opencart 1x and 2x native mobile applications, developer SDKs, Rest API, and custom services. Email us at support@ocmobi.com!

Pricing | Features | Custom Services
Facebook | Twitter | Google+ | Instagram


User avatar
New member

Posts

Joined
Wed Mar 04, 2015 1:41 am


Post by Qphoria » Wed Apr 01, 2015 12:08 am

fido-x wrote: Yes, vQmod supports a renamed admin folder, as long as you install it BEFORE renaming the admin folder.
Yes but you just need to rename the admin folder temporarily to "admin".. then run vqmod installer and then change it back. You don't need to edit the config files or anything. It's extremely minor.
fido-x wrote: You would also have to edit every vQmod .xml file and replace any reference to the old admin folder with the new folder name.
This is completely untrue and we should do better to advertise proper use.
Since vQmod 2.3 (about 2 years ago), Jay added the "pathReplaces.php" file which lets you set up a translation from "admin" to "whatever" in one place, one time. So you DO NOT need to edit ANY files. It will automatically translate the path without needing to change any xml files. More Info

Never underestimate vQmod again!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by TLEwebdevs » Wed Apr 08, 2015 4:22 pm

fido-x wrote:We're not mind readers. No offence, but how are we, as developers, supposed to know what you've renamed your admin folder to?
Have a look at the WordPress open source code - how do they do it?
(Simplistic answer - they have you rename it during install then commit that name somewhere in the database, or possibly in the .htaccess file ... possibly in plain text, possibly encrypted, I never looked deep into it because it works).

They also have you change the database tables prefix from "wp_" to whatever you like within MySQL's restrictions during install, and that is written to the config.php file during the install.

There are easy ways and hard ways to do this, and I'd suggest there's a large proportion of OpenCart users who are not code-jockeys, therefore the solution should be as easy to use and interaction-free as possible.
Last edited by TLEwebdevs on Wed Apr 08, 2015 4:35 pm, edited 1 time in total.

User avatar
Newbie

Posts

Joined
Fri Mar 13, 2015 6:25 pm

Post by TLEwebdevs » Wed Apr 08, 2015 4:28 pm

Qphoria wrote: This is completely untrue and we should do better to advertise proper use.
Since vQmod 2.3 (about 2 years ago), Jay added the "pathReplaces.php" file which lets you set up a translation from "admin" to "whatever" in one place, one time. So you DO NOT need to edit ANY files. It will automatically translate the path without needing to change any xml files. More Info

Never underestimate vQmod again!
As someone completely new to OpenCart and vQmod, it took me almost a week of hair pulling to discover the pathReplaces.php solution - could I ask that you comment it into the mod description in the opencart repository, and into a readme.txt within the mod package? Please, pretty please? It might save future users some angst.

;)

User avatar
Newbie

Posts

Joined
Fri Mar 13, 2015 6:25 pm

Post by TLEwebdevs » Wed Apr 08, 2015 4:30 pm

ocmobi wrote:Are you sure you updated your configs properly and changed all pathing on the site and in other areas to reflect your file system changes?
Is there a checklist anywhere for ALL the places that need updated? I couldn't find one linked from the installation pages on the site.

User avatar
Newbie

Posts

Joined
Fri Mar 13, 2015 6:25 pm

Post by kombi » Sat Apr 11, 2015 10:30 am

Not sure if this a correct place to ask... But here I go.. I am using opencart 2.0.2, I was updating a extension via OCMOD by uploading the new file package via the uploader. What happened is the old file did not get deleted/overwritten after the update like with VQMOD files being overwritten. So the dual copy is creating a conflict and I cannot get back into my admin page. I can not find the path to where the Ocmod stores the XML like in VQMOD. Where are the XML stored so I can manually delete them in OCMOD.

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

Post by kombi » Sat Apr 11, 2015 11:41 am

looks like it stored in the database under "modification" so how do you easily delete and flush the opencart cache to clean it out? VQMOD you just delete the cache folder?

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

Post by fido-x » Sat Apr 18, 2015 11:50 am

kombi wrote:looks like it stored in the database under "modification" so how do you easily delete and flush the opencart cache to clean it out? VQMOD you just delete the cache folder?
Click the orange "Clear" button to clear the modification cache. Click the blue "Refresh" button to refresh the cache.

If your modifications are preventing access to the "Extensions->Modification" page in the admin, you can use the file manager from your hosting control panel to clear the files in the "system/modification" directory. Note: DO NOT delete the "index.html" file.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by alber99 » Sat Oct 31, 2015 7:47 am

Is this still a problem in OC 2.0.3 ?

I've changed the name of my admin folder and sometimes experience incomplete extension installs using OCMOD - usually the upload step says "successful" but then the mod does not appear in Admin - so can't get beyond that step.

New member

Posts

Joined
Sun Apr 08, 2012 9:14 am

Post by VictorDrummond » Sat Oct 31, 2015 11:40 am

alber99 wrote:Is this still a problem in OC 2.0.3 ?

I've changed the name of my admin folder and sometimes experience incomplete extension installs using OCMOD - usually the upload step says "successful" but then the mod does not appear in Admin - so can't get beyond that step.
I have 2.03.1 + VQMOD + OCMOD... now with renamed ADMIN... It's not a problem at all...

Follow Q's tutorial to the letter, see this post:
http://forum.opencart.com/viewtopic.php?f=121&t=93109

Implemented 2 days ago, works perfectly.

Hosting for Oc 2.x: Well tested on 2.03.1 including emails work correctly, cPanel Shared or WHM VPS, managed security, fast & reliable SSD drives, Raid 10 /4 disk redundancy, server locale - Texas, contact me to discuss further.


User avatar
Active Member

Posts

Joined
Sat Dec 15, 2012 12:41 pm
Location - On the balcony slammin' Margaritas
Who is online

Users browsing this forum: No registered users and 4 guests