Location: PHPKode > projects > OpenBizMap > openbizmap/mydata/script/userexit/exit_onaccesscheck.txt
<?php
//USEREXIT file
//Code placed here modifies standard odb functionality


$result_array=search('sysGroupBy=user [user='.$user.'$] MyBag=access');
if(count($result_array))
{
  define('USERGROUP',strtoupper(read($result_array[0],'User Group')));
  define('FILTER',read($result_array[0],'Filter'));

  if(!read($result_array[0],'Active'))
  {
    $login=1;
    mylog('LOGIN BLOCKED (!Active) '.$user);
  }

  $user_desc=read($result_array[0],'Person Code');
  define('USERDESCRIPTION',$user_desc);
  if($user_desc)
    $bagaccess_array[purename('code_'.$user_desc)]=2;
}

$bagaccess_array['all']=0;
$bagaccess_array['logs']=0;
$bagaccess_array['menu']=0;
$bagaccess_array['deleted']=0;
$bagaccess_array['access']=0;

if(USERGROUP=='ADMIN')
{
  $bagaccess_array['all']=2;
  $bagaccess_array['access']=2;
  $bagaccess_array['deleted']=1;
  $bagaccess_array['logs']=1;
  $bagaccess_array['menu']=2;
}
elseif(USERGROUP=='SUPERUSER')
{
  $bagaccess_array['all']=2;
  $bagaccess_array['access']=2;
  $bagaccess_array['menu']=2;
}
else //if(USERGROUP=='GUEST')
{
  $bagaccess_array['articles']=1;
  $bagaccess_array['guest']=1;
  $bagaccess_array['']=1;
  $bagaccess_array['menu']=1;
}

?>
Return current item: OpenBizMap