summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e2de0e)
raw | patch | inline | side by side (parent: 0e2de0e)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Feb 2008 07:24:41 +0000 (07:24 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Feb 2008 07:24:41 +0000 (07:24 +0000) |
Enabled unit tagging
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8998 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8998 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/ihtml/themes/default/msg_dialog.tpl b/gosa-core/ihtml/themes/default/msg_dialog.tpl
index 1929f8863fe92f959405230e59f148739d5ef1ac..c0251705b44ec6ac20c378ffaf450c796d0bb89e 100644 (file)
<div id='e_layer{$i_ID}' style="errorMsgDialog">
<div id="e_layerTitle{$i_ID}" style="errorMsgTitle">
- {$s_Title}
- </div>
- <div style="errorMsgSeperator"></div>
- <table style='width:100%' summary='' border=0>
- <tr>
- <td style='vertical-align:top;padding:2px 10px 0px 10px'>
+ <table><tr><td>
{if $i_Type == ERROR_DIALOG}
<img src='images/error.png' alt='{t}Error{/t}'>
{elseif $i_Type == WARNING_DIALOG}
{elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG}
<img src='images/info.png' alt='{t}Information{/t}'>
{/if}
- </td>
+ </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
+ </table>
+ </div>
+ <div style="errorMsgSeperator"></div>
+ <table style='width:100%' summary='' border=0>
+ <tr>
<td style='width:100%'>
<b>{$s_Message}</b>
<br>
<div id='e_layer{$i_ID}' class="errorMsgDialog">
<div id="e_layerTitle{$i_ID}" class="errorMsgTitle">
- {$s_Title}
- </div>
- <div class="errorMsgSepeator"></div>
-
- <table style='width:100%' summary='' border=0>
- <tr>
- <td style='vertical-align:top;padding:2px 10px 0px 10px'>
+ <table><tr><td>
{if $i_Type == ERROR_DIALOG}
<img src='images/error.png' alt='{t}Error{/t}'>
{elseif $i_Type == WARNING_DIALOG}
{elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG}
<img src='images/info.png' alt='{t}Information{/t}'>
{/if}
- </td>
+ </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
+ </table>
+ </div>
+ <div class="errorMsgSepeator"></div>
+
+ <table style='width:100%' summary='' border=0>
+ <tr>
<td style='width:100%'>
<b>{$s_Message}</b>
<br>
index 69ee3f9097b2c66d7504ff661bd6b6d905c0df9f..a1c386f8293c15a91ac8c13c16f90e63f4caeeea 100644 (file)
/* Check for connection */
if (is_null($this->ldap) || (is_int($this->ldap) && $this->ldap == 0)){
$smarty= get_smarty();
- msg_dialog::display(_("LDAP error"), _("Can't bind to LDAP. Please contact the system administrator."), FATAL_ERROR_DIALOG);
+ msg_dialog::display(_("LDAP error"), _("Cannot bind to LDAP. Please contact the system administrator."), FATAL_ERROR_DIALOG);
exit();
}
diff --git a/gosa-core/include/class_hostActionQueue.inc b/gosa-core/include/class_hostActionQueue.inc
index c32be66ae6821f9ddc0803b84ccebfa239378808..c21ebfd76560da070b51e300406f501779272488 100644 (file)
if(count($parts) != 10){
print_red(_("Entry broken, skipped."));
+ msg_dialog::display(_("GOsa infrastructure"), _("Cannot read broken entry - skipped!"), WARNING_DIALOG);
}else{
$entry = array();
diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index d924c5998a0083c422fb1049dc0d52b652c1ec27..299cbd2e8a77c44f62f63e7ac4bd3aae481db593 100644 (file)
$this->acltabs= new aclroletab($this->config, NULL,$this->dn);
$this->acltabs->set_acl_base($this->DivListACL->selectedBase);
}else{
- print_red(_("You are not allowed to create a new role."));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to create a new role!"), ERROR_DIALOG);
}
}
/* Set ACL and move DN to the headline */
session::set('objectinfo',$this->dn);
}else{
- print_red(_("You are not allowed to edit this acl."));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to edit this ACL!"), ERROR_DIALOG);
}
}
/* Obviously the acl isn't allowed to delete. Show message and
clean session. */
- print_red (_("You are not allowed to delete this acl!"));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
}
}
/* Normally this shouldn't be reached, send some extra
logs to notify the administrator */
- print_red (_("You are not allowed to delete this acl role!"));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to delete this role!"), ERROR_DIALOG);
if(isset($this->ui->uid)){
new log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role deletion.");
/* Obviously the acl isn't allowed to delete. Show message and
clean session. */
- print_red (_("You are not allowed to delete this acl!"));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
}
}
/* Normally this shouldn't be reached, send some extra
logs to notify the administrator */
- print_red (_("You are not allowed to delete this acl!"));
+ msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
if(isset($this->ui->uid)){
new log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role deletion.");
diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc
index 01581ab9bb67b4ed5619f3c9b15bcd99ed31b9f6..5939a5b3815f5db011690d34cba7145a4db0e110 100644 (file)
$all_names .= ", ...";
}
$all_names = "<span style='text-align:left;'>".$all_names."</span>";
- print_red(sprintf(_("This role can't be removed while it is in use. Follwing objects are using this role %s"),$all_names));
+ msg_dialog::display(_("Object in use"), sprintf(_("This role cannot be removed while it is in use by these objects:")."<br><br>%s", $all_names), WARNING_DIALOG);
return;
}
diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc
index 03cedf2dc19ecc5fbd78bf9da26c721a89eb62d5..a6e443d0815bb2faaa29b4c0664efb475f3068f6 100644 (file)
var $objectclasses= array("top", "gosaDepartment", "organizationalUnit");
var $initially_was_tagged = false;
-
- /* Temporary disable the Unit Tag functionalityi.
- This is not used anymore, cause of the new acl implementation.
- Setting this to TRUE will disable
- all POST / GET activity, "Department tagging" and the checkbox within the generic template.
- */
- var $UnitTagDiabled = TRUE;
var $orig_base = "";
var $orig_ou = "";
$smarty->assign("base_select", $this->base);
/* Set admin unit flag */
- $smarty->assign("UnitTagDiabled",$this->UnitTagDiabled);
- if(!$this->UnitTagDiabled){
- if ($this->is_administrational_unit) {
- $smarty->assign("unitTag", "checked");
- } else {
- $smarty->assign("unitTag", "");
- }
+ if ($this->is_administrational_unit) {
+ $smarty->assign("unitTag", "checked");
+ } else {
+ $smarty->assign("unitTag", "");
}
return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
}
/* Save tagging flag */
- if(!$this->UnitTagDiabled){
- if ($this->acl_is_writeable("unitTag")){
- if (isset($_POST['unitTag'])){
- $this->is_administrational_unit= true;
- } else {
- $this->is_administrational_unit= false;
- }
+ if ($this->acl_is_writeable("unitTag")){
+ if (isset($_POST['unitTag'])){
+ $this->is_administrational_unit= true;
+ } else {
+ $this->is_administrational_unit= false;
}
}
}
{
$ldap= $this->config->get_ldap_link();
- if(!$this->UnitTagDiabled){
+ /* Add tag objects if needed */
+ if ($this->is_administrational_unit){
- /* Add tag objects if needed */
- if ($this->is_administrational_unit){
+ /* If this wasn't tagged before add oc an reset unit tag */
+ if(!$this->initially_was_tagged){
+ $this->objectclasses[]= "gosaAdministrativeUnit";
+ $this->gosaUnitTag= "";
- /* If this wasn't tagged before add oc an reset unit tag */
- if(!$this->initially_was_tagged){
- $this->objectclasses[]= "gosaAdministrativeUnit";
- $this->gosaUnitTag= "";
-
- /* It seams that this method is called twice,
- set this to true. to avoid adding this oc twice */
- $this->initially_was_tagged = true;
- }
+ /* It seams that this method is called twice,
+ set this to true. to avoid adding this oc twice */
+ $this->initially_was_tagged = true;
+ }
- if ($this->gosaUnitTag == ""){
+ if ($this->gosaUnitTag == ""){
- /* It's unlikely, but check if already used... */
- $try= 5;
- $ldap->cd($this->config->current['BASE']);
- while ($try--){
+ /* It's unlikely, but check if already used... */
+ $try= 5;
+ $ldap->cd($this->config->current['BASE']);
+ while ($try--){
- /* Generate microtime stamp as tag */
- list($usec, $sec)= explode(" ", microtime());
- $time_stamp= preg_replace("/\./", "", $sec.$usec);
+ /* Generate microtime stamp as tag */
+ list($usec, $sec)= explode(" ", microtime());
+ $time_stamp= preg_replace("/\./", "", $sec.$usec);
- $ldap->search("(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$time_stamp))",array("gosaUnitTag"));
- if ($ldap->count() == 0){
- break;
- }
- }
- if($try == 0) {
- print_red(_("Fatal error: Can't find an unused tag to mark the administrative unit!"));
- return;
+ $ldap->search("(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$time_stamp))",array("gosaUnitTag"));
+ if ($ldap->count() == 0){
+ break;
}
- $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
}
+ if($try == 0) {
+ msg_dialog::display(_("Fatal error"), _("Cannot find an unused tag for this administrative unit!"), WARNING_DIALOG);
+ return;
+ }
+ $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
}
}
- plugin::save();
-
- if(!$this->UnitTagDiabled){
+ plugin::save();
- /* Remove tag information if needed */
- if (!$this->is_administrational_unit){
- $tmp= array();
+ /* Remove tag information if needed */
+ if (!$this->is_administrational_unit){
+ $tmp= array();
- /* Remove gosaAdministrativeUnit from this plugin */
- $has_unit_tag= false;
- foreach($this->attrs['objectClass'] as $oc){
- if (!preg_match("/^gosaAdministrativeUnit$/i", $oc)){
- $tmp[]= $oc;
- }
- if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){
- $has_unit_tag= true;
- }
+ /* Remove gosaAdministrativeUnit from this plugin */
+ $has_unit_tag= false;
+ foreach($this->attrs['objectClass'] as $oc){
+ if (!preg_match("/^gosaAdministrativeUnit$/i", $oc)){
+ $tmp[]= $oc;
}
- $this->attrs['objectClass']= $tmp;
-
- if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
- $this->attrs['gosaUnitTag']= array();
+ if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){
+ $has_unit_tag= true;
}
- $this->gosaUnitTag = "";
}
+ $this->attrs['objectClass']= $tmp;
+
+ if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
+ $this->attrs['gosaUnitTag']= array();
+ }
+ $this->gosaUnitTag = "";
}
/* Write back to ldap */
}
show_ldap_error($ldap->get_error(), sprintf(_("Saving of department with dn '%s' failed."),$this->dn));
-
- if(!$this->UnitTagDiabled){
- /* The parameter forces only to set must_be_tagged, and don't touch any objects
- This will be done later */
- $this->tag_objects(true);
- }
+ /* The parameter forces only to set must_be_tagged, and don't touch any objects
+ This will be done later */
+ $this->tag_objects(true);
/* Optionally execute a command after we're done */
$this->postcreate();
diff --git a/gosa-core/plugins/admin/departments/generic.tpl b/gosa-core/plugins/admin/departments/generic.tpl
index 7e353be8c826af3cf9df493c4e2ec662b7920094..a743aeb340d4baab2f2bb2dcdbb80ec8c68a399c 100644 (file)
</tr>
</table>
-
-{if !$UnitTagDiabled}
-
-<!--
-This is not used anymore cause of the new acl implementation
-Its functionality is disabled in class_departmentGeneric.inc
--->
-
<p class='seperator'> </p>
<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
</tr>
</table>
-{/if}
<!-- Place cursor -->
<input type='hidden' name='dep_generic_posted' value='1'>
<script language="JavaScript" type="text/javascript">