- /**
- * gets the binary data from an uploaded file
- */
- function _getUploadData(){
- $file = $_FILES[photoupload];
-
- if (is_uploaded_file($file[tmp_name])) {
- if(preg_match('=image/p?jpe?g=',$file[type])){
- $fh = fopen($file[tmp_name],'r');
- $data = fread($fh,$file[size]);
- fclose($fh);
- unlink($file[tmp_name]);
- return $data;
- }
+/**
+ * does as the name says - delete the whole entry
+ */
+function _delEntry($dn){
+ global $LDAP_CON;
+ if(ldap_full_delete($LDAP_CON,$dn,true)){
+ header("Location: index.php");
+ exit;
+ }
+}
+
+/**
+ * gets the binary data from an uploaded file
+ */
+function _getUploadData(){
+ global $smarty;
+ global $lang;
+ $file = $_FILES['photoupload'];
+
+ if (is_uploaded_file($file['tmp_name'])) {
+ if(preg_match('=image/p?jpe?g=',$file['type'])){
+ $fh = fopen($file['tmp_name'],'r');
+ $data = fread($fh,$file['size']);
+ fclose($fh);
+ unlink($file['tmp_name']);
+ return $data;
+ } else {
+ $smarty->assign('jpegError',$lang['err_wrongFileType']);