!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/usr/share/roundcube/program/steps/addressbook/   drwxr-xr-x
Free 1.44 GB of 7.22 GB (20.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     copy.inc (4.35 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/copy.inc                                    |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2007, The Roundcube Dev Team                            |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Copy a contact record from one direcotry to another                 |
 |                                                                       |
 +-----------------------------------------------------------------------+
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
*/

// only process ajax requests
if (!$OUTPUT->ajax_call)
  return;


$cids         rcmail_get_cids();
$target       get_input_value('_to'RCUBE_INPUT_POST);
$target_group get_input_value('_togid'RCUBE_INPUT_POST);

$success  0;
$errormsg 'copyerror';
$maxnum   $RCMAIL->config->get('max_group_members'0);

foreach (
$cids as $source => $cid)
{
    
// Something wrong, target not specified
    
if (!strlen($target)) {
        break;
    }

    
// It maight happen when copying records from search result
    // Do nothing, go to next source
    
if ((string)$target == (string)$source) {
        continue;
    }

    
$CONTACTS $RCMAIL->get_address_book($source);
    
$TARGET   $RCMAIL->get_address_book($target);

    if (!
$TARGET || !$TARGET->ready || $TARGET->readonly) {
        break;
    }

    
$ids = array();

    foreach (
$cid as $cid) {
        
$a_record $CONTACTS->get_record($cidtrue);

        
// Check if contact exists, if so, we'll need it's ID
        // Note: Some addressbooks allows empty email address field
        
if (!empty($a_record['email']))
            
$result $TARGET->search('email'$a_record['email'], 1truetrue);
        else if (!empty(
$a_record['name']))
            
$result $TARGET->search('name'$a_record['name'], 1truetrue);
        else
            
$result = new rcube_result_set();

        
// insert contact record
        
if (!$result->count) {
            
$plugin $RCMAIL->plugins->exec_hook('contact_create', array(
                
'record' => $a_record'source' => $target'group' => $target_group));

            if (!
$plugin['abort']) {
                if (
$insert_id $TARGET->insert($plugin['record'], false)) {
                    
$ids[] = $insert_id;
                    
$success++;
                }
            }
            else if (
$plugin['result']) {
                
$ids array_merge($ids$plugin['result']);
                
$success++;
            }
        }
        else {
            
$record $result->first();
            
$ids[] = $record['ID'];
            
$errormsg = empty($a_record['email']) ? 'contactnameexists' 'contactexists';
        }
    }

    
// assign to group
    
if ($target_group && $TARGET->groups && !empty($ids)) {
        
$plugin $RCMAIL->plugins->exec_hook('group_addmembers', array(
            
'group_id' => $target_group'ids' => $ids'source' => $target));

        if (!
$plugin['abort']) {
            
$TARGET->reset();
            
$TARGET->set_group($target_group);

            if (
$maxnum && ($TARGET->count()->count count($plugin['ids']) > $maxnum)) {
                
$OUTPUT->show_message('maxgroupmembersreached''warning', array('max' => $maxnum));
                
$OUTPUT->send();
            }

            if ((
$cnt $TARGET->add_to_group($target_group$plugin['ids'])) && $cnt $success)
                
$success $cnt;
        }
        else if (
$plugin['result']) {
            
$success $plugin['result'];
        }

        
$errormsg $plugin['message'] ? $plugin['message'] : 'copyerror';
    }
}

if (
$success == 0)
    
$OUTPUT->show_message($errormsg'error');
else
    
$OUTPUT->show_message('copysuccess''notice', array('nr' => $success));

// send response
$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.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0129 ]--