Hi Anthony,

I am completely puzzled as to what happens, I added a warning variable to 
the function, to which I write the value of password throughout the code:


password=generate_password(name,now)
warning=' no form: ' + password
form=SQLFORM.factory(db.auth_user,ignore_rw=True,submit_button='Registreer',separator='',formstyle='bootstrap')
warning=warning +' form factory: ' + password
form.vars.title=row.title
form.vars.first_name=row.firstName
form.vars.familyNamePreposition=row.familyNamePreposition
form.vars.last_name=row.lastName
form.vars.shortname=username
form.vars.phone=row.phone
form.vars.email=row.email
form.vars.username=username
warning=warning +' form vars: ' + password
form.vars.password=password
warning=warning +' after form vars: ' + password
form.vars.nodeID=session.userNodeID
form.element('#no_table_username')['_readonly']=True
form.element('#no_table_password')['_readonly']=True
form.element('#no_table_nodeID')['_readonly']=True
form[0].insert(0,DIV(LABEL(H5('Gebruikersgegevens:'),_class="control-label"),_class="control-group"))
form[0].insert(8,DIV(LABEL(H5('Inloggegevens:'),_class="control-label"),_class="control-group"))
warning=warning +' before label: ' + password
form[0].insert(10,DIV(LABEL(H5(password),_class="control-label"),_class="control-group"))
warning=warning +' after label: ' + password
form[0].insert(12,DIV(LABEL(H5('Nodegegevens:'),_class="control-label"),_class="control-group"))
form[0].insert(14,DIV(LABEL(H5('Niet 
invullen!:'),_class="control-label"),_class="control-group"))
warning=warning +' form before process: ' + password
if 
form.process(onvalidation=onvalidation_register_form,keepvalues=False).accepted:
    warning=warning +' form after submit: ' + password
    id=session.userNodeID
    del session.userNodeID
    warning=warning + ' userNodeID: ' + password
    rating=db(db.rating.nodeID==id).select().first()
    if not rating:
        db.rating.insert(nodeID=id,rating=categoryID)
    else:
        rating.update_record(nodeID=id,rating=categoryID)
    if categoryID!=FREEVCARDID:
        
bankaccount=db(db.bankAccount.nodeID==id).select(db.bankAccount.ALL).first()
        if bankaccount:
            if bankaccount.BIC!=row.BIC or bankaccount.IBAN!=row.IBAN or 
bankaccount.holder!=row.holder:
                
bankaccount.update_record(BIC=row.BIC,IBAN=row.IBAN,holder=row.holder)
        else:
            
db.bankAccount.insert(nodeID=id,BIC=row.BIC,IBAN=row.IBAN,holder=row.holder) 

        db.notification.insert(nodeID=id,notification=BANKACCOUNTCRUD)
    warning=warning + ' pre auth_user: ' + password
    userID=db.auth_user.insert(**db.auth_user._filter_fields(form.vars))
    warning= warning + ' auth_user: ' + password
    db.auth_membership.insert(user_id=userID,group_id=PROFILEGROUPID)
    db.auth_membership.insert(user_id=userID,group_id=ACCOUNTGROUPID)
    db.auth_membership.insert(user_id=userID,group_id=INTERFACEGROUPID)
    db.auth_membership.insert(user_id=userID,group_id=TEXTGROUPID)
    accountID=db.account.insert(nodeID=id)
    
interfaces=db(db.interface.nodeID==id).select(orderby=db.interface.categoryID)
    if interfaces:
        interface=interfaces.last()
        if interface:
            if interface.customized:
                redirect(URL('customizedInterface',args=id))
            else:
                
nodenavs=db((db.nodeNav.nodeID==id)&(db.nodeNav.navID==db.nav.id)).select(orderby=db.nav.id)
                if categoryID<=VCARDID:
                    
db.accountInterface.insert(accountID=accountID,interfaceID=interface.id)
                    if categoryID==FREEVCARDID:
                        
navs=db(db.nav.id.belongs(FREEVCARDID_NAVLIST)).select(orderby=db.nav.id)
                    elif categoryID==VCARDID:
                        
db.auth_membership.insert(user_id=userID,group_id=GRAPHICSGROUPID)
                        
db.auth_membership.insert(user_id=userID,group_id=NETWORKGROUPID)
                        
navs=db(db.nav.id.belongs(VCARDID_NAVLIST)).select(orderby=db.nav.id)
                for n in navs:
                    process_switchboard(db,id,n.navbarID,n.id,True)
    else:
        if categoryID<=VCARDID:
            interfaceID=db.interface.insert(nodeID=id,categoryID=categoryID)
            
db.accountInterface.insert(accountID=accountID,interfaceID=interfaceID)
            if categoryID==FREEVCARDID:
                
insert_navbars_navs(id,FREEVCARDID_NAVBARLIST,FREEVCARDID_NAVLIST)
            elif categoryID==VCARDID:
                
db.auth_membership.insert(user_id=userID,group_id=GRAPHICSGROUPID)
                
db.auth_membership.insert(user_id=userID,group_id=NETWORKGROUPID)
                insert_navbars_navs(id,VCARDID_NAVBARLIST,VCARDID_NAVLIST)
    row.update_record(nodeID=id,repliedOn=request.now)
    
context=dict(id=id,title=form.vars.title,familyNamePreposition=form.vars.familyNamePreposition,\
    
lastName=form.vars.last_name,username=username,userkeyword=password,signature=None)
    message=response.render('mail/register.html',context)
    recipient=form.vars.email
    mail.send(to=[recipient],subject='Uw Leonexus ID voor de toegang tot 
Leonexus CMS',message=[None,message])

When I execute the function the warning has the following values:

no form: TnewO[86 
form factory: TnewO[86 
form vars: TnewO[86 
after form vars: TnewO[86 
before label: TnewO[86 
after label: TnewO[86 f
form before process: TnewO[86 
form after submit: TnewO[86 
userNodeID: TnewO[86 
pre auth_user: TnewO[86 
auth_user: TnewO[86 


In this line of code:

form[0].insert(10,DIV(LABEL(H5(password),_class="control-label"),_class="control-group"))

and for the insert in the auth_user table password has the value: HnewN}86

I am able to login using the username and the HnewN}86 the other value of 
password, wherever it comes from is useless.
As I said when instead of calling password=generate_password(name,now) I 
set the password to '#6testvalue' the function
executes flawlessly.

I hope you have sufficient information to help me solve this problem.

Kind regards,

Annet 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to