Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64
User : palandch ( 1163)
PHP Version : 7.1.33
Disable Function : NONE
Directory :  /home/palandch/www/core/model/modx/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/modaccess.class.php
<?php
/**
 * @package modx
 */
/**
 * Defines an access control policy between a principal and a target object.
 *
 * {@internal Implement derivatives to define a policy relationship to a
 * specific target class, which must extend modAccessibleObject or
 * modAccessibleSimpleObject, and must have an integer or string primary key.}
 *
 * @param string $target The target this ACL is attached to
 * @param string $principal_class The class key of the principal this ACL is attached to
 * @param int $principal The ID of the principal this ACL is attached to
 * @param int $authority The minimum authority level required to obtain this ACL
 * @param int $policy The ID of the modAccessPolicy that is attached to this ACL
 *
 * @abstract
 * @package modx
 */
class modAccess extends xPDOSimpleObject {
    /**
     * Override getOne to get the appropriate Principal class.
     *
     * @param $alias
     * @param null $criteria
     * @param bool $cacheFlag
     * @return null|xPDOObject
     */
    public function & getOne($alias, $criteria= null, $cacheFlag= true) {
        $object = null;
        if ($alias === 'Principal') {
            if ($fkdef= $this->getFKDefinition($alias)) {
                $k= $fkdef['local'];
                $fk= $fkdef['foreign'];
                if (isset ($this->_relatedObjects[$alias])) {
                    if (is_object($this->_relatedObjects[$alias])) {
                        $object= & $this->_relatedObjects[$alias];
                        return $object;
                    }
                }
                if ($criteria === null) {
                    $criteria= array(
                        $fk => $this->get($k),
                    );
                }
                $fkdef['class'] = $this->get('principal_class');
                if ($object= $this->xpdo->getObject($fkdef['class'], $criteria, $cacheFlag)) {
                    $this->_relatedObjects[$alias]= $object;
                }
            }
        } else {
            $object = parent::getOne($alias, $criteria, $cacheFlag);
        }
        return $object;
    }
}

Spamworldpro Mini