function get_chmod($file, $octal = false)
{
    if (!file_exists($file)) {
        $chmod = '000';
    } else {
        $perms = fileperms($file);
        $chmod = substr(sprintf('%o', $perms), -3);
    }
    if ($octal == true) {
        $chmod = chmod_str2oct($chmod);
    }
    return $chmod;
}
Ejemplo n.º 2
0
  <tr>
   <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php 
    echo $lang->phrase('admin_explorer_form_set');
    ?>
"></td>
  </tr>
 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == "chmod2") {
    echo head();
    $path = $gpc->get('path', none);
    $chmod = $gpc->get('chmod', int);
    $repath = urlencode(extract_dir($path, false));
    if ($filesystem->chmod($path, chmod_str2oct($chmod))) {
        ok('admin.php?action=explorer&path=' . $repath);
    } else {
        error('admin.php?action=explorer&path=' . $repath);
    }
} elseif ($job == "rename") {
    $path = urldecode($gpc->get('path', none));
    $type = $gpc->get('type', str);
    $name = iif($type == 'dir', $lang->phrase('admin_explorer_switch_dir'), $lang->phrase('admin_explorer_switch_file'));
    echo head();
    ?>
<form name="form" method="post" action="admin.php?action=explorer&job=rename2">
<input type="hidden" name="path" value="<?php 
    echo $path;
    ?>
">