aspose file tools*
The moose likes Ranch Office and the fly likes naming policy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "naming policy" Watch "naming policy" New topic
Author

naming policy

karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi,
how about preventing users to register if their username does not conform the naming policys ?
it is anoying to click on a thread and to find out that the only answer is the "we have a naming pol..."
is this possible ? / stupid ? / good ? /
karl
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
This is not possible with the current software. However, we would like suggestions about other ways to deal with naming policy violators.

Some things that have already been suggested include:
1) email the violator and disable his account (if he registered with a fake name, his email address is probably also fake)
2) delete the thread and disable the account (it might be a good question)
3) close the thread and disable the account(may prevent someone with a good answer from posting to that thread)

Any other thoughts?

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Marilyn deQueiroz:
This is not possible with the current software.

I've seen a thread where Paul Wheaton says he is reluctant to hack the perl to enforce the naming policy because it is possible that some other stuff might not work. Wouldn't it be possible to do a minor hack to the code, where it generates the registration page, to add some HTML to import some external JavaScript code in order to perform client-side form validation to enforce the naming policy?
Not a perfect solution, since disabling JavaScript would get around it, but possibly a compromise.
[This message has been edited by Jason Menard (edited July 10, 2001).]
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi,
yes, what about checking the name with Javascript. only simple checks like is it 2 parts, separated by a space.
if you submit the form by calling submit() function and not with the submit button, then you can even prevent "javascript-off-switchers" from subscribing with wrong names.

karl
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20647
    ∞

I'm open to trying something like that. We would need somebody with a lot of JavaScript experience to work with a sheriff that is willing to donate time to such a project ....


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Here is some code which demonstrates the concept:

**Note: Couldn't figure out how to turn html off for this one so I replaced the html containers with '|'. Sorry about that, but it gets the idea across.
I would be happy to provide any assistance required.
Jason

[This message has been edited by Jason Menard (edited July 13, 2001).]
[This message has been edited by Jason Menard (edited July 16, 2001).]
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I got this error when I tried testing your data entry.

Method Not Allowed
The requested method POST is not allowed for the URL /ubb/Forum10/HTML/000645.html.

--------------------------------------------------------------------------------
Apache/1.3.17 Server at www.javaranch.com Port 80


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Ajith Kallambella:
I got this error when I tried testing your data entry.
[b]
Method Not Allowed
The requested method POST is not allowed for the URL /ubb/Forum10/HTML/000645.html.

Yeah it was interpreting the html and I was just trying to display the code. I did a cheap workaround so you can look at it now.
Jason
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Originally posted by Jason Menard:
Here is some code which demonstrates the concept:

Notice "method=POST"

Reread Ajith's comment.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Marilyn deQueiroz:
[B]
Originally posted by Jason Menard:
Here is some code which demonstrates the concept:

Notice "method=POST"

Reread Ajith's comment.[/B]

I read the comment. Ajith executed an html form I had inadvertantly embedded in this page. The method was POST, which is what you normally do with a form, and there was no ACTION specified. When there is no ACTION specified it implies the ACTION is the current page. Naturally my example trying to POST to THIS page will cause an error which is what happened. The point of the example was to demonstrate the javascript. If you take the code and put it in its own html file the demo will work..
Or have I totaly missed the point and you mean something else?
Jason
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Well,
The html that contains the form where you enter your new user name etc. is dynamically generated by a cgi program so, to add the javascript, we would have to hack the perl script for it.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
You can always put the java script into a .js file then just include it in the html file that is generated. That way all you have to get into the perl is the include line.
Dave

Dave
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
You also have to modify the < form> line to reflect the onSubmit() call. It's really a fairly minor perl hack, especially if as suggested the js file is included from an external source.
Specifically it looks like the javascript could be put into ubb/noncgi/Templates/public_register_page.pl and public_register_page_kid.pl
As a side note, to enforce the naming policy within ubb (non-js), it should be very simple. Just insert an appropriate regex in sub illegal_name_check in the ubb_lib.cgi file.
Jason
[This message has been edited by Jason Menard (edited July 16, 2001).]
 
 
subject: naming policy