diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index 7b55449d99a83782c77be1c85c6586d0da3c75bc..fc2ce9d6095333faa52b59a352e0bd8556558ace 100644 (file)
var $goFonMSN = "";
var $selected_categorie = 0;
var $netConfigDNS;
+ var $view_logged = FALSE;
/* attribute list for save action */
var $attributes= array("cn", "description",
/* Save dn for later references */
$this->orig_dn= $this->dn;
-
- if($this->is_account){
- @log::log("view","phone/".get_class($this),$this->dn);
- }
}
function set_acl_base($base)
function execute()
{
- /* Call parent execute */
- plugin::execute();
+ /* Call parent execute */
+ plugin::execute();
+
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","phone/".get_class($this),$this->dn);
+ }
/* Do we represent a valid phone? */
if (!$this->is_account && $this->parent == NULL){
$this->netConfigDNS->remove_from_parent();
$ldap->rmdir($this->dn);
- @log::log("remove","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("remove","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
show_ldap_error($ldap->get_error(), sprintf(_("Removing of system phone/generic with dn '%s' failed."),$this->dn));
$this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
$ldap->search ("(cn=".$this->cn.")", array("cn"));
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
+
+ if(preg_match("/cn=dhcp,/",$attrs['dn'])){
+ continue;
+ }
+
if ($attrs['dn'] != $this->orig_dn){
$message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
break;
/* only to define which attrs to save*/
- $mode = $this->attrs['selected_categorie'];
+ $mode = $this->selected_categorie;
/* Remove all unwanted attrs */
foreach($this->attributes as $att){
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
$ldap->cd($this->dn);
$ldap->add($this->attrs);
- @log::log("create","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("create","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
$this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
} else {
if ($this->orig_dn != $this->dn){
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
- @log::log("modify","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ new log("modify","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
// $user_phone_reload
$ldap->cd ($this->config->current['BASE']);
}
+ /* Display generic part for server copy & paste */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn" ,$this->cn);
+ $smarty->assign("object","phone");
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = $_POST['cn'];
+ }
+ }
+
+
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ if(isset($source['macAddress'][0])){
+ $this->netConfigDNS->macAddress = $source['macAddress'][0];
+ }
+ if(isset($source['ipHostNumber'][0])){
+ $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
+ }
+
+ $source_o = new phonegeneric($this->config, $source['dn']);
+ $this->selected_categorie = $source_o->selected_categorie;
+ }
+
+
/* Return plugin informations for acl handling
#FIXME FAIscript seams to ununsed within this class... */
function plInfo()