[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/sambaadmin/inc/ -> class.uiuserdata.inc.php (source)

   1  <?php
   2      /***************************************************************************\
   3      * eGroupWare - SambaAdmin                                                   *
   4      * http://www.egroupware.org                                                 *
   5      * http://www.linux-at-work.de                                               *
   6      * Written by : Lars Kneschke [lkneschke@linux-at-work.de]                   *
   7      * -------------------------------------------------                         *
   8      * This program is free software; you can redistribute it and/or modify it   *
   9      * under the terms of the GNU General Public License as published by the     *
  10      * Free Software Foundation; either version 2 of the License, or (at your    *
  11      * option) any later version.                                                *
  12      \***************************************************************************/
  13      /* $Id: class.uiuserdata.inc.php 19994 2005-11-25 12:36:45Z lkneschke $ */
  14  
  15      class uiuserdata
  16      {
  17  
  18          var $public_functions = array
  19          (
  20              'editUserData'    => True,
  21              'saveUserData'    => True
  22          );
  23  
  24  		function uiuserdata()
  25          {
  26              $this->t        =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('sambaadmin'));
  27              $this->bosambaadmin    =& CreateObject('sambaadmin.bosambaadmin');
  28              
  29              $this->rowColor[0] = $GLOBLAS['phpgw_info']["theme"]["bg01"];
  30              $this->rowColor[1] = $GLOBLAS['phpgw_info']["theme"]["bg02"];
  31                                               
  32          }
  33      
  34  		function display_app_header()
  35          {
  36              $GLOBALS['egw']->common->egw_header();
  37              echo parse_navbar();
  38          }
  39  
  40  		function editUserData($_useCache='0')
  41          {
  42              $accountID = $_GET['account_id'];            
  43  
  44              $this->display_app_header();
  45  
  46              $this->translate();
  47  
  48              $this->t->set_file(array("editUserData" => "edituserdata.tpl"));
  49              $this->t->set_block('editUserData','form','form');
  50              $this->t->set_block('editUserData','link_row','link_row');
  51              $this->t->set_var("th_bg",$GLOBALS['egw_info']["theme"]["th_bg"]);
  52              $this->t->set_var("tr_color1",$GLOBALS['egw_info']["theme"]["row_on"]);
  53              $this->t->set_var("tr_color2",$GLOBALS['egw_info']["theme"]["row_off"]);
  54              
  55              $this->t->set_var("lang_button",lang("save"));
  56              $this->t->set_var("lang_ready",lang("Done"));
  57              $this->t->set_var("link_back",$GLOBALS['egw']->link('/admin/accounts.php'));
  58              
  59              $linkData = array
  60              (
  61                  'menuaction'    => 'sambaadmin.uiuserdata.saveUserData',
  62                  'account_id'    => $accountID
  63              );
  64              $this->t->set_var("form_action", $GLOBALS['egw']->link('/index.php',$linkData));
  65              
  66              // only when we show a existing user
  67              if($userData = $this->bosambaadmin->getUserData($accountID, $_useCache))
  68              {
  69                  $charset = $GLOBALS['egw']->translation->charset();
  70                  $this->t->set_var('displayname',htmlspecialchars($userData["displayname"],ENT_QUOTES,$charset));
  71                  $this->t->set_var('sambahomepath',htmlspecialchars($userData["sambahomepath"],ENT_QUOTES,$charset));
  72                  $this->t->set_var('sambahomedrive',htmlspecialchars($userData['sambahomedrive'],ENT_QUOTES,$charset));
  73                  $this->t->set_var('sambalogonscript',htmlspecialchars($userData['sambalogonscript'],ENT_QUOTES,$charset));
  74                  $this->t->set_var('sambaprofilepath',htmlspecialchars($userData['sambaprofilepath'],ENT_QUOTES,$charset));
  75                  
  76                  $this->t->set_var("uid",rawurlencode($_accountData["dn"]));
  77              }
  78              else
  79              {
  80              }
  81          
  82              // create the menu on the left, if needed        
  83              $menuClass =& CreateObject('admin.uimenuclass');
  84              $this->t->set_var('rows',$menuClass->createHTMLCode('edit_user'));
  85  
  86              $this->t->pfp("out","form");
  87  
  88          }
  89          
  90  		function saveUserData()
  91          {
  92              $formData = array
  93              (
  94                  'displayname'        => get_var('displayname',array('POST')),
  95                  'sambahomepath'        => get_var('sambahomepath',array('POST')),
  96                  'sambahomedrive'    => get_var('sambahomedrive',array('POST')),
  97                  'sambalogonscript'    => get_var('sambalogonscript',array('POST')),
  98                  'sambaprofilepath'    => get_var('sambaprofilepath',array('POST'))
  99              );
 100  
 101              $this->bosambaadmin->saveUserData(get_var('account_id',array('GET')), $formData);
 102  
 103              // read data fresh from ldap storage
 104              $this->editUserData();
 105          }
 106          
 107  		function translate()
 108          {
 109              $this->t->set_var('lang_displayname',lang('displayname'));
 110              $this->t->set_var('lang_homepath',lang('homepath'));
 111              $this->t->set_var('lang_homedrive',lang('homedrive'));
 112              $this->t->set_var('lang_logonscript',lang('logonscript'));
 113              $this->t->set_var('lang_profilepath',lang('profilepath'));
 114              $this->t->set_var('lang_samba_config',lang('samba config'));
 115          }
 116      }
 117  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7