2

On one of my pages, I am checking if the user has permissions:

// Validate our user
if ($this->global_model->get_permission() != 'Admin') 
{
    redirect('/permissions/index/'.current_url());
}

On the permissions controller, I am logging where they came from:

$this->global_model->log_data('permission','Invalid Permissions | Referer : ' . $this->uri->segment(3));

Due to the URL having / in it, its giving me http: as URI3.

How can I pass this in the URL but get the whole value?

1 Answer 1

2

You could create a workaround like this to avoid splitting up the URI:

redirect('/permissions/index/' . base64_encode(current_url()) );

Then on the other usage (the parameter next to the method name):

$url = base64_decode($this->uri->segment(3));
$this->global_model->log_data('permission','Invalid Permissions | Referer : ' . $url);
Sign up to request clarification or add additional context in comments.

2 Comments

Cool, that worked for me! I had to add an = to $config['permitted_uri_chars'] hope that's not a big issue..
@SBB oh yes i forgot about that, its included in one of the filters of CI, im glad this helped

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.