[web2py] SMTP authentication with gmail

2012-06-26 Thread aungsan
Please let me know anything wrong in the following code. 

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db, hmac_key = Auth.get_or_create_key())

auth.settings.create_user_groups=False
auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username','profile']
auth.settings.remember_me_form = False

## create all tables needed by auth if not custom tables
#auth.define_tables(username=True, migrate = False, fake_migrate = True)
auth.define_tables(migrate = False, fake_migrate = True)

from gluon.contrib.login_methods.email_auth import email_auth
auth.settings.login_methods.append(
email_auth("smtp.gmail.com:587", "@gmail.com"))

I am having the same problem. How did you fix it? Let say, if port 587 is 
 not working, what kind of error do you have. 

For me, it return no error at all. Just show me that invalid login.

Any idea ? 

-- 





[web2py] Re: email_auth with GMail and fluxflex

2012-06-26 Thread aungsan
I am having the same problem. How did you fix it? Let say, if port 587 is 
 not working, what kind of error do you have. 

For me, it return no error at all. Just show me that invalid login.

Any idea ? 

-- 





[web2py] Re: After LDAP authentication, where can I change some actions?

2012-06-26 Thread aungsan
same here. Please keep me in your circle. If anyone know the answer, plz 
share with me :)

-- 





[web2py] Re: ldap

2012-06-26 Thread aungsan
Thanks. From source, it work. I normally do dev on nix. This time, on 
windows. So I do not notice. I was even surprised when I do not see source 
to debug. ^_^

-- 





[web2py] Re: Authentication

2012-06-26 Thread aungsan
How about LDAP? 

I use the following as seen on site.


from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
   server='my.domain.controller',
   base_dn='ou=Users,dc=domain,dc=com'))


But my question is do I still have to keep the following lines ? 

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db, hmac_key = Auth.get_or_create_key())

What is auth = Auth(db, hmac_key = Auth.get_or_create_key()) actually does 
? If i comment those line, I got error saying that auth is not defined.

-- 





[web2py] ldap

2012-06-25 Thread aungsan
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
   server='abc.google.com', base_dn='ou=Users, dc=google,dc=com')]

I am having the following error.

File "gluon/contrib/login_methods/ldap_auth.py", line 9, in 
ImportError: No module named ldap


I installed easy_install python-ldap.

I test with just a line in test.py and run python test.py

import ldap

See no error.

i re-install by msi packages. 

http://pypi.python.org/packages/2.7/p/python-ldap/python-ldap-2.4.10.win32-py2.7.msi#md5=7bcf356c590ea093f7c3ad410c155f82

Test with simple import. It work. But web2py still giving error.

-- 





[web2py] Authentication

2012-06-25 Thread aungsan
I got following issue with web2py Authentication.

I have to authenticate through URL 
"http://www.example.com/something/q?ID='username'&pass='password'"

It return true or false. I cannot go and change it. And I have to do 
authentication with it for sure.

After I got true or false, I would like to insert username and password 
into web2py auth database and set login flag. So that user is logged in.

How could I implement it ?

-- 





[web2py] Re: web2py DAL, migration

2012-06-25 Thread aungsan
Hey 

thanks you so much. I guess it is mysql wired thing. keyword reserve. But 
sometimes it does work. sometimes it does not.  ^_^

-- 





[web2py] web2py DAL, migration

2012-06-25 Thread aungsan
Hi,

I got web2py dal very wired problem.

I follow that link.

http://vimeo.com/23145118

db.define_table('stock_price2',
  Field('symbol'),
  Field('price', 'double'),
  Field('price_change', 'double'),
)

Accidentally, i type chnage in the last field name. So I want to change it 
back to "change". MySQL  does not accept that field name. And then later 
web2py give me no much problem Cos I go and change directly in mysql.

db.define_table('stock_price2',
  Field('symbol'),
  Field('price', 'double'),
  Field('price_change', 'double'),
  migrate = False, fake_migrate = True
)

Nothing work.

I really want to know simple example how to change field name after table 
is crated.

Thanks you very much. Web2py ROCK !

-- 





[web2py] ajax form submit

2010-12-16 Thread aungsan
for example,

in default.py

def user():
  return dict(form=auth())


in view

{=form}}

How do I change it styl, i.e password input box appear next to
username not below.

And I put the following in the views/default/index.html


{{=A('linked page',_href=URL(c='default',f='user'),cid='myid')}}


But I could not submit the form. It does not work. Nothing happen :S