!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/vcard_attachments/   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:     vcard_attachments.php (3.59 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * Detect VCard attachments and show a button to add them to address book
 *
 * @version 1.0
 * @author Thomas Bruederli
 */
class vcard_attachments extends rcube_plugin
{
  public 
$task 'mail';
  
  private 
$message;
  private 
$vcard_part;

  function 
init()
  {
    
$rcmail rcmail::get_instance();
    if (
$rcmail->action == 'show' || $rcmail->action == 'preview') {
      
$this->add_hook('message_load', array($this'message_load'));
      
$this->add_hook('template_object_messagebody', array($this'html_output'));
    }
    
    
$this->register_action('plugin.savevcard', array($this'save_vcard'));
  }
  
  
/**
   * Check message attachments for vcards
   */
  
function message_load($p)
  {
    
$this->message $p['object'];
    
    foreach ((array)
$this->message->attachments as $attachment) {
      if (
in_array($attachment->mimetype, array('text/vcard''text/x-vcard')))
        
$this->vcard_part $attachment->mime_id;
    }
  }
  
  
/**
   * This callback function adds a box below the message content
   * if there is a vcard attachment available
   */
  
function html_output($p)
  {
    if (
$this->vcard_part) {
      
$vcard = new rcube_vcard($this->message->get_part_content($this->vcard_part));
      
      
// successfully parsed vcard
      
if ($vcard->displayname) {
        
$display $vcard->displayname;
        if (
$vcard->email[0])
          
$display .= ' <'.$vcard->email[0].'>';
        
        
// add box below messsage body
        
$p['content'] .= html::p(array('style' => "margin:1em; padding:0.5em; border:1px solid #999; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; width: auto;"),
          
html::a(array(
              
'href' => "#",
              
'onclick' => "return plugin_vcard_save_contact('".JQ($this->vcard_part)."')",
              
'title' => "Save contact in local address book"),  // TODO: localize this title
            
html::img(array('src' => $this->url('vcard_add_contact.png'), 'align' => "middle")))
            . 
' ' html::span(nullQ($display)));
        
        
$this->include_script('vcardattach.js');
      }
    }
    
    return 
$p;
  }
  
  
/**
   * Handler for request action
   */
  
function save_vcard()
  {
    
$uid get_input_value('_uid'RCUBE_INPUT_POST);
    
$mbox get_input_value('_mbox'RCUBE_INPUT_POST);
    
$mime_id get_input_value('_part'RCUBE_INPUT_POST);
    
    
$rcmail rcmail::get_instance();
    
$part $uid && $mime_id $rcmail->imap->get_message_part($uid$mime_id) : null;
    
    
$error_msg 'Failed to saved vcard'// TODO: localize this text
    
    
if ($part && ($vcard = new rcube_vcard($part)) && $vcard->displayname && $vcard->email) {
      
$contacts $rcmail->get_address_book(nulltrue);
      
      
// check for existing contacts
      
$existing $contacts->search('email'$vcard->email[0], truefalse);
      if (
$done $existing->count) {
        
$rcmail->output->command('display_message'$this->gettext('contactexists'), 'warning');
      }
      else {
        
// add contact
        
$success $contacts->insert(array(
          
'name' => $vcard->displayname,
          
'firstname' => $vcard->firstname,
          
'surname' => $vcard->surname,
          
'email' => $vcard->email[0],
          
'vcard' => $vcard->export(),
        ));
        
        if (
$success)
          
$rcmail->output->command('display_message'$this->gettext('addedsuccessfully'), 'confirmation');
        else
          
$rcmail->output->command('display_message'$error_msg'error');
      }
    }
    else
      
$rcmail->output->command('display_message'$error_msg'error');
    
    
$rcmail->output->send();
  }
  
}

:: 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.004 ]--