Welcome Guest, Not a member yet? Register   Sign In
Problem
#1

[eluser]NiconPhantom[/eluser]
Hi all I have problem, maybe with route configuration...

I use freakauth + CI 1.7.0 and multilingual function (http://codeigniter.com/wiki/URI_Language_Identifier/).

When I click to login, registration or admin my URL is index.php/en/en/auth/login.html but not index.php/en/auth/login.html

in route.php I have:

$route['default_controller'] = "main";
$route['scaffolding_trigger'] = "scaff";
$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

$route['admin'] = "admin/adminhome";
$route['admin/users/:num'] = "admin/users";
$route['admin/admins/:num'] = "admin/admins";


Please help :-(
#2

[eluser]NiconPhantom[/eluser]
Maybe problem in standard MY_Language.php file:

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* URI Language Identifier
*
* Adds a language identifier prefix to all site_url links
*
* version 0.14 © Wiredesignz 2008-07-30
*/
class MY_Language extends CI_Language
{
function MY_Language()
{
parent::CI_Language();

global $RTR;

$index_page = $RTR->config->item('index_page');
$lang_uri_abbr = $RTR->config->item('lang_uri_abbr');

//get the language from uri segment
$lang_abbr = $RTR->uri->segment(1);

//check for invalid abbreviation
if( ! isset($lang_uri_abbr[$lang_abbr]))
{
$base_url = $RTR->config->item('base_url');
$deft_abbr = $RTR->config->item('language_abbr');

//check for abbreviation to be ignored
if ($deft_abbr != $RTR->config->item('lang_ignore'))
{
//check and set the default uri identifier
$index_page .= ($index_page == '') ? "{$deft_abbr}" : "/{$deft_abbr}";

$uri_string = $RTR->uri->uri_string;

//remove an invalid abbreviation from uri
if (strlen($lang_abbr) == 2)
{
$uri_string = str_replace("/{$lang_abbr}", '', $uri_string);
}

//prefix forward-slash to content in uri_string
$uri_string = ($uri_string == '') ? '' : '/'.$uri_string;

//redirect after inserting language id
header("Location:".$base_url.$index_page.$uri_string);
}

//get the language name
$user_lang = $lang_uri_abbr[$deft_abbr];
}
else
{
//get the language name
$user_lang = $lang_uri_abbr[$lang_abbr];

//reset config language to match the user language
$RTR->config->set_item('language', $user_lang);
$RTR->config->set_item('language_abbr', $lang_abbr);

//check for abbreviation to be ignored
if ($lang_abbr != $RTR->config->item('lang_ignore'))
{
//check and set the user uri identifier
$index_page .= ($index_page == '') ? "{$lang_abbr}" : "/{$lang_abbr}";
}
}

//reset the the config index_page value
$index_page .= ($index_page == '') ? '' : '/';

$RTR->config->set_item('index_page', $index_page);
}
}

?>




Theme © iAndrew 2016 - Forum software by © MyBB