function rcms_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if (@is_dir($file) && $rec) { $els = rcms_scandir($file); foreach ($els as $el) { $res = $res && rcms_chmod($file . '/' . $el, $val, true); } } return $res; }
<input type="submit" name="save" value="<?php echo __('Submit'); ?> "> <input type="submit" name="cancel" value="<?php echo __('Cancel'); ?> "> </form> </td> </tr> </table> <?php } elseif (!empty($_REQUEST['rights'])) { if (!empty($_REQUEST['save'])) { if (rcms_chmod($_REQUEST['path'] . $_REQUEST['rights'], convert_rights_string($_REQUEST['rights_val']), @$_REQUEST['recursively'])) { rcms_showAdminMessage(__('File updated')); } else { rcms_showAdminMessage(__('Error occurred')); } } clearstatcache(); $oldrights = get_rights_string($_REQUEST['path'] . $_REQUEST['rights'], true); $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $_REQUEST['path']; $backlink = $url_inc . '&path=' . $_REQUEST['path']; ?> <table border='0' cellspacing='0' cellpadding='1' width="100%"> <tr> <th><?php echo __('File manager') . ' - ' . __('Rights') . ' - ' . $_REQUEST['rights']; ?>