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/processors/security/group/user/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/processors/security/group/user/update.class.php
<?php
/**
 * Update a users role in a user group
 *
 * @param integer $usergroup The ID of the user group
 * @param intger $user The ID of the user
 *
 * @package modx
 * @subpackage processors.security.group
 */
class modUserGroupUserUpdateProcessor extends modProcessor {
    /** @var modUserGroupMember $membership */
    public $membership;

    public function checkPermissions() {
        return $this->modx->hasPermission('usergroup_user_edit');
    }
    public function getLanguageTopics() {
        return array('user');
    }

    public function initialize() {
        $user = $this->getProperty('user');
        if (empty($user)) return $this->modx->lexicon('user_err_ns');
        $userGroup = $this->getProperty('usergroup');
        if (empty($userGroup)) return $this->modx->lexicon('user_group_err_ns');
        
        $this->membership = $this->modx->getObject('modUserGroupMember',array(
            'member' => $this->getProperty('user',0),
            'user_group' => $this->getProperty('usergroup',0),
        ));
        if (empty($this->membership)) {
            return $this->modx->lexicon('user_group_member_err_nf');
        }
        return true;
    }

    public function process() {
        $this->membership->fromArray($this->getProperties());

        if ($this->membership->save() == false) {
            return $this->failure($this->modx->lexicon('user_group_member_err_save'));
        }
        
        return $this->success('',$this->membership);
    }
}
return 'modUserGroupUserUpdateProcessor';

Spamworldpro Mini