From: hickert Date: Fri, 26 Nov 2010 16:27:45 +0000 (+0000) Subject: Updated infoPage X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=86dc71e47735c9e9a173a5bba00b640be0a2db84;p=gosa.git Updated infoPage -Added userinfo and picture git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20393 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 1af718b5b..9fb52e0ed 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -236,7 +236,7 @@ if ($config->boolValueIsTrue("core","handleExpiredAccounts")){ } } -$smarty->assign("noMenuMode", FALSE); +$smarty->assign("noMenuMode", count($plist->getRegisteredMenuEntries()) == 0); if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){ $plug= validate($_GET['plug']); $plugin_dir= $plist->get_path($plug); @@ -253,7 +253,6 @@ if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){ if(count($plist->getRegisteredMenuEntries()) == 0){ session::global_set('plugin_dir',"infoPage"); $plugin_dir= "$BASE_DIR/plugins/generic/infoPage"; - $smarty->assign("noMenuMode", TRUE); }else{ session::global_set('plugin_dir',"welcome"); $plugin_dir= "$BASE_DIR/plugins/generic/welcome"; diff --git a/gosa-core/ihtml/themes/default/infoPage.tpl b/gosa-core/ihtml/themes/default/infoPage.tpl index 8bd6648ed..295486436 100644 --- a/gosa-core/ihtml/themes/default/infoPage.tpl +++ b/gosa-core/ihtml/themes/default/infoPage.tpl @@ -1 +1,68 @@ -asdf +

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

+
+ +{if $personalInfoAllowed} + +

{t}Information about you{/t}:

+ + + + + + {if $jpegPhoto != ""} + + {/if} + +
+ + {if $uid != ""}{/if} + {if $sn != ""}{/if} + {if $givenName != ""}{/if} + {if $personalTitle != ""}{/if} + {if $academicTitle != ""}{/if} + + {if $dateOfBirth != ""}{/if} + {if $homePhone != ""}{/if} + {if $homePostalAddress != ""}{/if} +
{t}User-ID{/t}:{$uid}
{t}Surname{/t}:{$sn}
{t}Given name{/t}:{$givenName}
{t}Personal title{/t}:{$personalTitle}
{t}Academic title{/t}:{$academicTitle}
{t}Date of birth{/t}:{$dateOfBirth}
{t}Home phone{/t}:{$homePhone}
{t}Home postal address{/t}:
{$homePostalAddress}
+
+ + {if $o != ""}{/if} + {if $ou != ""}{/if} + {if $l != ""}{/if} + {if $street != ""}{/if} + {if $departmentNumber != ""}{/if} + + {if $employeeNumber != ""}{/if} + {if $employeeType != ""}{/if} + +
{t}Organization{/t}:{$o}
{t}Organizational unit{/t}:{$ou}
{t}Location{/t}:{$l}
{t}Street{/t}:{$street}
{t}Department number{/t}:{$departmentNumber}
{t}Employee number{/t}:{$employeeNumber}
{t}Employee type{/t}:{$employeeType}
+
+ +
+ + +{/if} + +
+ + +

{t}Management shortcuts{/t}

+ +[aus gosa.conf, Ansicht wie im icon-Menu, max. 4 Icons nebeneinander] + +
+ +

{t}If you need assistance with this interface, please contact your administrative contact{/t}:

+ +
+[liste von uids aus gosa.conf, die aufgelöst wird nach:]
+ * Hugo Verwalter
+   Mail:  verwalter@where.com
+   Phone: 771
+
+ * Gundula Ver-Walter
+   Mail:  gundula@where.com
+   Phone: 772
+
+
diff --git a/gosa-core/plugins/generic/infoPage/class_infoPage.inc b/gosa-core/plugins/generic/infoPage/class_infoPage.inc index 8e7a0db01..d9d2c2db2 100644 --- a/gosa-core/plugins/generic/infoPage/class_infoPage.inc +++ b/gosa-core/plugins/generic/infoPage/class_infoPage.inc @@ -2,10 +2,37 @@ class infoPage extends plugin { + private $ui; + + function __construct($config) + { + $this->config = &$config; + $this->ui = get_userinfo(); + + plugin::plugin($config, $this->ui->dn); + } function execute() { $smarty = get_smarty(); + + $personalInfoAllowed = FALSE; + foreach(array("uid","sn","givenName","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, $this->attrs[$attr][0]); + $personalInfoAllowed = TRUE; + } + } + + session::set('binary',$this->attrs['jpegPhoto'][0]); + session::set('binarytype',"image/jpeg"); + $smarty->assign("rand", rand(0, 99999999)); + $smarty->assign("personalInfoAllowed", $personalInfoAllowed); + $smarty->assign("attrs", $this->attrs); return($smarty->fetch(get_template_path("infoPage.tpl"))); } }