delParam(SPN_FILESERVER_SHARE); include_once('modules/fileserver/FileServerManager.php'); $myFileServerManager =& FileServerManagerMaker(); include_once('modules/fileserver/FileServerSharesList.php'); $myFileServerSharesList = new FileServerSharesList(); $pathbar->setPage('fileserver'); $pathbar->set(); switch ($cmd = get_gpc('cmd')) { case false: break; case 'remove': $del = get_gpc('del'); if (!is_array($del) || !count($del)) { alert(lmsg('fileserver__shares_remove_empty_selection')); go_to_uplevel(); } foreach ($del AS $n => $sid) { include_once('modules/fileserver/FileServerShare.php'); $myFileServerShare = new FileServerShare($sid); if ($myFileServerShare->error()) psaerror('Unable to create FileServerShare object: ' . $myFileServerShare->getErrorMsg()); $without_restart = count($del) - 1 > $n; // restart samba server only if delete last share in selection if (!$myFileServerShare->delete($without_restart)) psaerror('FileServerShare::delete() failed: ' . $myFileServerShare->getErrorMsg()); } break; default: if (!$myFileServerSharesList->setFSP($cmd)) psaerror('Invalid cmd: ' . $cmd); } if (!$myFileServerSharesList->init()) psaerror('FileServerSharesList::init() failed: ' . $myFileServerSharesList->getErrormsg()); include_once('modules/fileserver/FileServerSharesForm.php'); $myFileServerSharesForm = new FileServerSharesForm(); if ($myFileServerSharesForm->error()) psaerror('Unable to create FileServerSharesForm object: ' . $myFileServerSharesForm->getErrorMsg()); if (false === $myFileServerSharesForm->define()) psaerror('FileServerSharesForm::define() failed: ' . $myFileServerSharesForm->getErrorMsg()); if (false === $myFileServerSharesForm->assign($myFileServerSharesList)) psaerror('FileServerSharesForm::assign() failed: ' . $myFileServerSharesForm->getErrorMsg()); if (false === $myFileServerSharesForm->parse()) psaerror('FileServerSharesForm::parse() failed: ' . $myFileServerSharesForm->getErrorMsg()); if (false === $myFileServerSharesForm->FastPrint()) psaerror('FileServerSharesForm::FastPrint() failed: ' . $myFileServerSharesForm->getErrorMsg()); ?>