summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b3b86e6)
raw | patch | inline | side by side (parent: b3b86e6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 13 Jun 2006 08:36:10 +0000 (08:36 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 13 Jun 2006 08:36:10 +0000 (08:36 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3796 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/systems/class_SnapShotDialog.inc b/plugins/admin/systems/class_SnapShotDialog.inc
index 4da63c0b54e4acb41ee0cc8d8f53e6c3e7d4ab91..0720d70810653e78acade689f69398630f201c43 100755 (executable)
var $parent = NULL;
var $Restore = false; /* Defines the restore mode */
var $DeletedOnes = false; /* Specifies which objects will be listed */
-
+ var $dialog = true;
function SnapShotDialog($config,$dn,$parent)
{
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index 7b0097267bcc4bb8fda4cfb153c77909a50ad70b..008c519f8d81f507da7d2120e985b34ec56cf570 100644 (file)
if($this->parent->snapshotEnabled()){
$listhead .= " <input class='center' type='image' align='middle' src='images/restore.png'
- title='"._("Restore objects")."' alt='"._("Up")."' name='RestoreDeletedSnapShot'>".
+ title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
}
if($this->parent->snapshotEnabled()){
$str .="<input class='center' type='image' src='images/snapshot.png'
- alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create snapshot")."'> ";
+ alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create a new snapshot from this object")."'> ";
if(count($this->parent->Available_SnapsShots($dn))){
$str .="<input class='center' type='image' src='images/restore.png'
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc
index 16522abd83b4dbb373d25ca6639d535d3e00c5ac..55efed9eed4225a3b6ec9d7412eaafc0c89f0f5c 100644 (file)
$this->AddHeader(array("string"=>" ", "attach"=>"style='width:20px;'"));
$this->AddHeader(array("string"=>_("Username")." / "._("Department")));
$this->AddHeader(array("string"=>_("Properties"), "attach" => "style='width:152px;'"));
- $this->AddHeader(array("string"=>_("Actions"), "attach" => "style='width:102px;border-right:0px;text-align:right;'"));
+ $this->AddHeader(array("string"=>_("Actions"), "attach" => "style='width:132px;border-right:0px;text-align:right;'"));
$this->AddCheckBox("ShowTemplates" ,_("Select to see template pseudo users") ,_("Show templates") , false);
$this->AddCheckBox("ShowFunctionalUsers",_("Select to see users that have only a GOsa object"),_("Show functional users") , true);
$this->AddRegex ("Regex", _("Display users matching"),"*" , true);
}
+ function GetSnapShotActions($dn)
+ {
+ $str = "";
+
+ if($this->parent->snapshotEnabled()){
+
+ $str .="<input class='center' type='image' src='images/snapshot.png'
+ alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create a new snapshot from this object")."'> ";
+
+ if(count($this->parent->Available_SnapsShots($dn))){
+ $str .="<input class='center' type='image' src='images/restore.png'
+ alt='"._("Restore snapshot")."' name='RestoreSnapShot_".base64_encode($dn)."' title='"._("Restore snapshot")."'> ";
+ }else{
+ $str.= "<img src='images/empty.png' style='width:16px;' class='center'> ";
+ }
+ }
+ return($str);
+ }
+
+
function GenHeader()
{
/* Prepare departments,
title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ".
" <input class='center' type='image' src='images/list_reload.png' align='middle'
title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' align='middle' src='images/list_new_user.png'
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+
+ if($this->parent->snapshotEnabled()){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/restore.png'
+ title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_user.png'
title='"._("Create new user")."' alt='"._("New user")."' name='user_new'> ".
" <input class='center' type='image' align='middle' src='images/list_new.png'
title='"._("Create new template")."' alt='"._("New template")."' name='user_tplnew'> ".
$tplimg = "<img class='center' src='images/select_template.png' alt='Template' title='%s'>";
$editlink = "<a href='?plug=".validate($_GET['plug'])."&id=%s&act=edit_entry'>%s</a>";
- /* Create action icons */
- $action = "";
- if($this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- $action.= "<input class='center' type='image'
- src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }
- $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
- name='user_edit_%KEY%' title='"._("Edit user")."'>";
- $action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."'
- name='user_chgpw_%KEY%' title='"._("Change password")."'>";
- $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
- name='user_del_%KEY%' title='"._("Delete user")."'>";
-
/* Possilbe objectClass image combinations */
$possibleAccounts = array(
"posixAccount" => array("VAR"=>"posix" ,"IMG"=>"posiximg"),
// Test Every Entry and generate divlist Array
foreach($list as $key => $val){
+ /* Create action icons */
+ $action = $this->GetSnapShotActions($val['dn']);
+ if($this->parent->CopyPasteHandler){
+ $action .= "<input class='center' type='image'
+ src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ $action.= "<input class='center' type='image'
+ src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }
+ $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
+ name='user_edit_%KEY%' title='"._("Edit user")."'>";
+ $action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."'
+ name='user_chgpw_%KEY%' title='"._("Change password")."'>";
+ $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
+ name='user_del_%KEY%' title='"._("Delete user")."'>";
+
+
/* Create phonaccopunt informationm, if conencted && is phoneAccount */
$connected = ""; // This string represents timestamp or offline status
$ip_port = ""; // String that will represent ip : port of the connected phone
$field2 = array("string" => sprintf($editlink,$key,$display).$ip_port, "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'");
$field3 = array("string" => $UseImg, "attach" => "style='width:152px;'");
$field4 = array("string" => $s_img_create_from_template.preg_replace("/%KEY%/", "$key", $action),
- "attach" => "style='width:102px;border-right:0px; text-align:right;'");
+ "attach" => "style='width:132px;border-right:0px; text-align:right;'");
/* Add to list */
$add = array($field1,$field2,$field3,$field4);
$this->AddElement($add);
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 362245e0540052215c3597ab519e4cf16029eade..517ef7887bb729e22345a7cb14e9d8f35dc5cb70 100644 (file)
$display= $this->usertab->execute();
/* Don't show buttons if tab dialog requests this */
- if (!$this->usertab->by_object[$this->usertab->current]->dialog){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
- $display.= " \n";
- if ($this->dn != "new"){
- $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+ if(isset($this->usertab->by_object)){
+ if (!$this->usertab->by_object[$this->usertab->current]->dialog){
+ $display.= "<p style=\"text-align:right\">\n";
+ $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
$display.= " \n";
+ if ($this->dn != "new"){
+ $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+ $display.= " \n";
+ }
+ $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $display.= "</p>";
}
- $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $display.= "</p>";
}
return ($display);
}
}
/* Copy selected object
- Create a new empty object and the current selected object.
- Send both to copy&paste class*/
+ Create a new empty object and the current selected object.
+ Send both to copy&paste class*/
if($s_action == "copy"){
$this->CopyPasteHandler->Clear();
$dn= $this->list[trim($s_entry)]['dn'];
}
/* Cut selected object.
- Open user object and send it to the copy & paste handler */
+ Open user object and send it to the copy & paste handler */
if($s_action == "cut"){
$this->CopyPasteHandler->Clear();
$dn= $this->list[trim($s_entry)]['dn'];
{
/* Handle divlist filter && department selection*/
$this->DivListUsers->save_object();
+
+ /* check for posts */
+ $once = true;
+ foreach($_POST as $name => $value){
+
+ /* Create a new snapshot, display a dialog */
+ if(preg_match("/^CreateSnapShot_/",$name) && $once){
+ $once = false;
+ $entry = preg_replace("/^CreateSnapShot_/","",$name);
+ $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
+ $this->usertab = new SnapShotDialog($this->config,$entry,$this);
+ }
+
+ /* Restore a snapshot, display a dialog with all snapshots of the current object */
+ if(preg_match("/^RestoreSnapShot_/",$name) && $once){
+ $once = false;
+ $entry = preg_replace("/^RestoreSnapShot_/","",$name);
+ $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
+ $this->usertab = new SnapShotDialog($this->config,$entry,$this);
+ $this->usertab->Restore = true;
+ }
+
+ /* Restore one of the already deleted objects */
+ if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){
+ $once = false;
+ $entry = get_people_ou().$this->DivListUsers->selectedBase;
+ $this->usertab = new SnapShotDialog($this->config,$entry,$this);
+ $this->usertab->Restore = true;
+ $this->usertab->DeletedOnes = true;
+ }
+ }
+
+ /* Create a new snapshot requested, check
+ the given attributes and create the snapshot*/
+ if(isset($_POST['CreateSnapshot'])){
+ $this->usertab->save_object();
+ $msgs = $this->usertab->check();
+ if(count($msgs)){
+ foreach($msgs as $msg){
+ print_red($msg);
+ }
+ }else{
+ $this->dn = $this->usertab->dn;
+ echo $this->dn;
+ $this->create_snapshot("snapshot",$this->usertab->CurrentDescription);
+ $this->usertab = NULL;
+ }
+ }
+
+ /* Restore is requested, restore the object with the posted dn .*/
+ if((isset($_POST['RestoreSnapshot'])) && (isset($_POST['SnapShot']))){
+ $entry =trim($_POST['SnapShot']);
+ if(!empty($entry)){
+ $entry = base64_decode($entry);
+ $this->restore_snapshot($entry);
+ $this->usertab = NULL;
+ }
+ }
}
/* A set of disabled and therefore overloaded functions. They are