Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Sorky - PE admincp_plugin Details »
Sorky - PE admincp_plugin
Mod Version: 1.0.1, by Sorky (Coder) Sorky is offline
Developer Last Online: Jan 2015 I like it Show Printable Version Email this Page

vB Version: 3.8.x Rating: (1 vote - 5.00 average) Installs: 7
Released: 16 May 2009 Last Update: 19 May 2009 Downloads: 43
Not Supported Uses Plugins  

Purpose
This Mod is designed to be used by other Mods or PlugIns.

Its primary purpose is very basic - to add hooks to the hook selection list in the PlugIn editor. This is so that other Mods or PlugIns can be created with their own hooks and means that they can add their hooks to the PlugIn Manager, so that they can be edited in the Plugin Manager, without the need to create and upload an XML file.

It's secondary purpose is a lot more interesting - it allows the content of plugin.php to be edited by a PlugIn prior to execution, thus allowing for code level edits to be performed without the administrator having to edit the php file directly. This is how the hook required for the primary purpose is inserted into the code without a file edit.

The name comes from the secondary purpose as it is a lot more interesting

Programmatically Edit admincp/plugin.php before execution through a hook

It reads the content of the original admincp/plugin.php and provides a hook that allows the content to be changed by any PlugIn before executing the content, thus effectively making the admincp/plugin.php file Programmatically Editable.

It then uses this ability to add a hook in admincp/plugin.php that this and other PlugIns can use to make further hooks available for use in the admin control panel. No need to load the XML files!

Once again, this Mod is primarily provided to be used by other Mods/PlugIns. Note: Any product that uses this capability should mark this product as a dependency.
  • Programmatically Edit admincp/plugin.php from within PlugIns
  • Add hooks to the pull-down hook list without installing an XML file

Installation
Import XML file (as product): AdminCP > Plugin System > Manage Products > [Add/Import Product]

Important: On installation it automatically renames admincp/plugin.php and installs a special stub to replace it - No user edit is required. The existing file remains unchanged (just renamed). Uninstallation will restore your original file just as it was. You don't have to worry. Simply load the product and everything else is taken care of for you!

*** NO FILE EDITS ***

*** NO MANUAL UPLOADS ***

Options
To set this plugin's options go to: AdminCP > vBulletin Options > Sorky18 - Customize Announcements

Versions
v1.0.0 - 16th of May, 2009 = Launch (click here)
V1.0.1 - 19th of May, 2009 = Minor improvement (click here)

More Information
See v1.0.0 post (click here)

If you like this Mod please click INSTALL.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Forum Display Enhancements Sorky - RSS Feed Link Sorky vBulletin 3.8 Add-ons 76 10 Jul 2011 14:17
Forum Display Enhancements Sorky - Customize Announcements Sorky vBulletin 3.8 Add-ons 49 11 Aug 2010 19:40
Forum Display Enhancements Sorky - RSS Feed Link Sorky vBulletin 3.7 Add-ons 66 29 Sep 2009 12:58
Forum Display Enhancements Sorky - Customize Announcements Sorky vBulletin 3.7 Add-ons 8 03 Jun 2009 11:46

Comments
  #2  
Old 16 May 2009, 09:57
Sorky Sorky is offline
 
Join Date: Apr 2007
Version 1.0.0 Features

This Mod is provided to be used by other Mods/PlugIns

Creates two hooks...
  • admincp_plugin_dynamicmodify
    Use this to Programmatically Edit admincp/plugin.php. See the PlugIn for an example
  • admincp_plugin_addhooks
    Use this to Programmatically add your own hooks. See the PlugIn for an example

No screen shots (no need)

One (1) option: Debug - Outputs the modified code to a file for analysis

Special Reference
This PlugIn should still work even if the admincp/plugin.php file has been manually edited, as long as...
The first 25 lines are unchanged
Line 25 = require_once('./global.php');
Line 438 is still "uksort($hooklocations, 'strnatcasecmp');" [ie: it has not moved]

Last edited by Sorky; 16 May 2009 at 13:31.
Reply With Quote
  #3  
Old 16 May 2009, 15:11
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Real name: Brian
I'm curious about the security. Is it remotely possible to inject code via the new hook to execute sql modifications through the admincp? How does the mod allow other mods to execute code, I would think a permission error would come up?

Seems interesting, just don't know if hooks in the admincp are safe.
__________________
Spirit Walkers
Reply With Quote
  #4  
Old 16 May 2009, 15:32
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Real name: David
Originally Posted by SkyCatcher View Post
I'm curious about the security. Is it remotely possible to inject code via the new hook to execute sql modifications through the admincp? How does the mod allow other mods to execute code, I would think a permission error would come up?

Seems interesting, just don't know if hooks in the admincp are safe.
You can do SQL modifications through any hook.
Reply With Quote
  #5  
Old 17 May 2009, 02:03
Sorky Sorky is offline
 
Join Date: Apr 2007
Originally Posted by SkyCatcher View Post
Seems interesting, just don't know if hooks in the admincp are safe.
There are already hooks in there, just (as any coder will attest) not always in the places that are needed.

And in answer to the security question... ANY PlugIn that has installation code could erase an SQL db or wipe a hard drive!!! It's not the PlugIn that's the problem, it's the ability to install one, which basically comes down to access to the Administrator Control Panel. A good idea to always add extra security to your admincp directory to restrict who can access it!
Reply With Quote
  #6  
Old 17 May 2009, 08:47
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Real name: Brian
I'm not talking about installing the plugin, I'm talking about exploiting the new hook to execute code with a higher permission base.

I haven't played around with the admincp files much at all but as far as I know it doesn't use the template system nor does it use any of the standard hooks. Adding a hook to the files in the admincp could ease life for everyone sure, but as I'm not sure about how it works I guess I'll just wait and see what others think.
__________________
Spirit Walkers
Reply With Quote
  #7  
Old 17 May 2009, 11:03
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Real name: David
Originally Posted by SkyCatcher View Post
I'm not talking about installing the plugin, I'm talking about exploiting the new hook to execute code with a higher permission base.

I haven't played around with the admincp files much at all but as far as I know it doesn't use the template system nor does it use any of the standard hooks. Adding a hook to the files in the admincp could ease life for everyone sure, but as I'm not sure about how it works I guess I'll just wait and see what others think.
Of course there are standard hooks in the admincp.
Reply With Quote
  #8  
Old 17 May 2009, 13:22
Sorky Sorky is offline
 
Join Date: Apr 2007
Originally Posted by SkyCatcher View Post
...but as far as I know it doesn't use the template system nor does it use any of the standard hooks
It sure does... Just open plugin.php and go to line 2555 Many of the functions that it calls also have hooks as well
Reply With Quote
  #9  
Old 19 May 2009, 10:16
Sorky Sorky is offline
 
Join Date: Apr 2007
Version 1.0.1 Features

Just relocated the initial dynamic edits from the plugin to the stub php file to ensure that the Mod (or its PlugIns) can be disabled.

Note: Must uninstall then re-install

PS: The product was designed on 3.8.2 and as such the plugin.php file of other 3.8.x versions should conform but should be checked to be sure. I also have versions with the changes that are required for 3.6.x and 3.7.x if anyone is interested.

Last edited by Sorky; 19 May 2009 at 10:25.
Reply With Quote
  #10  
Old 19 May 2009, 15:07
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
im still confused on what this does...
Reply With Quote
  #11  
Old 19 May 2009, 16:54
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Real name: David
Originally Posted by RTMdotORG View Post
im still confused on what this does...
If you don't know what it does then it's best you don't install it
Reply With Quote
  #12  
Old 20 May 2009, 00:38
Sorky Sorky is offline
 
Join Date: Apr 2007
Originally Posted by RTMdotORG View Post
im still confused on what this does...
It is designed to be used by other Mods or PlugIns, so as Enigma mentions, if you don't understand or need it, don't install it...

Its primary purpose is very basic - it is to add hooks to the hook selection list in the PlugIn editor, so that the any new Mod or PlugIn can be created that can be edited in the Plugin Manager without the need to create and upload an XML file describing the hook.

It's secondary purpose is a little more interesting - it allows the content of plugin.php to be edited by a PlugIn prior to execution, thus allowing for code level edits to be performed without the administrator having to edit the php file directly. This is how the hook required for the primary purpose is inserted into the code without a file edit.
Reply With Quote
  #13  
Old 23 May 2009, 14:00
Jasem's Avatar
Jasem Jasem is offline
 
Join Date: Feb 2006
Location: www.menokia.com
thank you!
__________________
games
Forum Nokia
Reply With Quote
  #14  
Old 24 May 2009, 06:39
lm3a.net's Avatar
lm3a.net lm3a.net is offline
 
Join Date: May 2009
thanks bro,
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:41.

Layout Options | Width: Wide Color: