diff --git a/intranet/Root.py b/intranet/Root.py
index b5682eb2..4b4a4262 100755
--- a/intranet/Root.py
+++ b/intranet/Root.py
@@ -10,7 +10,8 @@ sys.path.append('/usr/scripts/gestion/')
# ######################################################## #
def serverSidePath(self, path):
- # les template se trouve dans le dossier template
+ if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
+ if os.path.isfile(os.getcwd()+'/templates/'+path+".dev"):
return os.getcwd()+'/templates/'+path+".dev"
# les template se trouve dans le dossier template
return os.getcwd()+'/templates/'+path
# on surcharge cette fonction dans la classe Template
@@ -154,8 +155,11 @@ class Intranet:
# liste des modules disponibles
self.monCompte = monCompte.monCompte()
- self.impression = impression.root()
- self.sous = factures.root()
+ self.sous = factures.root()
+
+ # liste des modules en developpement
+ if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
+ self.impression = impression.root()
_cpFilterList = [templatesEngine(), DOMFilter(), verifDroits()]
@@ -232,9 +236,9 @@ def verifLogin(login = '', password = ''):
#
# mise en place de cherrypy + conf
#
-cherrypy.config.update(file="/home/gdetrez/intranet/dev.cfg")
-#cherrypy.config.update(file="/home/gdetrez/intranet/prod.cfg")
-cherrypy.config.update(file="/home/gdetrez/intranet/intranet.cfg")
+#cherrypy.config.update(file="/usr/scripts/intranet/dev.cfg")
+cherrypy.config.update(file="/usr/scripts/intranet/prod.cfg")
+cherrypy.config.update(file="/usr/scripts/intranet/intranet.cfg")
settings={'/': {
'sessionAuthenticateFilter.checkLoginAndPassword': verifLogin,
'sessionAuthenticateFilter.loginScreen': login
diff --git a/intranet/dev.cfg b/intranet/dev.cfg
index 7f0cbbfc..35c33f75 100644
--- a/intranet/dev.cfg
+++ b/intranet/dev.cfg
@@ -1,6 +1,6 @@
# The configuration file called myconfigfile.conf
[global]
-server.socketPort=8080
+server.socketPort=8083
server.socketHost=""
server.socketFile=""
server.socketQueueSize=5
diff --git a/intranet/monCompte.py b/intranet/monCompte.py
index 1055897e..86b195dd 100755
--- a/intranet/monCompte.py
+++ b/intranet/monCompte.py
@@ -103,15 +103,15 @@ class monCompte:
############## info mail ##############
mailInfos = {}
- #try:
- mailConfig = MailConfig(cherrypy.session['uid'])
- mailInfos['forwarding_address'] = mailConfig['forward']
- mailInfos['spam'] = {}
- mailInfos['spam']['no'] = mailConfig['spam'] == 'accepte'
- mailInfos['spam']['mark'] = mailConfig['spam'] == 'marque'
- mailInfos['spam']['drop'] = mailConfig['spam'] == 'supprime'
- #except Exception, e:
- # t['mailError'] = u"Erreur:fichiers de configuration mail incompréhensibles"
+ try:
+ mailConfig = MailConfig(cherrypy.session['uid'])
+ mailInfos['forwarding_address'] = mailConfig['forward']
+ mailInfos['spam'] = {}
+ mailInfos['spam']['no'] = mailConfig['spam'] == 'accepte'
+ mailInfos['spam']['mark'] = mailConfig['spam'] == 'marque'
+ mailInfos['spam']['drop'] = mailConfig['spam'] == 'supprime'
+ except Exception, e:
+ t['mailError'] = u"Erreur:fichiers de configuration mail incompréhensibles"
mailInfos['alias'] = adh.alias()
mailInfos['contourneGreylist'] = adh.contourneGreylist()
@@ -380,6 +380,8 @@ class monCompte:
##########################
def creerMachine(self, nomNouvelleMachine, MACNouvelleMachine, estMachineWifi='0'):
adh = self.__ldap.search('uid=' + cherrypy.session['uid'])['adherent'][0]
+ if adh.droits() == [] and adh.machines_fixes() != []:
+ return {'error':'Vous avez deja une machine fixe. Vous ne pouvez ajouter que des machines WiFi.'}
try:
if estMachineWifi=='true':
m = MachineWifi(adh)
diff --git a/intranet/templates/accueil.tmpl b/intranet/templates/accueil.tmpl
index b37e9a76..ca48c3c6 100644
--- a/intranet/templates/accueil.tmpl
+++ b/intranet/templates/accueil.tmpl
@@ -6,10 +6,6 @@
Mon Compte
-