diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc
index c624e5e0b54d311c72175bdd182fd693c6308b35..e2ad949f9e9e3bbf633b2f68ae2bd02f59d171dd 100644 (file)
class servservice extends plugin
{
class servservice extends plugin
{
- /* CLI vars */
- var $cli_summary= "Manage server basic objects";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
var $goExportEntry = array();
var $goExportEntryList= array();
var $goTimeSource = array();
var $goExportEntry = array();
var $goExportEntryList= array();
var $goTimeSource = array();
var $mounts_to_remove = array();
var $oldone = NULL; //temp dave for old mount entry
var $mounts_to_remove = array();
var $oldone = NULL; //temp dave for old mount entry
- function servservice ($config, $dn= NULL)
+ function servservice ($config, $dn= NULL, $parent= NULL)
{
{
- plugin::plugin ($config, $dn);
+ plugin::plugin ($config, $dn, $parent);
$ldap = $this->config->get_ldap_link();
$avl_objectclasses = $ldap->get_objectclasses();
$ldap = $this->config->get_ldap_link();
$avl_objectclasses = $ldap->get_objectclasses();
}
function deleteFromList($id){
}
function deleteFromList($id){
- unset($this->goExportEntryList[$id]);
+ /* Check if the share is used by someone */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=*|$id|*))", array("cn"));
+ $cnt= $ldap->count();
+ if ($cnt){
+ $msg= sprintf(_("The share can't be removed since it is still used by %d users:"), $cnt);
+ $msg.= "<br><br><ul>";
+ while ($attrs= $ldap->fetch()){
+ $msg.= "<li>".$attrs["cn"][0]."</li>";
+ }
+ $msg.= "</ul>"._("Please correct the share-/profile settings of these users");
+ print_red($msg);
+
+ } else {
+ /* Finally remove it */
+ unset($this->goExportEntryList[$id]);
+ }
}
function addToMountList($entry) {
}
function addToMountList($entry) {
$smarty= get_smarty();
$smarty->assign("staticAddress", "");
$smarty= get_smarty();
$smarty->assign("staticAddress", "");
- if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList']))){
+ if((isset($_POST['DelNfsEnt'])) && (isset($_POST['goExportEntryList'])) && chkacl($this->acl,"goExportEntry") == ""){
if($this->allow_mounts){
foreach($_POST['goExportEntryList'] as $entry){
$this->deleteFromMountList($this->goExportEntryList[$entry]);
if($this->allow_mounts){
foreach($_POST['goExportEntryList'] as $entry){
$this->deleteFromMountList($this->goExportEntryList[$entry]);
}
}
}
}
- if(isset($_POST['NewNfsAdd'])){
+ if(isset($_POST['NewNfsAdd']) && chkacl($this->acl,"goExportEntry") == ""){
$this->oldone = NULL;
$this->o_subWindow = new servnfs($this->config,$this->acl, $this->allow_mounts, $this->dn);
$this->dialog = true;
}
$this->oldone = NULL;
$this->o_subWindow = new servnfs($this->config,$this->acl, $this->allow_mounts, $this->dn);
$this->dialog = true;
}
- if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntryList']))){
+ if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntryList'])) && chkacl($this->acl,"goExportEntry") == ""){
$entry = $this->goExportEntryList[$_POST['goExportEntryList'][0]];
$add_mount=isset($this->mounts_to_add[$entry]);
$this->oldone=$entry;
$entry = $this->goExportEntryList[$_POST['goExportEntryList'][0]];
$add_mount=isset($this->mounts_to_add[$entry]);
$this->oldone=$entry;
}
/* Here we add a new entry */
}
/* Here we add a new entry */
- if(isset($_POST['NewNTPAdd']) && $_POST['NewNTPExport'] != "") {
+ if(isset($_POST['NewNTPAdd']) && $_POST['NewNTPExport'] != "" && chkacl($this->acl,"goNtpServer") == "") {
$this->goTimeSource[$_POST['NewNTPExport']]= $_POST['NewNTPExport'];
asort($this->goTimeSource);
}
/* Deleting an Entry, is a bit more complicated than adding one*/
$this->goTimeSource[$_POST['NewNTPExport']]= $_POST['NewNTPExport'];
asort($this->goTimeSource);
}
/* Deleting an Entry, is a bit more complicated than adding one*/
- if(isset($_POST['DelNTPEnt'])) {
+ if(isset($_POST['DelNTPEnt']) && chkacl($this->acl,"goNtpServer") == "") {
foreach ($_POST['goTimeSource'] as $entry){
if (isset($this->goTimeSource[$entry])){
unset($this->goTimeSource[$entry]);
foreach ($_POST['goTimeSource'] as $entry){
if (isset($this->goTimeSource[$entry])){
unset($this->goTimeSource[$entry]);
$smarty->assign("goExportEntryACL", " disabled ");
}else{
$smarty->assign("goShareServerState", " ");
$smarty->assign("goExportEntryACL", " disabled ");
}else{
$smarty->assign("goShareServerState", " ");
- $smarty->assign("goExportEntryACL", " ");
+ $smarty->assign("goExportEntryACL", chkacl($this->acl, "goExportEntry"));
}
/* Different handling for checkbox */
}
/* Different handling for checkbox */
if (isset($_POST['servicetab'])){
$tmp = $this->goTimeSource;
if (isset($_POST['servicetab'])){
$tmp = $this->goTimeSource;
- if(isset($_POST['goLdapBase'])){
+ if(isset($_POST['goLdapBase']) && chkacl($this->acl,"goLdapBase") == ""){
$this->goLdapBase = $_POST['goLdapBase'];
$this->goLdapBase = $_POST['goLdapBase'];
- }
+ }
/* Save checkbox state */
foreach ($this->additionaloc as $oc => $dummy){
/* Save checkbox state */
foreach ($this->additionaloc as $oc => $dummy){
}
/* Save xdmcp is enabled flag */
}
/* Save xdmcp is enabled flag */
- if (isset($_POST['goXdmcpIsEnabled'])){
- $this->goXdmcpIsEnabled= "true";
- } else {
- $this->goXdmcpIsEnabled= "false";
+ if(chkacl($this->acl,"goXdmcpIsEnabled") == ""){
+ if (isset($_POST['goXdmcpIsEnabled'])){
+ $this->goXdmcpIsEnabled= "true";
+ } else {
+ $this->goXdmcpIsEnabled= "false";
+ }
}
/* Save xdmcp is enabled flag */
}
/* Save xdmcp is enabled flag */
- if (isset($_POST['goShareServer'])){
- $this->goShareServer = true;
- } else {
- $this->goShareServer = false;
+ if(chkacl($this->acl,"goExportEntry") == ""){
+ if (isset($_POST['goShareServer'])){
+ $this->goShareServer = true;
+ } else {
+ $this->goShareServer = false;
+ }
}
$this->goTimeSource = array();
$this->goTimeSource = $tmp;
}
$this->goTimeSource = array();
$this->goTimeSource = $tmp;