Changeset 1727
- Timestamp:
- 08/28/06 14:13:38 (2 years ago)
- Files:
-
- alternc/trunk/bureau/class/m_bro.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
alternc/trunk/bureau/class/m_bro.php
r1723 r1727 96 96 if (substr($dir,0,strlen($root))!=$root) { 97 97 return false; 98 } if ($strip) { 98 } 99 if ($strip) { 99 100 $dir=substr($dir,strlen($root)); 100 101 } else { … … 259 260 */ 260 261 function CreateDir($dir,$file) { 261 global $db,$cuid; 262 $absolute=$this->convertabsolute($dir,0); 262 global $db,$cuid,$err; 263 263 $file=ssla($file); 264 if (!file_exists($absolute."/".$file)) { 265 mkdir($absolute."/".$file,00777); 266 } 267 $db->query("UPDATE browser SET crff=1 WHERE uid='$cuid';"); 264 $absolute=$this->convertabsolute($dir."/".$file,0); 265 if ($absolute && !file_exists($absolute)) { 266 mkdir($absolute,00777); 267 $db->query("UPDATE browser SET crff=1 WHERE uid='$cuid';"); 268 return true; 269 } else { 270 $err->raise("bro",1); 271 return false; 272 } 268 273 } 269 274 … … 276 281 function CreateFile($dir,$file) { 277 282 global $db,$err,$cuid; 278 $absolute=$this->convertabsolute($dir,0);279 if (!$absolute) {280 $err->raise("bro",1);281 return false;282 }283 283 $file=ssla($file); 284 //force la création au niveau de $dir uniquement 285 $file = dir_local($file); 286 if (!file_exists($absolute."/".$file)) { 287 touch($absolute."/".$file); 288 } 289 $db->query("UPDATE browser SET crff=0 WHERE uid='$cuid';"); 284 $absolute=$this->convertabsolute($dir."/".$file,0); 285 if ($absolute && !file_exists($absolute)) { 286 touch($absolute); 287 $db->query("UPDATE browser SET crff=0 WHERE uid='$cuid';"); 288 return true; 289 } else { 290 $err->raise("bro",1); 291 return false; 292 } 290 293 } 291 294
