Code

Updated infoPage
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Nov 2010 16:27:45 +0000 (16:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Nov 2010 16:27:45 +0000 (16:27 +0000)
-Added userinfo and picture

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20393 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/main.php
gosa-core/ihtml/themes/default/infoPage.tpl
gosa-core/plugins/generic/infoPage/class_infoPage.inc

index 1af718b5bf00ba4fa98076f0399faa0408d6d992..9fb52e0ed5dda3023c8ea8726ca3df1c027f6955 100644 (file)
@@ -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";
index 8bd6648ed130ac9ece0f89cd9a8fbbfd2608427a..2954864368eefc9e6010bd63492f9eba4456370b 100644 (file)
@@ -1 +1,68 @@
-asdf
+<h3>{t}Welcome to the GOsa self service!{/t}</h3>
+<hr>
+
+{if $personalInfoAllowed}
+
+    <h3>{t}Information about you{/t}:</h3>
+
+    <table width="100%">
+        <tr>
+            <td style="width:33%">
+                <table>
+                    {if $uid != ""}<tr><td>{t}User-ID{/t}:</td><td>{$uid}</td></tr>{/if}
+                    {if $sn != ""}<tr><td>{t}Surname{/t}:</td><td>{$sn}</td></tr>{/if}
+                    {if $givenName != ""}<tr><td>{t}Given name{/t}:</td><td>{$givenName}</td></tr>{/if}
+                    {if $personalTitle != ""}<tr><td>{t}Personal title{/t}:</td><td>{$personalTitle}</td></tr>{/if}
+                    {if $academicTitle != ""}<tr><td>{t}Academic title{/t}:</td><td>{$academicTitle}</td></tr>{/if}
+
+                    {if $dateOfBirth != ""}<tr><td>{t}Date of birth{/t}:</td><td>{$dateOfBirth}</td></tr>{/if}
+                    {if $homePhone != ""}<tr><td>{t}Home phone{/t}:</td><td>{$homePhone}</td></tr>{/if}
+                    {if $homePostalAddress != ""}<tr><td>{t}Home postal address{/t}:</td><td><pre>{$homePostalAddress}</pre></td></tr>{/if}
+                </table>
+            </td>
+            <td style="width:33%">
+                <table>
+                    {if $o != ""}<tr><td>{t}Organization{/t}:</td><td>{$o}</td></tr>{/if}
+                    {if $ou != ""}<tr><td>{t}Organizational unit{/t}:</td><td>{$ou}</td></tr>{/if}
+                    {if $l != ""}<tr><td>{t}Location{/t}:</td><td>{$l}</td></tr>{/if}
+                    {if $street != ""}<tr><td>{t}Street{/t}:</td><td>{$street}</td></tr>{/if}
+                    {if $departmentNumber != ""}<tr><td>{t}Department number{/t}:</td><td>{$departmentNumber}</td></tr>{/if}
+
+                    {if $employeeNumber != ""}<tr><td>{t}Employee number{/t}:</td><td>{$employeeNumber}</td></tr>{/if}
+                    {if $employeeType != ""}<tr><td>{t}Employee type{/t}:</td><td>{$employeeType}</td></tr>{/if}
+
+                </table>
+            </td>
+            {if $jpegPhoto != ""}
+                <td>
+                    <img  src="getbin.php?rand={$rand}" alt='' style='max-width:147px; max-height: 200px; vertical-align: middle;' >
+                </td>
+            {/if}
+        </tr>
+    </table>
+                
+
+{/if}
+
+<hr>
+
+
+<h3>{t}Management shortcuts{/t}</h3>
+
+[aus gosa.conf, Ansicht wie im icon-Menu, max. 4 Icons nebeneinander]
+
+<hr>
+
+<h3>{t}If you need assistance with this interface, please contact your administrative contact{/t}:</h3>
+
+<pre>
+[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
+</pre>
+<hr>
index 8e7a0db0153ea8d14addd23859f5c236ad6212c2..d9d2c2db20bf911730c6db2e6237b912677a716e 100644 (file)
@@ -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")));
     }
 }