Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release 3.6

  • Loading branch information...
commit 882e2039288099d4ff7644e39007e435797f722f 0 parents
@hsleisink authored
Showing with 28,731 additions and 0 deletions.
  1. +363 −0 ChangeLog
  2. +35 −0 INSTALL
  3. +29 −0 LICENSE
  4. +185 −0 add_module
  5. +85 −0 controllers/admin.php
  6. +64 −0 controllers/admin/access.php
  7. +55 −0 controllers/admin/action.php
  8. +95 −0 controllers/admin/agenda.php
  9. +12 −0 controllers/admin/albums.php
  10. +99 −0 controllers/admin/collection.php
  11. +96 −0 controllers/admin/dictionary.php
  12. +119 −0 controllers/admin/faq.php
  13. +83 −0 controllers/admin/file.php
  14. +86 −0 controllers/admin/forum.php
  15. +39 −0 controllers/admin/guestbook.php
  16. +19 −0 controllers/admin/languages.php
  17. +8 −0 controllers/admin/links.php
  18. +111 −0 controllers/admin/logging.php
  19. +76 −0 controllers/admin/menu.php
  20. +8 −0 controllers/admin/news.php
  21. +42 −0 controllers/admin/newsletter.php
  22. +22 −0 controllers/admin/organisation.php
  23. +158 −0 controllers/admin/page.php
  24. +85 −0 controllers/admin/photos.php
  25. +122 −0 controllers/admin/poll.php
  26. +138 −0 controllers/admin/role.php
  27. +12 −0 controllers/admin/settings.php
  28. +8 −0 controllers/admin/subscriptions.php
  29. +36 −0 controllers/admin/switch.php
  30. +206 −0 controllers/admin/user.php
  31. +158 −0 controllers/admin/weblog.php
  32. +161 −0 controllers/agenda.php
  33. +16 −0 controllers/captcha.php
  34. +45 −0 controllers/collection.php
  35. +31 −0 controllers/contact.php
  36. +38 −0 controllers/demos/ajax.php
  37. +16 −0 controllers/demos/alphabetize.php
  38. +28 −0 controllers/demos/banshee_website.php
  39. +21 −0 controllers/demos/calendar.php
  40. +11 −0 controllers/demos/captcha.php
  41. +19 −0 controllers/demos/ckeditor.php
  42. +11 −0 controllers/demos/errors.php
  43. +54 −0 controllers/demos/googlemaps.php
  44. +23 −0 controllers/demos/layout.php
  45. +29 −0 controllers/demos/openstreetmap.php
  46. +23 −0 controllers/demos/pagination.php
  47. +9 −0 controllers/demos/parameter.php
  48. +19 −0 controllers/demos/pdf.php
  49. +15 −0 controllers/demos/poll.php
  50. +23 −0 controllers/demos/posting.php
  51. +11 −0 controllers/demos/readonly.php
  52. +19 −0 controllers/demos/splitform.php
  53. +8 −0 controllers/demos/system_message.php
  54. +9 −0 controllers/demos/tablemanager.php
  55. +31 −0 controllers/demos/validation.php
  56. +64 −0 controllers/dictionary.php
  57. +45 −0 controllers/faq.php
  58. +172 −0 controllers/forum.php
  59. +52 −0 controllers/guestbook.php
  60. +17 −0 controllers/links.php
  61. +39 −0 controllers/login.php
  62. +19 −0 controllers/logout.php
  63. +110 −0 controllers/mailbox.php
  64. +62 −0 controllers/news.php
  65. +64 −0 controllers/newsletter.php
  66. +55 −0 controllers/password.php
  67. +106 −0 controllers/photo.php
  68. +54 −0 controllers/poll.php
  69. +48 −0 controllers/profile.php
  70. +28 −0 controllers/search.php
  71. +71 −0 controllers/session.php
  72. +32 −0 controllers/sitemap.php
  73. +10 −0 controllers/system/error.php
  74. +42 −0 controllers/system/page.php
  75. +89 −0 controllers/system/sso.php
  76. +229 −0 controllers/weblog.php
  77. +14 −0 database/backup_database
  78. +13 −0 database/flush_cache
  79. +1,051 −0 database/mysql.sql
  80. +80 −0 database/private_pages
  81. +83 −0 database/remove_demo_content
  82. +92 −0 database/setup_database
  83. +8 −0 extra/account_created.txt
  84. +8 −0 extra/account_updated.txt
  85. BIN  extra/captcha_font.ttf
  86. +8 −0 extra/fpdf_fonts/courier.php
  87. +8 −0 extra/fpdf_fonts/courierb.php
  88. +8 −0 extra/fpdf_fonts/courierbi.php
  89. +8 −0 extra/fpdf_fonts/courieri.php
  90. +19 −0 extra/fpdf_fonts/helvetica.php
  91. +19 −0 extra/fpdf_fonts/helveticab.php
  92. +19 −0 extra/fpdf_fonts/helveticabi.php
  93. +19 −0 extra/fpdf_fonts/helveticai.php
  94. +251 −0 extra/fpdf_fonts/makefont/cp1250.map
  95. +255 −0 extra/fpdf_fonts/makefont/cp1251.map
  96. +251 −0 extra/fpdf_fonts/makefont/cp1252.map
  97. +239 −0 extra/fpdf_fonts/makefont/cp1253.map
  98. +249 −0 extra/fpdf_fonts/makefont/cp1254.map
  99. +233 −0 extra/fpdf_fonts/makefont/cp1255.map
  100. +244 −0 extra/fpdf_fonts/makefont/cp1257.map
  101. +247 −0 extra/fpdf_fonts/makefont/cp1258.map
  102. +225 −0 extra/fpdf_fonts/makefont/cp874.map
  103. +256 −0 extra/fpdf_fonts/makefont/iso-8859-1.map
  104. +248 −0 extra/fpdf_fonts/makefont/iso-8859-11.map
  105. +256 −0 extra/fpdf_fonts/makefont/iso-8859-15.map
  106. +256 −0 extra/fpdf_fonts/makefont/iso-8859-16.map
  107. +256 −0 extra/fpdf_fonts/makefont/iso-8859-2.map
  108. +256 −0 extra/fpdf_fonts/makefont/iso-8859-4.map
  109. +256 −0 extra/fpdf_fonts/makefont/iso-8859-5.map
  110. +250 −0 extra/fpdf_fonts/makefont/iso-8859-7.map
  111. +256 −0 extra/fpdf_fonts/makefont/iso-8859-9.map
  112. +256 −0 extra/fpdf_fonts/makefont/koi8-r.map
  113. +256 −0 extra/fpdf_fonts/makefont/koi8-u.map
  114. +373 −0 extra/fpdf_fonts/makefont/makefont.php
  115. +289 −0 extra/fpdf_fonts/makefont/ttfparser.php
  116. +19 −0 extra/fpdf_fonts/symbol.php
  117. +19 −0 extra/fpdf_fonts/times.php
  118. +19 −0 extra/fpdf_fonts/timesb.php
  119. +19 −0 extra/fpdf_fonts/timesbi.php
  120. +19 −0 extra/fpdf_fonts/timesi.php
  121. +19 −0 extra/fpdf_fonts/zapfdingbats.php
  122. +11 −0 extra/newsletter.txt
  123. +8 −0 extra/reset_password.txt
  124. +120 −0 helpers/anti_spam.php
  125. +76 −0 helpers/bbcodes.php
  126. +14 −0 helpers/console.php
  127. +99 −0 helpers/crypto.php
  128. +52 −0 helpers/csv.php
  129. +36 −0 helpers/http.php
  130. +16 −0 helpers/ics.php
  131. +99 −0 helpers/output.php
  132. +33 −0 helpers/smilies.php
  133. +130 −0 libraries/alphabetize.php
  134. +90 −0 libraries/apns.php
  135. +348 −0 libraries/banshee.php
  136. +154 −0 libraries/banshee_website.php
  137. +137 −0 libraries/cache.php
  138. +136 −0 libraries/captcha.php
  139. +54 −0 libraries/controller.php
  140. +497 −0 libraries/database/database_connection.php
  141. +32 −0 libraries/database/mssql_connection.php
  142. +36 −0 libraries/database/mysql_connection.php
  143. +25 −0 libraries/database/mysql_pdo_connection.php
  144. +39 −0 libraries/database/mysqli_connection.php
  145. +170 −0 libraries/database/pdo_connection.php
  146. +31 −0 libraries/database/postgresql_connection.php
  147. +60 −0 libraries/database/sqlite3_connection.php
  148. +40 −0 libraries/database/sqlite_connection.php
  149. +397 −0 libraries/email.php
  150. +111 −0 libraries/error.php
  151. +1,616 −0 libraries/fpdf.php
  152. +239 −0 libraries/googlemaps.php
  153. +262 −0 libraries/http.php
  154. +203 −0 libraries/image.php
  155. +121 −0 libraries/language.php
  156. +225 −0 libraries/logging.php
  157. +106 −0 libraries/menu.php
  158. +32 −0 libraries/model.php
  159. +56 −0 libraries/newsletter.php
  160. +289 −0 libraries/openstreetmap.php
  161. +461 −0 libraries/output.php
  162. +244 −0 libraries/page.php
  163. +148 −0 libraries/pagination.php
  164. +171 −0 libraries/poll.php
  165. +222 −0 libraries/pop3.php
  166. +164 −0 libraries/post_data.php
  167. +120 −0 libraries/rss.php
  168. +76 −0 libraries/secure_cookie.php
  169. +381 −0 libraries/security.php
  170. +216 −0 libraries/session.php
  171. +158 −0 libraries/settings.php
  172. +127 −0 libraries/splitform_controller.php
  173. +161 −0 libraries/splitform_model.php
  174. +345 −0 libraries/tablemanager_controller.php
  175. +389 −0 libraries/tablemanager_model.php
  176. +313 −0 libraries/user.php
  177. +355 −0 libraries/xml.php
  178. +183 −0 libraries/zipfile.php
  179. 0  logfiles/access.log
  180. 0  logfiles/actions.log
  181. 0  logfiles/database.log
  182. 0  logfiles/debug.log
  183. 0  logfiles/error.log
  184. 0  logfiles/poll.log
  185. 0  logfiles/search.log
  186. 0  logfiles/spam.log
  187. +11 −0 logfiles/spammers
  188. +63 −0 models/admin/access.php
  189. +48 −0 models/admin/action.php
  190. +99 −0 models/admin/agenda.php
  191. +58 −0 models/admin/albums.php
  192. +112 −0 models/admin/collection.php
  193. +59 −0 models/admin/dictionary.php
  194. +149 −0 models/admin/faq.php
  195. +129 −0 models/admin/file.php
  196. +72 −0 models/admin/forum.php
  197. +24 −0 models/admin/guestbook.php
  198. +68 −0 models/admin/languages.php
  199. +17 −0 models/admin/links.php
  200. +149 −0 models/admin/logging.php
  201. +101 −0 models/admin/menu.php
  202. +26 −0 models/admin/news.php
  203. +50 −0 models/admin/newsletter.php
  204. +38 −0 models/admin/organisation.php
  205. +201 −0 models/admin/page.php
  206. +246 −0 models/admin/photos.php
  207. +164 −0 models/admin/poll.php
  208. +135 −0 models/admin/role.php
  209. +136 −0 models/admin/settings.php
  210. +12 −0 models/admin/subscriptions.php
  211. +13 −0 models/admin/switch.php
  212. +378 −0 models/admin/user.php
  213. +196 −0 models/admin/weblog.php
  214. +54 −0 models/agenda.php
  215. +40 −0 models/collection.php
  216. +37 −0 models/contact.php
  217. +24 −0 models/demos/alphabetize.php
  218. +2 −0  models/demos/googlemap.php
  219. +21 −0 models/demos/layout.php
  220. +4 −0 models/demos/openstreetmap.php
  221. +5 −0 models/demos/posting.php
  222. +26 −0 models/demos/splitform.php
  223. +43 −0 models/demos/tablemanager.php
  224. +19 −0 models/dictionary.php
  225. +17 −0 models/faq.php
  226. +213 −0 models/forum.php
  227. +82 −0 models/guestbook.php
  228. +9 −0 models/links.php
  229. +70 −0 models/login.php
  230. +102 −0 models/mailbox.php
  231. +24 −0 models/news.php
  232. +95 −0 models/newsletter.php
  233. +56 −0 models/password.php
  234. +60 −0 models/photo.php
  235. +38 −0 models/poll.php
  236. +57 −0 models/profile.php
  237. +33 −0 models/session.php
  238. +24 −0 models/sitemap.php
  239. +14 −0 models/system/page.php
  240. +11 −0 models/system/sso.php
  241. +199 −0 models/weblog.php
  242. +6 −0 public/.htaccess
  243. +53 −0 public/css/admin.css
  244. +18 −0 public/css/admin/access.css
  245. +17 −0 public/css/admin/action.css
  246. +51 −0 public/css/admin/agenda.css
  247. +3 −0  public/css/admin/albums.css
  248. +22 −0 public/css/admin/collection.css
  249. +27 −0 public/css/admin/dictionary.css
  250. +24 −0 public/css/admin/faq.css
  251. +33 −0 public/css/admin/file.css
  252. +44 −0 public/css/admin/forum.css
  253. +19 −0 public/css/admin/guestbook.css
  254. +7 −0 public/css/admin/languages.css
  255. +3 −0  public/css/admin/links.css
  256. +114 −0 public/css/admin/logging.css
  257. +38 −0 public/css/admin/menu.css
  258. +38 −0 public/css/admin/news.css
  259. +12 −0 public/css/admin/newsletter.css
  260. +14 −0 public/css/admin/organisation.css
  261. +49 −0 public/css/admin/page.css
  262. +17 −0 public/css/admin/photos.css
  263. +42 −0 public/css/admin/poll.css
  264. +55 −0 public/css/admin/role.css
  265. +20 −0 public/css/admin/settings.css
  266. +3 −0  public/css/admin/subscriptions.css
  267. +18 −0 public/css/admin/switch.css
  268. +39 −0 public/css/admin/user.css
  269. +49 −0 public/css/admin/weblog.css
  270. +82 −0 public/css/agenda.css
  271. +17 −0 public/css/collection.css
  272. +13 −0 public/css/contact.css
  273. +3 −0  public/css/demos/ajax.css
  274. +4 −0 public/css/demos/alphabetize.css
  275. +1 −0  public/css/demos/calendar.css
  276. +3 −0  public/css/demos/ckeditor.css
  277. +22 −0 public/css/demos/googlemaps.css
  278. +4 −0 public/css/demos/layout.css
  279. +22 −0 public/css/demos/openstreetmap.css
  280. +3 −0  public/css/demos/pagination.css
  281. +3 −0  public/css/demos/poll.css
  282. +17 −0 public/css/demos/posting.css
  283. 0  public/css/demos/readonly.css
  284. +11 −0 public/css/demos/splitform.css
  285. +15 −0 public/css/demos/tablemanager.css
  286. +7 −0 public/css/demos/validation.css
  287. +29 −0 public/css/dictionary.css
  288. +13 −0 public/css/faq.css
  289. +137 −0 public/css/forum.css
  290. +42 −0 public/css/guestbook.css
  291. +18 −0 public/css/includes/alphabetize.css
  292. +121 −0 public/css/includes/banshee.css
  293. +251 −0 public/css/includes/calendar.css
  294. +154 −0 public/css/includes/layout_compromise.css
  295. +190 −0 public/css/includes/layout_pluralism.css
  296. +18 −0 public/css/includes/pagination.css
  297. +34 −0 public/css/includes/poll.css
  298. +83 −0 public/css/includes/slimbox2.css
  299. +19 −0 public/css/includes/splitform.css
  300. +32 −0 public/css/includes/tablemanager.css
Sorry, we could not display the entire diff because too many files (890) changed.
363 ChangeLog
@@ -0,0 +1,363 @@
+banshee (3.6) stable; urgency=low
+
+ * Removed SlimStat because there is no active development and Piwik
+ is much better. Simple log statistics module added.
+ * Mailbox module added.
+ * Added system warnings.
+ * Optional read-only access rights for modules.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Wed, 5 Sep 2012 18:31:02 +0200
+
+banshee (3.5) stable; urgency=low
+
+ * Photos are stored on disk instead of in database.
+ * Default password hash function changed from MD5 to SHA256.
+ * Several improvements and small bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 5 Jul 2012 22:11:43 +0200
+
+banshee (3.4) stable; urgency=low
+
+ * SlimStat better integrated in Banshee.
+ * Improved remove_module script.
+ * Improved security for password storage.
+ * Improved e-mail library.
+ * Notification e-mails for account creation or change.
+ * OpenStreetMap static map library added.
+ * Sitemap.xml module added.
+ * Updated FPDF to 1.7.
+ * Small improvements.
+ * Bugfix: SSO was broken due to code changes at other places.
+ * Bugfix: old way of object calling in poll, newsletter and
+ switch administration page.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 8 Mar 2012 19:45:59 +0100
+
+banshee (3.3) stable; urgency=low
+
+ * Layout added to pages in database.
+ * Alphabetize library added.
+ * Alphabetizing added to tablemanager library.
+ * Secure cookie library added.
+ * Input validation library added.
+ * Replaced Lightbox with Slimbox2.
+ * Photo album collection module added.
+ * Small bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Sat, 8 Oct 2011 08:04:21 +0200
+
+banshee (3.2) stable; urgency=low
+
+ * Multiple read-to-use layouts available via separate theme package.
+ * Usage of ncurses removed from console scripts.
+ * jQuery updated to 1.6 and jQuery UI updated to 1.8.12.
+ * Improved SQLite driver.
+ * Bugfix: bug in resize function in image library.
+
+ -- Hugo Leisink <hugo@leisink.net> Mon, 9 May 2011 19:17:06 +0200
+
+banshee (3.1) stable; urgency=medium
+
+ * Posts by unregistered users in forum.
+ * jQuery updated to 1.5.1.
+ * Improved session library.
+ * Helpers introduced.
+ * Small improvements and bugfixes.
+ * Script to create new modules added.
+ * Bugfix: non-admins were not able to create weblogs.
+ * Bugfix: password reset form accepted empty password.
+
+ -- Hugo Leisink <hugo@leisink.net> Mon, 28 Mar 2011 18:46:29 +0200
+
+banshee (3.0) stable; urgency=low
+
+ * License changed. See LICENSE for the current version.
+ * Single Sign-On functionality added.
+ * Website errors included in view.
+ * System message functionality added.
+ * Improved JSON output.
+ * CKEditor updated to version 3.5.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 6 Jan 2011 10:32:10 +0100
+
+banshee (2.6) stable; urgency=low
+
+ * Session library added for improved session handling.
+ * Session Manager module added.
+ * Separate file for settings class. Other stuff moved to
+ libraries/configuration.php
+ * Error handling functions moved from libraries/output.php to
+ libraries/error.php.
+ * Chunked content encoding support added to HTTP library.
+ * JSON output type added.
+ * Small improvements and bugfixes.
+ * Bugfix: small issues in splitform library.
+
+ -- Hugo Leisink <hugo@leisink.net> Sun, 28 Nov 2010 22:31:42 +0100
+
+banshee (2.5) stable; urgency=low
+
+ * CKEditor updated to version 3.4.1.
+ * Sections added to cache library.
+ * Replaced Google Analytics with SlimStat.
+ * Small bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 11 Nov 2010 12:81:43 +0100
+
+banshee (2.4) stable; urgency=low
+
+ * Photo album module added.
+ * Library for communication with other Banshee-based websites added.
+ * RSS library added and used in news and weblog module.
+ * Pagination added to forum module.
+ * Improved multilingual and UTF-8 support.
+ * Small improvements and bugfixes.
+ * Bugfix: boolean value not remembered on form error in tablemanager.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 16 Sep 2010 16:39:34 +0200
+
+banshee (2.3) stable; urgency=low
+
+ * Cache library added and used in XML library.
+ * GoogleMaps static map library added.
+ * Improved HTTP library.
+ * Settings in database.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Wed, 11 Aug 2010 23:17:28 +0200
+
+banshee (2.2) stable; urgency=low
+
+ * Organisation administration module added.
+ * Flags 'unique' and 'readonly' and field type 'ckeditor' added to
+ tablemanager library.
+ * FPDF library added.
+ * Apple Push Notification Service library added.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Wed, 14 Jul 2010 22:26:28 +0200
+
+banshee (2.1) stable; urgency=low
+
+ * Controller execute function called with URL parameters.
+ * URL parameter property added to page class.
+ * Splitform and tablemanager libraries improved and divided over controller
+ and model class.
+ * Directory support in file administration.
+ * Improved AJAX javascript library.
+ * Visible flag on weblog articles.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Tue, 29 Jun 2010 9:12:38 +0200
+
+banshee (2.0) stable; urgency=low
+
+ * Using OO for controllers and models.
+ * AJAX integrated in public/index.php.
+ * Changes in login / logout page behaviour.
+ * Pagination added to news module.
+ * XSLT template 'result' moved to 'includes/functions.xslt'.
+ * Depricated function eregi() replaced by preg_match().
+ * Small bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Sun, 16 May 2010 10:28:02 +0200
+
+banshee (1.7) stable; urgency=low
+
+ * E-mail notification for forum, guestbook and weblog.
+ * Improved database drivers.
+ * Graphics library replaced by image class.
+ * Security audit and Show API tool added.
+ * Captcha library added.
+ * Object-oriented controller and model support for tablemanager and
+ splitform libraries.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Wed, 5 May 2010 10:41:23 +0200
+
+banshee (1.6) stable; urgency=medium
+
+ * Improved tablemanager library. Foreign key type added.
+ * Improved splitform library.
+ * CKEditor updated to version 3.2.
+ * jQuery updated to version 1.4.2.
+ * Small improvements and bugfixes.
+ * Bugfix: incorrect object-oriented page controller call in public/ajax.php.
+ * Bugfix: variables of last splitform page missing in submit data.
+ * Bugfix: access always denied to pages with parameter inside URL
+ for non-administrator users.
+
+ -- Hugo Leisink <hugo@leisink.net> Fri, 19 Mar 2010 8:31:07 +0100
+
+banshee (1.5) stable; urgency=low
+
+ * Links module added.
+ * Improved database setup script.
+ * Bugfix: incorrect null value handling for update() in database libraries.
+ * Small bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Mon, 22 Feb 2010 23:00:02 +0100
+
+banshee (1.4) stable; urgency=low
+
+ * Function add_javascript() added to output class.
+ * Support for GZip content encoding added to HTTP library.
+ * CKEditor updated to version 3.1.
+ * Improved database backup script.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Sat, 16 Jan 2010 20:59:23 +0100
+
+banshee (1.3) stable; urgency=low
+
+ * Cross-site Request Forgery protection.
+ * GZip content encoding for output.
+ * Improved multilingual support.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Sun, 6 Dec 2009 16:10:16 +0100
+
+banshee (1.2) stable; urgency=low
+
+ * Replaced the FCKEditor 2.6 with the CKEditor 3.0.
+ * Removed the TinyMCE editor.
+ * Layout selectable by controller and output object.
+ * More control over pagination links from tablemanager.
+ * Newsletter improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Thu, 12 Nov 2009 23:10:45 +0100
+
+banshee (1.1) stable; urgency=low
+
+ * Newsletter functionality added.
+ * The page_access_list() function also returns public pages.
+ * Object-oriented controller and model libraries added.
+ * Database helper functions added to pagination class.
+ * Tablemanager improvements.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Sat, 31 Oct 2009 10:25:28 +0100
+
+banshee (1.0) stable; urgency=low
+
+ * Pagination library added.
+ * Old browser notification added.
+ * Bugfixes in tablemanager class.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Sun, 30 Aug 2009 22:21:50 +0200
+
+banshee (0.9) stable; urgency=low
+
+ * Login via one time key in URL.
+ * Virtual pages added to Access overview.
+ * Search module added.
+ * Templates added.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Sun, 17 May 2009 9:55:16 +0200
+
+banshee (0.8) stable; urgency=low
+
+ * Icons in the administration pages.
+ * F.A.Q. module added.
+ * Access overview module added.
+ * Action log view module added.
+ * Access by role to page in database.
+ * Improved error handling.
+ * Small improvements and bugfixes.
+
+ -- Hugo Leisink <hugo@leisink.net> Fri, 20 Mar 2009 10:15:47 +0100
+
+banshee (0.7) stable; urgency=low
+
+ * Contact module added.
+ * Style per page instead of alternate styles.
+ * CMS pages have been given its own style.
+ * Message class replaced by language class.
+ * Administration pages show overview instead of message after creating or
+ updating an item.
+ * User warnings on page via internal messaging system.
+ * Improved role administration.
+ * Cleanup script added.
+ * Weblog administration bugfixes.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Fri, 20 Feb 2009 11:14:46 +0100
+
+banshee (0.6) stable; urgency=low
+
+ * Tablemanager library added.
+ * Splitform library added.
+ * Improved database libraries (PDO support added).
+ * Monthly view added to weblog.
+ * List view added to agenda.
+ * Configuration class replaced with setting class.
+ * Visible flag for pages in database.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Tue, 10 Feb 2009 10:30:51 +0100
+
+banshee (0.5) stable; urgency=low
+
+ * Dictionary module added.
+ * Forgot-password module added.
+ * Weblog RSS feed added.
+ * jQuery UI added.
+ * Smilies added to the forum.
+ * XML_output library splitted into XML and output.
+ * $_PAGE, $_USER and $xml renamed to $_page, $_user and $_output.
+ * Improved POP3 library.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Wed, 14 Jan 2009 15:34:07 +0100
+
+banshee (0.4) stable; urgency=low
+
+ * Weblog module added.
+ * Poll module added.
+ * News RSS feed added.
+ * Extension based view ability added.
+ * Small improvements.
+ * HTTP library extended with proxy functionality.
+
+ -- Hugo Leisink <hugo@leisink.net> Mon, 29 Nov 2008 10:30:44 +0100
+
+banshee (0.3) stable; urgency=low
+
+ * Directory 'public/style' renamed to 'public/css'.
+ * Group renamed to role.
+ * Administration page shows pages the user has access to.
+ * Administration pages moved to 'admin' directory.
+ * Agenda module added.
+ * File module added.
+ * POP3 library added.
+ * Google Analytics scripts included.
+ * Small improvements.
+
+ -- Hugo Leisink <hugo@leisink.net> Tue, 9 Nov 2008 22:03:54 +0100
+
+banshee (0.2) stable; urgency=low
+
+ * Class autoloader added.
+ * Each class in own file.
+ * Forum module added.
+ * Menu-in-database added.
+ * Pages-in-database added.
+ * User switch feature added.
+ * Improved last_insert_id() in database class.
+ * External libraries added: FCKeditor, jQuery.
+ * Caching in XML output library.
+
+ -- Hugo Leisink <hugo@leisink.net> Mon, 10 Nov 2008 20:42:18 +0100
+
+banshee (0.1) stable; urgency=low
+
+ * Forked from Skeleton (http://skeleton.leisink.org/).
+ * HTML/PHP separation via XSLT.
+ * Redesign of database library.
+ * External libraries added: DHTML Calender, PHP.js, TinyMCE.
+
+ -- Hugo Leisink <hugo@leisink.net> Sat, 4 Oct 2008 11:18:50 +0200
35 INSTALL
@@ -0,0 +1,35 @@
+CONFIGURE YOUR WEBSERVER
+=========================
+Use the directory 'public' as the webroot directory and allow PHP execution. If you use the Hiawatha webserver, you can use the following UrlToolkit configuration:
+
+UrlToolkit {
+ ToolkitID = banshee
+ RequestURI isfile Return
+ Match ^/(css|files|images|js)($|/) Return
+ Match ^/(favicon.ico|robots.txt)$ Return
+ Match .*\?(.*) Rewrite /index.php?$1
+ Match .* Rewrite /index.php
+}
+
+For Apache, there is a .htaccess file in the 'public' directory which contains the URL rewriting rules.
+
+
+CONFIGURE PHP
+==============
+Banshee needs PHP's MySQL and XSL module. Use the following PHP settings:
+ cgi.fix_pathinfo = 0 (when using FastCGI PHP), 1 (otherwise)
+ cgi.rfc2616_headers = 1 (when using Hiawatha), 0 (when using Apache)
+ register_globals = Off
+ allow_url_include = Off
+
+
+CONFIGURE YOUR DATABASE
+========================
+Change the database settings in 'settings/website.conf' and run the script 'database/setup_database'. This will create a MySQL user, a MySQL database and initialize the created database.
+
+The installed database already contains two users: 'admin' and 'user'. Both have the password 'banshee'.
+
+
+CONFIGURE BANSHEE
+==================
+Go to the Settings page in the CMS and replace the present e-mail addresses with your own.
29 LICENSE
@@ -0,0 +1,29 @@
+Banshee PHP framework - Copyright (C) by Hugo Leisink <hugo@leisink.net>
+
+You are allowed to use the Banshee PHP framework under the following conditions:
+
+ 1) You must leave the copyright messages inside the files which are part of
+ the Banshee PHP framework unchanged.
+ 2) You must leave the generator meta HTML tag unchanged. This tag must be
+ present in every HTML output.
+ 3) If you use (parts of) the Banshee PHP framework to build a website which
+ you sell or rent to other people or organisations, you must inform them
+ that "you built the website upon (parts of) the Banshee PHP framework,
+ which is a free and open source framework".
+
+In no event shall the author of Banshee be liable for any bug in this software.
+
+The following files are not part of the Banshee PHP framework:
+
+ - CKeditor : public/js/ckeditor/*
+ - The DHTML Calendar: public/js/calendar*.js
+ public/css/includes/calendar.css
+ - FPDF : libraries/fpdf.php
+ - jQuery : public/js/jquery/*
+ - MD5 javascript : public/js/md5.js
+ - PHP.js : public/js/php.js
+ - SHA1 javascript : public/js/sha1.js
+ - SHA256 javascript : public/js/sha256.js
+ - ZIP library : libraries/zipfile.php
+
+Look for copyright messages inside those files.
185 add_module
@@ -0,0 +1,185 @@
+#!/usr/bin/php
+<?php
+ require("libraries/banshee.php");
+ require("libraries/security.php");
+
+ /* Show help and exit
+ */
+ function help_exit() {
+ global $argv;
+
+ printf("Usage: %s public|private <module name> [tm|sf]\n", $argv[0]);
+ exit;
+ }
+
+ /* Copy file, but don't overwrite
+ */
+ function safe_copy($source, $dest) {
+ if (file_exists($source) == false) {
+ return false;
+ } else if (file_exists($dest)) {
+ printf("Warning, destination file already exists: %s\n", $dest);
+ return false;
+ }
+
+ copy($source, $dest);
+
+ return true;
+ }
+
+ /* Set class name inside file
+ */
+ function set_class_name($directory, $module) {
+ $filename = $directory."/".$module.".php";
+
+ if (($file = file($filename)) === false) {
+ return false;
+ }
+
+ $module = str_replace("/", "_", $module);
+ $file[1] = str_replace("XXX", $module, $file[1]);
+
+ if (($fp = fopen($filename, "w")) == false) {
+ return false;
+ }
+
+ fputs($fp, implode("", $file));
+ fclose($fp);
+
+ return true;
+ }
+
+ /* Fix include path in XSLT file
+ */
+ function fix_view_include_path($module) {
+ $filename = "views/".$module.".xslt";
+
+ if (($count = substr_count($module, "/")) == 0) {
+ return true;
+ } else if (($file = file($filename)) === false) {
+ return false;
+ }
+
+ foreach ($file as &$line) {
+ if (substr($line, 0, 12) != "<xsl:include") {
+ continue;
+ }
+ $line = substr($line, 0, 19).str_repeat("../", $count).substr($line, 19);
+ }
+
+ if (($fp = fopen($filename, "w")) == false) {
+ return false;
+ }
+
+ fputs($fp, implode("", $file));
+ fclose($fp);
+
+ return true;
+ }
+
+ /* Start
+ */
+ error_reporting(E_ALL & ~E_NOTICE);
+
+ if (count($argv) < 3) {
+ help_exit();
+ } else if (in_array($argv[1], array("public", "private")) == false) {
+ help_exit();
+ }
+
+ if (is_dir("settings") == false) {
+ printf("Not inside a Banshee website directory.\n");
+ exit;
+ }
+
+ $access = $argv[1];
+ $view = trim($argv[2], "/");
+ list($module) = explode(".", $view);
+ $type = $argv[3];
+
+ /* Validate module name
+ */
+ $module_characters = VALIDATE_NONCAPITALS.VALIDATE_NUMBERS."/_";
+ if (valid_input($module, $module_characters) == false) {
+ printf("Invalid module name.\n");
+ exit;
+ }
+
+ /* Validate type
+ */
+ if ($type === null) {
+ $type = "page";
+ } else if ($type == "tm") {
+ $type = "tablemanager";
+ } else if ($type == "sf") {
+ $type = "splitform";
+ } else {
+ printf("Invalid module type.\n");
+ exit;
+ }
+
+ /* Check for module existence
+ */
+ chdir(dirname($argv[0])."/settings");
+
+ if (in_array($view, public_pages())) {
+ printf("Module '%s' is already a public module.\n", $module);
+ exit;
+ } else if (in_array($view, private_pages())) {
+ printf("Module '%s' is already a private module.\n", $module);
+ exit;
+ }
+
+ chdir("..");
+
+ /* Make directories
+ */
+ $locations = array("controllers", "models", "views", "public/css");
+
+ $ofs = 0;
+ while (($pos = strpos($module, "/", $ofs)) !== false) {
+ $ofs = $pos + 1;
+ $subdir = "/".substr($module, 0, $pos);
+ foreach ($locations as $location) {
+ if (file_exists($location.$subdir) == false) {
+ printf("Creating directory %s%s.\n", $location, $subdir);
+ mkdir($location.$subdir, 0755, true);
+ }
+ }
+ }
+
+ /* Copy templates
+ */
+ printf("Creating controller, model, view and stylesheet.\n");
+ safe_copy("templates/".$type."_controller.php", "controllers/".$module.".php");
+ safe_copy("templates/".$type."_model.php", "models/".$module.".php");
+ safe_copy("templates/".$type."_view.xslt", "views/".$view.".xslt");
+ touch("public/css/".$module.".css");
+
+ /* Set class names
+ */
+ printf("Setting controller and model class name.\n");
+ set_class_name("controllers", $module);
+ set_class_name("models", $module);
+
+ /* Fix include path in XSLT
+ */
+ printf("Fixing include paths in view.\n");
+ fix_view_include_path($module);
+
+ /* Add to configuration file
+ */
+ printf("Adding module to %s pages configuration.\n", $access);
+ if (($fp = fopen("settings/".$access."_pages.conf", "a")) !== false) {
+ fputs($fp, $view."\n");
+ fclose($fp);
+ }
+
+ /* Register private page in database
+ */
+ if ($access == "private") {
+ system("database/private_pages");
+ }
+
+ print "Done.\n";
+?>
85 controllers/admin.php
@@ -0,0 +1,85 @@
+<?php
+ class admin_controller extends controller {
+ private $menu = array(
+ "Authentication & authorization" => array(
+ "Users" => array("admin/user", "users.png"),
+ "Roles" => array("admin/role", "roles.png"),
+ "Organisations" => array("admin/organisation", "organisations.png"),
+ "Access" => array("admin/access", "access.png"),
+ "User switch" => array("admin/switch", "switch.png")),
+ "Content" => array(
+ "Agenda" => array("admin/agenda", "agenda.png"),
+ "Dictionary" => array("admin/dictionary", "dictionary.png"),
+ "F.A.Q." => array("admin/faq", "faq.png"),
+ "Files" => array("admin/file", "files.png"),
+ "Forum" => array("admin/forum", "forum.png"),
+ "Guestbook" => array("admin/guestbook", "guestbook.png"),
+ "Languages" => array("admin/languages", "languages.png"),
+ "Links" => array("admin/links", "links.png"),
+ "Menu" => array("admin/menu", "menu.png"),
+ "News" => array("admin/news", "news.png"),
+ "Pages" => array("admin/page", "page.png"),
+ "Polls" => array("admin/poll", "poll.png"),
+ "Weblog" => array("admin/weblog", "weblog.png")),
+ "Photo album" => array(
+ "Albums" => array("admin/albums", "albums.png"),
+ "Collections" => array("admin/collection", "collection.png"),
+ "Photos" => array("admin/photos", "photos.png")),
+ "Newsletter" => array(
+ "Newsletter" => array("admin/newsletter", "newsletter.png"),
+ "Subscriptions" => array("admin/subscriptions", "subscriptions.png")),
+ "System" => array(
+ "Logging" => array("admin/logging", "logging.png"),
+ "Action log" => array("admin/action", "action.png"),
+ "Settings" => array("admin/settings", "settings.png")));
+
+ public function execute() {
+ if (($this->user->id == 1) && ($this->user->password == "c10b391ff5e75af6ee8469539e6a5428f09eff7e693d6a8c4de0e5525cd9b287")) {
+ $this->output->add_system_warning("Don't forget to change the password of the admin account!");
+ }
+
+ if ($this->settings->secret_website_code == "CHANGE_ME_INTO_A_RANDOM_STRING") {
+ $this->output->add_system_warning("Don't forget to change the secret_website_code setting.");
+ }
+
+ if (is_false(MULTILINGUAL)) {
+ unset($this->menu["Content"]["Languages"]);
+ }
+
+ $access_list = page_access_list($this->db, $this->user);
+ $private_pages = private_pages();
+
+ $this->output->open_tag("menu");
+
+ foreach ($this->menu as $text => $section) {
+
+ $this->output->open_tag("section", array(
+ "text" => $text,
+ "class" => strtr(strtolower($text), " &", "__")));
+
+ foreach ($section as $text => $info) {
+ list($page, $icon) = $info;
+
+ if (in_array($page, $private_pages) == false) {
+ continue;
+ }
+
+ if (isset($access_list[$page])) {
+ $access = show_boolean($access_list[$page] > 0);
+ } else {
+ $access = show_boolean(true);
+ }
+
+ $this->output->add_tag("entry", $page, array(
+ "text" => $text,
+ "access" => $access,
+ "icon" => $icon));
+ }
+
+ $this->output->close_tag();
+ }
+
+ $this->output->close_tag();
+ }
+ }
+?>
64 controllers/admin/access.php
@@ -0,0 +1,64 @@
+<?php
+ class admin_access_controller extends controller {
+ public function execute() {
+ if (($users = $this->model->get_all_users()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ } else if (($modules = $this->model->get_private_modules()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ } else if (($pages = $this->model->get_private_pages()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ } else if (($roles = $this->model->get_all_roles()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ } else {
+ $this->output->open_tag("overview");
+
+ /* Roles
+ */
+ $this->output->open_tag("roles");
+ foreach ($roles as $role) {
+ $this->output->add_tag("role", $role["name"]);
+ }
+ $this->output->close_tag();
+
+ /* Users
+ */
+ $this->output->open_tag("users");
+ foreach ($users as $user) {
+ $this->output->open_tag("user", array("name" => $user["username"]));
+ foreach ($roles as $role) {
+ $this->output->add_tag("role", in_array($role["id"], $user["roles"]) ? YES : NO);
+ }
+ $this->output->close_tag();
+ }
+ $this->output->close_tag();
+
+ /* Modules
+ */
+ $this->output->open_tag("modules");
+ foreach ($modules as $module) {
+ $this->output->open_tag("module", array("url" => $module));
+ foreach ($roles as $role) {
+ $this->output->add_tag("access", $role[$module]);
+ }
+ $this->output->close_tag();
+ }
+ $this->output->close_tag();
+
+ /* Pages
+ */
+ $this->output->open_tag("pages");
+ foreach ($pages as $page) {
+ $this->output->open_tag("page", array("url" => $page["url"]));
+ foreach ($roles as $role) {
+ $level = $page["access"][$role["id"]];
+ $this->output->add_tag("access", isset($level) ? $level : 0);
+ }
+ $this->output->close_tag();
+ }
+ $this->output->close_tag();
+
+ $this->output->close_tag();
+ }
+ }
+ }
+?>
55 controllers/admin/action.php
@@ -0,0 +1,55 @@
+<?php
+ class admin_action_controller extends controller {
+ public function execute() {
+ if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY) == false) {
+ $offset = 0;
+ } else {
+ $offset = $this->page->pathinfo[2];
+ }
+
+ if (isset($_SESSION["admin_actionlog_size"]) == false) {
+ $_SESSION["admin_actionlog_size"] = $this->model->get_log_size();
+ }
+
+ $paging = new pagination($this->output, "admin_actionlog", $this->settings->admin_page_size, $_SESSION["admin_actionlog_size"]);
+
+ if (($log = $this->model->get_action_log($paging->offset, $paging->size)) === false) {
+ $this->output->add_tag("result", "Error reading action log.");
+ return;
+ }
+
+ $users = array($this->user->id => $this->user->username);
+
+ $this->output->open_tag("log");
+
+ $this->output->open_tag("list");
+ foreach ($log as $entry) {
+ $user_id = $entry["user_id"];
+
+ list($user_id, $switch_id) = explode(":", $user_id);
+
+ if (isset($users[$user_id]) == false) {
+ if (($user = $this->model->get_user($user_id)) !== false) {
+ $users[$user_id] = $user["username"];
+ }
+ }
+
+ if (isset($users[$switch_id]) == false) {
+ if (($switch = $this->model->get_user($switch_id)) !== false) {
+ $users[$switch_id] = $switch["username"];
+ }
+ }
+
+ $entry["username"] = isset($users[$user_id]) ? $users[$user_id] : "-";
+ $entry["switch"] = isset($users[$switch_id]) ? $users[$switch_id] : "-";
+
+ $this->output->record($entry, "entry");
+ }
+ $this->output->close_tag();
+
+ $paging->show_browse_links();
+
+ $this->output->close_tag();
+ }
+ }
+?>
95 controllers/admin/agenda.php
@@ -0,0 +1,95 @@
+<?php
+ class admin_agenda_controller extends controller {
+ public function show_agenda_overview() {
+ if (($appointments = $this->model->get_appointments()) === false) {
+ $this->output->add_tag("result", "Database error");
+ } else {
+ $this->output->open_tag("overview");
+ $this->output->open_tag("appointments", array("now" => time()));
+ foreach ($appointments as $appointment) {
+ $appointment = $this->model->appointment_db_to_form($appointment);
+ $this->output->record($appointment, "appointment");
+ }
+ $this->output->close_tag();
+ $this->output->close_tag();
+ }
+ }
+
+ public function show_appointment_form($appointment) {
+ $this->output->add_javascript("ckeditor/ckeditor.js");
+ $this->output->add_javascript("start_ckeditor.js");
+ $this->output->add_javascript("calendar.js");
+ $this->output->add_javascript("calendar-en.js");
+ $this->output->add_javascript("calendar-setup.js");
+ $this->output->add_javascript("admin/agenda.js");
+
+ $appointment = $this->model->appointment_db_to_form($appointment);
+ $this->output->record($appointment, "edit");
+
+ $this->output->onload_javascript("setup_calendars('".$appointment["all_day"]."')");
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Save appointment") {
+ /* Save appointment
+ */
+ $appointment = $this->model->appointment_form_to_db($_POST);
+ if ($this->model->appointment_oke($appointment) == false) {
+ $this->show_appointment_form($appointment);
+ } else if (isset($_POST["id"]) == false) {
+ /* Create appointment
+ */
+ if ($this->model->create_appointment($appointment) == false) {
+ $this->output->add_message("Error while creating appointment.");
+ $this->show_appointment_form($appointment);
+ } else {
+ $this->user->log_action("appointment %d created", $db->last_insert_id);
+ $this->show_agenda_overview();
+ }
+ } else {
+ /* Update appointment
+ */
+ if ($this->model->update_appointment($appointment) == false) {
+ $this->output->add_message("Error while updateing appointment.");
+ $this->show_appointment_form($appointment);
+ } else {
+ $this->user->log_action("appointment %d updated", $_POST["id"]);
+ $this->show_agenda_overview();
+ }
+ }
+ } else if ($_POST["submit_button"] == "Delete appointment") {
+ /* Delete appointment
+ */
+ if ($this->model->delete_appointment($_POST["id"]) == false) {
+ $this->output->add_tag("result", "Error while deleting appointment.");
+ } else {
+ $this->user->log_action("appointment %d deleted", $_POST["id"]);
+ $this->show_agenda_overview();
+ }
+ } else {
+ $this->show_agenda_overview();
+ }
+ } else if ($this->page->pathinfo[2] == "new") {
+ /* New appointment
+ */
+ $appointment = array(
+ "begin" => date("Y-m-d")." 12:00",
+ "end" => date("Y-m-d")." 15:00");
+ $this->show_appointment_form($appointment);
+ } else if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY)) {
+ /* Edit appointment
+ */
+ if (($appointment = $this->model->get_appointment($this->page->pathinfo[2])) == false) {
+ $this->output->add_tag("result", "Agendapunten niet gevonden.");
+ } else {
+ $this->show_appointment_form($appointment);
+ }
+ } else {
+ /* Show month
+ */
+ $this->show_agenda_overview();
+ }
+ }
+ }
+?>
12 controllers/admin/albums.php
@@ -0,0 +1,12 @@
+<?php
+ class admin_albums_controller extends tablemanager_controller {
+ protected $name = "Photo album";
+ protected $pathinfo_offset = 2;
+ protected $back = "admin";
+ protected $icon = "albums.png";
+ protected $page_size = 25;
+ protected $pagination_links = 7;
+ protected $pagination_step = 1;
+ protected $foreign_null = "---";
+ }
+?>
99 controllers/admin/collection.php
@@ -0,0 +1,99 @@
+<?php
+ class admin_collection_controller extends controller {
+ private function show_collection_overview() {
+ if (($collections = $this->model->get_collections()) === false) {
+ $this->add_tag("result", "Database error.");
+ return;
+ }
+
+ $this->output->open_tag("overview");
+
+ $this->output->open_tag("collections");
+ foreach ($collections as $collection) {
+ $this->output->record($collection, "collection");
+ }
+ $this->output->close_tag();
+
+ $this->output->close_tag();
+ }
+
+ private function show_collection_form($collection) {
+ if (($albums = $this->model->get_albums()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ if (is_array($collection["albums"]) == false) {
+ $collection["albums"] = array();
+ }
+
+ $this->output->open_tag("edit");
+
+ $params = isset($collection["id"]) ? array("id" => $collection["id"]) : array();
+
+ $this->output->open_tag("collection", $params);
+ $this->output->record($collection);
+
+ $this->output->open_tag("albums");
+ foreach ($albums as $album) {
+ $this->output->add_tag("album", $album["name"], array(
+ "id" => $album["id"],
+ "checked" => show_boolean(in_array($album["id"], $collection["albums"]))));
+ }
+ $this->output->close_tag();
+ $this->output->close_tag();
+
+ $this->output->close_tag();
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Save collection") {
+ /* Save collection
+ */
+ if ($this->model->save_oke($_POST) == false) {
+ $this->show_collection_form($_POST);
+ } else if (isset($_POST["id"]) == false) {
+ /* Create collection
+ */
+ if ($this->model->create_collection($_POST) == false) {
+ $this->show_collection_form($_POST);
+ } else {
+ $this->show_collection_overview();
+ }
+ } else {
+ /* Update collection
+ */
+ if ($this->model->update_collection($_POST) == false) {
+ $this->show_collection_form($_POST);
+ } else {
+ $this->show_collection_overview();
+ }
+ }
+ } else if ($_POST["submit_button"] == "Delete collection") {
+ /* Delete collection
+ */
+ if ($this->model->delete_collection($_POST["id"]) == false) {
+ $this->output->add_message("Error deleting collection.");
+ $this->show_collection_form($_POST);
+ } else {
+ $this->show_collection_overview();
+ }
+ } else {
+ $this->show_collection_overview();
+ }
+ } else if ($this->page->pathinfo[2] == "new") {
+ $collection = array();
+ $this->show_collection_form($collection);
+ } else if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY)) {
+ if (($collection = $this->model->get_collection($this->page->pathinfo[2])) == false) {
+ $this->output->add_tag("result", "Collection not found.");
+ } else {
+ $this->show_collection_form($collection);
+ }
+ } else {
+ $this->show_collection_overview();
+ }
+ }
+ }
+?>
96 controllers/admin/dictionary.php
@@ -0,0 +1,96 @@
+<?php
+ class admin_dictionary_controller extends controller {
+ private function show_dictionary_overview() {
+ if (($word_count = $this->model->count_words()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $paging = new pagination($this->output, "admin_dictionary", $this->settings->admin_page_size, $word_count);
+
+ if (($words = $this->model->get_words($paging->offset, $paging->size)) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $this->output->open_tag("overview");
+
+ $this->output->open_tag("words");
+ foreach ($words as $word) {
+ $this->output->record($word, "word");
+ }
+ $this->output->close_tag();
+
+ $paging->show_browse_links();
+
+ $this->output->close_tag();
+ }
+
+ private function show_word_form($word) {
+ if (isset($word["id"]) != false) {
+ $letter = strtolower($word["word"][0]);
+ }
+
+ $this->output->add_javascript("ckeditor/ckeditor.js");
+ $this->output->add_javascript("start_ckeditor.js");
+
+ $this->output->record($word, "edit");
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Save word") {
+ /* Save word
+ */
+ if ($this->model->save_oke($_POST) == false) {
+ $this->show_word_form($_POST);
+ } else if (isset($_POST["id"]) == false) {
+ if ($this->model->create_word($_POST) == false) {
+ $this->output->add_message("Database error while creating word.");
+ $this->show_word_form($_POST);
+ } else {
+ $this->user->log_action("dictionary word %d created", $this->db->last_insert_id);
+ $this->show_dictionary_overview();
+ }
+ } else {
+ if ($this->model->update_word($_POST) == false) {
+ $this->output->add_message("Database error while updating word.");
+ $this->show_word_form($_POST);
+ } else {
+ $this->user->log_action("dictionary word %d updated", $_POST["id"]);
+ $this->show_dictionary_overview();
+ }
+ }
+ } else if ($_POST["submit_button"] == "Delete word") {
+ /* Delete word
+ */
+ if ($this->model->delete_word($_POST["id"]) == false) {
+ $this->output->add_tag("result", "Error while deleting word.");
+ } else {
+ $this->user->log_action("dictionary word %d deleted", $_POST["id"]);
+ $this->show_dictionary_overview();
+ }
+ } else {
+ $this->show_dictionary_overview();
+ }
+ } else if ($this->page->pathinfo[2] == "new") {
+ /* New word
+ */
+ $word = array();
+ $this->show_word_form($word);
+ } else if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY)) {
+ /* Edit word
+ */
+ if (($word = $this->model->get_word($this->page->pathinfo[2])) == false) {
+ $this->output->add_tag("result", "Word not found.");
+ } else {
+ $this->show_word_form($word);
+ }
+ } else {
+ /* Show dictionary overview
+ */
+ $this->show_dictionary_overview();
+ }
+ }
+ }
+?>
119 controllers/admin/faq.php
@@ -0,0 +1,119 @@
+<?php
+ require_once("../helpers/output.php");
+
+ class admin_faq_controller extends controller {
+ public function show_faq_overview() {
+ if (($sections = $this->model->get_all_sections()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ } else if (($faqs = $this->model->get_all_faqs()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $this->output->open_tag("overview");
+
+ $this->output->open_tag("sections");
+ foreach ($sections as $section) {
+ $this->output->add_tag("section", $section["label"], array("id" => $section["id"]));
+ }
+ $this->output->close_tag();
+
+ $this->output->open_tag("faqs");
+ foreach ($faqs as $faq) {
+ $faq["question"] = truncate_text($faq["question"], 140);
+ $this->output->record($faq, "faq");
+ }
+ $this->output->close_tag();
+
+ $this->output->close_tag();
+ }
+
+ public function show_faq_form($faq) {
+ if (($sections = $this->model->get_all_sections()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ if (isset($faq["select"]) == false) {
+ $faq["select"] = count($sections) == 0 ? "new" : "old";
+ }
+
+ $this->output->add_javascript("ckeditor/ckeditor.js");
+ $this->output->add_javascript("start_ckeditor.js");
+
+ $this->output->open_tag("edit");
+
+ $this->output->open_tag("sections");
+ foreach ($sections as $section) {
+ $this->output->add_tag("section", $section["label"], array("id" => $section["id"]));
+ }
+ $this->output->close_tag();
+
+ $this->output->record($faq, "faq");
+
+ $this->output->close_tag();
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Save FAQ") {
+ /* Save FAQ
+ */
+ if ($this->model->save_oke($_POST) == false) {
+ $this->show_faq_form($_POST);
+ } else if (isset($_POST["id"]) === false) {
+ /* Create FAQ
+ */
+ if ($this->model->create_faq($_POST) == false) {
+ $this->output->add_message("Error while creating F.A.Q.");
+ show_faq_form($_POST);
+ } else {
+ $this->user->log_action("faq %d created", $this->db->last_insert_id);
+ $this->show_faq_overview();
+ }
+ } else {
+ /* Update FAQ
+ */
+ if ($this->model->update_faq($_POST) == false) {
+ $this->output->add_message("Error while updating F.A.Q.");
+ $this->show_faq_form($_POST);
+ } else {
+ $this->user->log_action("faq %d updated", $_POST["id"]);
+ $this->show_faq_overview();
+ }
+ }
+ } else if ($_POST["submit_button"] == "Delete FAQ") {
+ /* Delete FAQ
+ */
+ if ($this->model->delete_faq($_POST["id"]) == false) {
+ $this->output->add_message("Error while deleting F.A.Q.");
+ show_faq_form($_POST);
+ } else {
+ $this->user->log_action("faq %d deleted", $_POST["id"]);
+ show_faq_overview();
+ }
+ } else {
+ $this->show_faq_overview();
+ }
+ } else if ($this->page->pathinfo[2] == "new") {
+ /* New FAQ
+ */
+ $faq = array("section" => 1);
+ $this->show_faq_form($faq);
+ } else if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY)) {
+ /* Edit existing FAQ
+ */
+ if (($faq = $this->model->get_faq($this->page->pathinfo[2])) == false) {
+ $this->output->add_tag("result", "FAQ not found.");
+ } else {
+ $this->show_faq_form($faq);
+ }
+ } else {
+ /* FAQ overview
+ */
+ $this->show_faq_overview();
+ }
+ }
+ }
+?>
83 controllers/admin/file.php
@@ -0,0 +1,83 @@
+<?php
+ class admin_file_controller extends controller {
+ public function execute() {
+ $base_dir = UPLOAD_DIRECTORY;
+ if (($sub_dir = implode("/", $this->page->parameters)) != "") {
+ $sub_dir = "/".$sub_dir;
+ }
+ $directory = $base_dir.$sub_dir;
+
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Create directory") {
+ /* Create directory
+ */
+ if ($this->model->directory_oke($_POST["create"], $directory) == false) {
+ $this->output->add_tag("create", $_POST["create"]);
+ } else if ($this->model->create_directory($_POST["create"], $directory) == false) {
+ $this->output->add_tag("create", $_POST["create"]);
+ $this->output->add_message("Error creating directory.");
+ }
+ } else if ($_POST["submit_button"] == "Upload file") {
+ /* Upload file
+ */
+ if ($this->model->upload_oke($_FILES["file"], $directory)) {
+ if ($this->model->import_uploaded_file($_FILES["file"], $directory) == false) {
+ $this->output->add_message("Error while importing file.");
+ } else {
+ $this->user->log_action("file '%s' uploaded", $_FILES["file"]["name"]);
+ }
+ }
+ } else if ($_POST["submit_button"] == "delete") {
+ /* Delete file
+ */
+ if ($this->model->delete_file($_POST["filename"], $directory) == false) {
+ $this->output->add_message("Error while deleting file.");
+ } else {
+ $this->user->log_action("file '%s' deleted", $_POST["filename"]);
+ }
+ }
+ }
+
+ if (($files = $this->model->directory_listing($directory)) === false) {
+ $this->output->add_tag("result", "Error reading directory");
+ } else {
+ $this->output->open_tag("files", array("dir" => $sub_dir));
+
+ /* One directory up
+ */
+ $back = $this->page->parameters;
+ if (count($back) > 0) {
+ array_pop($back);
+ if (($back = implode("/", $back)) != "") {
+ $back = "/".$back;
+ }
+ $this->output->add_tag("back", "/".$this->page->module.$back);
+ }
+
+ /* Directories
+ */
+ foreach ($files["dirs"] as $filename) {
+ $file = array(
+ "name" => $filename,
+ "link" => "/".$this->page->module.$sub_dir."/".$filename,
+ "size" => $this->model->get_file_size($directory."/".$filename),
+ "delete" => show_boolean($this->model->directory_empty($filename, $directory)));
+ $this->output->record($file, "dir");
+ }
+
+ /* Files
+ */
+ foreach ($files["files"] as $filename) {
+ $file = array(
+ "name" => $filename,
+ "link" => "/".$directory."/".urlencode($filename),
+ "size" => $this->model->get_file_size($directory."/".$filename),
+ "delete" => "yes");
+ $this->output->record($file, "file");
+ }
+
+ $this->output->close_tag();
+ }
+ }
+ }
+?>
86 controllers/admin/forum.php
@@ -0,0 +1,86 @@
+<?php
+ require_once("../helpers/output.php");
+
+ class admin_forum_controller extends controller {
+ private function show_message_overview() {
+ if (($message_count = $this->model->count_messages()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return false;
+ }
+
+ $paging = new pagination($this->output, "admin_forum", $this->settings->admin_page_size, $message_count);
+
+ if (($messages = $this->model->get_messages($paging->offset, $paging->size)) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $this->output->open_tag("overview");
+
+ $this->output->open_tag("messages");
+ foreach ($messages as $message) {
+ $message["content"] = truncate_text($message["content"], 400);
+ $message["timestamp"] = date("j F Y, H:i", $message["timestamp"]);
+ if ($message["author"] == "") {
+ $message["author"] = $message["username"];
+ }
+ $this->output->record($message, "message");
+ }
+ $this->output->close_tag();
+
+ $paging->show_browse_links();
+
+ $this->output->close_tag();
+ }
+
+ private function show_message_form($message) {
+ $this->output->open_tag("edit");
+ $this->output->record($message, "message");
+ $this->output->close_tag();
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ if ($_POST["submit_button"] == "Save message") {
+ /* Update message
+ */
+ if ($this->model->save_oke($_POST) == false) {
+ $this->show_message_form($_POST);
+ } else if ($this->model->update_message($_POST) === false) {
+ $this->output->add_message("Database error while updating message.");
+ $this->show_message_form($_POST);
+ } else {
+ $topic_id = $this->model->get_topic_id($_POST["id"]);
+ $this->user->log_action("forum message %d (topic:%d) updated", $_POST["id"], $topic_id);
+ $this->show_message_overview();
+ }
+ } else if ($_POST["submit_button"] == "delete") {
+ /* Delete message
+ */
+ $topic_id = $this->model->get_topic_id($_POST["id"]);
+
+ if ($this->model->delete_message($_POST["message_id"]) == false) {
+ $this->output->add_tag("result", "Database error while deleting message.");
+ } else {
+ $this->user->log_action("forum message %d (topic:%d) deleted", $_POST["message_id"], $topic_id);
+ $this->show_message_overview();
+ }
+ } else {
+ $this->show_message_overview();
+ }
+ } else if (valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS, VALIDATE_NONEMPTY)) {
+ /* Edit existing message
+ */
+ if (($message = $this->model->get_message($this->page->pathinfo[2])) == false) {
+ $this->output->add_tag("result", "Message not found.");
+ } else {
+ $this->show_message_form($message);
+ }
+ } else {
+ /* Show message overview
+ */
+ $this->show_message_overview();
+ }
+ }
+ }
+?>
39 controllers/admin/guestbook.php
@@ -0,0 +1,39 @@
+<?php
+ require_once("../helpers/output.php");
+
+ class admin_guestbook_controller extends controller {
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ /* Delete message
+ */
+ if ($this->model->delete_message($_POST["id"])) {
+ $this->user->log_action("guestbook entry %d deleted", $_POST["id"]);
+ }
+ }
+
+ if (($message_count = $this->model->count_messages()) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $paging = new pagination($this->output, "admin_guestbook", $this->settings->admin_page_size, $message_count);
+
+ if (($guestbook = $this->model->get_messages($paging->offset, $paging->size)) === false) {
+ $this->output->add_tag("result", "Database error.");
+ return;
+ }
+
+ $this->output->open_tag("guestbook");
+
+ foreach ($guestbook as $item) {
+ $item["message"] = truncate_text($item["message"], 45);
+ $item["timestamp"] = date("j F Y, H:i", $item["timestamp"]);
+ $this->output->record($item, "item");
+ }
+
+ $paging->show_browse_links();
+
+ $this->output->close_tag();
+ }
+ }
+?>
19 controllers/admin/languages.php
@@ -0,0 +1,19 @@
+<?php
+ class admin_languages_controller extends tablemanager_controller {
+ protected $name = "Language";
+ protected $pathinfo_offset = 2;
+ protected $icon = "languages.png";
+ protected $back = "admin";
+
+ public function execute() {
+ if (is_a($this->language, "language")) {
+ parent::execute();
+ } else {
+ $this->output->open_tag("tablemanager");
+ $this->output->add_tag("name", "Language");
+ $this->output->add_tag("result", "Multiple languages are not supported by this website.", array("url" => "admin", "seconds" => "5"));
+ $this->output->close_tag();
+ }
+ }
+ }
+?>
8 controllers/admin/links.php
@@ -0,0 +1,8 @@
+<?php
+ class admin_links_controller extends tablemanager_controller {
+ protected $name = "Link";
+ protected $pathinfo_offset = 2;
+ protected $back = "admin";
+ protected $icon = "link.png";
+ }
+?>
111 controllers/admin/logging.php
@@ -0,0 +1,111 @@
+<?php
+ class admin_logging_controller extends controller {
+ private $height = 100;
+ private $page_width = 839;
+ private $list_limit = 15;
+
+ private function show_graph($items, $title) {
+ static $id = -1;
+
+ $id = $id + 1;
+ $max = $this->model->max_value($items, "count");
+
+ $this->output->open_tag("graph", array("title" => $title, "id" => $id, "max" => $max));
+ foreach ($items as $item) {
+ if ($max > 0) {
+ $item["height"] = round($this->height * ($item["count"] / $max));
+ } else {
+ $item["height"] = 0;
+ }
+ $item["day"] = date("j F Y", strtotime($item["date"]));
+
+ $this->output->record($item, "item");
+ }
+ $this->output->close_tag();
+ }
+
+ public function execute() {
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
+ $this->model->delete_referers($_POST);
+ }
+
+ $this->output->add_tag("width", floor($this->page_width / LOG_DAYS) - 1);
+ $this->output->add_tag("height", $this->height);
+
+ $this->output->add_javascript("jquery/jquery.js");
+ $this->output->add_javascript("admin/logging.js");
+
+ $day = valid_input($this->page->pathinfo[2], VALIDATE_NUMBERS."-", VALIDATE_NONEMPTY) ? $this->page->pathinfo[2] : null;
+
+ /* Visits
+ */
+ if (($visits = $this->model->get_visits(LOG_DAYS)) === false) {
+ return false;
+ }
+ $this->show_graph($visits, "Visits");
+
+ /* Page views
+ */
+ if (($pageviews = $this->model->get_page_views(LOG_DAYS)) === false) {
+ return false;
+ }
+ $this->show_graph($pageviews, "Page views");
+
+ /* Day deselect
+ */
+ if ($day !== null) {
+ $this->output->add_tag("deselect", date("j F Y", strtotime($day)), array("date" => $day));
+ }
+
+ /* Top pages
+ */
+ if (($pages = $this->model->get_top_pages($this->list_limit, $day)) === false) {
+ return false;
+ }
+
+ $this->output->open_tag("pages");
+ foreach ($pages as $page) {
+ $this->output->record($page, "page");
+ }
+ $this->output->close_tag();
+
+ /* Search queries
+ */
+ if (($queries = $this->model->get_search_queries($this->list_limit, $day)) === false) {
+ return false;
+ }
+
+ $this->output->open_tag("search");
+ foreach ($queries as $query) {
+ $this->output->record($query, "query");
+ }
+ $this->output->close_tag();
+
+ /* Referers
+ */
+ $date = date("Y-m-d", strtotime("-7 days"));
+ if (($referers = $this->model->get_referers($day)) === false) {
+ return false;
+ }
+
+ $this->output->open_tag("referers");
+ $hostname = null;
+ foreach ($referers as $hostname => $host) {
+ $total = 0;
+ foreach ($host as $referer) {
+ $total += $referer["count"];
+ }
+ $params = array(
+ "hostname" => $hostname,
+ "count" => count($host),
+ "total" => $total);
+ $this->output->open_tag("host", $params);
+ foreach ($host as $referer) {
+ $this->output->record($referer, "referer");
+ }
+ $this->output->close_tag();
+ }
+ $this->output->close_tag();
+ }
+ }
+?>
76 controllers/admin/menu.php
@@ -0,0 +1,76 @@
+<?php
+ class admin_menu_controller extends controller {
+ private $url = null;
+
+ private function show_menu_form($menu_id, $menu) {
+ $this->output->add_javascript("jquery/jquery.js");
+ $this->output->add_javascript("jquery/jquery.ui.core.js");
+ $this->output->add_javascript("jquery/jquery.ui.widget.js");
+ $this->output->add_javascript("jquery/jquery.ui.mouse.js");
+ $this->output->add_javascript("jquery/jquery.ui.sortable.js");
+ $this->output->add_javascript("admin/menu.js");
+
+ $this->output->open_tag("edit");
+
+ if (($parent = $this->model->get_menu($menu_id)) != false) {
+ $this->output->add_tag("parent", $parent["text"], array("id" => $parent["parent_id"]));
+ }
+
+ $this->output->open_tag("menu", array("id" => $menu_id));
+ $max_id = 0;
+ foreach ($menu as $item) {
+ unset($item["parent_id"]);
+ $this->output->record($item, "item");
+ if ($item["id"] > $max_id) {
+ $max_id = $item["id"];
+ }
+ }
+ $this->output->close_tag();
+ $this->output->add_tag("max_menu_id", $max_id + 1);
+ $this->output->close_tag();
+
+ if (count($menu) == 0) {
+ $this->output->onload_javascript("add_item('editmenu', 1)");
+ }
+ }
+
+ public function execute() {
+ $this->url = array("url" => "admin/menu");
+
+ if (