├── .gitignore
├── LICENSE
├── README.md
├── application
├── .htaccess
├── cache
│ ├── .htaccess
│ └── index.html
├── config
│ ├── aad_auth.template.php
│ ├── autoload.php
│ ├── config.php
│ ├── constants.php
│ ├── database.php
│ ├── doctypes.php
│ ├── foreign_chars.php
│ ├── hooks.php
│ ├── index.html
│ ├── memcached.php
│ ├── migration.php
│ ├── mimes.php
│ ├── profiler.php
│ ├── routes.php
│ ├── smileys.php
│ └── user_agents.php
├── controllers
│ ├── Sample.php
│ ├── Welcome.php
│ └── index.html
├── core
│ └── index.html
├── helpers
│ └── index.html
├── hooks
│ └── index.html
├── index.html
├── language
│ ├── english
│ │ └── index.html
│ └── index.html
├── libraries
│ ├── Aad_auth.php
│ ├── JWT
│ │ ├── BeforeValidException.php
│ │ ├── ExpiredException.php
│ │ ├── JWT.php
│ │ ├── LICENSE
│ │ └── SignatureInvalidException.php
│ ├── Jwt.php
│ └── index.html
├── logs
│ └── index.html
├── models
│ └── index.html
├── third_party
│ └── index.html
└── views
│ ├── errors
│ ├── cli
│ │ ├── error_404.php
│ │ ├── error_db.php
│ │ ├── error_exception.php
│ │ ├── error_general.php
│ │ ├── error_php.php
│ │ └── index.html
│ ├── html
│ │ ├── error_404.php
│ │ ├── error_db.php
│ │ ├── error_exception.php
│ │ ├── error_general.php
│ │ ├── error_php.php
│ │ └── index.html
│ └── index.html
│ ├── index.html
│ └── sample
│ ├── footer.php
│ ├── index.php
│ ├── partially_protected_page.php
│ ├── protected_page.php
│ └── unprotected_page.php
├── index.php
├── license.txt
└── system
├── .htaccess
├── core
├── Benchmark.php
├── CodeIgniter.php
├── Common.php
├── Config.php
├── Controller.php
├── Exceptions.php
├── Hooks.php
├── Input.php
├── Lang.php
├── Loader.php
├── Log.php
├── Model.php
├── Output.php
├── Router.php
├── Security.php
├── URI.php
├── Utf8.php
├── compat
│ ├── hash.php
│ ├── index.html
│ ├── mbstring.php
│ ├── password.php
│ └── standard.php
└── index.html
├── database
├── DB.php
├── DB_cache.php
├── DB_driver.php
├── DB_forge.php
├── DB_query_builder.php
├── DB_result.php
├── DB_utility.php
├── drivers
│ ├── cubrid
│ │ ├── cubrid_driver.php
│ │ ├── cubrid_forge.php
│ │ ├── cubrid_result.php
│ │ ├── cubrid_utility.php
│ │ └── index.html
│ ├── ibase
│ │ ├── ibase_driver.php
│ │ ├── ibase_forge.php
│ │ ├── ibase_result.php
│ │ ├── ibase_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
│ │ └── subdrivers
│ │ │ ├── index.html
│ │ │ ├── pdo_4d_driver.php
│ │ │ ├── pdo_4d_forge.php
│ │ │ ├── pdo_cubrid_driver.php
│ │ │ ├── pdo_cubrid_forge.php
│ │ │ ├── pdo_dblib_driver.php
│ │ │ ├── pdo_dblib_forge.php
│ │ │ ├── pdo_firebird_driver.php
│ │ │ ├── pdo_firebird_forge.php
│ │ │ ├── pdo_ibm_driver.php
│ │ │ ├── pdo_ibm_forge.php
│ │ │ ├── pdo_informix_driver.php
│ │ │ ├── pdo_informix_forge.php
│ │ │ ├── pdo_mysql_driver.php
│ │ │ ├── pdo_mysql_forge.php
│ │ │ ├── pdo_oci_driver.php
│ │ │ ├── pdo_oci_forge.php
│ │ │ ├── pdo_odbc_driver.php
│ │ │ ├── pdo_odbc_forge.php
│ │ │ ├── pdo_pgsql_driver.php
│ │ │ ├── pdo_pgsql_forge.php
│ │ │ ├── pdo_sqlite_driver.php
│ │ │ ├── pdo_sqlite_forge.php
│ │ │ ├── pdo_sqlsrv_driver.php
│ │ │ └── pdo_sqlsrv_forge.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
│ ├── sqlite3
│ │ ├── index.html
│ │ ├── sqlite3_driver.php
│ │ ├── sqlite3_forge.php
│ │ ├── sqlite3_result.php
│ │ └── sqlite3_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
│ ├── pagination_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
│ ├── Cache_redis.php
│ ├── Cache_wincache.php
│ └── index.html
└── index.html
├── Calendar.php
├── Cart.php
├── Driver.php
├── Email.php
├── Encrypt.php
├── Encryption.php
├── Form_validation.php
├── Ftp.php
├── Image_lib.php
├── Javascript.php
├── Javascript
├── Jquery.php
└── index.html
├── Migration.php
├── Pagination.php
├── Parser.php
├── Profiler.php
├── Session
├── Session.php
├── SessionHandlerInterface.php
├── Session_driver.php
├── drivers
│ ├── Session_database_driver.php
│ ├── Session_files_driver.php
│ ├── Session_memcached_driver.php
│ ├── Session_redis_driver.php
│ └── index.html
└── index.html
├── Table.php
├── Trackback.php
├── Typography.php
├── Unit_test.php
├── Upload.php
├── User_agent.php
├── Xmlrpc.php
├── Xmlrpcs.php
├── Zip.php
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | application/cache/*
4 | !application/cache/index.html
5 | !application/cache/.htaccess
6 |
7 | application/logs/*
8 | !application/logs/index.html
9 | !application/logs/.htaccess
10 |
11 | user_guide_src/build/*
12 | user_guide_src/cilexer/build/*
13 | user_guide_src/cilexer/dist/*
14 | user_guide_src/cilexer/pycilexer.egg-info/*
15 | /vendor/
16 |
17 | # IDE Files
18 | #-------------------------
19 | /nbproject/
20 | .idea/*
21 |
22 | ## Sublime Text cache files
23 | *.tmlanguage.cache
24 | *.tmPreferences.cache
25 | *.stTheme.cache
26 | *.sublime-workspace
27 | *.sublime-project
28 |
29 | # Visual Studio Code settings
30 | /.settings/
31 |
32 | # CodeIgniter session files
33 | session_data/
34 |
35 | # Azure AD SSO for CodeIgniter config file, just keep the template
36 | application/config/aad_auth.php
37 | application/config/aad_auth.*.php
38 | !application/config/aad_auth.template.php
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Philippe Signoret
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://waffle.io/psignoret/aad-sso-codeigniter)
2 | # aad-sso-codeigniter
3 | Authentication for a CodeIgniter site using Azure Active Directory
4 |
5 | **IMPORTANT**: This does not yet validate tokens and MUST NOT be used.
6 |
7 | Use Azure Active Directory to secure access to a site or application that is based on the CodeIgniter PHP framework.
8 |
9 | This includes:
10 | * The Azure Active Directory for CodeIgniter library.
11 | * A (very) basic sample showing how the Azure AD library can be used to secure access to entire pages (i.e. controller methods), or portions of a page.
12 |
13 | Notes:
14 |
15 | * This library uses CodeIgniter's [Sessions Library](http://www.codeigniter.com/user_guide/libraries/sessions.html). This means the library must be configured for use. (E.g. if using the [files driver](http://www.codeigniter.com/user_guide/libraries/sessions.html#files-driver), the directory must be set.)
16 |
17 |
18 | *IMPORTANT: This is a work in progress. You should not use this yet for any production sites or sensitive information.*
--------------------------------------------------------------------------------
/application/.htaccess:
--------------------------------------------------------------------------------
1 |
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/aad_auth.template.php: -------------------------------------------------------------------------------- 1 | '; 17 | 18 | /** 19 | * The client ID of the application (as registered in Azure AD). 20 | * 21 | * E.g. $config['client_id'] = '2916ea73-ecdf-4ed4-94ad-4a30a6e7a3c3'; 22 | */ 23 | $config['client_id'] = 'Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/memcached.php: -------------------------------------------------------------------------------- 1 | array( 15 | 'hostname' => '127.0.0.1', 16 | 'port' => '11211', 17 | 'weight' => '1', 18 | ), 19 | ); 20 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->current() this is the version that schema will 69 | | be upgraded / downgraded to. 70 | | 71 | */ 72 | $config['migration_version'] = 0; 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Migrations Path 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Path to your migrations folder. 80 | | Typically, it will be within your application path. 81 | | Also, writing permission is required within the migrations path. 82 | | 83 | */ 84 | $config['migration_path'] = APPPATH.'migrations/'; 85 | -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | my_controller/index 50 | | my-controller/my-method -> my_controller/my_method 51 | */ 52 | $route['default_controller'] = 'welcome'; 53 | $route['404_override'] = ''; 54 | $route['translate_uri_dashes'] = FALSE; 55 | -------------------------------------------------------------------------------- /application/config/smileys.php: -------------------------------------------------------------------------------- 1 | array('grin.gif', '19', '19', 'grin'), 21 | ':lol:' => array('lol.gif', '19', '19', 'LOL'), 22 | ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), 23 | ':)' => array('smile.gif', '19', '19', 'smile'), 24 | ';-)' => array('wink.gif', '19', '19', 'wink'), 25 | ';)' => array('wink.gif', '19', '19', 'wink'), 26 | ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), 27 | ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), 28 | ':-S' => array('confused.gif', '19', '19', 'confused'), 29 | ':wow:' => array('surprise.gif', '19', '19', 'surprised'), 30 | ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), 31 | ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), 32 | '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), 33 | ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), 34 | ':P' => array('raspberry.gif', '19', '19', 'raspberry'), 35 | ':blank:' => array('blank.gif', '19', '19', 'blank stare'), 36 | ':long:' => array('longface.gif', '19', '19', 'long face'), 37 | ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), 38 | ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), 39 | ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), 40 | '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), 41 | ':down:' => array('downer.gif', '19', '19', 'downer'), 42 | ':red:' => array('embarrassed.gif', '19', '19', 'red face'), 43 | ':sick:' => array('sick.gif', '19', '19', 'sick'), 44 | ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), 45 | ':-/' => array('hmm.gif', '19', '19', 'hmmm'), 46 | '>:(' => array('mad.gif', '19', '19', 'mad'), 47 | ':mad:' => array('mad.gif', '19', '19', 'mad'), 48 | '>:-(' => array('angry.gif', '19', '19', 'angry'), 49 | ':angry:' => array('angry.gif', '19', '19', 'angry'), 50 | ':zip:' => array('zip.gif', '19', '19', 'zipper'), 51 | ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), 52 | ':ahhh:' => array('shock.gif', '19', '19', 'shock'), 53 | ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), 54 | ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), 55 | ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), 56 | ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), 57 | ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), 58 | ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), 59 | ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), 60 | ':snake:' => array('snake.gif', '19', '19', 'snake'), 61 | ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), 62 | ':question:' => array('question.gif', '19', '19', 'question') 63 | 64 | ); 65 | -------------------------------------------------------------------------------- /application/controllers/Sample.php: -------------------------------------------------------------------------------- 1 | load->helper('url'); 11 | 12 | // Load Azure AD Single Sign-on library 13 | $this->load->library('aad_auth'); 14 | } 15 | 16 | public function index() 17 | { 18 | $this->load->view('sample/index'); 19 | } 20 | 21 | /** 22 | * This illustrates simple logging in. 23 | */ 24 | public function login() 25 | { 26 | $return_to = $this->input->get('return_to'); 27 | $this->aad_auth->login($return_to === NULL ? site_url() : $return_to); 28 | } 29 | 30 | /** 31 | * This illustrates an entirely unprotected page. 32 | */ 33 | public function unprotected_page() 34 | { 35 | $this->load->view('sample/unprotected_page'); 36 | } 37 | 38 | /** 39 | * This illustrates showing different views to protect an entire page. 40 | **/ 41 | public function protected_page() 42 | { 43 | if (!$this->aad_auth->is_logged_in()) 44 | { 45 | $this->aad_auth->login(); 46 | } 47 | else 48 | { 49 | $data = array( 50 | 'user_info' => $this->aad_auth->user_info(), 51 | 'id_token' => $this->aad_auth->id_token(), 52 | ); 53 | $this->load->view('sample/protected_page', $data); 54 | } 55 | } 56 | 57 | /** 58 | * This illustrates providing the sign-in state to the view, to allow 59 | * for some display logic in the view itself. 60 | */ 61 | public function partially_protected_page() 62 | { 63 | $data = array( 64 | 'is_logged_in' => $this->aad_auth->is_logged_in(), 65 | 'login_url' => site_url('sample/login?return_to=' . urlencode(current_url())), 66 | 'logout_url' => site_url('sample/logout?return_to=' . urlencode(current_url())), 67 | ); 68 | 69 | $this->load->view('sample/partially_protected_page', $data); 70 | } 71 | 72 | /** 73 | * A simple authentication response handler. 74 | * 75 | * TODO: Move all validation logic to the library, allow library user to set error and success handler. 76 | */ 77 | public function handle_response() 78 | { 79 | $this->load->library('session'); 80 | 81 | $state = $this->input->get('state'); 82 | $error = $this->input->get('error'); 83 | $code = $this->input->get('code'); 84 | 85 | // Regardless if authentication was successful or not, the state value MUST be the expected one. 86 | if ($this->session->aad_auth_nonce === NULL || $this->session->aad_auth_nonce !== $state) 87 | { 88 | die('State value returned (\'' . $state . '\') is not the value expected (\'' 89 | . $this->session->aad_auth_nonce . '\').'); 90 | } 91 | else 92 | { 93 | if ($error !== NULL || $code === NULL) 94 | { 95 | // Error during authentication 96 | echo '' . $error . ''; 97 | echo '
' . $this->input->get('error_description') . ''; 98 | } 99 | else 100 | { 101 | // Successful authentication, now use the authentication code to get an Access Token and ID Token 102 | echo '
'; var_dump($this->input->get()); echo ''; 103 | $this->aad_auth->request_tokens($this->input->get('code'), $this->session->aad_auth_nonce); 104 | } 105 | } 106 | } 107 | 108 | /** 109 | * This illustrates signing out (of both this site and Azure AD). 110 | */ 111 | public function logout() 112 | { 113 | $return_to = $this->input->get('return_to'); 114 | $this->aad_auth->logout($return_to === NULL ? site_url() : $return_to); 115 | } 116 | 117 | 118 | /** 119 | * This illustrates logging out of the site (but not of Azure AD), useful for testing. 120 | */ 121 | public function revoke_session() 122 | { 123 | $return_to = $this->input->get('return_to'); 124 | $this->aad_auth->revoke_session(); 125 | redirect($return_to === NULL ? site_url() : $return_to); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /application/controllers/Welcome.php: -------------------------------------------------------------------------------- 1 | load->helper('url'); 10 | } 11 | public function index() 12 | { 13 | redirect('sample/index'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/libraries/JWT/BeforeValidException.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/cli/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | An uncaught Exception was encountered 4 | 5 | Type: 6 | Message: 7 | Filename: getFile(), "\n"; ?> 8 | Line Number: getLine(); ?> 9 | 10 | 11 | 12 | Backtrace: 13 | getTrace() as $error): ?> 14 | 15 | File: 16 | Line: 17 | Function: 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /application/views/errors/cli/error_general.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | A PHP Error was encountered 4 | 5 | Severity: 6 | Message: 7 | Filename: 8 | Line Number: 9 | 10 | 11 | 12 | Backtrace: 13 | 14 | 15 | File: 16 | Line: 17 | Function: 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /application/views/errors/cli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/html/error_404.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 |Type:
10 |Message:
11 |Filename: getFile(); ?>
12 |Line Number: getLine(); ?>
13 | 14 | 15 | 16 |Backtrace:
17 | getTrace() as $error): ?> 18 | 19 | 20 | 21 |
22 | File:
23 | Line:
24 | Function:
25 |
Severity:
10 |Message:
11 |Filename:
12 |Line Number:
13 | 14 | 15 | 16 |Backtrace:
17 | 18 | 19 | 20 | 21 |
22 | File:
23 | Line:
24 | Function:
25 |
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/sample/footer.php: -------------------------------------------------------------------------------- 1 |2 | Try going to a = anchor('sample/protected_page', 'protected page') ?>, 3 | an = anchor('sample/unprotected_page', 'unprotected page') ?>, or to a 4 | = anchor('sample/partially_protected_page', 'partially protected page') ?>. 5 |
6 |7 | You can = anchor('sample/login', 'sign in') ?> or = anchor('sample/logout', 'sign out') ?>, or you 8 | find it useful to = anchor('sample/revoke_session', 'log out of this site') ?> (but not of Azure AD). 9 |
-------------------------------------------------------------------------------- /application/views/sample/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 |This is a demo of the Azure AD Single Sign-on library for CodeIgniter.
10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/sample/partially_protected_page.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 |10 | This is an partially protected page. Everyone can get to the page and see this paragraph, but some of the 11 | content is only available if the user is signed in. 12 |
13 | 14 |15 | This is restricted content and only signed in users can see it. You can = anchor($logout_url, 'sign out') ?> 16 | and come straight back here. 17 |
18 | 19 |20 | You are not signed in, so you can't see the restricted content. You can = anchor($login_url, 'sign in') ?> 21 | and come straight back. 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /application/views/sample/protected_page.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 6 | 7 | 8 |This is a protected page. Only people who have signed in can see it.
10 |
11 | You are signed in as = $user_info['displayable_id'] ?>, and this is your id_token
:
12 |
= print_r($id_token, TRUE) ?>13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /application/views/sample/unprotected_page.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 |
This is an unprotected page. Everyone can see it!
10 | 11 | 12 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 - 2015, British Columbia Institute of Technology 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/cubrid_utility.php: -------------------------------------------------------------------------------- 1 | db->data_cache['db_names'])) 57 | { 58 | return $this->db->data_cache['db_names']; 59 | } 60 | 61 | return $this->db->data_cache['db_names'] = cubrid_list_dbs($this->db->conn_id); 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * CUBRID Export 68 | * 69 | * @param array Preferences 70 | * @return mixed 71 | */ 72 | protected function _backup($params = array()) 73 | { 74 | // No SQL based support in CUBRID as of version 8.4.0. Database or 75 | // table backup can be performed using CUBRID Manager 76 | // database administration tool. 77 | return $this->db->display_error('db_unsupported_feature'); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/ibase/ibase_utility.php: -------------------------------------------------------------------------------- 1 | db->hostname, $this->db->username, $this->db->password)) 58 | { 59 | $res = ibase_backup($service, $this->db->database, $filename.'.fbk'); 60 | 61 | // Close the service connection 62 | ibase_service_detach($service); 63 | return $res; 64 | } 65 | 66 | return FALSE; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /system/database/drivers/ibase/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/mssql_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /system/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/oci8_forge.php: -------------------------------------------------------------------------------- 1 | db->escape_identifiers($table); 99 | $sqls = array(); 100 | for ($i = 0, $c = count($field); $i < $c; $i++) 101 | { 102 | if ($field[$i]['_literal'] !== FALSE) 103 | { 104 | $field[$i] = "\n\t".$field[$i]['_literal']; 105 | } 106 | else 107 | { 108 | $field[$i]['_literal'] = "\n\t".$this->_process_column($field[$i]); 109 | 110 | if ( ! empty($field[$i]['comment'])) 111 | { 112 | $sqls[] = 'COMMENT ON COLUMN ' 113 | .$this->db->escape_identifiers($table).'.'.$this->db->escape_identifiers($field[$i]['name']) 114 | .' IS '.$field[$i]['comment']; 115 | } 116 | 117 | if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name'])) 118 | { 119 | $sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name']) 120 | .' '.$this->db->escape_identifiers($field[$i]['new_name']); 121 | } 122 | } 123 | } 124 | 125 | $sql .= ' '.$alter_type.' '; 126 | $sql .= (count($field) === 1) 127 | ? $field[0] 128 | : '('.implode(',', $field).')'; 129 | 130 | // RENAME COLUMN must be executed after MODIFY 131 | array_unshift($sqls, $sql); 132 | return $sql; 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Field attribute AUTO_INCREMENT 139 | * 140 | * @param array &$attributes 141 | * @param array &$field 142 | * @return void 143 | */ 144 | protected function _attr_auto_increment(&$attributes, &$field) 145 | { 146 | // Not supported - sequences and triggers must be used instead 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/odbc_forge.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/pdo_forge.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_dblib_forge.php: -------------------------------------------------------------------------------- 1 | 'SMALLINT', 70 | 'SMALLINT' => 'INT', 71 | 'INT' => 'BIGINT', 72 | 'REAL' => 'FLOAT' 73 | ); 74 | 75 | // -------------------------------------------------------------------- 76 | 77 | /** 78 | * ALTER TABLE 79 | * 80 | * @param string $alter_type ALTER type 81 | * @param string $table Table name 82 | * @param mixed $field Column definition 83 | * @return string|string[] 84 | */ 85 | protected function _alter_table($alter_type, $table, $field) 86 | { 87 | if (in_array($alter_type, array('ADD', 'DROP'), TRUE)) 88 | { 89 | return parent::_alter_table($alter_type, $table, $field); 90 | } 91 | 92 | $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table).' ALTER COLUMN '; 93 | $sqls = array(); 94 | for ($i = 0, $c = count($field); $i < $c; $i++) 95 | { 96 | $sqls[] = $sql.$this->_process_column($field[$i]); 97 | } 98 | 99 | return $sqls; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Field attribute TYPE 106 | * 107 | * Performs a data type mapping between different databases. 108 | * 109 | * @param array &$attributes 110 | * @return void 111 | */ 112 | protected function _attr_type(&$attributes) 113 | { 114 | switch (strtoupper($attributes['TYPE'])) 115 | { 116 | case 'MEDIUMINT': 117 | $attributes['TYPE'] = 'INTEGER'; 118 | $attributes['UNSIGNED'] = FALSE; 119 | return; 120 | case 'INTEGER': 121 | $attributes['TYPE'] = 'INT'; 122 | return; 123 | default: return; 124 | } 125 | } 126 | 127 | // -------------------------------------------------------------------- 128 | 129 | /** 130 | * Field attribute AUTO_INCREMENT 131 | * 132 | * @param array &$attributes 133 | * @param array &$field 134 | * @return void 135 | */ 136 | protected function _attr_auto_increment(&$attributes, &$field) 137 | { 138 | if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'int') !== FALSE) 139 | { 140 | $field['auto_increment'] = ' IDENTITY(1,1)'; 141 | } 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_ibm_forge.php: -------------------------------------------------------------------------------- 1 | 'INTEGER', 63 | 'INT' => 'BIGINT', 64 | 'INTEGER' => 'BIGINT' 65 | ); 66 | 67 | /** 68 | * DEFAULT value representation in CREATE/ALTER TABLE statements 69 | * 70 | * @var string 71 | */ 72 | protected $_default = FALSE; 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * ALTER TABLE 78 | * 79 | * @param string $alter_type ALTER type 80 | * @param string $table Table name 81 | * @param mixed $field Column definition 82 | * @return string|string[] 83 | */ 84 | protected function _alter_table($alter_type, $table, $field) 85 | { 86 | if ($alter_type === 'CHANGE') 87 | { 88 | $alter_type = 'MODIFY'; 89 | } 90 | 91 | return parent::_alter_table($alter_type, $table, $field); 92 | } 93 | 94 | // -------------------------------------------------------------------- 95 | 96 | /** 97 | * Field attribute TYPE 98 | * 99 | * Performs a data type mapping between different databases. 100 | * 101 | * @param array &$attributes 102 | * @return void 103 | */ 104 | protected function _attr_type(&$attributes) 105 | { 106 | switch (strtoupper($attributes['TYPE'])) 107 | { 108 | case 'TINYINT': 109 | $attributes['TYPE'] = 'SMALLINT'; 110 | $attributes['UNSIGNED'] = FALSE; 111 | return; 112 | case 'MEDIUMINT': 113 | $attributes['TYPE'] = 'INTEGER'; 114 | $attributes['UNSIGNED'] = FALSE; 115 | return; 116 | default: return; 117 | } 118 | } 119 | 120 | // -------------------------------------------------------------------- 121 | 122 | /** 123 | * Field attribute UNIQUE 124 | * 125 | * @param array &$attributes 126 | * @param array &$field 127 | * @return void 128 | */ 129 | protected function _attr_unique(&$attributes, &$field) 130 | { 131 | if ( ! empty($attributes['UNIQUE']) && $attributes['UNIQUE'] === TRUE) 132 | { 133 | $field['unique'] = ' UNIQUE'; 134 | 135 | // UNIQUE must be used with NOT NULL 136 | $field['null'] = ' NOT NULL'; 137 | } 138 | } 139 | 140 | // -------------------------------------------------------------------- 141 | 142 | /** 143 | * Field attribute AUTO_INCREMENT 144 | * 145 | * @param array &$attributes 146 | * @param array &$field 147 | * @return void 148 | */ 149 | protected function _attr_auto_increment(&$attributes, &$field) 150 | { 151 | // Not supported 152 | } 153 | 154 | } 155 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_oci_forge.php: -------------------------------------------------------------------------------- 1 | db->escape_identifiers($table); 99 | $sqls = array(); 100 | for ($i = 0, $c = count($field); $i < $c; $i++) 101 | { 102 | if ($field[$i]['_literal'] !== FALSE) 103 | { 104 | $field[$i] = "\n\t".$field[$i]['_literal']; 105 | } 106 | else 107 | { 108 | $field[$i]['_literal'] = "\n\t".$this->_process_column($field[$i]); 109 | 110 | if ( ! empty($field[$i]['comment'])) 111 | { 112 | $sqls[] = 'COMMENT ON COLUMN ' 113 | .$this->db->escape_identifiers($table).'.'.$this->db->escape_identifiers($field[$i]['name']) 114 | .' IS '.$field[$i]['comment']; 115 | } 116 | 117 | if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name'])) 118 | { 119 | $sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name']) 120 | .' '.$this->db->escape_identifiers($field[$i]['new_name']); 121 | } 122 | } 123 | } 124 | 125 | $sql .= ' '.$alter_type.' '; 126 | $sql .= (count($field) === 1) 127 | ? $field[0] 128 | : '('.implode(',', $field).')'; 129 | 130 | // RENAME COLUMN must be executed after MODIFY 131 | array_unshift($sqls, $sql); 132 | return $sql; 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Field attribute AUTO_INCREMENT 139 | * 140 | * @param array &$attributes 141 | * @param array &$field 142 | * @return void 143 | */ 144 | protected function _attr_auto_increment(&$attributes, &$field) 145 | { 146 | // Not supported - sequences and triggers must be used instead 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/subdrivers/pdo_odbc_forge.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/postgre/postgre_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite/sqlite_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite3/sqlite3_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/sqlsrv_forge.php: -------------------------------------------------------------------------------- 1 | 'SMALLINT', 70 | 'SMALLINT' => 'INT', 71 | 'INT' => 'BIGINT', 72 | 'REAL' => 'FLOAT' 73 | ); 74 | 75 | // -------------------------------------------------------------------- 76 | 77 | /** 78 | * ALTER TABLE 79 | * 80 | * @param string $alter_type ALTER type 81 | * @param string $table Table name 82 | * @param mixed $field Column definition 83 | * @return string|string[] 84 | */ 85 | protected function _alter_table($alter_type, $table, $field) 86 | { 87 | if (in_array($alter_type, array('ADD', 'DROP'), TRUE)) 88 | { 89 | return parent::_alter_table($alter_type, $table, $field); 90 | } 91 | 92 | $sql = 'ALTER TABLE '.$this->db->escape_identifiers($table).' ALTER COLUMN '; 93 | $sqls = array(); 94 | for ($i = 0, $c = count($field); $i < $c; $i++) 95 | { 96 | $sqls[] = $sql.$this->_process_column($field[$i]); 97 | } 98 | 99 | return $sqls; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Field attribute TYPE 106 | * 107 | * Performs a data type mapping between different databases. 108 | * 109 | * @param array &$attributes 110 | * @return void 111 | */ 112 | protected function _attr_type(&$attributes) 113 | { 114 | switch (strtoupper($attributes['TYPE'])) 115 | { 116 | case 'MEDIUMINT': 117 | $attributes['TYPE'] = 'INTEGER'; 118 | $attributes['UNSIGNED'] = FALSE; 119 | return; 120 | case 'INTEGER': 121 | $attributes['TYPE'] = 'INT'; 122 | return; 123 | default: return; 124 | } 125 | } 126 | 127 | // -------------------------------------------------------------------- 128 | 129 | /** 130 | * Field attribute AUTO_INCREMENT 131 | * 132 | * @param array &$attributes 133 | * @param array &$field 134 | * @return void 135 | */ 136 | protected function _attr_auto_increment(&$attributes, &$field) 137 | { 138 | if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'int') !== FALSE) 139 | { 140 | $field['auto_increment'] = ' IDENTITY(1,1)'; 141 | } 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/sqlsrv_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsupported_feature'); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /system/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/fonts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psignoret/aad-sso-codeigniter/47f7ce88299dea80b7b52061b94f5fdac08ea6b6/system/fonts/texb.ttf -------------------------------------------------------------------------------- /system/helpers/array_helper.php: -------------------------------------------------------------------------------- 1 | input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly); 74 | } 75 | } 76 | 77 | // -------------------------------------------------------------------- 78 | 79 | if ( ! function_exists('get_cookie')) 80 | { 81 | /** 82 | * Fetch an item from the COOKIE array 83 | * 84 | * @param string 85 | * @param bool 86 | * @return mixed 87 | */ 88 | function get_cookie($index, $xss_clean = NULL) 89 | { 90 | is_bool($xss_clean) OR $xss_clean = (config_item('global_xss_filtering') === TRUE); 91 | $prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix'); 92 | return get_instance()->input->cookie($prefix.$index, $xss_clean); 93 | } 94 | } 95 | 96 | // -------------------------------------------------------------------- 97 | 98 | if ( ! function_exists('delete_cookie')) 99 | { 100 | /** 101 | * Delete a COOKIE 102 | * 103 | * @param mixed 104 | * @param string the cookie domain. Usually: .yourdomain.com 105 | * @param string the cookie path 106 | * @param string the cookie prefix 107 | * @return void 108 | */ 109 | function delete_cookie($name, $domain = '', $path = '/', $prefix = '') 110 | { 111 | set_cookie($name, '', '', $domain, $path, $prefix); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /system/helpers/directory_helper.php: -------------------------------------------------------------------------------- 1 | 0) && is_dir($source_dir.$file)) 86 | { 87 | $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); 88 | } 89 | else 90 | { 91 | $filedata[] = $file; 92 | } 93 | } 94 | 95 | closedir($fp); 96 | return $filedata; 97 | } 98 | 99 | return FALSE; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /system/helpers/email_helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 67 | 68 | if ($for !== '') 69 | { 70 | $line = ''; 71 | } 72 | 73 | return $line; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /system/helpers/number_helper.php: -------------------------------------------------------------------------------- 1 | lang->load('number'); 65 | 66 | if ($num >= 1000000000000) 67 | { 68 | $num = round($num / 1099511627776, $precision); 69 | $unit = $CI->lang->line('terabyte_abbr'); 70 | } 71 | elseif ($num >= 1000000000) 72 | { 73 | $num = round($num / 1073741824, $precision); 74 | $unit = $CI->lang->line('gigabyte_abbr'); 75 | } 76 | elseif ($num >= 1000000) 77 | { 78 | $num = round($num / 1048576, $precision); 79 | $unit = $CI->lang->line('megabyte_abbr'); 80 | } 81 | elseif ($num >= 1000) 82 | { 83 | $num = round($num / 1024, $precision); 84 | $unit = $CI->lang->line('kilobyte_abbr'); 85 | } 86 | else 87 | { 88 | $unit = $CI->lang->line('bytes'); 89 | return number_format($num).' '.$unit; 90 | } 91 | 92 | return number_format($num, $precision).' '.$unit; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /system/helpers/path_helper.php: -------------------------------------------------------------------------------- 1 | security->xss_clean($str, $is_image); 64 | } 65 | } 66 | 67 | // ------------------------------------------------------------------------ 68 | 69 | if ( ! function_exists('sanitize_filename')) 70 | { 71 | /** 72 | * Sanitize Filename 73 | * 74 | * @param string 75 | * @return string 76 | */ 77 | function sanitize_filename($filename) 78 | { 79 | return get_instance()->security->sanitize_filename($filename); 80 | } 81 | } 82 | 83 | // -------------------------------------------------------------------- 84 | 85 | if ( ! function_exists('do_hash')) 86 | { 87 | /** 88 | * Hash encode a string 89 | * 90 | * @todo Remove in version 3.1+. 91 | * @deprecated 3.0.0 Use PHP's native hash() instead. 92 | * @param string $str 93 | * @param string $type = 'sha1' 94 | * @return string 95 | */ 96 | function do_hash($str, $type = 'sha1') 97 | { 98 | if ( ! in_array(strtolower($type), hash_algos())) 99 | { 100 | $type = 'md5'; 101 | } 102 | 103 | return hash($type, $str); 104 | } 105 | } 106 | 107 | // ------------------------------------------------------------------------ 108 | 109 | if ( ! function_exists('strip_image_tags')) 110 | { 111 | /** 112 | * Strip Image Tags 113 | * 114 | * @param string 115 | * @return string 116 | */ 117 | function strip_image_tags($str) 118 | { 119 | return get_instance()->security->strip_image_tags($str); 120 | } 121 | } 122 | 123 | // ------------------------------------------------------------------------ 124 | 125 | if ( ! function_exists('encode_php_tags')) 126 | { 127 | /** 128 | * Convert PHP tags to entities 129 | * 130 | * @param string 131 | * @return string 132 | */ 133 | function encode_php_tags($str) 134 | { 135 | return str_replace(array('', '?>'), array('<?', '?>'), $str); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /system/helpers/typography_helper.php: -------------------------------------------------------------------------------- 1 | load->library('typography'); 64 | return $CI->typography->nl2br_except_pre($str); 65 | } 66 | } 67 | 68 | // ------------------------------------------------------------------------ 69 | 70 | if ( ! function_exists('auto_typography')) 71 | { 72 | /** 73 | * Auto Typography Wrapper Function 74 | * 75 | * @param string $str 76 | * @param bool $reduce_linebreaks = FALSE whether to reduce multiple instances of double newlines to two 77 | * @return string 78 | */ 79 | function auto_typography($str, $reduce_linebreaks = FALSE) 80 | { 81 | $CI =& get_instance(); 82 | $CI->load->library('typography'); 83 | return $CI->typography->auto_typography($str, $reduce_linebreaks); 84 | } 85 | } 86 | 87 | // -------------------------------------------------------------------- 88 | 89 | if ( ! function_exists('entity_decode')) 90 | { 91 | /** 92 | * HTML Entities Decode 93 | * 94 | * This function is a replacement for html_entity_decode() 95 | * 96 | * @param string 97 | * @param string 98 | * @return string 99 | */ 100 | function entity_decode($str, $charset = NULL) 101 | { 102 | return get_instance()->security->entity_decode($str, $charset); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /system/helpers/xml_helper.php: -------------------------------------------------------------------------------- 1 | ', '"', "'", '-'), 76 | array('&', '<', '>', '"', ''', '-'), 77 | $str 78 | ); 79 | 80 | // Decode the temp markers back to entities 81 | $str = preg_replace('/'.$temp.'(\d+);/', '\\1;', $str); 82 | 83 | if ($protect_all === TRUE) 84 | { 85 | return preg_replace('/'.$temp.'(\w+);/', '&\\1;', $str); 86 | } 87 | 88 | return $str; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/language/english/migration_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Javascript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Session/SessionHandlerInterface.php: -------------------------------------------------------------------------------- 1 | _config =& $params; 88 | } 89 | 90 | // ------------------------------------------------------------------------ 91 | 92 | /** 93 | * Cookie destroy 94 | * 95 | * Internal method to force removal of a cookie by the client 96 | * when session_destroy() is called. 97 | * 98 | * @return bool 99 | */ 100 | protected function _cookie_destroy() 101 | { 102 | return setcookie( 103 | $this->_config['cookie_name'], 104 | NULL, 105 | 1, 106 | $this->_config['cookie_path'], 107 | $this->_config['cookie_domain'], 108 | $this->_config['cookie_secure'], 109 | TRUE 110 | ); 111 | } 112 | 113 | // ------------------------------------------------------------------------ 114 | 115 | /** 116 | * Get lock 117 | * 118 | * A dummy method allowing drivers with no locking functionality 119 | * (databases other than PostgreSQL and MySQL) to act as if they 120 | * do acquire a lock. 121 | * 122 | * @param string $session_id 123 | * @return bool 124 | */ 125 | protected function _get_lock($session_id) 126 | { 127 | $this->_lock = TRUE; 128 | return TRUE; 129 | } 130 | 131 | // ------------------------------------------------------------------------ 132 | 133 | /** 134 | * Release lock 135 | * 136 | * @return bool 137 | */ 138 | protected function _release_lock() 139 | { 140 | if ($this->_lock) 141 | { 142 | $this->_lock = FALSE; 143 | } 144 | 145 | return TRUE; 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /system/libraries/Session/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/Session/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | --------------------------------------------------------------------------------