forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: chzuqi on March 16, 2009, 09:42:16 am

Title: Need I destroy session after I create it?
Post by: chzuqi on March 16, 2009, 09:42:16 am
I edit the file "register.php" and put the Security Code Check In it just look like the file I  uploaded.
The file saved the Security Code into $_SESSION['SafeCode'],need I destroy it when it invalid? ???

I put
Code: [Select]
array('safecode'),after
Code: [Select]
array('input', 'email', $lang_register_php['email'], 255),
and put this to display Security Code
Code: [Select]
case 'safecode':
    echo <<<EOT
    <tr><td width="40%" class="tableb"  height="25">
        <script language="javascript">
function startRequest(){
$("#re").load("ajaxcheckcode.php?safecode="+$("#safeccc").val());
}
</script>
            Security Code:<span style="font-size:10px">(click to refresh)</span><img src=ajaxcode.php onclick="this.src='ajaxcode.php?nocache='+Math.random()" style="cursor:hand"/></td>
        <td width="60%" class="tableb" valign="top">
        <input type=text name=safecode id=safeccc style="width:80px" onBlur="startRequest()"><span id=re style="padding-left:30px;font-size:12px"></span>
        </td></tr>
EOT;
    break;
after
Code: [Select]
foreach ($form_data as $element) switch ($element[0]) {
put thw code to check the Security Code
Code: [Select]
session_start();
if ((get_post_var('safecode') != $_SESSION['SafeCode']) or ($_SESSION['CodeTime']<time())){
$error = '<li>' . 'Security Code Wrong';
return false;
}
after
Code: [Select]
$result = cpg_db_query($sql);
The file I used has uploaded.
Title: Re: Need I destroy session after I create it?
Post by: Joachim Müller on March 17, 2009, 08:56:45 am
Ask the person you got your "securitycode" hack from. It's not part of Coppermine, so how are we suppossed to know what that hack does and what it takes to make it work.
What is that piece of code suppossed to do? Is it some sort of captcha hack? If yes, use the captcha mod or plugin that is being discussed here on our site. If you insist on using a third-party hack that doesn't come from this site, you're on your own.
Title: Re: Need I destroy session after I create it?
Post by: chzuqi on March 17, 2009, 09:42:59 am
Thanks. I will use captcha to insetd it.