summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9c0d57)
raw | patch | inline | side by side (parent: c9c0d57)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 1 Dec 2010 14:07:30 +0000 (14:07 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 1 Dec 2010 14:07:30 +0000 (14:07 +0000) |
-Added iamge ACLs
-Added default image.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20491 594d385d-05f5-0310-b6e9-bd551577e9d8
-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 | patch | blob | history | |
gosa-core/plugins/generic/infoPage/class_infoPage.inc | patch | blob | history |
diff --git a/gosa-core/ihtml/themes/default/infoPage.tpl b/gosa-core/ihtml/themes/default/infoPage.tpl
index f7f0b77edeb7fd97e5eb31b5568dd2754fc580f6..269135da0630da0c6c99e70999745a5b6619b1ee 100644 (file)
<table width="100%">
<tr>
- <td>
- <img src="getbin.php?rand={$rand}" alt='' style='max-width:147px; max-height: 200px; vertical-align: middle;' >
+ <td style='width:147px; height:200px; background-color:gray; vertical-align: middle;' >
+ {if $jpegPhoto == ""}
+ <img src="plugins/users/images/default.jpg" alt=''>
+ {else}
+ <img src="getbin.php?rand={$rand}" alt='' style='max-width:147px; max-height: 200px; vertical-align: middle;' >
+ {/if}
</td>
<td style="width:33%">
<table>
diff --git a/gosa-core/plugins/generic/infoPage/class_infoPage.inc b/gosa-core/plugins/generic/infoPage/class_infoPage.inc
index ce958029feebcc4312aacd636c6ec6ba1c82f51b..ec0aba6216b6b9ab02a6cb20fc21f804f2ac6f51 100644 (file)
}
}
- #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/", "<br>", $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])));
}