function chmod_processor($name, $data) { if(is_dir($name)) $_SESSION['DIRS']++; else $_SESSION['FILES']++; return d_chmod($name, $data['chmod']); }
session_write_close(); $_RESULT = exec_command($_REQUEST['cmd']); break; case 'get_rights': $_RESULT = d_get_rights($f); break; case 'set_rights': if(!$_REQUEST['recursive']) { $_RESULT = true; //array_display($_REQUEST); foreach($fz as $v) { if(!d_chmod($v, trim($_REQUEST['mod']))) $_RESULT=false; } if(!$_RESULT) echo 'Could not change file rights.'.reason(); }else { if(empty($_SESSION['CHCACHE']) || $_SESSION['CHFILEZ']!=$fz) /* CHmod Cache */ { $_SESSION['DIRS'] = $_SESSION['FILES'] = 0; $_SESSION['CHCACHE'] = multipart_begin(array( 'basedir' => dirname($fz[0]), 'files' => array_map('basename', $_SESSION['CHFILEZ'] = $fz), 'processors' => array('chmod_processor'), 'data' => array('chmod' => trim($_REQUEST['mod'])) ));