|
|
|
@ -11,7 +11,11 @@ session_name('ipreg'); |
|
|
|
|
session_start(); |
|
|
|
|
|
|
|
|
|
if (! include("config.php")) { |
|
|
|
|
echo "<!DOCTYPE html><html><head><title>IP Reg</title></head><body><h1>IP Reg</h1><h2>No configuration</h2><p>Error loading configuration. Please check your installation.</p></body></html>\n"; |
|
|
|
|
echo "<!DOCTYPE html><html><head><title>IP Reg</title></head><body>\n"; |
|
|
|
|
echo "<h1>IP Reg</h1><h2>No configuration</h2>\n"; |
|
|
|
|
echo '<p>Error loading configuration.'; |
|
|
|
|
echo 'Please <a href="install">check your installation</a>.', "</p>\n"; |
|
|
|
|
echo "</body></html>\n"; |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -115,11 +119,15 @@ function user_login ($user_name, $user_pass) { |
|
|
|
|
$_SESSION['suser_tooltips'] = $user->user_tooltips; |
|
|
|
|
|
|
|
|
|
$roles = explode(',', $user->user_role); |
|
|
|
|
if (in_array('admin', $roles)) { |
|
|
|
|
// admin means everything! |
|
|
|
|
$roles = ['add', 'edit', 'delete', 'manage', 'admin']; |
|
|
|
|
$_SESSION['suser_role_admin'] = true; |
|
|
|
|
} |
|
|
|
|
$_SESSION['suser_role_add'] = in_array('add', $roles); |
|
|
|
|
$_SESSION['suser_role_edit'] = in_array('edit', $roles); |
|
|
|
|
$_SESSION['suser_role_delete'] = in_array('delete', $roles); |
|
|
|
|
$_SESSION['suser_role_manage'] = in_array('manage', $roles); |
|
|
|
|
$_SESSION['suser_role_admin'] = in_array('admin', $roles); |
|
|
|
|
|
|
|
|
|
$menu = explode(',', $user->user_menu); |
|
|
|
|
$_SESSION['suser_menu_assets'] = in_array('asset', $menu); |
|
|
|
@ -159,5 +167,4 @@ $smarty->assign("config_version", $config_version); |
|
|
|
|
$smarty->assign($lang); |
|
|
|
|
$smarty->display("login.tpl"); |
|
|
|
|
|
|
|
|
|
include("footer.php"); |
|
|
|
|
?> |
|
|
|
|
$smarty->display('footer.tpl'); |
|
|
|
|