ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
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

 $value
 
 $size = 20
 
 $image_width = 215
 
 $image_height = 80
 
- Protected Attributes inherited from ilFormPropertyGUI
 $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

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

References $lng, and ilFormPropertyGUI\setType().

41  {
42  global $lng;
43 
44  parent::__construct($a_title, $a_postvar);
45  $this->setType('captcha');
46  if($lng instanceof ilLanguage)
47  {
48  $lng->loadLanguageModule('cptch');
49  }
50  }
setType($a_type)
Set Type.
global $lng
Definition: privfeed.php:17
language handling
+ 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

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

References $_POST, $lng, $si, $tpl, ilUtil\appendUrlParameterString(), ilSecurImageUtil\getAudioScript(), ilSecurImageUtil\getDirectory(), ilFormPropertyGUI\getFieldId(), getImageHeight(), ilSecurImageUtil\getImageScript(), getImageWidth(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSize(), getValue(), ilUtil\prepareFormOutput(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

123  {
124  global $lng;
125 
126  $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
127  if($this->getRequired() && trim($_POST[$this->getPostVar()]) == '')
128  {
129  if($lng instanceof ilLanguage)
130  {
131  $this->setAlert($lng->txt('msg_input_is_required'));
132  }
133 
134  return false;
135  }
136 
137  include_once('./Services/Captcha/classes/class.ilSecurImage.php');
138  $si = new ilSecurImage();
139  if(!$si->check($_POST[$this->getPostVar()]))
140  {
141  if($lng instanceof ilLanguage)
142  {
143  $this->setAlert($lng->txt('cptch_wrong_input'));
144  }
145 
146  return false;
147  }
148 
149  return true;
150  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
SecurImage Wrapper (very simply wrapper, does not abstract other captchas)
global $lng
Definition: privfeed.php:17
language handling
$_POST["username"]
+ Here is the call graph for this function:

◆ getImageHeight()

ilCaptchaInputGUI::getImageHeight ( )
Returns
int

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

References $image_height.

Referenced by checkInput().

82  {
83  return $this->image_height;
84  }
+ Here is the caller graph for this function:

◆ getImageWidth()

ilCaptchaInputGUI::getImageWidth ( )
Returns
int

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

References $image_width.

Referenced by checkInput().

98  {
99  return $this->image_width;
100  }
+ Here is the caller graph for this function:

◆ getSize()

ilCaptchaInputGUI::getSize ( )
Returns
int

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

References $size.

Referenced by checkInput().

114  {
115  return $this->size;
116  }
+ Here is the caller graph for this function:

◆ getValue()

ilCaptchaInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by checkInput().

66  {
67  return $this->value;
68  }
+ Here is the caller graph for this function:

◆ insert()

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

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

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

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

◆ setImageHeight()

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

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

References $image_height.

74  {
75  $this->image_height = $image_height;
76  }

◆ setImageWidth()

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

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

References $image_width.

90  {
91  $this->image_width = $image_width;
92  }

◆ setSize()

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

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

References $size, and size.

106  {
107  $this->size = $size;
108  }
font size
Definition: langcheck.php:162

◆ setValue()

ilCaptchaInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by setValueByArray().

57  {
58  $this->value = $a_value;
59  }
+ 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 206 of file class.ilCaptchaInputGUI.php.

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

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

Field Documentation

◆ $image_height

ilCaptchaInputGUI::$image_height = 80
protected

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

Referenced by getImageHeight(), and setImageHeight().

◆ $image_width

ilCaptchaInputGUI::$image_width = 215
protected

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

Referenced by getImageWidth(), and setImageWidth().

◆ $size

ilCaptchaInputGUI::$size = 20
protected

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

Referenced by getSize(), and setSize().

◆ $value

ilCaptchaInputGUI::$value
protected

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

Referenced by getValue().


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