[cpif] r285 - in trunk: backend frontend-web

svn at argo.es svn at argo.es
Thu Jul 19 11:10:39 CEST 2007


Author: jcea
Date: Thu Jul 19 11:10:37 2007
New Revision: 285

Log:
Cuando lanzamos CPIF, se envia un correo electronico
al administrador que se haya configurado.



Modified:
   trunk/backend/database.py
   trunk/backend/upgrade.py
   trunk/frontend-web/init.py
   trunk/frontend-web/url_edit_config.py

Modified: trunk/backend/database.py
==============================================================================
--- trunk/backend/database.py	(original)
+++ trunk/backend/database.py	Thu Jul 19 11:10:37 2007
@@ -1,7 +1,7 @@
 # $Id$
 
 
-VERSION_DB="2007071602"
+VERSION_DB="2007071901"
 
 import globales
 
@@ -81,6 +81,8 @@
     conf["smtp_auth_passwd"]=""
     conf["smtp_use_tls"]=False
     conf["smtp_email_sender"]=""
+    conf["admin_email_address"]=""
+    root["config"]=conf
 
   @monitor
   def load_initial_config(conn) :

Modified: trunk/backend/upgrade.py
==============================================================================
--- trunk/backend/upgrade.py	(original)
+++ trunk/backend/upgrade.py	Thu Jul 19 11:10:37 2007
@@ -241,6 +241,10 @@
         del usuario["new email"]
     conn.commit()
 
-
+  if root["version del foro"]=="2007071602" :
+    print "Actualizando la base de datos: 2007071602 -> 2007071901"
+    root["version del foro"]="2007071901"
+    root["config"]["admin_email_address"]=""
+    conn.commit()
 
 

Modified: trunk/frontend-web/init.py
==============================================================================
--- trunk/frontend-web/init.py	(original)
+++ trunk/frontend-web/init.py	Thu Jul 19 11:10:37 2007
@@ -96,9 +96,9 @@
         database.mensaje_add(conn,"Cuerpo del hilo %d" %i,r.sample(usuarios,1)[0],titulo="Hilo %d" %i,metatag=0)
       time.time=t
 
-    if globales.smtp_server=="mail2.argo.es" :
+    if globales.admin_email_address :
       import smtp
-      smtp.enqueue(conn,["jcea at argo.es"],"Subject: Arranque CPIF\r\n\r\nArrancamos CPIF")
+      smtp.enqueue(conn,[globales.admin_email_address],"Subject: Arranque CPIF\r\n\r\nArrancamos CPIF")
 
   inicializa(masterkey=sys.argv[1])
 

Modified: trunk/frontend-web/url_edit_config.py
==============================================================================
--- trunk/frontend-web/url_edit_config.py	(original)
+++ trunk/frontend-web/url_edit_config.py	Thu Jul 19 11:10:37 2007
@@ -30,6 +30,7 @@
   texto.append('<tr><td>Use TLS for SMTP</td><td><input type="checkbox" name="smtp_use_tls" %s /></td></tr>' % ("CHECKED" if globales.smtp_use_tls else ""))
   texto.append('<tr><td>Outgoing SMTP user<br/>(if server requires authentication)</td><td><input type="text" name="smtp_auth_user" size="25" value="%s" /></td><tr>' %globales.smtp_auth_user)
   texto.append('<tr><td>Outgoing SMTP password<br/>(if server requires authentication)</td><td><input type="password" name="smtp_auth_passwd" size="20" value="%s" /></td><tr>' %globales.smtp_auth_passwd)
+  texto.append('<tr><td>CPIF Admin email address</td><td><input type="text" name="admin_email_address" size="30" value="%s" /></td><tr>' %globales.admin_email_address)
 
   return (200, {"Content-Type":"text/html; charset=utf-8"},
 """



More information about the cpif mailing list