summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 850372f)
raw | patch | inline | side by side (parent: 850372f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 Jun 2007 10:38:08 +0000 (10:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 Jun 2007 10:38:08 +0000 (10:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6561 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_CopyPasteHandler.inc | patch | blob | history | |
plugins/admin/users/class_userManagement.inc | patch | blob | history |
index 425f2a08f6283d586cc35f339e070685998672ab..83ecc51d91e7e7509267afa1eb65ee9cd554a8c8 100644 (file)
/* Paste one entry from queue */
- function paste_entries()
+ function load_entry_from_queue()
{
/* Save posted variables, handle dialog posts like 'cancel' */
$this->current = $entry;
unset($this->queue[$key]);
}
-
- return($this->execute());
}
$this->current['object']->save();
$this->lastdn = $this->current['object']->dn;
$this->current =FALSE;
+
+ /* Load next queue entry */
+ $this->load_entry_from_queue();
}
}
if($this->current){
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 0d8adba855935651c6fba664503434dfdc53aebe..e9fc05ba62c8ad2040f000a56858a35cb36451ac 100644 (file)
$s_tab = "user";
}
- /* Display the copy & paste dialog, if it is currently open */
- $ret = $this->copyPasteHandling_from_queue($s_action);
- if($ret){
- return($ret);
- }
-
-
- /********************
- Edit existing entry
- ********************/
-
- /* User wants to edit data? */
- if (($s_action=="edit") && (!isset($this->usertab->config))){
-
- /* Get 'dn' from posted 'uid', must be unique */
- $this->dn= $this->list[trim($s_entry)]['dn'];
-
- /* Check locking, save current plugin in 'back_plugin', so
- the dialog knows where to return. */
- if (($user= get_lock($this->dn)) != ""){
- return(gen_locked_message ($user, $this->dn));
- }
-
- /* Lock the current entry, so everyone will get the
- above dialog */
- add_lock ($this->dn, $this->ui->dn);
-
- /* Register usertab to trigger edit dialog */
- $this->usertab= new usertabs($this->config,
- $this->config->data['TABS']['USERTABS'], $this->dn);
-
- /* Switch tab, if it was requested by the user */
- $this->usertab->current = $s_tab;
-
- /* Set ACL and move DN to the headline */
- $this->usertab->set_acl_base($this->dn);
- $_SESSION['objectinfo']= $this->dn;
- }
-
/********************
- Edit canceled
+ Copy & Paste
********************/
- /* Reset all relevant data, if we get a _cancel request */
- if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
- if (isset($this->usertab)){
- del_lock ($this->usertab->dn);
- unset ($this->usertab);
+ /* Display the copy & paste dialog, if it is currently open */
+ if($this->CPPasswordChange == ""){
+ $ret = $this->copyPasteHandling_from_queue($s_action);
+ if($ret){
+ return($ret);
}
- $this->usertab= NULL;
- $this->lognames= array();;
- $this->sn= "";
- $this->givenName= "";
- $this->uid= "";
- unset ($_SESSION['objectinfo']);
}
if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){
exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr);
}
-
new log("modify","users/".get_class($this),$this->dn,array(),"Password has been changed");
}
} else {
}
+ /********************
+ Edit existing entry
+ ********************/
+
+ /* User wants to edit data? */
+ if (($s_action=="edit") && (!isset($this->usertab->config))){
+
+ /* Get 'dn' from posted 'uid', must be unique */
+ $this->dn= $this->list[trim($s_entry)]['dn'];
+
+ /* Check locking, save current plugin in 'back_plugin', so
+ the dialog knows where to return. */
+ if (($user= get_lock($this->dn)) != ""){
+ return(gen_locked_message ($user, $this->dn));
+ }
+
+ /* Lock the current entry, so everyone will get the
+ above dialog */
+ add_lock ($this->dn, $this->ui->dn);
+
+ /* Register usertab to trigger edit dialog */
+ $this->usertab= new usertabs($this->config,
+ $this->config->data['TABS']['USERTABS'], $this->dn);
+
+ /* Switch tab, if it was requested by the user */
+ $this->usertab->current = $s_tab;
+
+ /* Set ACL and move DN to the headline */
+ $this->usertab->set_acl_base($this->dn);
+ $_SESSION['objectinfo']= $this->dn;
+ }
+
+
+ /********************
+ Edit canceled
+ ********************/
+
+ /* Reset all relevant data, if we get a _cancel request */
+ if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
+ if (isset($this->usertab)){
+ del_lock ($this->usertab->dn);
+ unset ($this->usertab);
+ }
+ $this->usertab= NULL;
+ $this->lognames= array();;
+ $this->sn= "";
+ $this->givenName= "";
+ $this->uid= "";
+ unset ($_SESSION['objectinfo']);
+ }
+
+
/********************
Delete MULTIPLE entries requested, display confirm dialog
********************/
function copyPasteHandling_from_queue($s_action)
{
+
+ /* Add entries to queue */
if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
/* Cleanup object queue */
}
}
+ /* Start pasting entries */
if($s_action == "editPaste"){
$this->start_pasting_copied_objects = TRUE;
}
/* Return C&P dialog */
- if($this->start_pasting_copied_objects &&
- ($this->CopyPasteHandler->entries_queued() || $this->CopyPasteHandler->current)){
+ if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
+ /* Load entry from queue and set base */
+ $this->CopyPasteHandler->load_entry_from_queue();
$this->CopyPasteHandler->SetVar("base",$this->DivListUsers->selectedBase);
- $data = $this->CopyPasteHandler->paste_entries();
+
+ /* Get dialog */
+ $data = $this->CopyPasteHandler->execute();
/* Set CPPasswordChange to s_entry which indicates that this entry requires a new password. */
if(isset($_POST['passwordTodo']) && ($_POST['passwordTodo'] == "new")){
}
/* Return dialog data */
- if(!empty($data)){
+ if(!empty($data) && $this->CPPasswordChange == ""){
return($data);
}
}
-
- $this->start_pasting_copied_objects = FALSE;
+
+ /* Automatically disable status for pasting */
+ if(!$this->CopyPasteHandler->entries_queued()){
+ $this->start_pasting_copied_objects = FALSE;
+ }
return("");
}