OW2 - Online Registration.


O W 2 - Warning
Warning
<% import groovy.sql.Sql

def sql = Sql.newInstance("jdbc:mysql://mysql-ldap-02.ow2.org/ow2", "ow2","lm2panpo_objectweb", "com.mysql.jdbc.Driver");

// ********** check about user login ****** def isUserAlreadyUsed(db,login){ def select ="SELECT count(*) count FROM t_user WHERE login ='${login}'";

def res = db.firstRow(select); if (res.count == 0) return false; else return true; }

// ********** Return true if the given organization is already registered def isOW2OrganizationAlreadyRegistered(db, name) { def select = "SELECT count(*) count FROM ow2_legal_entity_member WHERE name = '${name}'"; def res = db.firstRow(select); if (res.count == 0) return false; else return true; }

// ************ Return true if a legal entity representative is already registered with this email def isOW2EmailAlreadyUsedForLegalEntity(db, email){ def select = "SELECT count(*) count FROM ow2_legal_entity_member WHERE representative_email = '${email}'"; def res = db.firstRow(select); if (res.count == 0) return false; else return true; }

// ************ Return true if an individual is already registered with this email def isEmailAlreadyUsedForIndividual(db, email) { def select ="SELECT count(*) count FROM t_individual_member WHERE email = '${email}'"; def res = db.firstRow(select); if (res.count == 0) return false; else return true; }

def errorNumber = 0; def error="";

def login = request.getParameter("login"); if (login==null) login="";

def email= request.getParameter("email"); if (email==null) email="";

def firstName= request.getParameter("firstName"); if (firstName==null) firstName="";

def lastName= request.getParameter("lastName"); if (lastName==null) lastName="";

def membership= request.getParameter("membership"); if (membership==null) membership="";

def consortiumRead= request.getParameter("consortiumRead"); if (consortiumRead==null) consortiumRead="";

def organizationName= request.getParameter("organizationName"); if (organizationName==null) organizationName="";

def organizationWeb= request.getParameter("organizationWeb"); if (organizationWeb==null) organizationWeb="";

def work= request.getParameter("work"); if (work==null) work="";

def street1= request.getParameter("street1"); if (street1==null) street1="";

def street2= request.getParameter("street2"); if (street2==null) street2="";

def city= request.getParameter("city"); if (city==null) city="";

def state= request.getParameter("state"); if (state==null) state="";

def country= request.getParameter("country"); if (country==null) country="";

def zipCode= request.getParameter("zipCode"); if (zipCode==null) zipCode="";

def invoiceFirstName= request.getParameter("invoiceFirstName"); if (invoiceFirstName==null) invoiceFirstName="";

def invoiceLastName= request.getParameter("invoiceLastName"); if (invoiceLastName==null) invoiceLastName="";

def invoiceStreet1= request.getParameter("invoiceStreet1"); if (invoiceStreet1==null) invoiceStreet1="";

def invoiceStreet2= request.getParameter("invoiceStreet2"); if (invoiceStreet2==null) invoiceStreet2="";

def invoiceCity= request.getParameter("invoiceCity"); if (invoiceCity==null) invoiceCity="";

def invoiceState= request.getParameter("invoiceState"); if (invoiceState==null) invoiceState="";

def invoiceZipCode= request.getParameter("invoiceZipCode"); if (invoiceZipCode==null) invoiceZipCode="";

def invoiceCountry= request.getParameter("invoiceCountry"); if (invoiceCountry==null) invoiceCountry="";

def status= request.getParameter("status"); if (status==null) status="";

if (membership!= null && membership.size()!= 0 && membership!="strategic" && membership!="corporate" && membership!="individual"){ ++errorNumber; error += ""; error += " - "; error += "Your session has expired. Please restart the OW2 On-Line Registration"; error += ""; }

if (errorNumber ==0){ if (login != null && login.size() < 2){ error += ""; error += "" + ++errorNumber +"."; error += "Your login must be at least 2 characters long."; error += ""; } else { if (login != null && login.size() > 40){ error += ""; error += "" + ++errorNumber +"."; error += "Your login must not be more than 40 characters long."; error += ""; } else { if (!(login==~"^a-z A-Z?{1}0-9a-z A-Z_?+$")){ error += ""; error += "" + ++errorNumber +"."; error += "Your login must contain only alphanumeric characters or underscore character."; error += ""; } } }

if (isUserAlreadyUsed(sql,login)){ error += ""; error += "" + ++errorNumber +"."; error += "Login already used. "; error += " If you are an former ObjectWeb Member, please "; error += "edit your profile to become an OW2 Member"; error += ""; } if (membership != null && membership.size() == 0){ error += ""; error += "" + ++errorNumber +"."; error += "Please select your membership program."; error += ""; }else{ if ( membership == "corporate" || membership == "strategic" ) { if ( isOW2EmailAlreadyUsedForLegalEntity(sql, email)) { error += ""; error += "" + ++errorNumber +"."; error += "Another legal entity representative already uses this e-mail."; error += ""; } else { if ( membership == "individual" && isOW2EmailAlreadyUsedForIndividual(sql, email) ) { error += ""; error += "" + ++errorNumber +"."; error +="Someone is already registered with this e-mail."; error += ""; } } } } if ( consortiumRead==null || (consortiumRead != null && consortiumRead != 'y')) { error += ""; error += "" + ++errorNumber +"."; error += "Please read the Consortium Agreement."; error += ""; }

}

if (errorNumber != 0){%>

O W 2 Registration Wizard

Step 1 - Control Form

<%print error%>
Warning

<%}

if (errorNumber == 0 ){%>

O W 2 Registration Wizard

Step 2
<%if (membership == "individual" || membership == "strategic" ){ %>
Organizzation name: <% if (membership == "strategic") {%> <%}%>
Organization website:
Your position: <% if (membership == "strategic") {%> <%}%>
<%} else if (membership == "corporate"){%>
Organization name:

Organization website:
Organization status:
/> An Academic Research Laboratory
/> An Academia (university, public school,including non-profit organization)
/> A Micro-enterprise^
/> A Small or Medium-sized enterprise^(we call them SMORG, Small or Medium-sized ORGanization)
/> A Large enterprise^ (we call them LORG, for Large ORGanization)

^~~as defined by the European Commission, see also Membership Categories?~~

Your position:

<%}%>


All fields marked by a Required field are required.
<%}%> <%sql.close() %>

http://skins.ow2.org/skins/skinOW2/images/Featuredvideo.png
  • Jean-Pierre Laisné, CloudOrbit
http://skins.ow2.org/skins/skinOW2/images/watchallvideos.png

 


This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4.4 - Documentation
Powered by XWiki Hosted by Xsalto Free PageRank Checker Creative Commons 2.0 license Legal Notice