Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Overwrite defualt GLinks functions

Quote Reply
Overwrite defualt GLinks functions
Hi there.

Is it possible to overwrite the behavior of certain GLinks functions with a plugin? For example, the Links::User::Login::signup_user function. Is it possible to create a plugin that overwrite this functions default behavior? To disable the email validation for some users on certain conditions, for example. the shortcut would be to just modify the Login.pm file, but it is preferred that this is done via a plugin, if possible.

Thanks.


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Overwrite defualt GLinks functions In reply to
MMm, I guess you could have your code in a plugin (a PRE hook), and then do an "exit" before it actually run the standard code?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Overwrite defualt GLinks functions In reply to
Yea, that also crossed my mind. But wouldn't that also prevent some of the PRE hooks and the POST hooks to run?


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Overwrite defualt GLinks functions In reply to
Which hook is it you wanna do it on? I guess its worth just trying it (I'm not really sure what you're trying to do though :p)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Overwrite defualt GLinks functions In reply to
Might as well let the cat out of the bag. I am integrating one of our sites with Facebook Connect. So basically, the registration process of users with FB Connect will differ from that of a "normal" GLinks user. For example, if a user registers using the Facebook connect, email validation would not be necessary. But we also don't want to loose the email validation functionality for the regular registration process.

I have managed to pull it off by modifying the Links.pm and adding additional functions, but now I have to integrate it with Gossamer Community. Adding additional functions would again be the easier way to accomplish this, but our CEO said that he would prefer it to be done via a plug in.

Now the way I understand plug in hooks, is that one hook can have many functions working from it. But those functions are called at random. If I am to call the Plugin stop function from a PRE hook, what exactly will happen? Will it stop the execution of the other PRE functions that has not been executed as well? Will it prevent the POST hooks from going off?

I'm just guessing the probable hook, so let me know if I'm wrong, but it seems that I might have to work on the "web_user_login" hook in Gossamer Community?


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Overwrite defualt GLinks functions In reply to
Hi,

Ah ok - so this is GComm not GLinks?

Quote:
Now the way I understand plug in hooks, is that one hook can have many functions working from it. But those functions are called at random. If I am to call the Plugin stop function from a PRE hook, what exactly will happen? Will it stop the execution of the other PRE functions that has not been executed as well? Will it prevent the POST hooks from going off?

I think you may be right. The only way I can see how to do that, is to call your plugin from the actually .pm file itself (before the hook gets called) ... and then go from there.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Overwrite defualt GLinks functions In reply to
So, creating an additional function and dispatching it with the normal hooks will also work then... as in this case the additional function will be standing in for the original one...


Sacrifice is not about what you lose,
it is about what you gain in the process.