]> git.sur5r.net Git - contagged/blobdiff - entry.php
Display errors when image upload fails
[contagged] / entry.php
index bb207ceb10e62d40a22faade43995ac6e9dfe9dd..a19888ec24375478b608470981bd258629cc6d91 100644 (file)
--- a/entry.php
+++ b/entry.php
@@ -89,8 +89,9 @@ function _fetchData($dn){
   global $smarty;
   global $users; //contains the users for manager role
 
-  $sr = ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)');
-  if(!ldap_count_entries($LDAP_CON,$sr)){
+  $sr = @ldap_search($LDAP_CON,$dn,'(objectClass=inetOrgPerson)');
+  tpl_ldaperror();
+  if(!@ldap_count_entries($LDAP_CON,$sr)){
     return false;
   }
   $result = ldap_get_binentries($LDAP_CON, $sr);
@@ -218,6 +219,8 @@ function _delEntry($dn){
  * gets the binary data from an uploaded file
  */
 function _getUploadData(){
+  global $smarty;
+  global $lang;
   $file = $_FILES['photoupload'];
 
   if (is_uploaded_file($file['tmp_name'])) {
@@ -227,7 +230,11 @@ function _getUploadData(){
       fclose($fh);
       unlink($file['tmp_name']);
       return $data;
+    } else {
+      $smarty->assign('jpegError',$lang['err_wrongFileType']); 
     }
+  } else {
+    $smarty->assign('jpegError',$lang['err_fileNotUploaded']);
   }
   return '';
 }