ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilUserLoginInputGUI Class Reference

This class represents a user login property in a property form. More...

+ Inheritance diagram for ilUserLoginInputGUI:
+ Collaboration diagram for ilUserLoginInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 setValue (string $a_value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 setCurrentUserId (int $a_user_id)
 
 getCurrentUserId ()
 
 setDisableHtmlAutoComplete (bool $a_value)
 
 isHtmlAutoCompleteDisabled ()
 
 checkInput ()
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Attributes

string $value = ""
 
int $size = 40
 
int $max_length = 80
 
int $checkunused = 0
 
bool $autocomplete_disabled = false
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Detailed Description

This class represents a user login property in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
12 This component will be removed with ILIAS 12

Definition at line 27 of file class.ilUserLoginInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserLoginInputGUI::__construct ( string  $a_title = "",
string  $a_postvar = "" 
)

Definition at line 38 of file class.ilUserLoginInputGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

41  {
42  global $DIC;
43 
44  $this->lng = $DIC->language();
45  parent::__construct($a_title, $a_postvar);
46  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilUserLoginInputGUI::checkInput ( )

Definition at line 83 of file class.ilUserLoginInputGUI.php.

References ilFormPropertyGUI\$lng, ilObjUser\_loginExists(), getCurrentUserId(), getInput(), ilFormPropertyGUI\getRequired(), ilUtil\isLogin(), ilFormPropertyGUI\setAlert(), and ilLanguage\txt().

83  : bool
84  {
85  $lng = $this->lng;
86 
87  $value = $this->getInput();
88  if ($this->getRequired() && $value == "") {
89  $this->setAlert($lng->txt("msg_input_is_required"));
90  return false;
91  }
92  if (!ilUtil::isLogin($value)) {
93  $this->setAlert($lng->txt("login_invalid"));
94  return false;
95  }
96 
98  $this->setAlert($lng->txt("login_exists"));
99  return false;
100  }
101 
102  return true;
103  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _loginExists(string $a_login, int $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
static isLogin(string $a_login)
+ Here is the call graph for this function:

◆ getCurrentUserId()

ilUserLoginInputGUI::getCurrentUserId ( )

Definition at line 68 of file class.ilUserLoginInputGUI.php.

References $checkunused.

Referenced by checkInput().

68  : int
69  {
70  return $this->checkunused;
71  }
+ Here is the caller graph for this function:

◆ getInput()

ilUserLoginInputGUI::getInput ( )

Definition at line 105 of file class.ilUserLoginInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and ilFormPropertyGUI\str().

Referenced by checkInput().

105  : string
106  {
107  return trim($this->str($this->getPostVar()));
108  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValue()

ilUserLoginInputGUI::getValue ( )

Definition at line 53 of file class.ilUserLoginInputGUI.php.

References $value.

Referenced by insert().

53  : string
54  {
55  return $this->value;
56  }
+ Here is the caller graph for this function:

◆ insert()

ilUserLoginInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 110 of file class.ilUserLoginInputGUI.php.

References ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getValue(), isHtmlAutoCompleteDisabled(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

110  : void
111  {
112  $a_tpl->setCurrentBlock("prop_login");
113  $a_tpl->setVariable("POST_VAR", $this->getPostVar());
114  $a_tpl->setVariable("ID", $this->getFieldId());
115  $a_tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($this->getValue()));
116  $a_tpl->setVariable("SIZE", $this->size);
117  $a_tpl->setVariable("MAXLENGTH", $this->max_length);
118  if ($this->getDisabled()) {
119  $a_tpl->setVariable(
120  "DISABLED",
121  " disabled=\"disabled\""
122  );
123  }
124  if ($this->isHtmlAutoCompleteDisabled()) {
125  $a_tpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
126  }
127  if ($this->getRequired()) {
128  $a_tpl->setVariable("REQUIRED", "required=\"required\"");
129  }
130  $a_tpl->parseCurrentBlock();
131  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ isHtmlAutoCompleteDisabled()

ilUserLoginInputGUI::isHtmlAutoCompleteDisabled ( )

Definition at line 78 of file class.ilUserLoginInputGUI.php.

References $autocomplete_disabled.

Referenced by insert().

78  : bool
79  {
81  }
+ Here is the caller graph for this function:

◆ setCurrentUserId()

ilUserLoginInputGUI::setCurrentUserId ( int  $a_user_id)

Definition at line 63 of file class.ilUserLoginInputGUI.php.

63  : void
64  {
65  $this->checkunused = $a_user_id;
66  }

◆ setDisableHtmlAutoComplete()

ilUserLoginInputGUI::setDisableHtmlAutoComplete ( bool  $a_value)

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

73  : void
74  {
75  $this->autocomplete_disabled = $a_value;
76  }

◆ setValue()

ilUserLoginInputGUI::setValue ( string  $a_value)

Definition at line 48 of file class.ilUserLoginInputGUI.php.

Referenced by setValueByArray().

48  : void
49  {
50  $this->value = $a_value;
51  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilUserLoginInputGUI::setValueByArray ( array  $a_values)

Definition at line 58 of file class.ilUserLoginInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

58  : void
59  {
60  $this->setValue($a_values[$this->getPostVar()]);
61  }
+ Here is the call graph for this function:

Field Documentation

◆ $autocomplete_disabled

bool ilUserLoginInputGUI::$autocomplete_disabled = false
protected

Definition at line 36 of file class.ilUserLoginInputGUI.php.

Referenced by isHtmlAutoCompleteDisabled().

◆ $checkunused

int ilUserLoginInputGUI::$checkunused = 0
protected

Definition at line 32 of file class.ilUserLoginInputGUI.php.

Referenced by getCurrentUserId().

◆ $max_length

int ilUserLoginInputGUI::$max_length = 80
protected

Definition at line 31 of file class.ilUserLoginInputGUI.php.

◆ $size

int ilUserLoginInputGUI::$size = 40
protected

Definition at line 30 of file class.ilUserLoginInputGUI.php.

◆ $value

string ilUserLoginInputGUI::$value = ""
protected

Definition at line 29 of file class.ilUserLoginInputGUI.php.

Referenced by getValue().


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