diff --git a/src/application/config/config.php b/src/application/config/config.php index afe513cd..5b2b281f 100644 --- a/src/application/config/config.php +++ b/src/application/config/config.php @@ -1,7 +1,7 @@ '1.1.0', // This must be changed manually. + 'title' => 'Develop' // Leave empty for no title or add BETA, TEST etc ... +); + +$config['ea_version'] = '1.1.0'; // This must be changed manually. $config['ea_release_title'] = 'Develop'; // Leave empty for no title or add BETA, TEST etc ... -$config['ea_google_sync_feature'] = SystemConfiguration::$google_sync_feature; +$config['ea_google_sync_feature'] = Config::$google_sync_feature; /* @@ -31,8 +36,7 @@ $config['ea_google_sync_feature'] = SystemConfiguration::$google_sync_feature; | path to your installation. | */ -require_once dirname(dirname(__DIR__)) . '/configuration.php'; -$config['base_url'] = SystemConfiguration::$base_url; +$config['base_url'] = Config::BASE_URL; /* |-------------------------------------------------------------------------- @@ -200,7 +204,7 @@ $config['directory_trigger'] = 'd'; // experimental not currently in use | your log files will fill up very fast. | */ -$config['log_threshold'] = 0; +$config['log_threshold'] = 1; /* |-------------------------------------------------------------------------- @@ -244,7 +248,7 @@ $config['cache_path'] = ''; | MUST set an encryption key. See the user guide for info. | */ -$config['encryption_key'] = SystemConfiguration::$base_url; +$config['encryption_key'] = Config::BASE_URL; /* |-------------------------------------------------------------------------- diff --git a/src/application/config/database.php b/src/application/config/database.php index c3890a49..a31fd903 100644 --- a/src/application/config/database.php +++ b/src/application/config/database.php @@ -48,13 +48,13 @@ $active_group = 'default'; $active_record = TRUE; -require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php'; +require_once __DIR__ . '/../../config.php'; -$db['default']['hostname'] = SystemConfiguration::$db_host; -$db['default']['username'] = SystemConfiguration::$db_username; -$db['default']['password'] = SystemConfiguration::$db_password; -$db['default']['database'] = SystemConfiguration::$db_name; -$db['default']['dbdriver'] = 'mysql'; +$db['default']['hostname'] = Config::DB_HOST; +$db['default']['username'] = Config::DB_USERNAME; +$db['default']['password'] = Config::DB_PASSWORD; +$db['default']['database'] = Config::DB_NAME; +$db['default']['dbdriver'] = 'mysqli'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; diff --git a/src/application/controllers/appointments.php b/src/application/controllers/appointments.php index bdb7b0eb..a972dbf1 100644 --- a/src/application/controllers/appointments.php +++ b/src/application/controllers/appointments.php @@ -53,7 +53,7 @@ class Appointments extends CI_Controller { 'message_title' => $this->lang->line('appointment_not_found'), 'message_text' => $this->lang->line('appointment_does_not_exist_in_db'), 'message_icon' => $this->config->item('base_url') - . 'assets/img/error.png', + . '/assets/img/error.png', 'company_name' => $company_name ); $this->load->view('appointments/message', $view); @@ -161,22 +161,22 @@ class Appointments extends CI_Controller { if (!$post_data['manage_mode']) { $customer_title = $this->lang->line('appointment_booked'); $customer_message = $this->lang->line('thank_your_for_appointment'); - $customer_link = $this->config->item('base_url') . 'appointments/index/' + $customer_link = $this->config->item('base_url') . '/appointments/index/' . $appointment['hash']; $provider_title = $this->lang->line('appointment_added_to_your_plan'); $provider_message = $this->lang->line('appointment_link_description'); - $provider_link = $this->config->item('base_url') . 'backend/index/' + $provider_link = $this->config->item('base_url') . '/backend/index/' . $appointment['hash']; } else { $customer_title = $this->lang->line('appointment_changes_saved'); $customer_message = ''; - $customer_link = $this->config->item('base_url') . 'appointments/index/' + $customer_link = $this->config->item('base_url') . '/appointments/index/' . $appointment['hash']; $provider_title = $this->lang->line('appointment_details_changed'); $provider_message = ''; - $provider_link = $this->config->item('base_url') . 'backend/index/' + $provider_link = $this->config->item('base_url') . '/backend/index/' . $appointment['hash']; } @@ -620,7 +620,7 @@ class Appointments extends CI_Controller { public function ajax_install() { try { // Create E!A database structure. - $file_contents = file_get_contents($this->config->item('base_url') . 'assets/sql/structure.sql'); + $file_contents = file_get_contents($this->config->item('base_url') . '/assets/sql/structure.sql'); $sql_queries = explode(';', $file_contents); array_pop($sql_queries); foreach($sql_queries as $query) { diff --git a/src/application/controllers/backend.php b/src/application/controllers/backend.php index 9879b66b..1e921eac 100644 --- a/src/application/controllers/backend.php +++ b/src/application/controllers/backend.php @@ -26,7 +26,7 @@ class Backend extends CI_Controller { * appear when the page loads. */ public function index($appointment_hash = '') { - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'backend'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/backend'); if (!$this->hasPrivileges(PRIV_APPOINTMENTS)) return; $this->load->model('appointments_model'); @@ -76,7 +76,7 @@ class Backend extends CI_Controller { * In this page the user can manage all the customer records of the system. */ public function customers() { - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'backend/customers'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/backend/customers'); if (!$this->hasPrivileges(PRIV_CUSTOMERS)) return; $this->load->model('providers_model'); @@ -109,7 +109,7 @@ class Backend extends CI_Controller { * from the backend services page. */ public function services() { - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'backend/services'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/backend/services'); if (!$this->hasPrivileges(PRIV_SERVICES)) return; $this->load->model('customers_model'); @@ -138,7 +138,7 @@ class Backend extends CI_Controller { * the page where the admin defines which service can each provider provide. */ public function users() { - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'backend/users'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/backend/users'); if (!$this->hasPrivileges(PRIV_USERS)) return; $this->load->model('providers_model'); @@ -172,7 +172,7 @@ class Backend extends CI_Controller { * installation (core settings like company name, book timeout etc). */ public function settings() { - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'backend/settings'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/backend/settings'); if (!$this->hasPrivileges(PRIV_SYSTEM_SETTINGS, FALSE) && !$this->hasPrivileges(PRIV_USER_SETTINGS)) return; @@ -220,7 +220,7 @@ class Backend extends CI_Controller { $user_id = $this->session->userdata('user_id'); if ($user_id == FALSE) { // User not logged in, display the login view. if ($redirect) { - header('Location: ' . $this->config->item('base_url') . 'user/login'); + header('Location: ' . $this->config->item('base_url') . '/user/login'); } return FALSE; } @@ -230,7 +230,7 @@ class Backend extends CI_Controller { $role_priv = $this->db->get_where('ea_roles', array('slug' => $role_slug))->row_array(); if ($role_priv[$page] < PRIV_VIEW) { // User does not have the permission to view the page. if ($redirect) { - header('Location: ' . $this->config->item('base_url') . 'user/no_privileges'); + header('Location: ' . $this->config->item('base_url') . '/user/no_privileges'); } return FALSE; } diff --git a/src/application/controllers/backend_api.php b/src/application/controllers/backend_api.php index 42cc1b5b..04faa95d 100644 --- a/src/application/controllers/backend_api.php +++ b/src/application/controllers/backend_api.php @@ -186,22 +186,22 @@ class Backend_api extends CI_Controller { if (!$manage_mode) { $customer_title = $this->lang->line('appointment_booked'); $customer_message = $this->lang->line('thank_your_for_appointment'); - $customer_link = $this->config->item('base_url') . 'appointments/index/' + $customer_link = $this->config->item('base_url') . '/appointments/index/' . $appointment['hash']; $provider_title = $this->lang->line('appointment_added_to_your_plan'); $provider_message = $this->lang->line('appointment_link_description'); - $provider_link = $this->config->item('base_url') . 'backend/index/' + $provider_link = $this->config->item('base_url') . '/backend/index/' . $appointment['hash']; } else { $customer_title = $this->lang->line('appointment_changes_saved'); $customer_message = ''; - $customer_link = $this->config->item('base_url') . 'appointments/index/' + $customer_link = $this->config->item('base_url') . '/appointments/index/' . $appointment['hash']; $provider_title = $this->lang->line('appointment_details_changed'); $provider_message = ''; - $provider_link = $this->config->item('base_url') . 'backend/index/' + $provider_link = $this->config->item('base_url') . '/backend/index/' . $appointment['hash']; } @@ -378,7 +378,7 @@ class Backend_api extends CI_Controller { $this->load->model('providers_model'); $this->load->model('customers_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where_clause = '(first_name LIKE "%' . $key . '%" OR ' . @@ -641,7 +641,7 @@ class Backend_api extends CI_Controller { } $this->load->model('services_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where = '(name LIKE "%' . $key . '%" OR duration LIKE "%' . $key . '%" OR ' . 'price LIKE "%' . $key . '%" OR currency LIKE "%' . $key . '%" OR ' . @@ -719,7 +719,7 @@ class Backend_api extends CI_Controller { } $this->load->model('services_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where = '(name LIKE "%' . $key . '%" OR description LIKE "%' . $key . '%")'; $categories = $this->services_model->get_all_categories($where); echo json_encode($categories); @@ -743,7 +743,7 @@ class Backend_api extends CI_Controller { } $this->load->model('admins_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where = '(first_name LIKE "%' . $key . '%" OR last_name LIKE "%' . $key . '%" ' . 'OR email LIKE "%' . $key . '%" OR mobile_number LIKE "%' . $key . '%" ' . @@ -829,7 +829,7 @@ class Backend_api extends CI_Controller { } $this->load->model('providers_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where = '(first_name LIKE "%' . $key . '%" OR last_name LIKE "%' . $key . '%" ' . 'OR email LIKE "%' . $key . '%" OR mobile_number LIKE "%' . $key . '%" ' . @@ -920,7 +920,7 @@ class Backend_api extends CI_Controller { } $this->load->model('secretaries_model'); - $key = mysql_real_escape_string($_POST['key']); + $key = $this->db->escape_str($_POST['key']); $where = '(first_name LIKE "%' . $key . '%" OR last_name LIKE "%' . $key . '%" ' . 'OR email LIKE "%' . $key . '%" OR mobile_number LIKE "%' . $key . '%" ' . diff --git a/src/application/controllers/test.php b/src/application/controllers/test.php index 062d340e..db827ee9 100644 --- a/src/application/controllers/test.php +++ b/src/application/controllers/test.php @@ -18,9 +18,9 @@ class Test extends CI_Controller { public function index() { // User must be logged in as an admin in order to run the tests. $this->load->library('session'); - $this->session->set_userdata('dest_url', $this->config->item('base_url') . 'test'); + $this->session->set_userdata('dest_url', $this->config->item('base_url') . '/test'); if ($this->session->userdata('role_slug') != DB_SLUG_ADMIN) { - header('Location: ' . $this->config->item('base_url') . 'user/login'); + header('Location: ' . $this->config->item('base_url') . '/user/login'); return; } diff --git a/src/application/controllers/user.php b/src/application/controllers/user.php index fdf1d626..b6ef4ecf 100644 --- a/src/application/controllers/user.php +++ b/src/application/controllers/user.php @@ -15,7 +15,7 @@ class User extends CI_Controller { } public function index() { - header('Location: ' . $this->config->item('base_url') . 'user/login'); + header('Location: ' . $this->config->item('base_url') . '/user/login'); } public function login() { @@ -25,7 +25,7 @@ class User extends CI_Controller { $view['dest_url'] = $this->session->userdata('dest_url'); if (!$view['dest_url']) { - $view['dest_url'] = $view['base_url'] . 'backend'; + $view['dest_url'] = $view['base_url'] . '/backend'; } $view['company_name'] = $this->settings_model->get_setting('company_name'); diff --git a/src/application/libraries/google_sync.php b/src/application/libraries/google_sync.php index 62e18656..a0626a95 100644 --- a/src/application/libraries/google_sync.php +++ b/src/application/libraries/google_sync.php @@ -38,7 +38,7 @@ class Google_Sync { $this->client->setClientId(SystemConfiguration::$google_client_id); $this->client->setClientSecret(SystemConfiguration::$google_client_secret); $this->client->setDeveloperKey(SystemConfiguration::$google_api_key); - $this->client->setRedirectUri($this->CI->config->item('base_url') . 'google/oauth_callback'); + $this->client->setRedirectUri($this->CI->config->item('base_url') . '/google/oauth_callback'); $this->service = new Google_CalendarService($this->client); } diff --git a/src/application/logs/log-2015-01-28.php b/src/application/logs/log-2015-01-28.php new file mode 100644 index 00000000..e69de29b diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index 10da8d22..c5353724 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -11,27 +11,27 @@ + href="config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap.css"> + href="config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap-responsive.css"> + href="config->base_url(); ?>/assets/css/libs/jquery/jquery-ui.min.css"> + href="config->base_url(); ?>/assets/css/libs/jquery/jquery.qtip.min.css"> + href="config->base_url(); ?>/assets/css/frontend.css"> + href="config->base_url(); ?>/assets/css/general.css"> + src="config->base_url(); ?>/assets/js/libs/jquery/jquery.min.js"> + src="config->base_url(); ?>/assets/js/libs/jquery/jquery-ui.min.js"> + src="config->base_url(); ?>/assets/js/libs/jquery/jquery.qtip.min.js"> + src="config->base_url(); ?>/assets/js/libs/bootstrap/bootstrap.min.js"> + src="config->base_url(); ?>/assets/js/libs/date.js"> + src="config->base_url(); ?>/assets/js/frontend_book.js"> config->base_url(); ?>assets/img/favicon.ico"> + href="config->base_url(); ?>/assets/img/favicon.ico">
+ . '/appointments/cancel/' . $appointment_data['hash'] . '"> @@ -379,6 +379,6 @@ + src="config->base_url(); ?>/assets/js/general_functions.js"> \ No newline at end of file diff --git a/src/application/views/appointments/book_success.php b/src/application/views/appointments/book_success.php index 53bbb108..b6b5b148 100644 --- a/src/application/views/appointments/book_success.php +++ b/src/application/views/appointments/book_success.php @@ -7,29 +7,29 @@ + src="config->base_url(); ?>/assets/js/libs/jquery/jquery.min.js"> + src="config->base_url(); ?>/assets/js/libs/bootstrap/bootstrap.min.js"> + src="config->base_url(); ?>/assets/js/libs/date.js"> + href="config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap.css"> + href="config->base_url(); ?>/assets/css/libs/bootstrap/bootstrap-responsive.css"> + href="config->base_url(); ?>/assets/img/favicon.ico">