<?php
if (isset($_SESSION["member"]["kduser"]) && trim($_SESSION["member"]["kduser"])!="") {
	$rsaud=array();$qaud="SELECT a.*, mod_name, mod_label FROM _user_auth a
		LEFT JOIN _admin_mods b ON b.kdmod=a.kdmod
		WHERE kduser='".trim($_SESSION["member"]["kduser"])."'";
	callRS($rsaud, $qaud);
	#printR($qaud);
	$avail_mods = array();
	for ($v=0;$v<count($rsaud);$v++) {
		$avail_mods[$rsaud[$v]["mod_name"]] = array(
			"kdmod"=>$rsaud[$v]["kdmod"],
			"mod_label"=>$rsaud[$v]["mod_label"],
			"isallowed"=>$rsaud[$v]["isallowed"]
		);
	}
	
	$_SESSION["user_auth"][trim($_SESSION["member"]["kduser"])] = $avail_mods;
	$ses_kduser = $_SESSION["member"]["kduser"];
}
?>