From e95a829b93987e0b2268ba86ba5a6d68eab8339a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 1 Dec 2010 14:07:30 +0000 Subject: [PATCH 1/1] Updated infoPage -Added iamge ACLs -Added default image. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20491 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/ihtml/themes/default/infoPage.tpl | 8 +++++-- .../generic/infoPage/class_infoPage.inc | 21 +++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/gosa-core/ihtml/themes/default/infoPage.tpl b/gosa-core/ihtml/themes/default/infoPage.tpl index f7f0b77ed..269135da0 100644 --- a/gosa-core/ihtml/themes/default/infoPage.tpl +++ b/gosa-core/ihtml/themes/default/infoPage.tpl @@ -5,8 +5,12 @@ -
- + + {if $jpegPhoto == ""} + + {else} + + {/if} diff --git a/gosa-core/plugins/generic/infoPage/class_infoPage.inc b/gosa-core/plugins/generic/infoPage/class_infoPage.inc index ce958029f..ec0aba621 100644 --- a/gosa-core/plugins/generic/infoPage/class_infoPage.inc +++ b/gosa-core/plugins/generic/infoPage/class_infoPage.inc @@ -135,21 +135,24 @@ class infoPage extends plugin } } - #TODO: Permission - if(!isset($this->attrs['jpegPhoto'])){ - #echo "No image..."; - } - // Convert address - if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", "homePostalAddress")) && isset($this->attrs['homePostalAddress'][0])){ + if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", "homePostalAddress")) && + isset($this->attrs['homePostalAddress'][0])){ $smarty->assign("homePostalAddress", preg_replace("/\n/", "
", $this->attrs['homePostalAddress'][0])); } - session::set('binary',$this->attrs['jpegPhoto'][0]); - session::set('binarytype',"image/jpeg"); + // Assign JPEG Photo only if it is set and if we are allowed to view it. + $smarty->assign("jpegPhoto", ""); + if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", "userPicture")) && + isset($this->attrs['jpegPhoto'][0])){ + session::set('binary',$this->attrs['jpegPhoto'][0]); + session::set('binarytype',"image/jpeg"); + $smarty->assign("jpegPhoto", $this->attrs['jpegPhoto']); + } // Set date of birth - if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", "dateOfBirth")) && isset($this->attrs['dateOfBirth'][0])){ + if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", "dateOfBirth")) && + isset($this->attrs['dateOfBirth'][0])){ $smarty->assign("dateOfBirth", date('d.m.Y',strtotime($this->attrs['dateOfBirth'][0]))); } -- 2.30.2