Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Email Notification when New User Registers

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to have jForum email me when a new user registers so that I can configure their rights right away versus them having to wait for me to grant them user rights beyond the basics?

The number of people that will be using and registering to this forum is very small so it is easy to manage.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using e-mail notification on registration (e.g. they get a new user gets an e-mail with a link they have to click to verify the address), you can modify the ActivationSpammer class to include the admin e-mail address in the recicients list.

If you're not using that, you can modify the UserAction.insertSave method to send the admin an e-mail when a new user is added. Not sure, but you may have to consider the case when the id is added via the admin screens. They may use the same code.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

monroe wrote:If you are using e-mail notification on registration (e.g. they get a new user gets an e-mail with a link they have to click to verify the address), you can modify the ActivationSpammer class to include the admin e-mail address in the recicients list.

If you're not using that, you can modify the UserAction.insertSave method to send the admin an e-mail when a new user is added. Not sure, but you may have to consider the case when the id is added via the admin screens. They may use the same code.



I am using the email notification upon registration. Where would I find that ActivationSpammer class at? Sorry, I am not the greatest with this stuff usually.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I found the classes you were talking about and Im guessing that you mean the ActivationKeySpammer.class file. My only problem is that I have no idea what to do with Java stuff and how to decompile the class files or whatever I need to do to edit them. Is there something specific I can/should do to modify that file? If so, how do I do it?
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes that is the class I meant.

You'll need to get the Source Distributions and modify this by finding the lines:



And adding code like this below them:


[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so when there is that line that says:

User admin = um.selectByName("admin");

It is going to search through all of the current users and try to find someone with the username of admin and use that email address correct?
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the "admin" part can be any user name in jForum's user table. The e-mail address for this user will get a copy of the "Click here to finish registering" message.

FYI if you want to have multiple people notified, you just have to repeat the last two lines. E.g.


[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gotcha. I am downloading the source pack right now because I just tried a decompiler (DJ Decompiler) and it didnt seem to like that. I will try the straight source way.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I am getting a little confused. I downloaded the source files and the class file is still compiled? How do I make my change and recompile that .class file to work? I dont know my java at all and how this stuff works. I am able to see code when I decompile it but after I make my change, I dont know how to recompile it so that it doesnt go back to plaintext.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You do not need to decompile, just compile de sources to regenerate the .class files when you are ready to try your modifications.

To compile, change to the jforum directory and type:

ant dist

That command will compile and generate a distribution file like the one you downloaded in the beginning, in the dist subdirectory.

[originally posted on jforum.net by andune76]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not have ant installed or configured tho and I have never been able to get it working properly with XAMPP. I will see what I can do and go from there I guess. Either that or have someone compile that file with the code needed already in there so that I can just pop it right in.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Ok I finally got ant working but I cant seem to compile it successfully. Above is the errors that it is giving me. Below is my ActivationKeySpammer.java file


[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, I am using XAMPP 1.6.6a. I am using MySQL for my DB.
[originally posted on jforum.net by confused2gether]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, Java 101 is in session...

Java is a "tightly typed" language. This means that any variable has to be tied to a definite Object or primitive type. (As opposed to languages like Basic and Perl which let you assign anything to a variable and cause lots of grief down the line...) E.g. If a variable is declared as type String, only String values can be assigned to it. The same is true of variables that are defined to real Objects, e.g. UserDAO and the like.

Java does not limit it's "namespace" to having just one unique object named "UserDAO". It lets you use this name for other objects. However, each class or object has a unique "package" that it belongs to. And so there is a fully qualified name for each object, eg. net.jforum.dao.UserDAO is different from com.my.jforum.dao.UserDAO.

However, to keep programmer from typing the long fully qualified name, Java has a variety of ways that can be used to allow just the short class name to be used.

The "can not find Symbol" class XXX means that the compiler can not link the short name of XXX to the fully qualified class you want.

The easy way to fix this is to add an "import" statement at the top of your class code to with the fully qualified classes you want to use from other packages. E.g.:

import net.jforum.dao.*;

Will allow all the classes from that package to be referred to by just the short class name. (FYI - This is where the two class missing Classes live.)

Alternatively, you can explicitly import just the classes you need. (Eclipse will do this for you automatically). This is slightly more efficient but not necessary. You can also not do an import and use the fully qualified Class name with no imports. E.g., type in net.jforum.dao.UserDAO each time you refer to this.

As to the "variable recipient" not found... try recipients as in the "List recipients =" variable declaration.

Now you know a little bit of Java programming magic...
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I LIKE THIS BBS!
[originally posted on jforum.net by hanwesley]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I only want to taste.
[originally posted on jforum.net by hanwesley]
 
reply
    Bookmark Topic Watch Topic
  • New Topic