summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c47f907)
raw | patch | inline | side by side (parent: c47f907)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jun 2006 04:50:05 +0000 (04:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jun 2006 04:50:05 +0000 (04:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3687 594d385d-05f5-0310-b6e9-bd551577e9d8
15 files changed:
diff --git a/plugins/admin/systems/class_goCupsServer.inc b/plugins/admin/systems/class_goCupsServer.inc
index c926db6e1f1d7a0bf160eae14f30c5b9f6be5a67..8d3c0065f71a6b167a827990f464e2d0230cf250 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->cat($this->dn,array("objectClass"));
-
if($ldap->count()){
- $attrs =array();
+
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goCupsServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goCupsServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
function check()
{
$message = plugin::check();
diff --git a/plugins/admin/systems/class_goFaxServer.inc b/plugins/admin/systems/class_goFaxServer.inc
index ff8805b10f9bd6eb36e3adbbd28131fbf70324d3..2fec5525977e5dc8b7597af6dd272e88f847e070 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goFaxAdmin", "goFaxPassword"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goFaxAdmin", "goFaxPassword") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goFaxServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goFaxServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
diff --git a/plugins/admin/systems/class_goFonServer.inc b/plugins/admin/systems/class_goFonServer.inc
index adb0d55f8b45efa950366a006c785b9346b82e30..cdb123bde763191c7e70db472b3b409743a6ffcf 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goFonAdmin", "goFonAreaCode", "goFonCountryCode","goFonPassword"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goFonAdmin", "goFonAreaCode", "goFonCountryCode","goFonPassword") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goFonServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goFonServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
function check()
{
$message = plugin::check();
diff --git a/plugins/admin/systems/class_goGlpiServer.inc b/plugins/admin/systems/class_goGlpiServer.inc
index 36caf5c92820010fe00f4f6a2c6307bf3a63f5e5..ce7569dfeb53b94043b8e0e65b324334d71cd556 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goGlpiAdmin","goGlpiDatabase"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goGlpiAdmin","goGlpiDatabase") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goGlpiServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goGlpiServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
diff --git a/plugins/admin/systems/class_goImapServer.inc b/plugins/admin/systems/class_goImapServer.inc
index 301a2dd8721b49258e180e4344cafde733554c1a..56d658bab5cbb17314c802bb3e3c15ab9460f1ce 100644 (file)
}
$smarty->assign("Actions",$this->Actions);
$smarty->assign("is_new",$this->dn);
+ $smarty->assign("is_acc",$this->initially_was_account);
return($smarty->fetch(get_template_path("goImapServer.tpl",TRUE,dirname(__FILE__))));
}
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goImapName","goImapConnect","goImapAdmin","goImapPassword"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goImapName","goImapConnect","goImapAdmin","goImapPassword") as $required){
- if(!isset($attrs[$required])){
- if(empty($this->$required)){
- print_red(_("Can't set new status while there are blank option within generic configuration part."));
- return;
- }else{
- $attrs[$required] = $this->$required;
- }
- }else{
- $attrs[$required] = $attrs[$required][0];
- }
- }
-
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
}
- if(!in_array("goImapServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goImapServer";
- }
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
diff --git a/plugins/admin/systems/class_goKrbServer.inc b/plugins/admin/systems/class_goKrbServer.inc
index ca2bc66f58465cb56bce350bc2122af5d64e370b..34dd98309bf6bd40a1cfe7334fca303095048119 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goKrbRealm","goKrbAdmin","goKrbPassword"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goKrbRealm","goKrbAdmin","goKrbPassword") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goKrbServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goKrbServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
-
+
+
function check()
{
$message = plugin::check();
diff --git a/plugins/admin/systems/class_goLdapServer.inc b/plugins/admin/systems/class_goLdapServer.inc
index f5a28488279f392a2ba41abfb1267ebc6ca3c4d4..885970ac03bfdbc20dd5c014d424f9980fddec48 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goLdapBase"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goLdapBase") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goLdapServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goLdapServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
diff --git a/plugins/admin/systems/class_goLogDBServer.inc b/plugins/admin/systems/class_goLogDBServer.inc
index a857050092163844dcccf2fa15dbf223fefa4c0d..47d132b199e95e55e486e586b6167907e6434994 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goLogAdmin","goLogPassword"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goLogAdmin","goLogPassword") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goLogDBServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goLogDBServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
function check()
{
$message = plugin::check();
diff --git a/plugins/admin/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc
index 8afd4dda024a3274e20c69e5f30dc16a50b1d751..701428b02831b8900dd6dc1e0b98c8ebd3d0a2b7 100644 (file)
$this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
SERVICE_STARTED => SERVICE_STARTED,
- SERVICE_RESTARTED=>SERVICE_RESTARTED,
- "mailqueue"=>"mailqueue");
+ SERVICE_RESTARTED=>SERVICE_RESTARTED);
/* Fill RestrictionFilters TransportProtocols from external hooks */
$str = $this->config->data['TABS']['SERVERSERVICE'];
$smarty->assign("is_new", $this->dn);
+ $smarty->assign("is_acc", $this->initially_was_account);
$smarty->assign("TransportProtocols", $this->TransportProtocols);
$smarty->assign("Actions", $this->Actions);
$smarty->assign("RestrictionFilters", $this->RestrictionFilters);
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->cat($this->dn,array("objectClass"));
-
if($ldap->count()){
- $attrs =array();
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
}
- if(!in_array("goMailServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goMailServer";
- }
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
diff --git a/plugins/admin/systems/class_goNtpServer.inc b/plugins/admin/systems/class_goNtpServer.inc
index 9188acf3fa6e5e4487f6eecadc49d737029875cd..fa6e11c072eddfef8b5f9071b937bfa7f227f118 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->cat($this->dn,array("objectClass"));
-
if($ldap->count()){
- $attrs =array();
+
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goNtpServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goNtpServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
+
function check(){ return array();}
function save_object(){;}
diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc
index 7911dcb0e4687ae4fe5c2f71f257617e8b94fece..3a00600e66a5e40ce855e5401e96ba69061cf61c 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->cat($this->dn,array("objectClass"));
-
if($ldap->count()){
- $attrs =array();
- foreach(array() as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goShareServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goShareServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc
index f3481a47c0f55c5e9a65b0b54aefe841d2abd9e1..7bb179adf80410898a025e22603e5b9c675342cc 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->cat($this->dn,array("objectClass"));
-
if($ldap->count()){
- $attrs =array();
+
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goSyslogServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goSyslogServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
function check()
{
$message = plugin::check();
diff --git a/plugins/admin/systems/class_goTerminalServer.inc b/plugins/admin/systems/class_goTerminalServer.inc
index a9d2d59637e8c68c3c8a81cb4ec6e3b3e5e562e3..48f01b4f765868962df2c575d053ef6e9c8c4bbe 100644 (file)
function setStatus($value)
{
if($value == "none") return;
+ if(!$this->initially_was_account) return;
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->cat($this->dn,array("objectClass","goXdmcpIsEnabled", "goFontPath"));
-
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()){
- $attrs =array();
- foreach(array("goXdmcpIsEnabled", "goFontPath") as $req) {
- if(!isset($attrs[$req])){
- if(empty($this->$req)){
- print_red(sprintf(_("The required attribute '%s' is not set."),$req));
- }else{
- $attrs[$req] = $this->$req;
- }
- }else{
- $attrs[$req] = $attrs[$req][0];
- }
- }
$tmp = $ldap->fetch();
for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
$attrs['objectClass'][] = $tmp['objectClass'][$i];
- }
- if(!in_array("goTerminalServer",$attrs['objectClass'])){
- $attrs['objectClass'][] = "goTerminalServer";
}
-
$flag = $this->StatusFlag;
$attrs[$flag] = $value;
$this->$flag = $value;
$ldap->modify($attrs);
show_ldap_error($ldap->get_error());
- }
+ }
}
-
+
function check()
{
$message = plugin::check();
index 6c2e1fce94b55bb1f96bc3b3adf405a035c22b61..8381540be9d65a1375e5c745f7d9c925adb901d9 100644 (file)
</table>
<p class='seperator'> </p>
<br>
+<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
{if $is_new == "new"}
{t}The server must be saved before you can use the status flag.{/t}
+{elseif !$is_acc}
+ {t}The service must be saved before you can use the status flag.{/t}
{/if}
<br>
-<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
-<select name="action" title='{t}{/t}' {if $is_new =="new"} disabled {/if}>
+<select name="action" title='{t}{/t}'
+ {if $is_new =="new" || !$is_acc} disabled {/if}
+>
<option value="none"> </option>
{html_options options=$Actions}
</select>
-<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' {if $is_new == "new"} disabled {/if}>
+<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}'
+ {if $is_new == "new" | !$is_acc} disabled {/if}
+>
<p class="seperator"> </p>
<p>
index a53e0a83d7883ca015c256c658a7f54b1b7f955d..edd533f200a52f544a1e1eacbd5bde3f48723f9c 100644 (file)
<p class='seperator'> </p>
<br>
+<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
{if $is_new == "new"}
{t}The server must be saved before you can use the status flag.{/t}
+{elseif !$is_acc}
+ {t}The service must be saved before you can use the status flag.{/t}
{/if}
<br>
-<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
-<select name="action" title='{t}{/t}' {if $is_new == "new"} disabled {/if}>
+<select name="action" title='{t}{/t}'
+ {if $is_new == "new" || $is_acc == false} disabled {/if}
+>
<option value="none"> </option>
{html_options options=$Actions}
</select>
-<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' {if $is_new == "new"} disabled {/if}>
+<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}'
+ {if $is_new == "new" || $is_acc == false} disabled {/if}
+>
<p class="seperator"> </p>
<p>