LimeSurvey API - Master branch

UserGroupController extends LSBaseController
in package

class UserGroupController

Table of Contents

Properties

$aData  : array<string|int, mixed>
$navData  : array<string|int, mixed>
This array contains the survey / group / question id used by the menu widget.
$sTemplate  : null
$userId  : int

Methods

__construct()  : mixed
Basic initialiser to the base controller class
accessRules()  : array<string|int, mixed>
actionAddGroup()  : mixed
Adds a user to user group if action is set to "saveusergroup"
actionAddUserToGroup()  : mixed
Adds a user to a group
actionDeleteGroup()  : mixed
Deletes a user group and all entries in UserInGroup related to that group
actionDeleteUserFromGroup()  : mixed
Deletes a user from group
actionEdit()  : void
Load edit user group screen.
actionIndex()  : array<string|int, mixed>
Load main user group screen, showing all existing userGroups in a gridview.
actionMailToAllUsersInGroup()  : mixed
Sends email to all users in a group
actionViewGroup()  : mixed
Renders a view for a particular group showing all users in group
beforeRender()  : bool
this is part of renderWrappedTemplate implement in old usergroups.php
createAbsoluteUrl()  : string
Returns an absolute URL based on the given controller and action information.
filters()  : array<string|int, mixed>|void
Run filters
loadHelper()  : void
Loads a helper
loadLibrary()  : void
Loads a library
run()  : void
Checks for action specific authorization and then executes an action
_checkInstallation()  : void
Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.
customInit()  : mixed
loadPageStates()  : array<string|int, mixed>
Loads page states from a hidden input.
renderJSON()  : void
Method to render an array as a json document (this one called by a lot of actions in different controllers)
sessionControl()  : void
Load and set session vars
checkBeforeAddDeleteUser()  : array<string|int, mixed>
Checks permission to add/delete users to group and checks if group and user exists

Properties

$aData

public array<string|int, mixed> $aData = []

import for all new controllers/actions (REFACTORING) to pass data before rendering the content

$navData

This array contains the survey / group / question id used by the menu widget.

public array<string|int, mixed> $navData = array()

$sTemplate

public null $sTemplate = \null

this is needed for the preview rendering inside the questioneditor

Methods

__construct()

Basic initialiser to the base controller class

public __construct(string $id[, CWebModule $module = null ]) : mixed
Parameters
$id : string
$module : CWebModule = null
Tags
access

public

accessRules()

public accessRules() : array<string|int, mixed>
Return values
array<string|int, mixed>

actionAddGroup()

Adds a user to user group if action is set to "saveusergroup"

public actionAddGroup() : mixed

actionAddUserToGroup()

Adds a user to a group

public actionAddUserToGroup() : mixed

actionDeleteGroup()

Deletes a user group and all entries in UserInGroup related to that group

public actionDeleteGroup() : mixed

actionDeleteUserFromGroup()

Deletes a user from group

public actionDeleteUserFromGroup() : mixed
Tags
throws
CDbException

actionEdit()

Load edit user group screen.

public actionEdit(int $ugid) : void
Parameters
$ugid : int

actionIndex()

Load main user group screen, showing all existing userGroups in a gridview.

public actionIndex() : array<string|int, mixed>
Return values
array<string|int, mixed>

actionMailToAllUsersInGroup()

Sends email to all users in a group

public actionMailToAllUsersInGroup(int $ugid) : mixed
Parameters
$ugid : int

actionViewGroup()

Renders a view for a particular group showing all users in group

public actionViewGroup( $ugid[, bool $header = false ]) : mixed
Parameters
$ugid :
$header : bool = false

beforeRender()

this is part of renderWrappedTemplate implement in old usergroups.php

public beforeRender(string $view) : bool
Parameters
$view : string
Return values
bool

createAbsoluteUrl()

Returns an absolute URL based on the given controller and action information.

public createAbsoluteUrl(string $route[, array<string|int, mixed> $params = array() ][, string $schema = '' ][, string $ampersand = '&' ]) : string

The functionalty was moved to \LSYii_Application::createPublicUrl, to be safe the function remains here.

Parameters
$route : string

the URL route. This should be in the format of 'ControllerID/ActionID'.

$params : array<string|int, mixed> = array()

additional GET parameters (name=>value). Both the name and value will be URL-encoded.

$schema : string = ''

schema to use (e.g. http, https). If empty, the schema used for the current request will be used.

$ampersand : string = '&'

the token separating name-value pairs in the URL.

Return values
string

the constructed URL

filters()

Run filters

public filters() : array<string|int, mixed>|void
Return values
array<string|int, mixed>|void

loadHelper()

Loads a helper

public loadHelper(string $helper) : void
Parameters
$helper : string
Tags
access

public

loadLibrary()

Loads a library

public loadLibrary(string $library) : void
Parameters
$library : string
Tags
access

public

run()

Checks for action specific authorization and then executes an action

public run(string $action) : void

TODO: check the dbupdate mechanism, do we really want to check db update before every action??

Parameters
$action : string
Tags
access

public

throws
CException
throws
CHttpException

_checkInstallation()

Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.

protected _checkInstallation() : void
Tags
access

protected

loadPageStates()

Loads page states from a hidden input.

protected loadPageStates() : array<string|int, mixed>
Return values
array<string|int, mixed>

the loaded page states

renderJSON()

Method to render an array as a json document (this one called by a lot of actions in different controllers)

protected renderJSON(array<string|int, mixed> $aData[, mixed $success = true ]) : void
Parameters
$aData : array<string|int, mixed>
$success : mixed = true

sessionControl()

Load and set session vars

protected sessionControl() : void

todo REFACTORING see comments in mehtod

Tags
access

protected

checkBeforeAddDeleteUser()

Checks permission to add/delete users to group and checks if group and user exists

private checkBeforeAddDeleteUser( $uid,  $userGroupId) : array<string|int, mixed>

todo: could be moved to model

Parameters
$uid :

integer userID

$userGroupId :

integer userGroupID

Return values
array<string|int, mixed>

if empty everything is ok, else ['errorMsg'] ['redirectPath']


        
On this page

Search results