Code

Update flush
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Dec 2010 08:55:59 +0000 (08:55 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Dec 2010 08:55:59 +0000 (08:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20460 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 51b1539262c21d56aad62850d6fb104e6c91b184..de7fc22a7cc8c90e4fff55156fa81b91218ac4b5 100644 (file)
@@ -1,12 +1,12 @@
-<h3>{t}Welcome to the GOsa self service!{/t}</h3>
-<hr>
-
 {if $personalInfoAllowed}
 
-    <h3>{t}Information about you{/t}:</h3>
+    <h3>{t}Personal information{/t}</h3>
 
     <table width="100%">
         <tr>
+            <td>
+                    <img src="getbin.php?rand={$rand}" alt='' style='max-width:147px; max-height: 200px; vertical-align: middle;' >
+            </td>
             <td style="width:33%">
                 <table>
                     {if $uid != ""}<tr><td>{t}User-ID{/t}:</td><td>{$uid}</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 $mail != ""}<tr><td>{t}Mail{/t}:</td><td>{$mail}</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}
+                    {if $homePostalAddress != ""}<tr><td>{t}Home postal address{/t}:</td><td>{$homePostalAddress}</td></tr>{/if}
                 </table>
             </td>
-            <td style="width:33%">
+            <td>
                 <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}
 
                 </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>
 
index 2745024c216696e2203b109804b2a093eabe3f53..701114349076d473d8cf8c65820b246d1086ee74 100644 (file)
@@ -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/", "<br>", $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")));
     }