summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d26eb5d)
raw | patch | inline | side by side (parent: d26eb5d)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Feb 2008 19:15:58 +0000 (19:15 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Feb 2008 19:15:58 +0000 (19:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9219 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc b/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc
index 05cd9278073f7ea427e0754c1ab33816425f9ef2..0dd77e3f6a9d140c1a7ba3cbd421259170e69c34 100644 (file)
/* get config */
if(!isset($this->goFonHomeServers[$this->goFonHomeServer])){
- print_red(sprintf(_("The specified home server '%s' is not available in GOsa server configuration. Saving this account will create a new entry on the server '%s'. Use cancel if you do not want to create a new entry while ignoring old accounts."), preg_replace("/,/",", ",$this->goFonHomeServer), preg_replace("/,/",", ",$this->goFonHomeServers[0]['DN'])));
+ msg_dialog::display(_("Obsolete entry"), sprintf(_("The current home server is not available anymore. It will be moved to '%s' if you save this entry!"), preg_replace("/,/",", ",$this->goFonHomeServers[0]['DN'])), ERROR_DIALOG);
$this->goFonHomeServer = $this->goFonHomeServers[0]['DN'];
$this->init_HomeServer = $this->goFonHomeServers[0]['DN'];
}
{
/* Check if mysql extension is available */
if(!is_callable("mysql_pconnect")){
- return(_("Can't save any changes to asterisk database, there is currently no mysql extension available in your php setup."));
+ return(sprintf(_("Missing %s PHP extension!"), "mysql"));
}
/********************
$r_current = @mysql_pconnect($cfg_Current['SERVER'],$cfg_Current['LOGIN'],$cfg_Current['PASSWORD']);
if(!$r_current){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current));
- return(sprintf(_("The MySQL home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cfg_Current['SERVER'],$cfg_Current['LOGIN']));
+ return(sprintf(_("Cannot connect to %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
$db_current = @mysql_select_db($cfg_Current['DB'],$r_current);
if(!$db_current){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current));
mysql_close($r_current);
- return( sprintf(_("Can't select database '%s' on home server '%s'."),$cfg_Current['DB'],$cfg_Current['SERVER']));
+ return(sprintf(_("Cannot select %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
/********************
$r_init = @mysql_pconnect($cfg_Init['SERVER'],$cfg_Init['LOGIN'],$cfg_Init['PASSWORD']);
if(!$r_init){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_init));
- return(sprintf(_("The MySQL initial home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cfg_Init['SERVER'],$cfg_Init['LOGIN']));
+ return(sprintf(_("Cannot connect to %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
$db_init = @mysql_select_db($cfg_Init['DB'],$r_init);
if(!$db_init){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_init));
mysql_close($r_init);
- return( sprintf(_("Can't select database '%s' on initial home server '%s'."),$cfg_Init['DB'],$cfg_Init['SERVER']));
+ return(sprintf(_("Cannot select %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
}
}
/* Check if there is at least on server configuration */
if(!count($this->goFonHomeServers)){
- return( _("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). Your settings can't be saved to asterisk database."));
+ return( _("There is currently no asterisk server defined!"));
}
/********************
$res = @mysql_query($sql,$res_cur);
if(!$res){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($r_current));
- return(_("Error while removing old queue entries from database.").
- " "._("Please have a look a the gosa logfiles."));
+ return(_("Cannot remove queue entries from database!"));
}
}
}
{
/* Check if there is at least on server configuration */
if(!count($this->goFonHomeServers)){
- return( _("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). Your settings can't be saved to asterisk database."));
+ return( _("There is currently no asterisk server defined!"));
}
/********************
$res = mysql_query($query,$res_cur);
if(!$res){
new log("debug","ogroups/".get_class($this),"",array(),@mysql_error($res_cur));
- return(_("Could not detect old queue entry, query failed.")." "._("Please have a look a the gosa logfiles."));
+ return(_("Cannot find old queue entry!"));
}
$cnt = mysql_affected_rows($res_cur);
$SQL[] = $query;
}
}else{
- return(sprintf(_("More than one entry in queue table found, that uses the name ('%s'). Please fix this issue manually first."),$this->cn));
+ return(sprintf(_("Found more than one entry named '%s' in queue table. Please inform your system administrator!"),$this->cn));
}
/* Add database entry, display error and abort if this fails */
$str = $this->add_to_database(true);
if(!empty($str)){
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
}
/* Save data to LDAP */
*/
$str = $this->remove_from_database(true);
if(!empty($str)){
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
return false;
}
diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
index be2f95de9e88458cbe50423d06f3eda0e3a80a02..d74a607605a8d77ff096a534f9369c457e842c2d 100644 (file)
$ldap->search ("(&(objectClass=goFonAccount)(goFonHardware=".$this->cn."))", array("uid","cn"));
while ($attr = $ldap->fetch()){
- print_red(sprintf(_("Can't delete because there are users which are depending on this phone. One of them is user '%s'."),
- ($attr['uid'][0]." - ".$attr['cn'][0])));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot delete entry because it is still in use by '%s'!"), $attr['cn'][0]), ERROR_DIALOG);
return;
}
new log("remove","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of system phone/generic with dn '%s' failed."),$this->dn));
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of system phone/generic with dn '%s' failed!"),$this->dn));
$this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
/* Delete references to object groups */
/* To check for valid ip*/
if($this->netConfigDNS->ipHostNumber == ""){
- $message[]= _("The required field IP address is empty.");
+ $message[]= _("IP address is not set!");
} else {
if (!tests::is_ip($this->netConfigDNS->ipHostNumber)){
- $message[]= _("The field IP address contains an invalid address.");
+ $message[]= _("IP address is not valid!");
}
}
/* Check if given name is a valid host/dns name */
if(!tests::is_dns_name($this->cn) ){
- $message[] = _("Please specify a valid name for this object.");
+ $message[] = _("Name is not valid!");
}
if ($this->cn == ""){
- $message[]= _("The required field 'Phone name' is not set.");
+ $message[]= _("Name is not set!");
}
if ($this->cn == "0"){
- $message[]= _("The 'Phone name' '0' is reserved and cannot be used.");
+ $message[]= _("'0' is a reserved name and cannot be used!");
}
if ($this->orig_dn != $this->dn){
}
if ($attrs['dn'] != $this->orig_dn){
- $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
+ $message[]= _("Name is already in use!");
break;
}
}
}
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->save();
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of system phone/generic with dn '%s' failed."),$this->dn));
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of phone/generic with dn '%s' failed!"),$this->dn));
}
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc
index cd6c84aa93aa5f2f38cf6f4aa25de35281e74197..216233deb98c70565341d8d6f538b9ec7262f2d3 100644 (file)
/* get config */
if(!isset($this->goFonHomeServers[$this->goFonHomeServer])){
- print_red(sprintf(_("The specified home server '%s' is not available in GOsa server configuration. Saving this account will create a new entry on the server '%s'. Use cancel if you do not want to create a new entry while ignoring old accounts."),$this->goFonHomeServer, $this->goFonHomeServers[0]['DN']));
+ msg_dialog::display(_("Obsolete entry"), sprintf(_("The current home server is not available anymore. It will be moved to '%s' if you save this entry!"), preg_replace("/,/",", ",$this->goFonHomeServers[0]['DN'])), ERROR_DIALOG);
$this->goFonHomeServer = $this->goFonHomeServers[0]['DN'];
$this->init_HomeServer = $this->goFonHomeServers[0]['DN'];
if(isset($this->goFonHomeServers[$this->goFonHomeServer])){
$str = $this->SQL_remove_me(true);
if($str){
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
return false;
}
}else{
- print_red(_("Could not remove the conference entry from database on home server (%s). Please check your asterisk database configuration."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot delete entry from server '%s' because it seems to be removed!"), preg_replace("/,/",", ",$this->goFonHomeServer), ERROR_DIALOG);
return false;
}
{
/* Check if mysql extension is available */
if(!is_callable("mysql_pconnect")){
- return(_("Can't save any changes to asterisk database, there is currently no mysql extension available in your php setup."));
+ return(sprintf(_("Missing %s PHP extension!"), "mysql"));
}
/********************
if(!$r_current){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_current));
- return(sprintf(_("The MySQL home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cfg_Current['SERVER'],$cfg_Current['LOGIN']));
+ return(sprintf(_("Cannot connect to %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
$db_current = @mysql_select_db($cfg_Current['DB'],$r_current);
if(!$db_current){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_current));
mysql_close($r_current);
- return( sprintf(_("Can't select database '%s' on home server '%s'."),$cfg_Current['DB'],$cfg_Current['SERVER']));
+ return(sprintf(_("Cannot select %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
/********************
$r_init = @mysql_pconnect($cfg_Init['SERVER'],$cfg_Init['LOGIN'],$cfg_Init['PASSWORD']);
if(!$r_init){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_init));
-
- return(sprintf(_("The MySQL initial home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cfg_Init['SERVER'],$cfg_Init['LOGIN']));
+ return(sprintf(_("Cannot connect to %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
$db_init = @mysql_select_db($cfg_Init['DB'],$r_init);
if(!$db_init){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_init));
mysql_close($r_init);
- return( sprintf(_("Can't select database '%s' on initial home server '%s'."),$cfg_Init['DB'],$cfg_Init['SERVER']));
+ return(sprintf(_("Cannot select %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
}
}
/* Check if previously selected server is still available */
if($this->initially_was_account && !isset($this->goFonHomeServers[$this->goFonHomeServer])){
- $message[]= sprintf(_("The previously selected asterisk home server (%s) is no longer available."),preg_replace("/,/",", ",$this->goFonHomeServer));
+ $message[]= sprintf(_("The previously selected asterisk home server '%s' is no longer available!"),preg_replace("/,/",", ",$this->goFonHomeServer));
return($message);
}
if((empty($this->goFonPIN))&&($this->goFonConferenceOption_P=="P")&&($this->goFonConferenceOption_D=="D")){
- $message[]= _("Please enter a PIN.");
+ $message[]= _("PIN is not set!");
}
if(empty($this->cn)){
- $message[] =_("Please enter a name for the conference.");
+ $message[] =_("Name is not set!");
}
if(!is_numeric($this->telephoneNumber)){
- $message[] =_("Only numeric chars are allowed in Number field.");
+ $message[] =_("Number is not valid!");
}
if(!((is_numeric($this->goFonConferenceOptionLifetime))||(empty($this->goFonConferenceOptionLifetime)))){
- $message[] =_("Only numbers are allowed in Lifetime.");
+ $message[] =_("Lifetime is not valid!");
}
/* Check if add could be successful */
$ldap->cd(get_ou('conferenceou').$this->base);
$ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn"));
if($ldap->count()){
- $message[] =_("There is already a conference with this name in the current tree.");
+ $message[] =_("Name is already in use!");
}
}
return $message;
{
/* Check if there is at least on server configuration */
if(!count($this->goFonHomeServers)){
- return( _("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). Your settings can't be saved to asterisk database."));
+ return( _("There is currently no asterisk server defined!"));
}
/********************
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!$res){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($res_cur));
- return(_("Can not check if there are already some entries with given telephone number and/or cn in the destination home server.").
- " "._("Please have a look a the gosa logfiles."));
+ return(sprintf(_("Cannot query %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
if($save && mysql_affected_rows($res_cur)) {
$SQL = "DELETE FROM ".$cfg_Current['EXT_TABLE']."
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$SQL, "Database query");
if(!$res){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($res_cur));
- return(_("Can not remove entries with some telephone number and/or cn from destination home server.").
- " "._("Please have a look a the gosa logfiles."));
+ return(sprintf(_("Cannot query %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
}
}
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!$res){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_init));
- return(_("Can not check if entry exists in old database. Please have a look a the gosa logfiles."));
+ return(sprintf(_("Cannot query %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
/* There are entries using this cn and/or phone number */
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$SQL, "Database query");
if(!$res){
new log("debug","gofonconference/".get_class($this),"",array(),@mysql_error($r_init));
- return(_("Can not remove old entries from initial home server. Please have a look a the gosa logfiles."));
+ return(sprintf(_("Cannot query %s database on server '%s'!"), "GOfon", $cfg_Init['SERVER']));
}
}//ENDE old num availiable ...
$num = $this->telephoneNumber;
if((isset($numbers[$num]))&&(($numbers[$num]['cn'][0]!=$this->old_cn))){
if(isset($numbers[$num]['uid'][0])){
- return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
+ return sprintf(_("'%s' is already assigned to '%s'!"),$num,$numbers[$num]['uid'][0]);
}else{
- return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
+ return sprintf(_("'%s' is already assigned to '%s'!"),$num,$numbers[$num]['cn'][0]);
}
}
}
new log("create","gofonconference/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonConference/generic with dn '%s' failed."),$this->dn));
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonConference/generic with dn '%s' failed!"),$this->dn));
/* Optionally execute a command after we're done */
$this->postcreate();
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc
index 50b4b241b32bbd3f7e4a0fb1cb832a752f6b9733..55bdfda21019330b49ff43b4ddbc2b94d18e4609 100644 (file)
if(preg_match("/d/",$acl)){
$this->remove_from_parent();
} else {
- print_red (_("You have no permission to remove this department."));
+ msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
}
/* Remove lock file after successfull deletion */
del_lock ($dn);
if(preg_match("/d/",$acl)){
$this->remove_from_parent();
} else {
- print_red (_("You have no permission to remove this department."));
+ msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
}
}
diff --git a/gosa-plugins/gofon/gofon/fonreports/class_fonreport.inc b/gosa-plugins/gofon/gofon/fonreports/class_fonreport.inc
index a67ff28e80dcda2fbcc4dfaa0be2bdcb47c0e42d..8e1e013048445f8ac644a95ed4691e983aea40b4 100644 (file)
/* Connecting, selecting database */
if (!isset($this->config->data['SERVERS']['FON'][0])){
- print_red(_("Can't connect to phone database, no reports can be shown!"));
+ msg_dialog::display(_("Configuration error"), _("There is currently no asterisk server defined!"), WARNING_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}elseif(!is_callable("mysql_connect")){
- print_red(_("There is no mysql extension available, please check your php setup."));
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "mysql"), WARNING_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}else{
$cfg= $this->config->data['SERVERS']['FON'][0];
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
if ($link === FALSE){
- print_red(_("Can't connect to phone database, no reports can be shown!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "GOfon"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
if (! @mysql_select_db("gophone")){
- print_red(_("Can't select phone database for report generation!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "GOfon"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
}
$result = @mysql_query($query);
if ($result === false){
- print_red(_("Query for phone database failed!"));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot query %s database!"), "GOfon"), ERROR_DIALOG);
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc
index 1e250dd46cff166e17cd4b998b29338cf2abb49c..c4d22b417569826a358cc8b80ab65bc38ae5c45e 100644 (file)
{
/* Check if mysql extension is available */
if(!is_callable("mysql_pconnect")){
- return(_("Can't save any changes to asterisk database, there is currently no mysql extension available in your php setup."));
+ return(sprintf(_("Missing %s PHP extension!"), "mysql"));
}
/********************
$r_current = @mysql_pconnect($cfg_Current['SERVER'],$cfg_Current['LOGIN'],$cfg_Current['PASSWORD']);
if(!$r_current){
new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_current));
- return(sprintf(_("The MySQL home server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cfg_Current['SERVER'],$cfg_Current['LOGIN']));
+ return (sprintf(_("Cannot connect to %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
$db_current = @mysql_select_db($cfg_Current['DB'],$r_current);
if(!$db_current){
new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_current));
mysql_close($r_current);
- return( sprintf(_("Can't select database '%s' on home server '%s'."),$cfg_Current['DB'],$cfg_Current['SERVER']));
+ return (sprintf(_("Cannot select %s database on server '%s'!"), "GOfon", $cfg_Current['SERVER']));
}
}
}
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!$res){
new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_current));
- return(sprintf(_("Removing macro from '%s' failed. Check GOsa log for mysql error."),$Server['SERVER']));
+ return(sprintf(_("Cannot remove macro from '%s'!"),$Server['SERVER']));
}
@mysql_close($r_current);
}
# }
/* Multiple () are not supproted currently ... */
if(substr_count($s_linestr,"(") >1 ){
- return(sprintf(_("More than one '(' is currently not supported. Line : '%s'."),$i_linenum));
+ return(sprintf(_("Not supported multiple brace in line %s!"),$i_linenum));
}
if(substr_count($s_linestr,")") >1 ){
- return(sprintf(_("More than one ')' is currently not supported. Line : '%s'."),$i_linenum));
+ return(sprintf(_("Not supported multiple brace in line %s!"),$i_linenum));
}
/* Check if there is an application given */
if(empty($tmp[1])){
- return(sprintf(_("There is no application given in line : '%s'."),$i_linenum));
+ return(sprintf(_("Application missing in line %s!"),$i_linenum));
}
/* Check if there is an extension given */
if(empty($tmp[0])){
- return(sprintf(_("There is no extension type given in line : '%s'."),$i_linenum));
+ return(sprintf(_("Extension missing in line %s!"),$i_linenum));
}
/* Create extension entry for current line
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
if(!$res){
new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_con));
- return(sprintf(_("Insert of new macro failed for server '%s'."),$cfg['SERVER']));
+ return(sprintf(_("Cannot insert new macro on server '%s'!"),$cfg['SERVER']));
}
@mysql_close($r_con);
}
$message= plugin::check();
if(!count($this->goFonHomeServers)){
- $message[] = _("There must be at least one server with an asterisk database to save this phone macro.");
+ $message[] = _("There is currently no asterisk server defined!");
}
/* Check if insert/replace is possible and all servers are available */
$ldap = $this->config->get_ldap_link();
$ldap->search("(&(objectClass=goFonMacro)(cn=".$this->cn."))",array("cn"));
if($ldap->count()>0){
- $message[]=sprintf(_("The given cn '%s' already exists."),$this->cn);
+ $message[]= _("Name is already in use!");
}
}
/* Check if display name is set */
if(empty($this->displayName)){
- $message[] = _("You must specify the 'Display Name' in order to save this macro");
+ $message[] = _("Display name is not set!");
}
/* CN is restricted to 20 chars */
if(strlen("Makro-".$this->cn)>20 ){
- $message[]=_("The given cn is too long, to create a Makro entry, maximum 20 chars.");
+ $message[]=_("Name can be 20 characters at maximum!");
}
/* If this macro is still in use we should not change the visible for user flag to invisible */
$res = $ldap->search("(&(objectClass=goFonAccount)(objectClass=gosaAccount)(goFonMacro=*))", array("goFonMacro"));
while ($val = $ldap->fetch()){
if(strstr($val['goFonMacro'][0],$this->dn)){
- $message[] = _("This macro is still in use. It is necessary to mark this macro as visible for users.");
+ $message[] = _("Macro is still in use!");
return($message);
}
}
}
if(empty($this->goFonMacroContent)){
- $message[] = _("You can't save an empty macro.");
+ $message[] = _("Macro is empty!");
}
return $message;
}
$ldap= $this->config->get_ldap_link();
/* Skip remove if this macro is still in use */
- $res = $ldap->search("(&(objectClass=goFonAccount)(objectClass=gosaAccount)(goFonMacro=*))", array("goFonMacro"));
+ $res = $ldap->search("(&(objectClass=goFonAccount)(objectClass=gosaAccount)(goFonMacro=*))", array("goFonMacro", "cn"));
while ($val = $ldap->fetch()){
if(strstr($val['goFonMacro'][0],$this->dn)){
- print_red(_("This macro is still in use. To delete this Macro ensure that nobody has selected it."));
+ msg_dialog::display(_("Error"), sprintf(_("Cannot delete entry because it is still in use by '%s'!"), $val['cn'][0]), ERROR_DIALOG);
return false;
}
}
if(count($this->goFonHomeServers)){
$str = $this->remove_from_database(true);
if($str){
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
return false;
}
}else{
- print_red(_("Could not remove the macro entry from asterisk databases. Please check your asterisk database configurations."));
+ msg_dialog::display(_("Configuration error"), _("There is currently no asterisk server defined!"), WARNING_DIALOG);
return false;
}
/* Remove phone macro */
$ldap->rmDir($this->dn);
new log("remove","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed."),$this->dn));
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed!"),$this->dn));
/* Delete references to object groups */
$ldap->cd ($this->config->current['BASE']);
$og= new ogroup($this->config, $ldap->getDN());
unset($og->member[$this->dn]);
$og->save ();
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed."),$this->dn));
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed!"),$this->dn));
}
}
/* Try to add entries to databases */
$str = $this->add_to_database(true);
if($str){
- print_red($str);
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
}else{
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc
index 9d552be2aa5857c86a26471a62704cfee75bc354..2fd5640099fbf5cf6510ca715fe12bd8c8a95c28 100644 (file)
$dns_names .="</pre>";
/* Lock the current entry, so nobody will edit it during deletion */
- $smarty->assign("intro", sprintf(_("You're about to delete the following user(s) %s"), @LDAP::fix($dns_names)));
+ $smarty->assign("intro", sprintf(_("You're about to delete the following macro(s) %s"), @LDAP::fix($dns_names)));
$smarty->assign("multiple", true);
return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
}
$this->macrotabs= NULL;
} else {
- print_red (_("You are not allowed to delete this macro!"));
+ msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
}
/* Remove lock file after successfull deletion */
/* Obviously the user isn't allowed to delete. Show message and
clean session. */
- print_red (_("You are not allowed to delete this macro!"));
+ msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
}
}
} else {
/* Normally this shouldn't be reached, send some extra
logs to notify the administrator */
- print_red (_("You are not allowed to delete this macro!"));
+ msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
new log("security","gofonmacro/".get_class($this),$this->dn,array(),"Tried to trick deletion.");
}
/* Remove lock file after successfull deletion */
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc
index 935321e0fe4777a4e74cdcf2ee98c850af88dfc5..ef7866e3308cbd951295efd0714d44b09ebf4bba 100644 (file)
foreach($this->goFonMacroParameter as $key=>$val){
if((strstr($val['default'],"!"))||(strstr($val['default'],"#"))) {
- $message[] = sprintf(_("The parameter %s contains invalid char. '!,#' is used as delimiter"),$val['name']);
+ $message[] = sprintf(_("Parameter %s contains invalid character. '!,#' is used as delimiter!"),$val['name']);
}
switch($val['type']){
case 'bool' : $possible = array("","0","1");
if(!in_array($val['default'],$possible)) {
- $message[] = sprintf(_("The parameter %s has incorrect value for type bool."),$val['name']);
+ $message[] = sprintf(_("Parameter %s is invalid!"),$val['name']);
};break;
case 'string' :
case 'combo' :
}
if($this->para_count != count($this->attrs['goFonMacroParameter'])){
- print_red(_("Parameter count of the macro changed, you must update each user which are using this macro '%s'."),$this->dn);
+ msg_dialog::display(_("Information"), _("Number of parameters for this macro has changed. Please update all users using it!"), INFO_DIALOG);
}
unset($this->attrs['base']);