Dragonfly CMS v9 ⇒ Modules & Blocks :: Archives ⇒ SOLVED: Only admin can access my new module? :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Archived ⇒ SOLVED: Only admin can access my new module?


I have created a module which is operating fine. I used cpg_inst.php in my module's folder and the module shows up in the Modules Admin page where I set access to All Visitors. But only admins can run the module. If not an admin, the "You are trying to access a restricted area." page is shown.

I don't know if it's related, but my module is NOT listed in the cms_modules table. Should I manually create an entry in the cms_modules table? What should the values be? Will that correct the permissions error I'm seeing?

TIA for any help/advice... Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37/4.1.21/4.4.7/9.1.2.1

Last edited by MotoWriter on Sun Sep 02, 2007 10:46 pm; edited 1 time in total


@MotoWriter
"You are trying to access a restricted area." thats because by default when you install a module its "disabled" so only admin have access to it. You need to go in admin -> modules to "enable" the module.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


The green check mark is on for the module, which I assume means Dragonfly sees it as "active". Is there something else on the Modules Admin page I'm overlooking? I have it set to All Visitors and Both (for blocks, although I won't be using it as a block).

I see the module name in the main menu, but when I go into www.motowriters.com/ad...p?op=cpgmm it's not shown there. Confused

I adapted my module from the Forums Member List module. Could there be some code that I'm missing in my index.php for the module that's required for all users to see it?

What's especially confusing is that the module is not in the cms_modules table. How is it showing up in Modules Admin if it's not in the table?

Thanks for your help!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37/4.1.21/4.4.7/9.1.2.1


Thanks anono-mod for splitting this to a new topic. To be clear, I followed Eestlane's basic guide when I created my module. So the unanswered questions relating to setting up a module from scratch seemed relevant to that thread.

I simply ran cpg_inst, which allowed me to activate the module. But that script doesn't do a SQL INSERT to put the module info in the cms_modules table. I figure there has to be more to setting up a module than just modifying cpg_inst and clicking on Install in the Modules Admin panel. Confused

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37/4.1.21/4.4.7/9.1.2.1


Make sure your modules index.php isn't using an Admin check such as

if(!can_admin()){ die("You are not an Admin"); }

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Mammlouk wrote
Make sure your modules index.php isn't using an Admin check such as

if(!can_admin()){ die("You are not an Admin"); }


Huh, thanks, good idea. The only eval going on at the top of the module, though, is if (!defined('CPG_NUKE')) { exit; }.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37/4.1.21/4.4.7/9.1.2.1


That should be fine then. I'm not sure, I'd just say double check the edit page for the module. You might be able to manually add it to the modules table, but I'm not sure if that's a good idea. I haven't really looked at the applicable tables for installing modules since I haven't had any problems with the installers on my custom modules yet.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


SOLVED...

Another oddity... in my cms_modules table I had probably 10 entries for several of the standard modules (have no idea how that occurred, but I deleted the extra entries with no problems). I was only displaying 30 records and was only seeing the first 15 modules, then entries repeating (though I thought there were only a couple of repeats). My module was buried at mid = 65.

I changed the entry in the "view" field from 2 to 0 and it now is accessible to all. The module also shows up in the cpgmm page to move modules around in the menus. Odd problem, to say the least. Confused

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37/4.1.21/4.4.7/9.1.2.1


Glad to hear you got it fixed.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC