Changeset 4726 in subversion


Ignore:
Timestamp:
May 3, 2011 4:42:27 PM (2 years ago)
Author:
netbit
Message:
  • Improvements to DirectAdmin? password driver
  • Update pt-BR language
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/password/README

    r4595 r4726  
    178178 -------------------------------------------- 
    179179 
    180  You can specify which host to connect to via 'password_directadmin_host' 
    181  and what port via 'password_direactadmin_port'. See config.inc.php.dist file 
    182  for more info. 
     180 You can specify which host to connect to via 'password_directadmin_host' (don't  
     181 forget to use tcp:// or ssl://) and what port via 'password_direactadmin_port'. 
     182 The password enforcement with plenty customization can be done directly by  
     183 DirectAdmin, please see http://www.directadmin.com/features.php?id=910 
     184 See config.inc.php.dist file for more info. 
    183185 
    184186 
  • trunk/plugins/password/config.inc.php.dist

    r4546 r4726  
    213213// -------------------------- 
    214214// The host which changes the password 
    215 // Use 'ssl://serverip' instead of 'tcp://serverip' when running DirectAdmin over SSL. 
     215// Use 'ssl://host' instead of 'tcp://host' when running DirectAdmin over SSL. 
     216// The host can contain the following macros that will be expanded as follows: 
     217//     %h is replaced with the imap host (from the session info) 
     218//     %d is replaced with the domain part of the username (if the username is an email) 
    216219$rcmail_config['password_directadmin_host'] = 'tcp://localhost'; 
    217220 
  • trunk/plugins/password/drivers/directadmin.php

    r4507 r4726  
    66 * Driver to change passwords via DirectAdmin Control Panel 
    77 * 
    8  * @version 1.0 
     8 * @version 1.2 
    99 * @author Victor Benincasa <vbenincasa@gmail.com> 
    1010 * 
     
    2222    $da_host    = $rcmail->config->get('password_directadmin_host'); 
    2323    $da_port    = $rcmail->config->get('password_directadmin_port'); 
     24 
     25    if(strpos($da_user, '@') === false) return array('code' => PASSWORD_ERROR, 'message' => 'Change the SYSTEM user password through control panel!'); 
     26 
     27    $da_host = str_replace('%h', $_SESSION['imap_host'], $da_host); 
     28    $da_host = str_replace('%d', $rcmail->user->get_username('domain'), $da_host); 
    2429 
    2530    $Socket->connect($da_host,$da_port);  
     
    3540    $response = $Socket->fetch_parsed_body(); 
    3641 
    37         //console("DA error response: $response[text] [$da_user]"); 
    38  
    39     if($Socket->result_status_code <> 200) 
    40         return PASSWORD_CONNECT_ERROR; 
    41     elseif($response['error'] == 1){ //Error description: $response[text]  
    42         return PASSWORD_ERROR; 
    43     }else  
     42    //DEBUG 
     43    //console("Password Plugin: [USER: $da_user] [HOST: $da_host] - Response: [SOCKET: ".$Socket->result_status_code."] [DA ERROR: ".strip_tags($response['error'])."] [TEXT: ".$response[text]."]"); 
     44 
     45    if($Socket->result_status_code != 200) 
     46        return array('code' => PASSWORD_CONNECT_ERROR, 'message' => $Socket->error[0]); 
     47    elseif($response['error'] == 1) 
     48        return array('code' => PASSWORD_ERROR, 'message' => strip_tags($response['text'])); 
     49    else  
    4450        return PASSWORD_SUCCESS; 
    4551 
     
    5864 * @author Phi1 'l0rdphi1' Stier <l0rdphi1@liquenox.net> 
    5965 * @package HTTPSocket 
    60  * @version 2.6 
     66 * @version 2.7 (Updated by Victor Benincasa <vbenincasa@gmail.com>) 
    6167 */ 
    6268class HTTPSocket { 
    6369 
    64     var $version = '2.6'; 
     70    var $version = '2.7'; 
    6571     
    6672    /* all vars are private except $error, $query_cache, and $doFollowLocationHeader */ 
     
    317323 
    318324        } 
    319  
    320         list($this->result_header, $this->result_body) = explode("\r\n\r\n", $this->result, 2); 
     325         
     326        list($this->result_header,$this->result_body) = preg_split("/\r\n\r\n/",$this->result,2); 
    321327 
    322328        if ($this->bind_host) 
     
    379385            if ($asArray) 
    380386            { 
    381                 return explode("\n", $this->fetch_body()); 
     387                return preg_split("/\n/",$this->fetch_body()); 
    382388            } 
    383389 
     
    439445    function fetch_header( $header = '' ) 
    440446    { 
    441         $array_headers = explode("\r\n", $this->result_header); 
    442  
     447        $array_headers = preg_split("/\r\n/",$this->result_header); 
     448         
    443449        $array_return = array( 0 => $array_headers[0] ); 
    444450        unset($array_headers[0]); 
     
    446452        foreach ( $array_headers as $pair ) 
    447453        { 
    448             list($key,$value) = explode(": ", $pair, 2); 
     454            list($key,$value) = preg_split("/: /",$pair,2); 
    449455            $array_return[strtolower($key)] = $value; 
    450456        } 
  • trunk/roundcubemail/program/localization/pt_BR/messages.inc

    r4687 r4726  
    3939$messages['loading'] = 'Carregando...'; 
    4040$messages['uploading'] = 'Enviando anexo...'; 
     41$messages['uploadingmany'] = 'Enviando anexos...'; 
    4142$messages['loadingdata'] = 'Carregando informações...'; 
    4243$messages['checkingmail'] = 'Verificando se há novas mensagens...'; 
Note: See TracChangeset for help on using the changeset viewer.