spiderfw 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (638) hide show
  1. data/README +4 -0
  2. data/Rakefile +74 -0
  3. data/apps/cas_server/_init.rb +23 -0
  4. data/apps/cas_server/config/options.rb +9 -0
  5. data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +353 -0
  6. data/apps/cas_server/lib/cas.rb +329 -0
  7. data/apps/cas_server/lib/utils.rb +30 -0
  8. data/apps/cas_server/models/login_ticket.rb +11 -0
  9. data/apps/cas_server/models/mixins/consumable.rb +10 -0
  10. data/apps/cas_server/models/proxy_granting_ticket.rb +12 -0
  11. data/apps/cas_server/models/proxy_ticket.rb +12 -0
  12. data/apps/cas_server/models/service_ticket.rb +22 -0
  13. data/apps/cas_server/models/ticket.rb +20 -0
  14. data/apps/cas_server/models/ticket_granting_ticket.rb +15 -0
  15. data/apps/cas_server/views/logout.shtml +3 -0
  16. data/apps/core/admin/_init.rb +23 -0
  17. data/apps/core/admin/admin.rb +17 -0
  18. data/apps/core/admin/controllers/admin_controller.rb +15 -0
  19. data/apps/core/admin/views/index.shtml +1 -0
  20. data/apps/core/admin/views/spider_admin.layout.shtml +23 -0
  21. data/apps/core/admin/widgets/admin_menu/admin_menu.rb +17 -0
  22. data/apps/core/auth/_init.rb +42 -0
  23. data/apps/core/auth/controllers/login_controller.rb +94 -0
  24. data/apps/core/auth/controllers/mixins/auth_helper.rb +114 -0
  25. data/apps/core/auth/controllers/mixins/http_basic_auth.rb +24 -0
  26. data/apps/core/auth/controllers/mixins/http_digest_auth.rb +26 -0
  27. data/apps/core/auth/lib/authenticable.rb +86 -0
  28. data/apps/core/auth/lib/authenticator.rb +11 -0
  29. data/apps/core/auth/lib/digest_authenticator.rb +44 -0
  30. data/apps/core/auth/lib/login_authenticator.rb +27 -0
  31. data/apps/core/auth/models/digest_user.rb +34 -0
  32. data/apps/core/auth/models/group.rb +22 -0
  33. data/apps/core/auth/models/login_user.rb +15 -0
  34. data/apps/core/auth/models/mixins/access_control.rb +71 -0
  35. data/apps/core/auth/models/mixins/authentication_tracking.rb +19 -0
  36. data/apps/core/auth/models/super_user.rb +8 -0
  37. data/apps/core/auth/models/user.rb +15 -0
  38. data/apps/core/auth/po/it/spider_auth.po +33 -0
  39. data/apps/core/auth/po/spider_auth.pot +31 -0
  40. data/apps/core/auth/views/login.shtml +25 -0
  41. data/apps/core/components/_init.rb +21 -0
  42. data/apps/core/components/po/it/spider_components.po +52 -0
  43. data/apps/core/components/po/spider_components.pot +53 -0
  44. data/apps/core/components/public/css/admin.css +73 -0
  45. data/apps/core/components/public/css/crud.css +58 -0
  46. data/apps/core/components/public/css/img/add.gif +0 -0
  47. data/apps/core/components/public/css/img/ajax-loader.gif +0 -0
  48. data/apps/core/components/public/css/img/back.gif +0 -0
  49. data/apps/core/components/public/css/img/bg_header.png +0 -0
  50. data/apps/core/components/public/css/img/body_bg.jpg +0 -0
  51. data/apps/core/components/public/css/img/gray_gradient.gif +0 -0
  52. data/apps/core/components/public/css/img/li_bg.png +0 -0
  53. data/apps/core/components/public/css/img/li_bg_active.png +0 -0
  54. data/apps/core/components/public/css/img/li_bg_hover.png +0 -0
  55. data/apps/core/components/public/css/img/logo.png +0 -0
  56. data/apps/core/components/public/css/img/menu_bg.png +0 -0
  57. data/apps/core/components/public/css/img/menu_bottom.png +0 -0
  58. data/apps/core/components/public/css/img/menu_top.png +0 -0
  59. data/apps/core/components/public/css/img/section-bottom.jpg +0 -0
  60. data/apps/core/components/public/css/list.css +7 -0
  61. data/apps/core/components/public/css/menu.css +47 -0
  62. data/apps/core/components/public/css/spider.css +9 -0
  63. data/apps/core/components/public/css/switcher.css +13 -0
  64. data/apps/core/components/public/css/table.css +99 -0
  65. data/apps/core/components/public/js/inheritance.js +71 -0
  66. data/apps/core/components/public/js/jquery/jquery-1.3.2.js +4376 -0
  67. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  68. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  69. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  70. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  71. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  72. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  73. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  75. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  76. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  78. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  79. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +406 -0
  81. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  82. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  85. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  86. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  87. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  88. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  89. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  90. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  91. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  92. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  93. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  94. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  95. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  96. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/AUTHORS.txt +30 -0
  97. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/GPL-LICENSE.txt +278 -0
  98. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/MIT-LICENSE.txt +25 -0
  99. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +20 -0
  100. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +32 -0
  101. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +100 -0
  102. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +10 -0
  103. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +10 -0
  104. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +197 -0
  105. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +97 -0
  106. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +10 -0
  107. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +10 -0
  108. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
  109. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +159 -0
  110. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +780 -0
  111. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +120 -0
  112. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +152 -0
  113. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +4376 -0
  114. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  115. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  116. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  117. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  118. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  119. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  120. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  121. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  122. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
  123. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  124. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
  125. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
  126. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  127. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +9 -0
  128. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +2 -0
  129. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +8 -0
  130. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +37 -0
  131. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +62 -0
  132. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +13 -0
  133. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +4 -0
  134. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +13 -0
  135. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +17 -0
  136. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +11 -0
  137. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +245 -0
  138. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  139. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  140. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  141. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  142. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  143. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  144. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  145. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  146. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  147. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  148. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  149. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  150. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  151. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  152. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  153. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +9 -0
  154. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +2 -0
  155. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +8 -0
  156. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +37 -0
  157. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +62 -0
  158. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +13 -0
  159. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +4 -0
  160. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +13 -0
  161. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +17 -0
  162. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +11 -0
  163. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +247 -0
  164. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.blind.js +49 -0
  165. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.bounce.js +78 -0
  166. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.clip.js +54 -0
  167. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.core.js +545 -0
  168. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.drop.js +50 -0
  169. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.explode.js +79 -0
  170. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.fold.js +56 -0
  171. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +48 -0
  172. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +56 -0
  173. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.scale.js +180 -0
  174. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.shake.js +57 -0
  175. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.slide.js +50 -0
  176. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.transfer.js +45 -0
  177. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/jquery-ui-i18n.js +771 -0
  178. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js +20 -0
  179. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js +20 -0
  180. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js +19 -0
  181. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js +19 -0
  182. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js +19 -0
  183. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js +19 -0
  184. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js +19 -0
  185. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js +19 -0
  186. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js +19 -0
  187. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js +19 -0
  188. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js +19 -0
  189. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js +19 -0
  190. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js +19 -0
  191. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js +19 -0
  192. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js +19 -0
  193. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js +19 -0
  194. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js +19 -0
  195. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js +19 -0
  196. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js +19 -0
  197. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js +20 -0
  198. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js +19 -0
  199. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js +19 -0
  200. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js +19 -0
  201. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js +19 -0
  202. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js +19 -0
  203. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js +19 -0
  204. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js +19 -0
  205. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js +19 -0
  206. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js +22 -0
  207. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js +19 -0
  208. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js +19 -0
  209. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js +20 -0
  210. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js +19 -0
  211. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js +19 -0
  212. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js +19 -0
  213. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js +19 -0
  214. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js +19 -0
  215. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js +19 -0
  216. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js +25 -0
  217. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js +19 -0
  218. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js +19 -0
  219. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +9133 -0
  220. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +477 -0
  221. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +519 -0
  222. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.datepicker.js +1636 -0
  223. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +671 -0
  224. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.draggable.js +766 -0
  225. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.droppable.js +282 -0
  226. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +116 -0
  227. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.resizable.js +800 -0
  228. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.selectable.js +257 -0
  229. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +558 -0
  230. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.sortable.js +1019 -0
  231. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +685 -0
  232. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +1 -0
  233. data/apps/core/components/public/js/jquery/jquery-ui/index.html +367 -0
  234. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +19 -0
  235. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +298 -0
  236. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +27 -0
  237. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +48 -0
  238. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +808 -0
  239. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +13 -0
  240. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +12 -0
  241. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +116 -0
  242. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +10 -0
  243. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +3558 -0
  244. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +10 -0
  245. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +163 -0
  246. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +166 -0
  247. data/apps/core/components/public/js/jquery/plugins/jquery.form.js +653 -0
  248. data/apps/core/components/public/js/jquery/plugins/jquery.query-2.1.6.js +224 -0
  249. data/apps/core/components/public/js/jquery/plugins/jquery.url.js +214 -0
  250. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +187 -0
  251. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +1 -0
  252. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +193 -0
  253. data/apps/core/components/public/js/jquery/plugins/treeview/changelog.txt +35 -0
  254. data/apps/core/components/public/js/jquery/plugins/treeview/images/ajax-loader.gif +0 -0
  255. data/apps/core/components/public/js/jquery/plugins/treeview/images/file.gif +0 -0
  256. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder-closed.gif +0 -0
  257. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder.gif +0 -0
  258. data/apps/core/components/public/js/jquery/plugins/treeview/images/minus.gif +0 -0
  259. data/apps/core/components/public/js/jquery/plugins/treeview/images/plus.gif +0 -0
  260. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black-line.gif +0 -0
  261. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black.gif +0 -0
  262. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default-line.gif +0 -0
  263. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default.gif +0 -0
  264. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam-line.gif +0 -0
  265. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam.gif +0 -0
  266. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray-line.gif +0 -0
  267. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray.gif +0 -0
  268. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red-line.gif +0 -0
  269. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red.gif +0 -0
  270. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.async.js +110 -0
  271. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.css +74 -0
  272. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.edit.js +37 -0
  273. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.js +256 -0
  274. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.min.js +15 -0
  275. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.pack.js +16 -0
  276. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.sortable.js +386 -0
  277. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.cookie.js +92 -0
  278. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.js +3534 -0
  279. data/apps/core/components/public/js/jquery/plugins/treeview/todo +8 -0
  280. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/LICENSE +0 -0
  281. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/README +0 -0
  282. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.css +34 -0
  283. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.js +1413 -0
  284. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.min.js +10 -0
  285. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/222222_256x240_icons_icons.png +0 -0
  286. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/2e83ff_256x240_icons_icons.png +0 -0
  287. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/454545_256x240_icons_icons.png +0 -0
  288. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/888888_256x240_icons_icons.png +0 -0
  289. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/aaaaaa_40x100_textures_01_flat_0.png +0 -0
  290. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cccccc_40x100_textures_03_highlight_soft_75.png +0 -0
  291. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cd0a0a_256x240_icons_icons.png +0 -0
  292. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/dadada_40x100_textures_02_glass_75.png +0 -0
  293. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
  294. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fbf9ee_40x100_textures_02_glass_55.png +0 -0
  295. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fef1ec_40x100_textures_05_inset_soft_95.png +0 -0
  296. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_65.png +0 -0
  297. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_75.png +0 -0
  298. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.accordion.css +9 -0
  299. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.all.css +4 -0
  300. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.allplugins.css +7 -0
  301. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.core.css +37 -0
  302. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.datepicker.css +60 -0
  303. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.dialog.css +13 -0
  304. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.progressbar.css +4 -0
  305. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.resizable.css +13 -0
  306. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.slider.css +13 -0
  307. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.tabs.css +9 -0
  308. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.theme.css +238 -0
  309. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.timepickr.css +44 -0
  310. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.js +2307 -0
  311. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.min.js +10 -0
  312. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/body-bg.png +0 -0
  313. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn-hover.png +0 -0
  314. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn.png +0 -0
  315. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/buttons.psd +0 -0
  316. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/index.html +326 -0
  317. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.anchorHandler.js +44 -0
  318. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.strings.js +290 -0
  319. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.ui.all.js +518 -0
  320. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.js +255 -0
  321. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.ui.min.js +26 -0
  322. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ff.png +0 -0
  323. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ie.png +0 -0
  324. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.png +0 -0
  325. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.psd +0 -0
  326. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/package.png +0 -0
  327. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/reset.css +48 -0
  328. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/script_code.png +0 -0
  329. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/styles.css +308 -0
  330. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/themeroller_ready_black_200px.gif +0 -0
  331. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/weather_sun.png +0 -0
  332. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.dropslide.css +26 -0
  333. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.timepickr.css +18 -0
  334. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.dropslide.js +132 -0
  335. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.timepickr.js +217 -0
  336. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/data/testrunner.js +1 -0
  337. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/index.html +34 -0
  338. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
  339. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
  340. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testrunner.js +780 -0
  341. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testsuite.css +120 -0
  342. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/styles.css +201 -0
  343. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/test.js +41 -0
  344. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/unit/ui.timepickr.js +154 -0
  345. data/apps/core/components/public/js/list.js +234 -0
  346. data/apps/core/components/public/js/spider.js +484 -0
  347. data/apps/core/components/public/widgets/search_table.js +10 -0
  348. data/apps/core/components/public/widgets/table.js +9 -0
  349. data/apps/core/components/widgets/admin/admin.rb +75 -0
  350. data/apps/core/components/widgets/admin/admin.shtml +16 -0
  351. data/apps/core/components/widgets/confirm/confirm.rb +37 -0
  352. data/apps/core/components/widgets/confirm/confirm.shtml +9 -0
  353. data/apps/core/components/widgets/crud/crud.rb +119 -0
  354. data/apps/core/components/widgets/crud/crud.shtml +59 -0
  355. data/apps/core/components/widgets/crud/form_table/form_table.rb +13 -0
  356. data/apps/core/components/widgets/crud/form_table/form_table.shtml +3 -0
  357. data/apps/core/components/widgets/list/list.rb +294 -0
  358. data/apps/core/components/widgets/list/list.shtml +38 -0
  359. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.rb +19 -0
  360. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.shtml +5 -0
  361. data/apps/core/components/widgets/menu/menu.rb +20 -0
  362. data/apps/core/components/widgets/menu/menu.shtml +13 -0
  363. data/apps/core/components/widgets/search_table/search_table.rb +22 -0
  364. data/apps/core/components/widgets/search_table/search_table.shtml +11 -0
  365. data/apps/core/components/widgets/switcher/switcher.rb +68 -0
  366. data/apps/core/components/widgets/switcher/switcher.shtml +17 -0
  367. data/apps/core/components/widgets/table/table.rb +153 -0
  368. data/apps/core/components/widgets/table/table.shtml +41 -0
  369. data/apps/core/components/widgets/tabs/tabs.rb +38 -0
  370. data/apps/core/components/widgets/tabs/tabs.shtml +2 -0
  371. data/apps/core/forms/_init.rb +22 -0
  372. data/apps/core/forms/po/it/spider_forms.po +36 -0
  373. data/apps/core/forms/po/spider_forms.pot +37 -0
  374. data/apps/core/forms/public/date_time.js +23 -0
  375. data/apps/core/forms/public/form.css +81 -0
  376. data/apps/core/forms/public/form.js +19 -0
  377. data/apps/core/forms/public/input.js +30 -0
  378. data/apps/core/forms/public/search_select.js +123 -0
  379. data/apps/core/forms/public/select.js +11 -0
  380. data/apps/core/forms/tags/element_label.erb +1 -0
  381. data/apps/core/forms/tags/element_row.erb +4 -0
  382. data/apps/core/forms/tags/row.erb +4 -0
  383. data/apps/core/forms/widgets/form/form.rb +430 -0
  384. data/apps/core/forms/widgets/form/form.shtml +47 -0
  385. data/apps/core/forms/widgets/inputs/checkbox/checkbox.rb +13 -0
  386. data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +3 -0
  387. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +48 -0
  388. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +4 -0
  389. data/apps/core/forms/widgets/inputs/hidden/hidden.rb +8 -0
  390. data/apps/core/forms/widgets/inputs/hidden/hidden.shtml +3 -0
  391. data/apps/core/forms/widgets/inputs/input/input.rb +105 -0
  392. data/apps/core/forms/widgets/inputs/input/input.shtml +3 -0
  393. data/apps/core/forms/widgets/inputs/input/readonly.shtml +6 -0
  394. data/apps/core/forms/widgets/inputs/password/password.rb +24 -0
  395. data/apps/core/forms/widgets/inputs/password/password.shtml +5 -0
  396. data/apps/core/forms/widgets/inputs/search_select/search_select.rb +168 -0
  397. data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +42 -0
  398. data/apps/core/forms/widgets/inputs/select/select.rb +126 -0
  399. data/apps/core/forms/widgets/inputs/select/select.shtml +8 -0
  400. data/apps/core/forms/widgets/inputs/subform/subform.rb +10 -0
  401. data/apps/core/forms/widgets/inputs/subform/subform.shtml +5 -0
  402. data/apps/core/forms/widgets/inputs/text/text.rb +9 -0
  403. data/apps/core/forms/widgets/inputs/text/text.shtml +3 -0
  404. data/apps/core/forms/widgets/inputs/text_area/text_area.rb +10 -0
  405. data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +1 -0
  406. data/apps/drb_server/_init.rb +8 -0
  407. data/apps/drb_server/lib/model_server.rb +41 -0
  408. data/apps/drb_server/script/start_server.rb +19 -0
  409. data/apps/hippo/_init.rb +10 -0
  410. data/apps/hippo/models/mixins/hippo_struct.rb +210 -0
  411. data/apps/hippo/models/security_group.rb +21 -0
  412. data/apps/hippo/models/security_user.rb +29 -0
  413. data/apps/messenger/_init.rb +24 -0
  414. data/apps/messenger/config/options.rb +15 -0
  415. data/apps/messenger/config/worker.rb +3 -0
  416. data/apps/messenger/controllers/messenger_controller.rb +80 -0
  417. data/apps/messenger/controllers/mixins/messenger_controller_mixin.rb +54 -0
  418. data/apps/messenger/lib/backends/email/smtp.rb +0 -0
  419. data/apps/messenger/messenger.rb +94 -0
  420. data/apps/messenger/models/email.rb +22 -0
  421. data/apps/messenger/models/message.rb +44 -0
  422. data/apps/messenger/po/it/spider_messenger.po +77 -0
  423. data/apps/messenger/po/spider_messenger.pot +77 -0
  424. data/apps/messenger/views/index.shtml +13 -0
  425. data/apps/messenger/views/list.shtml +5 -0
  426. data/apps/messenger/views/messenger.layout.shtml +4 -0
  427. data/apps/messenger/views/queue.shtml +8 -0
  428. data/apps/messenger/views/tags/sent_messages.shtml +1 -0
  429. data/apps/soap/_init.rb +16 -0
  430. data/apps/soap/controllers/soap_controller.rb +334 -0
  431. data/apps/soap/doc/examples/example.rb +28 -0
  432. data/apps/soap/lib/soap.rb +217 -0
  433. data/apps/sso/_init.rb +16 -0
  434. data/apps/sso/config/options.rb +13 -0
  435. data/apps/sso/controllers/mixins/saml2_mixin.rb +149 -0
  436. data/apps/sso/lib/saml2/backend.rb +16 -0
  437. data/apps/sso/lib/saml2/lasso_backend.rb +88 -0
  438. data/apps/sso/lib/saml2.rb +112 -0
  439. data/apps/sso/views/saml2_post.shtml +19 -0
  440. data/apps/webdav/_init.rb +15 -0
  441. data/apps/webdav/controllers/webdav_controller.rb +862 -0
  442. data/apps/webdav/lib/locking.rb +193 -0
  443. data/apps/webdav/lib/vfs/abstract.rb +78 -0
  444. data/apps/webdav/lib/vfs/local.rb +126 -0
  445. data/apps/webdav/lib/vfs/mapped.rb +235 -0
  446. data/apps/webdav/lib/vfs/properties.rb +41 -0
  447. data/apps/worker/_init.rb +13 -0
  448. data/apps/worker/cmd.rb +65 -0
  449. data/apps/worker/config/options.rb +9 -0
  450. data/apps/worker/lib/runner.rb +43 -0
  451. data/apps/worker/lib/task.rb +9 -0
  452. data/apps/worker/models/job.rb +20 -0
  453. data/apps/worker/worker.rb +168 -0
  454. data/bin/spider +9 -0
  455. data/blueprints/app/_init.rb +10 -0
  456. data/blueprints/app/controllers/__APP___controller.rb +14 -0
  457. data/blueprints/app/views/__APP__.layout.shtml +8 -0
  458. data/blueprints/app/views/index.shtml +3 -0
  459. data/blueprints/install/config/config.yml +14 -0
  460. data/blueprints/install/init.rb +3 -0
  461. data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
  462. data/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
  463. data/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
  464. data/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
  465. data/data/locale/it/LC_MESSAGES/spider_messenger.mo +0 -0
  466. data/lib/spiderfw/app.rb +186 -0
  467. data/lib/spiderfw/autoload.rb +12 -0
  468. data/lib/spiderfw/cache/template_cache.rb +136 -0
  469. data/lib/spiderfw/cmd/cmd.rb +72 -0
  470. data/lib/spiderfw/cmd/commands/cert.rb +427 -0
  471. data/lib/spiderfw/cmd/commands/console.rb +27 -0
  472. data/lib/spiderfw/cmd/commands/init.rb +52 -0
  473. data/lib/spiderfw/cmd/commands/model.rb +131 -0
  474. data/lib/spiderfw/cmd/commands/setup.rb +54 -0
  475. data/lib/spiderfw/cmd/commands/test.rb +61 -0
  476. data/lib/spiderfw/cmd/commands/webserver.rb +93 -0
  477. data/lib/spiderfw/config/configurable.rb +38 -0
  478. data/lib/spiderfw/config/configuration.rb +281 -0
  479. data/lib/spiderfw/config/options/spider.rb +122 -0
  480. data/lib/spiderfw/controller/app_controller.rb +14 -0
  481. data/lib/spiderfw/controller/controller.rb +321 -0
  482. data/lib/spiderfw/controller/controller_exceptions.rb +27 -0
  483. data/lib/spiderfw/controller/controller_io.rb +26 -0
  484. data/lib/spiderfw/controller/controller_mixin.rb +12 -0
  485. data/lib/spiderfw/controller/cookie.rb +20 -0
  486. data/lib/spiderfw/controller/cookies.rb +17 -0
  487. data/lib/spiderfw/controller/dispatcher.rb +269 -0
  488. data/lib/spiderfw/controller/first_responder.rb +59 -0
  489. data/lib/spiderfw/controller/formats/html.rb +90 -0
  490. data/lib/spiderfw/controller/helpers/widget_helper.rb +73 -0
  491. data/lib/spiderfw/controller/home_controller.rb +26 -0
  492. data/lib/spiderfw/controller/http_controller.rb +112 -0
  493. data/lib/spiderfw/controller/mixins/http_mixin.rb +228 -0
  494. data/lib/spiderfw/controller/mixins/static_content.rb +90 -0
  495. data/lib/spiderfw/controller/mixins/visual.rb +489 -0
  496. data/lib/spiderfw/controller/page_controller.rb +39 -0
  497. data/lib/spiderfw/controller/request.rb +48 -0
  498. data/lib/spiderfw/controller/response.rb +50 -0
  499. data/lib/spiderfw/controller/router.rb +9 -0
  500. data/lib/spiderfw/controller/scene.rb +27 -0
  501. data/lib/spiderfw/controller/session/file_session.rb +83 -0
  502. data/lib/spiderfw/controller/session/flash_hash.rb +56 -0
  503. data/lib/spiderfw/controller/session/memory_session.rb +62 -0
  504. data/lib/spiderfw/controller/session/transient_hash.rb +18 -0
  505. data/lib/spiderfw/controller/session.rb +106 -0
  506. data/lib/spiderfw/controller/spider_controller.rb +20 -0
  507. data/lib/spiderfw/create.rb +64 -0
  508. data/lib/spiderfw/env.rb +17 -0
  509. data/lib/spiderfw/exceptions.rb +2 -0
  510. data/lib/spiderfw/home.rb +26 -0
  511. data/lib/spiderfw/http/adapters/cgi.rb +62 -0
  512. data/lib/spiderfw/http/adapters/cgi_io.rb +27 -0
  513. data/lib/spiderfw/http/adapters/fcgi.rb +62 -0
  514. data/lib/spiderfw/http/adapters/mongrel.rb +207 -0
  515. data/lib/spiderfw/http/adapters/rack.rb +152 -0
  516. data/lib/spiderfw/http/adapters/thin.rb +38 -0
  517. data/lib/spiderfw/http/adapters/webrick.rb +176 -0
  518. data/lib/spiderfw/http/http.rb +297 -0
  519. data/lib/spiderfw/http/server.rb +40 -0
  520. data/lib/spiderfw/i18n/cldr.rb +114 -0
  521. data/lib/spiderfw/i18n/gettext.rb +8 -0
  522. data/lib/spiderfw/i18n/i18n.rb +120 -0
  523. data/lib/spiderfw/i18n/provider.rb +12 -0
  524. data/lib/spiderfw/i18n/rails.rb +89 -0
  525. data/lib/spiderfw/i18n/shtml_parser.rb +41 -0
  526. data/lib/spiderfw/model/active_record.rb +335 -0
  527. data/lib/spiderfw/model/base_model.rb +2068 -0
  528. data/lib/spiderfw/model/condition.rb +416 -0
  529. data/lib/spiderfw/model/data_type.rb +75 -0
  530. data/lib/spiderfw/model/datatypes/binary.rb +10 -0
  531. data/lib/spiderfw/model/datatypes/bool.rb +10 -0
  532. data/lib/spiderfw/model/datatypes/decimal.rb +22 -0
  533. data/lib/spiderfw/model/datatypes/email.rb +13 -0
  534. data/lib/spiderfw/model/datatypes/password.rb +63 -0
  535. data/lib/spiderfw/model/datatypes/serialized_object.rb +32 -0
  536. data/lib/spiderfw/model/datatypes/text.rb +10 -0
  537. data/lib/spiderfw/model/datatypes/uuid.rb +29 -0
  538. data/lib/spiderfw/model/datatypes.rb +19 -0
  539. data/lib/spiderfw/model/element.rb +250 -0
  540. data/lib/spiderfw/model/extended_models/managed.rb +43 -0
  541. data/lib/spiderfw/model/identity_mapper.rb +89 -0
  542. data/lib/spiderfw/model/inline_model.rb +37 -0
  543. data/lib/spiderfw/model/mappers/db_mapper.rb +1126 -0
  544. data/lib/spiderfw/model/mappers/hash_mapper.rb +114 -0
  545. data/lib/spiderfw/model/mappers/mapper.rb +926 -0
  546. data/lib/spiderfw/model/mappers/mappers.rb +7 -0
  547. data/lib/spiderfw/model/mappers/proxy_mapper.rb +25 -0
  548. data/lib/spiderfw/model/mappers/vfs/flat_file.rb +31 -0
  549. data/lib/spiderfw/model/mixins/converted.rb +110 -0
  550. data/lib/spiderfw/model/mixins/list.rb +135 -0
  551. data/lib/spiderfw/model/mixins/mixins.rb +7 -0
  552. data/lib/spiderfw/model/mixins/state_machine.rb +81 -0
  553. data/lib/spiderfw/model/mixins/synchronized.rb +88 -0
  554. data/lib/spiderfw/model/mixins/tree.rb +296 -0
  555. data/lib/spiderfw/model/mixins/versioned.rb +147 -0
  556. data/lib/spiderfw/model/model.rb +226 -0
  557. data/lib/spiderfw/model/model_hash.rb +50 -0
  558. data/lib/spiderfw/model/proxy_model.rb +37 -0
  559. data/lib/spiderfw/model/query.rb +147 -0
  560. data/lib/spiderfw/model/query_funcs.rb +99 -0
  561. data/lib/spiderfw/model/query_set.rb +700 -0
  562. data/lib/spiderfw/model/request.rb +80 -0
  563. data/lib/spiderfw/model/storage/base_storage.rb +110 -0
  564. data/lib/spiderfw/model/storage/db/adapters/mssql.rb +129 -0
  565. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +436 -0
  566. data/lib/spiderfw/model/storage/db/adapters/oci8.rb +533 -0
  567. data/lib/spiderfw/model/storage/db/adapters/sqlite.rb +163 -0
  568. data/lib/spiderfw/model/storage/db/connectors/odbc.rb +213 -0
  569. data/lib/spiderfw/model/storage/db/db.rb +13 -0
  570. data/lib/spiderfw/model/storage/db/db_connection_pool.rb +126 -0
  571. data/lib/spiderfw/model/storage/db/db_connector.rb +9 -0
  572. data/lib/spiderfw/model/storage/db/db_schema.rb +233 -0
  573. data/lib/spiderfw/model/storage/db/db_storage.rb +872 -0
  574. data/lib/spiderfw/model/storage/db/dialects/no_total_rows.rb +18 -0
  575. data/lib/spiderfw/model/storage/db/reflector.rb +36 -0
  576. data/lib/spiderfw/model/storage/null_storage.rb +18 -0
  577. data/lib/spiderfw/model/storage/schema.rb +19 -0
  578. data/lib/spiderfw/model/storage.rb +72 -0
  579. data/lib/spiderfw/model/sync.rb +94 -0
  580. data/lib/spiderfw/model/type.rb +13 -0
  581. data/lib/spiderfw/model/unit_of_work.rb +75 -0
  582. data/lib/spiderfw/requires.rb +21 -0
  583. data/lib/spiderfw/resource.rb +18 -0
  584. data/lib/spiderfw/setup/setup_task.rb +44 -0
  585. data/lib/spiderfw/tag/tag.rb +28 -0
  586. data/lib/spiderfw/templates/blocks/attr_if.rb +32 -0
  587. data/lib/spiderfw/templates/blocks/comment.rb +38 -0
  588. data/lib/spiderfw/templates/blocks/debugger.rb +16 -0
  589. data/lib/spiderfw/templates/blocks/each.rb +51 -0
  590. data/lib/spiderfw/templates/blocks/html.rb +70 -0
  591. data/lib/spiderfw/templates/blocks/if.rb +35 -0
  592. data/lib/spiderfw/templates/blocks/pass.rb +16 -0
  593. data/lib/spiderfw/templates/blocks/render.rb +23 -0
  594. data/lib/spiderfw/templates/blocks/run.rb +30 -0
  595. data/lib/spiderfw/templates/blocks/tag.rb +21 -0
  596. data/lib/spiderfw/templates/blocks/tag_if.rb +29 -0
  597. data/lib/spiderfw/templates/blocks/text.rb +43 -0
  598. data/lib/spiderfw/templates/blocks/widget.rb +58 -0
  599. data/lib/spiderfw/templates/blocks/yield.rb +18 -0
  600. data/lib/spiderfw/templates/layout.rb +44 -0
  601. data/lib/spiderfw/templates/resources/less.rb +14 -0
  602. data/lib/spiderfw/templates/template.rb +625 -0
  603. data/lib/spiderfw/templates/template_blocks.rb +185 -0
  604. data/lib/spiderfw/utils/annotations.rb +201 -0
  605. data/lib/spiderfw/utils/fork.rb +75 -0
  606. data/lib/spiderfw/utils/hash_comparison.rb +8 -0
  607. data/lib/spiderfw/utils/inflector.rb +42 -0
  608. data/lib/spiderfw/utils/logger.rb +92 -0
  609. data/lib/spiderfw/utils/monkey/class.rb +59 -0
  610. data/lib/spiderfw/utils/monkey/date_time.rb +34 -0
  611. data/lib/spiderfw/utils/monkey/debugger.rb +25 -0
  612. data/lib/spiderfw/utils/monkey/exception.rb +23 -0
  613. data/lib/spiderfw/utils/monkey/kernel.rb +12 -0
  614. data/lib/spiderfw/utils/monkey/module.rb +12 -0
  615. data/lib/spiderfw/utils/monkey/symbol.rb +7 -0
  616. data/lib/spiderfw/utils/monkey/time.rb +17 -0
  617. data/lib/spiderfw/utils/multi_level_hash.rb +33 -0
  618. data/lib/spiderfw/utils/periodic_runner.rb +50 -0
  619. data/lib/spiderfw/utils/rails.rb +78 -0
  620. data/lib/spiderfw/utils/rails_app.rb +53 -0
  621. data/lib/spiderfw/utils/sanitizer.rb +178 -0
  622. data/lib/spiderfw/utils/setup_task.rb +35 -0
  623. data/lib/spiderfw/utils/shared_store/file_shared_store.rb +73 -0
  624. data/lib/spiderfw/utils/shared_store/memory_shared_store.rb +46 -0
  625. data/lib/spiderfw/utils/shared_store.rb +47 -0
  626. data/lib/spiderfw/utils/test_case.rb +24 -0
  627. data/lib/spiderfw/utils/thread_out.rb +24 -0
  628. data/lib/spiderfw/version.rb +3 -0
  629. data/lib/spiderfw/widget/rest_model.rb +20 -0
  630. data/lib/spiderfw/widget/widget.rb +671 -0
  631. data/lib/spiderfw/widget/widget_attributes.rb +54 -0
  632. data/lib/spiderfw/widget/widget_plugin.rb +37 -0
  633. data/lib/spiderfw.rb +509 -0
  634. data/spider.gemspec +43 -0
  635. data/views/errors/404.shtml +6 -0
  636. data/views/errors/error.layout.shtml +70 -0
  637. data/views/errors/error_generic.shtml +6 -0
  638. metadata +800 -0
@@ -0,0 +1,862 @@
1
+ require 'rexml/document'
2
+ require 'webrick/httputils'
3
+ require 'iconv'
4
+
5
+ module Spider; module WebDAV
6
+
7
+ class WebDAVController < Spider::Controller
8
+ include HTTPMixin
9
+ CRLF = "\r\l"
10
+ PUT_READ_BUFFER = 16384
11
+
12
+ def self.default_action
13
+ ''
14
+ end
15
+
16
+ def init
17
+ @options = {
18
+ :FileSystemCoding => "UTF-8",
19
+ :DefaultClientCoding => "UTF-8",
20
+ :DefaultClientCodingWin => "CP932",
21
+ :DefaultClientCodingMacx => "UTF-8",
22
+ :DefaultClientCodingUnix => "EUC-JP",
23
+ :NotInListName => %w(.*),
24
+ :NondisclosureName => %w(.ht*)
25
+ }
26
+ super
27
+ end
28
+
29
+ def request_uri
30
+ normalize_path(@request.env['PATH_INFO'])
31
+ end
32
+
33
+ def normalize_path(path)
34
+ path.sub!(/http:\/\/[^\/]+\/#{call_path}/, '')
35
+ path = '/'+path unless !path.empty? && path[0].chr == '/'
36
+ path.gsub!(/\/+$/, '') unless path == '/'
37
+ path = Spider::HTTP.urldecode(path)
38
+ end
39
+
40
+ def map_path_to_request(path)
41
+ path.sub!(/^\/+/, '')
42
+ '/'+call_path+'/'+path
43
+ end
44
+
45
+ def vfs
46
+ @vfs ||= init_vfs
47
+ end
48
+
49
+ def init_vfs
50
+ raise NotImplementedError, "The controller must implement its own vfs method, returning a Spider::WebDAV::VFS::Abstract subclass instance"
51
+ end
52
+
53
+ def execute(action='', *arguments)
54
+ path = action
55
+ path += ".#{@request.format}" if @request.format
56
+ path = normalize_path(path)
57
+ Spider.logger.debug("WEBDAV "+ @request.env['REQUEST_METHOD']+" "+path);
58
+ case @request.env['REQUEST_METHOD']
59
+ when 'OPTIONS'
60
+ do_OPTIONS
61
+ when 'GET'
62
+ do_GET(path)
63
+ when 'PUT'
64
+ do_PUT(path)
65
+ when 'PROPFIND'
66
+ do_PROPFIND(path)
67
+ when 'PROPPATCH'
68
+ do_PROPPATCH(path)
69
+ when 'LOCK'
70
+ do_LOCK(path)
71
+ when 'UNLOCK'
72
+ do_UNLOCK(path)
73
+ when 'MKCOL'
74
+ do_MKCOL(path)
75
+ when 'DELETE'
76
+ do_DELETE(path)
77
+ when 'COPY'
78
+ do_COPY(path)
79
+ when 'MOVE'
80
+ do_MOVE(path)
81
+ when 'HEAD'
82
+ do_GET(path, true)
83
+ end
84
+ end
85
+
86
+ def do_OPTIONS
87
+ @response.headers["DAV"] = vfs.locking? ? "2" : "1"
88
+ @response.headers["MS-Author-Via"] = "DAV"
89
+ end
90
+
91
+
92
+ def do_GET(path, just_head=false)
93
+ begin
94
+ properties = vfs.properties(path)
95
+ rescue Errno::ENOENT => e
96
+ raise NotFound.new(path)
97
+ end
98
+ @response.headers['ETag'] = properties.etag
99
+ if (not_modified?(properties.mtime, properties.etag))
100
+ @response.status = Spider::HTTP::NOT_MODIFIED
101
+ elsif (@request.env['RANGE'])
102
+ make_partial_content
103
+ else
104
+ @response.headers['Content-Type'] = properties.content_type
105
+ @response.headers['Content-Length'] = properties.size
106
+ @response.headers['Last-Modified'] = properties.mtime.httpdate
107
+ @response.headers['Content-Disposition'] = "attachment; filename=#{File.basename(path)}"
108
+ unless just_head
109
+ vfs.stream(path, "rb") do |f|
110
+ $out << f.read
111
+ end
112
+ end
113
+ end
114
+ end
115
+
116
+ def do_PUT(path)
117
+ vfs.touch(path)
118
+ check_lock(path)
119
+
120
+ if @request.env['RANGE']
121
+ ranges = WEBrick::HTTPUtils::parse_range_header(@request.env['RANGE']) or
122
+ raise HTTPStatus.BAD_REQUEST,
123
+ "Unrecognized range-spec: \"#{@request.env['RANGE']}\""
124
+ end
125
+
126
+ if !ranges.nil? && ranges.length != 1
127
+ raise HTTPStatus.NOT_IMPLEMENTED
128
+ end
129
+
130
+ begin
131
+ vfs.iostream(path) do |f|
132
+ if ranges
133
+ # TODO: supports multiple range
134
+ #ranges.each do |range|
135
+ # first, last = prepare_range(range, filesize)
136
+ # first + req.content_length != last and
137
+ # raise HTTPStatus.BadRequest
138
+ # f.pos = first
139
+ # req.body {|buf| f << buf }
140
+ #end
141
+ else
142
+ begin
143
+ # body_str = @request.body.read
144
+ # debug("PUT BODY_STR: #{body_str}")
145
+ # f << body_str
146
+ @request.body do |buf|
147
+ f << buf
148
+ end
149
+ end
150
+ end
151
+ end
152
+ rescue Errno::ENOENT
153
+ raise HTTPStatus.CONFLICT
154
+ rescue Errno::ENOSPC
155
+ raise HTTPStatus.WEBDAV_INSUFFICIENT_STORAGE
156
+ end
157
+ end
158
+
159
+ def do_PROPFIND(path)
160
+ depth = @request.env['HTTP_DEPTH']
161
+ debug "propfind requeset for path #{path}, depth=#{depth}"
162
+ depth = (depth.nil? || depth == "infinity") ? nil : depth.to_i
163
+ #raise Forbidden unless depth # deny inifinite propfind
164
+
165
+ begin
166
+ b = @request.read_body
167
+ req_doc = REXML::Document.new b
168
+ rescue REXML::ParseException
169
+ raise HTTPStatus.BAD_REQUEST
170
+ end
171
+ # debug("REQ_DOC:")
172
+ # debug(req_doc)
173
+
174
+ ns = {""=>"DAV:"}
175
+ req_props = []
176
+ all_props = %w(creationdate getlastmodified getetag resourcetype getcontenttype getcontentlength displayname)
177
+
178
+ if vfs.locking?
179
+ all_props += %w(supportedlock lockdiscovery)
180
+ end
181
+
182
+ if @request.read_body.empty? || !REXML::XPath.match(req_doc, "/propfind/allprop", ns).empty?
183
+ req_props = all_props
184
+ elsif !REXML::XPath.match(req_doc, "/propfind/propname", ns).empty?
185
+ # TODO: support propname
186
+ raise HTTPStatus.NOT_IMPLEMENTED
187
+ elsif !REXML::XPath.match(req_doc, "/propfind/prop", ns).empty?
188
+ REXML::XPath.each(req_doc, "/propfind/prop/*", ns){|e|
189
+ req_props << [e.name, e.namespace]
190
+ }
191
+ else
192
+ raise BadRequest
193
+ end
194
+
195
+ propfind_response(path, req_props, depth)
196
+ end
197
+
198
+ def do_PROPPATCH(path)
199
+
200
+ if not vfs.exists?(path)
201
+ raise NotFound.new(path)
202
+ end
203
+
204
+ ret = []
205
+ ns = {""=>"DAV:"}
206
+ begin
207
+ req_doc = REXML::Document.new @request.read_body
208
+ rescue REXML::ParseException
209
+ raise BadRequest
210
+ end
211
+ REXML::XPath.each(req_doc, "/propertyupdate/remove/prop/*", ns){|e|
212
+ ps = REXML::Element.new "D:propstat"
213
+ ps.add_element("D:prop").add_element "D:" + e.name
214
+ ps << elem_status(Spider::HTTP::FORBIDDEN)
215
+ ret << ps
216
+ }
217
+ REXML::XPath.each(req_doc, "/propertyupdate/set/prop/*", ns){|e|
218
+ ps = REXML::Element.new "D:propstat"
219
+ ps.add_element("D:prop").add_element "D:" + e.name
220
+ begin
221
+ e.namespace.nil? || e.namespace == "DAV:" or raise Unsupported
222
+ case e.name
223
+ when "getlastmodified"
224
+ vfs.set_lastmodified(Time.httpdate(e.text), res.filename)
225
+ else
226
+ raise Unsupported
227
+ end
228
+ ps << elem_status(Spider::HTTP::OK)
229
+ rescue Errno::EACCES, ArgumentError
230
+ ps << elem_status(Spider::HTTP::CONFLICT)
231
+ rescue Unsupported
232
+ ps << elem_status(Spider::HTTP::FORBIDDEN)
233
+ rescue
234
+ ps << elem_status(Spider::HTTP::INTERNAL_SERVER_ERROR)
235
+ end
236
+ ret << ps
237
+ }
238
+ @response.headers["Content-Type"] = 'text/xml; charset="utf-8"'
239
+ @response.status = Spider::HTTP::WEBDAV_MULTI_STATUS
240
+ m = build_multistat([[request_uri, *ret]]).to_s
241
+ debug("PROPPATCH RESPONSE: #{m}")
242
+ $out << m
243
+
244
+ end
245
+
246
+ def do_LOCK(path)
247
+ raise HTTPStatus.NOT_IMPLEMENTED unless vfs.locking?
248
+
249
+ body_str = @request.read_body
250
+ debug("LOCK REQUEST:")
251
+ debug(body_str)
252
+ #
253
+ if not vfs.exists?(path)
254
+ #vfs.touch(path)
255
+ #debug("CREATED #{path}")
256
+ raise NotFound.new(vfs.map_path(path))
257
+ end
258
+ begin
259
+ req_doc = REXML::Document.new body_str
260
+ rescue REXML::ParseException
261
+ raise BadRequest
262
+ end
263
+
264
+ if body_str.empty?
265
+ # Could be a lock refresh
266
+ matches = parse_if_header
267
+
268
+ matches.each do |match|
269
+ res = match[0].empty? ? path : match[0]
270
+
271
+ locks = vfs.locked?(res)
272
+ debug "locks:"
273
+ debug locks
274
+ if (locks)
275
+ locks.each do |lock|
276
+ vfs.refresh(lock) if if_match(lock, [res, match[1]])
277
+ end
278
+ end
279
+ end
280
+
281
+ raise HTTPStatus.NO_CONTENT
282
+ else
283
+ ns = {""=>"DAV:"}
284
+ item = REXML::XPath.first(req_doc, "/lockinfo", ns)
285
+ debug("ITEM:")
286
+ debug(item)
287
+
288
+ raise BadRequest unless item
289
+ depth = @request.env['HTTP_DEPTH'] =~ /^infinite$/i ? 'infinite' : 0
290
+ scope = (v = REXML::XPath.first(item, 'lockscope/*', ns)) && v.name
291
+ type = (v = REXML::XPath.first(item, 'locktype/*', ns)) && v.name
292
+ owner = REXML::XPath.first(item, 'owner/*', ns)
293
+ debug("OWNER: #{owner}")
294
+ # owner = REXML::XPath.first(item, 'owner')
295
+ if (owner)
296
+ owner = owner.elements.size > 0 ? owner.elements[1] : owner.text
297
+ else
298
+ owner = ""
299
+ end
300
+ if (request_timeout = @request.env['HTTP_TIMEOUT'])
301
+ timeout_parts = request_timeout.split(/,\s+/)
302
+ timeout = timeout_parts[0]
303
+ end
304
+ debug("TIMEOUT: #{timeout}")
305
+
306
+
307
+ # Try to lock the resource
308
+ lock = vfs.lock(path, :depth => depth, :scope => scope, :type => type, :owner => owner, :uid => @request.user_id)
309
+ lock.timeout = timeout if (lock && timeout)
310
+ debug("CREATED LOCK:")
311
+ debug(lock)
312
+ if not lock
313
+ @response.headers["Content-Type"] = 'text/xml; charset="utf-8"'
314
+ @response.status = Spider::HTTP::WEBDAV_LOCKED
315
+ done
316
+ #
317
+ # @response.status = Spider::HTTP::WEBDAV_MULTI_STATUS
318
+ # m = build_multistat([[request_uri, elem_status(Spider::HTTP::WEBDAV_LOCKED)]]).to_s
319
+ # debug("MULTISTAT: #{m}")
320
+ # $out << m
321
+ # done
322
+ end
323
+
324
+ @response.headers['Lock-Token'] = "<opaquelocktoken:#{lock.token}>" if lock
325
+
326
+ # Respond with propfinding the lockdiscovery property
327
+ # FIXME: cleanup, the code is repeated from propfind_response
328
+ propstat = get_propstat(path, ['lockdiscovery'])
329
+ Spider.logger.debug("--PROPSTAT:")
330
+ Spider.logger.debug(propstat[0].to_s)
331
+ prop = REXML::XPath.first(propstat, 'D:prop')
332
+ prop.attributes['xmlns:D'] = 'DAV:'
333
+ resp = REXML::Document.new << prop
334
+ @response.headers["Content-Type"] = 'text/xml; charset="utf-8"'
335
+ @response.status = Spider::HTTP::OK
336
+ debug("LOCK RESPONSE:")
337
+ debug(resp.to_s)
338
+ $out << resp.to_s
339
+
340
+ end
341
+ end
342
+
343
+ def do_UNLOCK(path)
344
+ raise HTTPStatus.NOT_IMPLEMENTED unless vfs.locking?
345
+
346
+ unless (@request.env['HTTP_LOCK_TOKEN'] =~ /<opaquelocktoken:(.*)>/) || (@request.env['HTTP_LOCK_TOKEN'] =~ /opaquelocktoken:(.*)/)
347
+ raise BadRequest
348
+ end
349
+
350
+ if vfs.unlock(path, $1, @request.user_id)
351
+ raise HTTPStatus.NO_CONTENT
352
+ else
353
+ Spider::Logger.error("UNLOCK OF #{path} FAILED!!!")
354
+ raise Forbidden
355
+ end
356
+ end
357
+
358
+ def do_MKCOL(path)
359
+
360
+ check_lock(path)
361
+
362
+ begin
363
+ vfs.mkdir(path)
364
+ rescue Errno::ENOENT, Errno::EACCES
365
+ raise Forbidden
366
+ rescue Errno::ENOSPC
367
+ raise HTTPStatus.WEBDAV_INSUFFICIENT_STORAGE
368
+ rescue Errno::EEXIST
369
+ raise HTTPStatus.CONFLICT
370
+ end
371
+ raise HTTPStatus.CREATED
372
+ end
373
+
374
+ def do_DELETE(path)
375
+ lock = check_lock(path)
376
+ begin
377
+ vfs.rm(path)
378
+
379
+ vfs.unlock_all(lock.resource) if vfs.locking? and lock
380
+ rescue Errno::EPERM
381
+ raise Forbidden
382
+ end
383
+ raise HTTPStatus.NO_CONTENT
384
+ end
385
+
386
+ def do_COPY(path)
387
+ src, dest, depth, exists_p = cp_mv_precheck(path)
388
+ debug "copy #{src} -> #{dest}"
389
+ begin
390
+ if depth.nil? # infinity
391
+ vfs.cp(src, dest, true)
392
+ elsif depth == 0
393
+ vfs.cp(src, dest, false)
394
+ end
395
+ rescue Errno::ENOENT
396
+ raise HTTPStatus.CONFLICT
397
+ # FIXME: use multi status(?) and check error URL.
398
+ rescue Errno::ENOSPC
399
+ raise HTTPStatus.WEBDAV_INSUFFICIENT_STORAGE
400
+ end
401
+
402
+ raise exists_p ? HTTPStatus.NO_CONTENT : HTTPStatus.CREATED
403
+ end
404
+
405
+ def do_MOVE(path)
406
+ src, dest, depth, exists_p = cp_mv_precheck(path)
407
+
408
+ begin
409
+ vfs.mv(src, dest)
410
+
411
+ lock = check_lock(src)
412
+ vfs.unlock_all(lock.resource) if vfs.locking? and lock
413
+ rescue Errno::ENOENT
414
+ raise HTTPStatus.CONFLICT
415
+ # FIXME: use multi status(?) and check error URL.
416
+ rescue Errno::ENOSPC
417
+ raise HTTPStatus.WEBDAV_INSUFFICIENT_STORAGE
418
+ end
419
+
420
+ raise exists_p ? HTTPStatus.NO_CONTENT : HTTPStatus.CREATED
421
+ end
422
+
423
+ def propfind_response(path, props, depth)
424
+
425
+ if not vfs.exists?(path)
426
+ raise NotFound.new(vfs.map_path(path))
427
+ end
428
+
429
+ ret = get_rec_prop(path, ::WEBrick::HTTPUtils.escape(codeconv_str_fscode2utf(request_uri)), props, *[depth].compact)
430
+ @response.headers["Content-Type"] = 'text/xml; charset="utf-8"'
431
+ @response.status = Spider::HTTP::WEBDAV_MULTI_STATUS
432
+ res = build_multistat(ret).to_s
433
+ debug("PROPFIND RESPONSE:")
434
+ debug(res)
435
+ $out << res
436
+
437
+ end
438
+
439
+ def get_rec_prop(path, r_uri, props, depth = 5000)
440
+ # debugger
441
+ debug "get prop file='#{path}' depth=#{depth}"
442
+ ret_set = []
443
+ depth -= 1
444
+ ret_set << [r_uri, get_propstat(path, props)]
445
+
446
+ return ret_set if !(vfs.directory?(path) && depth >= 0)
447
+
448
+ vfs.ls(path) {|d|
449
+ sub_path = (path == '/' ? '/'+d : "#{path}/#{d}")
450
+ if vfs.directory?(sub_path)
451
+ ret_set += get_rec_prop(sub_path,
452
+ ::WEBrick::HTTPUtils.normalize_path(
453
+ r_uri+::WEBrick::HTTPUtils.escape(
454
+ codeconv_str_fscode2utf("/#{d}/"))),
455
+ props, depth)
456
+ else
457
+ ret_set << [::WEBrick::HTTPUtils.normalize_path(
458
+ r_uri+::WEBrick::HTTPUtils.escape(
459
+ codeconv_str_fscode2utf("/#{d}"))),
460
+ get_propstat(sub_path, props)]
461
+ end
462
+ }
463
+ ret_set
464
+ end
465
+
466
+ def get_propstat(file, props)
467
+ propstats = []
468
+ propstat = REXML::Element.new "D:propstat"
469
+ propstats << propstat
470
+
471
+ errstat = {}
472
+ begin
473
+ st = vfs.properties(file)
474
+ pe = REXML::Element.new "D:prop"
475
+ props.each {|pname, pnamespace|
476
+ namespace_method_prefix = ''
477
+ if (!pnamespace || pnamespace.empty? || pnamespace == 'DAV:')
478
+ namespace_method_prefix = 'dav_'
479
+ elsif (pnamespace =~ /http:\/\/([^\/]+)(\/)?/)
480
+ namespace_method_prefix = $1.gsub('.', '_')+'_'
481
+ end
482
+ begin
483
+ begin
484
+ if respond_to?("get_prop_#{namespace_method_prefix}#{pname}", true)
485
+ prop_el = __send__("get_prop_#{namespace_method_prefix}#{pname}", file, st)
486
+ elsif (st.respond_to?("#{namespace_method_prefix}#{pname}"))
487
+ prop_el = gen_element(["#{pname}", pnamespace], st.send("#{namespace_method_prefix}#{pname}"))
488
+ else
489
+ raise Spider::Controller::NotFound.new(file)
490
+ end
491
+ rescue VFS::PropertyNotFound => e
492
+ raise Spider::Controller::NotFound.new(e.file)
493
+ end
494
+ pe << prop_el if prop_el
495
+ rescue Spider::ControllerMixins::HTTPMixin::HTTPStatus, Spider::Controller::NotFound, Errno::ENOENT => e
496
+ # FIXME: add to errstat
497
+ ps = REXML::Element.new("D:propstat")
498
+ ps << gen_element('D:prop', gen_element("D:#{pname}"))
499
+ if (e.is_a?(Spider::Controller::NotFound) || e.is_a?(Errno::ENOENT))
500
+ ps << elem_status(Spider::HTTP::NOT_FOUND)
501
+ else
502
+ ps << elem_status(e.code, e.status_message)
503
+ end
504
+
505
+ propstats << ps
506
+ end
507
+ }
508
+ propstat.elements << pe
509
+ propstat.elements << elem_status(Spider::HTTP::OK)
510
+ rescue Exception => e
511
+ debug("EXCEPTION!")
512
+ debug(e)
513
+ # debugger
514
+ propstat.elements << elem_status(Spider::HTTP::INTERNAL_SERVER_ERROR)
515
+ end
516
+ Spider.logger.debug("PROPSTATS:")
517
+ Spider.logger.debug(propstats)
518
+ propstats
519
+ end
520
+
521
+ def gen_element(elem, child = nil, attrib = {})
522
+ if (elem.is_a?(Array))
523
+ namespace = elem[1]
524
+ elem = elem[0]
525
+ end
526
+ e = REXML::Element.new(elem)
527
+ e.add_namespace(namespace) if namespace
528
+ if child.is_a?(REXML::Element)
529
+ e << child
530
+ elsif child
531
+ e.text = child.to_s
532
+ end
533
+
534
+ attrib.each {|k, v| e.attributes[k] = v }
535
+ e
536
+ end
537
+
538
+ def elem_status(code, message=nil)
539
+ message ||= Spider::HTTP.status_messages[code]
540
+ gen_element("D:status", "#{@request.env['SERVER_PROTOCOL']} #{code} #{message}")
541
+ end
542
+
543
+ def elem_multistat
544
+ gen_element "D:multistatus", nil, {"xmlns:D" => "DAV:"}
545
+ end
546
+
547
+ def build_multistat(rs)
548
+ m = elem_multistat
549
+ rs.each {|href, *cont|
550
+ res = m.add_element "D:response"
551
+ res.add_element("D:href").text = href
552
+ cont.flatten.each {|c| res.elements << c}
553
+ }
554
+ REXML::Document.new << m
555
+ end
556
+
557
+
558
+ def get_prop_dav_displayname(file, props)
559
+ gen_element "D:displayname", props.displayname
560
+ end
561
+
562
+ def get_prop_dav_creationdate(file, props)
563
+ cd = props.ctime ? props.ctime.xmlschema : (Time.now).xmlschema
564
+ gen_element "D:creationdate", cd
565
+ end
566
+
567
+ def get_prop_dav_getlastmodified(file, props)
568
+ mtime = props.mtime || Time.now
569
+ if @request.env['HTTP_USER_AGENT'] and @request.env['HTTP_USER_AGENT'] =~ /gvfs/
570
+ d = mtime.xmlschema
571
+ else
572
+ d = mtime.httpdate
573
+ end
574
+
575
+ gen_element "D:getlastmodified", d
576
+ end
577
+ def get_prop_dav_getetag(file, props)
578
+ gen_element "D:getetag", props.etag
579
+ end
580
+
581
+ def get_prop_dav_resourcetype(file, props)
582
+ t = gen_element "D:resourcetype"
583
+ vfs.directory?(file) and t.add_element("D:collection")
584
+ t
585
+ end
586
+
587
+ def get_prop_dav_getcontenttype(file, props)
588
+ gen_element("D:getcontenttype", props.content_type)
589
+ end
590
+
591
+ def get_prop_dav_getcontentlength(file, props)
592
+ gen_element "D:getcontentlength", props.size
593
+ end
594
+
595
+ def get_prop_dav_lockdiscovery(file, props)
596
+ raise NotFound.new(file) unless vfs.locking?
597
+ locks = vfs.locked?(file)
598
+ return nil unless locks
599
+
600
+ discovery = REXML::Element.new('D:lockdiscovery')
601
+
602
+ locks.each do |lock|
603
+ e = lock_entry('activelock', lock.scope, lock.type)
604
+ e << gen_element('D:depth', lock.depth)
605
+
606
+ if lock.owner
607
+ owner = REXML::Element.new('D:owner')
608
+ if (lock.owner.is_a?(String))
609
+ owner.text = lock.owner
610
+ else
611
+ owner << lock.owner
612
+ end
613
+
614
+ e << owner
615
+ end
616
+
617
+ if lock.timeout
618
+ e << gen_element('D:timeout', lock.timeout)
619
+ end
620
+
621
+ token = REXML::Element.new('D:locktoken')
622
+ token << gen_element('D:href', "opaquelocktoken:#{lock.token}")
623
+
624
+ e << token
625
+
626
+ discovery << e
627
+ end
628
+
629
+ discovery
630
+ end
631
+
632
+ def get_prop_dav_supportedlock(file, props)
633
+ e = REXML::Element.new('D:supportedlock')
634
+ e << lock_entry('lockentry', 'exclusive', 'write')
635
+ e << lock_entry('lockentry', 'shared', 'write')
636
+
637
+ e
638
+ end
639
+
640
+ def lock_entry(name, scope, type)
641
+ entry = REXML::Element.new("D:#{name}")
642
+
643
+ entry << gen_element('D:lockscope', scope ? gen_element("D:#{scope}") : nil)
644
+ entry << gen_element('D:locktype', type ? gen_element("D:#{type}") : nil)
645
+
646
+ entry
647
+ end
648
+
649
+ def not_modified?(mtime, etag)
650
+ if ir = @request.env['IF_RANGE']
651
+ begin
652
+ if Time.httpdate(ir) >= mtime
653
+ return true
654
+ end
655
+ rescue
656
+ if ::WEBrick::HTTPUtils::split_header_value(ir).member?(etag)
657
+ return true
658
+ end
659
+ end
660
+ end
661
+
662
+ if (ims = @request.env['IF_MODIFIED_SINCE']) && Time.parse(ims) >= mtime
663
+ return true
664
+ end
665
+
666
+ if (inm = @request.env['IF_NONE_MATCH']) &&
667
+ ::WEBrick::HTTPUtils::split_header_value(inm).member?(etag)
668
+ return true
669
+ end
670
+
671
+ return false
672
+ end
673
+
674
+ def make_partial_content(path, properties)
675
+ unless ranges = ::WEBrick::HTTPUtils::parse_range_header(@request.env['RANGE'])
676
+ @response.status = Spider::HTTP::BAD_REQUEST
677
+ done
678
+ end
679
+ vfs.stream(path, "rb") do |io|
680
+ if ranges.size > 1
681
+ have_range = false
682
+ time = Time.now
683
+ boundary = "#{time.sec}_#{time.usec}_#{Process::pid}"
684
+ @response.headers['Content-Type'] = "multipart/byteranges; boundary=#{boundary}"
685
+ ranges.each do |range|
686
+ first, last = prepare_range(range, properties.size)
687
+ next if first < 0
688
+
689
+ io.pos = first
690
+ content = io.read(last - first + 1)
691
+ have_range = true
692
+
693
+ $out << "--" << boundary << CRLF
694
+ $out << "Content-Type: #{mtype}" << CRLF
695
+ $out << "Content-Range: #{first}-#{last}/#{filesize}" << CRLF
696
+ $out << CRLF
697
+ $out << content
698
+ $out << CRLF
699
+ end
700
+
701
+ unless have_range
702
+ @response.headers.delete('Content-Type')
703
+ @response.status = Spider::HTTP::REQUESTED_RANGE_NOT_SATISFIABLE
704
+ done
705
+ end
706
+ $out << "--" << boundary << "--" << CRLF
707
+
708
+ elsif range = ranges[0]
709
+ if filesize == 0 and range.first == 0 and range.last == -1 then
710
+ first, last = 0, 0
711
+ else
712
+ first, last = prepare_range(range, properties.size)
713
+ end
714
+
715
+ if first < 0
716
+ @response.status = Spider::HTTP::REQUESTED_RANGE_NOT_SATISFIABLE
717
+ done
718
+ end
719
+
720
+ if filesize != 0
721
+ if last == properties.size - 1
722
+ d = io.dup
723
+ d.pos = first
724
+
725
+ content = d.read
726
+ else
727
+ io.pos = first
728
+ content = io.read(last - first + 1)
729
+ end
730
+ end
731
+
732
+ @response.headers['Content-Type'] = properties.content_type
733
+ @response.headers['Content-Range'] = "#{first}-#{last}/#{filesize}"
734
+ @response.headers['Content-Length'] = properties.size == 0 ? 0 : last - first + 1
735
+ $out << content
736
+ else
737
+ @response.status = Spider::HTTP::BAD_REQUEST
738
+ done
739
+ end
740
+ end
741
+ end
742
+
743
+ def prepare_range(range, filesize)
744
+ first = range.first < 0 ? filesize + range.first : range.first
745
+
746
+ return -1, -1 if first < 0 || first >= filesize
747
+
748
+ last = range.last < 0 ? filesize + range.last : range.last
749
+ last = filesize - 1 if last >= filesize
750
+
751
+ return first, last
752
+ end
753
+
754
+ def check_lock(path)
755
+ return nil unless vfs.locking?
756
+
757
+ # Get locks on this resource
758
+ locks = vfs.locked?(path)
759
+
760
+ return nil unless locks && !locks.empty?
761
+
762
+ # Check if the current user is the owner of one of the locks
763
+ matches = parse_if_header
764
+
765
+ locks.each do |lock|
766
+ matches.each do |match|
767
+ return lock if if_match(lock, match)
768
+ end
769
+ end
770
+
771
+ raise HTTPStatus.WEBDAV_LOCKED
772
+ end
773
+
774
+ def parse_if_header
775
+ return [] unless @request.env['HTTP_IF']
776
+
777
+ matches = []
778
+ token = '<[^>]*>'
779
+ @request.env['HTTP_IF'].scan(/(#{token})?(\s*\(((#{token})|\[([^\]]*)\]\s*)+\))+/) do |resource, lst, token|
780
+ if resource
781
+ resource = normalize_path(resource.gsub(/(<|>)/, ''))
782
+ else
783
+ resource = request_uri
784
+ end
785
+
786
+ matches << [resource, token.gsub(/(<|>)/, '').gsub(/^opaquelocktoken:/, '')]
787
+ end
788
+
789
+ matches
790
+ end
791
+
792
+ def if_match(lock, match)
793
+ # debug("IF MATCH:")
794
+ # debug(lock)
795
+ # debug(match)
796
+ # debug("CONFRONTO #{lock.resource}, #{match[0]}")
797
+ # debug("TOKEN NON CORRISPONDENTE #{lock.token}, #{match[1]}") unless lock.token == match[1]
798
+ return false unless lock.token == match[1]
799
+ # debug("UID NON CORRISPONDENTE #{lock.uid}, #{@request.user_id}") unless lock.uid == @request.user_id
800
+ return false unless lock.uid == @request.user_id
801
+ # debug("#resource non corrispondente #{lock.resource}, #{match[0]}") if not match[0].empty? and lock.resource != match[0]
802
+ return false if not match[0].empty? and lock.resource != match[0]
803
+ true
804
+ end
805
+
806
+ def codeconv_str_fscode2utf(str)
807
+ return str if @options[:FileSystemCoding] == "UTF-8"
808
+ debug "codeconv str fscode2utf: orig='#{str}'"
809
+ begin
810
+ ret = Iconv.iconv("UTF-8", @options[:FileSystemCoding], str).first
811
+ rescue Iconv::IllegalSequence
812
+ warn "code conversion fail! #{@options[:FileSystemCoding]}->UTF-8 str=#{str.dump}"
813
+ ret = str
814
+ end
815
+ debug "codeconv str fscode2utf: ret='#{ret}'"
816
+ ret
817
+ end
818
+
819
+ def cp_mv_precheck(path)
820
+ depth = @request.env['HTTP_DEPTH']
821
+ depth = (depth.nil? || depth == "infinity") ? nil : depth.to_i
822
+ depth.nil? || depth == 0 or raise BadRequest
823
+ debug "copy/move requested. Destination=#{@request.env['HTTP_DESTINATION']}"
824
+ dest_uri = URI.parse(@request.env['HTTP_DESTINATION'])
825
+ # unless "#{@request.env['HTTP_HOST']}" == "#{dest_uri.host}:#{dest_uri.port}"
826
+ # raise HTTPStatus.BAD_GATEWAY
827
+ # # TODO: anyone needs to copy other server?
828
+ # end
829
+ src = path
830
+ dest = normalize_path(@request.env['HTTP_DESTINATION'])
831
+
832
+ src == dest and raise Forbidden
833
+
834
+ if @request.env['REQUEST_METHOD'] == 'MOVE'
835
+ # MOVE - check lock on source
836
+ check_lock(src)
837
+ end
838
+
839
+ check_lock(dest)
840
+
841
+ exists_p = false
842
+ if vfs.exists?(dest)
843
+ exists_p = true
844
+ if @request.env["HTTP_OVERWRITE"] == "T"
845
+ debug "copy/move precheck: Overwrite flag=T, deleting #{dest}"
846
+ vfs.rm(dest)
847
+ else
848
+ raise HTTPStatus.PRECONDITION_FAILED
849
+ end
850
+ end
851
+
852
+ return *[src, dest, depth, exists_p]
853
+ end
854
+
855
+
856
+ end
857
+
858
+ class Unsupported < RuntimeError
859
+ end
860
+
861
+
862
+ end; end