├── .gitignore ├── application ├── .htaccess ├── cache │ ├── .htaccess │ └── index.html ├── config │ ├── autoload.php │ ├── config.php │ ├── constants.php │ ├── database.php │ ├── doctypes.php │ ├── email.php │ ├── foreign_chars.php │ ├── hooks.php │ ├── index.html │ ├── migration.php │ ├── mimes.php │ ├── profiler.php │ ├── routes.php │ ├── smileys.php │ └── user_agents.php ├── controllers │ ├── company.php │ ├── index.html │ ├── invitation.php │ ├── item.php │ ├── password.php │ ├── plan.php │ ├── profile.php │ ├── project.php │ ├── user.php │ └── welcome.php ├── core │ └── index.html ├── errors │ ├── error_404.php │ ├── error_db.php │ ├── error_general.php │ ├── error_php.php │ └── index.html ├── helpers │ ├── access_controll_helper.php │ ├── index.html │ └── plan_helper.php ├── hooks │ └── index.html ├── index.html ├── language │ └── english │ │ └── index.html ├── libraries │ └── index.html ├── logs │ └── index.html ├── models │ ├── company_model.php │ ├── email_model.php │ ├── index.html │ ├── invitation_model.php │ ├── item_model.php │ ├── password_model.php │ ├── plan_model.php │ ├── project_model.php │ └── user_model.php ├── third_party │ └── index.html └── views │ ├── common │ ├── footer.php │ ├── header.php │ ├── private_navbar.php │ └── public_navbar.php │ ├── index.html │ ├── invitation │ ├── expired.php │ └── register.php │ ├── item │ ├── edit.php │ ├── menubar.php │ └── view.php │ ├── password │ ├── invalid_code.php │ ├── new_password.php │ ├── reset.php │ └── reset_confirm.php │ ├── plan │ └── select.php │ ├── profile │ ├── edit.php │ └── index.php │ ├── project │ ├── archive.php │ ├── archived_items.php │ ├── edit.php │ ├── info.php │ ├── invalid_share_code.php │ ├── menubar.php │ ├── restricted.php │ └── view.php │ └── user │ ├── dashboard.php │ ├── login.php │ ├── register.php │ ├── validated.php │ └── validation_failed.php ├── css ├── bootstrap-responsive.css ├── bootstrap-responsive.min.css ├── bootstrap.css ├── bootstrap.min.css └── style.css ├── images ├── add.png └── addUser.png ├── img ├── glyphicons-halflings-white.png └── glyphicons-halflings.png ├── index.php ├── js ├── bootbox.min.js ├── bootstrap.js ├── bootstrap.min.js ├── company.js ├── item.js ├── jquery-ui.min.js ├── jquery.min.js ├── plans.js ├── project.js └── projectView.js ├── license.txt ├── readme.md ├── system ├── .htaccess ├── core │ ├── Benchmark.php │ ├── CodeIgniter.php │ ├── Common.php │ ├── Config.php │ ├── Controller.php │ ├── Exceptions.php │ ├── Hooks.php │ ├── Input.php │ ├── Lang.php │ ├── Loader.php │ ├── Model.php │ ├── Output.php │ ├── Router.php │ ├── Security.php │ ├── URI.php │ ├── Utf8.php │ └── index.html ├── database │ ├── DB.php │ ├── DB_active_rec.php │ ├── DB_cache.php │ ├── DB_driver.php │ ├── DB_forge.php │ ├── DB_result.php │ ├── DB_utility.php │ ├── drivers │ │ ├── cubrid │ │ │ ├── cubrid_driver.php │ │ │ ├── cubrid_forge.php │ │ │ ├── cubrid_result.php │ │ │ ├── cubrid_utility.php │ │ │ └── index.html │ │ ├── index.html │ │ ├── mssql │ │ │ ├── index.html │ │ │ ├── mssql_driver.php │ │ │ ├── mssql_forge.php │ │ │ ├── mssql_result.php │ │ │ └── mssql_utility.php │ │ ├── mysql │ │ │ ├── index.html │ │ │ ├── mysql_driver.php │ │ │ ├── mysql_forge.php │ │ │ ├── mysql_result.php │ │ │ └── mysql_utility.php │ │ ├── mysqli │ │ │ ├── index.html │ │ │ ├── mysqli_driver.php │ │ │ ├── mysqli_forge.php │ │ │ ├── mysqli_result.php │ │ │ └── mysqli_utility.php │ │ ├── oci8 │ │ │ ├── index.html │ │ │ ├── oci8_driver.php │ │ │ ├── oci8_forge.php │ │ │ ├── oci8_result.php │ │ │ └── oci8_utility.php │ │ ├── odbc │ │ │ ├── index.html │ │ │ ├── odbc_driver.php │ │ │ ├── odbc_forge.php │ │ │ ├── odbc_result.php │ │ │ └── odbc_utility.php │ │ ├── pdo │ │ │ ├── index.html │ │ │ ├── pdo_driver.php │ │ │ ├── pdo_forge.php │ │ │ ├── pdo_result.php │ │ │ └── pdo_utility.php │ │ ├── postgre │ │ │ ├── index.html │ │ │ ├── postgre_driver.php │ │ │ ├── postgre_forge.php │ │ │ ├── postgre_result.php │ │ │ └── postgre_utility.php │ │ ├── sqlite │ │ │ ├── index.html │ │ │ ├── sqlite_driver.php │ │ │ ├── sqlite_forge.php │ │ │ ├── sqlite_result.php │ │ │ └── sqlite_utility.php │ │ └── sqlsrv │ │ │ ├── index.html │ │ │ ├── sqlsrv_driver.php │ │ │ ├── sqlsrv_forge.php │ │ │ ├── sqlsrv_result.php │ │ │ └── sqlsrv_utility.php │ └── index.html ├── fonts │ ├── index.html │ └── texb.ttf ├── helpers │ ├── array_helper.php │ ├── captcha_helper.php │ ├── cookie_helper.php │ ├── date_helper.php │ ├── directory_helper.php │ ├── download_helper.php │ ├── email_helper.php │ ├── file_helper.php │ ├── form_helper.php │ ├── html_helper.php │ ├── index.html │ ├── inflector_helper.php │ ├── language_helper.php │ ├── number_helper.php │ ├── path_helper.php │ ├── security_helper.php │ ├── smiley_helper.php │ ├── string_helper.php │ ├── text_helper.php │ ├── typography_helper.php │ ├── url_helper.php │ └── xml_helper.php ├── index.html ├── language │ ├── english │ │ ├── calendar_lang.php │ │ ├── date_lang.php │ │ ├── db_lang.php │ │ ├── email_lang.php │ │ ├── form_validation_lang.php │ │ ├── ftp_lang.php │ │ ├── imglib_lang.php │ │ ├── index.html │ │ ├── migration_lang.php │ │ ├── number_lang.php │ │ ├── profiler_lang.php │ │ ├── unit_test_lang.php │ │ └── upload_lang.php │ └── index.html └── libraries │ ├── Cache │ ├── Cache.php │ └── drivers │ │ ├── Cache_apc.php │ │ ├── Cache_dummy.php │ │ ├── Cache_file.php │ │ └── Cache_memcached.php │ ├── Calendar.php │ ├── Cart.php │ ├── Driver.php │ ├── Email.php │ ├── Encrypt.php │ ├── Form_validation.php │ ├── Ftp.php │ ├── Image_lib.php │ ├── Javascript.php │ ├── Log.php │ ├── Migration.php │ ├── Pagination.php │ ├── Parser.php │ ├── Profiler.php │ ├── Session.php │ ├── Sha1.php │ ├── Table.php │ ├── Trackback.php │ ├── Typography.php │ ├── Unit_test.php │ ├── Upload.php │ ├── User_agent.php │ ├── Xmlrpc.php │ ├── Xmlrpcs.php │ ├── Zip.php │ ├── index.html │ └── javascript │ └── Jquery.php └── user_guide ├── changelog.html ├── database ├── active_record.html ├── caching.html ├── call_function.html ├── configuration.html ├── connecting.html ├── examples.html ├── fields.html ├── forge.html ├── helpers.html ├── index.html ├── queries.html ├── results.html ├── table_data.html ├── transactions.html └── utilities.html ├── doc_style ├── index.html └── template.html ├── general ├── alternative_php.html ├── ancillary_classes.html ├── autoloader.html ├── caching.html ├── cli.html ├── common_functions.html ├── controllers.html ├── core_classes.html ├── creating_drivers.html ├── creating_libraries.html ├── credits.html ├── drivers.html ├── environments.html ├── errors.html ├── helpers.html ├── hooks.html ├── libraries.html ├── managing_apps.html ├── models.html ├── profiling.html ├── quick_reference.html ├── requirements.html ├── reserved_names.html ├── routing.html ├── security.html ├── styleguide.html ├── urls.html └── views.html ├── helpers ├── array_helper.html ├── captcha_helper.html ├── cookie_helper.html ├── date_helper.html ├── directory_helper.html ├── download_helper.html ├── email_helper.html ├── file_helper.html ├── form_helper.html ├── html_helper.html ├── inflector_helper.html ├── language_helper.html ├── number_helper.html ├── path_helper.html ├── security_helper.html ├── smiley_helper.html ├── string_helper.html ├── text_helper.html ├── typography_helper.html ├── url_helper.html └── xml_helper.html ├── images ├── appflowchart.gif ├── arrow.gif ├── ci_logo.jpg ├── ci_logo_flame.jpg ├── ci_quick_ref.png ├── codeigniter_1.7.1_helper_reference.pdf ├── codeigniter_1.7.1_helper_reference.png ├── codeigniter_1.7.1_library_reference.pdf ├── codeigniter_1.7.1_library_reference.png ├── file.gif ├── folder.gif ├── nav_bg_darker.jpg ├── nav_separator_darker.jpg ├── nav_toggle_darker.jpg ├── reactor-bullet.png ├── smile.gif └── transparent.gif ├── index.html ├── installation ├── downloads.html ├── index.html ├── troubleshooting.html ├── upgrade_120.html ├── upgrade_130.html ├── upgrade_131.html ├── upgrade_132.html ├── upgrade_133.html ├── upgrade_140.html ├── upgrade_141.html ├── upgrade_150.html ├── upgrade_152.html ├── upgrade_153.html ├── upgrade_154.html ├── upgrade_160.html ├── upgrade_161.html ├── upgrade_162.html ├── upgrade_163.html ├── upgrade_170.html ├── upgrade_171.html ├── upgrade_172.html ├── upgrade_200.html ├── upgrade_201.html ├── upgrade_202.html ├── upgrade_203.html ├── upgrade_210.html ├── upgrade_211.html ├── upgrade_212.html ├── upgrade_b11.html └── upgrading.html ├── libraries ├── benchmark.html ├── caching.html ├── calendar.html ├── cart.html ├── config.html ├── email.html ├── encryption.html ├── file_uploading.html ├── form_validation.html ├── ftp.html ├── image_lib.html ├── input.html ├── javascript.html ├── language.html ├── loader.html ├── migration.html ├── output.html ├── pagination.html ├── parser.html ├── security.html ├── sessions.html ├── table.html ├── trackback.html ├── typography.html ├── unit_testing.html ├── uri.html ├── user_agent.html ├── xmlrpc.html └── zip.html ├── license.html ├── nav ├── hacks.txt ├── moo.fx.js ├── nav.js ├── prototype.lite.js └── user_guide_menu.js ├── overview ├── appflow.html ├── at_a_glance.html ├── cheatsheets.html ├── features.html ├── getting_started.html ├── goals.html ├── index.html └── mvc.html ├── toc.html ├── tutorial ├── conclusion.html ├── create_news_items.html ├── hard_coded_pages.html ├── index.html ├── news_section.html └── static_pages.html └── userguide.css /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /application/cache/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/autoload.php: -------------------------------------------------------------------------------- 1 | '', 5 | 'xhtml1-strict' => '', 6 | 'xhtml1-trans' => '', 7 | 'xhtml1-frame' => '', 8 | 'html5' => '', 9 | 'html4-strict' => '', 10 | 'html4-trans' => '', 11 | 'html4-frame' => '' 12 | ); 13 | 14 | /* End of file doctypes.php */ 15 | /* Location: ./application/config/doctypes.php */ -------------------------------------------------------------------------------- /application/config/email.php: -------------------------------------------------------------------------------- 1 | 'ae', 12 | '/ö|œ/' => 'oe', 13 | '/ü/' => 'ue', 14 | '/Ä/' => 'Ae', 15 | '/Ü/' => 'Ue', 16 | '/Ö/' => 'Oe', 17 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', 18 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', 19 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 20 | '/ç|ć|ĉ|ċ|č/' => 'c', 21 | '/Ð|Ď|Đ/' => 'D', 22 | '/ð|ď|đ/' => 'd', 23 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', 24 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', 25 | '/Ĝ|Ğ|Ġ|Ģ/' => 'G', 26 | '/ĝ|ğ|ġ|ģ/' => 'g', 27 | '/Ĥ|Ħ/' => 'H', 28 | '/ĥ|ħ/' => 'h', 29 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', 30 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', 31 | '/Ĵ/' => 'J', 32 | '/ĵ/' => 'j', 33 | '/Ķ/' => 'K', 34 | '/ķ/' => 'k', 35 | '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', 36 | '/ĺ|ļ|ľ|ŀ|ł/' => 'l', 37 | '/Ñ|Ń|Ņ|Ň/' => 'N', 38 | '/ñ|ń|ņ|ň|ʼn/' => 'n', 39 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', 40 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', 41 | '/Ŕ|Ŗ|Ř/' => 'R', 42 | '/ŕ|ŗ|ř/' => 'r', 43 | '/Ś|Ŝ|Ş|Š/' => 'S', 44 | '/ś|ŝ|ş|š|ſ/' => 's', 45 | '/Ţ|Ť|Ŧ/' => 'T', 46 | '/ţ|ť|ŧ/' => 't', 47 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', 48 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', 49 | '/Ý|Ÿ|Ŷ/' => 'Y', 50 | '/ý|ÿ|ŷ/' => 'y', 51 | '/Ŵ/' => 'W', 52 | '/ŵ/' => 'w', 53 | '/Ź|Ż|Ž/' => 'Z', 54 | '/ź|ż|ž/' => 'z', 55 | '/Æ|Ǽ/' => 'AE', 56 | '/ß/'=> 'ss', 57 | '/IJ/' => 'IJ', 58 | '/ij/' => 'ij', 59 | '/Œ/' => 'OE', 60 | '/ƒ/' => 'f' 61 | ); 62 | 63 | /* End of file foreign_chars.php */ 64 | /* Location: ./application/config/foreign_chars.php */ -------------------------------------------------------------------------------- /application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->latest() this is the version that schema will 21 | | be upgraded / downgraded to. 22 | | 23 | */ 24 | $config['migration_version'] = 0; 25 | 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Migrations Path 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Path to your migrations folder. 33 | | Typically, it will be within your application path. 34 | | Also, writing permission is required within the migrations path. 35 | | 36 | */ 37 | $config['migration_path'] = APPPATH . 'migrations/'; 38 | 39 | 40 | /* End of file migration.php */ 41 | /* Location: ./application/config/migration.php */ -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | 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: ./application/config/smileys.php */ -------------------------------------------------------------------------------- /application/controllers/company.php: -------------------------------------------------------------------------------- 1 | load->model("company_model", "model"); 9 | } 10 | 11 | public function get() { 12 | 13 | authorizedContent(true); 14 | 15 | $email = $this->session->userdata("email"); 16 | 17 | $companies = $this->model->get($email); 18 | 19 | $companyInfo = $this->session->userdata("company"); 20 | $data = array( 21 | "selected" => $companyInfo['name'], 22 | "companies" => $companies 23 | ); 24 | $this->sendJson($data); 25 | } 26 | 27 | private function sendJson($obj) { 28 | 29 | header("Content-Type: application/json"); 30 | echo json_encode($obj); 31 | } 32 | } -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/controllers/invitation.php: -------------------------------------------------------------------------------- 1 | load->helper("form"); 9 | 10 | $this->load->model("invitation_model", "model"); 11 | } 12 | 13 | public function register($secret) { 14 | 15 | $invitedUser = $this->model->getInvitedUser($secret); 16 | 17 | $this->load->view("common/header"); 18 | $this->load->view("common/public_navbar"); 19 | 20 | if($invitedUser) { 21 | 22 | $data = array( 23 | "secret" => $secret, 24 | "user" => $invitedUser 25 | ); 26 | $this->load->view("invitation/register", $data); 27 | } else { 28 | 29 | $this->load->view("invitation/expired"); 30 | } 31 | 32 | $this->load->view("common/footer"); 33 | } 34 | 35 | public function doRegister() { 36 | 37 | $this->load->library('form_validation'); 38 | 39 | $this->form_validation->set_rules('password', 'Password', 'required'); 40 | $this->form_validation->set_rules('confirmPassword', 'Confirm Password', 'required|matches[password]'); 41 | 42 | $secret = $this->input->post("secret"); 43 | 44 | if($this->form_validation->run() == FALSE) { 45 | 46 | //validation failed 47 | $this->register($secret); 48 | } else { 49 | 50 | $password = $this->input->post("password"); 51 | $nickname = $this->input->post("nickname"); 52 | 53 | $invitedUser = $this->model->getInvitedUser($secret); 54 | 55 | if($invitedUser) { 56 | 57 | $this->load->model("user_model"); 58 | 59 | //change password 60 | $this->user_model->changePasswordWithoutCheck($invitedUser['email'], $password); 61 | 62 | //update user 63 | $this->user_model->update($invitedUser['email'], array("nickname" => $nickname)); 64 | 65 | //remove invitation 66 | $this->model->clearInvitation($secret);; 67 | 68 | //do login 69 | $this->user_model->login($email); 70 | 71 | redirect(site_url('user/dashboard')); 72 | 73 | echo "Done"; 74 | } else { 75 | 76 | $this->register($secret); 77 | } 78 | 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /application/controllers/password.php: -------------------------------------------------------------------------------- 1 | load->helper("form"); 9 | $this->load->model("password_model", "model"); 10 | } 11 | 12 | public function reset() { 13 | 14 | $this->load->view("common/header"); 15 | $this->load->view("common/public_navbar"); 16 | $this->load->view("password/reset"); 17 | $this->load->view("common/footer"); 18 | } 19 | 20 | public function doReset() { 21 | 22 | $this->load->library("form_validation"); 23 | $this->form_validation->set_rules("email", "Email", "required|valid_email"); 24 | 25 | if($this->form_validation->run()) { 26 | 27 | $email = $this->input->post("email"); 28 | 29 | $this->load->model("user_model"); 30 | $user = $this->user_model->getByEmail($email); 31 | 32 | if($user) { 33 | 34 | $code = $this->model->getResetCode($user['id']); 35 | 36 | $this->load->model("email_model"); 37 | $this->email_model->passwordReset($email, $code); 38 | 39 | } else { 40 | log_message("INFO", "password reset try for email: $email, but not registered"); 41 | } 42 | 43 | $this->load->view("common/header"); 44 | $this->load->view("common/public_navbar"); 45 | $this->load->view("password/reset_confirm"); 46 | $this->load->view("common/footer"); 47 | 48 | } else { 49 | 50 | $this->reset(); 51 | } 52 | } 53 | 54 | /* 55 | Used to get the new password for completing password resetting process 56 | */ 57 | public function newPassword($code) { 58 | 59 | $this->load->view("common/header"); 60 | $this->load->view("common/public_navbar"); 61 | $this->load->view("password/new_password", array( "code" => $code )); 62 | $this->load->view("common/footer"); 63 | } 64 | 65 | public function doNewPassword() { 66 | 67 | $this->load->library("form_validation"); 68 | $this->form_validation->set_rules("password", "Password", "required"); 69 | $this->form_validation->set_rules("confirmPassword", "Confirm Password", "required|matches[password]"); 70 | 71 | $password = $this->input->post("password"); 72 | $code = $this->input->post("code"); 73 | 74 | if($this->form_validation->run()) { 75 | 76 | $this->load->model("password_model"); 77 | $this->load->model("user_model"); 78 | 79 | $userId = $this->password_model->getUserId($code); 80 | 81 | if($userId) { 82 | 83 | $user = $this->user_model->getById($userId); 84 | $this->user_model->changePasswordWithoutCheck($user['email'], $password); 85 | $this->user_model->login($user['email']); 86 | 87 | $this->password_model->deleteResetCode($code); 88 | 89 | redirect(site_url("user/dashboard")); 90 | } else { 91 | 92 | $this->load->view("common/header"); 93 | $this->load->view("common/public_navbar"); 94 | $this->load->view("password/invalid_code"); 95 | $this->load->view("common/footer"); 96 | } 97 | 98 | 99 | } else { 100 | 101 | $this->newPassword($code); 102 | } 103 | } 104 | 105 | 106 | 107 | } -------------------------------------------------------------------------------- /application/controllers/plan.php: -------------------------------------------------------------------------------- 1 | load->model("plan_model", "model"); 9 | } 10 | 11 | public function select() { 12 | 13 | authorizedContent(); 14 | 15 | $data = array( 16 | "scripts"=> array("plans.js") 17 | ); 18 | 19 | $email = $this->session->userdata("email"); 20 | $companyInfo = $this->session->userdata("company"); 21 | 22 | $planData = array( 23 | "plans" => $this->model->get(), 24 | "selectedPlan" => $this->model->getSelectedPlan($companyInfo['id']), 25 | "company" => $companyInfo 26 | ); 27 | 28 | $this->load->view("common/header", $data); 29 | $this->load->view("common/private_navbar"); 30 | $this->load->view("plan/select", $planData); 31 | $this->load->view("common/footer"); 32 | } 33 | 34 | public function doSelect() { 35 | 36 | authorizedContent(true); 37 | 38 | $email = $this->session->userdata("email"); 39 | $companyInfo = $this->session->userdata("company"); 40 | $planId = intval($this->input->post("planId")); 41 | 42 | if(!$companyInfo) { 43 | 44 | $this->sendJson(array("error" => "No Company Selected")); 45 | } else if($planId) { 46 | 47 | $companyId = $companyInfo['id']; 48 | 49 | $this->model->selectPlan($companyId, $planId); 50 | $this->sendJson(array("success" => true)); 51 | 52 | } else { 53 | 54 | $this->sendJson(array("error" => "No PlanId Provided")); 55 | } 56 | 57 | } 58 | 59 | public function um($metric, $qty) { 60 | 61 | $companyInfo = $this->session->userdata("company"); 62 | 63 | $companyId = $companyInfo['id']; 64 | 65 | updateMetric($companyId, $metric, $qty); 66 | } 67 | 68 | private function sendJson($obj) { 69 | 70 | header("Content-Type: application/json"); 71 | echo json_encode($obj); 72 | } 73 | } -------------------------------------------------------------------------------- /application/controllers/profile.php: -------------------------------------------------------------------------------- 1 | $this->session->userdata("nickname"), 11 | "email" => $this->session->userdata("email") 12 | ); 13 | 14 | if(!$data['nickname']) { 15 | $data['nickname'] = $data['email']; 16 | } 17 | 18 | $this->load->view("common/header"); 19 | $this->load->view("common/private_navbar"); 20 | $this->load->view("profile/index", $data); 21 | $this->load->view("common/footer"); 22 | } 23 | 24 | public function edit($errors = array()) { 25 | 26 | authorizedContent(); 27 | 28 | $data = array( 29 | "nickname" => $this->session->userdata("nickname"), 30 | "email" => $this->session->userdata("email"), 31 | "errors" => $errors 32 | ); 33 | 34 | $this->load->helper("form"); 35 | $this->load->view("common/header"); 36 | $this->load->view("common/private_navbar"); 37 | $this->load->view("profile/edit", $data); 38 | $this->load->view("common/footer"); 39 | 40 | } 41 | 42 | public function doEdit() { 43 | 44 | authorizedContent(); 45 | 46 | $email = $this->session->userdata("email"); 47 | $data = array( 48 | "email" => $this->input->post("email"), 49 | "nickname" => $this->input->post("nickname") 50 | ); 51 | 52 | $this->load->model("user_model"); 53 | $this->user_model->update($email, $data); 54 | redirect(site_url("profile/edit?updated=true")); 55 | } 56 | 57 | public function doPasswordChange() { 58 | 59 | authorizedContent(); 60 | 61 | 62 | $this->load->helper("form"); 63 | $this->load->library('form_validation'); 64 | 65 | $this->form_validation->set_rules('currPassword', 'Current Password', 'required'); 66 | $this->form_validation->set_rules('newPassword', 'New Password', 'required'); 67 | $this->form_validation->set_rules('confirmNewPassword', 'Confirm New Password', 'required'); 68 | $this->form_validation->set_rules('confirmNewPassword', 'Confirm New Password', 'matches[newPassword]'); 69 | 70 | if($this->form_validation->run() == FALSE) { 71 | 72 | //validation failed 73 | $this->edit(); 74 | } else { 75 | 76 | $email = $this->session->userdata("email"); 77 | $password = $this->input->post("currPassword"); 78 | $newPassword = $this->input->post("newPassword"); 79 | $this->load->model("user_model"); 80 | if($this->user_model->changePassword($email, $password, $newPassword)) { 81 | 82 | redirect(site_url("profile/edit?passwordChanged=true")); 83 | } else { 84 | 85 | $errors = array( 86 | "changePassword" => "Your current password is not correct" 87 | ); 88 | $this->edit($errors); 89 | } 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /application/controllers/welcome.php: -------------------------------------------------------------------------------- 1 | 18 | * @see http://codeigniter.com/user_guide/general/urls.html 19 | */ 20 | public function index() 21 | { 22 | $this->load->view('common/header'); 23 | $this->load->view('common/public_navbar'); 24 | $this->load->view('common/footer'); 25 | } 26 | } 27 | 28 | /* End of file welcome.php */ 29 | /* Location: ./application/controllers/welcome.php */ -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/errors/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Page Not Found 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_db.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Database Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_general.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_php.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

A PHP Error was encountered

4 | 5 |

Severity:

6 |

Message:

7 |

Filename:

8 |

Line Number:

9 | 10 |
-------------------------------------------------------------------------------- /application/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/helpers/access_controll_helper.php: -------------------------------------------------------------------------------- 1 | session->userdata("email"); 10 | 11 | if(!$email) { 12 | 13 | if($jsonUser) { 14 | 15 | header("Content-Type: application/json"); 16 | echo json_encode(array("error"=> "Unauthorized access")); 17 | die(); 18 | } else { 19 | 20 | redirect(site_url("user/login")); 21 | } 22 | } 23 | } 24 | 25 | function authorizedContentWithSharing($projectId) { 26 | 27 | $CI =& get_instance(); 28 | $userId = $CI->session->userdata("id"); 29 | $CI->load->model("project_model"); 30 | 31 | if($userId) { 32 | 33 | $role = $CI->project_model->getUserRole($userId, $projectId); 34 | 35 | if($role) { 36 | $project = $CI->project_model->getAssignedProject($userId, $projectId); 37 | } else if($CI->session->userdata("SHARE_PROJECT") == $projectId) { 38 | 39 | $role = "VIEWER"; 40 | $project = $CI->project_model->getOne($projectId); 41 | } else { 42 | authorizedContent(); 43 | } 44 | 45 | } else if($CI->session->userdata("SHARE_PROJECT") == $projectId) { 46 | 47 | $role = "VIEWER"; 48 | $project = $CI->project_model->getOne($projectId); 49 | } else { 50 | authorizedContent(); 51 | } 52 | 53 | return array( 54 | 'role' => $role, 55 | 'project' => $project 56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/helpers/plan_helper.php: -------------------------------------------------------------------------------- 1 | load->model("plan_model"); 10 | $CI->plan_model->updateMetric($companyId, $metricName, $qty); 11 | } -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/models/company_model.php: -------------------------------------------------------------------------------- 1 | db->where("email", $email); 8 | $this->db->where("name", $name); 9 | 10 | log_message("INFO", "creating company: $name for user: $email"); 11 | 12 | $companies = $this->db->get("company")->result_array(); 13 | if(count($companies) == 0) { 14 | 15 | $this->db->insert("company", array( 16 | "name" => $name, 17 | "email" => $email, 18 | "createdAt" => time() 19 | )); 20 | return TRUE; 21 | } else { 22 | 23 | log_message("INFO", "Company exists: $name by user: $email"); 24 | return FALSE; 25 | } 26 | } 27 | 28 | public function get($email) { 29 | 30 | log_message("INFO", "getiing all companies for user: $email"); 31 | 32 | $this->db->where("email", $email); 33 | $companies = $this->db->get("company")->result_array(); 34 | 35 | return $companies; 36 | } 37 | 38 | public function getOne($email, $name) { 39 | 40 | log_message("INFO", "getiing company: $name for user: $email"); 41 | 42 | $this->db->where("name", $name); 43 | $this->db->where("email", $email); 44 | $companies = $this->db->get("company")->result_array(); 45 | 46 | if(count($companies) == 1) { 47 | 48 | return $companies[0]; 49 | } else { 50 | 51 | log_message("INFO", "no such company: $company for user: #email"); 52 | return NULL; 53 | } 54 | } 55 | 56 | public function delete($email, $name) { 57 | 58 | $this->db->where("email", $email); 59 | $this->db->where("name", $name); 60 | 61 | $this->db->delete("company"); 62 | return TRUE; 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /application/models/email_model.php: -------------------------------------------------------------------------------- 1 | config->load("email", TRUE); 8 | $smtpInfo = $this->config->item("smtp", "email"); 9 | 10 | $config = Array( 11 | 'protocol' => 'smtp', 12 | 'smtp_host' => $smtpInfo['host'], 13 | 'smtp_port' => $smtpInfo['port'], 14 | 'smtp_user' => $smtpInfo['user'], 15 | 'smtp_pass' => $smtpInfo['password'], 16 | 'mailtype' => 'html', 17 | 'charset' => 'iso-8859-1' 18 | ); 19 | $this->load->library('email', $config); 20 | $this->email->set_newline("\r\n"); 21 | 22 | $smtp = $this->config->item("smtp", "email"); 23 | } 24 | 25 | public function passwordReset($email, $code) { 26 | 27 | log_message("INFO", "sending password reset code: $code to email: $email"); 28 | 29 | $link = site_url("password/newPassword/$code"); 30 | $message = 31 | "Click following link to reset your password

". 32 | "$link"; 33 | 34 | $this->sendEmail($email, "Password Reset Request", $message); 35 | 36 | } 37 | 38 | public function validateUser($email, $code) { 39 | 40 | $link = site_url("user/validate/$code"); 41 | $message = 42 | "Please click following link to validate your account.

". 43 | "$link"; 44 | 45 | $this->sendEmail($email, "Validate your account at SAAS", $message); 46 | 47 | log_message("INFO", "validating acount with: $email with code: $code"); 48 | } 49 | 50 | public function inviteUser($email, $code) { 51 | 52 | $link = site_url("invitation/register/$code"); 53 | $message = 54 | "Please click following link to create your account.

". 55 | "$link"; 56 | 57 | $this->sendEmail($email, "You are invited to SAAS", $message); 58 | 59 | log_message("INFO", "inviting user: $email with code: $code"); 60 | } 61 | 62 | private function sendEmail($to, $subject, $message) { 63 | 64 | $enable = $this->config->item("enable", "email"); 65 | 66 | if($enable) { 67 | 68 | $sender = $this->config->item("sender", "email"); 69 | 70 | $this->email->from($sender['email'], $sender['name']); 71 | $this->email->to($to); 72 | $this->email->subject($subject); 73 | $this->email->message($message); 74 | 75 | if(!$this->email->send()) { 76 | 77 | log_message("ERROR", "email sending failed to: $to with subject: $subject"); 78 | log_message("ERROR", $this->email->print_debugger()); 79 | } 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/models/invitation_model.php: -------------------------------------------------------------------------------- 1 | db->query($sql, array($email, $key, $key)); 14 | 15 | return $key; 16 | } 17 | 18 | public function getInvitedUser($secret) { 19 | 20 | log_message("INFO", "getting user from invitation secret: $secret"); 21 | 22 | $sql = "SELECT u.* from user u, invitation i WHERE u.email = i.email AND i.secret = ?"; 23 | $users = $this->db->query($sql, array($secret))->result_array(); 24 | 25 | if(count($users) == 1) { 26 | return $users[0]; 27 | } else { 28 | 29 | log_message("ERROR", "not a valid invitation secret: $secret"); 30 | return FALSE; 31 | } 32 | } 33 | 34 | public function clearInvitation($secret) { 35 | 36 | log_message("INFO", "clearing invitation for secret: $secret"); 37 | 38 | $this->db->where("secret", $secret); 39 | $this->db->delete("invitation"); 40 | } 41 | } -------------------------------------------------------------------------------- /application/models/password_model.php: -------------------------------------------------------------------------------- 1 | db->query($sql, array($userId, $code, $time, $code, $time)); 15 | 16 | return $code; 17 | } 18 | 19 | public function getUserId($code) { 20 | 21 | log_message("INFO", "getting userId by code: $code"); 22 | 23 | $codes = $this->db->get_where("password_reset", array("code" => $code))->result_array(); 24 | 25 | if(count($codes) == 1) { 26 | return $codes[0]["user"]; 27 | } else { 28 | return NULL; 29 | } 30 | } 31 | 32 | public function deleteResetCode($code) { 33 | 34 | log_message("INFO", "deleting reset code: $code"); 35 | 36 | $this->db->where("code", $code); 37 | $this->db->delete("password_reset"); 38 | } 39 | } -------------------------------------------------------------------------------- /application/models/plan_model.php: -------------------------------------------------------------------------------- 1 | db->get("plan")->result_array(); 10 | 11 | return $plans; 12 | } 13 | 14 | public function selectPlan($companyId, $planId) { 15 | 16 | log_message("INFO", "select plan: $planId for company: $companyId"); 17 | 18 | $this->db->where("id", $companyId); 19 | 20 | $data = array( 21 | "plan" => $planId 22 | ); 23 | $this->db->update("company", $data); 24 | return TRUE; 25 | } 26 | 27 | public function getSelectedPlan($companyId) { 28 | 29 | if($companyId) { 30 | 31 | log_message("INFO", "getting selectd plan for company: $companyId"); 32 | 33 | $this->db->where("id", $companyId); 34 | 35 | $companies = $this->db->get("company")->result_array(); 36 | return $companies[0]['plan']; 37 | } else { 38 | return 0; 39 | } 40 | } 41 | 42 | public function updateMetric($companyId, $metricName, $qty) { 43 | 44 | 45 | $plan = $this->getSelectedPlan($companyId); 46 | if($plan) { 47 | 48 | //get metricId 49 | $this->db->where("plan", $plan); 50 | $this->db->where("name", $metricName); 51 | $plan_metrics = $this->db->get("plan_metric")->result_array(); 52 | if(count($plan_metrics) == 1) { 53 | 54 | log_message("INFO", "update metric: '$metricName' for the current plan: $plan for company: $companyId"); 55 | //has a plan metric 56 | $plan_metric = intval($plan_metrics[0]['id']); 57 | $sql = "INSERT INTO company_plan_metric (company, plan_metric, qty) VALUES (?, ?, ?) "; 58 | $sql .= "ON DUPLICATE KEY UPDATE qty = qty + ?; "; 59 | $this->db->query($sql, array($companyId, $plan_metric, $qty, $qty)); 60 | return TRUE; 61 | } else { 62 | //no such plan metric for the current plan 63 | log_message("ERROR", "no such plan metric: '$metricName' for the current plan: $plan for company: $companyId"); 64 | return FALSE; 65 | } 66 | } else { 67 | 68 | log_message("ERROR", "cannot determine the plan for company: $companyId"); 69 | return FALSE; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/common/footer.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /application/views/common/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SAAS Boilerplate 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /application/views/common/private_navbar.php: -------------------------------------------------------------------------------- 1 | "Dashboard", "href" => "user/dashboard")); 5 | 6 | $comapanyInfo = $this->session->userdata("company"); 7 | if($comapanyInfo) { 8 | array_push($links, array("caption" => "Archive", "href" => "project/archive")); 9 | array_push($links, array("caption" => "Plans", "href" => "plan/select")); 10 | } 11 | 12 | array_push($links, array("caption" => "Profile", "href" => "profile")); 13 | array_push($links, array("caption" => "Logout", "href" => "user/doLogout")); 14 | 15 | ?> 16 |
17 | -------------------------------------------------------------------------------- /application/views/common/public_navbar.php: -------------------------------------------------------------------------------- 1 | "Home", "href" => ""), 4 | array("caption" => "Login", "href" => "user/login"), 5 | array("caption" => "Register", "href" => "user/register") 6 | ); 7 | ?> 8 |
9 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/invitation/expired.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

Your Invitation Expired!

5 | 6 | This invitation code has been already used
7 | So try to login with your invited email 8 |
9 | 10 |
-------------------------------------------------------------------------------- /application/views/invitation/register.php: -------------------------------------------------------------------------------- 1 |
2 | User Registration (via Inivitation) 3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | "form-horizontal", 13 | "method" => "post" 14 | )); 15 | 16 | ?> 17 | 18 |
19 | 20 |
21 | ' id="inputEmail" placeholder="Enter your email"> 22 |
23 |
24 |
25 | 26 |
27 | ' id="inputNickname" placeholder="Enter your nickname"> 28 |
29 |
30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 |
47 | 48 | 49 |
-------------------------------------------------------------------------------- /application/views/item/edit.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | load->view("item/menubar", array( 5 | "project" => $project, 6 | )); 7 | ?> 8 | 9 |
10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 | 18 | "form-horizontal", 20 | "method" => "post" 21 | )); 22 | 23 | ?> 24 |
25 | 26 |
27 | ' id="inputName" placeholder="Enter new project name"> 28 |
29 |
30 |
31 |
32 | 33 |
34 |
35 | 36 | 37 |
38 | There is no such project 39 |
40 | 41 |
42 |
-------------------------------------------------------------------------------- /application/views/item/menubar.php: -------------------------------------------------------------------------------- 1 |

Project: > Item:

2 |
3 |
4 | "Back to Project", "href" => "project/view/{$project['id']}")); 9 | array_push($links, array("caption" => "Info", "href" => "item/view/{$project['id']}/{$item['id']}")); 10 | 11 | if($this->project_model->checkPermission("EDITOR", $role)) { 12 | array_push($links, array("caption" => "Settings", "href" => "item/edit/{$project['id']}/{$item['id']}")); 13 | } 14 | 15 | ?> 16 | 28 |
-------------------------------------------------------------------------------- /application/views/item/view.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | load->view("item/menubar", array( 5 | "project" => $project 6 | )); 7 | ?> 8 | 9 |
10 | 11 | 12 |
13 |
-------------------------------------------------------------------------------- /application/views/password/invalid_code.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Invalid Reset Link

4 | Seems like you've already reset the password.
5 | If go back to your email and copy and paste the Reset Link to your browser address bar. 6 |
7 |
-------------------------------------------------------------------------------- /application/views/password/new_password.php: -------------------------------------------------------------------------------- 1 |
2 | New Password for Resetting Password 3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | "form-horizontal", 13 | "method" => "post" 14 | )); 15 | 16 | ?> 17 | 18 |
19 | 20 |
21 | ' id="inputPassword" placeholder="Enter your password"> 22 |
23 |
24 |
25 | 26 |
27 | ' id="inputConfirmPassword" placeholder="Enter your password"> 28 |
29 |
30 |
31 |
32 | 33 |
34 |
35 | 36 | 37 |
-------------------------------------------------------------------------------- /application/views/password/reset.php: -------------------------------------------------------------------------------- 1 |
2 | Password Reset 3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | "form-horizontal", 13 | "method" => "post" 14 | )); 15 | 16 | ?> 17 |
18 | 19 |
20 | ' id="inputEmail" placeholder="Enter your email"> 21 |
22 |
23 |
24 |
25 | 26 |
27 |
28 | 29 | 30 |
-------------------------------------------------------------------------------- /application/views/password/reset_confirm.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Password Reset Email Sent!

4 | Please check your email to reset password 5 |
6 |
-------------------------------------------------------------------------------- /application/views/plan/select.php: -------------------------------------------------------------------------------- 1 |
2 |

Available Plans

3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 |
Plan NameDescriptionSelect
21 | 22 | 23 | 24 | 25 | 26 |
31 |
32 |
-------------------------------------------------------------------------------- /application/views/profile/edit.php: -------------------------------------------------------------------------------- 1 |
2 |

Edit Profile

3 | Back

4 | 5 |
6 | 7 |

Basic Info

8 | 9 | input->get("updated")) { ?> 10 | 11 |
12 | Basic Info Successfully Updated! 13 |
14 | 15 | 16 | 17 | "form-horizontal", 19 | "method" => "post" 20 | )); 21 | 22 | ?> 23 |
24 | 25 |
26 | 27 |
28 |
29 |
30 | 31 |
32 | 33 |
34 |
35 |
36 |
37 | 38 |
39 |
40 | 41 | 42 |
43 | 44 |
45 | 46 |

Change Password

47 | 48 | 49 | 50 |
51 | 52 |
53 | 54 | 55 | 56 | 57 |
58 | 59 |
60 | 61 | 62 | 63 | input->get("passwordChanged")) { ?> 64 | 65 |
66 | Password Changed Successfully! 67 |
68 | 69 | 70 | 71 | "form-horizontal", 73 | "method" => "post" 74 | )); 75 | 76 | ?> 77 |
78 | 79 |
80 | 81 |
82 |
83 |
84 | 85 |
86 | 87 |
88 |
89 |
90 | 91 |
92 | 93 |
94 |
95 |
96 |
97 | 98 |
99 |
100 | 101 | 102 |
103 | 104 | 105 |
106 | -------------------------------------------------------------------------------- /application/views/profile/index.php: -------------------------------------------------------------------------------- 1 |
2 |

Profile

3 | Edit Profile

4 |
5 |

6 | 7 |

8 |

9 | Email: 10 |
11 |
12 | 13 | 14 |
-------------------------------------------------------------------------------- /application/views/project/archive.php: -------------------------------------------------------------------------------- 1 |
2 |

Project Archive

3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Project NameUnarchive
22 |
23 |
-------------------------------------------------------------------------------- /application/views/project/archived_items.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | load->view("project/menubar", array( 5 | "project" => $project, 6 | "role" => $role 7 | )); 8 | ?> 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
Item NameUnarchive
28 | 29 |
30 |
-------------------------------------------------------------------------------- /application/views/project/edit.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | load->view("project/menubar", array( 5 | "project" => $project, 6 | "role" => $role 7 | )); 8 | ?> 9 | 10 |
11 | 12 | model->checkPermission("ADMIN", $role)) { ?> 13 | 14 |
15 | 16 |
17 | 18 | 19 | "form-horizontal", 21 | "method" => "post" 22 | )); 23 | 24 | ?> 25 |
26 | 27 |
28 | ' id="inputName" placeholder="Enter new project name"> 29 |
30 |
31 |
32 |
33 | 34 |
35 |
36 | 37 | 38 |
39 | There is no such project 40 |
41 | 42 |
43 |
-------------------------------------------------------------------------------- /application/views/project/info.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | load->view("project/menubar", array( 5 | "project" => $project, 6 | "role" => $role 7 | )); 8 | ?> 9 | 10 |
11 | 12 | 13 |
14 |
-------------------------------------------------------------------------------- /application/views/project/invalid_share_code.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Invalid Project Share URL

4 | This is not a valid Project Share URL. Please double check the URL 5 |
6 |
-------------------------------------------------------------------------------- /application/views/project/menubar.php: -------------------------------------------------------------------------------- 1 |

Project:

2 |
3 |
4 | "Back to Dashboard", "href" => "user/dashboard/{$project['company']}")); 9 | array_push($links, array("caption" => "Items", "href" => "project/view/{$project['id']}")); 10 | array_push($links, array("caption" => "Info", "href" => "project/info/{$project['id']}")); 11 | 12 | if($this->model->checkPermission("ADMIN", $role)) { 13 | 14 | array_push($links, array("caption" => "Archived Items", "href" => "project/archivedItems/{$project['id']}")); 15 | array_push($links, array("caption" => "Settings", "href" => "project/edit/{$project['id']}")); 16 | } 17 | 18 | ?> 19 | 31 |
-------------------------------------------------------------------------------- /application/views/project/restricted.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

Your are not allowed here

5 | 6 | You don't own this project
7 | So you can't access it 8 |
9 | 10 |
-------------------------------------------------------------------------------- /application/views/user/dashboard.php: -------------------------------------------------------------------------------- 1 | session->userdata("company"); 3 | if($companyInfo) { 4 | $myCompanyId = $companyInfo['id']; 5 | } else { 6 | $myCompanyId = NULL; 7 | } 8 | ?> 9 |
10 |

Projects

11 |
12 | 13 | 22 | 23 |
24 | 25 | 26 |
27 |
Add New Project
28 | 29 |
30 | 31 | 32 | 33 | 34 |
35 |
36 | '> 37 | 38 | 39 | ' class='projectEdit btn btn-info btn-mini'>Edit 40 | 41 | 42 | 43 |
44 | 45 | 46 |
47 |
48 |
49 |
-------------------------------------------------------------------------------- /application/views/user/login.php: -------------------------------------------------------------------------------- 1 |
2 | User Login 3 | 4 | 5 | 6 |
7 | 8 | 9 |
10 | 11 | 12 | "form-horizontal", 14 | "method" => "post" 15 | )); 16 | 17 | ?> 18 |
19 | 20 |
21 | ' id="inputEmail" placeholder="Enter your email"> 22 |
23 |
24 |
25 | 26 |
27 | 28 |

29 | Forgot Password 30 |
31 |
32 |
33 |
34 | 35 |
36 |
37 | 38 | 39 |
-------------------------------------------------------------------------------- /application/views/user/register.php: -------------------------------------------------------------------------------- 1 |
2 | User Registration 3 | 4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | "form-horizontal", 13 | "method" => "post" 14 | )); 15 | 16 | ?> 17 |
18 | 19 |
20 | ' id="inputEmail" placeholder="Enter your email"> 21 |
22 |
23 |
24 | 25 |
26 | ' id="inputNickname" placeholder="Enter your nickname"> 27 |
28 |
29 |
30 | 31 |
32 | ' id="inputCompany" placeholder="Enter your company name"> 33 |
34 |
35 |
36 | 37 |
38 | 39 |
40 |
41 |
42 | 43 |
44 | 45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 | 53 | 54 |
-------------------------------------------------------------------------------- /application/views/user/validated.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

User Account Validated!

4 | You will be redirected to dashboard withing 5 seconds. Or click 5 | '>here 6 | 7 | 13 |
14 |
-------------------------------------------------------------------------------- /application/views/user/validation_failed.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Invalid validation link!

4 | User validation link is expired or invalid 5 |
6 |
-------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Open+Sans); 2 | body { 3 | font-family: 'Open Sans'; 4 | } 5 | 6 | .navbar-shadow { 7 | box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.7); 8 | } 9 | 10 | #footer { 11 | padding: 10px 0px 0px 0px; 12 | margin-top: 30px; 13 | border-top: 1px solid #ccc; 14 | text-align: center; 15 | font-size: 12px; 16 | color: #888; 17 | } 18 | 19 | #companyBar { 20 | 21 | padding: 0px 0px 20px 0px; 22 | border-bottom: 1px solid #ccc; 23 | } 24 | 25 | .miniContent { 26 | margin: 30px 0px 0px 0px; 27 | } 28 | 29 | .project { 30 | 31 | padding: 10px 20px 10px 20px; 32 | margin: 0px 20px 20px 0px; 33 | border: 1px solid #ccc; 34 | float: left; 35 | width: 160px; 36 | text-align: center; 37 | } 38 | 39 | .project img { 40 | 41 | margin: 0px 0px 5px 0px; 42 | } 43 | 44 | .project .name { 45 | 46 | font-size: 15px; 47 | font-weight: bold; 48 | margin: 0px 0px 10px 0px; 49 | } 50 | 51 | #addProject { 52 | 53 | cursor: pointer; 54 | } 55 | 56 | #planList { 57 | margin-top: 30px; 58 | } 59 | 60 | 61 | #archiveList { 62 | margin: 30px 0px 0px 0px; 63 | } 64 | 65 | #userList { 66 | width: 175px; 67 | text-align: left; 68 | } 69 | 70 | .projectUser { 71 | float: left; 72 | margin: 0px 3px 3px 0px; 73 | } 74 | 75 | .item { 76 | 77 | padding: 10px 20px 10px 20px; 78 | margin: 0px 20px 20px 0px; 79 | border: 1px solid #ccc; 80 | float: left; 81 | width: 160px; 82 | text-align: center; 83 | } 84 | 85 | .item img { 86 | 87 | margin: 0px 0px 5px 0px; 88 | } 89 | 90 | .item .name { 91 | 92 | font-size: 15px; 93 | font-weight: bold; 94 | margin: 0px 0px 10px 0px; 95 | } 96 | 97 | #addItem { 98 | cursor: pointer; 99 | } -------------------------------------------------------------------------------- /images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/images/add.png -------------------------------------------------------------------------------- /images/addUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/images/addUser.png -------------------------------------------------------------------------------- /img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /js/company.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#companyList').change(function() { 4 | 5 | var company = $(this).find(":selected").attr("name"); 6 | location.href = BASE_URL + 'user/dashboard/' + company; 7 | }); 8 | 9 | }); -------------------------------------------------------------------------------- /js/item.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#addItem').click(function() { 4 | 5 | var project = $(this).attr('data-project'); 6 | bootbox.prompt("Enter name for the new item", function(item) { 7 | 8 | if(item) { 9 | 10 | var data = "name=" + item + "&project=" + project; 11 | $.post(BASE_URL + 'item/doCreate', data, function(data) { 12 | 13 | if(data.success) { 14 | location.href = BASE_URL + 'project/view/' + project; 15 | } else { 16 | bootbox.alert("Item already exists!"); 17 | } 18 | }); 19 | } 20 | 21 | }); 22 | 23 | }); 24 | 25 | $('.itemDelete').live('click', function() { 26 | 27 | var itemDiv = $(this).parent(); 28 | var id = $(this).attr('data-id'); 29 | var project = $(this).attr('data-project'); 30 | 31 | bootbox.confirm("Do you need to delete this item?", function(confirmed) { 32 | 33 | if(confirmed) { 34 | 35 | var data = "id=" + id + "&project=" + project; 36 | $.post(BASE_URL + 'item/doDelete', data, function(data) { 37 | 38 | if(data.success) { 39 | itemDiv.remove(); 40 | } else { 41 | bootbox.alert(data.error); 42 | } 43 | }); 44 | } 45 | 46 | }); 47 | 48 | 49 | }); 50 | 51 | $('.itemArchive').live('click', function() { 52 | 53 | var itemDiv = $(this).parent(); 54 | var id = $(this).attr('data-id'); 55 | var project = $(this).attr('data-project'); 56 | bootbox.confirm("Do you need to archive this item?", function(confirmed) { 57 | 58 | if(confirmed) { 59 | 60 | var data = "id=" + id + "&project=" + project; 61 | $.post(BASE_URL + 'item/doArchive', data, function(data) { 62 | 63 | if(data.success) { 64 | itemDiv.remove(); 65 | } else { 66 | bootbox.alert(data.error); 67 | } 68 | }); 69 | } 70 | 71 | }); 72 | 73 | 74 | }); 75 | 76 | $('.itemUnarchive').live('click', function() { 77 | 78 | var itemDiv = $(this).parent(); 79 | var id = $(this).attr('data-id'); 80 | var project = $(this).attr('data-project'); 81 | bootbox.confirm("Do you need to unarchive this item?", function(confirmed) { 82 | 83 | if(confirmed) { 84 | 85 | var data = "id=" + id + "&project=" + project; 86 | $.post(BASE_URL + 'item/doUnarchive', data, function(data) { 87 | 88 | if(data.success) { 89 | location.href = BASE_URL + 'project/archivedItems/' + project; 90 | } else { 91 | bootbox.alert(data.error); 92 | } 93 | }); 94 | } 95 | 96 | }); 97 | 98 | 99 | }); 100 | 101 | /* 102 | ************ Reordering Support ***************** 103 | */ 104 | $('#startReorder').click(function() { 105 | 106 | $("#startReorder").hide(); 107 | $("#endReorder").show(); 108 | 109 | $('#alertReorder') 110 | .removeClass('alert-success') 111 | .html("Reorder items now, after completing click the above button.") 112 | .show(); 113 | $('#itemSortList').sortable(); 114 | }); 115 | 116 | $('#endReorder').click(function() { 117 | 118 | $("#startReorder").show(); 119 | $("#endReorder").hide(); 120 | 121 | $('#itemSortList').sortable('destroy'); 122 | 123 | var project = null; 124 | var sortList = []; 125 | $('#itemSortList .item').each(function(item) { 126 | 127 | project = $(this).attr('data-project'); 128 | sortList.push($(this).attr('data-id')); 129 | 130 | }); 131 | 132 | var data = "project=" + project + "&sortList=" + sortList.join(","); 133 | 134 | console.log(data); 135 | $.post(BASE_URL + 'item/doReorder', data, function(data) { 136 | 137 | if(data.success) { 138 | 139 | $('#alertReorder') 140 | .addClass('alert-success') 141 | .html("Successfully Reordered!") 142 | .show(); 143 | 144 | setTimeout(function() { 145 | 146 | $('#alertReorder').hide(); 147 | }, 4000); 148 | } else { 149 | bootbox.alert(data.error); 150 | } 151 | }); 152 | 153 | }); 154 | }); 155 | -------------------------------------------------------------------------------- /js/plans.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('.planSelect').click(function() { 4 | 5 | var planId = $(this).attr('data-plan'); 6 | 7 | $.post(BASE_URL + 'plan/doSelect', "planId=" + planId, function(data) { 8 | 9 | if(data.success) { 10 | 11 | location.href = BASE_URL + 'plan/select'; 12 | } else { 13 | bootbox.alert(data.error); 14 | } 15 | }); 16 | }); 17 | }); -------------------------------------------------------------------------------- /js/project.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#addProject').click(function() { 4 | 5 | bootbox.prompt("Enter name for the new project", function(project) { 6 | 7 | if(project) { 8 | 9 | $.post(BASE_URL + 'project/doCreate', "name=" + project, function(data) { 10 | 11 | if(data.success) { 12 | location.href = BASE_URL + 'user/dashboard'; 13 | } else { 14 | bootbox.alert("Project already exists!"); 15 | } 16 | }); 17 | } 18 | 19 | }); 20 | 21 | }); 22 | 23 | $('.projectDelete').live('click', function() { 24 | 25 | var projectDiv = $(this).parent(); 26 | var id = $(this).attr('data-id'); 27 | bootbox.confirm("Do you need to delete this project?", function(confirmed) { 28 | 29 | if(confirmed) { 30 | 31 | $.post(BASE_URL + 'project/doDelete', "id=" + id, function(data) { 32 | 33 | if(data.success) { 34 | projectDiv.remove(); 35 | } else { 36 | bootbox.alert(data.error); 37 | } 38 | }); 39 | } 40 | 41 | }); 42 | 43 | 44 | }); 45 | 46 | $('.projectArchive').live('click', function() { 47 | 48 | var projectDiv = $(this).parent(); 49 | var id = $(this).attr('data-id'); 50 | bootbox.confirm("Do you need to archive this project?", function(confirmed) { 51 | 52 | if(confirmed) { 53 | 54 | $.post(BASE_URL + 'project/doArchive', "id=" + id, function(data) { 55 | 56 | if(data.success) { 57 | projectDiv.remove(); 58 | } else { 59 | bootbox.alert(data.error); 60 | } 61 | }); 62 | } 63 | 64 | }); 65 | 66 | 67 | }); 68 | 69 | $('.projectUnarchive').live('click', function() { 70 | 71 | var projectDiv = $(this).parent(); 72 | var id = $(this).attr('data-id'); 73 | bootbox.confirm("Do you need to unarchive this project?", function(confirmed) { 74 | 75 | if(confirmed) { 76 | 77 | $.post(BASE_URL + 'project/doUnarchive', "id=" + id, function(data) { 78 | 79 | if(data.success) { 80 | location.href = BASE_URL + 'project/archive'; 81 | } else { 82 | bootbox.alert(data.error); 83 | } 84 | }); 85 | } 86 | 87 | }); 88 | 89 | 90 | }); 91 | }); 92 | -------------------------------------------------------------------------------- /js/projectView.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('.projectUser img').tooltip(); 4 | 5 | var projectId = null; 6 | $('#manageUsers, #addUser').click(function() { 7 | 8 | $('#usersModal').modal('show'); 9 | projectId = $(this).attr('data-id'); 10 | $('#addEmail').focus(); 11 | }); 12 | 13 | $('#assignUser').click(function() { 14 | 15 | var email = $('#addEmail').val(); 16 | var role = $('#role').find(":selected").attr('name'); 17 | 18 | if(!email) { 19 | 20 | bootbox.alert("Please enter a email to assign a user"); 21 | $('#addEmail').focus(); 22 | } else if(!role) { 23 | 24 | bootbox.alert("Please select a role!"); 25 | $('#role').select(); 26 | 27 | } else { 28 | 29 | var data = "email=" + email + "&role=" + role; 30 | $.post(BASE_URL + 'project/doAssignUser/' + projectId, data, function(data) { 31 | 32 | if(data.success) { 33 | $('#userSuccess').fadeIn(function() { 34 | setTimeout(function() { 35 | $('#userSuccess').fadeOut(); 36 | }, 3000); 37 | }) 38 | $('#addEmail').val('').focus(); 39 | 40 | } else { 41 | bootbox.alert(data.err || data.message); 42 | } 43 | }); 44 | 45 | } 46 | 47 | 48 | }); 49 | 50 | $('.projectUserRemove').live('click', function() { 51 | 52 | var projectId = $(this).attr('data-project'); 53 | var userId = $(this).attr('data-user'); 54 | 55 | var tr = $(this).parent().parent(); 56 | 57 | $.post(BASE_URL + 'project/doRemoveUser/' + projectId, "user=" + userId, function(data) { 58 | 59 | if(data.success) { 60 | tr.remove(); 61 | } else { 62 | bootbox.alert(data.err); 63 | } 64 | }); 65 | }); 66 | 67 | }); 68 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 - 2011, EllisLab, Inc. 2 | All rights reserved. 3 | 4 | This license is a legal agreement between you and EllisLab Inc. for the use 5 | of CodeIgniter Software (the "Software"). By obtaining the Software you 6 | agree to comply with the terms and conditions of this license. 7 | 8 | PERMITTED USE 9 | You are permitted to use, copy, modify, and distribute the Software and its 10 | documentation, with or without modification, for any purpose, provided that 11 | the following conditions are met: 12 | 13 | 1. A copy of this license agreement must be included with the distribution. 14 | 15 | 2. Redistributions of source code must retain the above copyright notice in 16 | all source code files. 17 | 18 | 3. Redistributions in binary form must reproduce the above copyright notice 19 | in the documentation and/or other materials provided with the distribution. 20 | 21 | 4. Any files that have been modified must carry notices stating the nature 22 | of the change and the names of those who changed them. 23 | 24 | 5. Products derived from the Software must include an acknowledgment that 25 | they are derived from CodeIgniter in their documentation and/or other 26 | materials provided with the distribution. 27 | 28 | 6. Products derived from the Software may not be called "CodeIgniter", 29 | nor may "CodeIgniter" appear in their name, without prior written 30 | permission from EllisLab, Inc. 31 | 32 | INDEMNITY 33 | You agree to indemnify and hold harmless the authors of the Software and 34 | any contributors for any direct, indirect, incidental, or consequential 35 | third-party claims, actions or suits, as well as any related expenses, 36 | liabilities, damages, settlements or fees arising from your use or misuse 37 | of the Software, or a violation of any terms of this license. 38 | 39 | DISCLAIMER OF WARRANTY 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR 41 | IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, 42 | NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 43 | 44 | LIMITATIONS OF LIABILITY 45 | YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. 46 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE 47 | FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION 48 | WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE 49 | APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING 50 | BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF 51 | DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. 52 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | SAAS Boilerplate 2 | ================ 3 | 4 | Requirements 5 | ------------ 6 | 7 | * PHP 5.x 8 | * MySql 9 | * Apache Server 10 | 11 | Installation 12 | ------------ 13 | 14 | * Add this project into your web root 15 | * Use `database.sql` to create the initial database 16 | * configure database settings at `application/config/database.php` 17 | * configure email settings at `application/config/email.php` -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /system/core/Benchmark.php: -------------------------------------------------------------------------------- 1 | marker[$name] = microtime(); 54 | } 55 | 56 | // -------------------------------------------------------------------- 57 | 58 | /** 59 | * Calculates the time difference between two marked points. 60 | * 61 | * If the first parameter is empty this function instead returns the 62 | * {elapsed_time} pseudo-variable. This permits the full system 63 | * execution time to be shown in a template. The output class will 64 | * swap the real value for this variable. 65 | * 66 | * @access public 67 | * @param string a particular marked point 68 | * @param string a particular marked point 69 | * @param integer the number of decimal places 70 | * @return mixed 71 | */ 72 | function elapsed_time($point1 = '', $point2 = '', $decimals = 4) 73 | { 74 | if ($point1 == '') 75 | { 76 | return '{elapsed_time}'; 77 | } 78 | 79 | if ( ! isset($this->marker[$point1])) 80 | { 81 | return ''; 82 | } 83 | 84 | if ( ! isset($this->marker[$point2])) 85 | { 86 | $this->marker[$point2] = microtime(); 87 | } 88 | 89 | list($sm, $ss) = explode(' ', $this->marker[$point1]); 90 | list($em, $es) = explode(' ', $this->marker[$point2]); 91 | 92 | return number_format(($em + $es) - ($sm + $ss), $decimals); 93 | } 94 | 95 | // -------------------------------------------------------------------- 96 | 97 | /** 98 | * Memory Usage 99 | * 100 | * This function returns the {memory_usage} pseudo-variable. 101 | * This permits it to be put it anywhere in a template 102 | * without the memory being calculated until the end. 103 | * The output class will swap the real value for this variable. 104 | * 105 | * @access public 106 | * @return string 107 | */ 108 | function memory_usage() 109 | { 110 | return '{memory_usage}'; 111 | } 112 | 113 | } 114 | 115 | // END CI_Benchmark class 116 | 117 | /* End of file Benchmark.php */ 118 | /* Location: ./system/core/Benchmark.php */ -------------------------------------------------------------------------------- /system/core/Controller.php: -------------------------------------------------------------------------------- 1 | $class) 45 | { 46 | $this->$var =& load_class($class); 47 | } 48 | 49 | $this->load =& load_class('Loader', 'core'); 50 | 51 | $this->load->initialize(); 52 | 53 | log_message('debug', "Controller Class Initialized"); 54 | } 55 | 56 | public static function &get_instance() 57 | { 58 | return self::$instance; 59 | } 60 | } 61 | // END Controller class 62 | 63 | /* End of file Controller.php */ 64 | /* Location: ./system/core/Controller.php */ -------------------------------------------------------------------------------- /system/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 52 | } 53 | } 54 | // END Model Class 55 | 56 | /* End of file Model.php */ 57 | /* Location: ./system/core/Model.php */ -------------------------------------------------------------------------------- /system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/cubrid_utility.php: -------------------------------------------------------------------------------- 1 | conn_id) 41 | { 42 | return "SELECT '" . $this->database . "'"; 43 | } 44 | else 45 | { 46 | return FALSE; 47 | } 48 | } 49 | 50 | // -------------------------------------------------------------------- 51 | 52 | /** 53 | * Optimize table query 54 | * 55 | * Generates a platform-specific query so that a table can be optimized 56 | * 57 | * @access private 58 | * @param string the table name 59 | * @return object 60 | * @link http://www.cubrid.org/manual/840/en/Optimize%20Database 61 | */ 62 | function _optimize_table($table) 63 | { 64 | // No SQL based support in CUBRID as of version 8.4.0. Database or 65 | // table optimization can be performed using CUBRID Manager 66 | // database administration tool. See the link above for more info. 67 | return FALSE; 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * Repair table query 74 | * 75 | * Generates a platform-specific query so that a table can be repaired 76 | * 77 | * @access private 78 | * @param string the table name 79 | * @return object 80 | * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency 81 | */ 82 | function _repair_table($table) 83 | { 84 | // Not supported in CUBRID as of version 8.4.0. Database or 85 | // table consistency can be checked using CUBRID Manager 86 | // database administration tool. See the link above for more info. 87 | return FALSE; 88 | } 89 | 90 | // -------------------------------------------------------------------- 91 | /** 92 | * CUBRID Export 93 | * 94 | * @access private 95 | * @param array Preferences 96 | * @return mixed 97 | */ 98 | function _backup($params = array()) 99 | { 100 | // No SQL based support in CUBRID as of version 8.4.0. Database or 101 | // table backup can be performed using CUBRID Manager 102 | // database administration tool. 103 | return $this->db->display_error('db_unsuported_feature'); 104 | } 105 | } 106 | 107 | /* End of file cubrid_utility.php */ 108 | /* Location: ./system/database/drivers/cubrid/cubrid_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/mssql_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/mysqli_utility.php: -------------------------------------------------------------------------------- 1 | db->_escape_identifiers($table); 52 | } 53 | 54 | // -------------------------------------------------------------------- 55 | 56 | /** 57 | * Repair table query 58 | * 59 | * Generates a platform-specific query so that a table can be repaired 60 | * 61 | * @access private 62 | * @param string the table name 63 | * @return object 64 | */ 65 | function _repair_table($table) 66 | { 67 | return "REPAIR TABLE ".$this->db->_escape_identifiers($table); 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * MySQLi Export 74 | * 75 | * @access private 76 | * @param array Preferences 77 | * @return mixed 78 | */ 79 | function _backup($params = array()) 80 | { 81 | // Currently unsupported 82 | return $this->db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file mysqli_utility.php */ 87 | /* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file oci8_utility.php */ 87 | /* Location: ./system/database/drivers/oci8/oci8_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/odbc_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported ODBC feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported ODBC feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * ODBC Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file odbc_utility.php */ 103 | /* Location: ./system/database/drivers/odbc/odbc_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/pdo_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported PDO feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported PDO feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * PDO Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file pdo_utility.php */ 103 | /* Location: ./system/database/drivers/pdo/pdo_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/postgre/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/postgre/postgre_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | 87 | /* End of file postgre_utility.php */ 88 | /* Location: ./system/database/drivers/postgre/postgre_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/sqlite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite/sqlite_utility.php: -------------------------------------------------------------------------------- 1 | db_debug) 41 | { 42 | return $this->db->display_error('db_unsuported_feature'); 43 | } 44 | return array(); 45 | } 46 | 47 | // -------------------------------------------------------------------- 48 | 49 | /** 50 | * Optimize table query 51 | * 52 | * Is optimization even supported in SQLite? 53 | * 54 | * @access private 55 | * @param string the table name 56 | * @return object 57 | */ 58 | function _optimize_table($table) 59 | { 60 | return FALSE; 61 | } 62 | 63 | // -------------------------------------------------------------------- 64 | 65 | /** 66 | * Repair table query 67 | * 68 | * Are table repairs even supported in SQLite? 69 | * 70 | * @access private 71 | * @param string the table name 72 | * @return object 73 | */ 74 | function _repair_table($table) 75 | { 76 | return FALSE; 77 | } 78 | 79 | // -------------------------------------------------------------------- 80 | 81 | /** 82 | * SQLite Export 83 | * 84 | * @access private 85 | * @param array Preferences 86 | * @return mixed 87 | */ 88 | function _backup($params = array()) 89 | { 90 | // Currently unsupported 91 | return $this->db->display_error('db_unsuported_feature'); 92 | } 93 | } 94 | 95 | /* End of file sqlite_utility.php */ 96 | /* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/sqlsrv_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /system/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/fonts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/system/fonts/texb.ttf -------------------------------------------------------------------------------- /system/helpers/array_helper.php: -------------------------------------------------------------------------------- 1 | input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); 52 | } 53 | } 54 | 55 | // -------------------------------------------------------------------- 56 | 57 | /** 58 | * Fetch an item from the COOKIE array 59 | * 60 | * @access public 61 | * @param string 62 | * @param bool 63 | * @return mixed 64 | */ 65 | if ( ! function_exists('get_cookie')) 66 | { 67 | function get_cookie($index = '', $xss_clean = FALSE) 68 | { 69 | $CI =& get_instance(); 70 | 71 | $prefix = ''; 72 | 73 | if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '') 74 | { 75 | $prefix = config_item('cookie_prefix'); 76 | } 77 | 78 | return $CI->input->cookie($prefix.$index, $xss_clean); 79 | } 80 | } 81 | 82 | // -------------------------------------------------------------------- 83 | 84 | /** 85 | * Delete a COOKIE 86 | * 87 | * @param mixed 88 | * @param string the cookie domain. Usually: .yourdomain.com 89 | * @param string the cookie path 90 | * @param string the cookie prefix 91 | * @return void 92 | */ 93 | if ( ! function_exists('delete_cookie')) 94 | { 95 | function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') 96 | { 97 | set_cookie($name, '', '', $domain, $path, $prefix); 98 | } 99 | } 100 | 101 | 102 | /* End of file cookie_helper.php */ 103 | /* Location: ./system/helpers/cookie_helper.php */ -------------------------------------------------------------------------------- /system/helpers/directory_helper.php: -------------------------------------------------------------------------------- 1 | 0) && @is_dir($source_dir.$file)) 61 | { 62 | $filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden); 63 | } 64 | else 65 | { 66 | $filedata[] = $file; 67 | } 68 | } 69 | 70 | closedir($fp); 71 | return $filedata; 72 | } 73 | 74 | return FALSE; 75 | } 76 | } 77 | 78 | 79 | /* End of file directory_helper.php */ 80 | /* Location: ./system/helpers/directory_helper.php */ -------------------------------------------------------------------------------- /system/helpers/download_helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 46 | 47 | if ($id != '') 48 | { 49 | $line = '"; 50 | } 51 | 52 | return $line; 53 | } 54 | } 55 | 56 | // ------------------------------------------------------------------------ 57 | /* End of file language_helper.php */ 58 | /* Location: ./system/helpers/language_helper.php */ -------------------------------------------------------------------------------- /system/helpers/number_helper.php: -------------------------------------------------------------------------------- 1 | lang->load('number'); 43 | 44 | if ($num >= 1000000000000) 45 | { 46 | $num = round($num / 1099511627776, $precision); 47 | $unit = $CI->lang->line('terabyte_abbr'); 48 | } 49 | elseif ($num >= 1000000000) 50 | { 51 | $num = round($num / 1073741824, $precision); 52 | $unit = $CI->lang->line('gigabyte_abbr'); 53 | } 54 | elseif ($num >= 1000000) 55 | { 56 | $num = round($num / 1048576, $precision); 57 | $unit = $CI->lang->line('megabyte_abbr'); 58 | } 59 | elseif ($num >= 1000) 60 | { 61 | $num = round($num / 1024, $precision); 62 | $unit = $CI->lang->line('kilobyte_abbr'); 63 | } 64 | else 65 | { 66 | $unit = $CI->lang->line('bytes'); 67 | return number_format($num).' '.$unit; 68 | } 69 | 70 | return number_format($num, $precision).' '.$unit; 71 | } 72 | } 73 | 74 | 75 | /* End of file number_helper.php */ 76 | /* Location: ./system/helpers/number_helper.php */ -------------------------------------------------------------------------------- /system/helpers/path_helper.php: -------------------------------------------------------------------------------- 1 | security->xss_clean($str, $is_image); 44 | } 45 | } 46 | 47 | // ------------------------------------------------------------------------ 48 | 49 | /** 50 | * Sanitize Filename 51 | * 52 | * @access public 53 | * @param string 54 | * @return string 55 | */ 56 | if ( ! function_exists('sanitize_filename')) 57 | { 58 | function sanitize_filename($filename) 59 | { 60 | $CI =& get_instance(); 61 | return $CI->security->sanitize_filename($filename); 62 | } 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * Hash encode a string 69 | * 70 | * @access public 71 | * @param string 72 | * @return string 73 | */ 74 | if ( ! function_exists('do_hash')) 75 | { 76 | function do_hash($str, $type = 'sha1') 77 | { 78 | if ($type == 'sha1') 79 | { 80 | return sha1($str); 81 | } 82 | else 83 | { 84 | return md5($str); 85 | } 86 | } 87 | } 88 | 89 | // ------------------------------------------------------------------------ 90 | 91 | /** 92 | * Strip Image Tags 93 | * 94 | * @access public 95 | * @param string 96 | * @return string 97 | */ 98 | if ( ! function_exists('strip_image_tags')) 99 | { 100 | function strip_image_tags($str) 101 | { 102 | $str = preg_replace("##", "\\1", $str); 103 | $str = preg_replace("##", "\\1", $str); 104 | 105 | return $str; 106 | } 107 | } 108 | 109 | // ------------------------------------------------------------------------ 110 | 111 | /** 112 | * Convert PHP tags to entities 113 | * 114 | * @access public 115 | * @param string 116 | * @return string 117 | */ 118 | if ( ! function_exists('encode_php_tags')) 119 | { 120 | function encode_php_tags($str) 121 | { 122 | return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); 123 | } 124 | } 125 | 126 | 127 | /* End of file security_helper.php */ 128 | /* Location: ./system/helpers/security_helper.php */ -------------------------------------------------------------------------------- /system/helpers/typography_helper.php: -------------------------------------------------------------------------------- 1 | load->library('typography'); 44 | 45 | return $CI->typography->nl2br_except_pre($str); 46 | } 47 | } 48 | 49 | // ------------------------------------------------------------------------ 50 | 51 | /** 52 | * Auto Typography Wrapper Function 53 | * 54 | * 55 | * @access public 56 | * @param string 57 | * @param bool whether to allow javascript event handlers 58 | * @param bool whether to reduce multiple instances of double newlines to two 59 | * @return string 60 | */ 61 | if ( ! function_exists('auto_typography')) 62 | { 63 | function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE) 64 | { 65 | $CI =& get_instance(); 66 | $CI->load->library('typography'); 67 | return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks); 68 | } 69 | } 70 | 71 | 72 | // -------------------------------------------------------------------- 73 | 74 | /** 75 | * HTML Entities Decode 76 | * 77 | * This function is a replacement for html_entity_decode() 78 | * 79 | * @access public 80 | * @param string 81 | * @return string 82 | */ 83 | if ( ! function_exists('entity_decode')) 84 | { 85 | function entity_decode($str, $charset='UTF-8') 86 | { 87 | global $SEC; 88 | return $SEC->entity_decode($str, $charset); 89 | } 90 | } 91 | 92 | /* End of file typography_helper.php */ 93 | /* Location: ./system/helpers/typography_helper.php */ -------------------------------------------------------------------------------- /system/helpers/xml_helper.php: -------------------------------------------------------------------------------- 1 | ","\"", "'", "-"), 53 | array("&", "<", ">", """, "'", "-"), 54 | $str); 55 | 56 | // Decode the temp markers back to entities 57 | $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); 58 | 59 | if ($protect_all === TRUE) 60 | { 61 | $str = preg_replace("/$temp(\w+);/","&\\1;", $str); 62 | } 63 | 64 | return $str; 65 | } 66 | } 67 | 68 | // ------------------------------------------------------------------------ 69 | 70 | /* End of file xml_helper.php */ 71 | /* Location: ./system/helpers/xml_helper.php */ -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/migration_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/Cache_dummy.php: -------------------------------------------------------------------------------- 1 | '1', 'INFO' => '2', 'DEBUG' => '3', 'ALL' => '4'); 34 | 35 | /** 36 | * Constructor 37 | */ 38 | public function __construct() 39 | { 40 | $config =& get_config(); 41 | 42 | $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/'; 43 | 44 | if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) 45 | { 46 | $this->_enabled = FALSE; 47 | } 48 | 49 | if (is_numeric($config['log_threshold'])) 50 | { 51 | $this->_threshold = $config['log_threshold']; 52 | } 53 | 54 | if ($config['log_date_format'] != '') 55 | { 56 | $this->_date_fmt = $config['log_date_format']; 57 | } 58 | } 59 | 60 | // -------------------------------------------------------------------- 61 | 62 | /** 63 | * Write Log File 64 | * 65 | * Generally this function will be called using the global log_message() function 66 | * 67 | * @param string the error level 68 | * @param string the error message 69 | * @param bool whether the error is a native PHP error 70 | * @return bool 71 | */ 72 | public function write_log($level = 'error', $msg, $php_error = FALSE) 73 | { 74 | if ($this->_enabled === FALSE) 75 | { 76 | return FALSE; 77 | } 78 | 79 | $level = strtoupper($level); 80 | 81 | if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) 82 | { 83 | return FALSE; 84 | } 85 | 86 | $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; 87 | $message = ''; 88 | 89 | if ( ! file_exists($filepath)) 90 | { 91 | $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; 92 | } 93 | 94 | if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) 95 | { 96 | return FALSE; 97 | } 98 | 99 | $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; 100 | 101 | flock($fp, LOCK_EX); 102 | fwrite($fp, $message); 103 | flock($fp, LOCK_UN); 104 | fclose($fp); 105 | 106 | @chmod($filepath, FILE_WRITE_MODE); 107 | return TRUE; 108 | } 109 | 110 | } 111 | // END Log Class 112 | 113 | /* End of file Log.php */ 114 | /* Location: ./system/libraries/Log.php */ -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /user_guide/doc_style/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Writing Documentation : CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

Writing Documentation

59 | 60 |

To help facilitate a consistent, easy-to-read documentation style for CodeIgniter projects, EllisLab is making the markup and CSS from the CodeIgniter user guide freely available to the community for their use. For your convenience, a template file has been created that includes the primary blocks of markup used with brief samples.

61 | 62 |

Files

63 | 64 | 68 | 69 | 70 |
71 | 72 | 73 | 74 | 75 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /user_guide/general/quick_reference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Quick Reference Chart : CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

Quick Reference Chart

59 | 60 |

For a PDF version of this chart, click here.

61 | 62 |

63 | 64 |
65 | 66 | 67 | 68 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /user_guide/general/requirements.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Server Requirements : CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

Server Requirements

59 | 60 |
    61 |
  • PHP version 5.1.6 or newer.
  • 62 |
  • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
  • 63 |
64 | 65 | 66 | 67 |
68 | 69 | 70 | 71 | 72 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /user_guide/images/appflowchart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/appflowchart.gif -------------------------------------------------------------------------------- /user_guide/images/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/arrow.gif -------------------------------------------------------------------------------- /user_guide/images/ci_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/ci_logo.jpg -------------------------------------------------------------------------------- /user_guide/images/ci_logo_flame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/ci_logo_flame.jpg -------------------------------------------------------------------------------- /user_guide/images/ci_quick_ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/ci_quick_ref.png -------------------------------------------------------------------------------- /user_guide/images/codeigniter_1.7.1_helper_reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/codeigniter_1.7.1_helper_reference.pdf -------------------------------------------------------------------------------- /user_guide/images/codeigniter_1.7.1_helper_reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/codeigniter_1.7.1_helper_reference.png -------------------------------------------------------------------------------- /user_guide/images/codeigniter_1.7.1_library_reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/codeigniter_1.7.1_library_reference.pdf -------------------------------------------------------------------------------- /user_guide/images/codeigniter_1.7.1_library_reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/codeigniter_1.7.1_library_reference.png -------------------------------------------------------------------------------- /user_guide/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/file.gif -------------------------------------------------------------------------------- /user_guide/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/folder.gif -------------------------------------------------------------------------------- /user_guide/images/nav_bg_darker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/nav_bg_darker.jpg -------------------------------------------------------------------------------- /user_guide/images/nav_separator_darker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/nav_separator_darker.jpg -------------------------------------------------------------------------------- /user_guide/images/nav_toggle_darker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/nav_toggle_darker.jpg -------------------------------------------------------------------------------- /user_guide/images/reactor-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/reactor-bullet.png -------------------------------------------------------------------------------- /user_guide/images/smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/smile.gif -------------------------------------------------------------------------------- /user_guide/images/transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkchaux/codeigniter-saas-boilerplate/14edc52fe494da2ba962208d33029189368c7821/user_guide/images/transparent.gif -------------------------------------------------------------------------------- /user_guide/installation/upgrade_120.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

Upgrading From Beta 1.0 to Final 1.2

59 | 60 |

To upgrade to Version 1.2 please replace the following directories with the new versions:

61 | 62 |

Note: If you have any custom developed files in these folders please make copies of them first.

63 | 64 |
    65 |
  • drivers
  • 66 |
  • helpers
  • 67 |
  • init
  • 68 |
  • language
  • 69 |
  • libraries
  • 70 |
  • plugins
  • 71 |
  • scaffolding
  • 72 |
73 | 74 |

Please also replace your local copy of the user guide with the new version.

75 | 76 |
77 | 78 | 79 | 80 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /user_guide/nav/hacks.txt: -------------------------------------------------------------------------------- 1 | I did the following hack in moo.fx.js: 2 | 3 | At line 79 in the toggle: function() function, I added: 4 | 5 | document.getElementById('nav').style.display = 'block'; 6 | 7 | -- Rick Ellis 8 | 9 | 10 | Also removed fx.Opacity and fx.Height from moo.fx.js -- Pascal -------------------------------------------------------------------------------- /user_guide/nav/moo.fx.js: -------------------------------------------------------------------------------- 1 | /* 2 | moo.fx, simple effects library built with prototype.js (http://prototype.conio.net). 3 | by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE. 4 | for more info (http://moofx.mad4milk.net). 5 | 10/24/2005 6 | v(1.0.2) 7 | */ 8 | 9 | //base 10 | var fx = new Object(); 11 | fx.Base = function(){}; 12 | fx.Base.prototype = { 13 | setOptions: function(options) { 14 | this.options = { 15 | duration: 500, 16 | onComplete: '' 17 | } 18 | Object.extend(this.options, options || {}); 19 | }, 20 | 21 | go: function() { 22 | this.duration = this.options.duration; 23 | this.startTime = (new Date).getTime(); 24 | this.timer = setInterval (this.step.bind(this), 13); 25 | }, 26 | 27 | step: function() { 28 | var time = (new Date).getTime(); 29 | var Tpos = (time - this.startTime) / (this.duration); 30 | if (time >= this.duration+this.startTime) { 31 | this.now = this.to; 32 | clearInterval (this.timer); 33 | this.timer = null; 34 | if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); 35 | } 36 | else { 37 | this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from; 38 | //this time-position, sinoidal transition thing is from script.aculo.us 39 | } 40 | this.increase(); 41 | }, 42 | 43 | custom: function(from, to) { 44 | if (this.timer != null) return; 45 | this.from = from; 46 | this.to = to; 47 | this.go(); 48 | }, 49 | 50 | hide: function() { 51 | this.now = 0; 52 | this.increase(); 53 | }, 54 | 55 | clearTimer: function() { 56 | clearInterval(this.timer); 57 | this.timer = null; 58 | } 59 | } 60 | 61 | //stretchers 62 | fx.Layout = Class.create(); 63 | fx.Layout.prototype = Object.extend(new fx.Base(), { 64 | initialize: function(el, options) { 65 | this.el = $(el); 66 | this.el.style.overflow = "hidden"; 67 | this.el.iniWidth = this.el.offsetWidth; 68 | this.el.iniHeight = this.el.offsetHeight; 69 | this.setOptions(options); 70 | } 71 | }); 72 | 73 | fx.Height = Class.create(); 74 | Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { 75 | increase: function() { 76 | this.el.style.height = this.now + "px"; 77 | }, 78 | 79 | toggle: function() { 80 | if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); 81 | else this.custom(0, this.el.scrollHeight); 82 | } 83 | }); 84 | -------------------------------------------------------------------------------- /user_guide/nav/prototype.lite.js: -------------------------------------------------------------------------------- 1 | /* Prototype JavaScript framework 2 | * (c) 2005 Sam Stephenson 3 | * 4 | * Prototype is freely distributable under the terms of an MIT-style license. 5 | * 6 | * For details, see the Prototype web site: http://prototype.conio.net/ 7 | * 8 | /*--------------------------------------------------------------------------*/ 9 | 10 | 11 | //note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). 12 | 13 | var Class = { 14 | create: function() { 15 | return function() { 16 | this.initialize.apply(this, arguments); 17 | } 18 | } 19 | } 20 | 21 | Object.extend = function(destination, source) { 22 | for (property in source) { 23 | destination[property] = source[property]; 24 | } 25 | return destination; 26 | } 27 | 28 | Function.prototype.bind = function(object) { 29 | var __method = this; 30 | return function() { 31 | return __method.apply(object, arguments); 32 | } 33 | } 34 | 35 | function $() { 36 | var elements = new Array(); 37 | 38 | for (var i = 0; i < arguments.length; i++) { 39 | var element = arguments[i]; 40 | if (typeof element == 'string') 41 | element = document.getElementById(element); 42 | 43 | if (arguments.length == 1) 44 | return element; 45 | 46 | elements.push(element); 47 | } 48 | 49 | return elements; 50 | } 51 | 52 | //------------------------- 53 | 54 | document.getElementsByClassName = function(className) { 55 | var children = document.getElementsByTagName('*') || document.all; 56 | var elements = new Array(); 57 | 58 | for (var i = 0; i < children.length; i++) { 59 | var child = children[i]; 60 | var classNames = child.className.split(' '); 61 | for (var j = 0; j < classNames.length; j++) { 62 | if (classNames[j] == className) { 63 | elements.push(child); 64 | break; 65 | } 66 | } 67 | } 68 | 69 | return elements; 70 | } 71 | 72 | //------------------------- 73 | 74 | if (!window.Element) { 75 | var Element = new Object(); 76 | } 77 | 78 | Object.extend(Element, { 79 | remove: function(element) { 80 | element = $(element); 81 | element.parentNode.removeChild(element); 82 | }, 83 | 84 | hasClassName: function(element, className) { 85 | element = $(element); 86 | if (!element) 87 | return; 88 | var a = element.className.split(' '); 89 | for (var i = 0; i < a.length; i++) { 90 | if (a[i] == className) 91 | return true; 92 | } 93 | return false; 94 | }, 95 | 96 | addClassName: function(element, className) { 97 | element = $(element); 98 | Element.removeClassName(element, className); 99 | element.className += ' ' + className; 100 | }, 101 | 102 | removeClassName: function(element, className) { 103 | element = $(element); 104 | if (!element) 105 | return; 106 | var newClassName = ''; 107 | var a = element.className.split(' '); 108 | for (var i = 0; i < a.length; i++) { 109 | if (a[i] != className) { 110 | if (i > 0) 111 | newClassName += ' '; 112 | newClassName += a[i]; 113 | } 114 | } 115 | element.className = newClassName; 116 | }, 117 | 118 | // removes whitespace-only text node children 119 | cleanWhitespace: function(element) { 120 | element = $(element); 121 | for (var i = 0; i < element.childNodes.length; i++) { 122 | var node = element.childNodes[i]; 123 | if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 124 | Element.remove(node); 125 | } 126 | } 127 | }); -------------------------------------------------------------------------------- /user_guide/nav/user_guide_menu.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | myHeight = new fx.Height('nav', {duration: 400}); 3 | myHeight.hide(); 4 | } -------------------------------------------------------------------------------- /user_guide/overview/cheatsheets.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CodeIgniter Cheatsheets : CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

CodeIgniter Cheatsheets

59 | 60 |

Library Reference

61 | 62 |
CodeIgniter Library Reference
63 | 64 |

Helpers Reference

65 |
CodeIgniter Library Reference
66 | 67 |
68 | 69 | 70 | 71 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /user_guide/overview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CodeIgniter Overview : CodeIgniter User Guide 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |

CodeIgniter User Guide Version 2.1.2

35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | 51 | 52 |
53 | 54 | 55 | 56 |
57 | 58 |

CodeIgniter Overview

59 | 60 |

The following pages describe the broad concepts behind CodeIgniter:

61 | 62 | 70 | 71 | 72 | 73 | 74 |
75 | 76 | 77 | 78 | 82 | 83 | 84 | --------------------------------------------------------------------------------