MemberController
340189
public function actionAll( $id ) {

		$dataProvider	= GroupMessageService::getPagination( [ 'conditions' => [ 'groupId' => $id ] ] );
		$member			= GroupMemberService::findByUserId( Yii::$app->user->getIdentity()->id );

		return $this->render( 'all', [

			'dataProvider' => $dataProvider,
			'groupId' => $id,
			'memberId' => $member->id
		] );
	}
626925
protected void _setMembership(Membership membership, AbstractItem item)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "_setMembership", new Object[] { membership, item });

        item._setMembership(membership);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "_setMembership");
    }
839206
public function canEdit($member = null)
    {
        $parent = $this->Parent();
        if ($parent && $parent->exists()) {
            return $parent->canEdit($member) && !$this->isReadonly();
        } elseif (!$this->exists() && Controller::has_curr()) {
            // This is for GridFieldOrderableRows support as it checks edit permissions on
            // singleton of the class. Allows editing of User Defined Form pages by
            // 'Content Authors' and those with permission to edit the UDF page. (ie. CanEditType/EditorGroups)
            // This is to restore User Forms 2.x backwards compatibility.
            $controller = Controller::curr();
            if ($controller && $controller instanceof CMSPageEditController) {
                $parent = $controller->getRecord($controller->currentPageID());
                // Only allow this behaviour on pages using UserFormFieldEditorExtension, such
                // as UserDefinedForm page type.
                if ($parent && $parent->hasExtension(UserFormFieldEditorExtension::class)) {
                    return $parent->canEdit($member);
                }
            }
        }

        // Fallback to secure admin permissions
        return parent::canEdit($member);
    }
983625
public static Member member(MemberId memberId, Address address) {
    return builder(memberId)
        .withAddress(address)
        .build();
  }
349459
public function actionMembers()
    {
        $searchModel = new UserSearch();
        return $this->render('members', [
            'dataProvider' => $searchModel->search(Yii::$app->request->get()),
            'searchModel'  => $searchModel,
        ]);
    }
961711
public function index($memberId)
    {
        $member = Member::findOrFail($memberId);
        $this->authorize('view', $member);
        return $this->respondRelatedNotes($memberId, 'member');
    }
963136
function(members) {
              users = {};
              members.each(function(member) {
                if(member.id !== 'anonymous' && member.id !== 'undefined') {
                  if(settings.randomColor && member.info.color === undefined) {
                    member.info.color = settings.templates.color(member.id);
                  }
                  // sort list with admin first
                  html = (member.info.isAdmin)
                    ? settings.templates.userList(member.info) + html
                    : html + settings.templates.userList(member.info)
                  ;
                  users[ member.id ] = member.info;
                }
              });
              $module
                .data('users', users)
                .data('user', users[members.me.id] )
                .removeClass(className.loading)
              ;
              $userList
                .html(html)
              ;
              module.user.updateCount();
              $.proxy(settings.onJoin, $userList.children())();
            }
34652
public function index() {        
        $tree = Globals::getTree();
        $controller = new PageController();
        $controller
        ->setPageTitle(I18N::translate('Certificate'))
        ->restrictAccess(
            $this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($tree)
        );
        
        $cid = Filter::get('cid');
        
        $certificate = null;
        if(!empty($cid) && strlen($cid) > 22){
            $certificate = Certificate::getInstance($cid, $tree, null, $this->provider);
        }
        
        $data = new ViewBag();
        $data->set('title', $controller->getPageTitle());
        
        $data->set('has_certif', false);
        if($certificate) {
            $controller->restrictAccess($certificate->canShow());
            $data->set('title', $certificate->getTitle());
            $data->set('has_certif', true);
            $data->set('certificate', $certificate);
            
            $data->set(
                'url_certif_city', 
                'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . 
                    '&mod_action=Certificate@listAll' .
                    '&ged=' . $tree->getNameUrl() .
                    '&city=' . Functions::encryptToSafeBase64($certificate->getCity())
            );
            
            $controller->addInlineJavascript('
                jQuery("#certificate-tabs").tabs();
			    jQuery("#certificate-tabs").css("visibility", "visible");    
            ');
            
            $data->set('has_linked_indis', false);
            $data->set('has_linked_fams', false);
            
            $linked_indis = $certificate->linkedIndividuals();
            $linked_fams = $certificate->linkedFamilies();
                        
            if($linked_indis && count($linked_indis) > 0) {
                $data->set('has_linked_indis', true);
                $data->set('linked_indis', $linked_indis);
            }
            
            if(!empty($linked_fams)) {
                $data->set('has_linked_fams', true);
                $data->set('linked_fams', $linked_fams);
            }
        }
        
        ViewFactory::make('Certificate', $this, $controller, $data)->render();
    }
187171
private void checkMembers(XMember<?>[] members) {
		for (int index = 0; index < members.length; index++) {
			final XMember<?> member = members[index];
			if (!member.getMember().getDeclaringClass()
					.isAssignableFrom(getTargetClass())) {
				throw new IllegalArgumentException("Member [" + member
						+ "] does not belong to the target class ["
						+ targetClass + "].");
			}
		}
	}
859929
public function index()
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $members = Member::with(
            'member_category',
            'user'
        )
            ->onTeam()
            ->active()
            ->orderBy('preference', 'asc')
            ->paginate(config('app.pagination_default'));
        /** @noinspection PhpUndefinedMethodInspection */
        return fractal($members, new MemberTransformer())
            ->withResourceName('member')
            ->respond();
    }
1332592
public function index() {        
        $action = Filter::post('action');        
        if($action == 'update' && Filter::checkCsrf()) $this->update();
        
        Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
        $ctrl = new PageController();
        $ctrl
            ->restrictAccess(Auth::isAdmin())
            ->setPageTitle($this->module->getTitle());

        $view_bag = new ViewBag();
        $view_bag->set('title', $ctrl->getPageTitle());
        $view_bag->set('module', $this->module);
        
        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
    }
382702
void removeMember(MemberImpl member) {
        heartbeatFailureDetector.remove(member);
        if (icmpParallelMode) {
            icmpFailureDetector.remove(member);
        }
    }
1279209
@SuppressWarnings("unchecked")
    protected C buildController() throws CoreException {

        // Build the controller by reflection excluding NullController
        return (C) ClassUtility.findAndBuildGenericType(this.getClass(), Controller.class, NullController.class, this);
    }
663495
private function createController(): void
    {
        $aFields  = $this->getArguments();
        $aCreated = [];

        try {

            $aControllers = array_filter(
                array_map(function ($sController) {
                    return implode('/', array_map('ucfirst', explode('/', ucfirst(trim($sController)))));
                }, explode(',', $aFields['CONTROLLER_NAME']))
            );
            $aMethods     = array_filter(
                array_map(function ($sMethod) {
                    return lcfirst(trim($sMethod));
                }, explode(',', $aFields['METHODS']))
            );

            sort($aControllers);

            foreach ($aControllers as $sController) {

                $aControllerBits = explode('/', $sController);
                $aControllerBits = array_map('ucfirst', $aControllerBits);

                if (count($aControllerBits) > 2) {
                    throw new ConsoleException('Controllers cannot be deeper than one directory');
                }

                $aFields['MODULE_NAME']     = getFromArray(0, $aControllerBits);
                $aFields['CONTROLLER_NAME'] = getFromArray(1, $aControllerBits, $aFields['MODULE_NAME']);
                $this->oOutput->write('Creating controller <comment>' . $sController . '</comment>... ');


                if (count($aControllerBits) == 2) {
                    //  A path has been specified, splice in the correct folder structure
                    $aLastControllerBits = array_splice($aControllerBits, -1, 1);
                    $aControllerBits     = array_merge(
                        array_map('lcfirst', $aControllerBits),
                        ['controllers'],
                        array_map('ucfirst', $aLastControllerBits)
                    );
                } else {
                    //  The controller should be in a folder called itself
                    $aControllerBits = array_merge(
                        array_map('lcfirst', $aControllerBits),
                        ['controllers'],
                        array_map('ucfirst', $aControllerBits)
                    );
                }

                $aViewBits = $aControllerBits;
                array_splice($aViewBits, -2, 1, ['views']);

                $sControllerPath     = self::CONTROLLER_PATH . implode('/', array_slice($aControllerBits, 0, -1)) . '/';
                $sViewPath           = self::CONTROLLER_PATH . implode('/', array_slice($aViewBits, 0, -1)) . '/';
                $sControllerFilename = end($aControllerBits) . '.php';
                $sClassName          = ucfirst(underscoreToCamelcase(end($aControllerBits)));

                $aFields['CONTROLLER_PATH']     = $sControllerPath;
                $aFields['CONTROLLER_FILENAME'] = $sControllerFilename;
                $aFields['CONTROLLER_CLASS']    = $sClassName;
                $aFields['VIEW_PATH']           = $sViewPath;

                //  Check if the controller already exists
                if (file_exists($sControllerPath . $sControllerFilename)) {
                    throw new ConsoleException(
                        'Controller "' . $sController . '" already exists at "' . $sControllerPath . $sControllerFilename . '"'
                    );
                }

                //  Generate methods
                if ($aFields['MODULE_NAME'] === $aFields['CONTROLLER_NAME']) {
                    $sViewPathPrefix = '';
                    $sViewPrefix     = lcfirst($aFields['CONTROLLER_NAME']) . '/';
                } else {
                    $sViewPathPrefix = $aFields['CONTROLLER_NAME'] . '/';
                    $sViewPrefix     = lcfirst($aFields['MODULE_NAME']) . '/' . $aFields['CONTROLLER_NAME'] . '/';
                }

                $aMethodStrings = [];
                $aViews         = [];
                reset($aMethods);
                foreach ($aMethods as $sMethod) {

                    $aViews[]         = $sViewPathPrefix . $sMethod;
                    $aMethodStrings[] = '';
                    $aMethodStrings[] = $this->getResource(
                        'template/controller_method.php',
                        [
                            'METHOD_NAME' => $sMethod,
                            'METHOD_VIEW' => $sViewPrefix . $sMethod,
                        ]
                    );
                    $aMethodStrings[] = '';
                    $aMethodStrings[] = '// --------------------------------------------------------------------------';
                }

                //  Remove the first item (blank string) and the last two (separators)
                $aMethodStrings = array_slice($aMethodStrings, 1, -2);

                //  Add leading tabs
                array_walk(
                    $aMethodStrings,
                    function (&$sLine) {
                        $sLine = trim($sLine);
                        if (!empty($sLine)) {
                            $aLines = explode("\n", $sLine);
                            foreach ($aLines as &$sSingleLine) {
                                $sSingleLine = $this->tabs(1) . $sSingleLine;
                            }
                            $sLine = implode("\n", $aLines);
                        }
                    }
                );

                $aFields['METHODS'] = implode("\n", $aMethodStrings);

                //  Ensure the path exists
                $this->createPath($aFields['CONTROLLER_PATH']);

                //  Create the controller and write to it
                $this->createFile(
                    $aFields['CONTROLLER_PATH'] . $aFields['CONTROLLER_FILENAME'],
                    $this->getResource('template/controller.php', $aFields)
                );
                $aCreated[] = $aFields['CONTROLLER_PATH'] . $aFields['CONTROLLER_FILENAME'];
                $this->oOutput->writeln('<info>done!</info>');

                //  Create the views
                $this->oOutput->write('Creating views for controller <comment>' . $sController . '</comment>... ');
                $this->createPath($aFields['VIEW_PATH']);

                foreach ($aViews as $sView) {
                    $sViewPath    = $aFields['VIEW_PATH'] . $sView . '.php';
                    $sViewSubPath = dirname($sView);
                    if ($sViewSubPath !== '.') {
                        $this->createPath($aFields['VIEW_PATH'] . $sViewSubPath);
                    }
                    $this->createFile(
                        $sViewPath,
                        $this->getResource(
                            'template/view.php',
                            [
                                'VIEW' => preg_replace('#^' . NAILS_APP_PATH . '#', '', $sViewPath),
                            ]
                        )
                    );
                    $aCreated[] = $sView;

                }
                $this->oOutput->writeln('<info>done!</info>');
            }

        } catch (ConsoleException $e) {
            $this->oOutput->writeln('<error>failed!</error>');
            //  Clean up created models
            if (!empty($aCreated)) {
                $this->oOutput->writeln('<error>Cleaning up - removing newly created files</error>');
                foreach ($aCreated as $sPath) {
                    @unlink($sPath);
                }
            }
            throw new ConsoleException($e->getMessage());
        }
    }
207600
public function init()
    {
        parent::init();

        // Check we are logged in as a user who can access front end management
        if (!Permission::check("USERS_MANAGE_ACCOUNT")) {
            Security::permissionFailure();
        }

        // Set our member object
        $member = Member::currentUser();

        if ($member instanceof Member) {
            $this->member = $member;
        }
    }
1373245
public function showMembers() {
    $entityView = $this->entityTypeManager->getStorage('view')->load('campaign_members');
    /** @var \Drupal\views\ViewExecutable $view */
    $view = $this->viewsExecutableFactory->get($entityView);
    $view->setDisplay('members_list_block');

    $campaigns = $this->campaignMenuService->getActiveCampaigns();
    if (empty($view->getExposedInput()) && !empty($campaigns)) {
      $defaultCampaign = current($campaigns);
      $view->setExposedInput(['campaign' => $defaultCampaign->id()]);
    }

    $build = [
      'link' => [
        '#type' => 'link',
        '#title' => $this->t('Registration Portal >>>'),
        '#url' => Url::fromRoute('openy_campaign.member-registration-portal'),
        '#attributes' => [
          'class' => [
            'align-right',
          ],
        ],
        '#prefix' => '<div class="row">',
        '#suffix' => '</div>',
      ],
      'view' => $view->render(),
    ];

    return $build;
  }
864756
function performAction($controller,$action,$queryString = null,$render = 0) {
		$controllerFile = ROOT . '/application/controllers/' . $controller . "controller.php";
		//print "Trying to load $controllerFile<br>";
		if (file_exists($controllerFile)){
			//print "File exists<br>";
			include_once($controllerFile);
		} else {
			throw new Exception("Controller file: $controllerFile does not exists");
		}
		$controllerName = ucfirst($controller).'Controller';
		$actionName= $action . 'Action'; // This is done to avoid clash with reserved function names like list();
		if (class_exists($controllerName)){
			
		} else {
			throw new Exception("ControllerClass: $controllerName does not exists");
		}

		//print "Trying to load $controllerName<br>"; 
		$dispatch = new $controllerName($controller, $action);
		$dispatch->render = $render;
		$dispatch->$actionName($queryString);

		if ($dispatch->render >0) {
				$dispatch->display();
		}

	}