gestion 1.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +48 -0
- data/.project +14 -0
- data/Binaries/adduser_to_buzz +15 -0
- data/Binaries/backup +7 -0
- data/Binaries/check_gestion +8 -0
- data/Binaries/gestion.gnumail +22 -0
- data/Binaries/gestion.logrotate +34 -0
- data/Binaries/gestion.service +12 -0
- data/Binaries/gestion_update.rb +183 -0
- data/Binaries/gestion_update.service +10 -0
- data/Binaries/get_compta +11 -0
- data/Binaries/kill_gestion +16 -0
- data/Binaries/ldap/add_indexes +51 -0
- data/Binaries/ldap/backup +2 -0
- data/Binaries/ldap/install_ldap +92 -0
- data/Binaries/ldap/restore +7 -0
- data/Binaries/lib_backup +5 -0
- data/Binaries/log_scan_errors +8 -0
- data/Binaries/loop_gestion +64 -0
- data/Binaries/onetimers/sync_courses_from_compta.rb +74 -0
- data/Binaries/onetimers/transfer_cash_from_ldap_to_csv +26 -0
- data/Binaries/reboot +5 -0
- data/Binaries/restore +3 -0
- data/Binaries/restore_do +22 -0
- data/Binaries/sort_events +31 -0
- data/Binaries/start_gestion +18 -0
- data/Binaries/swipe_gestion +18 -0
- data/Binaries/update_africompta +21 -0
- data/Binaries/update_users +3 -0
- data/Diplomas.src/accredited.odg +0 -0
- data/Diplomas.src/diploma.odg +0 -0
- data/Diplomas.src/label.odg +0 -0
- data/Diplomas.src/presence_sheet.ods +0 -0
- data/Diplomas.src/presence_sheet_small.ods +0 -0
- data/Diplomas.src/student_card.odg +0 -0
- data/Doc/130514-it-ideas.odt +0 -0
- data/Doc/Compta-cash.mm +179 -0
- data/Doc/General.odt +0 -0
- data/Entities/AccessGroups.rb +117 -0
- data/Entities/Activity.rb +178 -0
- data/Entities/ChatMsg.rb +142 -0
- data/Entities/Classroom.rb +11 -0
- data/Entities/Client.rb +19 -0
- data/Entities/Computer.rb +21 -0
- data/Entities/ConfigBase.rb +280 -0
- data/Entities/Course.rb +1588 -0
- data/Entities/CourseType.rb +171 -0
- data/Entities/DFiles.rb +466 -0
- data/Entities/FilesManage.rb +226 -0
- data/Entities/Grade.rb +186 -0
- data/Entities/Internet.rb +300 -0
- data/Entities/Netdev.rb +10 -0
- data/Entities/Person.rb +1175 -0
- data/Entities/Plug.rb +98 -0
- data/Entities/Quiz.rb +33 -0
- data/Entities/Recharges.rb +37 -0
- data/Entities/Report.rb +136 -0
- data/Entities/Room.rb +12 -0
- data/Entities/SMS.rb +30 -0
- data/Entities/ScheduleType.rb +33 -0
- data/Entities/Share.rb +120 -0
- data/Entities/Task.rb +51 -0
- data/Entities/Ticket.rb +72 -0
- data/Entities/Usage.rb +143 -0
- data/Entities/Worker.rb +29 -0
- data/Files/apache-profeda.conf +36 -0
- data/Files/label.erb +121 -0
- data/Files/label_notfound.erb +64 -0
- data/Files/label_notpassed.erb +84 -0
- data/Files/mobileinfo.erb +115 -0
- data/Files/smb.conf +333 -0
- data/Files/timetable.html +36 -0
- data/Files/timetable.js +239 -0
- data/Gemfile +12 -0
- data/Gemfile.dev +12 -0
- data/Gemfile.dev.lock +127 -0
- data/Gemfile.lock +127 -0
- data/Gemfile.prod +8 -0
- data/Gestion +35 -0
- data/Gestion.rb +220 -0
- data/INSTALL +40 -0
- data/Images/connection.xcf +0 -0
- data/Images/connection_no.png +0 -0
- data/Images/connection_wait.png +0 -0
- data/Images/connection_yes.png +0 -0
- data/Paths/Exas.rb +13 -0
- data/Paths/Files.rb +19 -0
- data/Paths/GetDiplomas.rb +20 -0
- data/Paths/Info.rb +114 -0
- data/Paths/Label.rb +187 -0
- data/Paths/MobileInfo.rb +19 -0
- data/Paths/internetCash.rb +34 -0
- data/Paths/internetWifi.rb +54 -0
- data/README.md +60 -0
- data/Rakefile +13 -0
- data/TODO +1391 -0
- data/Test/.gitignore +3 -0
- data/Test/Diplomas/base_gestion.odt +0 -0
- data/Test/Diplomas/base_report.odt +0 -0
- data/Test/Diplomas/carte_etudiant.odg +0 -0
- data/Test/Diplomas/exam_language.odt +0 -0
- data/Test/Diplomas/label.odg +0 -0
- data/Test/Diplomas/presence_sheet.ods +0 -0
- data/Test/Diplomas/presence_sheet_small.ods +0 -0
- data/Test/Diplomas/student_card.odg +0 -0
- data/Test/Manual/testMerge +18 -0
- data/Test/config_test.yaml +26 -0
- data/Test/db.testGestion +0 -0
- data/Test/dfiles/descs/avg-rescue.desc +10 -0
- data/Test/dfiles/descs/avg.desc +8 -0
- data/Test/dfiles/descs/driver.desc +8 -0
- data/Test/dfiles/descs/linuxmint.desc +7 -0
- data/Test/dfiles/files/avg-160203.exe +1 -0
- data/Test/dfiles/files/avg.iso +1 -0
- data/Test/dfiles/files/driver.exe +1 -0
- data/Test/dfiles/index_post.html +3 -0
- data/Test/dfiles/index_pre.html +8 -0
- data/Test/dfiles/priorities +5 -0
- data/Test/ge_activity.rb +124 -0
- data/Test/ge_chat.rb +106 -0
- data/Test/ge_compta.rb +67 -0
- data/Test/ge_configbase.rb +54 -0
- data/Test/ge_course.rb +1114 -0
- data/Test/ge_dfiles.rb +121 -0
- data/Test/ge_filesmanage.rb +180 -0
- data/Test/ge_info.rb +27 -0
- data/Test/ge_internet.rb +246 -0
- data/Test/ge_login.rb +55 -0
- data/Test/ge_person.rb +373 -0
- data/Test/ge_qvinfo.rb +28 -0
- data/Test/ge_report.rb +97 -0
- data/Test/ge_share.rb +27 -0
- data/Test/ge_sms.rb +34 -0
- data/Test/ge_tasks.rb +19 -0
- data/Test/ge_usage.rb +168 -0
- data/Test/ge_view.rb +46 -0
- data/Test/multiconf-captive +29 -0
- data/Test/test.conf +7 -0
- data/Test/test.rb +49 -0
- data/Test/test_bytes.png +0 -0
- data/VERSION +140 -0
- data/Views/Admin/Backup.rb +91 -0
- data/Views/Admin/Configuration.rb +44 -0
- data/Views/Admin/Credit.rb +32 -0
- data/Views/Admin/FilesManage.rb +219 -0
- data/Views/Admin/Function.rb +39 -0
- data/Views/Admin/Power.rb +49 -0
- data/Views/Admin/Printer.rb +37 -0
- data/Views/Admin/Server.rb +252 -0
- data/Views/Admin/Tabs.rb +5 -0
- data/Views/Admin/Update.rb +73 -0
- data/Views/Admin/UpdateSystem.rb +26 -0
- data/Views/Cashbox/Activity.rb +191 -0
- data/Views/Cashbox/Course.rb +141 -0
- data/Views/Cashbox/Credit.rb +79 -0
- data/Views/Cashbox/Report.rb +115 -0
- data/Views/Cashbox/Service.rb +105 -0
- data/Views/Cashbox/Tabs.rb +10 -0
- data/Views/Compta/Accounts.rb +36 -0
- data/Views/Compta/Course.rb +96 -0
- data/Views/Compta/Show.rb +6 -0
- data/Views/Compta/Transfer.rb +66 -0
- data/Views/Course/Diploma.rb +203 -0
- data/Views/Course/Grade.rb +401 -0
- data/Views/Course/Modify.rb +447 -0
- data/Views/Course/Print.rb +94 -0
- data/Views/Course/Responsible.rb +44 -0
- data/Views/Course/Stats.rb +76 -0
- data/Views/Course/Students.rb +92 -0
- data/Views/Course/Tabs.rb +220 -0
- data/Views/Internet/Access.rb +134 -0
- data/Views/Internet/ClassEdit.rb +24 -0
- data/Views/Internet/ClassUsers.rb +81 -0
- data/Views/Internet/Config.rb +32 -0
- data/Views/Internet/Mobile.rb +213 -0
- data/Views/Internet/Recharges.rb +49 -0
- data/Views/Internet/Tabs.rb +6 -0
- data/Views/Inventory/Computer.rb +24 -0
- data/Views/Inventory/Room.rb +18 -0
- data/Views/Inventory/Tabs.rb +9 -0
- data/Views/Inventory/TicketClosed.rb +7 -0
- data/Views/Inventory/TicketOpen.rb +23 -0
- data/Views/Library/Person.rb +36 -0
- data/Views/Library/Tabs.rb +7 -0
- data/Views/Network/Block.rb +87 -0
- data/Views/Network/Netdevs.rb +21 -0
- data/Views/Network/Restriction.rb +37 -0
- data/Views/Network/Share.rb +167 -0
- data/Views/Network/Tables.rb +28 -0
- data/Views/Network/Tabs.rb +6 -0
- data/Views/Person/Admin.rb +99 -0
- data/Views/Person/Center.rb +48 -0
- data/Views/Person/Course.rb +72 -0
- data/Views/Person/Modify.rb +153 -0
- data/Views/Person/Tabs.rb +162 -0
- data/Views/Report/ComptaExecutive.rb +221 -0
- data/Views/Report/ComptaFlat.rb +79 -0
- data/Views/Report/ReportCourse.rb +47 -0
- data/Views/Report/Tabs.rb +8 -0
- data/Views/Report/Usage.rb +52 -0
- data/Views/Report/UsageCases.rb +59 -0
- data/Views/Self/Cash.rb +67 -0
- data/Views/Self/Chat.rb +55 -0
- data/Views/Self/Concours.rb +109 -0
- data/Views/Self/Email.rb +34 -0
- data/Views/Self/Internet.rb +255 -0
- data/Views/Self/Results.rb +17 -0
- data/Views/Self/Services.rb +85 -0
- data/Views/Self/Show.rb +47 -0
- data/Views/Self/Tabs.rb +5 -0
- data/Views/Special/DFileEdit.rb +13 -0
- data/Views/Special/PlugEdit.rb +56 -0
- data/Views/Special/Tabs.rb +6 -0
- data/Views/Special/Vnc.rb +39 -0
- data/Views/Task/Client.rb +21 -0
- data/Views/Task/Edit.rb +33 -0
- data/Views/Task/List.rb +55 -0
- data/Views/Task/Tabs.rb +9 -0
- data/Views/Task/Worker.rb +30 -0
- data/Views/Template/Activity.rb +33 -0
- data/Views/Template/CourseType.rb +63 -0
- data/Views/Template/ScheduleType.rb +29 -0
- data/Views/Template/Tabs.rb +5 -0
- data/Views/Welcome.rb +121 -0
- data/config.yaml.default +36 -0
- data/po/Gestion-ar.po +2356 -0
- data/po/Gestion-en.mo +0 -0
- data/po/Gestion-en.po +4363 -0
- data/po/Gestion-fr.mo +0 -0
- data/po/Gestion-fr.po +4345 -0
- data/po/traduction-ar.rtf +76 -0
- metadata +381 -0
data/Gemfile.dev.lock
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../AfriCompta
|
3
|
+
specs:
|
4
|
+
africompta (1.9.11)
|
5
|
+
prawn (= 1.0.0)
|
6
|
+
qooxview (= 1.9.11)
|
7
|
+
|
8
|
+
PATH
|
9
|
+
remote: ../HelperClasses
|
10
|
+
specs:
|
11
|
+
helper_classes (0.3.5)
|
12
|
+
|
13
|
+
PATH
|
14
|
+
remote: ../HilinkModem
|
15
|
+
specs:
|
16
|
+
hilink_modem (0.3.5)
|
17
|
+
activesupport (~> 5.1)
|
18
|
+
serialport (~> 1.3)
|
19
|
+
|
20
|
+
PATH
|
21
|
+
remote: ../Network
|
22
|
+
specs:
|
23
|
+
network (0.3.5)
|
24
|
+
chunky_png (= 1.3.4)
|
25
|
+
helper_classes (= 0.3.5)
|
26
|
+
hilink_modem (= 0.3.5)
|
27
|
+
i18n (= 0.7.0)
|
28
|
+
multi_json (= 1.0.3)
|
29
|
+
serial_modem (= 0.3.5)
|
30
|
+
|
31
|
+
PATH
|
32
|
+
remote: ../QooxView
|
33
|
+
specs:
|
34
|
+
qooxview (1.9.11)
|
35
|
+
activemodel (= 5.1.0)
|
36
|
+
activerecord (= 5.1.0)
|
37
|
+
activesupport (= 5.1.0)
|
38
|
+
arel (= 8.0)
|
39
|
+
chunky_png (= 1.3.4)
|
40
|
+
docsplit (= 0.7.6)
|
41
|
+
gettext (= 3.0.0)
|
42
|
+
helper_classes (= 0.3.5)
|
43
|
+
i18n (= 0.7.0)
|
44
|
+
iconv (= 1.0.3)
|
45
|
+
iniparse (= 1.4.0)
|
46
|
+
json (= 2.1.0)
|
47
|
+
locale (= 2.0.8)
|
48
|
+
multi_json (= 1.0.3)
|
49
|
+
net-ldap (= 0.16)
|
50
|
+
rqrcode (= 0.4.2)
|
51
|
+
rqrcode-with-patches (= 0.5.4)
|
52
|
+
rubyzip (= 1.1.7)
|
53
|
+
serialport (= 1.3.1)
|
54
|
+
sqlite3 (= 1.3.10)
|
55
|
+
test-unit (= 3.2.3)
|
56
|
+
text (= 1.2.3)
|
57
|
+
|
58
|
+
PATH
|
59
|
+
remote: ../SerialModem
|
60
|
+
specs:
|
61
|
+
serial_modem (0.3.5)
|
62
|
+
serialport (= 1.3.1)
|
63
|
+
|
64
|
+
GEM
|
65
|
+
remote: https://rubygems.org/
|
66
|
+
specs:
|
67
|
+
activemodel (5.1.0)
|
68
|
+
activesupport (= 5.1.0)
|
69
|
+
activerecord (5.1.0)
|
70
|
+
activemodel (= 5.1.0)
|
71
|
+
activesupport (= 5.1.0)
|
72
|
+
arel (~> 8.0)
|
73
|
+
activesupport (5.1.0)
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
75
|
+
i18n (~> 0.7)
|
76
|
+
minitest (~> 5.1)
|
77
|
+
tzinfo (~> 1.1)
|
78
|
+
arel (8.0.0)
|
79
|
+
chunky_png (1.3.4)
|
80
|
+
concurrent-ruby (1.0.5)
|
81
|
+
docsplit (0.7.6)
|
82
|
+
gettext (3.0.0)
|
83
|
+
locale (>= 2.0.5)
|
84
|
+
text
|
85
|
+
i18n (0.7.0)
|
86
|
+
iconv (1.0.3)
|
87
|
+
iniparse (1.4.0)
|
88
|
+
json (2.1.0)
|
89
|
+
locale (2.0.8)
|
90
|
+
minitest (5.10.2)
|
91
|
+
multi_json (1.0.3)
|
92
|
+
net-ldap (0.16.0)
|
93
|
+
pdf-core (0.2.2)
|
94
|
+
power_assert (1.0.2)
|
95
|
+
prawn (1.0.0)
|
96
|
+
pdf-core (~> 0.2.2)
|
97
|
+
ttfunk (~> 1.1.1)
|
98
|
+
rqrcode (0.4.2)
|
99
|
+
rqrcode-with-patches (0.5.4)
|
100
|
+
chunky_png
|
101
|
+
rubyzip (1.1.7)
|
102
|
+
serialport (1.3.1)
|
103
|
+
sqlite3 (1.3.10)
|
104
|
+
test-unit (3.2.3)
|
105
|
+
power_assert
|
106
|
+
text (1.2.3)
|
107
|
+
thread_safe (0.3.6)
|
108
|
+
ttfunk (1.1.1)
|
109
|
+
tzinfo (1.2.3)
|
110
|
+
thread_safe (~> 0.1)
|
111
|
+
|
112
|
+
PLATFORMS
|
113
|
+
ruby
|
114
|
+
|
115
|
+
DEPENDENCIES
|
116
|
+
africompta!
|
117
|
+
helper_classes!
|
118
|
+
hilink_modem!
|
119
|
+
network!
|
120
|
+
pdf-core (= 0.2.2)
|
121
|
+
prawn (= 1.0.0)
|
122
|
+
qooxview!
|
123
|
+
serial_modem!
|
124
|
+
ttfunk (= 1.1.1)
|
125
|
+
|
126
|
+
BUNDLED WITH
|
127
|
+
1.15.0
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../AfriCompta
|
3
|
+
specs:
|
4
|
+
africompta (1.9.11)
|
5
|
+
prawn (= 1.0.0)
|
6
|
+
qooxview (= 1.9.11)
|
7
|
+
|
8
|
+
PATH
|
9
|
+
remote: ../HelperClasses
|
10
|
+
specs:
|
11
|
+
helper_classes (0.3.5)
|
12
|
+
|
13
|
+
PATH
|
14
|
+
remote: ../HilinkModem
|
15
|
+
specs:
|
16
|
+
hilink_modem (0.3.5)
|
17
|
+
activesupport (~> 5.1)
|
18
|
+
serialport (~> 1.3)
|
19
|
+
|
20
|
+
PATH
|
21
|
+
remote: ../Network
|
22
|
+
specs:
|
23
|
+
network (0.3.5)
|
24
|
+
chunky_png (= 1.3.4)
|
25
|
+
helper_classes (= 0.3.5)
|
26
|
+
hilink_modem (= 0.3.5)
|
27
|
+
i18n (= 0.7.0)
|
28
|
+
multi_json (= 1.0.3)
|
29
|
+
serial_modem (= 0.3.5)
|
30
|
+
|
31
|
+
PATH
|
32
|
+
remote: ../QooxView
|
33
|
+
specs:
|
34
|
+
qooxview (1.9.11)
|
35
|
+
activemodel (= 5.1.0)
|
36
|
+
activerecord (= 5.1.0)
|
37
|
+
activesupport (= 5.1.0)
|
38
|
+
arel (= 8.0)
|
39
|
+
chunky_png (= 1.3.4)
|
40
|
+
docsplit (= 0.7.6)
|
41
|
+
gettext (= 3.0.0)
|
42
|
+
helper_classes (= 0.3.5)
|
43
|
+
i18n (= 0.7.0)
|
44
|
+
iconv (= 1.0.3)
|
45
|
+
iniparse (= 1.4.0)
|
46
|
+
json (= 2.1.0)
|
47
|
+
locale (= 2.0.8)
|
48
|
+
multi_json (= 1.0.3)
|
49
|
+
net-ldap (= 0.16)
|
50
|
+
rqrcode (= 0.4.2)
|
51
|
+
rqrcode-with-patches (= 0.5.4)
|
52
|
+
rubyzip (= 1.1.7)
|
53
|
+
serialport (= 1.3.1)
|
54
|
+
sqlite3 (= 1.3.10)
|
55
|
+
test-unit (= 3.2.3)
|
56
|
+
text (= 1.2.3)
|
57
|
+
|
58
|
+
PATH
|
59
|
+
remote: ../SerialModem
|
60
|
+
specs:
|
61
|
+
serial_modem (0.3.5)
|
62
|
+
serialport (= 1.3.1)
|
63
|
+
|
64
|
+
GEM
|
65
|
+
remote: https://rubygems.org/
|
66
|
+
specs:
|
67
|
+
activemodel (5.1.0)
|
68
|
+
activesupport (= 5.1.0)
|
69
|
+
activerecord (5.1.0)
|
70
|
+
activemodel (= 5.1.0)
|
71
|
+
activesupport (= 5.1.0)
|
72
|
+
arel (~> 8.0)
|
73
|
+
activesupport (5.1.0)
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
75
|
+
i18n (~> 0.7)
|
76
|
+
minitest (~> 5.1)
|
77
|
+
tzinfo (~> 1.1)
|
78
|
+
arel (8.0.0)
|
79
|
+
chunky_png (1.3.4)
|
80
|
+
concurrent-ruby (1.0.5)
|
81
|
+
docsplit (0.7.6)
|
82
|
+
gettext (3.0.0)
|
83
|
+
locale (>= 2.0.5)
|
84
|
+
text
|
85
|
+
i18n (0.7.0)
|
86
|
+
iconv (1.0.3)
|
87
|
+
iniparse (1.4.0)
|
88
|
+
json (2.1.0)
|
89
|
+
locale (2.0.8)
|
90
|
+
minitest (5.10.2)
|
91
|
+
multi_json (1.0.3)
|
92
|
+
net-ldap (0.16.0)
|
93
|
+
pdf-core (0.2.2)
|
94
|
+
power_assert (1.0.2)
|
95
|
+
prawn (1.0.0)
|
96
|
+
pdf-core (~> 0.2.2)
|
97
|
+
ttfunk (~> 1.1.1)
|
98
|
+
rqrcode (0.4.2)
|
99
|
+
rqrcode-with-patches (0.5.4)
|
100
|
+
chunky_png
|
101
|
+
rubyzip (1.1.7)
|
102
|
+
serialport (1.3.1)
|
103
|
+
sqlite3 (1.3.10)
|
104
|
+
test-unit (3.2.3)
|
105
|
+
power_assert
|
106
|
+
text (1.2.3)
|
107
|
+
thread_safe (0.3.6)
|
108
|
+
ttfunk (1.1.1)
|
109
|
+
tzinfo (1.2.3)
|
110
|
+
thread_safe (~> 0.1)
|
111
|
+
|
112
|
+
PLATFORMS
|
113
|
+
ruby
|
114
|
+
|
115
|
+
DEPENDENCIES
|
116
|
+
africompta!
|
117
|
+
helper_classes!
|
118
|
+
hilink_modem!
|
119
|
+
network!
|
120
|
+
pdf-core (= 0.2.2)
|
121
|
+
prawn (= 1.0.0)
|
122
|
+
qooxview!
|
123
|
+
serial_modem!
|
124
|
+
ttfunk (= 1.1.1)
|
125
|
+
|
126
|
+
BUNDLED WITH
|
127
|
+
1.15.0
|
data/Gemfile.prod
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'qooxview', git: 'https://github.com/ineiti/QooxView'
|
4
|
+
gem 'africompta', git: 'https://github.com/ineiti/AfriCompta'
|
5
|
+
gem 'network', git: 'https://github.com/ineiti/Network'
|
6
|
+
gem 'helper_classes', git: 'https://github.com/ineiti/HelperClasses'
|
7
|
+
gem 'hilink_modem', git: 'https://github.com/ineiti/HilinkModem'
|
8
|
+
gem 'serial_modem', git: 'https://github.com/ineiti/SerialModem'
|
data/Gestion
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
WDIR=$( dirname ${BASH_SOURCE[0]} )
|
4
|
+
cd $WDIR
|
5
|
+
if [ "$1" = "update" ]; then
|
6
|
+
Binaries/gestion_update.rb
|
7
|
+
exit
|
8
|
+
fi
|
9
|
+
|
10
|
+
echo ""
|
11
|
+
mkdir -p Backups
|
12
|
+
if [ "$( which ruby )" ]; then
|
13
|
+
if [ ! -f /etc/gestion.conf ]; then
|
14
|
+
if [ "$( whoami )" = "root" ]; then
|
15
|
+
echo "Copying gestion.conf to /etc - please edit to your needs"
|
16
|
+
BASE=$( pwd | sed -e "s/.Gestion$//" )
|
17
|
+
sed -e "s:.opt.profeda:$BASE:" gestion.conf > /etc/gestion.conf
|
18
|
+
else
|
19
|
+
echo "Not started as root, doing nothing"
|
20
|
+
fi
|
21
|
+
fi
|
22
|
+
if [ ! -e Diplomas ]; then
|
23
|
+
cp -a Diplomas.src Diplomas
|
24
|
+
fi
|
25
|
+
if [ -f dorestore ]; then
|
26
|
+
RESTORE=restore_$( date +%Y-%m-%d_%H.%M.%S )
|
27
|
+
for d in data config.yaml Exas Diplomas*; do
|
28
|
+
mv $d $RESTORE
|
29
|
+
done
|
30
|
+
tar xf Backups/$( cat dorestore )
|
31
|
+
rm dorestore
|
32
|
+
fi
|
33
|
+
./Gestion.rb $@
|
34
|
+
fi
|
35
|
+
echo
|
data/Gestion.rb
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
if ARGV == %w(-p)
|
5
|
+
DEBUG_LVL = 0
|
6
|
+
else
|
7
|
+
DEBUG_LVL = 2
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'bundler/setup'
|
11
|
+
require 'helper_classes'
|
12
|
+
include HelperClasses
|
13
|
+
include System
|
14
|
+
$LOAD_PATH.push __dir__
|
15
|
+
|
16
|
+
Encoding.default_external = Encoding::UTF_8
|
17
|
+
|
18
|
+
# Gestion - a frontend for different modules developed in Markas-al-Nour
|
19
|
+
# N'Djaména, Tchad.
|
20
|
+
|
21
|
+
VERSION_GESTION='1.9.13' +
|
22
|
+
(File.exists?('Gestion.pkgrel') ? '-' + IO.read('Gestion.pkgrel') : '')
|
23
|
+
require 'fileutils'
|
24
|
+
|
25
|
+
GESTION_DIR=File.dirname(__FILE__)
|
26
|
+
$config_file='config.yaml'
|
27
|
+
if not FileTest.exists? $config_file
|
28
|
+
puts "Config-file doesn't exist, copying a standard one"
|
29
|
+
FileUtils.cp 'config.yaml.default', 'config.yaml'
|
30
|
+
end
|
31
|
+
|
32
|
+
begin
|
33
|
+
require 'qooxview'
|
34
|
+
require 'africompta'
|
35
|
+
#ACQooxView.load_entities(false)
|
36
|
+
%w( Modules Paths ).each { |dir|
|
37
|
+
Dir.glob("#{dir}/*").each { |d| require d }
|
38
|
+
}
|
39
|
+
rescue Exception => e
|
40
|
+
puts "#{e.inspect}"
|
41
|
+
puts "#{e.to_s}"
|
42
|
+
puts e.backtrace
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
|
46
|
+
begin
|
47
|
+
# Our default-permission is to only login!
|
48
|
+
Permission.add('default', ',Welcome,SelfShow')
|
49
|
+
Permission.add('quiz', 'SelfChat,SelfConcours,SelfResults', '')
|
50
|
+
Permission.add('internet', 'SelfInternet,SelfChat', 'default')
|
51
|
+
Permission.add('student', '', 'internet')
|
52
|
+
Permission.add('librarian', 'LibraryPerson,FlagInternetFree', 'student')
|
53
|
+
Permission.add('assistant', 'TaskEdit,FlagInternetFree', 'student')
|
54
|
+
Permission.add('teacher', 'CourseGrade,PersonModify,NetworkRestriction,CoursePrint,' +
|
55
|
+
'FlagResponsible', 'assistant')
|
56
|
+
Permission.add('center_director', '', 'center')
|
57
|
+
Permission.add('secretary', 'CourseModify,FlagPersonAdd,FlagPersonDelete,' +
|
58
|
+
'PersonModify,CourseDiploma,FlagCourseGradeAll,Cashbox.*,' +
|
59
|
+
'FlagAddInternet,CourseStats,CoursePrint,' +
|
60
|
+
'CourseStudents,PersonCourse', 'assistant,cybermanager')
|
61
|
+
Permission.add('accounting', 'ComptaTransfer,FlagAccounting,' +
|
62
|
+
'ComptaReport,ComptaShow,ComptaEdit.*,Cashbox.*,Report.*,' +
|
63
|
+
'ComptaCheck', 'secretary')
|
64
|
+
Permission.add('maintenance', 'Inventory.*,AdminBackup,AdminPower,AdminFiles.*', 'default')
|
65
|
+
Permission.add('cybermanager', 'CashboxCredit,FlagAddInternet,' +
|
66
|
+
'FlagPersonAdd,CashboxService,InternetMobile,' +
|
67
|
+
'CashboxActivity', '')
|
68
|
+
Permission.add('manager', 'Template.*,Internet.*',
|
69
|
+
'director')
|
70
|
+
Permission.add('director', 'FlagAdminCourse,FlagAdminPerson,' +
|
71
|
+
'PersonAdmin,PersonCourse,InternetConnection,CourseStats,Report.*,' +
|
72
|
+
'secretary,cybermanager,teacher')
|
73
|
+
Permission.add('center', 'CourseModify,FlagAdminCourse,CourseGrade,' +
|
74
|
+
'FlagPersonAdd,FlagPersonDelete,PersonModify,CourseDiploma,' +
|
75
|
+
'FlagRemoteCourse,SelfShow,SelfChat,FlagAdminPerson,' +
|
76
|
+
'PersonCenter,FlagDeletePerson', '')
|
77
|
+
Permission.add('admin', '.*', '.*')
|
78
|
+
Permission.add('email', 'SelfEmail', '')
|
79
|
+
|
80
|
+
QooxView::init('Entities', 'Views')
|
81
|
+
|
82
|
+
# Look for admin, create if it doesn't exist
|
83
|
+
admin = Entities.Persons.match_by_login_name('admin')
|
84
|
+
if not admin
|
85
|
+
dputs(1) { 'OK, creating admin' }
|
86
|
+
admin = Entities.Persons.create(:login_name => 'admin', :password => 'super123', :permissions => ["admin"],
|
87
|
+
:internet_credit => '100')
|
88
|
+
else
|
89
|
+
admin.permissions = ['admin'];
|
90
|
+
end
|
91
|
+
|
92
|
+
rescue Exception => e
|
93
|
+
case e.to_s
|
94
|
+
when /UpdatePot|MakeMo|PrintHelp|value_entity_uncomplete/
|
95
|
+
else
|
96
|
+
puts e.inspect
|
97
|
+
puts e.backtrace
|
98
|
+
dputs(0) { "Error: Couldn't load things!" }
|
99
|
+
dputs(0) { "#{e.inspect}" }
|
100
|
+
dputs(0) { "#{e.to_s}" }
|
101
|
+
puts e.backtrace
|
102
|
+
end
|
103
|
+
exit
|
104
|
+
end
|
105
|
+
|
106
|
+
webrick_port = get_config(3302, :Webrick, :port)
|
107
|
+
dputs(2) { "Starting at port #{webrick_port}" }
|
108
|
+
|
109
|
+
$profiling = get_config(nil, :profiling)
|
110
|
+
if $profiling
|
111
|
+
dputs(1) { 'Starting Profiling' }
|
112
|
+
require 'rubygems'
|
113
|
+
require 'perftools'
|
114
|
+
PerfTools::CpuProfiler.start("/tmp/#{$profiling}") do
|
115
|
+
QooxView::startWeb webrick_port, get_config(30, :profiling, :duration)
|
116
|
+
dputs(1) { 'Finished profiling' }
|
117
|
+
end
|
118
|
+
|
119
|
+
if $profiling
|
120
|
+
puts "Now run the following:
|
121
|
+
pprof.rb --pdf /tmp/#{$profiling} > /tmp/#{$profiling}.pdf
|
122
|
+
open /tmp/#{$profiling}.pdf
|
123
|
+
CPUPROFILE_FREQUENCY=500
|
124
|
+
"
|
125
|
+
end
|
126
|
+
else
|
127
|
+
# Autosave every 2 minutes
|
128
|
+
if ConfigBase.autosave == %w(true)
|
129
|
+
dputs(1) { 'Starting autosave' }
|
130
|
+
$autosave = Thread.new {
|
131
|
+
loop {
|
132
|
+
sleep ConfigBase.autosave_timer.to_i
|
133
|
+
rescue_all "Error: couldn't save all" do
|
134
|
+
Entities.save_all
|
135
|
+
end
|
136
|
+
}
|
137
|
+
}
|
138
|
+
end
|
139
|
+
|
140
|
+
# Initialize network and listen for new devices
|
141
|
+
if ConfigBase.has_function? :network
|
142
|
+
if !get_config(false, :Simulation)
|
143
|
+
Network::Device.start
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Start up internet-handling (traffic and credit)
|
148
|
+
if ConfigBase.has_function? :internet
|
149
|
+
dputs(1) { 'Starting internet' }
|
150
|
+
Internet.setup
|
151
|
+
$internet = Thread.new {
|
152
|
+
loop {
|
153
|
+
rescue_all "Couldn't take internet-money" do
|
154
|
+
# Simple debug-routine to make it faster to test
|
155
|
+
if false
|
156
|
+
dputs(0) { 'Internet-sleep is on 5!' }
|
157
|
+
sleep 5
|
158
|
+
Internet.update_traffic
|
159
|
+
else
|
160
|
+
(1..6).each {
|
161
|
+
sleep 10
|
162
|
+
Internet.update_traffic
|
163
|
+
}
|
164
|
+
end
|
165
|
+
Internet.take_money
|
166
|
+
end
|
167
|
+
}
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
# Shows time every minute in the logs
|
172
|
+
if get_config(false, :showTime)
|
173
|
+
dputs(1) { 'Showing time' }
|
174
|
+
$show_time = Thread.new {
|
175
|
+
loop {
|
176
|
+
sleep 60
|
177
|
+
dputs(1) { 'It is now: ' + Time.now.strftime('%Y-%m-%d %H:%M') }
|
178
|
+
}
|
179
|
+
}
|
180
|
+
end
|
181
|
+
|
182
|
+
# Trying to debug mysterious slowdown
|
183
|
+
if false
|
184
|
+
$test_hash = {a: 1, b: 2, c: 3}
|
185
|
+
$test_hash_big = (1..100).collect { |i| ["value#{i}", i] }.to_h
|
186
|
+
$show_time = Thread.new {
|
187
|
+
loop {
|
188
|
+
Timing.measure('Small hash') { $test_hash._a }
|
189
|
+
Timing.measure('Big hash') { $test_hash_big['value50'] }
|
190
|
+
Timing.measure('Big method_missing') { $test_hash_big._value50 }
|
191
|
+
sleep 10
|
192
|
+
}
|
193
|
+
}
|
194
|
+
end
|
195
|
+
|
196
|
+
# Catch SIGINT signal so we can save everything before quitting
|
197
|
+
trap('SIGINT') {
|
198
|
+
throw :ctrl_c
|
199
|
+
}
|
200
|
+
|
201
|
+
# Finally start QooxView
|
202
|
+
catch :ctrl_c do
|
203
|
+
rescue_all 'Error: QooxView aborted' do
|
204
|
+
log_msg :main, "Started Gestion on port #{webrick_port}"
|
205
|
+
images_path = File.join(File.expand_path(File.dirname(__FILE__)), 'Images')
|
206
|
+
RPCQooxdooHandler.add_file_path(:Images, images_path)
|
207
|
+
QooxView::startWeb webrick_port
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Clean up all threads
|
212
|
+
if get_config(true, :autosave)
|
213
|
+
$autosave.kill
|
214
|
+
end
|
215
|
+
$internet and $internet.kill
|
216
|
+
$show_time and $show_time.kill
|
217
|
+
|
218
|
+
# And finally save all before quitting
|
219
|
+
Entities.save_all
|
220
|
+
end
|
data/INSTALL
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
This package depends on QooxView, AfriCompta and LibNet. There should be a
|
2
|
+
directory holding all directories:
|
3
|
+
|
4
|
+
# ls
|
5
|
+
QooxView Gestion AfriCompta LibNet
|
6
|
+
|
7
|
+
|
8
|
+
# Gestion/Gestion
|
9
|
+
|
10
|
+
This will try to download all missing packets (down to ruby).
|
11
|
+
|
12
|
+
Short, it will do about:
|
13
|
+
|
14
|
+
# sudo apt-get install ruby rubygems libreoffice pdftk psutils sqlite \
|
15
|
+
# libsqlite3-dev default-jdk gettext
|
16
|
+
|
17
|
+
And then it will compile sqlite3-support, so a gcc-compiler should be present.
|
18
|
+
A standard Lubuntu, LinuxMint or Debian-Squeezy installation seem to run
|
19
|
+
it well.
|
20
|
+
|
21
|
+
Once it's running, you can point your browser to
|
22
|
+
|
23
|
+
http://localhost:3302
|
24
|
+
|
25
|
+
and log in using admin/super123
|
26
|
+
|
27
|
+
======== Further installation
|
28
|
+
|
29
|
+
If you want to use it more thoroughly, I propose you go into
|
30
|
+
|
31
|
+
LibNet/tools
|
32
|
+
|
33
|
+
and run ./install there. This will copy some links around the system.
|
34
|
+
|
35
|
+
|
36
|
+
======== Slowness on connection
|
37
|
+
|
38
|
+
if the system reacts very slowly whenever there is a connection, check that the
|
39
|
+
DNS-server doesn't send out private reverse-requests (--bogus-priv on dnsmasq) and
|
40
|
+
also some other requests (--filterwin2k on dnsmasq)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/Paths/Exas.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class Exas < RPCQooxdooPath
|
2
|
+
def self.parse_req_res(req, res)
|
3
|
+
dputs(4) { "Exas: #{req.inspect}" }
|
4
|
+
path, query, addr = req.path, req.query.to_sym, RPCQooxdooHandler.get_ip(req)
|
5
|
+
if req.request_method == 'GET'
|
6
|
+
filename = RPCQooxdooPath.sanitize(path.sub(/^.[^\/]*./, ''))
|
7
|
+
res['content-type'] = 'data/binary'
|
8
|
+
dputs(4) { "Request is #{req.inspect}" }
|
9
|
+
dputs(3) { "filename is #{filename} - content-type is #{res['content-type']}" }
|
10
|
+
return IO.read("#{Courses.dir_exams}/#{filename}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/Paths/Files.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
class Files < RPCQooxdooPath
|
3
|
+
def self.parse_req_res( req, res )
|
4
|
+
dputs( 4 ){ "Files: #{req.inspect}" }
|
5
|
+
path, query, addr = req.path, req.query.to_sym, RPCQooxdooHandler.get_ip( req )
|
6
|
+
if req.request_method == 'GET'
|
7
|
+
filename = RPCQooxdooPath.sanitize(path.sub( /^.[^\/]*./, '' ))
|
8
|
+
res['content-type'] = case filename
|
9
|
+
when /js$/i
|
10
|
+
'text/javascript'
|
11
|
+
when /html$/i
|
12
|
+
'text/html'
|
13
|
+
end
|
14
|
+
dputs(4){"Request is #{req.inspect}" }
|
15
|
+
dputs(3){"filename is #{filename} - content-type is #{res['content-type']}" }
|
16
|
+
return IO.read( 'Files/' + filename )
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
class GetDiplomas < RPCQooxdooPath
|
3
|
+
def self.parse_req_res( req, res )
|
4
|
+
dputs( 4 ){ "GetDiplomas: #{req.inspect}" }
|
5
|
+
path, query, addr = req.path, req.query.to_sym, RPCQooxdooHandler.get_ip( req )
|
6
|
+
if req.request_method == 'GET'
|
7
|
+
filename = RPCQooxdooPath.sanitize(path.sub( /^.[^\/]*./, '' ))
|
8
|
+
res['content-type'] = case filename
|
9
|
+
when /pdf$/i
|
10
|
+
'application/pdf'
|
11
|
+
when /png$/i
|
12
|
+
'image/png'
|
13
|
+
end
|
14
|
+
dputs(4){"Request is #{req.inspect}" }
|
15
|
+
dputs(3){"filename is #{filename} - content-type is #{res['content-type']}" }
|
16
|
+
return IO.read( Courses.dir_diplomas + '/' + filename ).
|
17
|
+
force_encoding('ASCII-8BIT')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|