$samba['enabled'], 'shares'=>$samba['shares']]; $creds=bg_samba_credentials_summary(); $output=''; if($_SERVER['REQUEST_METHOD']==='POST'){ csrf_validate(); $a=$_POST['action']??''; if($a==='save'){ $enabled=!empty($_POST['enabled']); $shares=bg_normalize_lines($_POST['shares']??''); $r=bg_samba_save_config($enabled, $shares); bg_flash(($r['code']??1)===0?'success':'warning', ($r['code']??1)===0?'Samba configuration saved in ~/.config/BastionGuard/samba.conf.':($r['output']??'Samba save error.')); bg_redirect('samba.php'); } elseif($a==='scan'){ $path=trim($_POST['path']??''); if($path==='') $output='Invalid path.'; else { $res=bg_samba_scan_privileged($path); $output=($res['output']??'')."\n\nExit code: ".($res['code']??'?'); } } } include 'includes/header.php'; include 'includes/sidebar.php'; ?>
Reads and saves the real desktop UI file: = bg_e($samba['path']) ?>.
Read method: = bg_e($samba['read']['via'] ?? 'direct') ?> · File status: = !empty($samba['read']['exists']) ? 'present' : 'missing' ?>
| Share | Credentials | |
|---|---|---|
= bg_e($s) ?> | user = bg_e($cr['user']) ?>none |
No share configured in the Samba file.
File: = bg_e($creds['path']) ?> via = bg_e($creds['read']['via'] ?? 'direct') ?>. Passwords are not displayed.
= bg_e($share) ?>No SMB credentials in cred.conf.