From 8205a0e1b5c376220e45f4f4a1debdef310d6202 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <ldestailleur@teclib.com>
Date: Mon, 11 Aug 2014 10:50:08 +0200
Subject: [PATCH] Fix: Better comment and var name

---
 htdocs/user/class/user.class.php | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 60a7648be35..df4128ba747 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2222,10 +2222,10 @@ class User extends CommonObject
 	 *				fullname = nom avec chemin complet du user
 	 *				fullpath = chemin complet compose des id
 	 *
-	 *  @param      int		$markafterid      Removed all users including the leaf $markafterid in user tree.
-	 *	@return		array		      		  Array of users. this->users and this->parentof are set.
+	 *  @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.
 	 */
-	function get_full_tree($markafterid=0)
+	function get_full_tree($deleteafterid=0)
 	{
 		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)
 		}
 
-		// Exclude leaf including $markafterid from tree
-		if ($markafterid)
+		// Exclude leaf including $deleteafterid from tree
+		if ($deleteafterid)
 		{
-			//print "Look to discard user ".$markafterid."\n";
-			$keyfilter1='^'.$markafterid.'$';
-			$keyfilter2='_'.$markafterid.'$';
-			$keyfilter3='^'.$markafterid.'_';
-			$keyfilter4='_'.$markafterid.'_';
+			//print "Look to discard user ".$deleteafterid."\n";
+			$keyfilter1='^'.$deleteafterid.'$';
+			$keyfilter2='_'.$deleteafterid.'$';
+			$keyfilter3='^'.$deleteafterid.'_';
+			$keyfilter4='_'.$deleteafterid.'_';
 			foreach($this->users as $key => $val)
 			{
 				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'];
 		$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]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];
-- 
GitLab