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 @@ icon Mon Compte -
  • - icon - Impression -
  • icon Mes Factures diff --git a/intranet/templates/factures-historique.tmpl b/intranet/templates/factures-historique.tmpl index cb7458f1..5e4cb1d5 100644 --- a/intranet/templates/factures-historique.tmpl +++ b/intranet/templates/factures-historique.tmpl @@ -31,7 +31,7 @@ - \ No newline at end of file + diff --git a/intranet/templates/factures.tmpl b/intranet/templates/factures.tmpl index 66fbbc16..2a814add 100644 --- a/intranet/templates/factures.tmpl +++ b/intranet/templates/factures.tmpl @@ -30,7 +30,7 @@ function hideDetail(id){
    -

    Mes factures

    +

    Mes factures PayPal

    #for f in $listeFactures #if $f.payee @@ -88,13 +88,13 @@ function hideDetail(id){ #if $listeFactures == []
    - VIDE + AUCUNE TRANSACTION PAYPAL ENREGISTRÉE
    #end if
    diff --git a/intranet/templates/login.tmpl b/intranet/templates/login.tmpl index df5f7d96..4777aa1e 100644 --- a/intranet/templates/login.tmpl +++ b/intranet/templates/login.tmpl @@ -10,7 +10,7 @@ padding:20px; background:#eee; border:3px solid #ddd; - margin:30px; + margin:auto auto; } .liens { text-align:right; diff --git a/intranet/templates/main.tmpl b/intranet/templates/main.tmpl index 4b8268f8..379fcd8f 100644 --- a/intranet/templates/main.tmpl +++ b/intranet/templates/main.tmpl @@ -30,13 +30,17 @@ $page
    - -
    -

    Site du cr@ns wiki
    Contact Cr@ns
    +

    Site du cr@ns wiki
    Contact Cr@ns
    +
    + L'intranet est en version beta, aidez-nous à l'améliorer en nous envoyant vos remarques et en nous signalant tout problème à nounous@crans.org +
    +
    #if $environment == 'development'