[ PHPXref.com ] [ Generated: Sun Jul 20 19:53:39 2008 ] [ PHProjekt 5.0.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/settings/ -> settings.inc.php (source)

   1  <?php
   2  
   3  // settings.inc.php - PHProjekt Version 5.0

   4  // copyright  ©  2000-2005 Albrecht Guenther  ag@phprojekt.com

   5  // www.phprojekt.com

   6  // Author: Franz Graf, $Author: paolo $

   7  // $Id: settings.inc.php,v 1.17.2.2 2005/08/05 12:26:00 paolo Exp $

   8  
   9  // check whether the lib has been included - authentication!

  10  if (!defined('lib_included')) die('Please use settings.php!');
  11  
  12  
  13  /**

  14  * Get the variables from _REQUEST that should be serialized.

  15  *

  16  * @return array settings-array

  17  */
  18  function settings_get_request_settings() {
  19  
  20      if ($_REQUEST['setting_tagesanfang'] >= $_REQUEST['setting_tagesende']) {
  21          $_REQUEST['setting_tagesanfang'] = PHPR_DAY_START;
  22          $_REQUEST['setting_tagesende']   = PHPR_DAY_END;
  23      }
  24  
  25      $temp = array();
  26      $temp['langua']             = $GLOBALS['langua']             = $_REQUEST['setting_langua'];
  27      $temp['skin']               = $GLOBALS['skin']               = $_REQUEST['setting_skin'];
  28      $temp['screen']             = $GLOBALS['screen']             = $_REQUEST['setting_screen'];
  29      $temp['startmodule']        = $GLOBALS['startmodule']        = $_REQUEST['setting_startmodule'];
  30      $temp['timezone']           = $GLOBALS['timezone']           = $_REQUEST['setting_timezone'];
  31      $temp['start_tree_mode']    = $GLOBALS['start_tree_mode']    = $_REQUEST['setting_tree_mode'];
  32      $temp['start_perpage']      = $GLOBALS['start_perpage']      = $_REQUEST['setting_perpage'];
  33      $temp['tagesanfang']        = $GLOBALS['tagesanfang']        = $_REQUEST['setting_tagesanfang'];
  34      $temp['tagesende']          = $GLOBALS['tagesende']          = $_REQUEST['setting_tagesende'];
  35      $temp['cal_hol_file']       = $GLOBALS['cal_hol_file']       = $_REQUEST['setting_cal_hol_file'];
  36      $temp['cal_visi']           = $GLOBALS['cal_visi']           = $_REQUEST['setting_cal_visi'];
  37      $temp['timestep_daily']     = $GLOBALS['timestep_daily']     = $_REQUEST['setting_timestep_daily'];
  38      $temp['timestep_weekly']    = $GLOBALS['timestep_weekly']    = $_REQUEST['setting_timestep_weekly'];
  39      $temp['ppc']                = $GLOBALS['ppc']                = $_REQUEST['setting_ppc'];
  40      $temp['cut']                = $GLOBALS['cut']                = $_REQUEST['setting_cut'];
  41      $temp['cal_mode']           = $GLOBALS['cal_mode']           = $_REQUEST['setting_cal_mode'];
  42      $temp['cal_visi']           = $GLOBALS['cal_visi']           = $_REQUEST['setting_cal_visi'];
  43      $temp['cal_freq']           = $GLOBALS['cal_freq']           = $_REQUEST['setting_cal_freq'];
  44      $temp['timecard_view']      = $GLOBALS['timecard_view']      = $_REQUEST['setting_timecard_view'];
  45      $temp['reminder']           = $GLOBALS['reminder']           = $_REQUEST['setting_reminder'];
  46      $temp['remind_freq']        = $GLOBALS['remind_freq']        = $_REQUEST['setting_remind_freq'];
  47      $temp['reminder_mail']      = $GLOBALS['reminder_mail']      = $_REQUEST['setting_reminder_mail'];
  48      $temp['cont_action']        = $GLOBALS['cont_action']        = $_REQUEST['setting_cont_action'];
  49      $temp['chat_entry_type']    = $GLOBALS['chat_entry_type']    = $_REQUEST['setting_chat_entry_type'];
  50      $temp['chat_direction']     = $GLOBALS['chat_direction']     = $_REQUEST['setting_chat_direction'];
  51      $temp['forum_view_both']    = $GLOBALS['forum_view_both']    = $_REQUEST['setting_forum_view_both'];
  52      $temp['file_download_type'] = $GLOBALS['file_download_type'] = $_REQUEST['setting_file_download_type'];
  53      $temp['notes_view_both']    = $GLOBALS['notes_view_both']    = $_REQUEST['setting_notes_view_both'];
  54  #    $temp['date_format']        = $GLOBALS['date_format']        = $_REQUEST['setting_date_format'];

  55  
  56      return $temp;
  57  }
  58  
  59  
  60  /**

  61  * Fetch the profiledata of ID $id from the DB.

  62  * It is checked whether this profile really belongs to the current user or not.

  63  * The values of the array will be empty if a profile is selected that

  64  * does not belong to the current user,

  65  *

  66  * @access public

  67  * @uses $user_ID    ID of the current user

  68  * @param int $id    ID of the profile to fetch

  69  * @return array     Array with the keys: ID, bezeichnung, personen.

  70  *                   'personen' references the deserialized arrays of shortnames(!)

  71  */
  72  function get_profile_from_user($id) {
  73      global $user_ID;
  74  
  75      $id = (int) $id;
  76      $data = array( "ID"          => $id,
  77                     "bezeichnung" => "",
  78                     "personen"    => array() );
  79  
  80      $query = "SELECT bezeichnung, personen
  81                  FROM ".DB_PREFIX."profile
  82                 WHERE ID  = '$id'
  83                   AND von = '$user_ID'";
  84      $res = db_query($query) or db_die();
  85      if ($row = db_fetch_row($res)) {
  86          $data['bezeichnung'] = $row[0];
  87          $data['personen']    = unserialize($row[1]);
  88          if (!$data['personen']) {
  89              $data['personen'] = array();
  90          }
  91      }
  92  
  93      // convert user(s) 'kurz' to 'id' for the selector => urghs

  94      if (count($data['personen']) > 0) {
  95          $kurz = "'".implode("','", $data['personen'])."'";
  96          $data['personen'] = array();
  97          $query = "SELECT ID
  98                      FROM ".DB_PREFIX."users
  99                     WHERE kurz IN ($kurz)";
 100          $res = db_query($query) or db_die();
 101          while ($row = db_fetch_row($res)) {
 102              $data['personen'][] = $row[0];
 103          }
 104      }
 105  
 106      return $data;
 107  }
 108  
 109  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]