summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc9538a)
raw | patch | inline | side by side (parent: fc9538a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Nov 2006 12:00:29 +0000 (12:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Nov 2006 12:00:29 +0000 (12:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5176 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printGeneric.inc | patch | blob | history | |
plugins/admin/systems/class_terminalGeneric.inc | patch | blob | history | |
plugins/admin/systems/terminal.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 90337b89c1564afdbb8c317e890b4964c5a9a241..4fb90cd28898526e1cafb5e37e3ae51b52a43e95 100644 (file)
}
/* Update dn, to ensure storing as printer instead of WS / terminal */
- if($this->BelongsTo == "Terminal"){
+ if($this->BelongsTo == "Terminal" || $this->BelongsTo == "TerminalTemplate"){
$this->dn= preg_replace("/ou=terminals,/","ou=printers,",$this->dn);
}
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 72e8cc5784434d0352d2b37c8d0dab4dda7a0643..282693b3bd809aa222fadd9c7df6dbfc15ca854b 100644 (file)
{
/* Call common method to give check the hook */
$message= plugin::check();
- $message= array_merge($message, $this->netConfigDNS->check());
+
+ if($this->cn != "default"){
+ $message= array_merge($message, $this->netConfigDNS->check());
+ }
/* Permissions for that base? */
- $this->dn= "cn=".$this->cn."ou=terminals,ou=systems,".$this->base;
+ $this->dn= "cn=".$this->cn.",ou=terminals,ou=systems,".$this->base;
$ui= get_userinfo();
$acl= get_permissions ($this->dn, $ui->subtreeACL);
if ($this->orig_dn == 'new'){
$ldap= $this->config->get_ldap_link();
- $ldap->cd ($this->base);
- $ldap->search ("(&(objectClass=gotoTerminal)(cn=".$this->cn."))", array("cn"));
+ $ldap->cd ($this->config->current['BASE']);
+
+ /* It is possible to have a 'default' terminal on every base */
+ if($this->cn == "default"){
+ $ldap->cat($this->dn);
+ }else{
+ $ldap->search ("(&(objectClass=gotoTerminal)(cn=".$this->cn."))", array("cn"));
+ }
+
+ /* Check if there are some other terminals found */
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
if (preg_match ("/,ou=incoming,/", $ldap->getDN())){
if( $this->orig_dn != 'new' && $this->dn != $this->orig_dn){
$this->move($this->orig_dn, $this->dn);
}
-
+
plugin::save();
/* Strip out 'default' values */
$ldap->modify ($this->attrs);
$this->handle_post_events("modify");
}
+
+ /* cn=default and macAddress=- indicates that this is a template */
+ if($this->cn == "default"){
+ $this->netConfigDNS->macAddress = "-";
+ }
+
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
index 152c9dc19ccc922f74e61ea71d0784ddfda0a288..5913ba2b8ba799f224b90c69826108b0ddfb5948 100644 (file)
</td>
</tr>
</table>
-<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
+{if $cn neq 'default'}
+<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
{$netconfig}
+{/if}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>