diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc
index 1d7364dfcde91299c5d09afa1c2f4fdfc2f62080..b6de303d1f4659fdc7efad4a0c2507f141c23bbe 100644 (file)
<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
define("LDAP_DUMP_PATH","/tmp/gosa");
/* Update folder permissions */
if(!@chmod(LDAP_DUMP_PATH,0700)){
- $msg= sprintf(_("Cannot cleanup copy & paste queue: setting permissions for '%s' failed!"),LDAP_DUMP_PATH);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("cannot set permission for '%s'"),LDAP_DUMP_PATH);
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all","copy & paste, event queue.",array(), $msg);
return(FALSE);
/* check if we are able to create a new file the given directory */
if(!is_writeable(LDAP_DUMP_PATH)){
- $msg= sprintf(_("Cannot cleanup copy & paste queue: no write permission inside '%s'!"),LDAP_DUMP_PATH);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("no write permission in '%s'"),LDAP_DUMP_PATH);
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all","copy & paste, event queue.",array(), $msg);
return(FALSE);
/* Check if given dn is valid and ldap search was succesfull */
if(!$res){
- $msg= sprintf(_("Copy and paste failed: object '%s' is not a valid ldap object!"), LDAP::fix($dn));
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("'%s' is no vaild LDAP object"), LDAP::fix($dn));
msg_dialog::display(_("Internal error"), $msg, ERROR_DIALOG);
new log("copy","all/all",$dn,array(), $msg);
return(FALSE);
/* check if we are able to create a new file the given directory */
if(!is_writeable($path)){
- $msg= sprintf(_("Cannot save LDAP dump: no write permission inside '%s'!"),LDAP_DUMP_PATH);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("no write permission in '%s'"),LDAP_DUMP_PATH);
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all",$dn,array(), $msg);
return(FALSE);
/* Update folder permissions */
if(!@chmod(LDAP_DUMP_PATH,0700)){
- $msg= sprintf(_("Cannot save LDAP dump: setting permissions for '%s' failed!"),LDAP_DUMP_PATH);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("cannot set permission for '%s'"),LDAP_DUMP_PATH);
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all","copy & paste, event queue.",array(), $msg);
return(FALSE);
/* Create file handle */
$fp = @fopen($path."/".$filename,"w+");
if(!$fp){
- $msg= sprintf(_("Cannot save LDAP dump: no write permission to '%s/%s'!"),$path,$filename);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("cannot open file '%s' for writing"), "$path/$filename");
msg_dialog::display(_("Configuration error"), $msg, ERROR_DIALOG);
new log("copy","all/all",$dn,array(), $msg);
return(FALSE);
}
return(unserialize($data));
}else{
- $msg= sprintf(_("Cannot load dumped file '%s'!"),$filename);
+ $msg= sprintf(_("Copy and paste failed!")."<br><br>"._("Error").": <i>"._("cannot open '%s' for reading"),$filename);
msg_dialog::display(_("Internal error"), $msg, ERROR_DIALOG);
new log("copy","all/all",$dn,array(), $msg);
return(FALSE);
*/
if(!isset($entry['object'])){
$entry = $this->load_entry_from_queue($entry);
- $entry = $this->_update_vars($entry);
$this->queue[$key] = $entry;
}
$msgs = $entry['object']->check();
/* Load next queue entry */
$this->current = $entry;
$this->lastdn = $this->current['object']->dn;
+ $this->current= $this->_update_vars($this->current);
$this->current['object']->save();
$this->current = FALSE;
}
/* Load next queue entry */
if(!count($msgs)){
$this->lastdn = $this->current['object']->dn;
+ $this->current= $this->_update_vars($this->current);
$this->current['object']->save();
$this->current = FALSE;
}else{
/* Display a list of all pastable entries
*/
if(count($this->clean_objects)){
- $dns = "";
- foreach($this->clean_objects as $entry){
- $dns .= $entry['dn']."\n";
- }
$smarty = get_smarty();
- $smarty->assign("type","cut");
+ $smarty->assign("type","directly");
$smarty->assign("Complete",false);
$smarty->assign("AttributesToFix"," ");
$smarty->assign("SubDialog","");
$smarty->assign("objectDN" ,$dns);
- $smarty->assign("message" , sprintf(_("You are going to paste the cutted entry '%s'."), "<pre>".$dns."</pre>"));
+ $smarty->assign("message" , sprintf(_("These objects will be pasted: %s"), "<br>".msgPool::buildList($this->clean_objects)));
return($smarty->fetch(get_template_path("copyPasteDialog.tpl",FALSE)));
}
}
if($this->current){
$smarty = get_smarty();
- $smarty->assign("type","copy");
+ $smarty->assign("type","modified");
$smarty->assign("Complete",false);
$smarty->assign("AttributesToFix",$this->generateAttributesToFix());
$smarty->assign("SubDialog",$this->current['object']->SubDialog);
$smarty->assign("objectDN",$this->current['source_data']['dn']);
- $smarty->assign("message", sprintf(_("You are going to paste the copied entry '%s'."), $this->current['source_data']['dn']));
+ $smarty->assign("message", sprintf(_("This object will be pasted: %s"), "<br><br>".$this->current['source_data']['dn']));
return($smarty->fetch(get_template_path("copyPasteDialog.tpl",FALSE)));
}
}
$Copy_Paste.= "<input type='image' name='editPaste' class='center'
src='".$img."' alt='"._("Paste")."'> ";
}else{
- $Copy_Paste.= "<img class='center' src='images/cant_editpaste.png' alt=\""._("Can't paste")."\"> ";
+ $Copy_Paste.= "<img class='center' src='images/cant_editpaste.png' alt=\""._("Cannot paste")."\"> ";
}
return ($Copy_Paste);
}