1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Added tooltip and required attribute to CAPTCHA.

This commit is contained in:
Cameron
2013-04-26 19:12:52 -07:00
parent ab2f3691d8
commit c62313466b

View File

@@ -158,7 +158,7 @@ class secure_image
} }
$frm = e107::getForm(); $frm = e107::getForm();
return $frm->hidden("rand_num", $this->random_number).$frm->text("code_verify", "", 20, "","size=20"); return $frm->hidden("rand_num", $this->random_number).$frm->text("code_verify", "", 20, array("size"=>20,"title"=> LAN_ENTER_CODE,'required'=>1));
} }
function renderLabel() function renderLabel()
@@ -236,18 +236,30 @@ class secure_image
$secureimg['color'] = "90,90,90"; // red,green,blue $secureimg['color'] = "90,90,90"; // red,green,blue
*/ */
$bg_file = $secureimg['image'];
// var_dump($secureimg); // var_dump($secureimg);
if(isset($secureimg['font']) && !is_readable($path.$secureimg['font']))
{
echo "Font missing"; // for debug only. translation not necessary.
exit;
}
if(!is_readable($path.$secureimg['image'].$ext))
{
echo "Missing Background-Image: ".$secureimg['image'].$ext; // for debug only. translation not necessary.
exit;
}
} }
else else
{ {
$fontpath = $this->BASE_DIR.$this->FONTS_DIRECTORY;
$bg_file = "generic/code_bg"; $secureimg['image'] = "generic/code_bg";
$fontpath = $this->BASE_DIR.$this->FONTS_DIRECTORY; $secureimg['angle'] = "0";
$secureimg['angle'] = "0"; $secureimg['color'] = "90,90,90"; // red,green,blue
$secureimg['color'] = "90,90,90"; // red,green,blue $secureimg['x'] = "1";
$secureimg['x'] = "1"; $secureimg['y'] = "21";
$secureimg['y'] = "21";
$num = rand(1,3); $num = rand(1,3);
@@ -269,21 +281,23 @@ class secure_image
break; break;
} }
} }
if(isset($secureimg['font']) && !is_readable($path.$secureimg['font'])) if(isset($secureimg['font']) && !is_readable($fontpath.$secureimg['font']))
{ {
echo "Font missing"; // for debug only. translation not necessary. echo "Font missing"; // for debug only. translation not necessary.
exit; exit;
} }
if(isset($secureimg['font']) && !is_readable($path.$secureimg['image'].$ext))
if(isset($secureimg['image']) && !is_readable($path.$secureimg['image'].$ext))
{ {
echo "Missing Background-Image: ".$secureimg['image'].$ext; // for debug only. translation not necessary. echo "Missing Background-Image: ".$secureimg['image'].$ext; // for debug only. translation not necessary.
exit; exit;
} }
$bg_file = $secureimg['image'];
switch($type) switch($type)
{ {