Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: How do I make " I agree" checkbox on the bottom of disclaimer?  (Read 4664 times)

0 Members and 1 Guest are viewing this topic.

pawelfoto

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22

I want to force users to click on " I agree" checkbox on the page with disclaimer,  before they will continue  registration process.

I dont know html/javascript at all,  so this is big problem for me.

Would anybode help me with this?


My gallery: www.pawelfoto.com

« Last Edit: December 16, 2009, 08:30:53 am by Joachim Müller »
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: How do I make " I agree" checkbox on the bottom of disclaimer?
« Reply #1 on: December 12, 2009, 05:14:02 pm »

The default behavior is for the disclaimer to be shown. But since you don't have "Allow new user registrations" set to yes it is hard to see what you have now.........

pawelfoto

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: How do I make " I agree" checkbox on the bottom of disclaimer?
« Reply #2 on: December 12, 2009, 05:22:10 pm »

Ok, It is solved

I just copied some scripts form modifyalb.php...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How do I make " I agree" checkbox on the bottom of disclaimer?
« Reply #3 on: December 14, 2009, 10:37:34 am »

Post what you actually did for the benefit of others with similar questions.
Logged

pawelfoto

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: How do I make " I agree" checkbox on the bottom of disclaimer?
« Reply #4 on: December 15, 2009, 04:27:54 pm »

Ok, it is quite Simple.

Edit register.php file. Make sure you done backup first.


Find
Code: [Select]
<form method="post" action="{$_SERVER['PHP_SELF']}">
Past into new line before

Code: [Select]
<script>
var checkobj

function agreesubmit(el){
    checkobj=el
    if (document.all||document.getElementById){
        for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
            var tempobj=checkobj.form.elements[i]
            if(tempobj.type.toLowerCase()=="submit")
                tempobj.disabled=!checkobj.checked
        }
    }
}

function defaultagree(el){
    if (!document.all&&!document.getElementById){
        if (window.checkobj&&checkobj.checked)
            return true
        else{
            alert("I am sure")
            return false
        }
    }
}
</script>

Next find

Code: [Select]
echo <<<EOT
                </td>
        </tr>
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" />
                </td>
        </tr>

EOT;

and replace it with this code below

Code: [Select]
echo <<<EOT
 
                </td>
                 
        </tr>
        <tr>
        <td colspan="1" align="left" class="tablef">
               
                                      <input name="agreecheck" id="agreecheck" type="checkbox" onClick="agreesubmit(this)" /><label for="agreecheck"><b>I Agree</b></label>
                </td>

        </tr>
        <tr>
                <td colspan="1" align="center" class="tablef">
                        <input type="submit" name="agree" value="{$lang_register_php['i_agree']}" class="button" disabled="disabled" />
                </td>
        </tr>

EOT;

Thats it !
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How do I make " I agree" checkbox on the bottom of disclaimer?
« Reply #5 on: December 16, 2009, 08:30:36 am »

Thanks for your readiness to share.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.