Code

Added additional check to delete block
[gosa.git] / setup / class_setupStep_Feedback.inc
index bd2580b44d89b8d6a0bb2b1dd97abd6d7e44e6c2..fd6e394c5741de41e01464f7b31d84668c226ffe 100644 (file)
@@ -28,10 +28,10 @@ class Step_Feedback  extends setup_step
   var $organization       = "";
   var $eMail              = "";
   var $name               = "";
-  var $subscribe          = TRUE;
-  var $use_gosa_announce  = TRUE;
+  var $subscribe          = FALSE;
+  var $use_gosa_announce  = FALSE;
 
-  var $feedback_url         = "https://oss.gonicus.de/feedback/send.php";
+  var $feedback_url         = "http://oss.gonicus.de/gosa-feedback/";
   var $get_started          = TRUE;
   var $problems_encountered = "";
   
@@ -98,7 +98,7 @@ class Step_Feedback  extends setup_step
     $this->features_used['asterisk']    = array("USED" => isset($oc['goFonAccount']), 
                                                 "NAME" => _("Asterisk administration"));
     $this->features_used['inventory']   = array("USED" => isset($oc['glpiAccount']) , 
-                                                "NAME" => _("System invetory"));
+                                                "NAME" => _("System inventory"));
     $this->features_used['system']      = array("USED" => FALSE , 
                                                 "NAME" => _("System-/Configmanagement"));
     $this->features_used['addressbook'] = array("USED" => FALSE , 
@@ -125,7 +125,7 @@ class Step_Feedback  extends setup_step
 
     if(isset($_POST['send_feedback'])){
 
-      $msgs = $this->check();
+      $msgs = $this->check_feedback();
       if(count($msgs)){
         foreach($msgs as $msg){
           print_red($msg);
@@ -143,8 +143,8 @@ class Step_Feedback  extends setup_step
           while($ret && !feof($ret)){
             $ret_value.= fgets($ret,256);
           }
-          if(!preg_match("/successfully/i",$ret_value)){
-            print_red(sprintf(_("Could not send feedback. Script said '%s'."),$ret_value));
+          if(!preg_match("/successful/i",$ret_value)){
+            print_red(_("Error while sending your feedback. The service is possible temporary unavailable"));
           }else{
             $additional_info = "<font color='green'>"._("Feedback sucessfully send")."</font>";
           }
@@ -172,12 +172,17 @@ class Step_Feedback  extends setup_step
   }
 
 
-  function check()
+  function check_feedback()
   {
     $msgs = array();
     if(!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.");
+    }
+
     return($msgs);
   }