Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ home/ jmdstrac/ public_html/ devices/ src/

/home/jmdstrac/public_html/devices/src/RuleMailCollector.php

<?php

/**
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */

/// Rule class for Rights management
class RuleMailCollector extends Rule
{
   // From Rule
    public static $rightname = 'rule_mailcollector';
    public $orderby   = "name";
    public $can_sort  = true;


    /**
     * @see Rule::maxActionsCount()
     **/
    public function maxActionsCount()
    {
        return 1;
    }


    /**
     * @see Rule::getTitle()
     **/
    public function getTitle()
    {
        return __('Rules for assigning a ticket created through a mails receiver');
    }


    /**
     * @see Rule::getCriterias()
     **/
    public function getCriterias()
    {

        static $criterias = [];

        if (count($criterias)) {
            return $criterias;
        }

        $criterias['mailcollector']['field']            = 'name';
        $criterias['mailcollector']['name']             = __('Mails receiver');
        $criterias['mailcollector']['table']            = 'glpi_mailcollectors';
        $criterias['mailcollector']['type']             = 'dropdown';

        $criterias['_users_id_requester']['field']      = 'name';
        $criterias['_users_id_requester']['name']       = _n('Requester', 'Requesters', 1);
        $criterias['_users_id_requester']['table']      = 'glpi_users';
        $criterias['_users_id_requester']['type']       = 'dropdown';

        $criterias['subject']['name']                   = __('Subject email header');
        $criterias['subject']['field']                  = 'subject';
        $criterias['subject']['table']                  = '';
        $criterias['subject']['type']                   = 'text';

        $criterias['content']['name']                   = __('Email body');
        $criterias['content']['table']                  = '';
        $criterias['content']['type']                   = 'text';

        $criterias['from']['name']                      = __('From email header');
        $criterias['from']['table']                     = '';
        $criterias['from']['type']                      = 'text';

        $criterias['to']['name']                        = __('To email header');
        $criterias['to']['table']                       = '';
        $criterias['to']['type']                        = 'text';

        $criterias['in_reply_to']['name']               = __('In-Reply-To email header');
        $criterias['in_reply_to']['table']              = '';
        $criterias['in_reply_to']['type']               = 'text';

        $criterias['x-priority']['name']                = __('X-Priority email header');
        $criterias['x-priority']['table']               = '';
        $criterias['x-priority']['type']                = 'text';

        $criterias['x-auto-response-suppress']['name']  = __('X-Auto-Response-Suppress email header');
        $criterias['x-auto-response-suppress']['table'] = '';
        $criterias['x-auto-response-suppress']['type']  = 'text';

        $criterias['auto-submitted']['name']            = __('Auto-Submitted email header');
        $criterias['auto-submitted']['table']           = '';
        $criterias['auto-submitted']['type']            = 'text';

       /// Renater spam matching : X-UCE-Status = Yes
        $criterias['x-uce-status']['name']              = __('X-UCE-Status email header');
        $criterias['x-uce-status']['table']             = '';
        $criterias['x-uce-status']['type']              = 'text';

        $criterias['received']['name']                  = __('Received email header');
        $criterias['received']['table']                 = '';
        $criterias['received']['type']                  = 'text';

        $criterias['_groups_id_requester']['table']     = 'glpi_groups';
        $criterias['_groups_id_requester']['field']     = 'completename';
        $criterias['_groups_id_requester']['name']      = sprintf(
            __('%1$s: %2$s'),
            User::getTypeName(1),
            Group::getTypeName(1)
        );
        $criterias['_groups_id_requester']['linkfield'] = '';
        $criterias['_groups_id_requester']['type']      = 'dropdown';
        $criterias['_groups_id_requester']['virtual']   = true;
        $criterias['_groups_id_requester']['id']        = 'groups';

        $criterias['KNOWN_DOMAIN']['field']             = 'name';
        $criterias['KNOWN_DOMAIN']['name']              = __('Known mail domain');
        $criterias['KNOWN_DOMAIN']['table']             = 'glpi_entities';
        $criterias['KNOWN_DOMAIN']['type']              = 'yesno';
        $criterias['KNOWN_DOMAIN']['virtual']           = true;
        $criterias['KNOWN_DOMAIN']['id']                = 'entitydatas';
        $criterias['KNOWN_DOMAIN']['allow_condition']   = [Rule::PATTERN_IS];

        $criterias['PROFILES']['field']                 = 'name';
        $criterias['PROFILES']['name']                  = __('User featuring the profile');
        $criterias['PROFILES']['table']                 = 'glpi_profiles';
        $criterias['PROFILES']['type']                  = 'dropdown';
        $criterias['PROFILES']['virtual']               = true;
        $criterias['PROFILES']['id']                    = 'profiles';
        $criterias['PROFILES']['allow_condition']          = [Rule::PATTERN_IS];

        if (Session::isMultiEntitiesMode()) {
            $criterias['UNIQUE_PROFILE']['field']           = 'name';
            $criterias['UNIQUE_PROFILE']['name']            = __('User featuring a single profile');
            $criterias['UNIQUE_PROFILE']['table']           = 'glpi_profiles';
            $criterias['UNIQUE_PROFILE']['type']            = 'dropdown';
            $criterias['UNIQUE_PROFILE']['virtual']         = true;
            $criterias['UNIQUE_PROFILE']['id']              = 'profiles';
            $criterias['UNIQUE_PROFILE']['allow_condition'] = [Rule::PATTERN_IS];
        }

        $criterias['ONE_PROFILE']['field']              = 'name';
        $criterias['ONE_PROFILE']['name']               = __('User with a single profile');
        $criterias['ONE_PROFILE']['table']              = '';
        $criterias['ONE_PROFILE']['type']               = 'yesonly';
        $criterias['ONE_PROFILE']['virtual']            = true;
        $criterias['ONE_PROFILE']['id']                 = 'profiles';
        $criterias['ONE_PROFILE']['allow_condition']    = [Rule::PATTERN_IS];

        return $criterias;
    }


    /**
     * @see Rule::getActions()
     **/
    public function getActions()
    {

        $actions                                              = parent::getActions();

        $actions['entities_id']['name']                       = Entity::getTypeName(1);
        $actions['entities_id']['type']                       = 'dropdown';
        $actions['entities_id']['table']                      = 'glpi_entities';

        $actions['_affect_entity_by_domain']['name']          = __('Entity from domain');
        $actions['_affect_entity_by_domain']['type']          = 'text';
        $actions['_affect_entity_by_domain']['force_actions'] = ['regex_result'];

        $actions['_affect_entity_by_tag']['name']             = __('Entity from TAG');
        $actions['_affect_entity_by_tag']['type']             = 'text';
        $actions['_affect_entity_by_tag']['force_actions']    = ['regex_result'];

        $actions['_affect_entity_by_user_entity']['name']     = __("Entity based on user's profile");
        $actions['_affect_entity_by_user_entity']['type']     = 'yesonly';
        $actions['_affect_entity_by_user_entity']['table']    = '';

        $actions['_refuse_email_no_response']['name']    = sprintf(
            __('%1$s (%2$s)'),
            __('Reject email'),
            __('without email response')
        );
        $actions['_refuse_email_no_response']['type']    = 'yesonly';
        $actions['_refuse_email_no_response']['table']   = '';

        $actions['_refuse_email_with_response']['name']  = sprintf(
            __('%1$s (%2$s)'),
            __('Reject email'),
            __('with email response')
        );
        $actions['_refuse_email_with_response']['type']  = 'yesonly';
        $actions['_refuse_email_with_response']['table'] = '';

        return $actions;
    }


    public function executeActions($output, $params, array $input = [])
    {

        if (count($this->actions)) {
            foreach ($this->actions as $action) {
                switch ($action->fields["action_type"]) {
                    case "assign":
                        switch ($action->fields["field"]) {
                            default:
                                 $output[$action->fields["field"]] = $action->fields["value"];
                                break;

                            case "_affect_entity_by_user_entity":
                              //3 cases :
                              //1 - rule contains a criteria like : Profil is XXXX
                              //    -> in this case, profiles_id is stored in
                              //       $this->criterias_results['PROFILES'] (one value possible)
                              //2-   rule contains criteria "User has only one profile"
                              //    -> in this case, profiles_id is stored in
                              //       $this->criterias_results['PROFILES'] (one value possible) (same as 1)
                              //3   -> rule contains only one profile
                                $profile = 0;

                              //Case 2:
                                if (isset($this->criterias_results['ONE_PROFILE'])) {
                                     $profile = $this->criterias_results['ONE_PROFILE'];
                                } else if (isset($this->criterias_results['UNIQUE_PROFILE'])) {
                                    //Case 3
                                    $profile = $this->criterias_results['UNIQUE_PROFILE'];
                                } else if (isset($this->criterias_results['PROFILES'])) {
                                    //Case 1
                                    $profile = $this->criterias_results['PROFILES'];
                                }

                                if ($profile) {
                                    $entities = [];
                                    if (isset($params['_users_id_requester'])) { // Not set when testing
                                        $entities
                                        = Profile_User::getEntitiesForProfileByUser(
                                            $params['_users_id_requester'],
                                            $profile
                                        );
                                    }

                                   //Case 2 : check if there's only one profile for this user
                                    if (
                                        (isset($this->criterias_results['ONE_PROFILE'])
                                        && (count($entities) == 1))
                                        || !isset($this->criterias_results['ONE_PROFILE'])
                                    ) {
                                        if (count($entities) == 1) {
                                            //User has right on only one entity
                                              $output['entities_id'] = array_pop($entities);
                                        } else if (isset($this->criterias_results['UNIQUE_PROFILE'])) {
                                              $output['entities_id'] = array_pop($entities);
                                        } else {
                                           //Rights on more than one entity : get the user's prefered entity
                                            if (isset($params['_users_id_requester'])) { // Not set when testing
                                                $user = new User();
                                                $user->getFromDB($params['_users_id_requester']);

                                                $tmpid = $user->getField('entities_id');

                                               // Retrieve all the entities (pref could be set on a child)
                                                $entities
                                                = Profile_User::getEntitiesForProfileByUser(
                                                    $params['_users_id_requester'],
                                                    $profile,
                                                    true
                                                );

                                             // If an entity is defined in user's preferences,
                                             // and this entity allowed for this profile, use this one
                                             // else do not set the rule as matched
                                                if (in_array($tmpid, $entities)) {
                                                          $output['entities_id'] = $user->fields['entities_id'];
                                                }
                                            }
                                        }
                                    }
                                }
                        }
                        break;

                    case "regex_result":
                        foreach ($this->regex_results as $regex_result) {
                             $entity_found = -1;
                             $res          = RuleAction::getRegexResultById(
                                 $action->fields["value"],
                                 $regex_result
                             );
                            if ($res != null) {
                                switch ($action->fields["field"]) {
                                    case "_affect_entity_by_domain":
                                        $entity_found = Entity::getEntityIDByDomain(addslashes($res));
                                        break;

                                    case "_affect_entity_by_tag":
                                          $entity_found = Entity::getEntityIDByTag(addslashes($res));
                                        break;
                                }

                                //If an entity was found
                                if ($entity_found > -1) {
                                    $output['entities_id'] = $entity_found;
                                    break;
                                }
                            }
                        }
                        break;
                    default:
                    //Allow plugins actions
                        $executeaction = clone $this;
                        $output = $executeaction->executePluginsActions($action, $output, $params, $input);
                        break;
                }
            }
        }
        return $output;
    }


    public static function getIcon()
    {
        return MailCollector::getIcon();
    }
}
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm