Permalink
Browse files

Fixed broken links issue

  • Loading branch information...
sampoyigi committed Oct 6, 2017
1 parent 9cf3259 commit 5cf37f41618ed3632de7ee9af8877a969dc597d0
@@ -7,33 +7,33 @@ public function index() {
$this->lang->load('login');
if ($this->user->islogged()) {
$this->redirect('dashboard');
redirect('dashboard');
}
$this->template->setTitle($this->lang->line('text_title'));
$data['site_name'] = $this->config->item('site_name');
$data['reset_url'] = $this->pageUrl('login/reset');
$data['site_name'] = $this->config->item('site_name');
$data['reset_url'] = site_url('login/reset');
if ($this->input->post() AND $this->validateLoginForm() === TRUE) {
if (!$this->user->login($this->input->post('user'), $this->input->post('password'))) { // checks if form validation routines ran successfully
$this->alert->set('danger', $this->lang->line('alert_username_not_found'));
$this->redirect(current_url());
redirect(current_url());
} else {
log_activity($this->user->getStaffId(), 'logged in', 'staffs', get_activity_message('activity_logged_in',
array('{staff}', '{link}'),
array($this->user->getStaffName(), admin_url('staffs/edit?id=' . $this->user->getStaffId()))
));
if (!$this->config->item('default_location_id')) {
$this->redirect('settings');
redirect('settings');
}
if ($redirect_url = $this->input->get('redirect')) {
$this->redirect($redirect_url);
redirect($redirect_url);
}
$this->redirect('dashboard');
redirect('dashboard');
}
}
@@ -45,16 +45,16 @@ public function reset() {
$this->load->model('Staffs_model');
if ($this->user->islogged()) {
$this->redirect('dashboard');
redirect('dashboard');
}
$this->template->setTitle($this->lang->line('text_password_reset_title'));
if ($this->input->post() AND $this->_resetPassword() === TRUE) {
$this->redirect('login');
redirect('login');
}
$data['login_url'] = $this->pageUrl();
$data['login_url'] = site_url('login');
$this->template->render('login_reset', $data);
}
@@ -70,7 +70,7 @@ protected function _resetPassword() {
}
$this->alert->set('danger', $this->lang->line('alert_email_not_sent'));
$this->redirect('login/reset');
redirect('login/reset');
}
}
@@ -5,7 +5,7 @@ class Login extends Main_Controller
public function index() {
if ($this->customer->islogged()) { // checks if customer is logged in then redirect to account page.
$this->redirect('account/account');
redirect('account/account');
}
$this->load->model('Pages_model');
@@ -27,18 +27,18 @@ public function index() {
if ($this->customer->login($email, $password) === FALSE) { // invoke login method in customer library with email and password $_POST data value then check if login was unsuccessful
$this->alert->set('alert', $this->lang->line('alert_invalid_login')); // display error message and redirect to account login page
$this->redirect(current_url());
redirect(current_url());
} else { // else if login was successful redirect to account page
log_activity($this->customer->getId(), 'logged in', 'customers', get_activity_message('activity_logged_in',
array('{customer}', '{link}'),
array($this->customer->getName(), admin_url('customers/edit?id=' . $this->customer->getId()))
));
if ($redirect_url = $this->input->get('redirect')) {
$this->redirect($redirect_url);
redirect($redirect_url);
}
$this->redirect('account/account');
redirect('account/account');
}
}
}
@@ -8,7 +8,7 @@ public function __construct() {
parent::__construct(); // calls the constructor
if ($this->customer->islogged()) { // checks if customer is logged in then redirect to account page.
$this->redirect('account/account');
redirect('account/account');
}
$this->load->model('Pages_model');
@@ -20,10 +20,10 @@ public function index() {
$this->alert->set('alert', $this->lang->line('alert_account_created')); // display success message and redirect to account login page
if ($redirect_url = $this->input->get('redirect')) {
$this->redirect($redirect_url);
redirect($redirect_url);
}
$this->redirect('account/login');
redirect('account/login');
}
$this->template->setTitle($this->lang->line('text_register_heading'));
@@ -213,8 +213,8 @@ protected function _load_db_config() {
date_default_timezone_set($this->config->item('timezone'));
}
if ($this->config->item('site_url')) {
$this->config->set_item('base_url', trim($this->config->item('site_url'), '/') . '/' . (APPDIR === MAINDIR) ? '' : APPDIR);
if ($url = $this->config->item('site_url')) {
$this->config->set_item('base_url', rtrim($url, '/') . '/' . (APPDIR === MAINDIR ? '' : APPDIR));
}
$this->_db_config_loaded = TRUE;
@@ -22,7 +22,7 @@
define('TI_VERSION', '2.1.1');
// Path to the root folder
defined('ROOTPATH') OR define('ROOTPATH', rtrim(dirname(BASEPATH), '/') . '/');
defined('ROOTPATH') OR define('ROOTPATH', dirname(dirname(dirname(__DIR__))) . '/');
// Path to the tastyigniter system core folder
defined('IGNITEPATH') OR define('IGNITEPATH', BASEPATH.'tastyigniter/');
@@ -89,7 +89,7 @@ public function getSysInfo()
$info['version'] = TI_VERSION;
$info['php_version'] = $this->installed_php_version;
$info['mysql_version'] = $this->db_exists ? $this->CI->db->version() : '';
$info['sys_hash'] = $this->CI->config->item('sys_hash'); // md5(TastyIgniter!core!2.1.1)
$info['sys_hash'] = $this->CI->config->item('sys_hash');
$this->CI->load->model('Languages_model');
$languages = $this->CI->Languages_model->getLanguages();

0 comments on commit 5cf37f4

Please sign in to comment.