diff --git a/application/config/development/autoload.php b/application/config/development/autoload.php index 367fa04..a94516f 100644 --- a/application/config/development/autoload.php +++ b/application/config/development/autoload.php @@ -58,7 +58,7 @@ | | $autoload['libraries'] = array('user_agent' => 'ua'); */ -$autoload['libraries'] = array('email'); +$autoload['libraries'] = array('session','database','email'); /* | ------------------------------------------------------------------- @@ -89,8 +89,7 @@ | | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('url', 'mail'); - +$autoload['helper'] = array('url','custom','mail', 'data'); /* | ------------------------------------------------------------------- | Auto-load Config files @@ -132,4 +131,4 @@ | | $autoload['model'] = array('first_model' => 'first'); */ -$autoload['model'] = array(); +$autoload['model'] = array('auth/auth_model'); \ No newline at end of file diff --git a/application/config/development/config.php b/application/config/development/config.php index 7966477..a6c321a 100644 --- a/application/config/development/config.php +++ b/application/config/development/config.php @@ -23,7 +23,10 @@ | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = 'https://localhost/CodeIgniter-HMVC'; +// $config['base_url'] = 'https://localhost/CodeIgniter-HMVC'; +$base = "http://".$_SERVER['HTTP_HOST']; +$base .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); +$config['base_url'] = $base; /* |-------------------------------------------------------------------------- @@ -223,7 +226,7 @@ | your log files will fill up very fast. | */ -$config['log_threshold'] = 0; +$config['log_threshold'] = 4; /* |-------------------------------------------------------------------------- @@ -449,7 +452,7 @@ | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; -$config['csrf_token_name'] = 'csrf_test_name'; +$config['csrf_token_name'] = 'ci_csrf_token'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; diff --git a/application/config/development/database.php b/application/config/development/database.php index 0088ef1..e8e83ce 100644 --- a/application/config/development/database.php +++ b/application/config/development/database.php @@ -75,10 +75,14 @@ $db['default'] = array( 'dsn' => '', - 'hostname' => 'localhost', - 'username' => '', - 'password' => '', - 'database' => '', + // 'hostname' => 'localhost', + // 'username' => 'root', + // 'password' => '', + // 'database' => 'venbaehn_ams', + 'hostname' => '119.18.54.85', + 'username' => 'venbaehn_ams', + 'password' => 'L;nD7Z@f)1ZT', + 'database' => 'venbaehn_ams', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/config/development/hooks.php b/application/config/development/hooks.php index a8f38a5..2ae23bc 100644 --- a/application/config/development/hooks.php +++ b/application/config/development/hooks.php @@ -11,3 +11,10 @@ | https://codeigniter.com/user_guide/general/hooks.html | */ +$hook['pre_controller'] = array( + 'class' => 'MyHooks', + 'function' => 'initialize', + 'filename' => 'MyHooks.php', + 'filepath' => 'hooks', +); + diff --git a/application/config/development/routes.php b/application/config/development/routes.php index af85792..05cbdf5 100644 --- a/application/config/development/routes.php +++ b/application/config/development/routes.php @@ -49,7 +49,11 @@ | Examples: my-controller/index -> my_controller/index | my-controller/my-method -> my_controller/my_method */ -// $route['default_controller'] = 'welcome'; +// $route['default_controller'] = 'Backend'; $route['default_controller'] = 'Auth'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; + +//modules routes +$route['logout'] = 'Auth/logout'; +$route['login'] = 'Auth'; \ No newline at end of file diff --git a/application/config/production/hooks.php b/application/config/production/hooks.php index a8f38a5..2ae23bc 100644 --- a/application/config/production/hooks.php +++ b/application/config/production/hooks.php @@ -11,3 +11,10 @@ | https://codeigniter.com/user_guide/general/hooks.html | */ +$hook['pre_controller'] = array( + 'class' => 'MyHooks', + 'function' => 'initialize', + 'filename' => 'MyHooks.php', + 'filepath' => 'hooks', +); + diff --git a/application/config/testing/config.php b/application/config/testing/config.php index 5fbeb6b..4ee4c90 100644 --- a/application/config/testing/config.php +++ b/application/config/testing/config.php @@ -449,8 +449,8 @@ | 'csrf_regenerate' = Regenerate token on every submission | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ -$config['csrf_protection'] = FALSE; -$config['csrf_token_name'] = 'csrf_test_name'; +$config['csrf_protection'] = TRUE; +$config['csrf_token_name'] = 'ci_csrf_token'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; diff --git a/index.php b/index.php index 83b2380..b4287c2 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ define('ENVIRONMENT', 'testing'); break; default: - define('ENVIRONMENT', 'testing'); + define('ENVIRONMENT', 'development'); break; } } @@ -98,7 +98,17 @@ break; case 'testing': - // ini_set('display_errors', 1); + ini_set('display_errors', 1); + error_reporting(-1); + if (version_compare(PHP_VERSION, '5.3', '>=')) { + error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); + } else { + error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); + } + break; + + case 'production': + ini_set('display_errors', 1); // error_reporting(-1); // if (version_compare(PHP_VERSION, '5.3', '>=')) { // error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); @@ -107,10 +117,6 @@ // } break; - case 'production': - ini_set('display_errors', 1); - break; - default: header('HTTP/1.1 503 Service Unavailable.', true, 503); echo 'The application environment is not set correctly.';