Browse Source

First public commit

master
Timothy Warren 5 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 @@
web/cron.log
application/logs/*.php
application/cache/*
web/coverage/*
vendor/*
composer.lock

+ 0
- 0
README.md View File


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

@@ -0,0 +1,123 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Libraries
| 2. Helper files
| 3. Plugins
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/

/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your system/application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

$autoload['libraries'] = [
'database',
'page',
'todo',
'session',
'form_validation',
'validation_callbacks'
];


/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/

$autoload['helper'] = array('url', 'html', 'security', 'form');


/*
| -------------------------------------------------------------------
| Auto-load Plugins
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['plugin'] = array('captcha', 'js_calendar');
*/

$autoload['plugin'] = array();


/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/

$autoload['config'] = array('sites');


/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/

$autoload['language'] = array();


/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('model1', 'model2');
|
*/

$autoload['model'] = array();



/* End of file autoload.php */
/* Location: ./application/config/autoload.php */

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

@@ -0,0 +1,350 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
*/
$config['base_url'] = 'https://todo.timshomepage.net/';

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/

$config['uri_protocol'] = "REQUEST_URI";

/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/

$config['url_suffix'] = "";

/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = "english";

/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = "UTF-8";

/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the "hooks" feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;


/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';


/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';


/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string "words" that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 1;

/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';

/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';

/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Sessions class with encryption
| enabled you MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = "xLx45kOkywjdvvVMxLov";

/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'session_cookie_name' = the name you want for the cookie
| 'encrypt_sess_cookie' = TRUE/FALSE (boolean). Whether to encrypt the cookie
| 'session_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'sess';
$config['sess_expiration'] = 43200; //12 hours
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;

/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "thp_todo_";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = TRUE;

/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = FALSE;

/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_token';
$config['csrf_cookie_name'] = 'csrf_cookie';
$config['csrf_expire'] = 7200;

/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not "echo" any values with compression enabled.
|
*/
$config['compress_output'] = TRUE;

/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are "local" or "gmt". This pref tells the system whether to use
| your server's local time as the master "now" reference, or convert it to
| GMT. See the "date helper" page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';


/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;


/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = '';


/* End of file config.php */
/* Location: ./system/application/config/config.php */

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

@@ -0,0 +1,114 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Kanji Constants
|--------------------------------------------------------------------------
|
| Constants defining equivalent kanji for arabic numerals
|
*/

define('ZERO', '〇');
define('ONE', '一');
define('TWO', '二');
define('THREE', '三');
define('FOUR', '四');
define('FIVE', '五');
define('SIX', '六');
define('SEVEN', '七');
define('EIGHT', '八');
define('NINE', '九');
define('TEN', '十');
define('HUNDRED', '百');
define('THOUSAND', '千');
define('TEN_THOUSAND', '万');
define('HUNDRED_MILLION', '億');


/*
|--------------------------------------------------------------------------
| TYPE Constants
|--------------------------------------------------------------------------
|
| Constants defining magic numbers
|
*/

// Status constants
define('STATUS_CREATED', 1);
define('STATUS_COMPLETED', 2);
define('STATUS_IN_PROGRESS', 3);
define('STATUS_ON_HOLD', 4);
define('STATUS_CANCELED', 5);

// Permission constants
define('PERM_NO_ACCESS', -1);
define('PERM_READ_ACCESS', 0);
define('PERM_COMMENT_ACCESS',1);
define('PERM_CHECKLIST_ACCESS', 2);
define('PERM_WRITE_ACCESS', 3);
define('PERM_ADMIN_ACCESS', 9);

// Friend constants
define('FRIEND_NOT_CONFIRMED', -1);
define('FRIEND_CONFIRMED', 1);
define('FRIEND_REJECTED', 0);

/*
|--------------------------------------------------------------------------
| Formatting Constants
|--------------------------------------------------------------------------
|
| Constants for the Page library
|
*/

//Define some constants for formatting
define('NL', "\n");
define('T1', "\t");
define('T2', T1.T1);
define('T3', T2.T1);
define('T4', T2.T2);
define('T5', T3.T2);
define('T6', T3.T3);

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);

/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/

define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');


/* End of file constants.php */
/* Location: ./system/application/config/constants.php */

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

@@ -0,0 +1,62 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the "Database Connection"
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
|
| The $active_group variable lets you choose which connection group to
| make active. By mysql there is only one group (the "mysql" group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/

$active_group = "todo";
$active_record = TRUE;

$db = [
'todo' => [
'hostname' => 'localhost',
'username' => 'todo',
'password' => 'todo',
'database' => 'todo',
'dbdriver' => 'postgre',
'dbprefix' => 'todo_',
'pconnect' => TRUE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'stricton' => FALSE
],
];


/* End of file database.php */
/* Location: ./system/application/config/database.php */

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

@@ -0,0 +1,17 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'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">',

'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
);

/* End of file doctypes.php */
/* Location: application/config/doctypes.php */

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

@@ -0,0 +1,67 @@
<?php
$config = [
'task' => [
[
'field' => 'title',
'label' => 'Title',
'rules' => 'required|min_length[1]|max_length[255]|xss_clean'
],
[
'field' => 'desc',
'label' => 'Description',
'rules' => 'required|min_length[1]|xss_clean'
],
[
'field' => 'category',
'label' => 'Category',
'rules' => 'required|is_natural_no_zero'
],
[
'field' => 'priority',
'label' => 'Priority',
'rules' => 'required|is_natural'
],
[
'field' => 'due_hour',
'label' => 'Due Hour',
'rules' => 'min_length[1]|less_than[24]|is_natural'
],
[
'field' => 'due_minute',
'label' => 'Due Minute',
'rules' => 'min_length[1]|less_than[61]|is_natural'
],
[
'field' => 'due',
'label' => 'Due Date',
'rules' => 'callback_validate[due_date]'
],
[
'field' => 'reminder',
'label' => 'Reminder',
'rules' => ''
]
],
'login/register' => [
[
'field' => 'email',
'label' => 'Email Address',
'rules' => 'required|callback_validate[valid_email]|is_unique[user.email]'
],
[
'field' => 'user',
'label' => 'Username',
'rules' => 'required|is_unique[user.username]'
],
[
'field' => 'pass',
'label' => 'Password',
'rules' => 'required',
],
[
'field' => 'pass1',
'label' => 'Password Confirmation',
'rules' => 'required|matches[pass]',
]
]
];

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

@@ -0,0 +1,23 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/hooks.html
|
*/

$hook['post_controller_constructor'][] = array(
'class' => '',
'function' => 'check_session',
'filename' => 'pre-controller.php',
'filepath' => 'hooks'
);



/* End of file hooks.php */
/* Location: ./system/application/config/hooks.php */

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

@@ -0,0 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>

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

@@ -0,0 +1,105 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/

$mimes = array( 'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'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'),
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'class' => 'application/octet-stream',
'psd' => 'application/x-photoshop',
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/x-download'),
'ai' => 'application/postscript',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => 'application/x-javascript',
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => 'application/x-tar',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg'),
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => 'audio/x-wav',
'bmp' => 'image/bmp',
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => 'text/css',
'html' => 'text/html',
'htm' => 'text/html',
'shtml' => 'text/html',
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => 'text/xml',
'xsl' => 'text/xml',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822'
);


/* End of file mimes.php */
/* Location: ./system/application/config/mimes.php */

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

@@ -0,0 +1,144 @@
<?php

/**
* Configuration for default Minify application
* @package Minify
*/


/**
* In 'debug' mode, Minify can combine files with no minification and
* add comments to indicate line #s of the original files.
*
* To allow debugging, set this option to true and add "&debug=1" to
* a URI. E.g. /min/?f=script1.js,script2.js&debug=1
*/
$min_allowDebugFlag = true;


/**
* Set to true to log messages to FirePHP (Firefox Firebug addon).
* Set to false for no error logging (Minify may be slightly faster).
* @link http://www.firephp.org/
*
* If you want to use a custom error logger, set this to your logger
* instance. Your object should have a method log(string $message).
*
* @todo cache system does not have error logging yet.
*/
$min_errorLogger = false;


/**
* For best performance, specify your temp directory here. Otherwise Minify
* will have to load extra code to guess. Some examples below:
*/
$min_cachePath = realpath(dirname(__FILE__) . '/../../application/cache');

/**
* Leave an empty string to use PHP's $_SERVER['DOCUMENT_ROOT'].
*
* On some servers, this value may be misconfigured or missing. If so, set this
* to your full document root path with no trailing slash.
* E.g. '/home/accountname/public_html' or 'c:\\xampp\\htdocs'
*
* If /min/ is directly inside your document root, just uncomment the
* second line. The third line might work on some Apache servers.
*/
$min_documentRoot = '';
//$min_documentRoot = substr(__FILE__, 0, strlen(__FILE__) - 15);
//$min_documentRoot = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];

/**
* Cache file locking. Set to false if filesystem is NFS. On at least one
* NFS system flock-ing attempts stalled PHP for 30 seconds!
*/
$min_cacheFileLocking = true;


/**
* Combining multiple CSS files can place @import declarations after rules, which
* is invalid. Minify will attempt to detect when this happens and place a
* warning comment at the top of the CSS output. To resolve this you can either
* move the @imports within your CSS files, or enable this option, which will
* move all @imports to the top of the output. Note that moving @imports could
* affect CSS values (which is why this option is disabled by default).
*/
$min_serveOptions['bubbleCssImports'] = false;


/**
* Maximum age of browser cache in seconds. After this period, the browser
* will send another conditional GET. Use a longer period for lower traffic
* but you may want to shorten this before making changes if it's crucial
* those changes are seen immediately.
*
* Note: Despite this setting, if you include a number at the end of the
* querystring, maxAge will be set to one year. E.g. /min/f=hello.css&123456
*/
$min_serveOptions['maxAge'] = 1800;


/**
* If you'd like to restrict the "f" option to files within/below
* particular directories below DOCUMENT_ROOT, set this here.
* You will still need to include the directory in the
* f or b GET parameters.
*
* // = shortcut for DOCUMENT_ROOT
*/
//$min_serveOptions['minApp']['allowDirs'] = array('//js', '//css');

/**
* Set to true to disable the "f" GET parameter for specifying files.
* Only the "g" parameter will be considered.
*/
$min_serveOptions['minApp']['groupsOnly'] = false;

/**
* Maximum # of files that can be specified in the "f" GET parameter
*/
$min_serveOptions['minApp']['maxFiles'] = 10;


/**
* If you minify CSS files stored in symlink-ed directories, the URI rewriting
* algorithm can fail. To prevent this, provide an array of link paths to
* target paths, where the link paths are within the document root.
*
* Because paths need to be normalized for this to work, use "//" to substitute
* the doc root in the link paths (the array keys). E.g.:
* <code>
* array('//symlink' => '/real/target/path') // unix
* array('//static' => 'D:\\staticStorage') // Windows
* </code>
*/
$min_symlinks = array(

);


/**
* If you upload files from Windows to a non-Windows server, Windows may report
* incorrect mtimes for the files. This may cause Minify to keep serving stale
* cache files when source file changes are made too frequently (e.g. more than
* once an hour).
*
* Immediately after modifying and uploading a file, use the touch command to
* update the mtime on the server. If the mtime jumps ahead by a number of hours,
* set this variable to that number. If the mtime moves back, this should not be
* needed.
*
* In the Windows SFTP client WinSCP, there's an option that may fix this
* issue without changing the variable below. Under login > environment,
* select the option "Adjust remote timestamp with DST".
* @link http://winscp.net/eng/docs/ui_login_environment#daylight_saving_time
*/
$min_uploaderHoursBehind = 0;


// try to disable output_compression (may not have an effect)
ini_set('zlib.output_compression', '0');

//Use JSMin+
$min_serveOptions['minifiers']['application/x-javascript'] = array('JSMinPlus', 'minify');

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

@@ -0,0 +1,36 @@
<?php
/**
* Groups configuration for default Minify implementation
* @package Minify
*/
$root = "//";

return array(
/*-----
Css
-----*/
'css' => array(
$root. 'fonts/Puritan/stylesheet.css',
$root. 'css/todo.css',
$root. 'css/message.css',
$root. 'js/CLEditor/jquery.cleditor.css',
$root. 'css/jquery-ui.min.css'
),
/*-----
Javascript
-----*/
'js' => array(
$root. 'js/CLEditor/jquery.cleditor.js',
$root. 'js/CLEditor/jquery.cleditor.xhtml.js',
$root. 'js/todo.js',
),
'js_mobile' => array(
$root. 'js/todo.js',
),

);

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

@@ -0,0 +1,53 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* NOTICE OF LICENSE
*
* Licensed under the Academic Free License version 3.0
*
* This source file is subject to the Academic Free License (AFL 3.0) that is
* bundled with this package in the files license_afl.txt / license_afl.rst.
* It is also available through the world wide web at this URL:
* http://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to obtain it
* through the world wide web, please send an email to
* licensing@ellislab.com so we can send you a copy immediately.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
* @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/

/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/profiling.html
|
*/
$config['config'] = FALSE;
$config['http_headers'] = FALSE;
$config['uri_string'] = FALSE;
$config['get'] = FALSE;
$config['controller_info'] = FALSE;
$config['session_data'] = FALSE;
$config['post'] = FALSE;
$config['benchmarks'] = FALSE;
$config['memory_usage'] = FALSE;
$config['query_toggle_count'] = 1;



/* End of file profiler.php */
/* Location: ./application/config/profiler.php */

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

@@ -0,0 +1,54 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are two reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
*/

$route = [
'default_controller' => 'login',
'logout' => 'login/logout',
'login' => 'login/do_login',
'register' => 'login/register',
'task/list' => 'task/list_tasks',
'friend/list' => 'friend/friend_list',
'category/list' => 'category/category_list',
'task/category/list' => 'category/category_list',
'task/calendar' => 'calendar/index',
'task/calendar/:any' => 'calendar/index',
'task/archive/:num' => 'task/archive',
'404_overide' => ''
];

/* End of file routes.php */
/* Location: ./system/application/config/routes.php */

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

@@ -0,0 +1,119 @@
<?php
include "config.php";
/*
|--------------------------------------------------------------------------
| Content Domain
|--------------------------------------------------------------------------
|
| This is the domain used for serving content, such as css, javascript.
|
*/
$config['content_domain'] = $config['base_url'];

/*
|--------------------------------------------------------------------------
| Content Domain
|--------------------------------------------------------------------------
|
| This is the domain/subdomain used for serving images.
|
*/
$config['image_domain'] = $config['content_domain'].'/images';

/*
|--------------------------------------------------------------------------
| Static Lib Path
|--------------------------------------------------------------------------
|
| This is the path where the 'libs' directory is on the static domain.
|
*/
$config['static_lib_path'] = $config['content_domain'];

/*
|--------------------------------------------------------------------------
| Group Style/Javascript Path
|--------------------------------------------------------------------------
|
| This is the path that is used to determine the relative path to the
| stylesheet minifier. This should not need to be changed.
|
*/
$config['group_style_path'] = $config['static_lib_path'] . 'min/index.php?g=';

/*
|--------------------------------------------------------------------------
| Default Style Path
|--------------------------------------------------------------------------
|
| This is the path that is used to determine the relative path to the
| stylesheet minifier. This should not need to be changed.
|
*/
$config['style_path'] = $config['static_lib_path'] . '/min/index.php?b=css&amp;f=';

/*
|--------------------------------------------------------------------------
| Default Javascript Path
|--------------------------------------------------------------------------
|
| This is the path that is used to determine the relative path to the
| stylesheet minifier. This should not need to be changed.
|
*/
$config['script_path'] = $config['static_lib_path'] . '/min/index.php?b=js&amp;f=';


/*
|--------------------------------------------------------------------------
| Default title
|--------------------------------------------------------------------------
|
| Default title for webpages
|
*/

$config['default_title'] = "Tim's Todo";

/*
|--------------------------------------------------------------------------
| Default css group
|--------------------------------------------------------------------------
|
| Default css group
|
*/
$config['default_js_group'] = "js";
$config['default_css_group'] = "css";

/*
|--------------------------------------------------------------------------
| Ignore IPs
|--------------------------------------------------------------------------
|
| IP address that are not counted in stats
|
*/

$config['ignore_ips'] = array('127.0.0.1');

/*
|--------------------------------------------------------------------------
| Ignore UserAgents
|--------------------------------------------------------------------------
|
| UserAgents that are not counted in stats
|
*/

$config['ignore_user_agents'] = array();

/*
|--------------------------------------------------------------------------
| Enable Reminders
|--------------------------------------------------------------------------
|
| Only enable if you can set a cron job or scheduled task for the reminder feature
|
*/
$config['enable_reminders'] = TRUE;

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

@@ -0,0 +1,66 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple simileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| http://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/

$smileys = array(

// smiley image name width height alt

':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'),
':question:' => array('question.gif', '19', '19', 'question') // no comma after last item

);

/* End of file smileys.php */
/* Location: ./system/application/config/smileys.php */

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

@@ -0,0 +1,62 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the "Database Connection"
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
|
| The $active_group variable lets you choose which connection group to
| make active. By mysql there is only one group (the "mysql" group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/

$active_group = "todo";
$active_record = TRUE;

$db = [
'todo' => [
'hostname' => 'localhost',
'username' => 'todo_test',
'password' => 'test',
'database' => 'todo_test',
'dbdriver' => 'postgre',
'dbprefix' => 'todo_',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => FALSE,
'stricton' => FALSE
]
];


/* End of file database.php */
/* Location: ./system/application/config/database.php */

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

@@ -0,0 +1,175 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
|
*/

$platforms = array (
'windows nt 6.0' => 'Windows Longhorn',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows' => 'Unknown Windows OS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS'
);


// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse'
);

$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'

// Phones and Manufacturers
'motorola' => "Motorola",
'nokia' => "Nokia",
'palm' => "Palm",
'iphone' => "Apple iPhone",
'ipod' => "Apple iPod Touch",
'sony' => "Sony Ericsson",
'ericsson' => "Sony Ericsson",
'blackberry' => "BlackBerry",
'cocoon' => "O2 Cocoon",
'blazer' => "Treo",
'lg' => "LG",
'amoi' => "Amoi",
'xda' => "XDA",
'mda' => "MDA",
'vario' => "Vario",
'htc' => "HTC",
'samsung' => "Samsung",
'sharp' => "Sharp",
'sie-' => "Siemens",
'alcatel' => "Alcatel",
'benq' => "BenQ",
'ipaq' => "HP iPaq",
'mot-' => "Motorola",
'playstation portable' => "PlayStation Portable",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
'philips' => "Philips",
'sagem' => "Sagem",
'sanyo' => "Sanyo",
'spv' => "SPV",
'zte' => "ZTE",
'sendo' => "Sendo",

// Operating Systems
'symbian' => "Symbian",
'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "Palm",
'series60' => "Symbian S60",
'windows ce' => "Windows CE",

// Browsers
'obigo' => "Obigo",
'netfront' => "Netfront Browser",
'openwave' => "Openwave Browser",
'mobilexplorer' => "Mobile Explorer",
'operamini' => "Opera Mini",
'opera mini' => "Opera Mini",

// Other
'digital paths' => "Digital Paths",
'avantgo' => "AvantGo",
'xiino' => "Xiino",
'novarra' => "Novarra Transcoder",
'vodafone' => "Vodafone",
'docomo' => "NTT DoCoMo",
'o2' => "O2",

// Fallback
'mobile' => "Generic Mobile",
'wireless' => "Generic Mobile",
'j2me' => "Generic Mobile",
'midp' => "Generic Mobile",
'cldc' => "Generic Mobile",
'up.link' => "Generic Mobile",
'up.browser' => "Generic Mobile",
'smartphone' => "Generic Mobile",
'cellphone' => "Generic Mobile"
);

// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos'
);

/* End of file user_agents.php */
/* Location: ./system/application/config/user_agents.php */

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

@@ -0,0 +1,103 @@
<?php

/**
* Account Management Controller
*/
class Account extends MY_Controller {

/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->page->set_foot_js_group('js');
$this->page->set_title('Account');
}

// --------------------------------------------------------------------------

/**
* Dashboard
*/
public function index()
{
$data = $this->todo->get_user_account_by_id($this->session->userdata('uid'));
$this->page->build('account/status', $data);
}

// --------------------------------------------------------------------------

/**
* Password change form
*/
public function password()
{
//Don't let the guest change the password
if($this->session->userdata('username') == 'guest')
{
$this->todo->redirect_303('account');
return;
}

if($this->input->post('pass_sub') == "Change Password")
{
$val = $this->todo->validate_pass();
if($val === TRUE)
{
$this->todo->update_pass();
//Redirect to index
$this->todo->redirect_303('task/list');
}
else
{
$data['err'] = $val;
$this->page->build('account/password', $data);
}
}
else
{
$this->page->build('account/password');
}
}

// --------------------------------------------------------------------------

/**
* Timezone update
*/
public function update_tz()
{
$timezone = $this->input->post('timezone');

$this->db->set('timezone', $timezone)
->where('id', $this->session->userdata('uid'))
->update('user');

if($this->db->affected_rows() == 1)
{
$this->output->set_output('1');
}
}

// --------------------------------------------------------------------------

/**
* Number format update
*/
public function update_nf()
{
$num_format = (int)$this->input->post('num_format');

$this->db->set('num_format', $num_format)
->where('id', $this->session->userdata('uid'))
->update('user');

if($this->db->affected_rows() == 1)
{
$this->session->set_userdata('num_format', $num_format);
$this->output->set_output('1');
}
}
}
// End of controllers/account.php

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

@@ -0,0 +1,133 @@
<?php

/**
* Calendar View Controller
*/
class Calendar extends MY_Controller {

/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->load->library('calendar');
$this->load->model('task_model');
}

/**
* Calendar View
*/
public function index()
{
//Output
$this->page->build('task/calendar', $this->get_calendar_data());
}

/**
* Get the data for the calendar display
*
* @return mixed
*/
protected function get_calendar_data()
{
//Offset time for custom months
if($this->uri->segment(3) && $this->uri->segment(4))
{
$year = $this->uri->segment(3);
$month = $this->uri->segment(4);
}

$_months = array(
01 => 'January', 02 => 'February',
03 => 'March', 04 => 'April',
05 => 'May', 06 => 'June',
07 => 'July', 08 => 'August',
09 => 'September', 10 => 'October',
11 => 'November', 12 => 'December',
1 => 'January', 2 => 'February',
3 => 'March', 4 => 'April',
5 => 'May', 6 => 'June',
7 => 'July', 8 => 'August',
9 => 'September',
);

$year = (isset($year)) ? $year : date('Y');
$month = (isset($month)) ? $month : date('m');

$local_time = time();

$data['month'] = $_months[(int)$month].' '.$year;
$data['calendar'] = array();
$data['today'] = getdate();

$days_in_month = $this->calendar->get_total_days($month, $year);

// Set the starting day number
$local_date = mktime(0, 0, 0, $month, 1, $year);
$month_end = mktime(0, 0, 0, $month, $days_in_month, $year);
$date = getdate($local_date);
$day = 0 + 1 - $date["wday"];

//Get tasks for each day
$content = $this->task_model->get_day_task_list($local_date, $month_end, $days_in_month);

// Set the current month/year/day
// We use this to determine the "today" date
$cur_year = date("Y", $local_time);
$cur_month = date("m", $local_time);
$cur_day = date("j", $local_time);

$is_current_month = ($cur_year == $year AND $cur_month == $month);

$out = null;

while ($day <= $days_in_month)
{
for ($i = 0; $i < 7; $i++)
{
if($i == 0)
{
$out .= '<tr>';
}

if ($day > 0 AND $day <= $days_in_month)
{
if (isset($content[$day]))
{
// Cells with content
$out .= ($is_current_month == TRUE AND $day == $cur_day) ? '<td class="today">' : '<td>';
$out .= '<div><span class="date">'.$day.'</span><ul>'.$content[$day].'</ul></div></td>';
}
else
{
// Cells with no content
$out .= ($is_current_month == TRUE AND $day == $cur_day) ? '<td class="today">' : '<td>';
$out .= '<div><span class="date">'.$day.'</span>&nbsp;</div></td>';
}
}
else
{
// Blank cells
$out .= '<td>&nbsp;</td>';
}


$day++;

if($i == 6)
{
$out .= '</tr>';
}
}


}

$data['calendar'] = $out;

return $data;
}

}

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

@@ -0,0 +1,86 @@
<?php

/**
* Category Controller
*/
class Category extends MY_Controller {

/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->page->set_foot_js_group('js');
$this->page->set_title('Categories');

}

/**
* Redirect to list
*/
public function index()
{
$this->todo->redirect_303(site_url('category/list'));
}

/**
* List of categories
*/
public function category_list()
{
$data['category'] = $this->todo->get_category_list();
$this->page->set_title("Category List");
$this->page->build('task/cat_list', $data);
}

/**
* Add a category
*/
public function add_sub()
{
if($this->input->post('add_sub') != FALSE)
{
$this->todo->add_category();
$this->todo->redirect_303(site_url('category/list'));
}
}

/**
* Category edit form
*/
public function edit($cat_id)
{
$data['cat'] = $this->todo->get_category((int) $cat_id);
$this->page->set_title("Edit Category");
$this->page->build('task/cat_add', $data);
}

/**
* Update the category
*/
public function edit_sub()
{
$title = $this->input->post('title', TRUE);
$desc = $this->input->post('desc', TRUE);
$cat_id = (int) $this->input->post('id');
$group_id = $this->todo->get_user_group();

$this->db->set('title', $title)
->set('description', $desc)
->where('group_id', $group_id)
->where('id', $cat_id)
->update('category');

$this->todo->redirect_303('category/list');
}

/**
* Delete a category
*/
public function del_sub($cat_id)
{
$this->output->set_output($this->todo->del_cat((int) $cat_id));
}
}
// End of controllers/category.php

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

@@ -0,0 +1,99 @@
<?php

/**
* Friend controller
*/
class Friend extends MY_Controller {

/**
* Constructor
*/
public function __construct()
{
parent::__construct();

$this->load->model('friend_model');

$this->page->set_title('Friends');
$this->page->set_foot_js_group('js');
}

/**
* Alias for friend list
*/
public function index()
{
$this->friend_list();
return;
}

/**
* Get the users's friends
*/
public function friend_list()
{
$data = array();
$data['friend_list'] = $this->friend_model->get_friends();
$this->page->set_title('Friends List');
$this->page->build('friend/list', $data);
}

/**
* Friend finder form
*/
public function find()
{
$data['results'] = null;
$this->page->set_title('Find Friends');
$this->page->build('friend/search', $data);
}

/**
* Send a friend request
*/
public function add_request()
{
$friend_id = (int) $this->input->post('fid');
$this->output->set_output($this->friend_model->send_request($friend_id));
}

/**
* Accept a friend request
*/
public function accept_request()
{
$aid = xss_clean($this->input->post('aid'));
$this->output->set_output($this->friend_model->accept_request($aid));
}

/**
* Reject a friend request
*/
public function reject_request()
{
$rid = xss_clean($this->input->post('rid'));
$this->output->set_output($this->friend_model->reject_request($rid));
}

/**
* Get list of friend requests
*/
public function requests()
{
$data['request_list'] = $this->friend_model->get_requests();
$this->page->set_title('Friend Reqests');
$this->page->build('friend/requests', $data);
}

/**
* Get results for friend finder
*/
public function ajax_search()
{
$data['results'] = $this->friend_model->find_friends();
$this->load->view('friend/ajax_search', $data);
}

}
// End of controllers/friend.php

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

@@ -0,0 +1,95 @@