parlement 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +709 -0
- data/COPYING +223 -0
- data/README +20 -0
- data/Rakefile +136 -0
- data/app/controllers/account_controller.rb +181 -0
- data/app/controllers/application.rb +30 -0
- data/app/controllers/elt_controller.rb +83 -0
- data/app/helpers/account_helper.rb +2 -0
- data/app/helpers/application_helper.rb +4 -0
- data/app/helpers/elt_helper.rb +37 -0
- data/app/helpers/live_tree.rb +238 -0
- data/app/helpers/mailman.rb +96 -0
- data/app/models/attachment.rb +4 -0
- data/app/models/elt.rb +17 -0
- data/app/models/mail.rb +4 -0
- data/app/models/notifier.rb +13 -0
- data/app/models/person.rb +9 -0
- data/app/models/user.rb +7 -0
- data/app/models/user_notify.rb +75 -0
- data/app/views/account/_help.rhtml +23 -0
- data/app/views/account/_login.rhtml +57 -0
- data/app/views/account/_show.rhtml +31 -0
- data/app/views/account/logout.rhtml +10 -0
- data/app/views/account/signup.rhtml +17 -0
- data/app/views/account/welcome.rhtml +13 -0
- data/app/views/elt/_elt.rhtml +105 -0
- data/app/views/elt/_form.rhtml +31 -0
- data/app/views/elt/_list.rhtml +28 -0
- data/app/views/elt/new.rhtml +102 -0
- data/app/views/elt/rss.rxml +31 -0
- data/app/views/elt/show.rhtml +46 -0
- data/app/views/elt/show_tree.rhtml +8 -0
- data/app/views/layouts/scaffold.rhtml +13 -0
- data/app/views/layouts/top.rhtml +45 -0
- data/app/views/notifier/changeEmail.rhtml +10 -0
- data/config/boot.rb +17 -0
- data/config/database.yml +82 -0
- data/config/environment.rb +92 -0
- data/config/environments/development.rb +17 -0
- data/config/environments/production.rb +17 -0
- data/config/environments/test.rb +17 -0
- data/config/environments/user_environment.rb +1 -0
- data/config/routes.rb +28 -0
- data/db/ROOT/CV.txt +166 -0
- data/db/ROOT/IP.txt +3 -0
- data/db/ROOT/parleR.txt +3 -0
- data/db/ROOT/parlement/security.txt +34 -0
- data/db/ROOT/parlement/test.txt +4 -0
- data/db/ROOT/parlement.txt +51 -0
- data/db/ROOT/perso.txt +215 -0
- data/db/schema.sql +127 -0
- data/lib/data_import.rb +54 -0
- data/lib/file_column.rb +263 -0
- data/lib/file_column_helper.rb +45 -0
- data/lib/localization.rb +88 -0
- data/lib/localizer.rb +88 -0
- data/lib/login_system.rb +87 -0
- data/lib/rails_file_column.rb +19 -0
- data/lib/user_system.rb +101 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/engine_files/README +5 -0
- data/public/engine_files/login_engine/stylesheets/login_engine.css +81 -0
- data/public/favicon.ico +0 -0
- data/public/favicon.png +0 -0
- data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
- data/public/images/live_tree_branch_expanded_icon.gif +0 -0
- data/public/images/live_tree_leaf_icon.gif +0 -0
- data/public/images/live_tree_loading_spinner.gif +0 -0
- data/public/images/webfeed.gif +0 -0
- data/public/javascripts/controls.js +721 -0
- data/public/javascripts/dragdrop.js +519 -0
- data/public/javascripts/effects.js +992 -0
- data/public/javascripts/live_tree.js +749 -0
- data/public/javascripts/prototype.js +1726 -0
- data/public/javascripts/scriptaculous.js +47 -0
- data/public/javascripts/slider.js +258 -0
- data/public/oldREADME +190 -0
- data/public/oldindex.html +78 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/default.css +238 -0
- data/public/stylesheets/live_tree.css +62 -0
- data/public/stylesheets/scaffold.css +74 -0
- data/script/about +3 -0
- data/script/benchmarker +19 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/create_db +7 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/process/spinner +3 -0
- data/script/profiler +34 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/attachments.yml +10 -0
- data/test/fixtures/elts.yml +15 -0
- data/test/fixtures/mails.yml +7 -0
- data/test/fixtures/people.yml +49 -0
- data/test/fixtures/users.yml +41 -0
- data/test/functional/account_controller_test.rb +239 -0
- data/test/functional/elt_controller_test.rb +18 -0
- data/test/mocks/test/time.rb +17 -0
- data/test/mocks/test/user_notify.rb +16 -0
- data/test/test_helper.rb +28 -0
- data/test/unit/attachment_test.rb +14 -0
- data/test/unit/elt_test.rb +14 -0
- data/test/unit/mail_test.rb +14 -0
- data/test/unit/notifier_test.rb +31 -0
- data/test/unit/person_test.rb +24 -0
- data/test/unit/user_test.rb +94 -0
- data/vendor/plugins/engines/CHANGELOG +7 -0
- data/vendor/plugins/engines/README +128 -0
- data/vendor/plugins/engines/init.rb +33 -0
- data/vendor/plugins/engines/lib/action_mailer_extensions.rb +160 -0
- data/vendor/plugins/engines/lib/action_view_extensions.rb +130 -0
- data/vendor/plugins/engines/lib/dependencies_extensions.rb +56 -0
- data/vendor/plugins/engines/lib/engines.rb +292 -0
- data/vendor/plugins/engines/lib/ruby_extensions.rb +127 -0
- data/vendor/plugins/engines/lib/testing_extensions.rb +33 -0
- data/vendor/plugins/engines/test/ruby_extensions_test.rb +94 -0
- data/vendor/plugins/login_engine/README +258 -0
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +248 -0
- data/vendor/plugins/login_engine/app/helpers/user_helper.rb +88 -0
- data/vendor/plugins/login_engine/app/models/user.rb +7 -0
- data/vendor/plugins/login_engine/app/models/user_notify.rb +75 -0
- data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +11 -0
- data/vendor/plugins/login_engine/app/views/user/_password.rhtml +9 -0
- data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user/edit.rhtml +23 -0
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +18 -0
- data/vendor/plugins/login_engine/app/views/user/home.rhtml +7 -0
- data/vendor/plugins/login_engine/app/views/user/login.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user/logout.rhtml +8 -0
- data/vendor/plugins/login_engine/app/views/user/signup.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user_notify/change_password.rhtml +10 -0
- data/vendor/plugins/login_engine/app/views/user_notify/delete.rhtml +5 -0
- data/vendor/plugins/login_engine/app/views/user_notify/forgot_password.rhtml +11 -0
- data/vendor/plugins/login_engine/app/views/user_notify/pending_delete.rhtml +9 -0
- data/vendor/plugins/login_engine/app/views/user_notify/signup.rhtml +12 -0
- data/vendor/plugins/login_engine/db/schema.rb +25 -0
- data/vendor/plugins/login_engine/init_engine.rb +10 -0
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +107 -0
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +149 -0
- data/vendor/plugins/login_engine/lib/login_engine.rb +58 -0
- data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +81 -0
- data/vendor/plugins/login_engine/tasks/tasks.rake +4 -0
- data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +41 -0
- data/vendor/plugins/login_engine/test/fixtures/users.yml +41 -0
- data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +533 -0
- data/vendor/plugins/login_engine/test/mocks/mail.rb +14 -0
- data/vendor/plugins/login_engine/test/mocks/time.rb +19 -0
- data/vendor/plugins/login_engine/test/test_helper.rb +15 -0
- data/vendor/plugins/login_engine/test/unit/user_test.rb +94 -0
- metadata +276 -0
data/lib/user_system.rb
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
module UserSystem
|
|
2
|
+
|
|
3
|
+
protected
|
|
4
|
+
|
|
5
|
+
# overwrite this if you want to restrict access to only a few actions
|
|
6
|
+
# or if you want to check if the user has the correct rights
|
|
7
|
+
# example:
|
|
8
|
+
#
|
|
9
|
+
# # only allow nonbobs
|
|
10
|
+
# def authorize?(user)
|
|
11
|
+
# user.login != "bob"
|
|
12
|
+
# end
|
|
13
|
+
def authorize?(user)
|
|
14
|
+
true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# overwrite this method if you only want to protect certain actions of the controller
|
|
18
|
+
# example:
|
|
19
|
+
#
|
|
20
|
+
# # don't protect the login and the about method
|
|
21
|
+
# def protect?(action)
|
|
22
|
+
# if ['action', 'about'].include?(action)
|
|
23
|
+
# return false
|
|
24
|
+
# else
|
|
25
|
+
# return true
|
|
26
|
+
# end
|
|
27
|
+
# end
|
|
28
|
+
def protect?(action)
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# login_required filter. add
|
|
33
|
+
#
|
|
34
|
+
# before_filter :login_required
|
|
35
|
+
#
|
|
36
|
+
# if the controller should be under any rights management.
|
|
37
|
+
# for finer access control you can overwrite
|
|
38
|
+
#
|
|
39
|
+
# def authorize?(user)
|
|
40
|
+
#
|
|
41
|
+
def login_required
|
|
42
|
+
|
|
43
|
+
if not protect?(action_name)
|
|
44
|
+
return true
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if user? and authorize?(@session['user'])
|
|
48
|
+
return true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# store current location so that we can
|
|
52
|
+
# come back after the user logged in
|
|
53
|
+
store_location
|
|
54
|
+
|
|
55
|
+
# call overwriteable reaction to unauthorized access
|
|
56
|
+
access_denied
|
|
57
|
+
return false
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# overwrite if you want to have special behavior in case the user is not authorized
|
|
61
|
+
# to access the current operation.
|
|
62
|
+
# the default action is to redirect to the login screen
|
|
63
|
+
# example use :
|
|
64
|
+
# a popup window might just close itself for instance
|
|
65
|
+
def access_denied
|
|
66
|
+
redirect_to :controller => "/user", :action => "login"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# store current uri in the session.
|
|
70
|
+
# we can return to this location by calling return_location
|
|
71
|
+
def store_location
|
|
72
|
+
@session['return-to'] = @request.request_uri
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# move to the last store_location call or to the passed default one
|
|
76
|
+
def redirect_back_or_default(default)
|
|
77
|
+
if @session['return-to'].nil?
|
|
78
|
+
redirect_to default
|
|
79
|
+
else
|
|
80
|
+
redirect_to_url @session['return-to']
|
|
81
|
+
@session['return-to'] = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def user?
|
|
86
|
+
# First, is the user already authenticated?
|
|
87
|
+
return true if not @session['user'].nil?
|
|
88
|
+
|
|
89
|
+
# If not, is the user being authenticated by a token?
|
|
90
|
+
return false if not @params['user']
|
|
91
|
+
id = @params['user']['id']
|
|
92
|
+
key = @params['key']
|
|
93
|
+
if id and key
|
|
94
|
+
@session['user'] = User.authenticate_by_token(id, key)
|
|
95
|
+
return true if not @session['user'].nil?
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Everything failed
|
|
99
|
+
return false
|
|
100
|
+
end
|
|
101
|
+
end
|
data/public/404.html
ADDED
data/public/500.html
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
|
3
|
+
<html>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Application error (Apache)</h1>
|
|
6
|
+
<p>Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html</p>
|
|
7
|
+
</body>
|
|
8
|
+
</html>
|
data/public/dispatch.cgi
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/ruby1.8
|
|
2
|
+
|
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
|
4
|
+
|
|
5
|
+
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
|
|
6
|
+
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
|
|
7
|
+
require "dispatcher"
|
|
8
|
+
|
|
9
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
|
|
10
|
+
Dispatcher.dispatch
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/ruby1.8
|
|
2
|
+
#
|
|
3
|
+
# You may specify the path to the FastCGI crash log (a log of unhandled
|
|
4
|
+
# exceptions which forced the FastCGI instance to exit, great for debugging)
|
|
5
|
+
# and the number of requests to process before running garbage collection.
|
|
6
|
+
#
|
|
7
|
+
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
|
|
8
|
+
# and the GC period is nil (turned off). A reasonable number of requests
|
|
9
|
+
# could range from 10-100 depending on the memory footprint of your app.
|
|
10
|
+
#
|
|
11
|
+
# Example:
|
|
12
|
+
# # Default log path, normal GC behavior.
|
|
13
|
+
# RailsFCGIHandler.process!
|
|
14
|
+
#
|
|
15
|
+
# # Default log path, 50 requests between GC.
|
|
16
|
+
# RailsFCGIHandler.process! nil, 50
|
|
17
|
+
#
|
|
18
|
+
# # Custom log path, normal GC behavior.
|
|
19
|
+
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
|
|
20
|
+
#
|
|
21
|
+
require File.dirname(__FILE__) + "/../config/environment"
|
|
22
|
+
require 'fcgi_handler'
|
|
23
|
+
|
|
24
|
+
RailsFCGIHandler.process!
|
data/public/dispatch.rb
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/ruby1.8
|
|
2
|
+
|
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
|
4
|
+
|
|
5
|
+
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
|
|
6
|
+
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
|
|
7
|
+
require "dispatcher"
|
|
8
|
+
|
|
9
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
|
|
10
|
+
Dispatcher.dispatch
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Files in this directory are automatically generated from your Rails Engines.
|
|
2
|
+
They are copied from the 'public' directories of each engine into this directory
|
|
3
|
+
each time Rails starts (server, console... any time 'start_engine' is called).
|
|
4
|
+
Any edits you make will NOT persist across the next server restart; instead you
|
|
5
|
+
should edit the files within the <engine_name>/public directory itself.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
This CSS file is basically the scaffold.css file, and is only
|
|
4
|
+
included here to demonstrate using CSS files with Engines.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
body { background-color: #fff; color: #333; }
|
|
9
|
+
|
|
10
|
+
body, p, ol, ul, td {
|
|
11
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
|
12
|
+
font-size: 13px;
|
|
13
|
+
line-height: 18px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pre {
|
|
17
|
+
background-color: #eee;
|
|
18
|
+
padding: 10px;
|
|
19
|
+
font-size: 11px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
a { color: #000; }
|
|
23
|
+
a:visited { color: #666; }
|
|
24
|
+
a:hover { color: #fff; background-color:#000; }
|
|
25
|
+
|
|
26
|
+
.fieldWithErrors {
|
|
27
|
+
padding: 2px;
|
|
28
|
+
background-color: red;
|
|
29
|
+
display: table;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#ErrorExplanation {
|
|
33
|
+
width: 400px;
|
|
34
|
+
border: 2px solid red;
|
|
35
|
+
padding: 7px;
|
|
36
|
+
padding-bottom: 12px;
|
|
37
|
+
margin-bottom: 20px;
|
|
38
|
+
background-color: #f0f0f0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#ErrorExplanation h2 {
|
|
42
|
+
text-align: left;
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
padding: 5px 5px 5px 15px;
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
margin: -7px;
|
|
47
|
+
background-color: #c00;
|
|
48
|
+
color: #fff;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#ErrorExplanation p {
|
|
52
|
+
color: #333;
|
|
53
|
+
margin-bottom: 0;
|
|
54
|
+
padding: 5px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#ErrorExplanation ul li {
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
list-style: square;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
div.uploadStatus {
|
|
63
|
+
margin: 5px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
div.progressBar {
|
|
67
|
+
margin: 5px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
div.progressBar div.border {
|
|
71
|
+
background-color: #fff;
|
|
72
|
+
border: 1px solid grey;
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
div.progressBar div.background {
|
|
77
|
+
background-color: #333;
|
|
78
|
+
height: 18px;
|
|
79
|
+
width: 0%;
|
|
80
|
+
}
|
|
81
|
+
|
data/public/favicon.ico
ADDED
|
File without changes
|
data/public/favicon.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|