Merged revisions 3338-3357 via svnmerge from
file:///home/developper/svn/phpcompta/branches/rel510 ........ r3340 | danydb | 2010-06-25 20:22:36 +0200 (Fri, 25 Jun 2010) | 1 line Fix bug in extension : the user list was limited (FF limit) ........ r3341 | danydb | 2010-06-25 21:16:50 +0200 (Fri, 25 Jun 2010) | 1 line Improve for user with plugin only, adaptation for numerous users ........
This commit is contained in:
parent
6ed60f9562
commit
5d9c44565d
6 changed files with 43 additions and 15 deletions
|
|
@ -84,7 +84,7 @@ switch($action) {
|
|||
$enable->value=$array;
|
||||
$enable->selected=$ext->get_parameter('enable');
|
||||
$str_enable=$enable->input();
|
||||
$r.='<div style="overflow:auto;">';
|
||||
$r.='<div style="overflow:hidden;">';
|
||||
$r.='<form id="formext" onsubmit="extension_save(this);return false">';
|
||||
$r.=dossier::hidden();
|
||||
/* property of the extension */
|
||||
|
|
@ -97,6 +97,7 @@ switch($action) {
|
|||
array('value'=>'N','label'=>_('Interdit'))
|
||||
);
|
||||
$array=User::get_list(dossier::id());
|
||||
|
||||
for ($i=0;$i<sizeof($array);$i++){
|
||||
$i_select=new ISelect("is_".$array[$i]['use_login']);
|
||||
$i_select->value=$ans;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function extDetail(req){
|
|||
if ( a.length == 0 ) { var rec=req.responseText;alert ('erreur :'+rec);}
|
||||
var html=answer.getElementsByTagName('code');
|
||||
var name_ctl=a[0].firstChild.nodeValue+'_content';
|
||||
var code_html=html[0].firstChild.nodeValue;
|
||||
var code_html=getNodeText(html[0]);
|
||||
code_html=unescape_xml(code_html);
|
||||
$(name_ctl).innerHTML=code_html;}
|
||||
catch (e) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,21 @@ if ( ! isset($_GET['user_id']) )
|
|||
return;
|
||||
|
||||
$SecUser=new User($rep,$_GET['user_id']);
|
||||
$admin=0;
|
||||
$access=$SecUser->get_folder_access($gDossier);
|
||||
|
||||
if ( $access == 'L') {
|
||||
$str='Local Admin';$admin=1;
|
||||
} elseif ($access=='R') {
|
||||
$str=' Utilisateur normal';
|
||||
} elseif ($access=='P') {
|
||||
$str=' Extension uniquement';
|
||||
}
|
||||
|
||||
|
||||
if ( $SecUser->admin==1 ) {
|
||||
$str=' Super Admin';$admin=1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
|
@ -56,11 +71,12 @@ $pdf->setDossierInfo(dossier::name().' Sécurité');
|
|||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
|
||||
$str_user=sprintf("( %d ) %s %s [ %s ]",
|
||||
$str_user=sprintf("( %d ) %s %s [ %s ] - %s",
|
||||
$SecUser->id,
|
||||
$SecUser->first_name,
|
||||
$SecUser->name,
|
||||
$SecUser->login);
|
||||
$SecUser->login,
|
||||
$str);
|
||||
|
||||
$pdf->SetFont('DejaVu','B',9);
|
||||
$pdf->Cell(0,7,$str_user,'B',0,'C');
|
||||
|
|
|
|||
|
|
@ -618,7 +618,7 @@ jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
|
|||
$sql="select distinct use_id,use_login,use_first_name,use_name from ac_users
|
||||
left outer join jnt_use_dos using (use_id)
|
||||
where
|
||||
(dos_id=$1 or use_admin=1) and use_active=1";
|
||||
(dos_id=$1 or use_admin=1) and use_active=1 order by use_login,use_name";
|
||||
$repo=new Database();
|
||||
$array=$repo->get_array($sql,array($p_dossier));
|
||||
if ( $repo->size() == 0 ) throw new Exception ('Error inaccessible folder');
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ if ( $User->check_action(PARSEC) == 0 ) {
|
|||
$cn=new Database();
|
||||
/* Show all the users, included local admin */
|
||||
$user_sql=$cn->exec_sql("select use_id,use_first_name,use_name,use_login,use_admin,priv_priv from ac_users natural join jnt_use_dos ".
|
||||
" join priv_user on (jnt_id=priv_jnt) where use_login != 'phpcompta' and dos_id=".$gDossier);
|
||||
" join priv_user on (jnt_id=priv_jnt) where use_login != 'phpcompta' and dos_id=".$gDossier.' order by use_login,use_name');
|
||||
$MaxUser=Database::num_row($user_sql);
|
||||
|
||||
if ( ! isset($_REQUEST['action'])) {
|
||||
echo '<DIV class="content" >';
|
||||
|
||||
echo '<TABLE CELLSPACING="20" ALIGN="CENTER">';
|
||||
|
|
@ -62,7 +62,9 @@ for ($i = 0;$i < $MaxUser;$i++) {
|
|||
// echo '<TR>';
|
||||
if ( $i % 3 == 0 && $i != 0)
|
||||
echo "</TR><TR>";
|
||||
$str=($l_line['priv_priv'] == 'L')?'Local Admin':' Utilisateur normal';
|
||||
$str=($l_line['priv_priv'] == 'L')?'Local Admin':' ';
|
||||
$str=($l_line['priv_priv'] == 'P')?'Uniquement Extension':$str;
|
||||
$str=($l_line['priv_priv'] == 'R')?'Utilisateur Normal':$str;
|
||||
if ( $l_line['use_admin'] == 1 )
|
||||
$str=' Super Admin';
|
||||
|
||||
|
|
@ -76,6 +78,7 @@ for ($i = 0;$i < $MaxUser;$i++) {
|
|||
}
|
||||
echo "</TR>";
|
||||
echo '</TABLE>';
|
||||
}
|
||||
$action="";
|
||||
|
||||
if ( isset ($_GET["action"] )) {
|
||||
|
|
@ -142,20 +145,25 @@ if ( $action == "view" ) {
|
|||
|
||||
$cn=new Database();
|
||||
$User=new User($cn,$_GET['user_id']);
|
||||
|
||||
echo '<h2>'.h($User->first_name).' '.h($User->name).' '.hi($User->login);
|
||||
$access=$User->get_folder_access($gDossier);
|
||||
|
||||
$admin=0;
|
||||
$access=$User->get_folder_access($gDossier);
|
||||
|
||||
if ( $access == 'L') {
|
||||
$str='Local Admin';$admin=1;
|
||||
} else {
|
||||
$str=' Utilisateur normal';}
|
||||
} elseif ($access=='R') {
|
||||
$str=' Utilisateur normal';
|
||||
} elseif ($access=='P') {
|
||||
$str=' Extension uniquement';
|
||||
}
|
||||
|
||||
|
||||
if ( $User->admin==1 ) {
|
||||
$str=' Super Admin';$admin=1;
|
||||
}
|
||||
|
||||
echo '<h2>'.h($User->first_name).' '.h($User->name).' '.hi($User->login)."($str)</h2>";
|
||||
|
||||
|
||||
if ( $admin != 0 ) {
|
||||
echo '<h2 class="info"> Cet utilisateur est administrateur, il a tous les droits</h2>';
|
||||
exit();
|
||||
|
|
@ -167,6 +175,7 @@ if ( $action == "view" ) {
|
|||
$action="";
|
||||
return;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Show access for journal
|
||||
//--------------------------------------------------------------------------------
|
||||
|
|
@ -183,6 +192,8 @@ if ( $action == "view" ) {
|
|||
echo HtmlInput::button('Imprime','imprime',"onclick=\"window.open('".$sHref."');\"");
|
||||
echo HtmlInput::submit('ok','Sauve');
|
||||
echo HtmlInput::reset('Annule');
|
||||
echo HtmlInput::button_anchor('Retour à la liste','?p_action=sec&'.dossier::get(),'retour');
|
||||
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::hidden('action','sec');
|
||||
echo HtmlInput::hidden('user_id',$_GET['user_id']);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div style="overflow:auto">
|
||||
<div style="overflow:hidden">
|
||||
<fieldset>
|
||||
<legend><?=_('Sécurité')?></legend>
|
||||
<table class="result">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue