!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/program/steps/addressbook/   drwxr-xr-x
Free 9.19 GB of 93.48 GB (9.83%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/import.inc                                  |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Import contacts from a vCard or CSV file                            |
 |                                                                       |
 +-----------------------------------------------------------------------+
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+

 $Id: $

*/

/**
 * Handler function to display the import/upload form
 */
function rcmail_import_form($attrib)
{
  global 
$RCMAIL$OUTPUT;
  
  
$attrib += array('id' => "rcmImportForm");
  
  
$upload = new html_inputfield(array('type' => 'file''name' => '_file''id' => 'rcmimportfile''size' => 40));
  
$form html::p(nullhtml::label('rcmimportfile'rcube_label('importfromfile')) . html::br() . $upload->show());
  
  
$check_replace = new html_checkbox(array('name' => '_replace''value' => 1'id' => 'rcmimportreplace'));
  
$form .= html::p(null$check_replace->show(get_input_value('_replace'RCUBE_INPUT_GPC)) .
    
html::label('rcmimportreplace'rcube_label('importreplace')));
  
  
$OUTPUT->add_label('selectimportfile','importwait');
  
$OUTPUT->add_gui_object('importform'$attrib['id']);
  
  
$out html::p(nullQ(rcube_label('importtext'), 'show'));
  
  
$out .= $OUTPUT->form_tag(array(
      
'action' => $RCMAIL->url('import'),
      
'method' => 'post',
      
'enctype' => 'multipart/form-data') + $attrib,
    
$form);
  
  return 
$out;
}


/**
 * Render the confirmation page for the import process
 */
function rcmail_import_confirm($attrib)
{
  global 
$IMPORT_STATS;
  
  
$vars get_object_vars($IMPORT_STATS);
  
$vars['names'] = join(', 'array_map('Q'$IMPORT_STATS->names));
  
  return 
html::p($attribQ(rcube_label(array(
    
'name' => 'importconfirm',
    
'nr' => $IMORT_STATS->inserted,
    
'vars' => $vars,
  )), 
'show'));
}


/**
 * Create navigation buttons for the current import step
 */
function rcmail_import_buttons($attrib)
{
  global 
$IMPORT_STATS$OUTPUT;
  
  
$attrib += array('type' => 'input');
  unset(
$attrib['name']);
  
  if (
is_object($IMPORT_STATS)) {
    
$attrib['class'] = trim($attrib['class'] . ' mainaction');
    
$out $OUTPUT->button(array('command' => 'list''label' => 'done') + $attrib);
  }
  else {
    
$out $OUTPUT->button(array('command' => 'list''label' => 'cancel') + $attrib);
    
$out .= '&nbsp;';
    
$attrib['class'] = trim($attrib['class'] . ' mainaction');
    
$out .= $OUTPUT->button(array('command' => 'import''label' => 'import') + $attrib);
  }
  
  return 
$out;
}


/** The import process **/

$importstep 'rcmail_import_form';

if (
$_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'])) {

  
$replace = (bool)get_input_value('_replace'RCUBE_INPUT_GPC);
  
$CONTACTS $RCMAIL->get_address_book(nulltrue);

  
// let rcube_vcard do the hard work :-)
  
$vcards rcube_vcard::import(file_get_contents($_FILES['_file']['tmp_name']));

  
// no vcards detected
  
if (!count($vcards)) {
    
$OUTPUT->show_message('importerror''error');
  }
  else if (
$CONTACTS->readonly) {
    
$OUTPUT->show_message('addresswriterror''error');
  }
  else {
    
$IMPORT_STATS = new stdClass;
    
$IMPORT_STATS->names = array();
    
$IMPORT_STATS->count count($vcards);
    
$IMPORT_STATS->inserted $IMPORT_STATS->skipped $IMPORT_STATS->nomail $IMPORT_STATS->errors 0;
    
    if (
$replace)
      
$CONTACTS->delete_all();
    
    foreach (
$vcards as $vcard) {
      
$email $vcard->email[0];
      
      
// skip entries without an e-mail address
      
if (empty($email)) {
        
$IMPORT_STATS->nomail++;
        continue;
      }
      
      if (!
$replace) {
        
// compare e-mail address
        
$existing $CONTACTS->search('email'$emailfalsefalse);
        if (!
$existing->count) {  // compare display name
          
$existing $CONTACTS->search('name'$vcard->displaynamefalsefalse);
        }
        if (
$existing->count) {
          
$IMPORT_STATS->skipped++;
          continue;
        }
      }
      
      
$a_record = array(
        
'name' => $vcard->displayname,
        
'firstname' => $vcard->firstname,
        
'surname' => $vcard->surname,
        
'email' => $email,
        
'vcard' => $vcard->export(),
      );
      
      
$plugin $RCMAIL->plugins->exec_hook('create_contact', array('record' => $a_record'source' => null));
      
$a_record $plugin['record'];

      
// insert record and send response
      
if (!$plugin['abort'] && ($success $CONTACTS->insert($a_record))) {
        
$IMPORT_STATS->inserted++;
        
$IMPORT_STATS->names[] = $vcard->displayname;
      } else {
        
$IMPORT_STATS->errors++;
      }
    }

    
$importstep 'rcmail_import_confirm';
  }
}
else if (
$err $_FILES['_file']['error']) {
  if (
$err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
    
$OUTPUT->show_message('filesizeerror''error', array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize')))));
  } else {
    
$OUTPUT->show_message('fileuploaderror''error');
  }
}


$OUTPUT->set_pagetitle(rcube_label('importcontacts'));

$OUTPUT->add_handlers(array(
  
'importstep' => $importstep,
  
'importnav' => 'rcmail_import_buttons',
));

// render page
$OUTPUT->send('importcontacts');

?>

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