Fix: Better comment and var name
This commit is contained in:
parent
159d0c7057
commit
8205a0e1b5
@ -2222,10 +2222,10 @@ class User extends CommonObject
|
|||||||
* fullname = nom avec chemin complet du user
|
* fullname = nom avec chemin complet du user
|
||||||
* fullpath = chemin complet compose des id
|
* fullpath = chemin complet compose des id
|
||||||
*
|
*
|
||||||
* @param int $markafterid Removed all users including the leaf $markafterid in user tree.
|
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
|
||||||
* @return array Array of users. this->users and this->parentof are set.
|
* @return array Array of users. this->users and this->parentof are set.
|
||||||
*/
|
*/
|
||||||
function get_full_tree($markafterid=0)
|
function get_full_tree($deleteafterid=0)
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
@ -2276,14 +2276,14 @@ class User extends CommonObject
|
|||||||
$this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
|
$this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exclude leaf including $markafterid from tree
|
// Exclude leaf including $deleteafterid from tree
|
||||||
if ($markafterid)
|
if ($deleteafterid)
|
||||||
{
|
{
|
||||||
//print "Look to discard user ".$markafterid."\n";
|
//print "Look to discard user ".$deleteafterid."\n";
|
||||||
$keyfilter1='^'.$markafterid.'$';
|
$keyfilter1='^'.$deleteafterid.'$';
|
||||||
$keyfilter2='_'.$markafterid.'$';
|
$keyfilter2='_'.$deleteafterid.'$';
|
||||||
$keyfilter3='^'.$markafterid.'_';
|
$keyfilter3='^'.$deleteafterid.'_';
|
||||||
$keyfilter4='_'.$markafterid.'_';
|
$keyfilter4='_'.$deleteafterid.'_';
|
||||||
foreach($this->users as $key => $val)
|
foreach($this->users as $key => $val)
|
||||||
{
|
{
|
||||||
if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath'])
|
if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath'])
|
||||||
@ -2325,7 +2325,7 @@ class User extends CommonObject
|
|||||||
$this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname'];
|
$this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname'];
|
||||||
$i=0; $cursor_user=$id_user;
|
$i=0; $cursor_user=$id_user;
|
||||||
|
|
||||||
while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) // Loop on each parent, one after one
|
while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user]))
|
||||||
{
|
{
|
||||||
$this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
|
$this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
|
||||||
$this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];
|
$this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user