ILIAS
release_4-3 Revision
◀ 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
protected
$autocomplete
=
false
;
18
25
function
__construct
($a_title =
""
, $a_postvar =
""
)
26
{
27
parent::__construct
($a_title, $a_postvar);
28
}
29
35
function
setValue
($a_value)
36
{
37
$this->value = $a_value;
38
}
39
45
function
getValue
()
46
{
47
return
$this->value
;
48
}
49
55
function
setValueByArray
($a_values)
56
{
57
$this->
setValue
($a_values[$this->
getPostVar
()]);
58
}
59
65
function
setCurrentUserId
($a_user_id)
66
{
67
$this->checkunused = $a_user_id;
68
}
69
75
function
getCurrentUserId
()
76
{
77
return
$this->checkunused
;
78
}
79
85
function
setAutoComplete
($a_value)
86
{
87
$this->autocomplete = (bool)$a_value;
88
}
89
95
function
getAutoComplete
()
96
{
97
return
$this->autocomplete
;
98
}
99
105
function
checkInput
()
106
{
107
global
$lng
;
108
109
$_POST
[$this->
getPostVar
()] =
ilUtil::stripSlashes
(
$_POST
[$this->
getPostVar
()]);
110
if
($this->
getRequired
() && trim(
$_POST
[$this->
getPostVar
()]) ==
""
)
111
{
112
$this->
setAlert
($lng->txt(
"msg_input_is_required"
));
113
114
return
false
;
115
}
116
if
(!
ilUtil::isLogin
(
$_POST
[$this->
getPostVar
()]))
117
{
118
$this->
setAlert
($lng->txt(
"login_invalid"
));
119
120
return
false
;
121
}
122
123
if
(
ilObjUser::_loginExists
(
$_POST
[$this->
getPostVar
()],$this->
getCurrentUserId
()))
124
{
125
$this->
setAlert
($lng->txt(
"login_exists"
));
126
127
return
false
;
128
}
129
130
131
return
true
;
132
}
133
137
function
insert
(&$a_tpl)
138
{
139
global
$lng
;
140
141
$a_tpl->setCurrentBlock(
"prop_login"
);
142
$a_tpl->setVariable(
"POST_VAR"
, $this->
getPostVar
());
143
$a_tpl->setVariable(
"ID"
, $this->
getFieldId
());
144
$a_tpl->setVariable(
"PROPERTY_VALUE"
,
ilUtil::prepareFormOutput
($this->
getValue
()));
145
$a_tpl->setVariable(
"SIZE"
, $this->size);
146
$a_tpl->setVariable(
"MAXLENGTH"
, $this->maxlength);
147
if
($this->
getDisabled
())
148
{
149
$a_tpl->setVariable(
"DISABLED"
,
150
" disabled=\"disabled\""
);
151
}
152
if
(!$this->
getAutoComplete
())
153
{
154
$a_tpl->setVariable(
"AUTOCOMPLETE"
,
"autocomplete=\"off\""
);
155
}
156
$a_tpl->parseCurrentBlock();
157
}
158
}
159
?>
Services
Form
classes
class.ilUserLoginInputGUI.php
Generated on Sat Apr 30 2016 19:00:59 for ILIAS by
1.8.1.2 (using
Doxyfile
)