!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/var/www/html/admin/webmail/plugins/squirrelmail_usercopy/   drwxr-xr-x
Free 9.29 GB of 93.48 GB (9.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     squirrelmail_usercopy.php (2.41 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * Copy a new users identity and settings from a nearby Squirrelmail installation
 *
 * Currently only file-based data storage of Squirrelmail is supported.
 *
 * @version 1.0
 * @author Thomas Bruederli
 */
class squirrelmail_usercopy extends rcube_plugin
{
    private 
$prefs null;
    private 
$abook = array();

    public function 
init()
    {
        
$this->add_hook('create_user', array($this'create_user'));
        
$this->add_hook('create_identity', array($this'create_identity'));
    }

    public function 
create_user($p)
    {
        
// read prefs and add email address
        
$this->read_squirrel_prefs($p['user']);
        if (
$this->prefs['email_address'])
            
$p['user_email'] = $this->prefs['email_address'];

        return 
$p;
    }

    public function 
create_identity($p)
    {
        
// only execute on login
        
if ($p['login'] && $this->prefs) {
            if (
$this->prefs['full_name'])
                
$p['record']['name'] = $this->prefs['full_name'];
            if (
$this->prefs['email_address'])
                
$p['record']['email'] = $this->prefs['email_address'];
            if (
$this->prefs['signature'])
                
$p['record']['signature'] = $this->prefs['signature'];
        
            
// copy address book
            
$rcmail rcmail::get_instance();
            
$contacts $rcmail->get_address_book(nulltrue);
            if (
$contacts && count($this->abook)) {
                foreach (
$this->abook as $rec)
                    
$contacts->insert($rectrue);
            }
            
            
// mark identity as complete for following hooks
            
$p['complete'] = true;
        }

        return 
$p;
    }

    private function 
read_squirrel_prefs($uname)
    {
        
$this->load_config();
        
$rcmail rcmail::get_instance();

        if (
$srcdir $rcmail->config->get('squirrelmail_data_dir')) {
            
$prefsfile slashify($srcdir) . $uname '.pref';
            
$abookfile slashify($srcdir) . $uname '.abook';
            
$sigfile slashify($srcdir) . $uname '.sig';

            if (
is_readable($prefsfile)) {
                
$this->prefs = array();
                foreach (
file($prefsfile) as $line) {
                    list(
$key$value) = explode('='$line);
                    
$this->prefs[$key] = utf8_encode(rtrim($value));
                }

                
// also read signature file if exists
                
if (is_readable($sigfile)) {
                    
$this->prefs['signature'] = utf8_encode(file_get_contents($sigfile));
                }

                
// parse addres book file
                
if (filesize($abookfile)) {
                    foreach(
file($abookfile) as $line) {
                        list(
$rec['name'], $rec['firstname'], $rec['surname'], $rec['email']) = explode('|'utf8_encode(rtrim($line)));
                        if (
$rec['name'] && $rec['email'])
                            
$this->abook[] = $rec;
                    }
                }
            }
        }
    }

}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0069 ]--