Commit 87f02a9a authored by Jean-Noël Rouchon's avatar Jean-Noël Rouchon

Ajout du module sympa

parent c1d420d4
This diff is collapsed.
......@@ -44,7 +44,7 @@ class ApplicationController < ActionController::Base
end
def set_modules
@modules = ConfigModule.all.order(:order, :id)
@modules = ConfigModule.all.order(:order)
end
def set_theme
......
......@@ -4,13 +4,6 @@ class CloudController < ApplicationController
# GET /cloud
def index
configmodule = ConfigModule.where(name: "Owncloud").first
if configmodule and configmodule.url
@url_embedded = get_login_url
else
redirect_to "/services", notice: "Le module owncloud n'est pas actif"
end
configmodule = ConfigModule.where(name: "Owncloud").first
if configmodule
domaininfo = DomainInfo.where(config_module_id: configmodule.id, domain_id: current_user.domain_id).first
......
class SympaController < ApplicationController
before_action :only_logged_users
# GET /sympa
def index
configmodule = ConfigModule.where(name: "Sympa").first
if configmodule
domaininfo = DomainInfo.where(config_module_id: configmodule.id, domain_id: current_user.domain_id).first
if domaininfo && domaininfo.instance_id
@url_embedded = Core::Sympa::Helper.get_login_url current_user
else
redirect_to "/services", notice: "Le module Sympa n'est pas disponible pour votre domaine"
end
else
redirect_to "/services", notice: "Le module Sympa n'est pas actif"
end
end
end
<div class="zourit-iframe">
<iframe src="<%=@url_embedded%>" width=100% frameborder="0" scrolling="yes"></iframe>
</div>
\ No newline at end of file
......@@ -63,6 +63,7 @@ Rails.application.routes.draw do
get 'compta' => "compta#index"
get 'cloud' => "cloud#index"
get 'mails' => "mails#index"
get 'sympa' => "sympa#index"
get 'services' => 'accueil#index'
......
name: "sympa"
program: "Sympa"
title: "Mes listes de diffusion"
resume: "Grâce au service Sympa je peux créer des listes de diffusions"
font: "fa-send"
instance_datas:
url: "Full URL with http(s)://"
domain_datas:
user_datas:
\ No newline at end of file
# Copyright (c) 2019 Jean-Noël Rouchon <jnoel@mithril.re>
#
# This file is part of Zourit.
#
# Zourit is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Zourit is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Zourit. If not, see <http://www.gnu.org/licenses/>.
module Core::Sympa::Helper
# url de sympa
def self.get_login_url user
return "http://listes.#{user.domain}"
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment