Browse Source

First public commit

Timothy J. Warren 4 years ago
commit
b48acc6c61
100 changed files with 13350 additions and 0 deletions
  1. 6
    0
      .gitignore
  2. 0
    0
      README.md
  3. 123
    0
      application/config/autoload.php
  4. 350
    0
      application/config/config.php
  5. 114
    0
      application/config/constants.php
  6. 62
    0
      application/config/database.php
  7. 17
    0
      application/config/doctypes.php
  8. 67
    0
      application/config/form_validation.php
  9. 23
    0
      application/config/hooks.php
  10. 10
    0
      application/config/index.html
  11. 105
    0
      application/config/mimes.php
  12. 144
    0
      application/config/min_config.php
  13. 36
    0
      application/config/min_groupsConfig.php
  14. 53
    0
      application/config/profiler.php
  15. 54
    0
      application/config/routes.php
  16. 119
    0
      application/config/sites.php
  17. 66
    0
      application/config/smileys.php
  18. 62
    0
      application/config/testing/database.php
  19. 175
    0
      application/config/user_agents.php
  20. 103
    0
      application/controllers/account.php
  21. 133
    0
      application/controllers/calendar.php
  22. 86
    0
      application/controllers/category.php
  23. 99
    0
      application/controllers/friend.php
  24. 95
    0
      application/controllers/group.php
  25. 114
    0
      application/controllers/login.php
  26. 40
    0
      application/controllers/reminder.php
  27. 349
    0
      application/controllers/task.php
  28. 36
    0
      application/core/MY_Controller.php
  29. 3
    0
      application/errors/error_404.php
  30. 61
    0
      application/errors/error_db.php
  31. 61
    0
      application/errors/error_general.php
  32. 10
    0
      application/errors/error_php.php
  33. 32
    0
      application/hooks/pre-controller.php
  34. 10
    0
      application/language/english/index.html
  35. 34
    0
      application/libraries/MY_Form_validation.php
  36. 81
    0
      application/libraries/MY_Session.php
  37. 297
    0
      application/libraries/Page.php
  38. 843
    0
      application/libraries/Todo.php
  39. 61
    0
      application/libraries/Validation_callbacks.php
  40. 10
    0
      application/logs/index.html
  41. 283
    0
      application/models/friend_model.php
  42. 147
    0
      application/models/mail_model.php
  43. 1597
    0
      application/models/task_model.php
  44. 278
    0
      application/third_party/CIUnit/bootstrap_phpunit.php
  45. 13
    0
      application/third_party/CIUnit/config/config.php
  46. 23
    0
      application/third_party/CIUnit/core/CIU_Controller.php
  47. 137
    0
      application/third_party/CIUnit/core/CIU_Exceptions.php
  48. 437
    0
      application/third_party/CIUnit/core/CIU_Loader.php
  49. 290
    0
      application/third_party/CIUnit/core/CIU_Output.php
  50. 419
    0
      application/third_party/CIUnit/core/CodeIgniter.php
  51. 188
    0
      application/third_party/CIUnit/core/Common.php
  52. 3
    0
      application/third_party/CIUnit/core/README.txt
  53. 62
    0
      application/third_party/CIUnit/helpers/CIU_url_helper.php
  54. 15
    0
      application/third_party/CIUnit/index.html
  55. 82
    0
      application/third_party/CIUnit/libraries/CIU_Session.php
  56. 256
    0
      application/third_party/CIUnit/libraries/CIUnit.php
  57. 222
    0
      application/third_party/CIUnit/libraries/CIUnitTestCase.php
  58. 84
    0
      application/third_party/CIUnit/libraries/Fixture.php
  59. 434
    0
      application/third_party/CIUnit/libraries/Unit_test.php
  60. 159
    0
      application/third_party/CIUnit/libraries/spyc/README
  61. 25
    0
      application/third_party/CIUnit/libraries/spyc/examples/yaml-dump.php
  62. 25
    0
      application/third_party/CIUnit/libraries/spyc/examples/yaml-load.php
  63. 16
    0
      application/third_party/CIUnit/libraries/spyc/php4/5to4.php
  64. 1023
    0
      application/third_party/CIUnit/libraries/spyc/php4/spyc.php4
  65. 162
    0
      application/third_party/CIUnit/libraries/spyc/php4/test.php4
  66. 1024
    0
      application/third_party/CIUnit/libraries/spyc/spyc.php
  67. 196
    0
      application/third_party/CIUnit/libraries/spyc/spyc.yaml
  68. 58
    0
      application/third_party/CIUnit/libraries/spyc/tests/DumpTest.php
  69. 57
    0
      application/third_party/CIUnit/libraries/spyc/tests/IndentTest.php
  70. 305
    0
      application/third_party/CIUnit/libraries/spyc/tests/ParseTest.php
  71. 2
    0
      application/third_party/CIUnit/libraries/spyc/tests/failing1.yaml
  72. 53
    0
      application/third_party/CIUnit/libraries/spyc/tests/indent_1.yaml
  73. 8
    0
      application/third_party/CIUnit/libraries/spyc/tests/quotes.yaml
  74. 38
    0
      application/views/account/password.php
  75. 15
    0
      application/views/account/side_nav.php
  76. 48
    0
      application/views/account/status.php
  77. 28
    0
      application/views/footer.php
  78. 13
    0
      application/views/friend/ajax_search.php
  79. 46
    0
      application/views/friend/group_list.php
  80. 30
    0
      application/views/friend/list.php
  81. 31
    0
      application/views/friend/manage.php
  82. 33
    0
      application/views/friend/requests.php
  83. 24
    0
      application/views/friend/search.php
  84. 36
    0
      application/views/friend/side_nav.php
  85. 10
    0
      application/views/header.php
  86. 49
    0
      application/views/login/login.php
  87. 42
    0
      application/views/login/register.php
  88. 39
    0
      application/views/menu.php
  89. 4
    0
      application/views/message.php
  90. 165
    0
      application/views/task/add.php
  91. 5
    0
      application/views/task/ajax_checklist.php
  92. 33
    0
      application/views/task/calendar.php
  93. 25
    0
      application/views/task/cat_add.php
  94. 64
    0
      application/views/task/cat_list.php
  95. 15
    0
      application/views/task/checklist_view.php
  96. 21
    0
      application/views/task/comments_view.php
  97. 211
    0
      application/views/task/edit.php
  98. 53
    0
      application/views/task/list.php
  99. 45
    0
      application/views/task/side_nav.php
  100. 0
    0
      application/views/task/view.php

+ 6
- 0
.gitignore View File

@@ -0,0 +1,6 @@
1
+web/cron.log
2
+application/logs/*.php
3
+application/cache/*
4
+web/coverage/*
5
+vendor/*
6
+composer.lock

+ 0
- 0
README.md View File


+ 123
- 0
application/config/autoload.php View File

@@ -0,0 +1,123 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| AUTO-LOADER
5
+| -------------------------------------------------------------------
6
+| This file specifies which systems should be loaded by default.
7
+|
8
+| In order to keep the framework as light-weight as possible only the
9
+| absolute minimal resources are loaded by default. For example,
10
+| the database is not connected to automatically since no assumption
11
+| is made regarding whether you intend to use it.  This file lets
12
+| you globally define which systems you would like loaded with every
13
+| request.
14
+|
15
+| -------------------------------------------------------------------
16
+| Instructions
17
+| -------------------------------------------------------------------
18
+|
19
+| These are the things you can load automatically:
20
+|
21
+| 1. Libraries
22
+| 2. Helper files
23
+| 3. Plugins
24
+| 4. Custom config files
25
+| 5. Language files
26
+| 6. Models
27
+|
28
+*/
29
+
30
+/*
31
+| -------------------------------------------------------------------
32
+|  Auto-load Libraries
33
+| -------------------------------------------------------------------
34
+| These are the classes located in the system/libraries folder
35
+| or in your system/application/libraries folder.
36
+|
37
+| Prototype:
38
+|
39
+|	$autoload['libraries'] = array('database', 'session', 'xmlrpc');
40
+*/
41
+
42
+$autoload['libraries'] = [
43
+	'database',
44
+	'page',
45
+	'todo',
46
+	'session',
47
+	'form_validation',
48
+	'validation_callbacks'
49
+];
50
+
51
+
52
+/*
53
+| -------------------------------------------------------------------
54
+|  Auto-load Helper Files
55
+| -------------------------------------------------------------------
56
+| Prototype:
57
+|
58
+|	$autoload['helper'] = array('url', 'file');
59
+*/
60
+
61
+$autoload['helper'] = array('url', 'html', 'security', 'form');
62
+
63
+
64
+/*
65
+| -------------------------------------------------------------------
66
+|  Auto-load Plugins
67
+| -------------------------------------------------------------------
68
+| Prototype:
69
+|
70
+|	$autoload['plugin'] = array('captcha', 'js_calendar');
71
+*/
72
+
73
+$autoload['plugin'] = array();
74
+
75
+
76
+/*
77
+| -------------------------------------------------------------------
78
+|  Auto-load Config files
79
+| -------------------------------------------------------------------
80
+| Prototype:
81
+|
82
+|	$autoload['config'] = array('config1', 'config2');
83
+|
84
+| NOTE: This item is intended for use ONLY if you have created custom
85
+| config files.  Otherwise, leave it blank.
86
+|
87
+*/
88
+
89
+$autoload['config'] = array('sites');
90
+
91
+
92
+/*
93
+| -------------------------------------------------------------------
94
+|  Auto-load Language files
95
+| -------------------------------------------------------------------
96
+| Prototype:
97
+|
98
+|	$autoload['language'] = array('lang1', 'lang2');
99
+|
100
+| NOTE: Do not include the "_lang" part of your file.  For example 
101
+| "codeigniter_lang.php" would be referenced as array('codeigniter');
102
+|
103
+*/
104
+
105
+$autoload['language'] = array();
106
+
107
+
108
+/*
109
+| -------------------------------------------------------------------
110
+|  Auto-load Models
111
+| -------------------------------------------------------------------
112
+| Prototype:
113
+|
114
+|	$autoload['model'] = array('model1', 'model2');
115
+|
116
+*/
117
+
118
+$autoload['model'] = array();
119
+
120
+
121
+
122
+/* End of file autoload.php */
123
+/* Location: ./application/config/autoload.php */

+ 350
- 0
application/config/config.php View File

@@ -0,0 +1,350 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Base Site URL
6
+|--------------------------------------------------------------------------
7
+|
8
+| URL to your CodeIgniter root. Typically this will be your base URL,
9
+| WITH a trailing slash:
10
+|
11
+|	http://example.com/
12
+|
13
+*/
14
+$config['base_url']	= 'https://todo.timshomepage.net/';
15
+
16
+/*
17
+|--------------------------------------------------------------------------
18
+| Index File
19
+|--------------------------------------------------------------------------
20
+|
21
+| Typically this will be your index.php file, unless you've renamed it to
22
+| something else. If you are using mod_rewrite to remove the page set this
23
+| variable so that it is blank.
24
+|
25
+*/
26
+$config['index_page'] = "";
27
+
28
+/*
29
+|--------------------------------------------------------------------------
30
+| URI PROTOCOL
31
+|--------------------------------------------------------------------------
32
+|
33
+| This item determines which server global should be used to retrieve the
34
+| URI string.  The default setting of "AUTO" works for most servers.
35
+| If your links do not seem to work, try one of the other delicious flavors:
36
+|
37
+| 'AUTO'			Default - auto detects
38
+| 'PATH_INFO'		Uses the PATH_INFO
39
+| 'QUERY_STRING'	Uses the QUERY_STRING
40
+| 'REQUEST_URI'		Uses the REQUEST_URI
41
+| 'ORIG_PATH_INFO'	Uses the ORIG_PATH_INFO
42
+|
43
+*/
44
+
45
+$config['uri_protocol']	= "REQUEST_URI";
46
+
47
+/*
48
+|--------------------------------------------------------------------------
49
+| URL suffix
50
+|--------------------------------------------------------------------------
51
+|
52
+| This option allows you to add a suffix to all URLs generated by CodeIgniter.
53
+| For more information please see the user guide:
54
+|
55
+| http://codeigniter.com/user_guide/general/urls.html
56
+*/
57
+
58
+$config['url_suffix'] = "";
59
+
60
+/*
61
+|--------------------------------------------------------------------------
62
+| Default Language
63
+|--------------------------------------------------------------------------
64
+|
65
+| This determines which set of language files should be used. Make sure
66
+| there is an available translation if you intend to use something other
67
+| than english.
68
+|
69
+*/
70
+$config['language']	= "english";
71
+
72
+/*
73
+|--------------------------------------------------------------------------
74
+| Default Character Set
75
+|--------------------------------------------------------------------------
76
+|
77
+| This determines which character set is used by default in various methods
78
+| that require a character set to be provided.
79
+|
80
+*/
81
+$config['charset'] = "UTF-8";
82
+
83
+/*
84
+|--------------------------------------------------------------------------
85
+| Enable/Disable System Hooks
86
+|--------------------------------------------------------------------------
87
+|
88
+| If you would like to use the "hooks" feature you must enable it by
89
+| setting this variable to TRUE (boolean).  See the user guide for details.
90
+|
91
+*/
92
+$config['enable_hooks'] = TRUE;
93
+
94
+
95
+/*
96
+|--------------------------------------------------------------------------
97
+| Class Extension Prefix
98
+|--------------------------------------------------------------------------
99
+|
100
+| This item allows you to set the filename/classname prefix when extending
101
+| native libraries.  For more information please see the user guide:
102
+|
103
+| http://codeigniter.com/user_guide/general/core_classes.html
104
+| http://codeigniter.com/user_guide/general/creating_libraries.html
105
+|
106
+*/
107
+$config['subclass_prefix'] = 'MY_';
108
+
109
+
110
+/*
111
+|--------------------------------------------------------------------------
112
+| Allowed URL Characters
113
+|--------------------------------------------------------------------------
114
+|
115
+| This lets you specify with a regular expression which characters are permitted
116
+| within your URLs.  When someone tries to submit a URL with disallowed
117
+| characters they will get a warning message.
118
+|
119
+| As a security measure you are STRONGLY encouraged to restrict URLs to
120
+| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
121
+|
122
+| Leave blank to allow all characters -- but only if you are insane.
123
+|
124
+| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
125
+|
126
+*/
127
+$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
128
+
129
+
130
+/*
131
+|--------------------------------------------------------------------------
132
+| Enable Query Strings
133
+|--------------------------------------------------------------------------
134
+|
135
+| By default CodeIgniter uses search-engine friendly segment based URLs:
136
+| example.com/who/what/where/
137
+|
138
+| You can optionally enable standard query string based URLs:
139
+| example.com?who=me&what=something&where=here
140
+|
141
+| Options are: TRUE or FALSE (boolean)
142
+|
143
+| The other items let you set the query string "words" that will
144
+| invoke your controllers and its functions:
145
+| example.com/index.php?c=controller&m=function
146
+|
147
+| Please note that some of the helpers won't work as expected when
148
+| this feature is enabled, since CodeIgniter is designed primarily to
149
+| use segment based URLs.
150
+|
151
+*/
152
+$config['allow_get_array']		= TRUE;
153
+$config['enable_query_strings'] = FALSE;
154
+$config['controller_trigger'] 	= 'c';
155
+$config['function_trigger'] 	= 'm';
156
+$config['directory_trigger'] 	= 'd'; // experimental not currently in use
157
+
158
+/*
159
+|--------------------------------------------------------------------------
160
+| Error Logging Threshold
161
+|--------------------------------------------------------------------------
162
+|
163
+| If you have enabled error logging, you can set an error threshold to
164
+| determine what gets logged. Threshold options are:
165
+| You can enable error logging by setting a threshold over zero. The
166
+| threshold determines what gets logged. Threshold options are:
167
+|
168
+|	0 = Disables logging, Error logging TURNED OFF
169
+|	1 = Error Messages (including PHP errors)
170
+|	2 = Debug Messages
171
+|	3 = Informational Messages
172
+|	4 = All Messages
173
+|
174
+| For a live site you'll usually only enable Errors (1) to be logged otherwise
175
+| your log files will fill up very fast.
176
+|
177
+*/
178
+$config['log_threshold'] = 1;
179
+
180
+/*
181
+|--------------------------------------------------------------------------
182
+| Error Logging Directory Path
183
+|--------------------------------------------------------------------------
184
+|
185
+| Leave this BLANK unless you would like to set something other than the default
186
+| system/logs/ folder.  Use a full server path with trailing slash.
187
+|
188
+*/
189
+$config['log_path'] = '';
190
+
191
+/*
192
+|--------------------------------------------------------------------------
193
+| Date Format for Logs
194
+|--------------------------------------------------------------------------
195
+|
196
+| Each item that is logged has an associated date. You can use PHP date
197
+| codes to set your own date formatting
198
+|
199
+*/
200
+$config['log_date_format'] = 'Y-m-d H:i:s';
201
+
202
+/*
203
+|--------------------------------------------------------------------------
204
+| Cache Directory Path
205
+|--------------------------------------------------------------------------
206
+|
207
+| Leave this BLANK unless you would like to set something other than the default
208
+| system/cache/ folder.  Use a full server path with trailing slash.
209
+|
210
+*/
211
+$config['cache_path'] = '';
212
+
213
+/*
214
+|--------------------------------------------------------------------------
215
+| Encryption Key
216
+|--------------------------------------------------------------------------
217
+|
218
+| If you use the Encryption class or the Sessions class with encryption
219
+| enabled you MUST set an encryption key.  See the user guide for info.
220
+|
221
+*/
222
+$config['encryption_key'] = "xLx45kOkywjdvvVMxLov";
223
+
224
+/*
225
+|--------------------------------------------------------------------------
226
+| Session Variables
227
+|--------------------------------------------------------------------------
228
+|
229
+| 'session_cookie_name' = the name you want for the cookie
230
+| 'encrypt_sess_cookie' = TRUE/FALSE (boolean).  Whether to encrypt the cookie
231
+| 'session_expiration'  = the number of SECONDS you want the session to last.
232
+|  by default sessions last 7200 seconds (two hours).  Set to zero for no expiration.
233
+| 'time_to_update'		= how many seconds between CI refreshing Session Information
234
+|
235
+*/
236
+$config['sess_cookie_name']		= 'sess';
237
+$config['sess_expiration']		= 43200; //12 hours
238
+$config['sess_encrypt_cookie']	= FALSE;
239
+$config['sess_use_database']	= TRUE;
240
+$config['sess_table_name']		= 'ci_sessions';
241
+$config['sess_match_ip']		= TRUE;
242
+$config['sess_match_useragent']	= TRUE;
243
+$config['sess_time_to_update'] 	= 300;
244
+
245
+/*
246
+|--------------------------------------------------------------------------
247
+| Cookie Related Variables
248
+|--------------------------------------------------------------------------
249
+|
250
+| 'cookie_prefix' = Set a prefix if you need to avoid collisions
251
+| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
252
+| 'cookie_path'   =  Typically will be a forward slash
253
+| 'cookie_secure' =  Cookies will only be set if a secure HTTPS connection exists.
254
+|
255
+*/
256
+$config['cookie_prefix']	= "thp_todo_";
257
+$config['cookie_domain']	= "";
258
+$config['cookie_path']		= "/";
259
+$config['cookie_secure']	= TRUE;
260
+
261
+/*
262
+|--------------------------------------------------------------------------
263
+| Global XSS Filtering
264
+|--------------------------------------------------------------------------
265
+|
266
+| Determines whether the XSS filter is always active when GET, POST or
267
+| COOKIE data is encountered
268
+|
269
+*/
270
+$config['global_xss_filtering'] = FALSE;
271
+
272
+/*
273
+|--------------------------------------------------------------------------
274
+| Cross Site Request Forgery
275
+|--------------------------------------------------------------------------
276
+| Enables a CSRF cookie token to be set. When set to TRUE, token will be
277
+| checked on a submitted form. If you are accepting user data, it is strongly
278
+| recommended CSRF protection be enabled.
279
+|
280
+| 'csrf_token_name' = The token name
281
+| 'csrf_cookie_name' = The cookie name
282
+| 'csrf_expire' = The number in seconds the token should expire.
283
+*/
284
+$config['csrf_protection'] = TRUE;
285
+$config['csrf_token_name'] = 'csrf_token';
286
+$config['csrf_cookie_name'] = 'csrf_cookie';
287
+$config['csrf_expire'] = 7200;
288
+
289
+/*
290
+|--------------------------------------------------------------------------
291
+| Output Compression
292
+|--------------------------------------------------------------------------
293
+|
294
+| Enables Gzip output compression for faster page loads.  When enabled,
295
+| the output class will test whether your server supports Gzip.
296
+| Even if it does, however, not all browsers support compression
297
+| so enable only if you are reasonably sure your visitors can handle it.
298
+|
299
+| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
300
+| means you are prematurely outputting something to your browser. It could
301
+| even be a line of whitespace at the end of one of your scripts.  For
302
+| compression to work, nothing can be sent before the output buffer is called
303
+| by the output class.  Do not "echo" any values with compression enabled.
304
+|
305
+*/
306
+$config['compress_output'] = TRUE;
307
+
308
+/*
309
+|--------------------------------------------------------------------------
310
+| Master Time Reference
311
+|--------------------------------------------------------------------------
312
+|
313
+| Options are "local" or "gmt".  This pref tells the system whether to use
314
+| your server's local time as the master "now" reference, or convert it to
315
+| GMT.  See the "date helper" page of the user guide for information
316
+| regarding date handling.
317
+|
318
+*/
319
+$config['time_reference'] = 'local';
320
+
321
+
322
+/*
323
+|--------------------------------------------------------------------------
324
+| Rewrite PHP Short Tags
325
+|--------------------------------------------------------------------------
326
+|
327
+| If your PHP installation does not have short tag support enabled CI
328
+| can rewrite the tags on-the-fly, enabling you to utilize that syntax
329
+| in your view files.  Options are TRUE or FALSE (boolean)
330
+|
331
+*/
332
+$config['rewrite_short_tags'] = FALSE;
333
+
334
+
335
+/*
336
+|--------------------------------------------------------------------------
337
+| Reverse Proxy IPs
338
+|--------------------------------------------------------------------------
339
+|
340
+| If your server is behind a reverse proxy, you must whitelist the proxy IP
341
+| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
342
+| header in order to properly identify the visitor's IP address.
343
+| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
344
+|
345
+*/
346
+$config['proxy_ips'] = '';
347
+
348
+
349
+/* End of file config.php */
350
+/* Location: ./system/application/config/config.php */

+ 114
- 0
application/config/constants.php View File

@@ -0,0 +1,114 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Kanji Constants
6
+|--------------------------------------------------------------------------
7
+|
8
+| Constants defining equivalent kanji for arabic numerals
9
+|
10
+*/
11
+
12
+define('ZERO', '〇');
13
+define('ONE', '一');
14
+define('TWO', '二');
15
+define('THREE', '三');
16
+define('FOUR', '四');
17
+define('FIVE', '五');
18
+define('SIX', '六');
19
+define('SEVEN', '七');
20
+define('EIGHT', '八');
21
+define('NINE', '九');
22
+define('TEN', '十');
23
+define('HUNDRED', '百');
24
+define('THOUSAND', '千');
25
+define('TEN_THOUSAND', '万');
26
+define('HUNDRED_MILLION', '億');
27
+
28
+
29
+/*
30
+|--------------------------------------------------------------------------
31
+| TYPE Constants
32
+|--------------------------------------------------------------------------
33
+|
34
+| Constants defining magic numbers
35
+|
36
+*/
37
+
38
+// Status constants
39
+define('STATUS_CREATED', 1);
40
+define('STATUS_COMPLETED', 2);
41
+define('STATUS_IN_PROGRESS', 3);
42
+define('STATUS_ON_HOLD', 4);
43
+define('STATUS_CANCELED', 5);
44
+
45
+// Permission constants
46
+define('PERM_NO_ACCESS', -1);
47
+define('PERM_READ_ACCESS', 0);
48
+define('PERM_COMMENT_ACCESS',1);
49
+define('PERM_CHECKLIST_ACCESS', 2);
50
+define('PERM_WRITE_ACCESS', 3);
51
+define('PERM_ADMIN_ACCESS', 9);
52
+
53
+// Friend constants
54
+define('FRIEND_NOT_CONFIRMED', -1);
55
+define('FRIEND_CONFIRMED', 1);
56
+define('FRIEND_REJECTED', 0);
57
+
58
+/*
59
+|--------------------------------------------------------------------------
60
+| Formatting Constants
61
+|--------------------------------------------------------------------------
62
+|
63
+| Constants for the Page library
64
+|
65
+*/
66
+
67
+//Define some constants for formatting
68
+define('NL', "\n");
69
+define('T1', "\t");
70
+define('T2', T1.T1);
71
+define('T3', T2.T1);
72
+define('T4', T2.T2);
73
+define('T5', T3.T2);
74
+define('T6', T3.T3);
75
+
76
+/*
77
+|--------------------------------------------------------------------------
78
+| File and Directory Modes
79
+|--------------------------------------------------------------------------
80
+|
81
+| These prefs are used when checking and setting modes when working
82
+| with the file system.  The defaults are fine on servers with proper
83
+| security, but you may wish (or even need) to change the values in
84
+| certain environments (Apache running a separate process for each
85
+| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
86
+| always be used to set the mode correctly.
87
+|
88
+*/
89
+define('FILE_READ_MODE', 0644);
90
+define('FILE_WRITE_MODE', 0666);
91
+define('DIR_READ_MODE', 0755);
92
+define('DIR_WRITE_MODE', 0777);
93
+
94
+/*
95
+|--------------------------------------------------------------------------
96
+| File Stream Modes
97
+|--------------------------------------------------------------------------
98
+|
99
+| These modes are used when working with fopen()/popen()
100
+|
101
+*/
102
+
103
+define('FOPEN_READ', 							'rb');
104
+define('FOPEN_READ_WRITE',						'r+b');
105
+define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 		'wb'); // truncates existing file data, use with care
106
+define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 	'w+b'); // truncates existing file data, use with care
107
+define('FOPEN_WRITE_CREATE', 					'ab');
108
+define('FOPEN_READ_WRITE_CREATE', 				'a+b');
109
+define('FOPEN_WRITE_CREATE_STRICT', 			'xb');
110
+define('FOPEN_READ_WRITE_CREATE_STRICT',		'x+b');
111
+
112
+
113
+/* End of file constants.php */
114
+/* Location: ./system/application/config/constants.php */

+ 62
- 0
application/config/database.php View File

@@ -0,0 +1,62 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| DATABASE CONNECTIVITY SETTINGS
5
+| -------------------------------------------------------------------
6
+| This file will contain the settings needed to access your database.
7
+|
8
+| For complete instructions please consult the "Database Connection"
9
+| page of the User Guide.
10
+|
11
+| -------------------------------------------------------------------
12
+| EXPLANATION OF VARIABLES
13
+| -------------------------------------------------------------------
14
+|
15
+|	['hostname'] The hostname of your database server.
16
+|	['username'] The username used to connect to the database
17
+|	['password'] The password used to connect to the database
18
+|	['database'] The name of the database you want to connect to
19
+|	['dbdriver'] The database type. ie: mysql.  Currently supported:
20
+				 mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21
+|	['dbprefix'] You can add an optional prefix, which will be added
22
+|				 to the table name when using the  Active Record class
23
+|	['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24
+|	['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25
+|	['cache_on'] TRUE/FALSE - Enables/disables query caching
26
+|	['cachedir'] The path to the folder where cache files should be stored
27
+|	['char_set'] The character set used in communicating with the database
28
+|	['dbcollat'] The character collation used in communicating with the database
29
+|
30
+| The $active_group variable lets you choose which connection group to
31
+| make active.  By mysql there is only one group (the "mysql" group).
32
+|
33
+| The $active_record variables lets you determine whether or not to load
34
+| the active record class
35
+*/
36
+
37
+$active_group = "todo";
38
+$active_record = TRUE;
39
+
40
+$db = [
41
+	'todo' => [
42
+		'hostname' => 'localhost',
43
+		'username' => 'todo',
44
+		'password' => 'todo',
45
+		'database' => 'todo',
46
+		'dbdriver' => 'postgre',
47
+		'dbprefix' => 'todo_',
48
+		'pconnect' => TRUE,
49
+		'db_debug' => TRUE,
50
+		'cache_on' => FALSE,
51
+		'cachedir' => '',
52
+		'char_set' => 'utf8',
53
+		'dbcollat' => 'utf8_general_ci',
54
+		'swap_pre' => '',
55
+		'autoinit' => TRUE,
56
+		'stricton' => FALSE
57
+	],
58
+];
59
+
60
+
61
+/* End of file database.php */
62
+/* Location: ./system/application/config/database.php */

+ 17
- 0
application/config/doctypes.php View File

@@ -0,0 +1,17 @@
1
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+
3
+$_doctypes = array(
4
+					'xhtml11'		=> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
5
+					'xhtml11svg' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
6
+
7
+					'xhtml1-strict'	=> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
8
+					'xhtml1-trans'	=> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
9
+					'xhtml1-frame'	=> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
10
+					'html5'			=> '<!DOCTYPE html>',
11
+					'html4-strict'	=> '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
12
+					'html4-trans'	=> '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
13
+					'html4-frame'	=> '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
14
+					);
15
+
16
+/* End of file doctypes.php */
17
+/* Location: application/config/doctypes.php */

+ 67
- 0
application/config/form_validation.php View File

@@ -0,0 +1,67 @@
1
+<?php
2
+$config = [
3
+	'task' => [
4
+		[
5
+			'field' => 'title',
6
+			'label' => 'Title',
7
+			'rules' => 'required|min_length[1]|max_length[255]|xss_clean'
8
+		],
9
+		[
10
+			'field' => 'desc',
11
+			'label' => 'Description',
12
+			'rules' => 'required|min_length[1]|xss_clean'
13
+		],
14
+		[
15
+			'field' => 'category',
16
+			'label' => 'Category',
17
+			'rules' => 'required|is_natural_no_zero'
18
+		],
19
+		[
20
+			'field' => 'priority',
21
+			'label' => 'Priority',
22
+			'rules' => 'required|is_natural'
23
+		],
24
+		[
25
+			'field' => 'due_hour',
26
+			'label' => 'Due Hour',
27
+			'rules' => 'min_length[1]|less_than[24]|is_natural'
28
+		],
29
+		[
30
+			'field' => 'due_minute',
31
+			'label' => 'Due Minute',
32
+			'rules' => 'min_length[1]|less_than[61]|is_natural'
33
+		],
34
+		[
35
+			'field' => 'due',
36
+			'label' => 'Due Date',
37
+			'rules' => 'callback_validate[due_date]'
38
+		],
39
+		[
40
+			'field' => 'reminder',
41
+			'label' => 'Reminder',
42
+			'rules' => ''
43
+		]
44
+	],
45
+	'login/register' => [
46
+		[
47
+			'field' => 'email',
48
+			'label' => 'Email Address',
49
+			'rules' => 'required|callback_validate[valid_email]|is_unique[user.email]'
50
+		],
51
+		[
52
+			'field' => 'user',
53
+			'label' => 'Username',
54
+			'rules' => 'required|is_unique[user.username]'
55
+		],
56
+		[
57
+			'field' => 'pass',
58
+			'label' => 'Password',
59
+			'rules' => 'required',
60
+		],
61
+		[
62
+			'field' => 'pass1',
63
+			'label' => 'Password Confirmation',
64
+			'rules' => 'required|matches[pass]',
65
+		]
66
+	]
67
+];

+ 23
- 0
application/config/hooks.php View File

@@ -0,0 +1,23 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------------
4
+| Hooks
5
+| -------------------------------------------------------------------------
6
+| This file lets you define "hooks" to extend CI without hacking the core
7
+| files.  Please see the user guide for info:
8
+|
9
+|	http://codeigniter.com/user_guide/general/hooks.html
10
+|
11
+*/
12
+
13
+$hook['post_controller_constructor'][] = array(
14
+	'class' => '',
15
+	'function' => 'check_session',
16
+	'filename' => 'pre-controller.php',
17
+	'filepath' => 'hooks'
18
+);
19
+
20
+
21
+
22
+/* End of file hooks.php */
23
+/* Location: ./system/application/config/hooks.php */

+ 10
- 0
application/config/index.html View File

@@ -0,0 +1,10 @@
1
+<html>
2
+<head>
3
+	<title>403 Forbidden</title>
4
+</head>
5
+<body>
6
+
7
+<p>Directory access is forbidden.</p>
8
+
9
+</body>
10
+</html>

+ 105
- 0
application/config/mimes.php View File

@@ -0,0 +1,105 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| MIME TYPES
5
+| -------------------------------------------------------------------
6
+| This file contains an array of mime types.  It is used by the
7
+| Upload class to help identify allowed file types.
8
+|
9
+*/
10
+
11
+$mimes = array(	'hqx'	=>	'application/mac-binhex40',
12
+				'cpt'	=>	'application/mac-compactpro',
13
+				'csv'	=>	array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
14
+				'bin'	=>	'application/macbinary',
15
+				'dms'	=>	'application/octet-stream',
16
+				'lha'	=>	'application/octet-stream',
17
+				'lzh'	=>	'application/octet-stream',
18
+				'exe'	=>	'application/octet-stream',
19
+				'class'	=>	'application/octet-stream',
20
+				'psd'	=>	'application/x-photoshop',
21
+				'so'	=>	'application/octet-stream',
22
+				'sea'	=>	'application/octet-stream',
23
+				'dll'	=>	'application/octet-stream',
24
+				'oda'	=>	'application/oda',
25
+				'pdf'	=>	array('application/pdf', 'application/x-download'),
26
+				'ai'	=>	'application/postscript',
27
+				'eps'	=>	'application/postscript',
28
+				'ps'	=>	'application/postscript',
29
+				'smi'	=>	'application/smil',
30
+				'smil'	=>	'application/smil',
31
+				'mif'	=>	'application/vnd.mif',
32
+				'xls'	=>	array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),
33
+				'ppt'	=>	array('application/powerpoint', 'application/vnd.ms-powerpoint'),
34
+				'wbxml'	=>	'application/wbxml',
35
+				'wmlc'	=>	'application/wmlc',
36
+				'dcr'	=>	'application/x-director',
37
+				'dir'	=>	'application/x-director',
38
+				'dxr'	=>	'application/x-director',
39
+				'dvi'	=>	'application/x-dvi',
40
+				'gtar'	=>	'application/x-gtar',
41
+				'gz'	=>	'application/x-gzip',
42
+				'php'	=>	'application/x-httpd-php',
43
+				'php4'	=>	'application/x-httpd-php',
44
+				'php3'	=>	'application/x-httpd-php',
45
+				'phtml'	=>	'application/x-httpd-php',
46
+				'phps'	=>	'application/x-httpd-php-source',
47
+				'js'	=>	'application/x-javascript',
48
+				'swf'	=>	'application/x-shockwave-flash',
49
+				'sit'	=>	'application/x-stuffit',
50
+				'tar'	=>	'application/x-tar',
51
+				'tgz'	=>	'application/x-tar',
52
+				'xhtml'	=>	'application/xhtml+xml',
53
+				'xht'	=>	'application/xhtml+xml',
54
+				'zip'	=>  array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
55
+				'mid'	=>	'audio/midi',
56
+				'midi'	=>	'audio/midi',
57
+				'mpga'	=>	'audio/mpeg',
58
+				'mp2'	=>	'audio/mpeg',
59
+				'mp3'	=>	array('audio/mpeg', 'audio/mpg'),
60
+				'aif'	=>	'audio/x-aiff',
61
+				'aiff'	=>	'audio/x-aiff',
62
+				'aifc'	=>	'audio/x-aiff',
63
+				'ram'	=>	'audio/x-pn-realaudio',
64
+				'rm'	=>	'audio/x-pn-realaudio',
65
+				'rpm'	=>	'audio/x-pn-realaudio-plugin',
66
+				'ra'	=>	'audio/x-realaudio',
67
+				'rv'	=>	'video/vnd.rn-realvideo',
68
+				'wav'	=>	'audio/x-wav',
69
+				'bmp'	=>	'image/bmp',
70
+				'gif'	=>	'image/gif',
71
+				'jpeg'	=>	array('image/jpeg', 'image/pjpeg'),
72
+				'jpg'	=>	array('image/jpeg', 'image/pjpeg'),
73
+				'jpe'	=>	array('image/jpeg', 'image/pjpeg'),
74
+				'png'	=>	array('image/png',  'image/x-png'),
75
+				'tiff'	=>	'image/tiff',
76
+				'tif'	=>	'image/tiff',
77
+				'css'	=>	'text/css',
78
+				'html'	=>	'text/html',
79
+				'htm'	=>	'text/html',
80
+				'shtml'	=>	'text/html',
81
+				'txt'	=>	'text/plain',
82
+				'text'	=>	'text/plain',
83
+				'log'	=>	array('text/plain', 'text/x-log'),
84
+				'rtx'	=>	'text/richtext',
85
+				'rtf'	=>	'text/rtf',
86
+				'xml'	=>	'text/xml',
87
+				'xsl'	=>	'text/xml',
88
+				'mpeg'	=>	'video/mpeg',
89
+				'mpg'	=>	'video/mpeg',
90
+				'mpe'	=>	'video/mpeg',
91
+				'qt'	=>	'video/quicktime',
92
+				'mov'	=>	'video/quicktime',
93
+				'avi'	=>	'video/x-msvideo',
94
+				'movie'	=>	'video/x-sgi-movie',
95
+				'doc'	=>	'application/msword',
96
+				'docx'	=>	'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
97
+				'xlsx'	=>	'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
98
+				'word'	=>	array('application/msword', 'application/octet-stream'),
99
+				'xl'	=>	'application/excel',
100
+				'eml'	=>	'message/rfc822'
101
+			);
102
+
103
+
104
+/* End of file mimes.php */
105
+/* Location: ./system/application/config/mimes.php */

+ 144
- 0
application/config/min_config.php View File

@@ -0,0 +1,144 @@
1
+<?php
2
+
3
+/**
4
+ * Configuration for default Minify application
5
+ * @package Minify
6
+ */
7
+
8
+
9
+/**
10
+ * In 'debug' mode, Minify can combine files with no minification and
11
+ * add comments to indicate line #s of the original files.
12
+ *
13
+ * To allow debugging, set this option to true and add "&debug=1" to
14
+ * a URI. E.g. /min/?f=script1.js,script2.js&debug=1
15
+ */
16
+$min_allowDebugFlag = true;
17
+
18
+
19
+/**
20
+ * Set to true to log messages to FirePHP (Firefox Firebug addon).
21
+ * Set to false for no error logging (Minify may be slightly faster).
22
+ * @link http://www.firephp.org/
23
+ *
24
+ * If you want to use a custom error logger, set this to your logger
25
+ * instance. Your object should have a method log(string $message).
26
+ *
27
+ * @todo cache system does not have error logging yet.
28
+ */
29
+$min_errorLogger = false;
30
+
31
+
32
+/**
33
+ * For best performance, specify your temp directory here. Otherwise Minify
34
+ * will have to load extra code to guess. Some examples below:
35
+ */
36
+$min_cachePath = realpath(dirname(__FILE__) . '/../../application/cache');
37
+
38
+/**
39
+ * Leave an empty string to use PHP's $_SERVER['DOCUMENT_ROOT'].
40
+ *
41
+ * On some servers, this value may be misconfigured or missing. If so, set this
42
+ * to your full document root path with no trailing slash.
43
+ * E.g. '/home/accountname/public_html' or 'c:\\xampp\\htdocs'
44
+ *
45
+ * If /min/ is directly inside your document root, just uncomment the
46
+ * second line. The third line might work on some Apache servers.
47
+ */
48
+$min_documentRoot = '';
49
+//$min_documentRoot = substr(__FILE__, 0, strlen(__FILE__) - 15);
50
+//$min_documentRoot = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];
51
+
52
+/**
53
+ * Cache file locking. Set to false if filesystem is NFS. On at least one
54
+ * NFS system flock-ing attempts stalled PHP for 30 seconds!
55
+ */
56
+$min_cacheFileLocking = true;
57
+
58
+
59
+/**
60
+ * Combining multiple CSS files can place @import declarations after rules, which
61
+ * is invalid. Minify will attempt to detect when this happens and place a
62
+ * warning comment at the top of the CSS output. To resolve this you can either
63
+ * move the @imports within your CSS files, or enable this option, which will
64
+ * move all @imports to the top of the output. Note that moving @imports could
65
+ * affect CSS values (which is why this option is disabled by default).
66
+ */
67
+$min_serveOptions['bubbleCssImports'] = false;
68
+
69
+
70
+/**
71
+ * Maximum age of browser cache in seconds. After this period, the browser
72
+ * will send another conditional GET. Use a longer period for lower traffic
73
+ * but you may want to shorten this before making changes if it's crucial
74
+ * those changes are seen immediately.
75
+ *
76
+ * Note: Despite this setting, if you include a number at the end of the
77
+ * querystring, maxAge will be set to one year. E.g. /min/f=hello.css&123456
78
+ */
79
+$min_serveOptions['maxAge'] = 1800;
80
+
81
+
82
+/**
83
+ * If you'd like to restrict the "f" option to files within/below
84
+ * particular directories below DOCUMENT_ROOT, set this here.
85
+ * You will still need to include the directory in the
86
+ * f or b GET parameters.
87
+ *
88
+ * // = shortcut for DOCUMENT_ROOT
89
+ */
90
+//$min_serveOptions['minApp']['allowDirs'] = array('//js', '//css');
91
+
92
+/**
93
+ * Set to true to disable the "f" GET parameter for specifying files.
94
+ * Only the "g" parameter will be considered.
95
+ */
96
+$min_serveOptions['minApp']['groupsOnly'] = false;
97
+
98
+/**
99
+ * Maximum # of files that can be specified in the "f" GET parameter
100
+ */
101
+$min_serveOptions['minApp']['maxFiles'] = 10;
102
+
103
+
104
+/**
105
+ * If you minify CSS files stored in symlink-ed directories, the URI rewriting
106
+ * algorithm can fail. To prevent this, provide an array of link paths to
107
+ * target paths, where the link paths are within the document root.
108
+ *
109
+ * Because paths need to be normalized for this to work, use "//" to substitute
110
+ * the doc root in the link paths (the array keys). E.g.:
111
+ * <code>
112
+ * array('//symlink' => '/real/target/path') // unix
113
+ * array('//static' => 'D:\\staticStorage')  // Windows
114
+ * </code>
115
+ */
116
+$min_symlinks = array(
117
+
118
+);
119
+
120
+
121
+/**
122
+ * If you upload files from Windows to a non-Windows server, Windows may report
123
+ * incorrect mtimes for the files. This may cause Minify to keep serving stale
124
+ * cache files when source file changes are made too frequently (e.g. more than
125
+ * once an hour).
126
+ *
127
+ * Immediately after modifying and uploading a file, use the touch command to
128
+ * update the mtime on the server. If the mtime jumps ahead by a number of hours,
129
+ * set this variable to that number. If the mtime moves back, this should not be
130
+ * needed.
131
+ *
132
+ * In the Windows SFTP client WinSCP, there's an option that may fix this
133
+ * issue without changing the variable below. Under login > environment,
134
+ * select the option "Adjust remote timestamp with DST".
135
+ * @link http://winscp.net/eng/docs/ui_login_environment#daylight_saving_time
136
+ */
137
+$min_uploaderHoursBehind = 0;
138
+
139
+
140
+// try to disable output_compression (may not have an effect)
141
+ini_set('zlib.output_compression', '0');
142
+
143
+//Use JSMin+
144
+$min_serveOptions['minifiers']['application/x-javascript'] = array('JSMinPlus', 'minify');

+ 36
- 0
application/config/min_groupsConfig.php View File

@@ -0,0 +1,36 @@
1
+<?php
2
+/**
3
+ * Groups configuration for default Minify implementation
4
+ * @package Minify
5
+ */
6
+ 
7
+$root = "//";
8
+
9
+return array(
10
+	
11
+	/*-----
12
+			Css				
13
+					-----*/
14
+	
15
+	'css' => array(
16
+		$root. 'fonts/Puritan/stylesheet.css',
17
+		$root. 'css/todo.css',
18
+		$root. 'css/message.css',
19
+		$root. 'js/CLEditor/jquery.cleditor.css',
20
+		$root. 'css/jquery-ui.min.css'
21
+	),
22
+	
23
+	/*-----
24
+		  Javascript			
25
+					-----*/
26
+	'js' => array(
27
+		$root. 'js/CLEditor/jquery.cleditor.js',
28
+		$root. 'js/CLEditor/jquery.cleditor.xhtml.js',
29
+		$root. 'js/todo.js',
30
+	),
31
+	
32
+	'js_mobile' => array(
33
+		$root. 'js/todo.js',
34
+	),
35
+
36
+);

+ 53
- 0
application/config/profiler.php View File

@@ -0,0 +1,53 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/**
3
+ * CodeIgniter
4
+ *
5
+ * An open source application development framework for PHP 5.1.6 or newer
6
+ *
7
+ * NOTICE OF LICENSE
8
+ * 
9
+ * Licensed under the Academic Free License version 3.0
10
+ * 
11
+ * This source file is subject to the Academic Free License (AFL 3.0) that is
12
+ * bundled with this package in the files license_afl.txt / license_afl.rst.
13
+ * It is also available through the world wide web at this URL:
14
+ * http://opensource.org/licenses/AFL-3.0
15
+ * If you did not receive a copy of the license and are unable to obtain it
16
+ * through the world wide web, please send an email to
17
+ * licensing@ellislab.com so we can send you a copy immediately.
18
+ *
19
+ * @package		CodeIgniter
20
+ * @author		EllisLab Dev Team
21
+ * @copyright	Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
22
+ * @license		http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
23
+ * @link		http://codeigniter.com
24
+ * @since		Version 1.0
25
+ * @filesource
26
+ */
27
+
28
+/*
29
+| -------------------------------------------------------------------------
30
+| Profiler Sections
31
+| -------------------------------------------------------------------------
32
+| This file lets you determine whether or not various sections of Profiler
33
+| data are displayed when the Profiler is enabled.
34
+| Please see the user guide for info:
35
+|
36
+|	http://codeigniter.com/user_guide/general/profiling.html
37
+|
38
+*/
39
+$config['config'] = FALSE;
40
+$config['http_headers'] = FALSE;
41
+$config['uri_string'] = FALSE;
42
+$config['get'] = FALSE;
43
+$config['controller_info'] = FALSE;
44
+$config['session_data'] = FALSE;
45
+$config['post'] = FALSE;
46
+$config['benchmarks'] = FALSE;
47
+$config['memory_usage'] = FALSE;
48
+$config['query_toggle_count'] = 1;
49
+
50
+
51
+
52
+/* End of file profiler.php */
53
+/* Location: ./application/config/profiler.php */

+ 54
- 0
application/config/routes.php View File

@@ -0,0 +1,54 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------------
4
+| URI ROUTING
5
+| -------------------------------------------------------------------------
6
+| This file lets you re-map URI requests to specific controller functions.
7
+|
8
+| Typically there is a one-to-one relationship between a URL string
9
+| and its corresponding controller class/method. The segments in a
10
+| URL normally follow this pattern:
11
+|
12
+| 	example.com/class/method/id/
13
+|
14
+| In some instances, however, you may want to remap this relationship
15
+| so that a different class/function is called than the one
16
+| corresponding to the URL.
17
+|
18
+| Please see the user guide for complete details:
19
+|
20
+|	http://codeigniter.com/user_guide/general/routing.html
21
+|
22
+| -------------------------------------------------------------------------
23
+| RESERVED ROUTES
24
+| -------------------------------------------------------------------------
25
+|
26
+| There are two reserved routes:
27
+|
28
+|	$route['default_controller'] = 'welcome';
29
+|
30
+| This route indicates which controller class should be loaded if the
31
+| URI contains no data. In the above example, the "welcome" class
32
+| would be loaded.
33
+|
34
+*/
35
+
36
+$route = [
37
+	'default_controller' => 'login',
38
+	
39
+	'logout' => 'login/logout',
40
+	'login' => 'login/do_login',
41
+	'register' => 'login/register',
42
+	'task/list' => 'task/list_tasks',
43
+	'friend/list' => 'friend/friend_list',
44
+	'category/list' => 'category/category_list',
45
+	'task/category/list' => 'category/category_list',
46
+	'task/calendar' => 'calendar/index',
47
+	'task/calendar/:any' => 'calendar/index',
48
+	'task/archive/:num' => 'task/archive',
49
+	
50
+	'404_overide' => ''
51
+];
52
+
53
+/* End of file routes.php */
54
+/* Location: ./system/application/config/routes.php */

+ 119
- 0
application/config/sites.php View File

@@ -0,0 +1,119 @@
1
+<?php
2
+include "config.php";
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Content Domain
6
+|--------------------------------------------------------------------------
7
+|
8
+| This is the domain used for serving content, such as css, javascript.
9
+|
10
+*/
11
+$config['content_domain'] = $config['base_url'];
12
+
13
+/*
14
+|--------------------------------------------------------------------------
15
+| Content Domain
16
+|--------------------------------------------------------------------------
17
+|
18
+| This is the domain/subdomain used for serving images.
19
+|
20
+*/
21
+$config['image_domain'] = $config['content_domain'].'/images';
22
+
23
+/*
24
+|--------------------------------------------------------------------------
25
+| Static Lib Path
26
+|--------------------------------------------------------------------------
27
+|
28
+| This is the path where the 'libs' directory is on the static domain.
29
+|
30
+*/
31
+$config['static_lib_path'] = $config['content_domain'];
32
+
33
+/*
34
+|--------------------------------------------------------------------------
35
+| Group Style/Javascript Path
36
+|--------------------------------------------------------------------------
37
+|
38
+| This is the path that is used to determine the relative path to the
39
+| stylesheet minifier. This should not need to be changed.
40
+|
41
+*/
42
+$config['group_style_path'] = $config['static_lib_path'] . 'min/index.php?g=';
43
+
44
+/*
45
+|--------------------------------------------------------------------------
46
+| Default Style Path
47
+|--------------------------------------------------------------------------
48
+|
49
+| This is the path that is used to determine the relative path to the
50
+| stylesheet minifier. This should not need to be changed.
51
+|
52
+*/
53
+$config['style_path'] = $config['static_lib_path'] . '/min/index.php?b=css&amp;f=';
54
+
55
+/*
56
+|--------------------------------------------------------------------------
57
+| Default Javascript Path
58
+|--------------------------------------------------------------------------
59
+|
60
+| This is the path that is used to determine the relative path to the
61
+| stylesheet minifier. This should not need to be changed.
62
+|
63
+*/
64
+$config['script_path'] = $config['static_lib_path'] . '/min/index.php?b=js&amp;f=';
65
+
66
+
67
+/*
68
+|--------------------------------------------------------------------------
69
+| Default title
70
+|--------------------------------------------------------------------------
71
+|
72
+| Default title for webpages
73
+|
74
+*/
75
+
76
+$config['default_title'] = "Tim's Todo";
77
+
78
+/*
79
+|--------------------------------------------------------------------------
80
+| Default css group
81
+|--------------------------------------------------------------------------
82
+|
83
+| Default css group
84
+|
85
+*/
86
+$config['default_js_group'] = "js";
87
+$config['default_css_group'] = "css";
88
+
89
+/*
90
+|--------------------------------------------------------------------------
91
+| Ignore IPs
92
+|--------------------------------------------------------------------------
93
+|
94
+| IP address that are not counted in stats
95
+|
96
+*/
97
+
98
+$config['ignore_ips'] = array('127.0.0.1');
99
+
100
+/*
101
+|--------------------------------------------------------------------------
102
+| Ignore UserAgents
103
+|--------------------------------------------------------------------------
104
+|
105
+| UserAgents that are not counted in stats
106
+|
107
+*/
108
+
109
+$config['ignore_user_agents'] = array();
110
+
111
+/*
112
+|--------------------------------------------------------------------------
113
+| Enable Reminders
114
+|--------------------------------------------------------------------------
115
+|
116
+| Only enable if you can set a cron job or scheduled task for the reminder feature
117
+|
118
+*/
119
+$config['enable_reminders'] = TRUE;

+ 66
- 0
application/config/smileys.php View File

@@ -0,0 +1,66 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| SMILEYS
5
+| -------------------------------------------------------------------
6
+| This file contains an array of smileys for use with the emoticon helper.
7
+| Individual images can be used to replace multiple simileys.  For example:
8
+| :-) and :) use the same image replacement.
9
+|
10
+| Please see user guide for more info: 
11
+| http://codeigniter.com/user_guide/helpers/smiley_helper.html
12
+|
13
+*/
14
+
15
+$smileys = array(
16
+
17
+//	smiley			image name						width	height	alt
18
+
19
+	':-)'			=>	array('grin.gif',			'19',	'19',	'grin'),
20
+	':lol:'			=>	array('lol.gif',			'19',	'19',	'LOL'),
21
+	':cheese:'		=>	array('cheese.gif',			'19',	'19',	'cheese'),
22
+	':)'			=>	array('smile.gif',			'19',	'19',	'smile'),
23
+	';-)'			=>	array('wink.gif',			'19',	'19',	'wink'),
24
+	';)'			=>	array('wink.gif',			'19',	'19',	'wink'),
25
+	':smirk:'		=>	array('smirk.gif',			'19',	'19',	'smirk'),
26
+	':roll:'		=>	array('rolleyes.gif',		'19',	'19',	'rolleyes'),
27
+	':-S'			=>	array('confused.gif',		'19',	'19',	'confused'),
28
+	':wow:'			=>	array('surprise.gif',		'19',	'19',	'surprised'),
29
+	':bug:'			=>	array('bigsurprise.gif',	'19',	'19',	'big surprise'),
30
+	':-P'			=>	array('tongue_laugh.gif',	'19',	'19',	'tongue laugh'),
31
+	'%-P'			=>	array('tongue_rolleye.gif',	'19',	'19',	'tongue rolleye'),
32
+	';-P'			=>	array('tongue_wink.gif',	'19',	'19',	'tongue wink'),
33
+	':P'			=>	array('raspberry.gif',		'19',	'19',	'raspberry'),
34
+	':blank:'		=>	array('blank.gif',			'19',	'19',	'blank stare'),
35
+	':long:'		=>	array('longface.gif',		'19',	'19',	'long face'),
36
+	':ohh:'			=>	array('ohh.gif',			'19',	'19',	'ohh'),
37
+	':grrr:'		=>	array('grrr.gif',			'19',	'19',	'grrr'),
38
+	':gulp:'		=>	array('gulp.gif',			'19',	'19',	'gulp'),
39
+	'8-/'			=>	array('ohoh.gif',			'19',	'19',	'oh oh'),
40
+	':down:'		=>	array('downer.gif',			'19',	'19',	'downer'),
41
+	':red:'			=>	array('embarrassed.gif',	'19',	'19',	'red face'),
42
+	':sick:'		=>	array('sick.gif',			'19',	'19',	'sick'),
43
+	':shut:'		=>	array('shuteye.gif',		'19',	'19',	'shut eye'),
44
+	':-/'			=>	array('hmm.gif',			'19',	'19',	'hmmm'),
45
+	'>:('			=>	array('mad.gif',			'19',	'19',	'mad'),
46
+	':mad:'			=>	array('mad.gif',			'19',	'19',	'mad'),
47
+	'>:-('			=>	array('angry.gif',			'19',	'19',	'angry'),
48
+	':angry:'		=>	array('angry.gif',			'19',	'19',	'angry'),
49
+	':zip:'			=>	array('zip.gif',			'19',	'19',	'zipper'),
50
+	':kiss:'		=>	array('kiss.gif',			'19',	'19',	'kiss'),
51
+	':ahhh:'		=>	array('shock.gif',			'19',	'19',	'shock'),
52
+	':coolsmile:'	=>	array('shade_smile.gif',	'19',	'19',	'cool smile'),
53
+	':coolsmirk:'	=>	array('shade_smirk.gif',	'19',	'19',	'cool smirk'),
54
+	':coolgrin:'	=>	array('shade_grin.gif',		'19',	'19',	'cool grin'),
55
+	':coolhmm:'		=>	array('shade_hmm.gif',		'19',	'19',	'cool hmm'),
56
+	':coolmad:'		=>	array('shade_mad.gif',		'19',	'19',	'cool mad'),
57
+	':coolcheese:'	=>	array('shade_cheese.gif',	'19',	'19',	'cool cheese'),
58
+	':vampire:'		=>	array('vampire.gif',		'19',	'19',	'vampire'),
59
+	':snake:'		=>	array('snake.gif',			'19',	'19',	'snake'),
60
+	':exclaim:'		=>	array('exclaim.gif',		'19',	'19',	'excaim'),
61
+	':question:'	=>	array('question.gif',		'19',	'19',	'question') // no comma after last item
62
+
63
+		);
64
+
65
+/* End of file smileys.php */
66
+/* Location: ./system/application/config/smileys.php */

+ 62
- 0
application/config/testing/database.php View File

@@ -0,0 +1,62 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| DATABASE CONNECTIVITY SETTINGS
5
+| -------------------------------------------------------------------
6
+| This file will contain the settings needed to access your database.
7
+|
8
+| For complete instructions please consult the "Database Connection"
9
+| page of the User Guide.
10
+|
11
+| -------------------------------------------------------------------
12
+| EXPLANATION OF VARIABLES
13
+| -------------------------------------------------------------------
14
+|
15
+|	['hostname'] The hostname of your database server.
16
+|	['username'] The username used to connect to the database
17
+|	['password'] The password used to connect to the database
18
+|	['database'] The name of the database you want to connect to
19
+|	['dbdriver'] The database type. ie: mysql.  Currently supported:
20
+				 mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21
+|	['dbprefix'] You can add an optional prefix, which will be added
22
+|				 to the table name when using the  Active Record class
23
+|	['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24
+|	['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25
+|	['cache_on'] TRUE/FALSE - Enables/disables query caching
26
+|	['cachedir'] The path to the folder where cache files should be stored
27
+|	['char_set'] The character set used in communicating with the database
28
+|	['dbcollat'] The character collation used in communicating with the database
29
+|
30
+| The $active_group variable lets you choose which connection group to
31
+| make active.  By mysql there is only one group (the "mysql" group).
32
+|
33
+| The $active_record variables lets you determine whether or not to load
34
+| the active record class
35
+*/
36
+
37
+$active_group = "todo";
38
+$active_record = TRUE;
39
+
40
+$db = [
41
+	'todo' => [
42
+		'hostname' => 'localhost',
43
+		'username' => 'todo_test',
44
+		'password' => 'test',
45
+		'database' => 'todo_test',
46
+		'dbdriver' => 'postgre',
47
+		'dbprefix' => 'todo_',
48
+		'pconnect' => FALSE,
49
+		'db_debug' => TRUE,
50
+		'cache_on' => FALSE,
51
+		'cachedir' => '',
52
+		'char_set' => 'utf8',
53
+		'dbcollat' => 'utf8_general_ci',
54
+		'swap_pre' => '',
55
+		'autoinit' => FALSE,
56
+		'stricton' => FALSE
57
+	]
58
+];
59
+
60
+
61
+/* End of file database.php */
62
+/* Location: ./system/application/config/database.php */

+ 175
- 0
application/config/user_agents.php View File

@@ -0,0 +1,175 @@
1
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
+/*
3
+| -------------------------------------------------------------------
4
+| USER AGENT TYPES
5
+| -------------------------------------------------------------------
6
+| This file contains four arrays of user agent data.  It is used by the
7
+| User Agent Class to help identify browser, platform, robot, and
8
+| mobile device data.  The array keys are used to identify the device
9
+| and the array values are used to set the actual name of the item.
10
+|
11
+*/
12
+
13
+$platforms = array (
14
+					'windows nt 6.0'	=> 'Windows Longhorn',
15
+					'windows nt 5.2'	=> 'Windows 2003',
16
+					'windows nt 5.0'	=> 'Windows 2000',
17
+					'windows nt 5.1'	=> 'Windows XP',
18
+					'windows nt 4.0'	=> 'Windows NT 4.0',
19
+					'winnt4.0'			=> 'Windows NT 4.0',
20
+					'winnt 4.0'			=> 'Windows NT',
21
+					'winnt'				=> 'Windows NT',
22
+					'windows 98'		=> 'Windows 98',
23
+					'win98'				=> 'Windows 98',
24
+					'windows 95'		=> 'Windows 95',
25
+					'win95'				=> 'Windows 95',
26
+					'windows'			=> 'Unknown Windows OS',
27
+					'os x'				=> 'Mac OS X',
28
+					'ppc mac'			=> 'Power PC Mac',
29
+					'freebsd'			=> 'FreeBSD',
30
+					'ppc'				=> 'Macintosh',
31
+					'linux'				=> 'Linux',
32
+					'debian'			=> 'Debian',
33
+					'sunos'				=> 'Sun Solaris',
34
+					'beos'				=> 'BeOS',
35
+					'apachebench'		=> 'ApacheBench',
36
+					'aix'				=> 'AIX',
37
+					'irix'				=> 'Irix',
38
+					'osf'				=> 'DEC OSF',
39
+					'hp-ux'				=> 'HP-UX',
40
+					'netbsd'			=> 'NetBSD',
41
+					'bsdi'				=> 'BSDi',
42
+					'openbsd'			=> 'OpenBSD',
43
+					'gnu'				=> 'GNU/Linux',
44
+					'unix'				=> 'Unknown Unix OS'
45
+				);
46
+
47
+
48
+// The order of this array should NOT be changed. Many browsers return
49
+// multiple browser types so we want to identify the sub-type first.
50
+$browsers = array(
51
+					'Opera'				=> 'Opera',
52
+					'MSIE'				=> 'Internet Explorer',
53
+					'Internet Explorer'	=> 'Internet Explorer',
54
+					'Shiira'			=> 'Shiira',
55
+					'Firefox'			=> 'Firefox',
56
+					'Chimera'			=> 'Chimera',
57
+					'Phoenix'			=> 'Phoenix',
58
+					'Firebird'			=> 'Firebird',
59
+					'Camino'			=> 'Camino',
60
+					'Netscape'			=> 'Netscape',
61
+					'OmniWeb'			=> 'OmniWeb',
62
+					'Safari'			=> 'Safari',
63
+					'Mozilla'			=> 'Mozilla',
64
+					'Konqueror'			=> 'Konqueror',
65
+					'icab'				=> 'iCab',
66
+					'Lynx'				=> 'Lynx',
67
+					'Links'				=> 'Links',
68
+					'hotjava'			=> 'HotJava',
69
+					'amaya'				=> 'Amaya',
70
+					'IBrowse'			=> 'IBrowse'
71
+				);
72
+
73
+$mobiles = array(
74
+					// legacy array, old values commented out
75
+					'mobileexplorer'	=> 'Mobile Explorer',
76
+//					'openwave'			=> 'Open Wave',
77
+//					'opera mini'		=> 'Opera Mini',
78
+//					'operamini'			=> 'Opera Mini',
79
+//					'elaine'			=> 'Palm',
80
+					'palmsource'		=> 'Palm',
81
+//					'digital paths'		=> 'Palm',
82
+//					'avantgo'			=> 'Avantgo',
83
+//					'xiino'				=> 'Xiino',
84
+					'palmscape'			=> 'Palmscape',
85
+//					'nokia'				=> 'Nokia',
86
+//					'ericsson'			=> 'Ericsson',
87
+//					'blackberry'		=> 'BlackBerry',
88
+//					'motorola'			=> 'Motorola'
89
+
90
+					// Phones and Manufacturers
91
+					'motorola'			=> "Motorola",
92
+					'nokia'				=> "Nokia",
93
+					'palm'				=> "Palm",
94
+					'iphone'			=> "Apple iPhone",
95
+					'ipod'				=> "Apple iPod Touch",
96
+					'sony'				=> "Sony Ericsson",
97
+					'ericsson'			=> "Sony Ericsson",
98
+					'blackberry'		=> "BlackBerry",
99
+					'cocoon'			=> "O2 Cocoon",
100
+					'blazer'			=> "Treo",
101
+					'lg'				=> "LG",
102
+					'amoi'				=> "Amoi",
103
+					'xda'				=> "XDA",
104
+					'mda'				=> "MDA",
105
+					'vario'				=> "Vario",
106
+					'htc'				=> "HTC",
107
+					'samsung'			=> "Samsung",
108
+					'sharp'				=> "Sharp",
109
+					'sie-'				=> "Siemens",
110
+					'alcatel'			=> "Alcatel",
111
+					'benq'				=> "BenQ",
112
+					'ipaq'				=> "HP iPaq",
113
+					'mot-'				=> "Motorola",
114
+					'playstation portable' 	=> "PlayStation Portable",
115
+					'hiptop'			=> "Danger Hiptop",
116
+					'nec-'				=> "NEC",
117
+					'panasonic'			=> "Panasonic",
118
+					'philips'			=> "Philips",
119
+					'sagem'				=> "Sagem",
120
+					'sanyo'				=> "Sanyo",
121
+					'spv'				=> "SPV",
122
+					'zte'				=> "ZTE",
123
+					'sendo'				=> "Sendo",
124
+
125
+					// Operating Systems
126
+					'symbian'				=> "Symbian",
127
+					'SymbianOS'				=> "SymbianOS", 
128
+					'elaine'				=> "Palm",
129
+					'palm'					=> "Palm",
130
+					'series60'				=> "Symbian S60",
131
+					'windows ce'			=> "Windows CE",
132
+
133
+					// Browsers
134
+					'obigo'					=> "Obigo",
135
+					'netfront'				=> "Netfront Browser",
136
+					'openwave'				=> "Openwave Browser",
137
+					'mobilexplorer'			=> "Mobile Explorer",
138
+					'operamini'				=> "Opera Mini",
139
+					'opera mini'			=> "Opera Mini",
140
+
141
+					// Other
142
+					'digital paths'			=> "Digital Paths",
143
+					'avantgo'				=> "AvantGo",
144
+					'xiino'					=> "Xiino",
145
+					'novarra'				=> "Novarra Transcoder",
146
+					'vodafone'				=> "Vodafone",
147
+					'docomo'				=> "NTT DoCoMo",
148
+					'o2'					=> "O2",
149
+
150
+					// Fallback
151
+					'mobile'				=> "Generic Mobile",
152
+					'wireless' 				=> "Generic Mobile",
153
+					'j2me'					=> "Generic Mobile",
154
+					'midp'					=> "Generic Mobile",
155
+					'cldc'					=> "Generic Mobile",
156
+					'up.link'				=> "Generic Mobile",
157
+					'up.browser'			=> "Generic Mobile",
158
+					'smartphone'			=> "Generic Mobile",
159
+					'cellphone'				=> "Generic Mobile"
160
+				);
161
+
162
+// There are hundreds of bots but these are the most common.
163
+$robots = array(
164
+					'googlebot'			=> 'Googlebot',
165
+					'msnbot'			=> 'MSNBot',
166
+					'slurp'				=> 'Inktomi Slurp',
167
+					'yahoo'				=> 'Yahoo',
168
+					'askjeeves'			=> 'AskJeeves',
169
+					'fastcrawler'		=> 'FastCrawler',
170
+					'infoseek'			=> 'InfoSeek Robot 1.0',
171
+					'lycos'				=> 'Lycos'
172
+				);
173
+
174
+/* End of file user_agents.php */
175
+/* Location: ./system/application/config/user_agents.php */

+ 103
- 0
application/controllers/account.php View File

@@ -0,0 +1,103 @@
1
+<?php
2
+
3
+/**
4
+ * Account Management Controller
5
+ */
6
+class Account extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->page->set_foot_js_group('js');
15
+		$this->page->set_title('Account');
16
+	}
17
+
18
+	// --------------------------------------------------------------------------
19
+
20
+	/**
21
+	 * Dashboard
22
+	 */
23
+	public function index()
24
+	{
25
+		$data = $this->todo->get_user_account_by_id($this->session->userdata('uid'));
26
+		$this->page->build('account/status', $data);
27
+	}
28
+
29
+	// --------------------------------------------------------------------------
30
+
31
+	/**
32
+	 * Password change form
33
+	 */
34
+	public function password()
35
+	{
36
+		//Don't let the guest change the password
37
+		if($this->session->userdata('username') == 'guest')
38
+		{
39
+			$this->todo->redirect_303('account');
40
+			return;
41
+		}
42
+
43
+		if($this->input->post('pass_sub') == "Change Password")
44
+		{
45
+			$val = $this->todo->validate_pass();
46
+			if($val === TRUE)
47
+			{
48
+				$this->todo->update_pass();
49
+				//Redirect to index
50
+				$this->todo->redirect_303('task/list');
51
+			}
52
+			else
53
+			{
54
+				$data['err'] = $val;
55
+				$this->page->build('account/password', $data);
56
+			}
57
+		}
58
+		else
59
+		{
60
+			$this->page->build('account/password');
61
+		}
62
+	}
63
+
64
+	// --------------------------------------------------------------------------
65
+
66
+	/**
67
+	 * Timezone update
68
+	 */
69
+	public function update_tz()
70
+	{
71
+		$timezone = $this->input->post('timezone');
72
+
73
+		$this->db->set('timezone', $timezone)
74
+			->where('id', $this->session->userdata('uid'))
75
+			->update('user');
76
+
77
+		if($this->db->affected_rows() == 1)
78
+		{
79
+			$this->output->set_output('1');
80
+		}
81
+	}
82
+
83
+	// --------------------------------------------------------------------------
84
+
85
+	/**
86
+	 * Number format update
87
+	 */
88
+	public function update_nf()
89
+	{
90
+		$num_format = (int)$this->input->post('num_format');
91
+
92
+		$this->db->set('num_format', $num_format)
93
+			->where('id', $this->session->userdata('uid'))
94
+			->update('user');
95
+
96
+		if($this->db->affected_rows() == 1)
97
+		{
98
+			$this->session->set_userdata('num_format', $num_format);
99
+			$this->output->set_output('1');
100
+		}
101
+	}
102
+}
103
+// End of controllers/account.php

+ 133
- 0
application/controllers/calendar.php View File

@@ -0,0 +1,133 @@
1
+<?php
2
+
3
+/**
4
+ * Calendar View Controller
5
+ */
6
+class Calendar extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->load->library('calendar');
15
+		$this->load->model('task_model');
16
+		
17
+	}
18
+
19
+	/**
20
+	 * Calendar View
21
+	 */
22
+	public function index()
23
+	{
24
+		//Output
25
+		$this->page->build('task/calendar', $this->get_calendar_data());
26
+	}
27
+
28
+	/**
29
+	 * Get the data for the calendar display
30
+	 *
31
+	 * @return mixed
32
+	 */
33
+	protected function get_calendar_data()
34
+	{
35
+		//Offset time for custom months
36
+		if($this->uri->segment(3) && $this->uri->segment(4))
37
+		{
38
+			$year = $this->uri->segment(3);
39
+			$month = $this->uri->segment(4);
40
+		}
41
+
42
+		$_months = array(
43
+			01 => 'January', 02 => 'February',
44
+			03 => 'March', 04 => 'April',
45
+			05 => 'May', 06 => 'June',
46
+			07 => 'July', 08 => 'August',
47
+			09 => 'September', 10 => 'October',
48
+			11 => 'November', 12 => 'December',
49
+			1 => 'January', 2 => 'February',
50
+			3 => 'March', 4 => 'April',
51
+			5 => 'May', 6 => 'June',
52
+			7 => 'July', 8 => 'August',
53
+			9 => 'September',
54
+		);
55
+
56
+		$year = (isset($year)) ? $year : date('Y');
57
+		$month = (isset($month)) ? $month : date('m');
58
+
59
+		$local_time = time();
60
+
61
+		$data['month'] = $_months[(int)$month].' '.$year;
62
+		$data['calendar'] = array();
63
+		$data['today'] = getdate();
64
+
65
+		$days_in_month = $this->calendar->get_total_days($month, $year);
66
+
67
+		// Set the starting day number
68
+		$local_date = mktime(0, 0, 0, $month, 1, $year);
69
+		$month_end  = mktime(0, 0, 0, $month, $days_in_month, $year);
70
+		$date = getdate($local_date);
71
+		$day  = 0 + 1 - $date["wday"];
72
+
73
+		//Get tasks for each day
74
+		$content = $this->task_model->get_day_task_list($local_date, $month_end, $days_in_month);
75
+
76
+		// Set the current month/year/day
77
+		// We use this to determine the "today" date
78
+		$cur_year	= date("Y", $local_time);
79
+		$cur_month	= date("m", $local_time);
80
+		$cur_day	= date("j", $local_time);
81
+
82
+		$is_current_month = ($cur_year == $year AND $cur_month == $month);
83
+
84
+		$out = null;
85
+
86
+		while ($day <= $days_in_month)
87
+		{
88
+			for ($i = 0; $i < 7; $i++)
89
+			{
90
+				if($i == 0)
91
+				{
92
+					$out .= '<tr>';
93
+				}
94
+
95
+				if ($day > 0 AND $day <= $days_in_month)
96
+				{
97
+					if (isset($content[$day]))
98
+					{
99
+						// Cells with content
100
+						$out .= ($is_current_month == TRUE AND $day == $cur_day) ? '<td class="today">' : '<td>';
101
+						$out .= '<div><span class="date">'.$day.'</span><ul>'.$content[$day].'</ul></div></td>';
102
+					}
103
+					else
104
+					{
105
+						// Cells with no content
106
+						$out .= ($is_current_month == TRUE AND $day == $cur_day) ? '<td class="today">' : '<td>';
107
+						$out .= '<div><span class="date">'.$day.'</span>&nbsp;</div></td>';
108
+					}
109
+				}
110
+				else
111
+				{
112
+					// Blank cells
113
+					$out .= '<td>&nbsp;</td>';
114
+				}
115
+
116
+
117
+				$day++;
118
+
119
+				if($i == 6)
120
+				{
121
+					$out .= '</tr>';
122
+				}
123
+			}
124
+
125
+
126
+		}
127
+
128
+		$data['calendar'] = $out;
129
+
130
+		return $data;
131
+	}
132
+
133
+}

+ 86
- 0
application/controllers/category.php View File

@@ -0,0 +1,86 @@
1
+<?php
2
+
3
+/**
4
+ * Category Controller
5
+ */
6
+class Category extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->page->set_foot_js_group('js');
15
+		$this->page->set_title('Categories');
16
+
17
+	}
18
+
19
+	/**
20
+	 * Redirect to list
21
+	 */
22
+	public function index()
23
+	{
24
+		$this->todo->redirect_303(site_url('category/list'));
25
+	}
26
+
27
+	/**
28
+	 * List of categories
29
+	 */
30
+	public function category_list()
31
+	{
32
+		$data['category'] = $this->todo->get_category_list();
33
+		$this->page->set_title("Category List");
34
+		$this->page->build('task/cat_list', $data);
35
+	}
36
+
37
+	/**
38
+	 * Add a category
39
+	 */
40
+	public function add_sub()
41
+	{
42
+		if($this->input->post('add_sub') != FALSE)
43
+		{
44
+			$this->todo->add_category();
45
+			$this->todo->redirect_303(site_url('category/list'));
46
+		}
47
+	}
48
+
49
+	/**
50
+	 * Category edit form
51
+	 */
52
+	public function edit($cat_id)
53
+	{
54
+		$data['cat'] = $this->todo->get_category((int) $cat_id);
55
+		$this->page->set_title("Edit Category");
56
+		$this->page->build('task/cat_add', $data);
57
+	}
58
+
59
+	/**
60
+	 * Update the category
61
+	 */
62
+	public function edit_sub()
63
+	{
64
+		$title = $this->input->post('title', TRUE);
65
+		$desc = $this->input->post('desc', TRUE);
66
+		$cat_id = (int) $this->input->post('id');
67
+		$group_id = $this->todo->get_user_group();
68
+
69
+		$this->db->set('title', $title)
70
+			->set('description', $desc)
71
+			->where('group_id', $group_id)
72
+			->where('id', $cat_id)
73
+			->update('category');
74
+
75
+		$this->todo->redirect_303('category/list');
76
+	}
77
+
78
+	/**
79
+	 * Delete a category
80
+	 */
81
+	public function del_sub($cat_id)
82
+	{
83
+		$this->output->set_output($this->todo->del_cat((int) $cat_id));
84
+	}
85
+}
86
+// End of controllers/category.php

+ 99
- 0
application/controllers/friend.php View File

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+/**
4
+ * Friend controller
5
+ */
6
+class Friend extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+
15
+		$this->load->model('friend_model');
16
+
17
+		$this->page->set_title('Friends');
18
+		$this->page->set_foot_js_group('js');
19
+	}
20
+
21
+	/**
22
+	 * Alias for friend list
23
+	 */
24
+	public function index()
25
+	{
26
+		$this->friend_list();
27
+		return;
28
+	}
29
+
30
+	/**
31
+	 * Get the users's friends
32
+	 */
33
+	public function friend_list()
34
+	{
35
+		$data = array();
36
+		$data['friend_list'] = $this->friend_model->get_friends();
37
+		$this->page->set_title('Friends List');
38
+		$this->page->build('friend/list', $data);
39
+	}
40
+
41
+	/**
42
+	 * Friend finder form
43
+	 */
44
+	public function find()
45
+	{
46
+		$data['results'] = null;
47
+		$this->page->set_title('Find Friends');
48
+		$this->page->build('friend/search', $data);
49
+	}
50
+
51
+	/**
52
+	 * Send a friend request
53
+	 */
54
+	public function add_request()
55
+	{
56
+		$friend_id = (int) $this->input->post('fid');
57
+		$this->output->set_output($this->friend_model->send_request($friend_id));
58
+	}
59
+
60
+	/**
61
+	 * Accept a friend request
62
+	 */
63
+	public function accept_request()
64
+	{
65
+		$aid = xss_clean($this->input->post('aid'));
66
+		$this->output->set_output($this->friend_model->accept_request($aid));
67
+	}
68
+
69
+	/**
70
+	 * Reject a friend request
71
+	 */
72
+	public function reject_request()
73
+	{
74
+		$rid = xss_clean($this->input->post('rid'));
75
+		$this->output->set_output($this->friend_model->reject_request($rid));
76
+	}
77
+
78
+	/**
79
+	 * Get list of friend requests
80
+	 */
81
+	public function requests()
82
+	{
83
+		$data['request_list'] = $this->friend_model->get_requests();
84
+		$this->page->set_title('Friend Reqests');
85
+		$this->page->build('friend/requests', $data);
86
+	}
87
+
88
+	/**
89
+	 * Get results for friend finder
90
+	 */
91
+	public function ajax_search()
92
+	{
93
+		$data['results'] = $this->friend_model->find_friends();
94
+		$this->load->view('friend/ajax_search', $data);
95
+	}
96
+	
97
+
98
+}
99
+// End of controllers/friend.php

+ 95
- 0
application/controllers/group.php View File

@@ -0,0 +1,95 @@
1
+<?php
2
+
3
+/**
4
+ * Group management controller
5
+ */
6
+class Group extends MY_Controller{
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->page->set_foot_js_group('js');
15
+		$this->page->set_title('Groups');
16
+	}
17
+
18
+	/**
19
+	 * Redirect to group list
20
+	 */
21
+	public function index()
22
+	{
23
+		//303 Redirect
24
+		$this->todo->redirect_303('groups/list');
25
+	}
26
+
27
+	/**
28
+	 * List of user's groups
29
+	 */
30
+	public function group_list()
31
+	{
32
+		$data['group'] = $this->todo->get_group_list((int) $this->session->userdata('uid'));
33
+		$this->page->set_title("Group List");
34
+		$this->page->build('friend/group_list', $data);
35
+	}
36
+
37
+	/**
38
+	 * Add a new group
39
+	 */
40
+	public function add_sub()
41
+	{
42
+		if($this->input->post('add_sub') != FALSE)
43
+		{
44
+			$this->todo->add_group();
45
+
46
+			//Redirect to the group list
47
+			$this->todo->redirect_303('group/manage');
48
+		}
49
+	}
50
+
51
+	/**
52
+	 * Delete a group
53
+	 */
54
+	public function del_group()
55
+	{
56
+		$group_id = (int) $this->uri->segment('3');
57
+		$this->output->set_output($this->todo->del_group($group_id));
58
+	}
59
+
60
+	/**
61
+	 * Add/Edit a group
62
+	 */
63
+	public function manage($group_id = NULL)
64
+	{
65
+		if(is_null($group_id))
66
+		{
67
+			$this->group_list();
68
+			return;
69
+		}
70
+		
71
+		if($this->input->post('friends'))
72
+		{
73
+			$this->todo->update_group();
74
+		}
75
+		
76
+		$group_id = (int) $group_id;
77
+
78
+		$friends_array = array();
79
+		$array = $this->todo->get_friends_in_group($group_id);
80
+		
81
+		foreach($array as $a)
82
+		{
83
+			$friends_array[] = $a['user_id'];
84
+		}
85
+
86
+		$data['group_name'] = $this->todo->get_group_name_by_id($group_id);
87
+		$data['friends'] = $this->todo->get_friend_list();
88
+		$data['selected_friends'] = $friends_array;
89
+		$data['group_perms'] = array();
90
+	
91
+		$this->page->set_title("Manage Group");
92
+		$this->page->build('friend/manage', $data);
93
+	}
94
+}
95
+// End of controllers/group.php

+ 114
- 0
application/controllers/login.php View File

@@ -0,0 +1,114 @@
1
+<?php
2
+
3
+/**
4
+ * Login Controller
5
+ */
6
+class Login extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->page->set_meta(array('name' =>'google-site-verification', 'content' => 'yuoqLwe6b0rP9DhTbOjuQVPRFl7RY2swO6blPPJWdMQ'));
15
+		$this->page->set_meta(array('name' => 'description', 'content' => 'Free online social task manager'));
16
+	}
17
+
18
+	// --------------------------------------------------------------------------
19
+
20
+	/**
21
+	 * Alias of 'do_login'
22
+	 */
23
+	public function index()
24
+	{
25
+		if($this->session->userdata('uid') === FALSE)
26
+		{
27
+			$this->do_login();
28
+			return;
29
+		}
30
+
31
+		$this->todo->redirect_303('task/list');
32
+	}
33
+
34
+	// --------------------------------------------------------------------------
35
+
36
+	/**
37
+	 * Default method of application
38
+	 */
39
+	public function do_login()
40
+	{
41
+		$data['err'] = array();
42
+
43
+		if($this->input->post('login_sub') != FALSE)
44
+		{
45
+			$res = $this->todo->verify_user();
46
+
47
+			if($res === TRUE)
48
+			{
49
+				//Redirect to the tasklist or page at before login
50
+				$login_referer = $this->session->userdata('login_referer');
51
+				$url = ($login_referer !== FALSE) ? $login_referer : 'task/list';
52
+
53
+				//Unset this for now
54
+				$this->session->unset_userdata('login_referer');
55
+				$this->todo->redirect_303($url);
56
+			}
57
+			else
58
+			{
59
+				$data['err'][] = $res;
60
+			}
61
+		}
62
+		$this->page->set_body_id('home');
63
+		$this->page->build('login/login', $data);
64
+	}
65
+
66
+	// --------------------------------------------------------------------------
67
+
68
+	/**
69
+	 * Registration form and submission
70
+	 */
71
+	public function register()
72
+	{
73
+		$data = array();
74
+		if ($this->input->post('reg_sub') !== FALSE)
75
+		{
76
+			if($this->form_validation->run('login/register') === TRUE)
77
+			{
78
+				$res = $this->todo->add_reg();
79
+
80
+				if ($res == 1)
81
+				{
82
+					//Redirect to index
83
+					$this->todo->redirect_303('login');
84
+				}
85
+				show_error("Error saving registration");
86
+			}
87
+			else
88
+			{
89
+				$data['err'] = $this->form_validation->get_error_array();
90
+				$this->page->build('login/register', $data);
91
+			}
92
+		}
93
+		else
94
+		{
95
+			$data['err']='';
96
+			$this->page->build('login/register', $data);
97
+		}
98
+	}
99
+
100
+	// --------------------------------------------------------------------------
101
+
102
+	/**
103
+	 * Logout action
104
+	 */
105
+	public function logout()
106
+	{
107
+		//Destroy Session
108
+		$this->session->sess_destroy();
109
+
110
+		//Redirect to index
111
+		$this->todo->redirect_303('login');
112
+	}
113
+}
114
+// End of controllers/login.php

+ 40
- 0
application/controllers/reminder.php View File

@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+/**
4
+ * Reminder Controller for running via Cron
5
+ */
6
+class Reminder extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->load->library('email');
15
+		$this->load->model('mail_model');
16
+
17
+	}
18
+
19
+	/**
20
+	 * Redirect for snoops
21
+	 */
22
+	public function index()
23
+	{
24
+		//303 Redirect
25
+		$this->todo->redirect_303('task/list');
26
+	}
27
+
28
+	/**
29
+	 * Check the database for reminder status
30
+	 */
31
+	public function check_reminder()
32
+	{
33
+		if(!defined('CRON'))
34
+			$this->todo->redirect_303('task/list');
35
+			
36
+		//Do all the fun stuff
37
+		$this->output->set_output($this->mail_model->check_db());
38
+	}
39
+}
40
+// End of controllers/reminder.php

+ 349
- 0
application/controllers/task.php View File

@@ -0,0 +1,349 @@
1
+<?php
2
+
3
+/**
4
+ * Task Controller
5
+ */
6
+class Task extends MY_Controller {
7
+
8
+	/**
9
+	 * Constructor
10
+	 */
11
+	public function __construct()
12
+	{
13
+		parent::__construct();
14
+		$this->load->model('task_model');
15
+		$this->load->library('pagination');
16
+		$this->page->set_title('Tasks');
17
+		$this->page->set_foot_js_group('js');
18
+	}
19
+
20
+	// --------------------------------------------------------------------------
21
+
22
+	/**
23
+	 * Redirect to task list
24
+	 */
25
+	public function index()
26
+	{
27
+		$this->todo->redirect_303('task/list');
28
+	}
29
+
30
+	// --------------------------------------------------------------------------
31
+
32
+	/**
33
+	 * List shared tasks
34
+	 */
35
+	public function shared()
36
+	{
37
+		$this->page->set_title("Shared Tasks");
38
+		$tasks = $this->task_model->get_shared_task_list();
39
+		$data['task_list'] = $tasks;
40
+		$data['list_type'] = "shared";
41
+
42
+		$this->page->build('task/list', $data);
43
+	}
44
+
45
+	// --------------------------------------------------------------------------
46
+
47
+	/**
48
+	 * Get the main task view
49
+	 */
50
+	public function list_tasks()
51
+	{
52
+		$this->page->set_title("View Tasks");
53
+		$tasks = $this->task_model->get_task_list();
54
+		$data['task_list'] = $tasks;
55
+		$data['list_type'] = 'active';
56
+
57
+		$this->page->build('task/list', $data);
58
+	}
59
+
60
+	// --------------------------------------------------------------------------
61
+
62
+	/**
63
+	 * List archived tasks
64
+	 */
65
+	public function archive($page = 1)
66
+	{
67
+		$per_page = 10;
68
+		$this->page->set_title("Archived Tasks");
69
+		$page = (int) $page;
70
+		$tasks = $this->task_model->get_archived_task_list($page, $per_page);
71
+
72
+		// Pagination preferences
73
+		$config = [
74
+			'base_url' => 'https://todo.timshomepage.net/task/archive/',
75
+			'total_rows' => $tasks['num_rows'],
76
+			'per_page' => $per_page,
77
+			'uri_segment' => 3,
78
+			'num_links' => 3,
79
+			'full_tag_open' => '<p id="pagination">',
80
+			'full_tag_close' => '</p>',
81
+			'cur_tag_open' => '<strong>',
82
+			'cur_tag_close' => '</strong>'
83
+		];
84
+
85
+		$this->pagination->initialize($config);
86
+
87
+		$data['task_list'] = $tasks;
88
+		$data['list_type'] = 'archived';
89
+		$data['pagination'] = $this->pagination->create_links();
90
+
91
+		$this->page->build('task/list', $data);
92
+	}
93
+
94
+	// --------------------------------------------------------------------------
95
+
96
+	/**
97
+	 * List overdue tasks
98
+	 */
99
+	public function overdue()
100
+	{
101
+		$this->page->set_title("Overdue Tasks");
102
+		$tasks = $this->task_model->get_overdue_task_list();
103
+		$data['task_list'] = $tasks;
104
+		$data['list_type'] = 'overdue';
105
+
106
+		$this->page->build('task/list', $data);
107
+	}
108
+
109
+	// --------------------------------------------------------------------------
110
+
111
+	/**
112
+	 * Add a task
113
+	 */
114
+	public function add()
115
+	{
116
+		$data = array();
117
+		$data['err'] = '';
118
+		$data['cat_list'] = $this->todo->get_category_select();
119
+		$data['pri_list'] = $this->todo->get_priority_select();
120
+		$data['group_perms'] = '';
121
+		$data['groups'] = $this->todo->get_group_list($this->session->userdata('uid'));
122
+		$data['task_title'] = '';
123
+		$data['description'] = '';
124
+		$data['due'] = mktime(12, 00, 00);
125
+		$data['title'] = '';
126
+		$data['rem_hours'] = 0;
127
+		$data['rem_minutes'] = 30;
128
+		$data['reminder'] = FALSE;
129
+		$data['friends'] = $this->todo->get_friend_list();
130
+
131
+
132
+		if ($this->input->post('add_sub') == 'Add Task')
133
+		{
134
+			$val = $this->task_model->validate_task();
135
+
136
+			if($val === TRUE)
137
+			{
138
+				$done = $this->task_model->add_task();
139
+
140
+				if ($done === TRUE)
141
+				{
142
+					//Redirect to task list
143
+					$this->todo->redirect_303('task/list');
144
+				}
145
+				else
146
+				{
147
+					$data['err'][] = "Database Error, Please try again later.";
148
+				}
149
+			}
150
+			else
151
+			{
152
+				//Get form values
153
+				$data = array_merge($data, $this->task_model->form_vals);
154
+				$data['err'] = $val;
155
+
156
+			}
157
+
158
+		}
159
+
160
+		$this->page->set_title("Add Task");
161
+		$this->page->build('task/add', $data);
162
+	}
163
+
164
+	// --------------------------------------------------------------------------
165
+
166
+	/**
167
+	 * Edit a task
168
+	 *
169
+	 * @param int $task_id
170
+	 */
171
+	public function edit($task_id)
172
+	{
173
+		$task_id = (int) $task_id;
174
+		$data = $this->task_model->get_task_by_id($task_id);
175
+		$data['cat_list'] = $this->task_model->get_category_select($task_id);
176
+		$data['pri_list'] = $this->task_model->get_priority_select($task_id);
177
+		$data['stat_list'] = $this->task_model->get_status_select($task_id);
178
+		$data['comments'] = $this->task_model->get_task_comments($task_id);
179
+		$data['groups'] = $this->todo->get_group_list($this->session->userdata('uid'));
180
+		$data['friends'] = $this->todo->get_friend_list();
181
+		$data['checklist'] = $this->task_model->get_checklist($task_id);
182
+
183
+		if ($this->input->post('edit_sub') == 'Update Task')
184
+		{
185
+			$val = $this->task_model->validate_task();
186
+
187
+			if($val === TRUE)
188
+			{
189
+				$done = $this->task_model->update_task();
190
+
191
+				if ($done === TRUE)
192
+				{
193
+					//Redirect to task list
194
+					$this->session->set_flashdata([
195
+						'message_type' => 'success',
196
+						'message' => 'Task was updated successfully.'
197
+					]);
198
+
199
+					$this->todo->redirect_303(site_url('task/list'));
200
+				}
201
+				else
202
+				{
203
+					$data['err'][] = "Database Error, Please try again later.";
204
+				}
205
+			}
206
+			else
207
+			{
208
+				$data['err'] = $val;
209
+			}
210
+
211
+		}
212
+
213
+		$this->page->set_title("Edit Task");
214
+		$this->page->build('task/edit', $data);
215
+	}
216
+
217
+	// --------------------------------------------------------------------------
218
+
219
+	/**
220
+	 * View an individual task
221
+	 *
222
+	 * @param int $task_id
223
+	 */
224
+	public function view($task_id = NULL)
225
+	{
226
+		if( ! is_numeric($task_id))
227
+		{
228
+			show_404();
229
+			return;
230
+		}
231
+
232
+		$task_id = (int)$task_id;
233
+		$data = $this->task_model->get_task_by_id($task_id);
234
+		$data['comments'] = $this->task_model->get_task_comments($task_id);
235
+		$data['status_id'] = $this->task_model->get_current_status_id($task_id);
236
+		$data['status'] = $this->task_model->get_status_select($task_id, $data['status_id']);
237
+		$data['category'] = $this->task_model->get_category_select($task_id);
238
+		$data['checklist'] = $this->task_model->get_checklist($task_id);
239
+		$data['task'] = $task_id;
240
+
241
+
242
+		$this->page->set_title("View Task");
243
+		$this->page->set_body_id("task_details");
244
+		$this->page->build('task/view', $data);
245
+	}
246
+
247
+	// --------------------------------------------------------------------------
248
+
249
+	/**
250
+	 * Delete a task
251
+	 */
252
+	public function delete($task_id)
253
+	{
254
+		$this->task_model->delete_task((int) $task_id);
255
+	}
256
+
257
+	// --------------------------------------------------------------------------
258
+
259
+	/**
260
+	 * Add a task comment
261
+	 */
262
+	public function add_task_comment()