diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc
index 5dcd8e649d9ccba0c9fdf273b1e8a08f0dc6d26c..20d563b5f9a1b90b81cc8f53df2a9058f8f9676d 100644 (file)
$this->checks['permissions']['ERROR_MSG'] = "";
$this->check_ldap_permissions();
- $this->checks['deps_visible']['TITLE'] = _("Checking for invisible deparmtments");
+ $this->checks['deps_visible']['TITLE'] = _("Checking for invisible departments");
$this->checks['deps_visible']['STATUS'] = FALSE;
$this->checks['deps_visible']['STATUS_MSG']= "";
$this->checks['deps_visible']['ERROR_MSG'] = "";
}else{
$ldap->cd($attrs['dn']);
if(!$ldap->modify($new_attrs)){
- print_red(sprintf(_("Failed to migrate the department '%s' into GOsa, error message is as follows '%s'."),$attrs['dn'],$ldap->get_error()));
+ msg_dialog::display(_("Migration error"), sprintf(_("Cannot migrate department '%s':")."<br><br><i>%s</i>",LDAP::fix($attrs['dn']),$ldap->get_error()), ERROR_DIALOG);
return(false);
}
}
}else{
$ldap->cd($attrs['dn']);
if(!$ldap->modify($new_attrs)){
- print_red(sprintf(_("Failed to migrate the department '%s' into GOsa, error message is as follows '%s'."),$attrs['dn'],$ldap->get_error()));
+ msg_dialog::display(_("Migration error"), sprintf(_("Cannot migrate department '%s':")."<br><br><i>%s</i>",LDAP::fix($attrs['dn']), $ldap->get_error()), ERROR_DIALOG);
return(false);
}
}
$ldap->cd($cv['base']);
if(!$ldap->modify($attrs_new)){
- print_red(sprintf(_("Adding acls for user '%s' failed, ldap says '%s'."),$dn,$ldap->get_error()));
+ msg_dialog::display(_("Migration error"), sprintf(_("Cannot add ACL for user '%s':")."<br><br><i>%s</i>", LDAP::fix($dn), $ldap->get_error()), ERROR_DIALOG);
return(FALSE);
}else{
return(TRUE);
}
if(empty($pw1) || empty($pw2) | ($pw1 != $pw2)){
- print_red(_("Specified passwords are empty or not equal."));
+ msg_dialog::display(_("Password error"), _("Provided passwords do not match!"), ERROR_DIALOG);
return false;
}
- if(!is_uid($uid) || empty($uid)){
- print_red(_("Please specify a valid uid."));
+ if(!tests::is_uid($uid) || empty($uid)){
+ msg_dialog::display(_("Input error"), _("Specify a valid user ID!"), ERROR_DIALOG);
return false;
}
$ldap->cat($dn,array("dn"));
if($ldap->count()){
- print_red(sprintf(_("Could not add administrative user, there is already an object with the same dn '%s' in your ldap database."),$dn));
+ msg_dialog::display(_("Error"), sprintf(_("Adding an administrative user failed: object '%s' already exists!"), LDAP::fix($dn)), ERROR_DIALOG);
return(FALSE);
}
$this->create_admin();
if(!$res){
- print_red($ldap->get_error());
+ msg_dialog::display(_("LDAP error"), $ldap->get_error(), ERROR_DIALOG);
return(FALSE);
}
if(isset($_POST['move_winstation_to'])){
$destination_dep = $_POST['move_winstation_to'];
}else{
- print_red(_("Couldn't move users to specified department."));
+ msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG);
return(false);
}
/* Check if there are references to this object */
- $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+ $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
$refs = "";
while($attrs = $ldap->fetch()){
$ref_dn = $attrs['dn'];
if(isset($_POST['move_group_to'])){
$destination_dep = $_POST['move_group_to'];
}else{
- print_red(_("Couldn't move users to specified department."));
+ msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG);
return(false);
}
$this->outside_groups[$b_dn]['ldif'] = _("Group will be moved from").":<br>\t".($ldap->fix($dn))."<br>"._("to").":<br>\t".($ldap->fix($d_dn));
/* Check if there are references to this object */
- $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+ $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
$refs = "";
while($attrs = $ldap->fetch()){
$ref_dn = $attrs['dn'];
if(isset($_POST['move_user_to'])){
$destination_dep = $_POST['move_user_to'];
}else{
- print_red(_("Couldn't move users to specified department."));
+ msg_dialog::display(_("LDAP error"), _("Cannot move users to the requested department!"), ERROR_DIALOG);
return(false);
}
$this->outside_users[$b_dn]['ldif'] = _("User will be moved from").":<br>\t".($ldap->fix($dn))."<br>"._("to").":<br>\t".($ldap->fix($d_dn));
/* Check if there are references to this object */
- $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+ $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
$refs = "";
while($attrs = $ldap->fetch()){
$ref_dn = $attrs['dn'];
/* Update object references in gosaGroupOfNames */
$ogs_to_fix = array();
$ldap->cd($cv['base']);
- $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::fix($source).'))', array('cn','member'));
+ $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::prepare4filter($source).'))', array('cn','member'));
while ($attrs= $ldap->fetch()){
$dn = $attrs['dn'];
$attrs = $this->cleanup_array($attrs);
/* Display warning if copy failed */
if(!$res){
- print_red(_("Failed to copy '%s' to '%s'. LDAP says '%s'."),$source,$destination,$ldap->get_error());
+ msg_dialog::display(_("LDAP error"), sprintf(_("Copy '%s' to '%s' failed:")."<br><br><i>%s</i>", LDAP::fix($source), LDAP::fix($destination), $ldap->get_error()), ERROR_DIALOG);
}else{
$res = $ldap->rmDir($source);
- show_ldap_error($ldap->get_error(),_("Something went wrong while copying dns."));
+ show_ldap_error($ldap->get_error(),_("Problem copying DNs"));
/* Object is copied, so update its references */
foreach($ogs_to_fix as $dn => $data){