From: Dominik Eckelmann Date: Wed, 3 Dec 2008 12:06:04 +0000 (+0100) Subject: Display errors when image upload fails X-Git-Tag: 0.7.1~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2bdafc359ef325594664ffb76eddabec43afb4fc;p=contagged Display errors when image upload fails darcs-hash:20081203120604-cca46-290cb6d9d7a3ea9966dc1513926afbd4c0eb9051.gz --- diff --git a/entry.php b/entry.php index 524bb54..a19888e 100644 --- a/entry.php +++ b/entry.php @@ -219,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'])) { @@ -228,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 ''; } diff --git a/inc/lang/de.php b/inc/lang/de.php index 2109146..c171645 100644 --- a/inc/lang/de.php +++ b/inc/lang/de.php @@ -67,17 +67,18 @@ $lang['username'] = 'Benutzername'; $lang['password'] = 'Passwort'; $lang['remember'] = 'Auf diesem Computer angemeldet bleiben'; -$lang['msg_login'] = 'Bitte melden sie sich an!'; -$lang['msg_loginfail'] = 'Anmeldung fehlgeschlagen!'; -$lang['msg_reallydel'] = 'Eintrag wirklich löschen?'; -$lang['msg_addto'] = 'Zu welchem Adressbuch soll der Eintrag hinzugefügt werden?'; -$lang['msg_jpegonly'] = 'Nur JPEG'; -$lang['msg_dateformat'] = 'JJJJ-MM-TT'; -$lang['msg_uploadvcf'] = 'Upload VCard File'; -$lang['msg_tagsep'] = 'Durch Komma getrennt'; - -$lang['err_noentries'] = 'Keine Einträge'; -$lang['err_ldap'] = 'Der LDAP Server lieferte folgende Fehlermeldungen'; +$lang['msg_login'] = 'Bitte melden sie sich an!'; +$lang['msg_loginfail'] = 'Anmeldung fehlgeschlagen!'; +$lang['msg_reallydel'] = 'Eintrag wirklich löschen?'; +$lang['msg_addto'] = 'Zu welchem Adressbuch soll der Eintrag hinzugefügt werden?'; +$lang['msg_jpegonly'] = 'Nur JPEG'; +$lang['msg_dateformat'] = 'JJJJ-MM-TT'; +$lang['msg_uploadvcf'] = 'Upload VCard File'; +$lang['msg_tagsep'] = 'Durch Komma getrennt'; +$lang['err_noentries'] = 'Keine Einträge'; +$lang['err_ldap'] = 'Der LDAP Server lieferte folgende Fehlermeldungen'; +$lang['err_wrongFileType'] = 'Die Datei ist kein bild.'; +$lang['err_fileNotUploaded'] = 'Die Datei konnte nicht hochgeladen werden, ist sie vielleicht zu groß?'; $lang['openxchange'] = 'Xchange Information'; $lang['moreopenxchange'] = 'Xchange Information (Fort.)'; diff --git a/inc/lang/en.php b/inc/lang/en.php index 5502935..3341421 100644 --- a/inc/lang/en.php +++ b/inc/lang/en.php @@ -76,8 +76,10 @@ $lang['msg_dateformat'] = 'YYYY-MM-DD'; $lang['msg_uploadvcf'] = 'Upload VCard File'; $lang['msg_tagsep'] = 'Comma separated'; -$lang['err_noentries'] = 'No entries'; -$lang['err_ldap'] = 'The LDAP server returned the following errors'; +$lang['err_noentries'] = 'No entries'; +$lang['err_ldap'] = 'The LDAP server returned the following errors'; +$lang['err_wrongFileType'] = 'The file is no image.'; +$lang['err_fileNotUploaded'] = 'The file cannot be uploaded, may its to huge?'; $lang['openxchange'] = 'Xchange Information'; $lang['moreopenxchange'] = 'Xchange Information Cont\'d'; diff --git a/templates/entry_edit.tpl b/templates/entry_edit.tpl index 62b43d2..2ea276c 100644 --- a/templates/entry_edit.tpl +++ b/templates/entry_edit.tpl @@ -187,6 +187,11 @@ {/if} +{if $jpegError} + + {$jpegError} + +{/if} {if $fields.birthday} {$lang.birthday}:
({$lang.msg_dateformat})