<commit_before><?php
/**
 * Generated Header (not documented yet)
 *
 * @author Anakeen 2000 
 * @version $Id: appl_access.php,v 1.6 2007/02/14 13:22:41 eric Exp $
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @package WHAT
 * @subpackage ACCESS
 */
 /**
 */

// ---------------------------------------------------------------
// $Id: appl_access.php,v 1.6 2007/02/14 13:22:41 eric Exp $
// $Source: /home/cvsroot/anakeen/freedom/core/Action/Access/appl_access.php,v $
// ---------------------------------------------------------------
//  O   Anakeen - 2000
// O*O  Anakeen development team
//  O   <EMAIL>
// ---------------------------------------------------------------
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or (at
//  your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// ---------------------------------------------------------------

include_once("Class.QueryDb.php");
include_once("Class.SubForm.php");
include_once("Class.QueryGen.php");

// -----------------------------------
function appl_access(&$action, $oid=0) {
// -----------------------------------

  $baseurl=$action->GetParam("CORE_BASEURL");
  $standurl=$action->GetParam("CORE_STANDURL");
  
  $action->lay->set("usefilter",false);
  $action->lay->set("maxreach",false);

  // affect the select form elements
  $query = new QueryDb("","Application");
  if ($oid == 0) {
    $query-> AddQuery("(objectclass != 'Y' ) OR ( objectclass isnull)");
    $varreg = "access_appl_id";
    $paramedit="&isclass=no";
  } else {
    $query->AddQuery("objectclass = 'Y'");
    $varreg = "access_class_id";
    $paramedit="&isclass=yes&oid=$oid";
  }
  $applist = $query->Query();
  unset($query);

  $action->lay->set("ACTION_CHG","ACCESS_APPL_CHG$paramedit");
  $action->lay->set("ACTION_MOD","APPL_ACCESS_MOD$paramedit");

  // select the first user if not set
  $appl_id=$action->Read($varreg);

  if ($appl_id == "") $appl_id=0; 

  // Set the edit form element
  $form = new SubForm("edit",500,330,"not used",
                                     $standurl."app=ACCESS&action=EDIT&mod=app$paramedit");
  $form->SetParam("id","-1");
  $form->SetKey("id");

  $action->parent->AddJsRef($action->GetParam("CORE_JSURL")."/subwindow.js");
  $action->parent->AddJsCode($form->GetMainJs());
  $jsscript=$form-> GetLinkJsMainCall();


  // display application / object class
  $tab=array();
  $appl_sel="";
  $i=0;
  if (is_array($applist)) {
    reset($applist);
    while(list($k,$v)=each($applist)) {
      
      if (($v->objectclass=="Y") || (true)) {
	$query = new QueryDb("","Acl");
	$query->basic_elem->sup_where=array("id_application={$v->id}");
	$acl_list = $query->Query("","","TABLE");
	if ($query->nb == 0) continue;
	if ($appl_id == 0) {
	  $appl_id=$v->id;
	  $action->Register($varreg,$appl_id);
	}
	if ($oid != 0) $tab[$i]["text"]=_($v->short_name);
	else $tab[$i]["text"]=$v->name;
	$tab[$i]["id"]=$v->id;
	if ($appl_id == $v->id) {
	  $appl_sel=$v;
	  $appl_sel->acl=$acl_list;
	  $tab[$i]["selected"]="selected";
	} else {
	  $tab[$i]["selected"]="";
	}
	$i++;
      }<commit_msg>Correct when filter return no users<commit_after><?php
/**
 * Generated Header (not documented yet)
 *
 * @author Anakeen 2000 
 * @version $Id: appl_access.php,v 1.7 2007/02/16 14:11:14 eric Exp $
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @package WHAT
 * @subpackage ACCESS
 */
 /**
 */

// ---------------------------------------------------------------
// $Id: appl_access.php,v 1.7 2007/02/16 14:11:14 eric Exp $
// $Source: /home/cvsroot/anakeen/freedom/core/Action/Access/appl_access.php,v $
// ---------------------------------------------------------------
//  O   Anakeen - 2000
// O*O  Anakeen development team
//  O   <EMAIL>
// ---------------------------------------------------------------
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or (at
//  your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// ---------------------------------------------------------------

include_once("Class.QueryDb.php");
include_once("Class.SubForm.php");
include_once("Class.QueryGen.php");

// -----------------------------------
function appl_access(&$action, $oid=0) {
// -----------------------------------

  $baseurl=$action->GetParam("CORE_BASEURL");
  $standurl=$action->GetParam("CORE_STANDURL");
  
  $action->lay->set("usefilter",false);
  $action->lay->set("maxreach",false);

  // affect the select form elements
  $query = new QueryDb("","Application");
  if ($oid == 0) {
    $query-> AddQuery("(objectclass != 'Y' ) OR ( objectclass isnull)");
    $varreg = "access_appl_id";
    $paramedit="&isclass=no";
  } else {
    $query->AddQuery("objectclass = 'Y'");
    $varreg = "access_class_id";
    $paramedit="&isclass=yes&oid=$oid";
  }
  $applist = $query->Query();
  unset($query);

  $action->lay->set("ACTION_CHG","ACCESS_APPL_CHG$paramedit");
  $action->lay->set("ACTION_MOD","APPL_ACCESS_MOD$paramedit");

  // select the first user if not set
  $appl_id=$action->Read($varreg);

  if ($appl_id == "") $appl_id=0; 

  // Set the edit form element
  $form = new SubForm("edit",500,330,"not used",
                                     $standurl."app=ACCESS&action=EDIT&mod=app$paramedit");
  $form->SetParam("id","-1");
  $form->SetKey("id");

  $action->parent->AddJsRef($action->GetParam("CORE_JSURL")."/subwindow.js");
  $action->parent->AddJsCode($form->GetMainJs());
  $jsscript=$form-> GetLinkJsMainCall();

  $action->lay->set("hasuser",true);

  // display application / object class
  $tab=array();
  $appl_sel="";
  $i=0;
  if (is_array($applist)) {
    reset($applist);
    while(list($k,$v)=each($applist)) {
      
      if (($v->objectclass=="Y") || (true)) {
	$query = new QueryDb("","Acl");
	$query->basic_elem->sup_where=array("id_application={$v->id}");
	$acl_list = $query->Query("","","TABLE");
	if ($query->nb == 0) continue;
	if ($appl_id == 0) {
	  $appl_id=$v->id;
	  $action->Register($varreg,$appl_id);
	}
	if ($oid != 0) $tab[$i]["text"]=_($v->short_name);
	else $tab[$i]["text"]=$v->name;
	$tab[$i]["id"]=$v->id;
	if ($appl_id == $v->id) {
	  $appl_sel=$v;
	  $appl_sel->acl=$acl_list;
	  $tab[$i]["selected"]="selected";
	} else {
	  $tab[$i]["selected"]="";
	}
	$i++;
      }
{'fraction_non_alphanumeric': 0.2642292754787733, 'fraction_numerical': 0.018481317798312576, 'mean_word_length': 2.627003399708596, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '639442', 'n_tokens_mistral': 2549, 'n_tokens_neox': 2418, 'n_words': 546}