ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdminUserSearchGUI Class Reference
+ Collaboration diagram for ilAdminUserSearchGUI:

Public Member Functions

 ilAdminUserSearchGUI ()
 Constructor public.
 setString ($a_str)
 Set/get search string public.
 getString ()
executeCommand ()
 Control public.
 __clearSession ()
 start ()
 startSimple ()
 startExtended ()
 showExtended ()
 show ()
 __showSearchSimple ()
 alex: shows only results, since simple search is done through filter now
 __showSearch ()
 appendSearch ()
 appendSearchSimple ()
 performSearchSimple ()
 performSearch ()
 __performUserSearch ()
 __performGroupSearch ()
 __performRoleSearch ()
__parseQueryString ($a_string)
 parse query string, using query parser instance
 __loadQueries ()
 __setSearchType ()
 __fillUserSearch ()
 __updateResults ()
 __appendToStoredResults ($a_usr_ids)
 __storeEntries (&$new_res)
 __fillUserTable ($user_ids)
 __fillGroupTable ($group_ids)
 __fillRoleTable ($role_ids)
 __showSearchResults ()
 __showSearchUserTable ($a_result_set, $a_user_ids=NULL, $a_cmd="performSearch", $tpl_var= 'RES_TABLE')
 __showSearchGroupTable ($a_result_set, $a_grp_ids=NULL)
 __showSearchRoleTable ($a_result_set, $a_role_ids)
 listUsersGroup ()
 listUsersRole ()
 __setTableGUIBasicData (&$tbl, &$result_set, $from="")
__initTableGUI ()
 __setTableGUIUserData (&$tbl, &$result_set, $from="")
 setCallbackClass (&$class)
 cancelDelete ()
 cancel deletion of object
 userAction ()
 delete ()
 cancel ()
 setSubTabs ()

Data Fields

 $search_type = 'usr'

Detailed Description

Definition at line 41 of file class.ilAdminUserSearchGUI.php.

Member Function Documentation

ilAdminUserSearchGUI::__appendToStoredResults (   $a_usr_ids)

Definition at line 615 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, and $usr_id.

Referenced by listUsersGroup(), and listUsersRole().

{
if(!$_SESSION['search_append'])
{
return $_SESSION['rep_search']['usr'] = $a_usr_ids;
}
foreach($a_usr_ids as $usr_id)
{
$_SESSION['rep_search']['usr'][] = $usr_id;
}
return $_SESSION['rep_search']['usr'] ? array_unique($_SESSION['rep_search']['usr']) : array();
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__clearSession ( )

Definition at line 114 of file class.ilAdminUserSearchGUI.php.

References $_SESSION.

Referenced by startExtended(), and startSimple().

{
unset($_SESSION['rep_search']);
unset($_SESSION['append_results']);
unset($_SESSION['rep_query']);
unset($_SESSION['rep_search_type']);
unset($_SESSION['usr_query_active']);
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__fillGroupTable (   $group_ids)

Definition at line 695 of file class.ilAdminUserSearchGUI.php.

References $ref_id, ilObject\_getAllReferences(), ilUtil\formCheckbox(), and ilObjectFactory\getInstanceByRefId().

Referenced by __showSearchResults().

{
$group_ids = $group_ids ? $group_ids : array();
$counter = 0;
foreach($group_ids as $group_id)
{
$ref_ids = ilObject::_getAllReferences($group_id)),false))
{
continue;
}
$grp_ids[$counter] = $group_id;
$f_result[$counter][] = ilUtil::formCheckbox(0,"group[]",$ref_id);
$f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
$f_result[$counter][] = $tmp_obj->getCountMembers();
unset($tmp_obj);
++$counter;
}
return $f_result ? $f_result : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__fillRoleTable (   $role_ids)

Definition at line 719 of file class.ilAdminUserSearchGUI.php.

References ilUtil\formCheckbox(), and ilObjectFactory\getInstanceByObjId().

Referenced by __showSearchResults().

{
$role_ids = $role_ids ? $role_ids : array();
$counter = 0;
foreach($role_ids as $role_id)
{
// exclude anonymous role
if ($role_id == ANONYMOUS_ROLE_ID)
{
continue;
}
if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($role_id,false))
{
continue;
}
// exclude roles with no users assigned to
if ($tmp_obj->getCountMembers() == 0)
{
continue;
}
$role_ids[$counter] = $role_id;
$f_result[$counter][] = ilUtil::formCheckbox(0,"role[]",$role_id);
$f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
$f_result[$counter][] = $tmp_obj->getCountMembers();
unset($tmp_obj);
++$counter;
}
return $f_result ? $f_result : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__fillUserSearch ( )

Definition at line 537 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, $lng, $name, ilUserSearchOptions\_getSearchableFieldsInfo(), FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, and ilUtil\formSelect().

Referenced by __showSearch().

{
global $lng;
include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
// active flag
$values = array('0' => $lng->txt('please_choose'),
'1' => $lng->txt('active'),
'2' => $lng->txt('inactive'));
$this->tpl->setCurrentBlock("select_field");
$this->tpl->setVariable("SELECT_NAME",$lng->txt('active'));
$this->tpl->setVariable("SELECT_BOX",ilUtil::formSelect($_SESSION['usr_query_active'],
"usr_query_active",
$values,
false,
true));
$this->tpl->parseCurrentBlock();
{
switch($info['type'])
{
$this->tpl->setCurrentBlock("select_field");
$this->tpl->setVariable("SELECT_NAME",$info['lang']);
$name = $info['db'];
$this->tpl->setVariable("SELECT_BOX",ilUtil::formSelect($_SESSION['rep_query']['usr'][$name],
"rep_query[usr][$name]",
$info['values'],
false,
true));
$this->tpl->parseCurrentBlock();
break;
$this->tpl->setCurrentBlock("text_field");
$this->tpl->setVariable("TEXT_NAME",$info['lang']);
$name = $info['db'];
$this->tpl->setVariable("USR_NAME","rep_query[usr][$name]");
$this->tpl->setVariable("USR_VALUE",$_SESSION['rep_query']['usr'][$name]);
$this->tpl->parseCurrentBlock();
break;
}
$this->tpl->setCurrentBlock("usr_rows");
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__fillUserTable (   $user_ids)

Definition at line 643 of file class.ilAdminUserSearchGUI.php.

References $usr_id, elseif(), ilDatePresentation\formatDate(), ilUtil\formCheckbox(), ilObjectFactory\getInstanceByObjId(), and IL_CAL_UNIX.

Referenced by __showSearchResults(), listUsersGroup(), and listUsersRole().

{
$user_ids = $user_ids ? $user_ids : array();
$counter = 0;
foreach($user_ids as $usr_id)
{
if(!is_object($tmp_obj = ilObjectFactory::getInstanceByObjId($usr_id,false)))
{
continue;
}
$user_ids[$counter] = $usr_id;
// determine txt_access
// Note: If you do changes here, you have to change the corresponding
// code in ilObjUserFolderGUI::viewObject as well.
if ($tmp_obj->getActive())
{
if ($tmp_obj->getTimeLimitUnlimited())
{
$txt_access = $this->lng->txt("access_unlimited");
}
elseif ($tmp_obj->getTimeLimitUntil() < time())
{
$txt_access = $this->lng->txt("access_expired");
}
else
{
$txt_access = ilDatePresentation::formatDate(new ilDateTime($tmp_obj->getTimeLimitUntil(),IL_CAL_UNIX));
}
}
else
{
$txt_access = $this->lng->txt("inactive");
}
$f_result[$counter][] = ilUtil::formCheckbox(0,"id[]",$usr_id);
$f_result[$counter][] = $tmp_obj->getLogin();
$f_result[$counter][] = $tmp_obj->getFirstname();
$f_result[$counter][] = $tmp_obj->getLastname();
$f_result[$counter][] = $tmp_obj->getEmail();
$f_result[$counter][] = $txt_access;
$f_result[$counter][] = $tmp_obj->getLastLogin();
$f_result[$counter][] = $usr_id;
unset($tmp_obj);
++$counter;
}
return $f_result ? $f_result : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilAdminUserSearchGUI::__initTableGUI ( )

Definition at line 1083 of file class.ilAdminUserSearchGUI.php.

Referenced by __showSearchGroupTable(), __showSearchRoleTable(), and __showSearchUserTable().

{
include_once "./Services/Table/classes/class.ilTableGUI.php";
return new ilTableGUI(0,false);
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__loadQueries ( )

Definition at line 506 of file class.ilAdminUserSearchGUI.php.

References $_POST, and $_SESSION.

Referenced by ilAdminUserSearchGUI().

{
if(is_array($_POST['rep_query']))
{
$_SESSION['usr_query_active'] = ($_POST['usr_query_active']) ? $_POST['usr_query_active'] : 0;
$_SESSION['rep_query'] = $_POST['rep_query'];
}
}

+ Here is the caller graph for this function:

& ilAdminUserSearchGUI::__parseQueryString (   $a_string)

parse query string, using query parser instance

Returns
object of query parser or error message if an error occured public

Definition at line 489 of file class.ilAdminUserSearchGUI.php.

References QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

{
include_once 'Services/Search/classes/class.ilQueryParser.php';
$query_parser = new ilQueryParser(ilUtil::stripSlashes($a_string));
$query_parser->setCombination(QP_COMBINATION_OR);
$query_parser->setMinWordLength(1,true);
$query_parser->parse();
if(!$query_parser->validate())
{
return $query_parser->getMessage();
}
return $query_parser;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__performGroupSearch ( )

Definition at line 445 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __parseQueryString(), __storeEntries(), and ilUtil\sendInfo().

Referenced by performSearch().

{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
$query_string = $_SESSION['rep_query']['grp']['title'];
if(!is_object($query_parser = $this->__parseQueryString($query_string)))
{
ilUtil::sendInfo($query_parser,true);
return false;
}
include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
$object_search = new ilLikeObjectSearch($query_parser);
$object_search->setFilter(array('grp'));
$this->__storeEntries($object_search->performSearch());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__performRoleSearch ( )

Definition at line 464 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __parseQueryString(), __storeEntries(), and ilUtil\sendInfo().

Referenced by performSearch().

{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
$query_string = $_SESSION['rep_query']['role']['title'];
if(!is_object($query_parser = $this->__parseQueryString($query_string)))
{
ilUtil::sendInfo($query_parser,true);
return false;
}
// Perform like search
include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
$object_search = new ilLikeObjectSearch($query_parser);
$object_search->setFilter(array('role'));
$this->__storeEntries($object_search->performSearch());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__performUserSearch ( )

Definition at line 392 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, $name, __parseQueryString(), __storeEntries(), ilUserSearchOptions\_getSearchableFieldsInfo(), ilObjectSearchFactory\_getUserDefinedFieldSearchInstance(), ilObjectSearchFactory\_getUserSearchInstance(), elseif(), FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, and ilUtil\sendInfo().

Referenced by performSearch().

{
include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
{
$name = $info['db'];
$query_string = $_SESSION['rep_query']['usr'][$name];
$active_status = $_SESSION['usr_query_active'];
// continue if no query string is given
if(!$query_string)
{
continue;
}
if(!is_object($query_parser = $this->__parseQueryString($query_string)))
{
ilUtil::sendInfo($query_parser);
return false;
}
switch($info['type'])
{
$udf_search->setFields(array($name));
$result_obj = $udf_search->performSearch();
// Store entries
$this->__storeEntries($result_obj);
break;
$user_search =& ilObjectSearchFactory::_getUserSearchInstance($query_parser);
$user_search->setFields(array($name));
if ($active_status == 1)
$user_search->enableActiveCheck(true);
elseif ($active_status == 2)
$user_search->enableInactiveCheck(true);
$result_obj = $user_search->performSearch();
// store entries
$this->__storeEntries($result_obj);
break;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__setSearchType ( )

Definition at line 517 of file class.ilAdminUserSearchGUI.php.

References $_POST, and $_SESSION.

Referenced by ilAdminUserSearchGUI().

{
// Update search type. Default to user search
if($_POST['search_for'])
{
#echo 1;
$_SESSION['rep_search_type'] = $_POST['search_for'];
}
if(!$_POST['search_for'] and !$_SESSION['rep_search_type'])
{
#echo 2;
$_SESSION['rep_search_type'] = 'usr';
}
$this->search_type = $_SESSION['rep_search_type'];
#echo $this->search_type;
return true;
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__setTableGUIBasicData ( $tbl,
$result_set,
  $from = "" 
)

Definition at line 1042 of file class.ilAdminUserSearchGUI.php.

References $_GET.

Referenced by __showSearchGroupTable(), and __showSearchRoleTable().

{
global $ilUser;
switch($from)
{
case "group":
$offset = $_GET["offset"];
$order = $_GET["sort_by"] ? $_GET["sort_by"] : "title";
$direction = $_GET["sort_order"];
$tbl->setLimit(1000000);
break;
case "role":
$offset = $_GET["offset"];
$order = $_GET["sort_by"] ? $_GET["sort_by"] : "title";
$direction = $_GET["sort_order"];
$tbl->setLimit(1000000);
break;
default:
$offset = $_GET["offset"];
// init sort_by (unfortunatly sort_by is preset with 'title'
if ($_GET["sort_by"] == "title" or empty($_GET["sort_by"]))
{
$_GET["sort_by"] = "login";
}
$order = $_GET["sort_by"];
$direction = $_GET["sort_order"];
$tbl->setLimit($ilUser->getPref('hits_per_page'));
break;
}
$tbl->setOrderColumn($order);
$tbl->setOrderDirection($direction);
$tbl->setOffset($offset);
$tbl->setMaxCount(count($result_set));
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$tbl->setData($result_set);
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__setTableGUIUserData ( $tbl,
$result_set,
  $from = "" 
)

Definition at line 1090 of file class.ilAdminUserSearchGUI.php.

References $_GET, $_SESSION, $key, $row, elseif(), and ilUtil\sortArray().

Referenced by __showSearchUserTable().

{
global $ilUser;
// remember link target to admin search gui (this)
$_SESSION["usr_search_link"] = $this->ctrl->getLinkTarget($this,'show');
$tbl->disable("auto_sort");
$tbl->enable("select_all");
$tbl->setFormName("cmd");
$tbl->setSelectAllCheckbox("id");
$offset = $_GET["offset"];
// init sort_by (unfortunatly sort_by is preset with 'title'
if ($_GET["sort_by"] == "title" or empty($_GET["sort_by"]))
{
$_GET["sort_by"] = "login";
}
$order = $_GET["sort_by"];
$direction = $_GET["sort_order"];
$tbl->setLimit($ilUser->getPref('hits_per_page'));
$tbl->setOrderColumn($order);
$tbl->setOrderDirection($direction);
$tbl->setOffset($offset);
$tbl->setMaxCount(count($result_set));
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$order_key = 1;
foreach ($tbl->header_vars as $key => $val)
{
if ($order == $val)
{
$order_key = $key;
break;
}
}
// sorting array
$result_set = ilUtil::sortArray($result_set,$order_key,$direction);
$result_set = array_slice($result_set,$offset,$ilUser->getPref('hits_per_page'));
// add user link and access info color
foreach ($result_set as $i => $row)
{
foreach ($row as $key => $cell)
{
if ($key == 1)
{
//build link
// alex: this resulted in bug #5206 -> no cmdNode
//$link = "ilias.php?ref_id=7&admin_mode=settings&obj_id=".$row[7]."&search=1&cmd=view&cmdClass=ilobjusergui&cmdNode=".$_SESSION["usergui_cmd_node"]."&baseClass=ilAdministrationGUI";
$this->ctrl->setParameterByClass("ilobjusergui", "ref_id", "7");
$this->ctrl->setParameterByClass("ilobjusergui", "obj_id", $row[7]);
$this->ctrl->setParameterByClass("ilobjusergui", "search", "1");
$link = $this->ctrl->getLinkTargetByClass(array("iladministrationgui", "ilobjusergui"), "view");
$result_set[$i][$key] = "<a href=\"".$link."\">".$cell."</a>";
}
if ($key == "5")
{
if ($cell == $this->lng->txt("access_unlimited"))
{
$result_set[$i][$key] = "<span class=\"smallgreen\">".$cell."</span>";
}
elseif (in_array($cell, array($this->lng->txt("access_expired"), $this->lng->txt("inactive"))))
{
$result_set[$i][$key] = "<span class=\"smallred\">".$cell."</span>";
}
else
{
$result_set[$i][$key] = "<span class=\"small\">".$cell."</span>";
}
}
unset($result_set[$i][7]);
}
}
$tbl->setData($result_set);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearch ( )

Definition at line 221 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __fillUserSearch(), ilUtil\formRadioButton(), and ilUtil\getImagePath().

Referenced by listUsersGroup(), listUsersRole(), and showExtended().

{
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.rep_search.html','Services/Search');
$this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this,'startExtended'));
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_usr.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("SEARCH_MEMBERS_HEADER",$this->lng->txt("search_user_extended"));
// user search
$this->tpl->setVariable("SEARCH_ASSIGN_USR",$this->lng->txt("search_for_users"));
$this->tpl->setVariable("SEARCH_ROW_CHECK_USER",ilUtil::formRadioButton($this->search_type == 'usr',"search_for","usr"));
$this->__fillUserSearch();
// groups
$this->tpl->setVariable("SEARCH_ROW_TXT_GROUP",$this->lng->txt("search_for_grp_members"));
$this->tpl->setVariable("GROUP_TERM",$this->lng->txt('search_grp_title'));
$this->tpl->setVariable("SEARCH_ROW_CHECK_GROUP",ilUtil::formRadioButton($this->search_type == 'grp',"search_for","grp"));
$this->tpl->setVariable("GRP_VALUE",$_SESSION['rep_query']['grp']['title']);
// roles
$this->tpl->setVariable("SEARCH_ROW_TXT_ROLE",$this->lng->txt("search_for_role_members"));
$this->tpl->setVariable("ROLE_TERM",$this->lng->txt('search_role_title'));
$this->tpl->setVariable("SEARCH_ROW_CHECK_ROLE",ilUtil::formRadioButton($this->search_type == 'role',"search_for","role"));
$this->tpl->setVariable("ROLE_VALUE",$_SESSION['rep_query']['role']['title']);
$this->tpl->setVariable("BTN2_VALUE",$this->lng->txt("cancel"));
if(count($_SESSION['rep_search']['usr']))
{
$this->tpl->setVariable("BTN3_VALUE",$this->lng->txt('append_results'));
}
$this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("search"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearchGroupTable (   $a_result_set,
  $a_grp_ids = NULL 
)

Definition at line 865 of file class.ilAdminUserSearchGUI.php.

References $_GET, $tpl, __initTableGUI(), __setTableGUIBasicData(), and ilUtil\getImagePath().

Referenced by __showSearchResults().

{
if(!$a_result_set)
{
return false;
}
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME","listUsersGroup");
$tpl->setVariable("BTN_VALUE",$this->lng->txt("crs_list_users"));
$tpl->parseCurrentBlock();
if (!empty($a_grp_ids))
{
$tpl->setCurrentBlock("tbl_select_all");
$tpl->setVariable("COLUMN_COUNTS",4);
$tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS",5);
$tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("crs_header_edit_members"),"icon_grp.gif",$this->lng->txt("crs_header_edit_members"));
$tbl->setHeaderNames(array("",
$this->lng->txt("obj_grp"),
$this->lng->txt("crs_count_members")));
$tbl->setHeaderVars(array("",
"title",
"nr_members"),
array("ref_id" => $_GET['ref_id'],
"cmd" => "show",
"cmdClass" => "ilsearchgui",
"cmdNode" => $_GET["cmdNode"]));
$tbl->setColumnWidth(array("","80%","19%"));
$this->__setTableGUIBasicData($tbl,$a_result_set,"group");
$tbl->render();
$this->tpl->setVariable("RES_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearchResults ( )

Definition at line 753 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, $result, __fillGroupTable(), __fillRoleTable(), __fillUserTable(), __showSearchGroupTable(), __showSearchRoleTable(), and __showSearchUserTable().

Referenced by show(), and showExtended().

{
$counter = 0;
$f_result = array();
switch($this->search_type)
{
case "usr":
$result = $this->__fillUserTable($_SESSION['rep_search']['usr']);
$this->__showSearchUserTable($result,$_SESSION['rep_search']['usr']);
break;
case 'grp':
$result = $this->__fillGroupTable($_SESSION['rep_search']['grp']);
$this->__showSearchGroupTable($result,$_SESSION['rep_search']['grp']);
break;
case 'role':
$result = $this->__fillRoleTable($_SESSION['rep_search']['role']);
$this->__showSearchRoleTable($result,$_SESSION['rep_search']['role']);
break;
}
// Finally fill user table, if search type append
if($_SESSION['search_append'] and $this->search_type != 'usr')
{
$result = $this->__fillUserTable($_SESSION['rep_search']['usr']);
$this->__showSearchUserTable($result,$_SESSION['rep_search']['usr'],'search','APPEND_TABLE');
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearchRoleTable (   $a_result_set,
  $a_role_ids 
)

Definition at line 919 of file class.ilAdminUserSearchGUI.php.

References $_GET, $tpl, __initTableGUI(), __setTableGUIBasicData(), and ilUtil\getImagePath().

Referenced by __showSearchResults().

{
if(!$a_result_set)
{
return false;
}
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME","listUsersRole");
$tpl->setVariable("BTN_VALUE",$this->lng->txt("crs_list_users"));
$tpl->parseCurrentBlock();
if (!empty($a_role_ids))
{
$tpl->setCurrentBlock("tbl_select_all");
$tpl->setVariable("COLUMN_COUNTS",4);
$tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS",5);
$tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("crs_header_edit_members"),"icon_role.gif",$this->lng->txt("crs_header_edit_members"));
$tbl->setHeaderNames(array("",
$this->lng->txt("objs_role"),
$this->lng->txt("crs_count_members")));
$tbl->setHeaderVars(array("",
"title",
"nr_members"),
array("ref_id" => $_GET['ref_id'],
"cmd" => "show",
"cmdClass" => "iladminusersearchgui",
"cmdNode" => $_GET["cmdNode"]));
$tbl->setColumnWidth(array("","80%","19%"));
$this->__setTableGUIBasicData($tbl,$a_result_set,"role");
$tbl->disable("auto_sort");
$tbl->render();
$this->tpl->setVariable("RES_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearchSimple ( )

alex: shows only results, since simple search is done through filter now

Definition at line 207 of file class.ilAdminUserSearchGUI.php.

References $_SESSION.

Referenced by show().

{
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.usr_search_simple.html','Services/Search');
$this->ctrl->setParameter($this,'search','1');
$this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this,'startSimple'));
$this->tpl->setVariable("TXT_SEARCH",$this->lng->txt("search"));
if(count($_SESSION['rep_search']['usr']))
$this->tpl->setVariable("BTN2_VALUE",$this->lng->txt('append_results'));
$this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("search_user"));
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__showSearchUserTable (   $a_result_set,
  $a_user_ids = NULL,
  $a_cmd = "performSearch",
  $tpl_var = 'RES_TABLE' 
)

Definition at line 783 of file class.ilAdminUserSearchGUI.php.

References $_GET, $_POST, $_SESSION, $tpl, __initTableGUI(), __setTableGUIUserData(), and ilUtil\getImagePath().

Referenced by __showSearchResults(), listUsersGroup(), and listUsersRole().

{
if(!$a_result_set)
{
return false;
}
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
// SET FORMACTION
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$operations = array(
array("name" => "delete", "lng" => "delete"),
array("name" => "activate", "lng" => "activate"),
array("name" => "deactivate", "lng" => "deactivate"),
array("name" => "accessRestrict", "lng" => "accessRestrict"),
array("name" => "accessFree", "lng" => "accessFree"),
array("name" => "export", "lng" => "export")
);
if (count($operations) > 0)
{
$select = "<select name=\"selectedAction\">\n";
foreach ($operations as $val)
{
$select .= "<option value=\"" . $val["name"] . "\"";
if (strcmp($_POST["selectedAction"], $val["name"]) == 0)
{
$select .= " selected=\"selected\"";
}
$select .= ">";
$select .= $this->lng->txt($val["lng"]);
$select .= "</option>";
}
$select .= "</select>";
$tpl->setCurrentBlock("tbl_action_select");
$tpl->setVariable("SELECT_ACTION", $select);
$tpl->setVariable("BTN_NAME", "userAction");
$tpl->setVariable("BTN_VALUE", $this->lng->txt("submit"));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS",7);
$tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("search_results"),"icon_usr.gif",$this->lng->txt("search_results"));
$tbl->setHeaderNames(array("",
$this->lng->txt("username"),
$this->lng->txt("firstname"),
$this->lng->txt("lastname"),
$this->lng->txt("email"),
$this->lng->txt("access_until"),
$this->lng->txt("last_login")));
$tbl->setHeaderVars(array("",
"login",
"firstname",
"lastname",
"email",
"access_until",
"last_login"),
array("ref_id" => $_GET['ref_id'],
"cmd" => ($_SESSION['usr_search_mode'] == 'extended') ? 'showExtended' : 'show',
"cmdClass" => "iladminusersearchgui",
"cmdNode" => $_GET["cmdNode"],
"baseClass" => "ilAdministrationGUI"));
$tbl->setColumnWidth(array("","15%","15%","15%","20%","15%","20%"));
$this->__setTableGUIUserData($tbl,$a_result_set);
$tbl->render();
$this->tpl->setVariable($tpl_var,$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__storeEntries ( $new_res)

Definition at line 628 of file class.ilAdminUserSearchGUI.php.

Referenced by __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

{
if($this->stored == false)
{
$this->result_obj->mergeEntries($new_res);
$this->stored = true;
return true;
}
else
{
$this->result_obj->intersectEntries($new_res);
return true;
}
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::__updateResults ( )

Definition at line 593 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, $result, and $search_type.

Referenced by performSearch().

{
if(!$_SESSION['search_append'])
{
$_SESSION['rep_search'] = array();
}
foreach($this->result_obj->getResults() as $result)
{
$_SESSION['rep_search'][$this->search_type][] = $result['obj_id'];
}
if(!$_SESSION['rep_search'][$this->search_type])
{
$_SESSION['rep_search'][$this->search_type] = array();
}
else
{
// remove duplicate entries
$_SESSION['rep_search'][$this->search_type] = array_unique($_SESSION['rep_search'][$this->search_type]);
}
return true;
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::appendSearch ( )

Definition at line 258 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, and performSearch().

{
$_SESSION['search_append'] = true;
$this->performSearch();
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::appendSearchSimple ( )

Definition at line 264 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, and performSearchSimple().

{
$_SESSION['search_append'] = true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::cancel ( )

Definition at line 1211 of file class.ilAdminUserSearchGUI.php.

References ilUtil\sendInfo().

{
ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::cancelDelete ( )

cancel deletion of object

public

Definition at line 1183 of file class.ilAdminUserSearchGUI.php.

References ilUtil\redirect(), and ilUtil\sendInfo().

{
session_unregister("saved_post");
$class =& $this->callback_class;
$script = $class->ctrl->getLinkTargetByClass('ilAdminUserSearchGUI','show');
ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
ilUtil::redirect($script);
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::delete ( )

Definition at line 1201 of file class.ilAdminUserSearchGUI.php.

References $_SESSION.

{
$_SESSION['user_delete_search'] = true;
// call callback if that function does give a return value => show error message
$class =& $this->callback_class;
// listener redirects if everything is ok.
$class->deleteObject();
}
& ilAdminUserSearchGUI::executeCommand ( )

Control public.

Definition at line 86 of file class.ilAdminUserSearchGUI.php.

References $_GET, $cmd, and $ret.

{
global $rbacsystem;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case "ilobjusergui": // never called, see workaround in objuserfoldergui
include_once('./Services/User/classes/class.ilObjUserGUI.php');
$this->gui_obj = new ilObjUserGUI("",(int) $_GET["obj_id"], false, false);
$this->gui_obj->setBackTarget($this->lng->txt("search_results"),
$this->ctrl->getLinkTarget($this, "show"));
$ret =& $this->ctrl->forwardCommand($this->gui_obj);
break;
default:
if(!$cmd)
{
$cmd = "show";
}
$this->$cmd();
break;
}
return true;
}
ilAdminUserSearchGUI::getString ( )

Definition at line 77 of file class.ilAdminUserSearchGUI.php.

{
return $this->string;
}
ilAdminUserSearchGUI::ilAdminUserSearchGUI ( )

Constructor public.

Definition at line 49 of file class.ilAdminUserSearchGUI.php.

References $ilCtrl, $lng, $tpl, __loadQueries(), and __setSearchType().

{
global $ilCtrl,$tpl,$lng;
$this->ctrl =& $ilCtrl;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->lng->loadLanguageModule('search');
$this->lng->loadLanguageModule('crs');
$this->__setSearchType();
$this->__loadQueries();
$this->result_obj = new ilSearchResult();
$this->result_obj->setMaxHits(1000000);
$this->settings =& new ilSearchSettings();
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::listUsersGroup ( )

Definition at line 975 of file class.ilAdminUserSearchGUI.php.

References $_POST, $_SESSION, $result, __appendToStoredResults(), __fillUserTable(), __showSearch(), __showSearchUserTable(), ilObjectFactory\getInstanceByRefId(), ilUtil\sendInfo(), and show().

{
global $rbacsystem,$tree;
$_SESSION["crs_group"] = $_POST["group"] = $_POST["group"] ? $_POST["group"] : $_SESSION["crs_group"];
if(!is_array($_POST["group"]))
{
ilUtil::sendInfo($this->lng->txt("crs_no_groups_selected"));
$this->show();
return false;
}
$this->__showSearch();
// GET ALL MEMBERS
$members = array();
foreach($_POST["group"] as $group_id)
{
if(!$tmp_obj = ilObjectFactory::getInstanceByRefId($group_id))
{
continue;
}
$members = array_merge($tmp_obj->getGroupMemberIds(),$members);
unset($tmp_obj);
}
$this->__appendToStoredResults($members);
$result = $this->__fillUserTable($_SESSION['rep_search']['usr']);
$this->__showSearchUserTable($result,$_SESSION['rep_search']['usr'],"listUsersGroup");
return true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::listUsersRole ( )

Definition at line 1010 of file class.ilAdminUserSearchGUI.php.

References $_POST, $_SESSION, $result, __appendToStoredResults(), __fillUserTable(), __showSearch(), __showSearchUserTable(), ilUtil\sendInfo(), and show().

{
global $rbacsystem,$rbacreview,$tree;
$_SESSION["crs_role"] = $_POST["role"] = $_POST["role"] ? $_POST["role"] : $_SESSION["crs_role"];
if(!is_array($_POST["role"]))
{
ilUtil::sendInfo($this->lng->txt("crs_no_roles_selected"));
$this->show();
return false;
}
$this->__showSearch();
// GET ALL MEMBERS
$members = array();
foreach($_POST["role"] as $role_id)
{
$members = array_merge($rbacreview->assignedUsers($role_id),$members);
}
$members = $this->__appendToStoredResults($members);
$result = $this->__fillUserTable($_SESSION['rep_search']['usr']);
$this->__showSearchUserTable($result,$user_ids,"listUsersRole");
return true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::performSearch ( )

Definition at line 346 of file class.ilAdminUserSearchGUI.php.

References $_POST, $_SESSION, __performGroupSearch(), __performRoleSearch(), __performUserSearch(), __updateResults(), QP_COMBINATION_OR, ilUtil\sendInfo(), show(), and showExtended().

Referenced by appendSearch().

{
// unset search_append if called directly
if($_POST['cmd']['performSearch'])
{
unset($_SESSION['search_append']);
}
switch($this->search_type)
{
case 'usr':
break;
case 'grp':
break;
case 'role':
break;
default:
echo 'not defined';
}
$this->result_obj->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
if(!count($this->result_obj->getResults()))
{
ilUtil::sendInfo($this->lng->txt('search_no_match'));
#global $ilErr;
#$ilErr->raiseError($this->lng->txt('search_no_match'),$ilErr->MESSAGE);
}
$this->__updateResults();
if($this->result_obj->isLimitReached())
{
$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
ilUtil::sendInfo($message);
}
// show results
if ($_SESSION["usr_search_mode"] == "extended")
$this->showExtended();
else
$this->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::performSearchSimple ( )

Definition at line 270 of file class.ilAdminUserSearchGUI.php.

References $_GET, $_POST, $_SESSION, $ilErr, $result, $search_type, ilObjUser\searchUsers(), ilUtil\sendInfo(), and show().

Referenced by appendSearchSimple(), and startSimple().

{
$_SESSION["usr_search_mode"] = "simple";
// unset search_append if called directly
if($_POST['cmd']['performSearchSimple'])
{
unset($_SESSION['search_append']);
}
// fields to search in
$_POST["search_fields"] = array ("username","firstname","lastname","email");
// search only for active users
$_POST['active'] = 1;
$_POST["search_string"] = trim($_POST["search_string"]) ? trim($_POST["search_string"]) : trim(urldecode($_GET["search_string"]));
$_SESSION['us_active'] = isset($_POST['active']) ? $_POST['active'] : $_SESSION['us_active'];
$_SESSION['us_active'] = $_SESSION["user_filter"];
if (empty($_POST["search_string"]))
{
$_POST["search_string"] = "%";
}
// return if no user found
if (count($search_result = ilObjUser::searchUsers($_POST["search_string"],$_SESSION['us_active'],true, $_GET["user_filter"])) == 0)
{
if ($_POST["search_string"] == "%")
{
$_POST["search_string"] = "";
}
$msg = $this->lng->txt("msg_no_search_result");
if ($_POST["search_string"] != "")
{
$msg .= " ".$this->lng->txt("with")." '".htmlspecialchars($_POST["search_string"])."'";
}
if ($_GET['search'])
{
global $ilErr;
$ilErr->raiseError($msg,$ilErr->MESSAGE);
}
else
{
ilUtil::sendInfo($msg, true);
$this->ctrl->setParameterByClass("ilobjuserfoldergui", "user_filter", $_GET["user_filter"]);
$this->ctrl->redirectByClass("ilobjuserfoldergui", "view");
}
}
if(!$_SESSION['search_append'])
{
$_SESSION['rep_search']['usr'] = array();
}
foreach($search_result as $result)
{
$_SESSION['rep_search']['usr'][] = $result;
}
if(!$_SESSION['rep_search'][$this->search_type])
{
$_SESSION['rep_search'][$this->search_type] = array();
}
else
{
// remove duplicate entries
$_SESSION['rep_search'][$this->search_type] = array_unique($_SESSION['rep_search'][$this->search_type]);
}
$this->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::setCallbackClass ( $class)

Definition at line 1173 of file class.ilAdminUserSearchGUI.php.

{
$this->callback_class = $class;
}
ilAdminUserSearchGUI::setString (   $a_str)

Set/get search string public.

Definition at line 73 of file class.ilAdminUserSearchGUI.php.

References $_SESSION.

{
$_SESSION['search']['string'] = $this->string = $a_str;
}
ilAdminUserSearchGUI::setSubTabs ( )

Definition at line 1218 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, $ilCtrl, and $lng.

Referenced by show(), and showExtended().

{
global $ilTabs, $lng, $ilCtrl;
$ilTabs->addSubTab("searchform", $lng->txt("search"),
$ilCtrl->getLinkTarget($this, "showExtended"));
if ($_SESSION['rep_search']['usr']) // last search result
{
$ilTabs->addSubTab("searchresults", $lng->txt("search_results"),
$ilCtrl->getLinkTarget($this, "show"));
}
}

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::show ( )

Definition at line 178 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __showSearchResults(), __showSearchSimple(), and setSubTabs().

Referenced by listUsersGroup(), listUsersRole(), performSearch(), and performSearchSimple().

{
global $ilTabs;
$_SESSION["usr_search_mode"] = "simple";
//add template for buttons
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->setSubTabs();
$ilTabs->activateSubTab("searchresults");
// search extended
/*$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'showExtended'));
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("search_user_extended"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",$this->callback_class->ctrl->getLinkTarget($this->callback_class, "importUserForm"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("import_users"));
$this->tpl->parseCurrentBlock();*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::showExtended ( )

Definition at line 152 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __showSearch(), __showSearchResults(), and setSubTabs().

Referenced by performSearch(), start(), and startExtended().

{
global $ilTabs;
$this->setSubTabs();
$ilTabs->activateSubTab("searchform");
$_SESSION["usr_search_mode"] = "extended";
//add template for buttons
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// search extended
/*$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,'show'));
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("search_user_simple"));
$this->tpl->parseCurrentBlock();*/
/*$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK",$this->callback_class->ctrl->getLinkTarget($this->callback_class, "importUserForm"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt("import_users"));
$this->tpl->parseCurrentBlock();*/
$this->__showSearch();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdminUserSearchGUI::start ( )

Definition at line 123 of file class.ilAdminUserSearchGUI.php.

References showExtended().

{
// delete all session info
//$this->__clearSession();
$this->showExtended();
return true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::startExtended ( )

Definition at line 142 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __clearSession(), and showExtended().

{
// delete all session info
$this->__clearSession();
$_SESSION["usr_search_mode"] = "extended";
$this->showExtended();
return true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::startSimple ( )

Definition at line 132 of file class.ilAdminUserSearchGUI.php.

References $_SESSION, __clearSession(), and performSearchSimple().

{
// delete all session info
$this->__clearSession();
$_SESSION["usr_search_mode"] = "simple";
return true;
}

+ Here is the call graph for this function:

ilAdminUserSearchGUI::userAction ( )

Definition at line 1193 of file class.ilAdminUserSearchGUI.php.

References $_POST, $_SESSION, and $method.

{
$method = $_POST["selectedAction"];
$_SESSION['user_" . $method . "_search'] = true;
$class =& $this->callback_class;
$class->showActionConfirmation($method);
}

Field Documentation

ilAdminUserSearchGUI::$search_type = 'usr'

Definition at line 43 of file class.ilAdminUserSearchGUI.php.

Referenced by __updateResults(), and performSearchSimple().


The documentation for this class was generated from the following file: