ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCaptchaInputGUI Class Reference

This class represents a captcha input in a property form. More...

+ Inheritance diagram for ilCaptchaInputGUI:
+ Collaboration diagram for ilCaptchaInputGUI:

Public Member Functions

 __construct ($a_title='', $a_postvar='')
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setImageHeight ($image_height)
 
 getImageHeight ()
 
 setImageWidth ($image_width)
 
 getImageWidth ()
 
 setSize ($size)
 
 getSize ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 
 setValueByArray ($a_values)
 Set value by array. 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...
 

Protected Attributes

 $lng
 
 $value
 
 $size = 20
 
 $image_width = 215
 
 $image_height = 80
 
- 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 captcha input in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilCaptchaInputGUI::__construct (   $a_title = '',
  $a_postvar = '' 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 45 of file class.ilCaptchaInputGUI.php.

46 {
47 global $DIC;
48
49 $this->lng = $DIC->language();
50 $lng = $DIC->language();
51
52 parent::__construct($a_title, $a_postvar);
53 $this->setType('captcha');
54 if ($lng instanceof ilLanguage) {
55 $lng->loadLanguageModule('cptch');
56 }
57 }
setType($a_type)
Set Type.
language handling
global $DIC
Definition: saml.php:7

References $DIC, $lng, and ilFormPropertyGUI\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilCaptchaInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 129 of file class.ilCaptchaInputGUI.php.

130 {
132
134 if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == '') {
135 if ($lng instanceof ilLanguage) {
136 $this->setAlert($lng->txt('msg_input_is_required'));
137 }
138
139 return false;
140 }
141
142 include_once('./Services/Captcha/classes/class.ilSecurImage.php');
143 $si = new ilSecurImage();
144 if (!$si->check($_POST[$this->getPostVar()])) {
145 if ($lng instanceof ilLanguage) {
146 $this->setAlert($lng->txt('cptch_wrong_input'));
147 }
148
149 return false;
150 }
151
152 return true;
153 }
$_POST["username"]
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
SecurImage Wrapper (very simply wrapper, does not abstract other captchas)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $lng, $si, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getImageHeight()

ilCaptchaInputGUI::getImageHeight ( )
Returns
int

Definition at line 88 of file class.ilCaptchaInputGUI.php.

References $image_height.

◆ getImageWidth()

ilCaptchaInputGUI::getImageWidth ( )
Returns
int

Definition at line 104 of file class.ilCaptchaInputGUI.php.

References $image_width.

◆ getSize()

ilCaptchaInputGUI::getSize ( )
Returns
int

Definition at line 120 of file class.ilCaptchaInputGUI.php.

121 {
122 return $this->size;
123 }

References $size.

◆ getValue()

ilCaptchaInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

◆ insert()

ilCaptchaInputGUI::insert ( ilTemplate  $a_tpl)
Parameters
ilTemplate$a_tpl

Definition at line 195 of file class.ilCaptchaInputGUI.php.

196 {
197 $html = $this->render();
198
199 $a_tpl->setCurrentBlock('prop_generic');
200 $a_tpl->setVariable('PROP_GENERIC', $html);
201 $a_tpl->parseCurrentBlock();
202 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
$html
Definition: example_001.php:87

References $html, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setImageHeight()

ilCaptchaInputGUI::setImageHeight (   $image_height)
Parameters
int$image_height

Definition at line 80 of file class.ilCaptchaInputGUI.php.

81 {
82 $this->image_height = $image_height;
83 }

References $image_height.

◆ setImageWidth()

ilCaptchaInputGUI::setImageWidth (   $image_width)
Parameters
int$image_width

Definition at line 96 of file class.ilCaptchaInputGUI.php.

97 {
98 $this->image_width = $image_width;
99 }

References $image_width.

◆ setSize()

ilCaptchaInputGUI::setSize (   $size)
Parameters
int$size

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

113 {
114 $this->size = $size;
115 }

References $size.

◆ setValue()

ilCaptchaInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

64 {
65 $this->value = $a_value;
66 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilCaptchaInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 208 of file class.ilCaptchaInputGUI.php.

209 {
210 $this->setValue($a_values[$this->getPostVar()]);
211 }
setValue($a_value)
Set Value.

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

+ Here is the call graph for this function:

Field Documentation

◆ $image_height

ilCaptchaInputGUI::$image_height = 80
protected

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

Referenced by getImageHeight(), and setImageHeight().

◆ $image_width

ilCaptchaInputGUI::$image_width = 215
protected

Definition at line 33 of file class.ilCaptchaInputGUI.php.

Referenced by getImageWidth(), and setImageWidth().

◆ $lng

ilCaptchaInputGUI::$lng
protected

Definition at line 18 of file class.ilCaptchaInputGUI.php.

Referenced by __construct(), and checkInput().

◆ $size

ilCaptchaInputGUI::$size = 20
protected

Definition at line 28 of file class.ilCaptchaInputGUI.php.

Referenced by getSize(), and setSize().

◆ $value

ilCaptchaInputGUI::$value
protected

Definition at line 23 of file class.ilCaptchaInputGUI.php.

Referenced by getValue().


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