Welcome Guest, Not a member yet? Register   Sign In
Showing Lang Line on Redirect
#1

[eluser]Unknown[/eluser]
So I am using the Ag Auth library and can't figure out how to call from the lang file... What I'm trying to do is display a permissions error when a non-admin tries to access an admin page. This can be any page I designate as "admin"...

So if they're on the login.php or dashboard.php and try to hit register.php it should prompt them with a modal that says "You do not have sufficient privileges to access this page." without leaving that page...

Code:
$lang['insufficient_privs'] = "You do not have sufficient privileges to access this page.";

Code:
<?php
  if(user_group('admin') === TRUE)
  {
    $this->load->view($this->config->item('auth_views_root') . 'pages/controls/register-controls');
    $this->load->view($this->config->item('auth_views_root') . 'pages/controls/nav');
  }
  else
  {
      // Not sure what to do here...
  }
?>
#2

[eluser]InsiteFX[/eluser]
Code:
show_error($this->lang->line('insufficient_privs'));
#3

[eluser]Unknown[/eluser]
That worked! Thanks! Smile




Theme © iAndrew 2016 - Forum software by © MyBB