diff --git a/gosa-core/setup/class_setupStep_Feedback.inc b/gosa-core/setup/class_setupStep_Feedback.inc
index fbcfb4c97bfeb4d4be04e70f0d9e5d973ab05ac6..d655c2e5e79d756cc72786eff4b9e6db1af16df8 100644 (file)
class Step_Feedback extends setup_step
{
var $languages = array();
- var $header_image = "images/welcome.png";
+ var $header_image = "images/setup/welcome.png";
var $organization = "";
var $eMail = "";
var $features_used = array();
var $initialized = FALSE;
-
+ var $feedback_send = FALSE;
var $attributes = array("organization","eMail","name","subscribe","use_gosa_announce","get_started","problems_encountered","features_used",
"first_use","use_since","distribution","web_server","php_version","ldap_server","object_count","want_to_see_next");
$this->web_server = $_SERVER['SERVER_SOFTWARE'];
$this->php_version = PHP_VERSION;
- /* On first call check for rid/sid base */
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+
+ $this->object_count= "";
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
- $ldap->search("(objectClass=*)",array("dn"));
- $this->object_count=$ldap->count();
/* Preselect used features */
$oc = $ldap->get_objectclasses();
function update_strings()
{
- $this->s_title = _("Notification and feedback");
+ $this->s_title = _("Feedback");
$this->s_info = _("Get notifications or send feedback");
$this->s_title_long = _("Notification and feedback");
}
}
$additional_info ="";
-
if(isset($_POST['send_feedback'])){
$msgs = $this->check_feedback();
if(count($msgs)){
foreach($msgs as $msg){
- print_red($msg);
+ msg_dialog::display(_("Setup error"), $msg, ERROR_DIALOG);
}
}else{
$str = $this->create_serialise_data_string();
$ret = @fopen($feedback_url,"r");
if(!$ret){
- print_red(sprintf(_("Could not connect to feedback server (%s). There is possibly no connection to the internet."),$this->feedback_url));
+ msg_dialog::display(_("Feedback error"), sprintf(_("Cannot send feedback to '%s': %s"), $this->feedback_url, $ret), ERROR_DIALOG);
}else{
$ret_value="";
while($ret && !feof($ret)){
$ret_value.= fgets($ret,256);
}
if(!preg_match("/successful/i",$ret_value)){
- print_red(_("Error while sending your feedback. The service is possible temporary unavailable"));
+ msg_dialog::display(_("Feedback error"), _("Cannot send feedback: service temporarily unavailable"), ERROR_DIALOG);
}else{
- $additional_info = "<font color='green'>"._("Feedback sucessfully send")."</font>";
+ $this->feedback_send = TRUE;
}
}
@fclose($ret);
$smarty = get_smarty();
foreach($this->attributes as $attr){
- $smarty->assign($attr, $this->$attr);
+ $smarty->assign($attr, reverse_html_entities($this->$attr));
}
+ $smarty->assign("feedback_send",$this->feedback_send);
$smarty->assign("years",$years);
$smarty->assign("features_used",$this->features_used);
- $smarty->assign("additional_info",$additional_info);
+ $smarty->assign("additional_info", reverse_html_entities($additional_info));
$smarty->assign ("must", "<font class=\"must\">*</font>");
return($smarty->fetch(get_template_path("setup_feedback.tpl",TRUE,dirname(__FILE__))));
}
function check_feedback()
{
$msgs = array();
- if(!is_email($this->eMail) || empty($this->eMail)){
+ if($this->subscribe && (!tests::is_email($this->eMail) || empty($this->eMail))){
$msgs[] = _("Please specify a valid email address.");
}
if(!$this->subscribe && !$this->use_gosa_announce){
- $msgs[] = _("You should have enabled at least one option, to subscribe or send your feedback.");
+ $msgs[] = _("You have to select at least one of both options, subscribe or send feedback.");
}
return($msgs);