From 04d960840aa0618b1cdd5d8ba216c27956465306 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 27 Mar 2012 13:57:09 -0500 Subject: [PATCH] moved configuration of multi user mode to 0.py --- VERSION | 2 +- applications/admin/models/0.py | 5 ++++- applications/admin/models/db.py | 12 ++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 2947416f..eca059ee 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-27 13:43:03) dev +Version 1.99.7 (2012-03-27 13:56:36) dev diff --git a/applications/admin/models/0.py b/applications/admin/models/0.py index ab900b66..160118cf 100644 --- a/applications/admin/models/0.py +++ b/applications/admin/models/0.py @@ -56,7 +56,10 @@ import os GAE_APPCFG = os.path.abspath(os.path.join('/usr/local/bin/appcfg.py')) # To use web2py as a teaching tool, set MULTI_USER_MODE to True -MULTI_USER_MODE = True +MULTI_USER_MODE = False +EMAIL_SERVER = 'localhost' +EMAIL_SENDER = 'professor@example.com' +EMAIL_LOGIN = None # configurable twitterbox, set to None/False to suppress TWITTER_HASH = "web2py" diff --git a/applications/admin/models/db.py b/applications/admin/models/db.py index 28bf0134..0d1f7ab3 100644 --- a/applications/admin/models/db.py +++ b/applications/admin/models/db.py @@ -4,24 +4,20 @@ if MULTI_USER_MODE: db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB from gluon.tools import * - mail = Mail() # mailer auth = Auth(globals(),db) # authentication/authorization crud = Crud(globals(),db) # for CRUD helpers using auth service = Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc plugins = PluginManager() - mail.settings.server = 'logging' or 'smtp.gmail.com:587' # your SMTP server - mail.settings.sender = 'you@gmail.com' # your email - mail.settings.login = 'username:password' # your credentials or None + mail = auth.settings.mailer + mail.settings.server = EMAIL_SERVER + mail.settings.sender = EMAIL_SENDER + mail.settings.login = EMAIL_LOGIN - auth.settings.hmac_key = '' # before define_tables() auth.define_tables() # creates all needed tables - auth.settings.mailer = mail # for user email verification auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = True - auth.messages.verify_email = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['verify_email'])+'/%(key)s to verify your email' auth.settings.reset_password_requires_verification = True - auth.messages.reset_password = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['reset_password'])+'/%(key)s to reset your password' db.define_table('app',Field('name'),Field('owner',db.auth_user))