locked
Giving approval to site postings RRS feed

  • Question

  • User1367810460 posted
    I notice that postings to this site must be approved by the site moderator. How can I find out about adding the same functionality to my own classifieds web site?
    Monday, August 28, 2006 3:01 PM

All replies

  • User1272303263 posted

    Dear Friend,

    when you install the classifed Kit, You obviously become the owner/moderator
    of your own website, so you can easily update/delete/moderate any ad posted on your site.

    I hope you have understood. If not then pl., install and check it yourself.

     

    Thanks
     

    Monday, August 28, 2006 10:54 PM
  • User1367810460 posted
    I want to control the site proactively -- before the "ads" are posted rather than after. Users can, after all, post some very untasteful material that I might not see for hours or days unless I become married to the site. I need the ability to inspect material before it is actually posted which is, of course, the way this site works (at least with regard to original thread postings although not these response postings -- I wonder if that does not sometimes cause some problems).
    Tuesday, August 29, 2006 8:04 AM
  • User209709384 posted

    As Paggy was saying you do have the ability to do this. If you go to Site Administration, Manage Settings, and check the box: Ads require activation before appearing on the site.

    Each Ad that is not activated will not be displayed but obviously is still in the database.

     Then you or someone as an Administrator have to go in activate the ad.

    What I did was just hooked the site up with paypal, then once they enter in a payment the ad gets activated automatically. I figured most people will not post untasteful material if they have to pay for it

    You also have the option to allow users to edit the ad once it is activated. If you dont want them to edit uncheck the box: Allow Users to edit their Ads:

    Tuesday, August 29, 2006 8:31 AM
  • User1272303263 posted

    You also have the option to allow users to edit the ad once it is activated. If you dont want them to edit uncheck the box: Allow Users to edit their Ads:

    Dear Justin,

    I doubt this option is safe enough. If you allow users to edit, they will again post nasty things on the web. I dont think there is a facility
    in this startkit, when ad ad comes for activation every time it is posted or edited. If it comes for activation, even after (1) Uploading a
    Photo or (2) editing an advt it is nice, other wise it is dangerous.

    Are you aware about this scenerio for activation after editing.

    Bye the way, i have already posted my erorr for the email, as you have guided me.

    Thanks

    Paggy4u

    Tuesday, August 29, 2006 9:36 AM
  • User209709384 posted

    That is why I suggested to turn that feature off. If one wanted to I think it would be rather easy to require activation after editing as well, just change the ad status after they save the edited ad

    Tuesday, August 29, 2006 9:43 AM
  • User1367810460 posted
    This has been quite helpful. I will require activation as has been suggested. And I will look into the same activation for edits. What I really need, however, is to be able to email an activation code to those who register so I can be sure about their identity (their email address) -- and this should be done automatically by the site so I do not have to monitor things. Since identity would be determined before activation, malicious entries should be deterred. I know all this is a big job and I do not expect anyone out there to do it for me but send any tips that you may be able to offer.
    Wednesday, August 30, 2006 8:29 PM
  • User209709384 posted

    I have not done this but an idea might be to change the IsApproved field value in the aspnet_membership to False when they register, then generate a validation key for that user, save it to the database, and send it off to his/her email address. Then once they validate your generated key, change the IsApproved value to True so they can log in.

    The IsApproved value for a membership user is checked during the call to ValidateUser by the SqlMembershipProvider. If the IsApproved property returns false, the ValidateUser method returns false even if the supplied user name and password are correct.

    Thursday, August 31, 2006 8:52 AM
  • User1367810460 posted
    Good tip. Thanks, Justin!
    Thursday, August 31, 2006 3:16 PM
  • User-505043935 posted

    I have not done this but an idea might be to change the IsApproved field value in the aspnet_membership to False when they register, then generate a validation key for that user, save it to the database, and send it off to his/her email address. Then once they validate your generated key, change the IsApproved value to True so they can log in.

    The IsApproved value for a membership user is checked during the call to ValidateUser by the SqlMembershipProvider. If the IsApproved property returns false, the ValidateUser method returns false even if the supplied user name and password are correct.

    Is there a way to set the IsApproved Flag to False in the CreateUserWizard?  I get the concept here, but not the implementation.  Please be explicit, you've got a newbie here. :)

    Thanks,

     

    Bob

    Sunday, April 13, 2008 9:38 PM
  • User1186425895 posted

    How about a BadWords filter? ... which would be a text file, one badword per line.

    BarryZ

    Wednesday, April 23, 2008 1:14 AM
  • User-505043935 posted

    How about a BadWords filter? ... which would be a text file, one badword per line.

    BarryZ

    Barry,

    I hope you get a better response to your post than I did.  I didn't get any. :)   I'm still trying to figure my situation out.

     

    Bob

    Wednesday, April 23, 2008 1:42 AM
  • User-1137493631 posted

    Hi Friend

    go through this link

    http://www.asp.net/downloads/starter-kits/classifieds/

     

    Wednesday, April 23, 2008 2:01 AM
  • User-505043935 posted

    Which one of us were you responding to?

     Thanks,

    Bob

    Wednesday, April 23, 2008 2:19 AM
  • User1128022426 posted

    Ok, here is my 2 cents..

    I have not implemented the membership approval just yet...however it can easily be implemented by:

    1. In Register.aspx.cs|vb, after the user is created you can set the IsApproved to false

    protected void CreateUserWizardControl_CreatedUser(object sender, EventArgs e){
    ...
          Membership.GetUser().IsApproved=false;   //this will return the current logged in user

    }

    2.You can then generate and email an activation code to the new member and after the member enters the code, you can then set IsApproved back to true

          Membership.GetUser("username").IsApproved=true;

    regarding "bad words" you are trying to filter, Again i did not implement that "yet"....you might want to consider an anti-spam framework....check http://www.akismet.com (Its what wordpress use in their blogs)

    Good Luck!

    Wednesday, April 23, 2008 10:33 AM
  • User-505043935 posted

    Thank you soooooooooooo much!!

    I don't want to generate the email with the approval link.  My situation is that I'm doing a web site for a Yahoo group that I run.  So, I will manually check to see if they are members of the Yahoo group, and then approve them or not, based on that.  I don't want anyone who is not a member of the group to have access to the members only area of this new website.

    Thanks again!

     Bob

    Wednesday, April 23, 2008 12:37 PM
  • User1128022426 posted

    Glad I was able to help :).. Dont forget to mark the question as answered.

    Wednesday, April 23, 2008 1:54 PM
  • User-505043935 posted

    Ok, here is my 2 cents..

    I have not implemented the membership approval just yet...however it can easily be implemented by:

    1. In Register.aspx.cs|vb, after the user is created you can set the IsApproved to false

    protected void CreateUserWizardControl_CreatedUser(object sender, EventArgs e){
    ...
          Membership.GetUser().IsApproved=false;   //this will return the current logged in user

    }

    Ash,

    I tried to implement exactly what you posted above.  Here's what I did:

    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser

    Membership.GetUser.IsApproved = False

    End Sub

    When I ran it, I got this error:

    System.NullReferenceException was unhandled by user code
      Message="Object reference not set to an instance of an object."
      Source="App_Web_y1c5uvrz" 

    ThaT's like the old 429 Automation Errors in VB6 whien you forgot to set a reference to something.  I thought the references to the Membership provider were set by using the Membership controls (Login, Create User, etc.) What else do I need to do?  The register.aspx page is in the root of the application, so it's not a folder problem.

    I also tried taking out the 1 after CreateUserWizard, but it didn't make any difference.  It's the line referenceing the Membership class that causes the error.  I also tried putting in curly brackets since you had them in yours, but I'm using VB and it gave me a syntax error. :)  

    Thanks for your help,

     Bob

     

    Thursday, April 24, 2008 1:43 AM
  • User1128022426 posted

    Are you sure its Membership.GetUser.IsApproved = False and not Membership.GetUser().IsApproved = False

    ?? I know nothing about VB...I HATE that language :)

    null reference is executed if you call a method or a property on a null object. You need to tell the UserWizard control to call the CreateUserWizard1_CreatedUser method on the CreatedUser event. So make sure that this event is set correctly, the name of the method doesnt mater as long as its the same....

    CreatedUser="foobar"

    Protected Sub foobar(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser

    Membership.GetUser().IsApproved = False

    End Sub

    Thursday, April 24, 2008 10:03 AM
  • User-505043935 posted

    ?? I know nothing about VB...I HATE that language :)

    OUCH!  That hurt!  You really know how to wound an old VB guy!  LOL!!!

    Are you sure its Membership.GetUser.IsApproved = False and not Membership.GetUser().IsApproved = False

    null reference is executed if you call a method or a property on a null object. You need to tell the UserWizard control to call the CreateUserWizard1_CreatedUser method on the CreatedUser event. So make sure that this event is set correctly, the name of the method doesnt mater as long as its the same....

    CreatedUser="foobar"

    Protected Sub foobar(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser

    Membership.GetUser().IsApproved = False

    End Sub

    OK, I put the Open and Close parenthesis after the Method Call:

    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser

    Membership.GetUser().IsApproved = False

    End Sub

    But, it made no difference.:It's the Membership.GetUser().IsApproced = False line that fails, and is highlighed in yellow when it comes up.

    Thanks so much for your input.  I appreciate it... even if you do hate VB. :)

     Bob

     

    Thursday, April 24, 2008 11:11 AM
  • User1128022426 posted

    LOL...

    actually try using OnCreatingUser event instead of OnCreatedUser 

     and use Membership.GetUser(CreateUserWizard1.UserName).IsApproved=False;

    check http://forums.asp.net/p/939408/1119989.aspx it talks more about why Membership.GetUser() could return a null..which is why you are getting the nullexception...

    also http://msdn.microsoft.com/en-us/library/fcxcb339.aspx is the documentation for the GetUser() Method....

     See if that works for u

    Thursday, April 24, 2008 11:38 AM
  • User-505043935 posted

    Ash, and others,

    EUREKA!!!  I worked it out.  THANKS for all your help. When I was first learning VB (sorry, Ash :) ) my instructor, and best friend to this day used to tell me every time I'd go to him with a question about something, "Go write an app that uses it.  When you figure it out, no one can ever take it from you."  It used to make me so frustrated, but he was right.  When I finally figured the darn thing out, and got it working, I knew it. 

    Well, this has gone is a very similar direction.  In looking at the links you sent me, I realized that perhpas I was going about this all wrong.  And in fact I was.  The GetUser() Method ONLY EVER works with a logged in User, which someone who is creating a new account will not be.  So, I stepped back from the Membership methods and started researching the CreateUserWizard properties and methods.  Here's what I came up with:

     Protected Sub CreateUserWizard1_CreatingUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles CreateUserWizard1.CreatingUser

    CreateUserWizard1.DisableCreatedUser =True CreateUserWizard1.LoginCreatedUser = False

    End Sub

    And it works like a charm!!!  It disables the user, unil I can approve them, and it stops the Wizard from logging them in. Now, I've just got to make me a way to enable them, but that should be easy.  I'll try to find the flg in the database that marks them as disabled and clear it when I approve them.  It appears that  it may be the Approved field, but not sure.  I'll work on that next. 

    But if anyone is wanting to not automatically approve new registerees, these two lines of code work great!

    Thanks for everyone's patience and help,

    Bob

    Thursday, April 24, 2008 1:05 PM
  • User-505043935 posted

    One quick follow-up:  It is the "IsApproved" field in the Membership database that will need to be reset once you want to approve the registeree.  The code I used above sets the field to False.  Changing it to true allows them to log in just fine.  I tested it.

    Thakns again,

    Bob

    Thursday, April 24, 2008 1:23 PM