ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 setCurrentUserId ($a_user_id)
 Set Check whether login is unused. More...
 
 getCurrentUserId ()
 Get Check whether login is unused. More...
 
 setDisableHtmlAutoComplete ($a_value)
 Set autocomplete. More...
 
 isHtmlAutoCompleteDisabled ()
 Get autocomplete. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 

Protected Attributes

 $value
 
 $size = 40
 
 $max_length = 80
 
 $checkunused = 0
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

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

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC.

30  {
31  global $DIC;
32 
33  $this->lng = $DIC->language();
34  parent::__construct($a_title, $a_postvar);
35  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ checkInput()

ilUserLoginInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

References $_POST, ilFormPropertyGUI\$lng, ilObjUser\_loginExists(), getCurrentUserId(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilUtil\isLogin(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

113  {
114  $lng = $this->lng;
115 
116  $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
117  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
118  $this->setAlert($lng->txt("msg_input_is_required"));
119 
120  return false;
121  }
122  if (!ilUtil::isLogin($_POST[$this->getPostVar()])) {
123  $this->setAlert($lng->txt("login_invalid"));
124 
125  return false;
126  }
127 
128  if (ilObjUser::_loginExists($_POST[$this->getPostVar()], $this->getCurrentUserId())) {
129  $this->setAlert($lng->txt("login_exists"));
130 
131  return false;
132  }
133 
134 
135  return true;
136  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static _loginExists($a_login, $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 stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static isLogin($a_login)
$_POST["username"]
getCurrentUserId()
Get Check whether login is unused.
+ Here is the call graph for this function:

◆ getCurrentUserId()

ilUserLoginInputGUI::getCurrentUserId ( )

Get Check whether login is unused.

Returns
boolean Check whether login is unused

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

References $checkunused.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getValue()

ilUserLoginInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by insert().

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

◆ insert()

ilUserLoginInputGUI::insert (   $a_tpl)

Insert property html.

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

References ilFormPropertyGUI\$lng, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getValue(), isHtmlAutoCompleteDisabled(), ilUtil\prepareFormOutput(), and size.

142  {
143  $lng = $this->lng;
144 
145  $a_tpl->setCurrentBlock("prop_login");
146  $a_tpl->setVariable("POST_VAR", $this->getPostVar());
147  $a_tpl->setVariable("ID", $this->getFieldId());
148  $a_tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
149  $a_tpl->setVariable("SIZE", $this->size);
150  $a_tpl->setVariable("MAXLENGTH", $this->max_length);
151  if ($this->getDisabled()) {
152  $a_tpl->setVariable(
153  "DISABLED",
154  " disabled=\"disabled\""
155  );
156  }
157  if ($this->isHtmlAutoCompleteDisabled()) {
158  $a_tpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
159  }
160  if ($this->getRequired()) {
161  $a_tpl->setVariable("REQUIRED", "required=\"required\"");
162  }
163  $a_tpl->parseCurrentBlock();
164  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getPostVar()
Get Post Variable.
isHtmlAutoCompleteDisabled()
Get autocomplete.
getFieldId()
Get Post Variable.
font size
Definition: langcheck.php:162
+ Here is the call graph for this function:

◆ isHtmlAutoCompleteDisabled()

ilUserLoginInputGUI::isHtmlAutoCompleteDisabled ( )

Get autocomplete.

Returns
bool Value

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

References $autocomplete_disabled.

Referenced by insert().

+ Here is the caller graph for this function:

◆ setCurrentUserId()

ilUserLoginInputGUI::setCurrentUserId (   $a_user_id)

Set Check whether login is unused.

Parameters
int$a_checkunuseduser id of current user

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

73  {
74  $this->checkunused = $a_user_id;
75  }

◆ setDisableHtmlAutoComplete()

ilUserLoginInputGUI::setDisableHtmlAutoComplete (   $a_value)

Set autocomplete.

Parameters
bool$a_valueValue

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

93  {
94  $this->autocomplete_disabled = (bool) $a_value;
95  }

◆ setValue()

ilUserLoginInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by setValueByArray().

43  {
44  $this->value = $a_value;
45  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilUserLoginInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

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

63  {
64  $this->setValue($a_values[$this->getPostVar()]);
65  }
getPostVar()
Get Post Variable.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

Field Documentation

◆ $autocomplete_disabled

ilUserLoginInputGUI::$autocomplete_disabled = false
protected

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

Referenced by isHtmlAutoCompleteDisabled().

◆ $checkunused

ilUserLoginInputGUI::$checkunused = 0
protected

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

Referenced by getCurrentUserId().

◆ $max_length

ilUserLoginInputGUI::$max_length = 80
protected

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

◆ $size

ilUserLoginInputGUI::$size = 40
protected

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

◆ $value

ilUserLoginInputGUI::$value
protected

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

Referenced by getValue().


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