getDataArray($strSQL,$arrDataLines,$intDataCount); // // Write data to session // ===================== if ($chkMode == "") { $_SESSION['groupuser'] = ""; if ($intDataCount != 0) { foreach ($arrDataLines AS $elem) { $arrTemp['id'] = $elem['id']; $arrTemp['user'] = $elem['id']; $strRights = ""; if ($elem['read'] == 1) $strRights .= "READ,"; if ($elem['write'] == 1) $strRights .= "WRITE,"; if ($elem['link'] == 1) $strRights .= "LINK,"; if ($strRights != "") $strRights = substr($strRights,0,-1); $arrTemp['rights'] = $strRights; $arrTemp['status'] = 0; $_SESSION['groupuser'][] = $arrTemp; } } } } // // Add mode // ======== if ($chkMode == "add") { if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { $intCheck = 0; foreach ($_SESSION['groupuser'] AS $key => $elem) { if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { $_SESSION['groupuser'][$key]['user'] = $chkUser; $_SESSION['groupuser'][$key]['rights'] = $chkRights; $intCheck = 1; } } if ($intCheck == 0) { $arrTemp['id'] = 0; $arrTemp['user'] = $chkUser; $arrTemp['rights'] = $chkRights; $arrTemp['status'] = 0; $_SESSION['groupuser'][] = $arrTemp; } } else { $arrTemp['id'] = 0; $arrTemp['user'] = $chkUser; $arrTemp['rights'] = $chkRights; $arrTemp['status'] = 0; $_SESSION['groupuser'][] = $arrTemp; } } // // Deletion mode // ============= if ($chkMode == "del") { if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { foreach ($_SESSION['groupuser'] AS $key => $elem) { if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { $_SESSION['groupuser'][$key]['status'] = 1; } } } } ?>