module/User/src/Grid/User/Controller/DatasheetController.php
public function viewAction()
    {
        $params     = $this->params();
        $service    = $this->getServiceLocator();
        $displayn   = $params->fromRoute( 'displayName' );

        // prevent "Invalid Encoding Attack"
        if ( ! mb_check_encoding( $displayn, 'UTF-8' ) )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        $model      = $service->get( 'Grid\User\Model\User\Model' );
        $user       = $model->findByDisplayName( $displayn );

        $this->paragraphLayout();

        if ( empty( $user ) )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        return new MetaContent( 'user.datasheet', array(
            'user'      => $user,
            'edit'      => $this->getPermissionsModel()
                                ->isAllowed( $user, 'edit' ),
            'password'  => $this->getPermissionsModel()
                                ->isAllowed( $user, 'password' ),
            'delete'    => $this->getPermissionsModel()
                                ->isAllowed( $user, 'delete' ),
        ) );
    }
public function viewAction()
    {
        $params     = $this->params();
        $service    = $this->getServiceLocator();
        $displayn   = $params->fromRoute( 'displayName' );

        // prevent "Invalid Encoding Attack"
        if ( ! mb_check_encoding( $displayn, 'UTF-8' ) )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        $model      = $service->get( 'Grid\User\Model\User\Model' );
        $user       = $model->findByDisplayName( $displayn );

        $this->paragraphLayout();

        if ( empty( $user ) )
        {
            $this->getResponse()
                 ->setStatusCode( 404 );

            return;
        }

        return new MetaContent( 'user.datasheet', array(
            'user'      => $user,
            'edit'      => $this->getPermissionsModel()
                                ->isAllowed( $user, 'edit' ),
            'password'  => $this->getPermissionsModel()
                                ->isAllowed( $user, 'password' ),
            'delete'    => $this->getPermissionsModel()
                                ->isAllowed( $user, 'delete' ),
        ) );
    }
public function viewAction ( ) { $ params = $ this -> params ( ) ; $ service = $ this -> getServiceLocator ( ) ; $ displayn = $ params -> fromRoute ( 'displayName' ) ; // prevent "Invalid Encoding Attack" if ( ! mb_check_encoding ( $ displayn , 'UTF-8' ) ) { $ this -> getResponse ( ) -> setStatusCode ( 404 ) ; return ; } $ model = $ service -> get ( 'Grid\User\Model\User\Model' ) ; $ user = $ model -> findByDisplayName ( $ displayn ) ; $ this -> paragraphLayout ( ) ; if ( empty ( $ user ) ) { $ this -> getResponse ( ) -> setStatusCode ( 404 ) ; return ; } return new MetaContent ( 'user.datasheet' , array ( 'user' => $ user , 'edit' => $ this -> getPermissionsModel ( ) -> isAllowed ( $ user , 'edit' ) , 'password' => $ this -> getPermissionsModel ( ) -> isAllowed ( $ user , 'password' ) , 'delete' => $ this -> getPermissionsModel ( ) -> isAllowed ( $ user , 'delete' ) , ) ) ; }
View a user
View a user