Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [Andy] Welcome message

Quote Reply
Re: [Andy] Welcome message In reply to
The reason the plugin isn't working, is because it only works when the email validation is turned on. I don't use admin or email validation, so the plugin hook is not working. Does anyone know how to change the code to another plugin hook that would work no matter if validation is on or off?

Code:
# ==================================================================
# Plugins::GForum::Welcome - Auto Generated Program Module
#
# Plugins::GForum::Welcome
# Author : Paul Wilson
# Version : 1.0
# Updated : Wed Apr 24 00:14:39 2002
#
# ==================================================================
#

package Plugins::GForum::Welcome;
# ==================================================================

use strict;
use GT::Base;
use GForum::Plugins;
use GT::Plugins qw/STOP CONTINUE/;
use GForum qw/$IN $DB $CFG/;

# Inherit from base class for debug and error methods
@Plugins::GForum::Welcome::ISA = qw(GT::Base);

# Your code begins here! Good Luck!


# PLUGIN HOOKS
# ===================================================================


sub pm {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'user_validate'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#

my ($conf) = GForum::Plugins->get_plugin_user_cfg('Welcome');
my ($utab) = $DB->table('User');
my ($code) = $IN->param('validate'); $code =~ s/^(\d+)GT//;
my ($adm) = $utab->select( { user_username => $conf->{Sender} }, ['user_id','user_username'] )->fetchrow_hashref;
my ($user) = $utab->select( { user_val_code => $code }, ['user_id','user_username'] )->fetchrow_hashref;

if (! $adm->{user_id} or ! $user->{user_id}) {
GT::Plugins->action ( CONTINUE );
return;
}
else {
$DB->table('Message')->insert({ from_user_id_fk => $adm->{user_id},
msg_username => $adm->{user_username},
to_user_id_fk => $user->{user_id},
msg_subject => $conf->{Subject},
msg_style => 1,
msg_body => $conf->{Message},
msg_time => time(),
msg_status => 0,
msg_ip => $ENV{REMOTE_ADDR} });

GT::Plugins->action ( CONTINUE );
return;

}

}
# Always end with a 1.
1;
Subject Author Views Date
Thread Welcome message balita 14985 Apr 23, 2002, 3:49 AM
Thread Re: [balita] Welcome message
ptegler 14669 Apr 23, 2002, 6:17 AM
Post Re: [ptegler] Welcome message
balita 14517 Apr 23, 2002, 9:41 AM
Thread Re: [balita] Welcome message
Franco 14557 Apr 23, 2002, 7:39 AM
Post Re: [Franco] Welcome message
Paul 14525 Apr 23, 2002, 7:55 AM
Thread Re: [Franco] Welcome message
Paul 14555 Apr 23, 2002, 8:18 AM
Thread Re: [Paul] Welcome message
Franco 14601 Apr 23, 2002, 8:20 AM
Post Re: [Franco] Welcome message
Paul 14508 Apr 23, 2002, 9:18 AM
Thread Re: [Franco] Welcome message
Paul 14599 Apr 23, 2002, 10:30 AM
Thread Re: [Paul] Welcome message
Franco 14480 Apr 23, 2002, 10:50 AM
Thread Re: [Franco] Welcome message
Paul 14560 Apr 23, 2002, 10:54 AM
Thread Re: [Paul] Welcome message
Franco 14556 Apr 23, 2002, 11:09 AM
Post Re: [Franco] Welcome message
hoefti 14287 Nov 18, 2004, 11:32 AM
Thread Re: [Paul] Welcome message
SeanP 14379 Dec 5, 2005, 1:52 PM
Thread Re: [SeanP] Welcome message
Franco 14287 Dec 8, 2005, 7:31 PM
Thread Re: [Franco] Welcome message
SeanP 14199 Dec 8, 2005, 8:11 PM
Thread Re: [SeanP] Welcome message
eupos 14194 Dec 9, 2005, 12:17 AM
Thread Re: [eupos] Welcome message
Andy 14287 Dec 9, 2005, 12:31 AM
Thread Re: [Andy] Welcome message
SeanP 14346 Dec 12, 2005, 7:43 AM
Post Re: [SeanP] Welcome message
eupos 14306 Dec 12, 2005, 8:18 AM
Thread Re: [Andy] Welcome message
SeanP 14129 Dec 13, 2005, 8:47 AM
Thread Re: [SeanP] Welcome message
eupos 14187 Dec 14, 2005, 12:37 AM
Thread Re: [eupos] Welcome message
SeanP 14231 Dec 14, 2005, 6:17 AM
Thread Re: [SeanP] Welcome message
eupos 14209 Dec 14, 2005, 7:20 AM
Post Re: [eupos] Welcome message
SeanP 3304 Dec 14, 2005, 2:51 PM
Thread Re: [eupos] Welcome message
hoefti 3123 Feb 26, 2007, 1:59 PM
Post Re: [hoefti] Welcome message
eupos 3096 Feb 28, 2007, 3:31 AM
Post Re: [eupos] Welcome message
SeanP 14220 Dec 9, 2005, 7:33 AM