ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSecurImage Class Reference

SecurImage Wrapper (very simply wrapper, does not abstract other captchas) More...

+ Collaboration diagram for ilSecurImage:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getSecureImageObject ()
 
 check ($a_input)
 
 showImage ()
 
 setImageHeight ($image_height)
 
 getImageHeight ()
 
 setImageWidth ($image_width)
 
 getImageWidth ()
 

Data Fields

const MAX_CAPTCHA_IMG_WIDTH = 430
 
const MAX_CAPTCHA_IMG_HEIGHT = 160
 

Protected Attributes

 $lng
 
 $image_width = 0
 
 $image_height = 0
 
 $securimage
 

Static Protected Attributes

static $supported_audio_languages
 

Detailed Description

SecurImage Wrapper (very simply wrapper, does not abstract other captchas)

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.ilSecurImage.php.

Constructor & Destructor Documentation

◆ __construct()

ilSecurImage::__construct ( )

Constructor.

Definition at line 55 of file class.ilSecurImage.php.

References $DIC, and ilSecurImageUtil\includeSecurImage().

56  {
57  global $DIC;
58 
59  $this->lng = $DIC->language();
61  $this->securimage = new Securimage();
62  if (!function_exists("imagettftext")) {
63  $this->securimage->use_gd_font = true;
64  }
65 
66  $this->securimage->num_lines = 3;
67  }
global $DIC
Definition: saml.php:7
Project: Securimage: A PHP class for creating and managing form CAPTCHA images File: securimage...
+ Here is the call graph for this function:

Member Function Documentation

◆ check()

ilSecurImage::check (   $a_input)
Parameters
$a_input
Returns
bool

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

82  {
83  return $this->securimage->check($a_input);
84  }

◆ getImageHeight()

ilSecurImage::getImageHeight ( )
Returns
int

Definition at line 130 of file class.ilSecurImage.php.

References $image_height.

131  {
132  return $this->image_height;
133  }

◆ getImageWidth()

ilSecurImage::getImageWidth ( )
Returns
int

Definition at line 150 of file class.ilSecurImage.php.

References $image_width.

151  {
152  return $this->image_width;
153  }

◆ getSecureImageObject()

ilSecurImage::getSecureImageObject ( )
Returns
Securimage

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

References $securimage.

73  {
74  return $this->securimage;
75  }

◆ setImageHeight()

ilSecurImage::setImageHeight (   $image_height)
Parameters
int$image_height
Exceptions
InvalidArgumentException

Definition at line 119 of file class.ilSecurImage.php.

References $image_height.

120  {
121  if (!is_numeric($image_height) || $image_height > self::MAX_CAPTCHA_IMG_HEIGHT) {
122  throw new InvalidArgumentException('Please provide a valid image height (numeric value > 0 and <= ' . self::MAX_CAPTCHA_IMG_HEIGHT);
123  }
124  $this->image_height = $image_height;
125  }

◆ setImageWidth()

ilSecurImage::setImageWidth (   $image_width)
Parameters
int$image_width
Exceptions
InvalidArgumentException

Definition at line 139 of file class.ilSecurImage.php.

References $image_width.

140  {
141  if (!is_numeric($image_width) || $image_width > self::MAX_CAPTCHA_IMG_WIDTH) {
142  throw new InvalidArgumentException('Please provide a valid image width (numeric value > 0 and <= ' . self::MAX_CAPTCHA_IMG_WIDTH);
143  }
144  $this->image_width = $image_width;
145  }

◆ showImage()

ilSecurImage::showImage ( )

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

References $lng, and ilSecurImageUtil\getDirectory().

90  {
92  $this->securimage->show();
93  }
+ Here is the call graph for this function:

Field Documentation

◆ $image_height

ilSecurImage::$image_height = 0
protected

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

Referenced by getImageHeight(), and setImageHeight().

◆ $image_width

ilSecurImage::$image_width = 0
protected

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

Referenced by getImageWidth(), and setImageWidth().

◆ $lng

ilSecurImage::$lng
protected

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

Referenced by showImage().

◆ $securimage

ilSecurImage::$securimage
protected

Definition at line 43 of file class.ilSecurImage.php.

Referenced by getSecureImageObject().

◆ $supported_audio_languages

ilSecurImage::$supported_audio_languages
staticprotected
Initial value:
= array(
'fr', 'de'
)

Definition at line 48 of file class.ilSecurImage.php.

◆ MAX_CAPTCHA_IMG_HEIGHT

const ilSecurImage::MAX_CAPTCHA_IMG_HEIGHT = 160

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

◆ MAX_CAPTCHA_IMG_WIDTH

const ilSecurImage::MAX_CAPTCHA_IMG_WIDTH = 430

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


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