Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
zourit-admin
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zourit
zourit-admin
Commits
a7487103
Commit
a7487103
authored
Oct 01, 2019
by
Jean-Noël Rouchon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Déplacement des modules dans le dossier /lib
parent
c1b6565d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
34 deletions
+34
-34
app/controllers/mails_controller.rb
app/controllers/mails_controller.rb
+2
-2
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+2
-1
config/application.rb
config/application.rb
+1
-1
config/initializers/modules.rb
config/initializers/modules.rb
+8
-8
lib/modules/core/garradin/config.yml
lib/modules/core/garradin/config.yml
+0
-0
lib/modules/core/garradin/helper.rb
lib/modules/core/garradin/helper.rb
+0
-0
lib/modules/core/nextcloud/config.yml
lib/modules/core/nextcloud/config.yml
+0
-0
lib/modules/core/nextcloud/helper.rb
lib/modules/core/nextcloud/helper.rb
+0
-0
lib/modules/core/zimbra/config.yml
lib/modules/core/zimbra/config.yml
+0
-0
lib/modules/core/zimbra/helper.rb
lib/modules/core/zimbra/helper.rb
+20
-21
lib/modules/others/.keep
lib/modules/others/.keep
+0
-0
lib/tasks/modules.rake
lib/tasks/modules.rake
+1
-1
No files found.
app/controllers/mails_controller.rb
View file @
a7487103
class
MailsController
<
ApplicationController
include
Core
::
Zimbra
::
Helper
include
OpenSSL
before_action
:only_logged_users
...
...
@@ -8,9 +7,10 @@ class MailsController < ApplicationController
def
index
configmodule
=
ConfigModule
.
where
(
name:
"Zimbra"
).
first
if
configmodule
domain
=
Domain
.
find
(
current_user
.
domain_id
)
domaininfo
=
DomainInfo
.
where
(
config_module_id:
configmodule
.
id
,
domain_id:
current_user
.
domain_id
).
first
if
domaininfo
&&
domaininfo
.
instance_id
@url_embedded
=
get_login_url
@url_embedded
=
Core
::
Zimbra
::
Helper
.
get_login_url
(
domain
,
current_user
)
else
redirect_to
"/services"
,
notice:
"Le module Zimbra n'est pas disponible pour votre domaine"
end
...
...
app/controllers/users_controller.rb
View file @
a7487103
...
...
@@ -141,7 +141,8 @@ class UsersController < ApplicationController
# GET /logout
def
logout
@urls
=
[
get_logout_url
,
Core
::
Garradin
::
Helper
.
get_logout_url
(
current_user
)]
domain
=
Domain
.
find
(
current_user
.
domain_id
)
@urls
=
[
Core
::
Zimbra
::
Helper
.
get_logout_url
(
domain
),
Core
::
Garradin
::
Helper
.
get_logout_url
(
current_user
)]
session
[
:user
]
=
nil
end
...
...
config/application.rb
View file @
a7487103
...
...
@@ -25,7 +25,7 @@ module ZouritAdmin
# Do not swallow errors in after_commit/after_rollback callbacks.
config
.
active_record
.
raise_in_transactional_callbacks
=
true
config
.
autoload_paths
<<
Rails
.
root
.
join
(
'modules'
)
config
.
autoload_paths
<<
Rails
.
root
.
join
(
'
lib'
).
join
(
'
modules'
)
# application's version
VERSION
=
'0.5.0 beta2'
...
...
config/initializers/modules.rb
View file @
a7487103
# Chargement de tous les modules Core
Dir
.
foreach
(
Rails
.
root
.
join
(
"modules/core"
))
do
|
folder
|
file
=
File
.
join
(
Rails
.
root
.
join
(
"modules/core"
,
folder
),
"helper.rb"
)
require
file
if
File
.
exist?
(
file
)
end
#
Dir.foreach(Rails.root.join("modules/core")) do |folder|
#
file = File.join(Rails.root.join("modules/core", folder), "helper.rb")
#
require file if File.exist?(file)
#
end
# Chargement de tous les modules Others
Dir
.
foreach
(
Rails
.
root
.
join
(
"modules/others"
))
do
|
folder
|
file
=
File
.
join
(
Rails
.
root
.
join
(
"modules/others"
,
folder
),
"helper.rb"
)
require
file
if
File
.
exist?
(
file
)
end
\ No newline at end of file
#Dir.foreach(Rails.root.join("modules/others")) do |folder|
# file = File.join(Rails.root.join("modules/others", folder), "helper.rb")
# require file if File.exist?(file)
#end
\ No newline at end of file
modules/core/garradin/config.yml
→
lib/
modules/core/garradin/config.yml
View file @
a7487103
File moved
modules/core/garradin/helper.rb
→
lib/
modules/core/garradin/helper.rb
View file @
a7487103
File moved
modules/core/nextcloud/config.yml
→
lib/
modules/core/nextcloud/config.yml
View file @
a7487103
File moved
modules/core/nextcloud/helper.rb
→
lib/
modules/core/nextcloud/helper.rb
View file @
a7487103
File moved
modules/core/zimbra/config.yml
→
lib/
modules/core/zimbra/config.yml
View file @
a7487103
File moved
modules/core/zimbra/helper.rb
→
lib/
modules/core/zimbra/helper.rb
View file @
a7487103
...
...
@@ -26,7 +26,8 @@ module Core::Zimbra::Helper
zimbra_cd
domain
.
name
puts
"Création de la liste de diffusion tous@
#{
domain
.
name
}
"
zimbra_cdl_tous
domain
.
name
#puts "Préparation de la clé d'authentification de #{domain.name}"
puts
"Préparation de la clé d'authentification de
#{
domain
.
name
}
"
puts
get_preauthkey
domain
#set_preauthkey domain
end
...
...
@@ -135,12 +136,16 @@ module Core::Zimbra::Helper
return
zimbra_ssh
requete
end
def
self
.
s
et_preauthkey
domain
def
self
.
g
et_preauthkey
domain
requete
=
"zmprov generateDomainPreAuthKey
#{
domain
.
name
}
"
result
,
message
,
output
=
zimbra_ssh
requete
preauthkey
=
output
.
to_s
.
gsub
(
"preAuthKey: "
,
""
)
return
preauthkey
end
def
self
.
set_preauthkey
domain
domainInfo
=
get_domaininfo
domain
domainInfo
.
datas
=
{
authkey:
preauthkey
}
domainInfo
.
datas
=
{
authkey:
get_preauthkey
(
domain
)
}
return
domainInfo
.
save
end
...
...
@@ -222,19 +227,19 @@ module Core::Zimbra::Helper
# FIN ALIAS ==========================
# url de logout
def
self
.
get_logout_url
url
=
get_module_url
def
self
.
get_logout_url
domain
url
=
get_module_url
domain
url
+=
"/?loginOp=logout"
if
url
return
url
end
# url de pré-authentification
def
self
.
get_login_url
domain
=
nil
url
=
get_module_url
key
=
get_authkey
def
self
.
get_login_url
domain
,
user
url
=
get_module_url
domain
key
=
get_authkey
domain
if
key
time
=
(
Time
.
now
.
to_f
*
1000
).
to_i
account
=
current_
user
.
email
account
=
user
.
email
preauth
=
compute_preauth
(
account
,
time
,
key
)
url
+=
"/service/preauth?account=
#{
account
}
&expires=0×tamp=
#{
time
}
&preauth=
#{
preauth
}
"
end
...
...
@@ -251,8 +256,8 @@ module Core::Zimbra::Helper
return
hmacd
.
to_s
end
def
self
.
get_authkey
domainDatas
=
get_domain_datas
def
self
.
get_authkey
domain
domainDatas
=
get_domain_datas
domain
return
domainDatas
?
domainDatas
[:
authkey
]
:
nil
end
...
...
@@ -263,24 +268,18 @@ module Core::Zimbra::Helper
return
module_id
end
def
self
.
get_module_url
domainInfo
=
get_domaininfo
def
self
.
get_module_url
domain
domainInfo
=
get_domaininfo
domain
instanceDatas
=
eval
(
domainInfo
.
instance
.
datas
)
return
instanceDatas
?
instanceDatas
[:
url
]
:
nil
end
def
self
.
get_domain_datas
domainInfo
=
get_domaininfo
def
self
.
get_domain_datas
domain
domainInfo
=
get_domaininfo
domain
data
=
domainInfo
?
eval
(
domainInfo
.
data
)
:
nil
return
data
end
def
self
.
get_domaininfo
puts
"get_domaininfo"
domain_id
=
current_user
.
domain_id
domainInfo
=
DomainInfo
.
where
(
domain_id:
domain_id
,
config_module_id:
get_module_id
).
first
end
def
self
.
get_domaininfo
domain
puts
"get_domaininfo"
domain_id
=
domain
.
id
...
...
modules/others/.keep
→
lib/
modules/others/.keep
View file @
a7487103
File moved
lib/tasks/modules.rake
View file @
a7487103
...
...
@@ -2,7 +2,7 @@ namespace :modules do
desc
"TODO"
task
populate: :environment
do
directories
=
[
"
modules/core"
,
"
modules/others"
]
directories
=
[
"
lib/modules/core"
,
"lib/
modules/others"
]
directories
.
each
do
|
dir
|
puts
"
#{
dir
}
integration"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment