require_once('inc/init.php');
ldap_login();
-if ($conf['userlogreq'] && $user == ''){
+if ($conf['userlogreq'] && !isset($_SESSION['ldapab']['username'])){
header('Location: login.php');
exit();
}
$now = time();
$newdn = 'uid='.$now;
if (empty($_REQUEST['type'])) { $_REQUEST['type']='public'; }
- if($_REQUEST['type'] == 'private'){
+ if($_REQUEST['type'] == 'private' && $conf['privatebook']){
$newdn .= ', '.$conf['privatebook'].', '.$_SESSION['ldapab']['binddn'];
}else{
$newdn .= ', '.$conf['publicbook'];
* gets the binary data from an uploaded file
*/
function _getUploadData(){
+ global $smarty;
+ global $lang;
$file = $_FILES['photoupload'];
if (is_uploaded_file($file['tmp_name'])) {
fclose($fh);
unlink($file['tmp_name']);
return $data;
+ } else {
+ $smarty->assign('jpegError',$lang['err_wrongFileType']);
}
+ } else {
+ $smarty->assign('jpegError',$lang['err_fileNotUploaded']);
}
return '';
}