home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / controls / user.php < prev    next >
PHP Script  |  2004-03-08  |  7KB  |  229 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../Group-Office.php");
  14.  
  15. $GO_SECURITY->authenticate();
  16. require($GO_LANGUAGE->get_language_file('contacts'));
  17.  
  18. $page_title=$user_profile;
  19. require($GO_CONFIG->class_path."users.class.inc");
  20. $users = new users();
  21. $profile = $users->get_user($_REQUEST['id']);
  22.  
  23. if ($GO_SECURITY->user_id != $_REQUEST['id'])
  24. {
  25.     if (!$GO_SECURITY->has_permission($GO_SECURITY->user_id,$profile["acl_id"]))
  26.     {
  27.         Header("Location: ".$GO_CONFIG->host."error_docs/403.php");
  28.         exit();
  29.     }
  30. }
  31.  
  32. require($GO_THEME->theme_path."header.inc");
  33. if (!$profile)
  34. {
  35.     echo "<p class=\"Error\">".$strDataError."</p>";
  36.     exit();
  37. }
  38.  
  39. $return_to = (isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];;
  40. $link_back = (isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];;
  41. ?>
  42. <table border="0" cellpadding="10" cellspacing="0" width="100%">
  43. <tr>
  44.     <td>
  45.     <table border="0" cellpadding="" cellspacing="3" width="100%">
  46.     <tr>
  47.         <td height="40" colspan="2"><h1><?php echo $page_title; ?></h1></td>
  48.     </tr>
  49.     <tr>
  50.         <td valign="top" width="50%">
  51.         <table border="0" class="normal" cellpadding="0" cellspacing="3" width="100%">
  52.  
  53.         <tr>
  54.             <td align="right" nowrap><i><?php echo $strFirstName; ?>:</i> </td>
  55.             <td width="100%"><?php echo empty_to_stripe($profile["first_name"]); ?></td>
  56.         </tr>
  57.         <tr>
  58.             <td align="right" nowrap><i><?php echo $strLastName; ?>:</i> </td>
  59.             <td width="100%"><?php echo empty_to_stripe($profile["last_name"]); ?></td>
  60.         </tr>
  61.         <tr>
  62.             <td align="right" nowrap><i><?php echo $strInitials; ?>:</i> </td>
  63.             <td width="100%"><?php echo empty_to_stripe($profile["initials"]); ?></td>
  64.         </tr>
  65.         <tr>
  66.             <td align="right" nowrap><i><?php echo $strSex; ?>:</i> </td>
  67.             <td width="100%"><?php echo empty_to_stripe($strSexes[$profile["sex"]]); ?></td>
  68.         </tr>
  69.         <tr>
  70.             <td align="right" nowrap><i><?php echo $strBirthday; ?></i>:</td>
  71.             <td>
  72.             <?php
  73.             if ($profile['birthday'] > 0)
  74.             {
  75.                 echo date($_SESSION['GO_SESSION']['date_format'], $profile['birthday']);;
  76.             }else
  77.             {
  78.                 echo '-';
  79.             }
  80.             ?>
  81.             </td>
  82.         </tr>
  83.         <tr><td colspan="2"> </td></tr>
  84.  
  85.         <tr>
  86.             <td align="right" nowrap><i><?php echo $strAddress; ?>:</i> </td>
  87.             <td width="100%"><?php echo empty_to_stripe($profile["address"]); ?></td>
  88.         </tr>
  89.  
  90.         <tr>
  91.             <td align="right" nowrap><i><?php echo $strZip; ?>:</i> </td>
  92.             <td width="100%"><?php echo empty_to_stripe($profile["zip"]); ?></td>
  93.         </tr>
  94.  
  95.         <tr>
  96.             <td align="right" nowrap><i><?php echo $strCity; ?>:</i> </td>
  97.             <td width="100%"><?php echo empty_to_stripe($profile["city"]); ?></td>
  98.         </tr>
  99.  
  100.         <tr>
  101.             <td align="right" nowrap><i><?php echo $strState; ?>:</i> </td>
  102.             <td width="100%"><?php echo empty_to_stripe($profile["state"]); ?></td>
  103.         </tr>
  104.  
  105.         <tr>
  106.             <td align="right" nowrap><i><?php echo $strCountry; ?>:</i> </td>
  107.             <td width="100%"><?php echo empty_to_stripe($profile["country"]); ?></td>
  108.         </tr>
  109.         <tr>
  110.             <td colspan="2"> </td>
  111.         </tr>
  112.  
  113.         <tr>
  114.             <td align="right" nowrap><i><?php echo $strEmail; ?>:</i> </td>
  115.             <td><?php echo mail_to(empty_to_stripe($profile["email"])); ?></td>
  116.         </tr>
  117.  
  118.         <tr>
  119.             <td align="right" nowrap><i><?php echo $strPhone; ?>:</i> </td>
  120.             <td><?php echo empty_to_stripe($profile["home_phone"]); ?></td>
  121.         </tr>
  122.  
  123.         <tr>
  124.             <td align="right" nowrap><i><?php echo $strFax; ?>:</i> </td>
  125.             <td><?php echo empty_to_stripe($profile["fax"]); ?></td>
  126.         </tr>
  127.  
  128.  
  129.         <tr>
  130.             <td align="right" nowrap><i><?php echo $strCellular; ?>:</i> </td>
  131.             <td><?php echo empty_to_stripe($profile["cellular"]); ?></td>
  132.         </tr>
  133.         <tr>
  134.             <td colspan="2"> </td>
  135.         </tr>
  136.         <?php
  137.         if (isset($contact_id))
  138.         {
  139.             echo '<tr><td valign="top"><i>'.$strComments.':</i></td><td>'.text_to_html($profile["comments"]).'</td></tr>';
  140.         }
  141.         ?>
  142.         </table>
  143.         </td>
  144.         <td valign="top" width="50%">
  145.         <table border="0" class="normal" cellpadding="0" cellspacing="3" width="100%">
  146.         <tr>
  147.             <td align="right" nowrap><i><?php echo $strCompany; ?>:</i> </td>
  148.             <td><?php echo empty_to_stripe($profile["company"]); ?></td>
  149.         </tr>
  150.         <tr>
  151.             <td align="right" nowrap><i><?php echo $strDepartment; ?>:</i> </td>
  152.             <td><?php echo empty_to_stripe($profile["department"]); ?></td>
  153.         </tr>
  154.  
  155.         <tr>
  156.             <td align="right" nowrap><i><?php echo $strFunction; ?>:</i> </td>
  157.             <td><?php echo empty_to_stripe($profile["function"]); ?></td>
  158.         </tr>
  159.         <tr><td colspan="2"> </td></tr>
  160.         <tr>
  161.             <td align="right" nowrap><i><?php echo $strAddress; ?>:</i> </td>
  162.             <td width="100%"><?php echo empty_to_stripe($profile["work_address"]); ?></td>
  163.         </tr>
  164.  
  165.         <tr>
  166.             <td align="right" nowrap><i><?php echo $strZip; ?>:</i> </td>
  167.             <td width="100%"><?php echo empty_to_stripe($profile["work_zip"]); ?></td>
  168.         </tr>
  169.  
  170.         <tr>
  171.             <td align="right" nowrap><i><?php echo $strCity; ?>:</i> </td>
  172.             <td width="100%"><?php echo empty_to_stripe($profile["work_city"]); ?></td>
  173.         </tr>
  174.  
  175.         <tr>
  176.             <td align="right" nowrap><i><?php echo $strState; ?>:</i> </td>
  177.             <td width="100%"><?php echo empty_to_stripe($profile["work_state"]); ?></td>
  178.         </tr>
  179.  
  180.         <tr>
  181.             <td align="right" nowrap><i><?php echo $strCountry; ?>:</i> </td>
  182.             <td width="100%"><?php echo empty_to_stripe($profile["work_country"]); ?></td>
  183.         </tr>
  184.         <tr>
  185.             <td colspan="2"> </td>
  186.         </tr>
  187.         <tr>
  188.             <td align="right" nowrap><i><?php echo $strPhone; ?>:</i> </td>
  189.             <td><?php echo empty_to_stripe($profile["work_phone"]); ?></td>
  190.         </tr>
  191.         <tr>
  192.             <td align="right" nowrap><i><?php echo $strFax; ?>:</i> </td>
  193.             <td><?php echo empty_to_stripe($profile["work_fax"]); ?></td>
  194.         </tr>
  195.         <tr>
  196.             <td align="right" nowrap><i><?php echo $strHomepage; ?>:</i> </td>
  197.             <td><?php echo empty_to_stripe(text_to_html($profile["homepage"])); ?></td>
  198.         </tr>
  199.         </table>
  200.         </td>
  201.     </tr>
  202.     <tr>
  203.         <td colspan="2">
  204.         <br />
  205.         <?php
  206.         $module = $GO_MODULES->get_module('addressbook');
  207.         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $module['acl_write']))
  208.         {
  209.             require($GO_CONFIG->class_path."addressbook.class.inc");
  210.             $ab = new addressbook();
  211.             if (!$ab->user_is_contact($GO_SECURITY->user_id, $_REQUEST['id']))
  212.             {
  213.                 $button = new button($cmdAdd, "document.location='".$module['url']."contact.php?user_id=".$_REQUEST['id']."&return_to=".urlencode($link_back)."';");
  214.                 echo '  ';
  215.             }
  216.         }
  217.         $button = new button($cmdClose, "javascript:document.location='".$return_to."'");
  218.         ?>
  219.         </td>
  220.     </tr>
  221.     </table>
  222.     </td>
  223. </tr>
  224. </table>
  225. <?php
  226. require($GO_THEME->theme_path."footer.inc");
  227. ?>
  228.  
  229.