Commit 8992e4f2 authored by Kylian ou Nathan's avatar Kylian ou Nathan
Browse files

Up

parent 884d1fa5
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
......@@ -9,7 +9,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
| http://example.com/
|
| WARNING: You MUST set this value!
|
......@@ -22,7 +22,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
*/
$config['base_url'] = 'http://lockhome.nrocher.fr/';
/*
......@@ -34,7 +34,7 @@ $config['base_url'] = 'http://lockhome.nrocher.fr/';
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
*/
$config['index_page'] = '';
/*
......@@ -51,8 +51,8 @@ $config['index_page'] = '';
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
......@@ -63,7 +63,7 @@ $config['uri_protocol'] = 'REQUEST_URI';
| For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/urls.html
*/
*/
$config['url_suffix'] = '';
/*
......@@ -75,8 +75,8 @@ $config['url_suffix'] = '';
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
......@@ -88,7 +88,7 @@ $config['language'] = 'english';
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
*/
$config['charset'] = 'UTF-8';
/*
......@@ -99,8 +99,8 @@ $config['charset'] = 'UTF-8';
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
*/
$config['enable_hooks'] = false;
/*
|--------------------------------------------------------------------------
......@@ -113,7 +113,7 @@ $config['enable_hooks'] = FALSE;
| https://codeigniter.com/user_guide/general/core_classes.html
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
*/
$config['subclass_prefix'] = 'MY_';
/*
......@@ -124,19 +124,19 @@ $config['subclass_prefix'] = 'MY_';
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = false;
/*
|--------------------------------------------------------------------------
......@@ -157,7 +157,7 @@ $config['composer_autoload'] = FALSE;
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
......@@ -181,8 +181,8 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
*/
$config['enable_query_strings'] = false;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
......@@ -198,8 +198,8 @@ $config['directory_trigger'] = 'd';
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
*/
$config['allow_get_array'] = true;
/*
|--------------------------------------------------------------------------
......@@ -209,20 +209,20 @@ $config['allow_get_array'] = TRUE;
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
*/
$config['log_threshold'] = 4;
/*
......@@ -233,7 +233,7 @@ $config['log_threshold'] = 4;
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
*/
$config['log_path'] = '';
/*
......@@ -247,7 +247,7 @@ $config['log_path'] = '';
|
| Note: Leaving it blank will default to 'php'.
|
*/
*/
$config['log_file_extension'] = 'log';
/*
......@@ -259,7 +259,7 @@ $config['log_file_extension'] = 'log';
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
*/
$config['log_file_permissions'] = 0644;
/*
......@@ -270,7 +270,7 @@ $config['log_file_permissions'] = 0644;
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
......@@ -281,7 +281,7 @@ $config['log_date_format'] = 'Y-m-d H:i:s';
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
*/
$config['error_views_path'] = '';
/*
......@@ -292,7 +292,7 @@ $config['error_views_path'] = '';
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
*/
$config['cache_path'] = '';
/*
......@@ -303,15 +303,15 @@ $config['cache_path'] = '';
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
*/
$config['cache_query_string'] = false;
/*
|--------------------------------------------------------------------------
......@@ -323,7 +323,7 @@ $config['cache_query_string'] = FALSE;
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
*/
$config['encryption_key'] = '';
/*
......@@ -333,57 +333,57 @@ $config['encryption_key'] = '';
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_save_path'] = null;
$config['sess_match_ip'] = false;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['sess_regenerate_destroy'] = false;
/*
|--------------------------------------------------------------------------
......@@ -399,12 +399,12 @@ $config['sess_regenerate_destroy'] = FALSE;
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = false;
$config['cookie_httponly'] = false;
/*
|--------------------------------------------------------------------------
......@@ -417,8 +417,8 @@ $config['cookie_httponly'] = FALSE;
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['standardize_newlines'] = FALSE;
*/
$config['standardize_newlines'] = false;
/*
|--------------------------------------------------------------------------
......@@ -431,8 +431,8 @@ $config['standardize_newlines'] = FALSE;
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
*/
$config['global_xss_filtering'] = false;
/*
|--------------------------------------------------------------------------
......@@ -447,12 +447,12 @@ $config['global_xss_filtering'] = FALSE;
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
*/
$config['csrf_protection'] = false;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_regenerate'] = true;
$config['csrf_exclude_uris'] = array();
/*
......@@ -474,8 +474,8 @@ $config['csrf_exclude_uris'] = array();
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
*/
$config['compress_output'] = false;
/*
|--------------------------------------------------------------------------
......@@ -487,7 +487,7 @@ $config['compress_output'] = FALSE;
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
*/
$config['time_reference'] = 'local';
/*
......@@ -501,8 +501,8 @@ $config['time_reference'] = 'local';
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
*/
$config['rewrite_short_tags'] = false;
/*
|--------------------------------------------------------------------------
......@@ -517,7 +517,7 @@ $config['rewrite_short_tags'] = FALSE;
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
$active_group = 'default';
$query_builder = TRUE;
$query_builder = true;
$db['default'] = array(
'dsn' => 'mysql:host=localhost; dbname=lockhome',
'hostname' => '',
'username' => 'lockhome',
'password' => 'peip',
'database' => '',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
'dsn' => 'mysql:host=localhost; dbname=lockhome',
'hostname' => '',
'username' => 'lockhome',
'password' => 'peip',
'database' => '',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => false,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => false,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => false,
'compress' => false,
'stricton' => false,
'failover' => array(),
'save_queries' => true,
);
<?php
class AuthentificationModele extends CI_Model {
class AuthentificationModele extends CI_Model
{
public function __construct() {
public function __construct()
{
$this->load->database();
}
// METHODE PERMETTANT LINSCRIPTION
public function inscription($nom, $prenom, $email, $password) {
public function inscription($nom, $prenom, $email, $password)
{
$sql = "SELECT * from Authentification WHERE email = ? LIMIT 1";
......@@ -33,16 +36,17 @@ class AuthentificationModele extends CI_Model {
}
// METHODE PERMETTANT LA CONNEXION
public function connexion($email, $password) {
public function connexion($email, $password)
{
$sql = "SELECT * FROM Authentification WHERE email = ? LIMIT 1";
$query = $this->db->query($sql, array($email));
if ($query->num_rows() > 0) {
$resultat = $query->result()[0];
if(password_verify($password, $resultat->password)){
if (password_verify($password, $resultat->password)) {
return $resultat->role;
} else {
return false;
......@@ -54,13 +58,14 @@ class AuthentificationModele extends CI_Model {
}
// METHODE PERMETTANT LA RECUPERATION DE MOT DE PASSE
public function mot_de_passe_oublie($email) {
public function mot_de_passe_oublie($email)
{
$sql = "SELECT * FROM Authentification WHERE email = ? LIMIT 1";
$query = $this->db->query($sql, array($email));
if ($query->num_rows() > 0) {
// ENVOYE UN MAIL ICI
return true;
......@@ -70,5 +75,3 @@ class AuthentificationModele extends CI_Model {
}
}
}
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment