From ad2b9fa6de15512112174da42a924818c9a9407f Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 1 Dec 2010 08:55:59 +0000 Subject: [PATCH] Update flush git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20460 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/ihtml/themes/default/infoPage.tpl | 18 +++++++----------- .../generic/infoPage/class_infoPage.inc | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/gosa-core/ihtml/themes/default/infoPage.tpl b/gosa-core/ihtml/themes/default/infoPage.tpl index 51b153926..de7fc22a7 100644 --- a/gosa-core/ihtml/themes/default/infoPage.tpl +++ b/gosa-core/ihtml/themes/default/infoPage.tpl @@ -1,12 +1,12 @@ -

{t}Welcome to the GOsa self service!{/t}

-
- {if $personalInfoAllowed} -

{t}Information about you{/t}:

+

{t}Personal information{/t}

+ - - {if $jpegPhoto} - - {/if}
+ + {if $uid != ""}{/if} @@ -16,11 +16,12 @@ {if $academicTitle != ""}{/if} {if $dateOfBirth != ""}{/if} + {if $mail != ""}{/if} {if $homePhone != ""}{/if} - {if $homePostalAddress != ""}{/if} + {if $homePostalAddress != ""}{/if}
{t}User-ID{/t}:{$uid}
{t}Academic title{/t}:{$academicTitle}
{t}Date of birth{/t}:{$dateOfBirth}
{t}Mail{/t}:{$mail}
{t}Home phone{/t}:{$homePhone}
{t}Home postal address{/t}:
{$homePostalAddress}
{t}Home postal address{/t}:{$homePostalAddress}
+ {if $o != ""}{/if} {if $ou != ""}{/if} @@ -33,11 +34,6 @@
{t}Organization{/t}:{$o}
{t}Organizational unit{/t}:{$ou}
- -
diff --git a/gosa-core/plugins/generic/infoPage/class_infoPage.inc b/gosa-core/plugins/generic/infoPage/class_infoPage.inc index 2745024c2..701114349 100644 --- a/gosa-core/plugins/generic/infoPage/class_infoPage.inc +++ b/gosa-core/plugins/generic/infoPage/class_infoPage.inc @@ -126,31 +126,39 @@ class infoPage extends plugin { $smarty = get_smarty(); $personalInfoAllowed = FALSE; - foreach(array("uid","sn","givenName","street","l","o","ou","jpegPhoto","personalTitle", + foreach(array("uid","sn","givenName","mail","street","l","o","ou","jpegPhoto","personalTitle", "academicTitle","dateOfBirth","homePostalAddress","homePhone","departmentNumber", "employeeNumber","employeeType") as $attr){ $smarty->assign($attr, ""); if(preg_match("/r/", $this->ui->get_permissions($this->ui->dn,"users/user", $attr)) && isset($this->attrs[$attr][0])){ - $smarty->assign($attr,set_post( $this->attrs[$attr][0])); + $smarty->assign($attr, set_post($this->attrs[$attr][0])); $personalInfoAllowed = TRUE; } } + #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])){ + $smarty->assign("homePostalAddress", preg_replace("/\n/", "
", $this->attrs['homePostalAddress'][0])); + } + session::set('binary',$this->attrs['jpegPhoto'][0]); session::set('binarytype',"image/jpeg"); // Set date of birth - if(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]))); } $smarty->assign("rand", rand(0, 99999999)); $smarty->assign("personalInfoAllowed", $personalInfoAllowed); - $smarty->assign("attrs", $this->attrs); $smarty->assign("managers", $this->managers); $smarty->assign("plugins", $this->plugins); - $smarty->assign("jpegPhoto", isset($this->attrs['jpegPhoto'])); $smarty->assign("managersCnt", count($this->managers)); return($smarty->fetch(get_template_path("infoPage.tpl"))); } -- 2.30.2