From: cajus Date: Tue, 17 May 2005 15:23:43 +0000 (+0000) Subject: Added imagick alternative for icon conversion X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=89e04f04b51710905ad3cd062eaaf919296394ee;p=gosa.git Added imagick alternative for icon conversion Updated contributed files git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@235 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/AUTHORS b/AUTHORS index 3f1f4bb14..b1ad7d0bb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,9 @@ This is the alphabetical list of all people that have contributed to the GOsa project, beeing code, translations, documentation and additional help. +* Alessandro Amici + Italian translations + * Markus Amersdorfer Wiki setup, Testing, hints, proposals diff --git a/Changelog b/Changelog index 8e378ec0d..314bd7035 100644 --- a/Changelog +++ b/Changelog @@ -1,11 +1,27 @@ GOsa2 changelog =============== -* gosa 2.3.1 +* gosa 2.4beta1 - Override automatically detected user bases if they don't exist - Don't shred samba group ID's if they are not present in the combobox - Updated smarty to version 2.6.9 + - Updated GOfon support to handle new features + - Replacement of most external programm calls + - Samba3 bugfixes for munged dial handling + - Updated LDIF export + - Improved setup checks to find more possible errors + - Fixed index ruler for long lists + - Completed system creation for servers, phones and misc components + - Added support for kolab users and kolab server settings + - Added server settings + - Added LDIF import + - Added CSV import + - Added italien translations (thanks to Alessandro Amici) + - Added subtree search checkbox in lists with potential higher + usage + - Added version indicator to make support more easy + - Added sample databases for fax, phone and system logging * gosa 2.3 - Updated smarty to version 2.6.7 diff --git a/contrib/openldap/gofax.schema b/contrib/openldap/gofax.schema index 76dcc3907..b949016cb 100644 --- a/contrib/openldap/gofax.schema +++ b/contrib/openldap/gofax.schema @@ -71,9 +71,9 @@ attributetype ( 1.3.6.1.4.1.10098.1.1.7.10 NAME 'goFaxIsEnabled' SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.10098.1.1.7.11 NAME 'facsimileAlternateTelephoneNumber' - EQUALITY telephoneNumberMatch - SUBSTR telephoneNumberSubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 ) + EQUALITY telephoneNumberMatch + SUBSTR telephoneNumberSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} ) # objectclass objectclass (1.3.6.1.4.1.10098.1.2.1.11 NAME 'goFaxAccount' SUP top AUXILIARY diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 44c07f444..6330e399b 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -58,28 +58,27 @@ class application extends plugin return ($display); } - /* Fill templating stuff */ - $smarty= get_smarty(); - $smarty->assign("cn", $this->cn); - $smarty->assign("bases", $this->config->idepartments); + /* Fill templating stuff */ + $smarty= get_smarty(); + $smarty->assign("cn", $this->cn); + $smarty->assign("bases", $this->config->idepartments); if ($this->dn == "new"){ - $smarty->assign("selectmode", ""); - $smarty->assign("namemode", ""); - } else { - $smarty->assign("namemode", "readonly"); - $smarty->assign("selectmode", "disabled"); - } + $smarty->assign("selectmode", ""); + $smarty->assign("namemode", ""); + } else { + $smarty->assign("namemode", "readonly"); + $smarty->assign("selectmode", "disabled"); + } /* Get random number for pictures */ - srand((double)microtime()*1000000); + srand((double)microtime()*1000000); $smarty->assign("rand", rand(0, 10000)); - /* Variables */ - foreach(array("description", "gosaApplicationExecute", "gosaApplicationName") as $val){ - - $smarty->assign($val, $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); - } + /* Variables */ + foreach(array("description", "gosaApplicationExecute", "gosaApplicationName") as $val){ + $smarty->assign($val, $this->$val); + $smarty->assign($val."ACL", chkacl($this->acl, $val)); + } /* Checkboxes */ foreach (array("G" => "exec_for_groupmembers", "O" => "overwrite_config", @@ -142,33 +141,59 @@ class application extends plugin } /* Check for picture upload */ - - if (isset($_FILES['picture_file']['name']) && $_FILES['picture_file']['name'] != ""){ if (!is_uploaded_file($_FILES['picture_file']['tmp_name'])) { print_red (_("The specified picture has not been uploaded correctly.")); } - /* Load the new uploaded Photo */ - if(!$handle = imagick_ReadImage($_FILES['picture_file']['tmp_name'])) { - gosa_log("Can't Load image"); - } - - /* Resizing image to 147x200 and blur */ - if(!imagick_resize($handle,48,48,IMAGICK_FILTER_GAUSSIAN,0)){ - gosa_log("imagick_resize failed"); - } - - /* Converting image to JPEG */ - if(!imagick_convert($handle,"PNG")) { - gosa_log("Can't Convert to PNG"); - } - - if(imagick_writeimage($handle,$_FILES['picture_file']['tmp_name'])){ - gosa_log("can't write to specified folder"); + if (!function_exists("imagick_blob2image")){ + /* Get temporary file name for conversation */ + $fname = tempnam ("/tmp", "GOsa"); + + /* Open file and write out photoData */ + $fp = fopen ($fname, "w"); + fwrite ($fp, $_FILES['picture_file']['tmp_name']); + fclose ($fp); + + /* Build conversation query. Filename is generated automatically, so + we do not need any special security checks. Exec command and save + output. For PHP safe mode, you'll need a configuration which respects + image magick as executable... */ + $query= "convert -size 48x48 $fname -resize 48x48 +profile \"*\" -"; + @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $query, "Execute"); + + /* Read data written by convert */ + $output= ""; + $sh= popen($query, 'r'); + while (!feof($sh)){ + $output.= fread($sh, 4096); + } + pclose($sh); + + unlink($fname); + } else { + + /* Load the new uploaded Photo */ + if(!$handle = imagick_ReadImage($_FILES['picture_file']['tmp_name'])){ + gosa_log("Can't Load image"); + } + + /* Resizing image to 147x200 and blur */ + if(!imagick_resize($handle,48,48,IMAGICK_FILTER_GAUSSIAN,0)){ + gosa_log("imagick_resize failed"); + } + + /* Converting image to JPEG */ + if(!imagick_convert($handle,"PNG")) { + gosa_log("Can't Convert to PNG"); + } + + if(imagick_writeimage($handle,$_FILES['picture_file']['tmp_name'])){ + gosa_log("can't write to specified folder"); + } + + imagick_free($handle); } - - imagick_free($handle); /* Activate new picture */ $this->set_picture($_FILES['picture_file']['tmp_name']);