$input_errors[]=sprintf(gettext("Attention: the used XigmaNAS platform '%s' is not recommended for extensions! After a reboot all extensions will no longer be available, use XigmaNAS embedded or full platform instead!"),$platform);
$path_check=explode("/",$path);// split path to get directory names
$path_elements=count($path_check);// get path depth
$fp=substr(sprintf('%o',fileperms("/$path_check[1]/$path_check[2]")),-1);// get mountpoint permissions for others
if($fp>=5){// transmission needs at least read & search permission at the mountpoint
$directory="/$path_check[1]/$path_check[2]";// set to the mountpoint
for($i=3;$i<$path_elements-1;$i++){// traverse the path and set permissions to rx
$directory=$directory."/$path_check[$i]";// add next level
exec("chmod o=+r+x \"$directory\""); // set permissions to o=+r+x
}
$path_elements=$path_elements-1;
$directory=$directory."/$path_check[$path_elements]";// add last level
exec("chmod 775 {$directory}");// set permissions to 775
exec("chown {$_POST['who']}{$directory}*");
}
else
{
$input_errors[]=sprintf(gettext("%s needs at least read & execute permissions at the mount point for directory %s! Set the Read and Execute bits for Others (Access Restrictions | Mode) for the mount point %s (in <a href='disks_mount.php'>Disks | Mount Point | Management</a> or <a href='disks_zfs_dataset.php'>Disks | ZFS | Datasets</a>) and hit Save in order to take them effect."),$application,$path,"/{$path_check[1]}/{$path_check[2]}");
$input_errors[]=gettext("The common directory for all extensions MUST be set to a directory below <b>'/mnt/'</b> to prevent to loose the extensions after a reboot on embedded systems!");
<?phphtml_filechooser("storage_path",gettext("Common directory"),$pconfig['storage_path'],gettext("Common directory for all extensions (a persistant place where all extensions are/should be - a directory below <b>/mnt/</b>)."),$pconfig['storage_path'],true,60);?>
<?phphtml_checkbox("path_check",gettext("Path check"),$pconfig['path_check'],gettext("If this option is selected no examination of the common directory path will be carried out (whether it was set to a directory below /mnt/)."),"<b><font color='red'>".gettext("Please use this option only if you know what you are doing!")."</font></b>",false);?> </table>