summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b78c29e)
raw | patch | inline | side by side (parent: b78c29e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 May 2007 07:47:49 +0000 (07:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 May 2007 07:47:49 +0000 (07:47 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6288 594d385d-05f5-0310-b6e9-bd551577e9d8
setup/class_setupStep_Feedback.inc | patch | blob | history |
index beb81dfe131e31a2de3ceab40116b38cdf452e25..59849117f9dcd9b4fe111cdc414e21c004f2e0d9 100644 (file)
var $subscribe = TRUE;
var $use_gosa_announce = TRUE;
+ var $feedback_url = "https://oss.gonicus.de/feedback/send.php";
var $get_started = TRUE;
var $problems_encountered = "";
$this->update_strings();
}
+
function init()
{
$cv = $this->parent->captured_values;
/* Initialize values */
$this->use_since = date("Y");
$this->organization = preg_replace("/^[^=]*+=(.*),.*$/","\\1",$cv['base']);
- $this->distribution = PHP_OS."/".$_SERVER['SERVER_SOFTWARE'];
+ $this->distribution = "";
$this->web_server = $_SERVER['SERVER_SOFTWARE'];
-
$this->php_version = PHP_VERSION;
/* On first call check for rid/sid base */
$cv['connection'],
FALSE,
$cv['tls']);
-
$ldap->cd($cv['base']);
$ldap->search("(objectClass=*)",array("dn"));
$this->object_count=$ldap->count();
+ /* Preselect used features */
$oc = $ldap->get_objectclasses();
-
-
$this->features_used = array();
$this->features_used['posix'] = array("USED" => isset($oc['posixAccount']) ,
"NAME" => _("UNIX accounts/groups"));
"NAME" => _("Addressbook"));
}
+
function update_strings()
{
$this->s_title = _("Notification and feedback");
$this->s_info = _("Get notifications or send feedback");
$this->s_title_long = _("Notification and feedback");
}
+
function execute()
{
$this->init();
}
+ if(isset($_POST['send_feedback'])){
+
+ $msgs = $this->check();
+ if(count($msgs)){
+ foreach($msgs as $msg){
+ print_red($msg);
+ }
+ }else{
+ $str = $this->create_serialise_data_string();
+ $feedback_url = $this->feedback_url."?data=".base64_encode($str);
+
+ $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));
+ }else{
+ $ret_value="";
+ 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));
+ }
+ }
+ @fclose($ret);
+ }
+ }
+
$years = array();
for($i = date("Y") ; $i >= 2001; $i--){
$years[$i] = $i;
return($smarty->fetch(get_template_path("setup_feedback.tpl",TRUE,dirname(__FILE__))));
}
+
+ function check()
+ {
+ $msgs = array();
+ if(!is_email($this->eMail) || empty($this->eMail)){
+ $msgs[] = _("Please specify a valid email address.");
+ }
+ return($msgs);
+ }
+
+
function save_object()
{
if(isset($_POST['step_feedback'])){
$this->features_used[$key]['USED'] = FALSE;
}
}
- if(isset($_POST['send_feedback'])){
- $str = $this->create_serialise_data_string();
-
- $feedback_url = "http://dyn-111/hickert-test/feedback.php?data=".serialize($str);
- $ret = fopen($feedback_url,"r");
- $ret_value = fgets($ret,256);
- fclose($ret);
-
- if(!preg_match("/successfully/i",$ret_value)){
- print_red(_("Could not send feedback."));
- }
- }
}
-
}
+
function create_serialise_data_string()
{
-
$str = "#FEEDBACK ".date("H:i:s d:m:Y");
if($this->subscribe){