Changeset 597


Ignore:
Timestamp:
01/13/09 18:22:43 (15 years ago)
Author:
niltonneto
Message:

Resolve #371

Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.uiconfig.inc.php

    r547 r597  
    157157                                   do algoritmo. 
    158158                                */ 
     159                                 
    159160                                $dir = $GLOBALS['phpgw']->common->get_app_dir($appname) . "/inc"; 
    160161                                $options = ' '; 
     
    177178                        } 
    178179                         
    179                         /* 
    180                          * FCK editor para o termo de aceite 
    181                          */ 
    182                         include_once("news_admin/inc/fckeditor.php"); 
    183                         $texto_termo_aceite = isset($GLOBALS['phpgw_info']['server']['agree_term']) ? $GLOBALS['phpgw_info']['server']['agree_term'] : ''; 
    184                         $oFCKeditor = new FCKeditor('newsettings[agree_term]');//CreateObject('news_admin.fckeditor','newsettings[agree_term]'); 
    185                         $oFCKeditor->BasePath = 'news_admin/templates/celepar/fckeditor/';  
    186                         $oFCKeditor->ToolbarSet = 'Basic'; 
    187                         $oFCKeditor->Value = $texto_termo_aceite;        
    188  
    189                         $t->set_var('agree_term_input',$oFCKeditor->Create());                   
    190180                         
    191                          
     181                        if($appname=="admin") {                                                  
     182                                /* 
     183                                 * FCK editor para o termo de aceite 
     184                                 */ 
     185                                include_once("news_admin/inc/fckeditor.php"); 
     186                                $texto_termo_aceite = isset($GLOBALS['phpgw_info']['server']['agree_term']) ? $GLOBALS['phpgw_info']['server']['agree_term'] : ''; 
     187                                $oFCKeditor = new FCKeditor('newsettings[agree_term]');//CreateObject('news_admin.fckeditor','newsettings[agree_term]'); 
     188                                $oFCKeditor->BasePath = 'news_admin/templates/celepar/fckeditor/';  
     189                                $oFCKeditor->ToolbarSet = 'Basic'; 
     190                                $oFCKeditor->Value = $texto_termo_aceite; 
     191                                $t->set_var('agree_term_input',$oFCKeditor->Create());                   
     192                        } 
    192193                        $t->set_var('title',lang('Site Configuration')); 
    193194                        $t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname)); 
  • trunk/admin/templates/celepar/config.tpl

    r548 r597  
    147147    <td>{lang_Enter_your_VoIP_server_port}:</td> 
    148148    <td><input name="newsettings[voip_port]" value="{value_voip_port}"></td> 
    149    </tr--> 
    150     
     149   </tr-->    
    151150    <tr class="row_on"> 
    152151    <td > 
    153                                                                 {lang_use_agree_term}: 
     152                {lang_use_agree_term}: 
    154153     </td> 
    155154        <td> 
  • trunk/expressoAdmin1_2/inc/class.db_functions.inc.php

    r586 r597  
    1818                $this->db = new db(); 
    1919                $this->db->Halt_On_Error = 'no'; 
     20                 
    2021                $this->db->connect( 
    2122                                $_SESSION['phpgw_info']['expresso']['server']['db_name'],  
     
    2627                                $_SESSION['phpgw_info']['expresso']['server']['db_type'] 
    2728                );               
    28                 $this->user_id = $_SESSION['phpgw_info']['expresso']['user']['account_id'];      
     29                $this->user_id = $_SESSION['phpgw_info']['expresso']['user']['account_id']; 
    2930        } 
    3031 
     
    3839                return $result; 
    3940        } 
    40 /* 
     41        /* 
    4142        *       Reativa os usuários desabilitados por tempo inativo modificando o seu ultimo acesso para o dia atual. 
    4243        */ 
    43         function reativar_usuario_inativo($uidNumber) { 
    44                  
    45         /*      $sql = "insert into phpgw_access_log (sessionid,loginid,ip,li,lo,account_id) values ('expirescontrol','teste','10.10.10.10','0','0','1') "; 
    46                         $this->db->query($sql);*/ 
     44        function reactivate_inactive_user($uidNumber) { 
    4745                 
    4846                $sql = "select * from phpgw_access_log where account_id=$uidNumber order by li desc limit 1"; 
     
    5149                $this->db->next_record(); 
    5250                $linha = $this->db->row(); 
    53  
    54                  
    5551                if(count($linha)>0) { 
    5652                        $sql = "insert into phpgw_access_log (sessionid,loginid,ip,li,lo,account_id) values ('expirescontrol','".$linha["loginid"]."','0.0.0.0','".time()."','0','".$linha["account_id"]."')"; 
     
    5955                } 
    6056        } 
    61  
    62          
    63         function inserir_usuario_log_controle_inativo($uid,$uidNumber) { 
     57         
     58        function insert_log_inactive_user_control($uid,$uidNumber) { 
    6459                        $sql = "insert into phpgw_access_log (sessionid,loginid,ip,li,lo,account_id) values ('expirescontrol','".$uid."','0.0.0.0','".time()."','0','".$uidNumber."')"; 
    6560                         
     
    157152        } 
    158153 
    159                 //RetornO o maior dos ID's incrementado de 1 
     154                //Retorna o maior dos ID's incrementado de 1 
    160155                if ($accounts_nextid >= $groups_nextid) 
    161156                        $id = $accounts_nextid; 
     
    656651                $user = $params['user']; 
    657652                $pass = $params['pass']; 
    658  
     653                 
    659654                $con_string = "host=$host port=$port dbname=$name user=$user password=$pass"; 
    660655                if ($db = pg_connect($con_string)) 
  • trunk/expressoAdmin1_2/inc/class.functions.inc.php

    r548 r597  
    352352                } 
    353353                 
    354                 function get_inative_users($contexts) { 
     354                function get_inactive_users($contexts) { 
    355355                        $retorno = array(); 
    356356                        $tempUsers = array(); 
  • trunk/expressoAdmin1_2/inc/class.uisectors.inc.php

    r548 r597  
    6969                                'back_url'                              => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), 
    7070                                'context_display'               => $context_display, 
    71                                 'lang_inatives'                 => lang('list inatives') 
     71                                'lang_inactives'                        => lang('list inactives') 
    7272                        ); 
    7373                        $p->set_var($var); 
     
    9999                                                'sector_name'  => $sector, 
    100100                                                'add_link' => $this->row_action('add','sector',$context) 
    101                                         ); 
    102                                          
     101                                        );                                       
    103102                                        if(isset($GLOBALS['phpgw_info']['server']['time_to_account_expires'])) 
    104                                                 $var['inatives_link'] = $this->row_action('list_inative','users',$context,'uiaccounts'); 
     103                                                $var['inactives_link'] = $this->row_action('list_inactive','users',$context,'uiaccounts'); 
    105104                                        else 
    106                                                 $var['inatives_link'] = lang('disabled'); 
     105                                                $var['inactives_link'] = lang('disabled'); 
    107106 
    108107                                        $p->set_var($var); 
  • trunk/expressoAdmin1_2/inc/class.user.inc.php

    r548 r597  
    584584                                { 
    585585                                        $this->db_functions->write_log("Reativado usuário bloqueado por inatividade",'',$dn,'',''); 
    586                                         $this->db_functions->reativar_usuario_inativo($old_values['uidnumber']); 
    587                                 } 
    588  
    589  
     586                                        $this->db_functions->reactivate_inactive_user($old_values['uidnumber']); 
     587                                } 
    590588                                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    591589                                // ACCOUNT VISIBLE 
  • trunk/expressoAdmin1_2/templates/default/sectors.tpl

    r548 r597  
    2020  <tr bgcolor="{th_bg}"> 
    2121   <td>{lang_name}</td> 
    22    <td>{lang_inatives}</td> 
     22   <td>{lang_inactives}</td> 
    2323   <td>{lang_add_sub_sectors}</td> 
    2424   <td>{lang_edit}</td> 
     
    3232 <tr bgcolor="{tr_color}"> 
    3333  <td>{sector_name}</td> 
    34   <td width="13%">{inatives_link}</td>   
     34  <td width="13%">{inactives_link}</td>   
    3535  <td width="25%">{add_link}</td> 
    3636  <td width="5%">{edit_link}</td> 
  • trunk/phpgwapi/inc/class.sessions.inc.php

    r548 r597  
    519519                                return False; 
    520520                        } 
    521  
    522                         if($this->account_id!=null) { 
    523                                 $last_access = $this->get_last_access_on_history($this->account_id); 
    524                                 //echo $last_access+($current_config["time_to_account_expires"]*86400); 
    525                                 //exit(0); 
    526                                  
    527                                 $this->read_repositories(False); 
    528                                 if((isset($GLOBALS['phpgw_info']['server']['time_to_account_expires'])) && ($last_access) && ($this->account_lid!="expresso-admin")) { 
    529                                         if ($last_access+($GLOBALS['phpgw_info']['server']['time_to_account_expires']*86400) < time()) 
     521                        // Só verifica tempo de inatividade do usuário, caso esteja configurado no Administrador. 
     522                        if(isset($GLOBALS['phpgw_info']['server']['time_to_account_expires']) &&  
     523                                $this->account_id !=null && $this->account_lid != "expresso-admin") { 
     524                                        $last_access = $this->get_last_access_on_history($this->account_id); 
     525                                        $this->read_repositories(False); 
     526                                        if ($last_access && ($last_access+($GLOBALS['phpgw_info']['server']['time_to_account_expires']*86400) < time())) 
    530527                                        { 
    531528                                                if(is_object($GLOBALS['phpgw']->log)) 
     
    544541                                                return False; 
    545542                                        } 
    546                                 } 
    547543                        } 
    548544 
     
    627623 
    628624                /** 
    629                   * Retorna o UNIX DATE do ultimo acesso dessa conta, baseado na tabela de histórico. 
    630                   */ 
     625                 * Retorna o UNIX DATE do ultimo acesso dessa conta, baseado na tabela de histórico. 
     626                 */ 
    631627                function get_last_access_on_history($account_id) { 
    632628                        $GLOBALS['phpgw']->db->query("select li from phpgw_access_log where account_id='$account_id' order by li desc limit 1",__LINE__,__FILE__); 
Note: See TracChangeset for help on using the changeset viewer.