[web2py] Re: Making minor changes to auth.navbar()

2013-12-05 Thread Rohan Prinja
How did you solve it? I'm facing the same problem - deciding where to place 
the navbar code I wrote.

On Saturday, 15 December 2012 09:09:05 UTC+5:30, Lewis wrote:

 I solved this.

 On Friday, December 14, 2012 3:37:45 PM UTC-8, Lewis wrote:

 I understand that code and put it in my controller.

 But, where do I put the reference to it in the view (the base view that 
 is extended):

 By default it says:  div id=navbar{{='auth' in globals() and 
 auth.navbar(separators=(' ',' | ',''))}}/div

 I assume that user.bar must replace auth.navbar(...).

 But, I don't see how.  An arbitrary function in a controller cannot do 
 the same things that the auth class method does.  The other problem is that 
 my user.bar() is not in default so I must also reference the controller 
 file.  Using URL('...', '') in place of auth.navbar did not work.

 I am sorry:  when you go mucking about substituting for internal 
 functions/classes of web2py it is very unclear what one must do because the 
 behavior of the internal classes is a bit obscure.

 Thank you.

 On Friday, July 20, 2012 4:29:37 PM UTC-7, pbreit wrote:

 I just write my own:

 def user_bar():
 action = '/user'
 if auth.user:
 logout=A('logout', _href=action+'/logout')
 profile=A('profile', _href=action+'/profile')
 password=A('change password', _href=action+'/change_password')
 bar = SPAN(auth.user.email, ' | ', profile, ' | ', password, ' 
 | ', logout, _class='auth_navbar')
 else:
 login=A('login', _href=action+'/login')
 register=A('register',_href=action+'/register')
 lost_password=A('lost password', _href=action+
 '/request_reset_password')
 bar = SPAN(' ', login, ' | ', register, ' | ', lost_password,_class
 ='auth_navbar')
 return bar



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: unable to submit auth forms

2012-10-18 Thread Rohan Malhotra

On Thursday, 18 October 2012 02:51:52 UTC+5:30, Massimo Di Pierro wrote:

 What is the code? Is this something that worked before? using a custom 
 form?

 On Wednesday, 17 October 2012 09:17:57 UTC-5, Rohan Malhotra wrote:

 Version 2.1.1 (2012-10-15 12:44:40) stable

 Hi,

 I am not able to submit an auth form. I am using default auth code. On 
 submitting the form, password is shown as invalid and 'enter from 0 to 
 512 characters' error is thrown. Input

 td class=w2p_fw
 input class=password invalidinput id=auth_user_password 
 name=password type=password 
 value=passwod_value_entered_before_submitting_form
 div class=error_wrapper
 div class=error id=password__error style=display: block;enter 
 from 0 to 512 characters/div
 /div
 /td


 Please advice.

 Thanks


It is default code copied from scaffolding app with no customization.

I downgraded web2py to 1.99 version and things started to work again 
without any change in code.

-Ro 

-- 





[web2py] unable to submit auth forms

2012-10-17 Thread Rohan Malhotra
Version 2.1.1 (2012-10-15 12:44:40) stable

Hi,

I am not able to submit an auth form. I am using default auth code. On 
submitting the form, password is shown as invalid and 'enter from 0 to 512 
characters' error is thrown. Input

td class=w2p_fw
input class=password invalidinput id=auth_user_password 
name=password type=password 
value=passwod_value_entered_before_submitting_form
div class=error_wrapper
div class=error id=password__error style=display: block;enter from 
0 to 512 characters/div
/div
/td


Please advice.

Thanks

-- 





[web2py] Re: Rocket errors on importing python library

2012-03-27 Thread Rohan
any updates?

On Monday, 26 March 2012 20:03:07 UTC+5:30, Rohan wrote:

 Web2py Version 1.99.7 (2012-03-04 22:12:08) stable
 Python 2.7.2+

 I am trying to load external library from python (
 http://pypi.python.org/pypi/readability-lxml/0.2.3)

 import urllib2
 import readability
 page = urllib2.urlopen(url)
 html = page.read()

 page is fetched properly but in my console I am getting Rocket errors. If 
 i comment 'import readability' or not use this lib then no rocket errors 
 are published.

 DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
 conxions
 DEBUG:Rocket.Monitor:In receive timed-out connections loop.
 DEBUG:Rocket.Monitor:Received a timed out connection.
 DEBUG:Rocket.Monitor:Adding connection to monitor list.
 DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
 conxions
 ...
 DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
 conxions
 DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
 conxions
 DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
 conxions
 ...

 and it get keep on printing same message over and over again. I have not 
 changed any values in rocket.py. 

 Is this expected and Is there any way I can disable this?  With this 
 continuous printing actual debug messages are getting lost, making dev 
 really hard.



[web2py] Rocket errors on importing python library

2012-03-26 Thread Rohan
Web2py Version 1.99.7 (2012-03-04 22:12:08) stable
Python 2.7.2+

I am trying to load external library from python (
http://pypi.python.org/pypi/readability-lxml/0.2.3)

import urllib2
import readability
page = urllib2.urlopen(url)
html = page.read()

page is fetched properly but in my console I am getting Rocket errors. If i 
comment 'import readability' or not use this lib then no rocket errors are 
published.

DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
conxions
DEBUG:Rocket.Monitor:In receive timed-out connections loop.
DEBUG:Rocket.Monitor:Received a timed out connection.
DEBUG:Rocket.Monitor:Adding connection to monitor list.
DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
conxions
...
DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
conxions
DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
conxions
DEBUG:Rocket.Errors.ThreadPool:Examining ThreadPool. 10 threads and 0 Q'd 
conxions
...

and it get keep on printing same message over and over again. I have not 
changed any values in rocket.py. 

Is this expected and Is there any way I can disable this?  With this 
continuous printing actual debug messages are getting lost, making dev 
really hard.



[web2py] Current transaction aborted error when trying to save session in database

2011-11-29 Thread Rohan
web2py version: 1.98.2

I have two servers with shared database and I am trying to store session in 
database using 
session.connect(request, response, db=db, migrate=False) 

but  session._try_store_in_db is throwing Internal Error from one of the 
servers but it works fine from second server.
Here is traceback

Traceback (most recent call last):
  File quot;/home/www-data/web2py/gluon/main.pyquot;, line 497, in 
wsgibase
session._try_store_in_db(request, response)
  File quot;/home/www-data/web2py/gluon/globals.pyquot;, line 474, in 
_try_store_in_db
record_id = table.insert(**dd)
  File quot;/home/www-data/web2py/gluon/dal.pyquot;, line 4786, in insert
return self._db._adapter.insert(self,self._listify(fields))
  File quot;/home/www-data/web2py/gluon/dal.pyquot;, line 844, in insert
raise e
InternalError: current transaction is aborted, commands ignored until end 
of transaction block

Any pointers will be appreciated
Regards


[web2py] with_alias with where clause

2011-05-18 Thread Rohan
web2py: Version 1.92.1 (2011-02-16 15:04:40)


with_alias fails to work when where clause is specified. It works fine when 
documented example is run

 db()._select(db.person.name, Father.name, Mother.name, 
left=(Father.on(Father.id==db.person.father_id), 
Mother.on(Mother.id==db.person.mother_id)))

'SELECT  person.name, father.name, mother.name FROM person LEFT JOIN person 
AS father ON (father.id = person.father_id) LEFT JOIN person AS mother ON 
(mother.id = person.mother_id);'

but it fails where I specify a where clause

 db((db.person.father_id == Father.id))._select(db.person.name, 
Father.name)

SELECT  person.name, father.name FROM person, father WHERE (person.father_id 
= father.id);

in second case, alias is not created. Read in a thread that with_alias 
currently supports left outer join only. Any plan to extend its usage?


[web2py] LOAD with ajax=False fails to pass vars

2011-05-12 Thread Rohan
web2py version: Version 1.92.1 (2011-02-16 15:04:40)

LOAD is failing to pass request.vars when ajax is set to False but passed 
vars when ajax is set to True. I want certain component to load before page 
finish loading so need to set ajax= False. I tried this call in 
default/index.html

{{=LOAD(c='default', f='testcall', args=request.args, vars={'x':1}, 
ajax=False)}}

with controller code
def testcall():
print request.vars
return

output with *ajax=True*
Storage {'x': '1'}

but with *ajax=False*
*Storage {}
*
*
*
is there something that I am missing?


[web2py] Re: extra element in form toggles automatically

2011-04-25 Thread Rohan
Any updates?

as a workaround I am using  response.js and setting the correct value of 
checkbox from js.


[web2py] extra element in form toggles automatically

2011-04-04 Thread Rohan
I am creating an extra element in form as per guide
http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM

here is the code

controller
settings_form = SQLFORM(db.auth_user, record, fields = ['first_name',
'email'], labels = {'first_name' : 'Full Name', 'email': 'Email
Address'}, submit_button = 'Submit', showid=False)

custom_checkbox = TR(LABEL(), TD(INPUT(_name='agree',value=True,
_type='checkbox'), LABEL('Some setting')))
settings_form[0].insert(-1, custom_checkbox)

view

h2 class=form_titlePreferences:/h2
{{=LOAD('default', 'settings', ajax=True, target='TargetDiv')}}

on submitting this form from page, the checkbox value toggle itself.
If it's on, after submitting, it will be set to off and if it's on
then on submitting, it will be reset to on.

I also tried this code in simple bare minimum welcome application to
check if any javascript inserted from my end is causing this issue but
faced same issue.

Any pointers?


[web2py] Re: extra element in form toggles automatically

2011-04-04 Thread Rohan
If not always setting it to true, it's toggling it. Once on then off then on 
and so on, 

I modified code and set value based on boolean variable but had same issue.

custom_checkbox = TR(LABEL(), TD(INPUT(_name='agree',value=session.dummy, 
_type='checkbox'), LABEL('Some setting'))) 
settings_form[0].insert(-1, custom_checkbox) 

on form accept

session.dummy =(not session.dummy)


[web2py] Re: extra element in form toggles automatically

2011-04-04 Thread Rohan
 instead of session.dummy =(not session.dummy) on above post,  i tried this 

on form.accepts 
session.dummy = form.vars. agree

still the checkbox toggles.


[web2py] Re: help desk app

2010-12-28 Thread Rohan
Hi,

I was working on tickets2email.py file to deploy it for my app and I
observed (a bug) that we are appending request.folder twice e.g.
applications/init/../init/errors/applications/init/errors/122.1

first in getting filename for ticket in tickets2email.py

filename = os.path.join(path, file)
...
...
error.load(request, request.application, filename)

then in gluon/restricted.py file

def _error_file(self, request, ticket_id, mode, app=None):
root = request.folder
if app:
root = os.path.join(os.path.join(root, '..'), app)
errors_folder = os.path.join(root, 'errors') #.replace('\\',
'/')
return open(os.path.join(errors_folder, ticket_id), mode)

ticket_id passed already had path till errors_folder so this resulted
in appending errors_folder path twice.
I removed errors_folder path from the ticket_id passed from
tickets2email.py and resulting path was correct.

Please let me know if I missed something.

Regards

On Dec 21, 10:38 am, mdipierro mdipie...@cs.depaul.edu wrote:
 You are right... I will change the name as bugs are fixed, when I post
 it on appliances.

 On Dec 20, 11:24 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote:







  Hello Massimo,

  Helpdesk App is something you usually  see on IT Support/ Hosting
  /Callcenters . If you have a web hosting on a popular hosting sites , and if
  you had requested support you will see it.

  Here is the most used (and popular) help desk system written in perl .. you
  can try it  therehttp://bestpractical.com/rt/

  What it does:

  1)When a new user sent an email to supp...@yoursite.com , it creates a
  ticket in a database , announce by emailingg support persons at business-end
  .
  2) Then user will be provided with a link where he can register and login to
  follow that ticket , update/close issue or reopen, open another issue
  3) User can also manually register and login , then create tickets .

  That how it works.

  What you have is ticketing system for web2py , not close to helpdesk , we
  need to avoid confusion here i think.

  Regards,
  Phyo.

  On Tue, Dec 21, 2010 at 6:53 AM, Plumo richar...@gmail.com wrote:
   hi Massimo, if I understand correctly what you created is for managing
   web2py tickets, while a helpdesk app is for managing client inquiries. So
   perhaps rename it to avoid confusion.

   Noticed an error:

   File 
   /home/web2py/devel/applications/helpdesk/views/plugin_wiki/page_edit.html
, line 99

       
   response.write(URL('static',f='plugin_wiki/markitup/sets/markmin/set.js/
script

   SyntaxError: EOL while scanning string literal


[web2py] Invalid function for logged in users

2010-12-02 Thread Rohan
Hi All,

I have a page which can be viewed by both visitors (not logged in) and
logged in users. Page works fine for visitors but when I visit page
after logging in, invalid function is shown on page and no error is
thrown.

I put few debug logs in controller and logs are getting printed. What
could be possible causes for this issue?

Regards
Rohan


[web2py] Re: reset password mail as html mail

2010-07-30 Thread Rohan
Thanks Massimo,

I copied the send() api to my tools.py and it worked.


On Jul 30, 3:03 am, mdipierro mdipie...@cs.depaul.edu wrote:
 Please try the code in trunk. If the message is 'html/html' it
 should be sent automatically in html.

 On Jul 29, 3:00 am, Rohan yourbuddyro...@gmail.com wrote:



  I need to send reset password mail as html, so i created

  in db.py

  auth.messages.reset_password = [None, htmlSome html + Click on
  below link to reset your password\n\n
  http://'+request.env.http_host+URL(r=request,c='account',f='user',args=['re 
  set_password'])+'/%(key)s
  /html]

  in tools.py request_reset_password api, tries to generate key and
  substitute in the message above

  self.settings.mailer.send(to=form.vars.email,

  subject=self.messages.reset_password_subject,

  message=self.messages.reset_password % \

  dict(key=reset_password_key))

  but in case of reset_password message is tuple or list, the above
  substitution will result in an error.

  Any pointers how to send html message?


[web2py] reset password mail as html mail

2010-07-29 Thread Rohan
I need to send reset password mail as html, so i created

in db.py

auth.messages.reset_password = [None, htmlSome html + Click on
below link to reset your password\n\n
http://'+request.env.http_host+URL(r=request,c='account',f='user',args=['reset_password'])+'/%(key)s
/html]

in tools.py request_reset_password api, tries to generate key and
substitute in the message above

self.settings.mailer.send(to=form.vars.email,
 
subject=self.messages.reset_password_subject,
 
message=self.messages.reset_password % \
 
dict(key=reset_password_key))

but in case of reset_password message is tuple or list, the above
substitution will result in an error.

Any pointers how to send html message?


[web2py] invite-friend slice

2010-06-23 Thread Rohan
Anybody aware of any plugin/slice available for inviting friends from
gmail, yahoo, hotmail, aol, facebook etc from a web application?

Thanks in advance.


[web2py] sender's name in mail

2010-06-02 Thread Rohan
I want to add sender's name in emails. Currently I am able to send
mails from ad...@example.com but sender's name is displayed as admin
which is not conveying the proper information. Can I add senders' name
to mail settings so that sender's name is displayed as Example Admin
or XYZ instead of admin?


[web2py] ajax call not working for url with request args

2010-05-18 Thread Rohan

I am trying to call a function using ajax from a page which has a
request arg. the api is not getting called. Same api gets called if I
don't use request.args
here is my code

div id=ajaxCallEval style=display: none;/div
form action=
input type=hidden id=pageId value=-1 /
/form
{{if request.args:}}
p style=cursor: pointer;
onclick=jQuery('#pageId').val('{{=request.args[0]}}');
ajax('pageAjax', ['pageId'],
'ajaxCallEval'); {{=request.args[0]}}/p
{{else:}}
p style=cursor: pointer; onclick=jQuery('#pageId').val('10');
ajax('pageAjax', ['pageId'],
'ajaxCallEval'); 10/p
{{pass}}

and default.py

def pageAjax():


print 'inside pageAjax with pageid %s' %request.vars.pageId
return

if I click on p element from /default/index, control goes inside
pageAjax and line is printed as expected, however similar click on /
default/index/10 does not print anything on console. In both cases
firebug console shows ajax call as being successful.

Please advice.


[web2py] Re: duplicate ids on using auth.login and auth.register forms on same page

2010-05-13 Thread Rohan
i am using  latest version 1.77.3 (2010-04-20 02:48:54)

On May 12, 8:29 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 This was fixed. What version of web2py are you using?

 On May 12, 5:51 am, Rohan yourbuddyro...@gmail.com wrote:



   I am using auth.login and auth.register forms on a single page and it
  is resulting in duplicate ids for email and password rows.
  similar discussions were going on this 
  threadhttp://groups.google.com/group/web2py/browse_frm/thread/e43c1203d8749630
  Is there any update on this?


[web2py] Re: duplicate ids on using auth.login and auth.register forms on same page

2010-05-13 Thread Rohan
i am using latest version 1.77.3 (2010-04-20 02:48:54)

On May 12, 8:29 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 This was fixed. What version of web2py are you using?

 On May 12, 5:51 am, Rohan yourbuddyro...@gmail.com wrote:



   I am using auth.login and auth.register forms on a single page and it
  is resulting in duplicate ids for email and password rows.
  similar discussions were going on this 
  threadhttp://groups.google.com/group/web2py/browse_frm/thread/e43c1203d8749630
  Is there any update on this?


[web2py] Re: SQLFORM generating duplicate ids in HTML

2010-05-12 Thread Rohan
Any update on this? I am using auth.login and auth.register forms on a
single page and it is resulting in duplicate ids for email and
password rows.

Original thread - 
http://groups.google.com/group/web2py/browse_thread/thread/e43c1203d8749630?tvc=2


[web2py] duplicate ids on using auth.login and auth.register forms on same page

2010-05-12 Thread Rohan
 I am using auth.login and auth.register forms on a single page and it
is resulting in duplicate ids for email and password rows.
similar discussions were going on this thread
http://groups.google.com/group/web2py/browse_frm/thread/e43c1203d8749630
Is there any update on this?


[web2py] Re: defaulting a value of a column in table with other columns of table

2010-05-03 Thread Rohan
Hi Mdipierro,

Could you please elaborate,I tried

 Field('access_key', 'string', readable=False, writable=False,
default=lambda r:defaultUserInfo(r['username'], r['email'])),

but keep getting TypeError: lambda() takes exactly 1 argument (0
given) error

Thanks


On Apr 28, 7:01 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Much simpler.

 Field('access_key',calulate=lambda r: calculateValue(r['email']))

 and it will be automatic

 On Apr 28, 2:26 am, Rohan yourbuddyro...@gmail.com wrote:



  Hi,

  I have added a new column access_key in auth_user table, I want to
  default it to with a value obtained by using email

  calculateValue(email):
       #some logic
       return calculatedValue

  I tried calling the above method using Field('access_key', 'string',
  readable=False, writable=False, default=calculateValue(email)) but not
  able to get the email.

  also I tried fetching email in method itself but since auth_user table
  is not yet defined, I was not able to access it. Any pointers how do I
  default the value ?

  calculateValue():
        #fetch email
       #some logic
       return calculatedValue

  I am creating a session usinghttp://codepad.org/tadGosTdso
  calculateValue(form) is not called  after session is created
  auth.settings.login_onaccept = calculateValue

  any help will be highly appreciated.


[web2py] Disabling few functions for certain users

2010-04-30 Thread Rohan
Hi All,

I am creating a session for a user logged in from facebook and wants
to disable certain functions like retrieve_password, change_password
etc. here is the code for this

if not auth.is_logged_in():
user_obj = Storage(user_table._filter_fields(user,
id=True))
#print 'user is not logged in'
session.auth = Storage(user=user_obj,
last_visit=request.now, expiration=auth.settings.expiration)
auth.user = user_obj
auth.settings.actions_disabled.append('retrieve_password')
auth.settings.actions_disabled.append('change_password')

but user is still able to access these functions. As an alternate, I
was thinking of creating a group for facebook users and disable these
functions at group level. Is this feasible? Is there any simpler way
without need to create user groups?

Thanks


[web2py] defaulting a value of a column in table with other columns of table

2010-04-28 Thread Rohan
Hi,

I have added a new column access_key in auth_user table, I want to
default it to with a value obtained by using email

calculateValue(email):
 #some logic
 return calculatedValue

I tried calling the above method using Field('access_key', 'string',
readable=False, writable=False, default=calculateValue(email)) but not
able to get the email.

also I tried fetching email in method itself but since auth_user table
is not yet defined, I was not able to access it. Any pointers how do I
default the value ?

calculateValue():
  #fetch email
 #some logic
 return calculatedValue

I am creating a session using http://codepad.org/tadGosTd so
calculateValue(form) is not called  after session is created
auth.settings.login_onaccept = calculateValue

any help will be highly appreciated.


[web2py] cookie.strip('') - AttributeError: 'Morsel' object has no attribute 'strip'

2010-04-26 Thread Rohan
I am trying to fetch some information from cookie

cookie = cookies.get(xyz, )
if not cookie: return None
args = dict((k, v[-1]) for k, v in
cgi.parse_qs(cookie.strip('')).items())

but on running, i am getting AttributeError: 'Morsel' object has no
attribute 'strip' error

Can someone please help me with this?

Thanks


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: getting started with fbconnect

2010-04-22 Thread Rohan
Hi Christian,

you can check  http://www.web2pyslices.com/main/slices/take_slice/77
I have not tried it yet but thought let you know about it.

Thanks


On Apr 20, 10:10 am, howesc how...@umich.edu wrote:
 Rohan,

 Someone pointed out gaema (http://code.google.com/p/gaema/) on the
 group a couple of weeks ago as a tool that integrates google, twitter,
 facebook, and others with google app engine.  i'm in the process of
 adapting it to work with web2py auth (for GAE and non GAE apps).  If
 all goes well look for an update from me in the next day or two with
 my progress.

 christian

 On Apr 19, 12:17 am, Rohan yourbuddyro...@gmail.com wrote:



  Hi All,

  I want to use fbconnect with web2py. I found couple of threads in this
  group
  1.http://groups.google.com/group/web2py/browse_frm/thread/84f27e0a06312...
  2.http://groups.google.com/group/web2py/browse_frm/thread/31e9149ad7310...

  but I am not able to find any document to get started with using
  fbconnect with web2py. I have already obtained API key from facebook.
  Can someone please share any doc for using fbconnect with web2py?

  Thanks


[web2py] Re: Customizing Retrieve password process

2010-04-20 Thread Rohan
Hi mdipierro,

After setting auth.settings.reset_password_requires_verification to
True, I got the mail with the below content

Click on the link 
http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
to reset your password

however I am not able to load the link
http://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
generated above.

Also, is there any way to customize the content of the mail? I want to
add something  above and below the default generated content.

Thanks a lot
Rohan

On Apr 19, 7:24 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Yes.

 auth.settings.reset_password_requires_verification = True

 On Apr 19, 5:10 am, Rohan yourbuddyro...@gmail.com wrote:



  Hi All,

  Currently my retrieve password application sends new password directly
  to user. Anyone can reset password of any other user as long as they
  know the email id. So I want to customize the process and want to send
  a mail to user asking user to verify email and reset password from
  some link provided in that page something like verification of email
  while registering.

  Any pointers?

  Thanks
  Rohan

  --
  Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: Customizing Retrieve password process

2010-04-20 Thread Rohan
Followup question on this,

After email is sent, user is navigated to the login page, but I want
user to head back to homepage. Can you please share the settings for
this?

Thanks
Rohan

On Apr 20, 12:19 pm, Rohan yourbuddyro...@gmail.com wrote:
 Hi mdipierro,

 After setting auth.settings.reset_password_requires_verification to
 True, I got the mail with the below content

 Click on the 
 linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
 to reset your password

 however I am not able to load the 
 linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
 generated above.

 Also, is there any way to customize the content of the mail? I want to
 add something  above and below the default generated content.

 Thanks a lot
 Rohan

 On Apr 19, 7:24 pm, mdipierro mdipie...@cs.depaul.edu wrote:



  Yes.

  auth.settings.reset_password_requires_verification = True

  On Apr 19, 5:10 am, Rohan yourbuddyro...@gmail.com wrote:

   Hi All,

   Currently my retrieve password application sends new password directly
   to user. Anyone can reset password of any other user as long as they
   know the email id. So I want to customize the process and want to send
   a mail to user asking user to verify email and reset password from
   some link provided in that page something like verification of email
   while registering.

   Any pointers?

   Thanks
   Rohan

   --
   Subscription 
   settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: Customizing Retrieve password process

2010-04-20 Thread Rohan
Hi mdipierro,

If i override the text of email by setting
auth.messages.reset_password and replace http://...reset_password/
1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb with http://domain/
application/default/user/reset_password/
1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb, it works.

Is this correct way of doing it?

Also my To field in the email received by user,  is showing =?utf-8?
q?com?= any ideas?

Thanks
Rohan


On Apr 20, 12:48 pm, Rohan yourbuddyro...@gmail.com wrote:
 Hi mdipierro,

 After setting auth.settings.reset_password_requires_verification to
 True, I got the mail with the below content

 Click on the 
 linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
 to reset your password

 however I am not able to load the 
 linkhttp://...reset_password/1271747658-828516dd-150c-43a9-bfe3-fb8f8986b6fb
 generated above.

 Thanks a lot
 Rohan

 On Apr 19, 7:24 pm, mdipierro mdipie...@cs.depaul.edu wrote:



  Yes.

  auth.settings.reset_password_requires_verification = True

  On Apr 19, 5:10 am, Rohan yourbuddyro...@gmail.com wrote:

   Hi All,

   Currently my retrieve password application sends new password directly
   to user. Anyone can reset password of any other user as long as they
   know the email id. So I want to customize the process and want to send
   a mail to user asking user to verify email and reset password from
   some link provided in that page something like verification of email
   while registering.

   Any pointers?

   Thanks
   Rohan

   --
   Subscription 
   settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] getting started with fbconnect

2010-04-19 Thread Rohan
Hi All,

I want to use fbconnect with web2py. I found couple of threads in this
group
1. 
http://groups.google.com/group/web2py/browse_frm/thread/84f27e0a06312da2/df12a6fac159242e?lnk=gstq=fbconnect#df12a6fac159242e
2. 
http://groups.google.com/group/web2py/browse_frm/thread/31e9149ad731067d/938e04f705533026?lnk=gstq=fbconnect#938e04f705533026

but I am not able to find any document to get started with using
fbconnect with web2py. I have already obtained API key from facebook.
Can someone please share any doc for using fbconnect with web2py?

Thanks


[web2py] Re: Creating a new auth session

2010-04-19 Thread Rohan
hi Jon,

Can you please share updates on integration between fbconnect and
auth.user()?

Thanks

On Feb 2, 4:34 pm, Jon Romero darks...@gmail.com wrote:
 But then how auth.user is updated?





 All auth does on successful login is:
 from gluon.storage import Storage
 session.auth=Storage()
 session.auth.user = db(db.auth_user.id==logged_in_user_id).select
 ().first()
 session.auth.user_id = session.auth.user.id
 session.auth.last_visit = request.now
 set session.auth=None on logout.

   So, how can Icreatea new session programmatically (like the login
   page does)?

   --
   Alejandro Fanjul Fdez.
   alex.fan...@gmail.comwww.mhproject.org

  --
  Alejandro Fanjul Fdez.
  alex.fan...@gmail.comwww.mhproject.org


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Customizing Retrieve password process

2010-04-19 Thread Rohan
Hi All,

Currently my retrieve password application sends new password directly
to user. Anyone can reset password of any other user as long as they
know the email id. So I want to customize the process and want to send
a mail to user asking user to verify email and reset password from
some link provided in that page something like verification of email
while registering.

Any pointers?

Thanks
Rohan


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: getting started with fbconnect

2010-04-19 Thread Rohan
I found some code on http://codepad.org/tadGosTd

I want to know if below piece of code is sufficient for creating a
record in auth.user table and creating a session for a user connected
using facebook connect?

logged_user = Users.find_by_fb_id(user['uid'])
user_id = db.users.insert(fb_id=user['uid'], name=user['name'],
age=user['age']) if not len(logged_user) else logged_user[0].id

if not auth.is_logged_in():
user_obj = 
Storage(the_data._filter_fields(Users.find_by_id(user_id)
[0], id=True))
session.auth = Storage(user=user_obj, last_visit=request.now,
expiration=2600)
auth.user = user_obj


On Apr 20, 10:10 am, howesc how...@umich.edu wrote:
 Rohan,

 Someone pointed out gaema (http://code.google.com/p/gaema/) on the
 group a couple of weeks ago as a tool that integrates google, twitter,
 facebook, and others with google app engine.  i'm in the process of
 adapting it to work with web2py auth (for GAE and non GAE apps).  If
 all goes well look for an update from me in the next day or two with
 my progress.

 christian

 On Apr 19, 12:17 am, Rohan yourbuddyro...@gmail.com wrote:



  Hi All,

  I want to use fbconnect with web2py. I found couple of threads in this
  group
  1.http://groups.google.com/group/web2py/browse_frm/thread/84f27e0a06312...
  2.http://groups.google.com/group/web2py/browse_frm/thread/31e9149ad7310...

  but I am not able to find any document to get started with using
  fbconnect with web2py. I have already obtained API key from facebook.
  Can someone please share any doc for using fbconnect with web2py?

  Thanks


[web2py] Re: Customizing default form

2010-04-14 Thread Rohan
Thanks  mdipierro,

I have followup queries,

I want to set default values for email and password field to Email
and Password respectively and clear these default values onFocus. I
can add default values and onfocus code using jQuery code but is there
anyway I can set defaultValue in the form itself like
{{=form.custom.widget.email.'defaultValue''== Email}}

Thanks

On Apr 14, 10:23 am, mdipierro mdipie...@cs.depaul.edu wrote:
 yes. in default/users.html

 replace

 {{=form}}

 with

 {{if request.args(0)=='login'}}
 {{=form.custom.begin}}
 tabletr
 td{{=form.custom.widget.email}}/td
 td{{=form.custom.widget.password}}/td
 td{{=form.custom.submit}}/td
 /tr/table
 {{=form.custom.end}}
 {{else:}}{{=form}}{{pass}}

 On Apr 14, 12:19 am, Rohan yourbuddyro...@gmail.com wrote:



  Hi All,

  I want to change the look and feel of default login form. I want it to
  display email and password fields in single row rather than 2
  different rows. Any way to customize the default form?

  Any pointers?

  Thanks


-- 
To unsubscribe, reply using remove me as the subject.


[web2py] Re: How to by-pass user/login page for authentication

2010-04-13 Thread Rohan
anyway to customize login form?

from page source i see form with table inside but no ids.

I have vague idea about it can be done using form.widget or
form.custom or something like this

Thanks

On Apr 9, 7:52 pm, Thadeus Burgess thade...@thadeusb.com wrote:
 From any controller.

 return dict(auth_form=auth())

 Then you can just

 {{=auth_form}} in your controllers view.

 -Thadeus



 On Fri, Apr 9, 2010 at 7:19 AM, Rohan yourbuddyro...@gmail.com wrote:
  Thanks Yarko,

  I don't want to use auth.requires_login() to index function as it will
  lead the user to login page.

  another is to point auth() to get
  login form / action from your more involved controller function, which
  also has your home page (and login form, of course).

  Can you please elaborate on this one? How can I point auth() to get
  info from my custom login form on my home page?

  Thanks

  On Apr 9, 5:11 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
  wrote:
  On Apr 9, 5:46 am, Rohan yourbuddyro...@gmail.com wrote:

   Hi All,

     I am a newbie with web2py. Basically I want to by-pass the user's
   visit to user/login page. My home page will have the login fields like
   twitter and I am planning to collect username/email and password from
   login screen and pass it to web2py's default authentication service
   for verification. On correct login, user should be navigated to index
   page like normal. Any pointers?

  One way to think of what you asked to do is this:

  - an index page that requires login
  - another page with a place to login, if not logged in

  A simple way to do this is to add the auth.requires_login()
  decorator to your index controller function, which will force a login
  call.  There are several ways you can manage how this looks:  one is
  by customizing the user.html page in views/default to be what you are
  referring to as your Home Page;  another is to point auth() to get
  login form / action from your more involved controller function, which
  also has your home page (and login form, of course).

  See more athttp://www.web2py.com/book/default/section/8/1?search=login

  Regards,
  - Yarko

   Also Is there anyway to customize the look and feel of default login
   screen generated by web2py?

   Thanks

  --
  To unsubscribe, reply using remove me as the subject.


[web2py] Customizing default form

2010-04-13 Thread Rohan
Hi All,

I want to change the look and feel of default login form. I want it to
display email and password fields in single row rather than 2
different rows. Any way to customize the default form?

Any pointers?

Thanks


-- 
To unsubscribe, reply using remove me as the subject.


[web2py] Re: How to by-pass user/login page for authentication

2010-04-09 Thread Rohan
Thanks Yarko,

I don't want to use auth.requires_login() to index function as it will
lead the user to login page.

 another is to point auth() to get
 login form / action from your more involved controller function, which
 also has your home page (and login form, of course).

Can you please elaborate on this one? How can I point auth() to get
info from my custom login form on my home page?

Thanks


On Apr 9, 5:11 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
wrote:
 On Apr 9, 5:46 am, Rohan yourbuddyro...@gmail.com wrote:

  Hi All,

    I am a newbie with web2py. Basically I want to by-pass the user's
  visit to user/login page. My home page will have the login fields like
  twitter and I am planning to collect username/email and password from
  login screen and pass it to web2py's default authentication service
  for verification. On correct login, user should be navigated to index
  page like normal. Any pointers?

 One way to think of what you asked to do is this:

 - an index page that requires login
 - another page with a place to login, if not logged in

 A simple way to do this is to add the auth.requires_login()
 decorator to your index controller function, which will force a login
 call.  There are several ways you can manage how this looks:  one is
 by customizing the user.html page in views/default to be what you are
 referring to as your Home Page;  another is to point auth() to get
 login form / action from your more involved controller function, which
 also has your home page (and login form, of course).

 See more athttp://www.web2py.com/book/default/section/8/1?search=login

 Regards,
 - Yarko





  Also Is there anyway to customize the look and feel of default login
  screen generated by web2py?

  Thanks


-- 
To unsubscribe, reply using remove me as the subject.