ILIAS
Release_5_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilUserLoginInputGUI.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
class
ilUserLoginInputGUI
extends
ilFormPropertyGUI
12
{
13
protected
$value
;
14
protected
$size
= 40;
15
protected
$max_length
= 80;
16
protected
$checkunused
= 0;
17
21
protected
$autocomplete_disabled
=
false
;
22
29
function
__construct
($a_title =
""
, $a_postvar =
""
)
30
{
31
parent::__construct
($a_title, $a_postvar);
32
}
33
39
function
setValue
($a_value)
40
{
41
$this->value = $a_value;
42
}
43
49
function
getValue
()
50
{
51
return
$this->value
;
52
}
53
59
function
setValueByArray
($a_values)
60
{
61
$this->
setValue
($a_values[$this->
getPostVar
()]);
62
}
63
69
function
setCurrentUserId
($a_user_id)
70
{
71
$this->checkunused = $a_user_id;
72
}
73
79
function
getCurrentUserId
()
80
{
81
return
$this->checkunused
;
82
}
83
89
function
setDisableHtmlAutoComplete
($a_value)
90
{
91
$this->autocomplete_disabled = (bool)$a_value;
92
}
93
99
function
isHtmlAutoCompleteDisabled
()
100
{
101
return
$this->autocomplete_disabled
;
102
}
103
109
function
checkInput
()
110
{
111
global
$lng
;
112
113
$_POST
[$this->
getPostVar
()] =
ilUtil::stripSlashes
(
$_POST
[$this->
getPostVar
()]);
114
if
($this->
getRequired
() && trim(
$_POST
[$this->
getPostVar
()]) ==
""
)
115
{
116
$this->
setAlert
($lng->txt(
"msg_input_is_required"
));
117
118
return
false
;
119
}
120
if
(!
ilUtil::isLogin
(
$_POST
[$this->
getPostVar
()]))
121
{
122
$this->
setAlert
($lng->txt(
"login_invalid"
));
123
124
return
false
;
125
}
126
127
if
(
ilObjUser::_loginExists
(
$_POST
[$this->
getPostVar
()],$this->
getCurrentUserId
()))
128
{
129
$this->
setAlert
($lng->txt(
"login_exists"
));
130
131
return
false
;
132
}
133
134
135
return
true
;
136
}
137
141
function
insert
(&$a_tpl)
142
{
143
global
$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->maxlength);
151
if
($this->
getDisabled
())
152
{
153
$a_tpl->setVariable(
"DISABLED"
,
154
" disabled=\"disabled\""
);
155
}
156
if
($this->
isHtmlAutoCompleteDisabled
())
157
{
158
$a_tpl->setVariable(
"AUTOCOMPLETE"
,
"autocomplete=\"off\""
);
159
}
160
$a_tpl->parseCurrentBlock();
161
}
162
}
163
?>
Services
Form
classes
class.ilUserLoginInputGUI.php
Generated on Wed Apr 27 2016 21:01:39 for ILIAS by
1.8.1.2 (using
Doxyfile
)