YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Pages: 1 2 
Topic Tools
 
Eblah (Read 11,015 times)
 Reply #15 - Sep 24th, 2005 at 9:33pm
There are no actions to perform.  

AK108 
YaBB Legends (Inactive)
*
Offline
Posts: 3,321


None
Re: Eblah
We could establish accepted names for all things that are common (such as username, password, displayname, aim, iamadmin, iamgmod) and then have them translate in and out. You would indeed have to expand it whenever a board came out with a new feature, but the output driver should use regexes to verify that the data is the expected type (icq is all numbers, iamadmin is on or off).

Say Board X came out with a "GlobalX ID" for their profile. The Board X input converter could feed the UDO a "_global_x_id" field (preceding it with an underscore to indicate that it isn't standerd yet) and set the version of the field to "Board X 1.2.3". Then, an output converter can later try to understand it, and if it passes the version test and and the regex test, it could be converted. Otherwise, it'll be discarded.

So it might look something like this (input driver)
Code Select All
# In the convertmembers sub
$memberin{$username}{'_global_x_id'} = $file[12];
$datasourcegen = 'Board X'; # Generic name
$datasourcever = '1.2.3'; # Specific version 



Output
Code Select All
if($datasourcegen eq 'Board X') {
     $memberout{$username}{'globalx'} = $memberin{$username}{'_global_x_id'};
     if($memberout{$username}{'globalx'} =~ /[^A-Za-z0-9_\-]/) {undef $memberout{$username}{'globalx'};} # Not safe to accept it if there's even one bad character
} 



Just an idea.
« Last Edit: Sep 24th, 2005 at 9:34pm by AK108 »  
Do not PM me for support.
WWW  
IP Logged  
 Reply #16 - Sep 25th, 2005 at 9:30am
There are no actions to perform.  

Matt Siegman 
YaBB Legends (Inactive)
*
Offline
Posts: 3,380
Wichita, KS


None
Re: Eblah
I like the idea of prefixing non-standard names with _.  I'll add it to the doc soon.
 
-- Matt Siegman 8) Wish List
 
IP Logged  
 Reply #17 - Sep 26th, 2005 at 5:16pm
There are no actions to perform.  

Tea-Master 
YaBB Legends (Active)
*
Offline
Posts: 3,623
Germany


None
Re: Eblah
hm ak good point about the data validation. every board may expect the data being in an other format. i.e. what about usernames? the one board allows characters like $% and the other does not. replace them with an underscore and if it results into an other existing name add a number right behind it? what about telephone numbers? passwords? userid's (loginname instead of number)? and the list goes on... in some cases replacements will become a very big issue resulting in lots of changes (if the field is referenced several times in different places).
what ever the converter does it has to display a list of changes it made of course.

Quote:
I was thinking that maybe we should have an official Driver list, where the drivers conform to our standards, including naming in their UDOs.  This would be the best way to ensure that the user downloads quality/working software.

What do you think?

yes that should be established for sure.
 
--> also known as Agent Zed Wink
 
IP Logged  
 Reply #18 - Sep 27th, 2005 at 3:24am
There are no actions to perform.  

AK108 
YaBB Legends (Inactive)
*
Offline
Posts: 3,321


None
Re: Eblah
The way I see it, there are three possible ways to handle variables that don't pass the test. The first way is to totally discard the data. I suggest that this is the way to handle non-standard data, as the UDO doesn't have an official format for it.
The second way is to do some replacements on the characters that aren't allowed, like removing or replaceing all invalid characters with, say, "Q".
The third way is to specially handle a data type from a specific board. This is the best way of the three (keeps the most data) but is the most impractical due to the sheer number of board types out there.

The second way is probably the best (and required pretty much for required fields) way to handle it. Maybe the converter should provide a few validation routines to make checking things easy? Or are regexs good enough?
« Last Edit: Sep 27th, 2005 at 3:24am by AK108 »  
Do not PM me for support.
WWW  
IP Logged  
 Reply #19 - Sep 27th, 2005 at 11:55am
There are no actions to perform.  

Tea-Master 
YaBB Legends (Active)
*
Offline
Posts: 3,623
Germany


None
Re: Eblah
regexs are great but i think there should be a validator class which provides methods to validate the data. regexs are always a point of failure and often misunderstood so we may end up with changing regexes often and in lots of places.
 
--> also known as Agent Zed Wink
 
IP Logged  
Pages: 1 2 
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.