Plugin Directory

Changeset 740249 for pie-register


Ignore:
Timestamp:
07/13/2013 10:34:12 AM (12 years ago)
Author:
genetech
Message:

version 1.31

Location:
pie-register/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pie-register/trunk/menus/pieregisterSettings.php

    r738939 r740249  
    287287                <?php _e('Disclaimer Title','piereg');?>
    288288              </label>
    289               <input type="text" name="piereg_disclaimer_title" id="disclaimer_title" value="<?php echo $piereg['disclaimer_title'];?>" />
     289              <input type="text" name="piereg_disclaimer_title" id="disclaimer_title" value="<?php echo html_entity_decode($piereg['disclaimer_title']);?>" />
    290290              <br />
    291291              <label for="disclaimer_content">
     
    293293              </label>
    294294              <br />
    295               <textarea name="piereg_disclaimer_content" id="disclaimer_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo stripslashes($piereg['disclaimer_content']);?></textarea>
     295              <textarea name="piereg_disclaimer_content" id="disclaimer_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo html_entity_decode($piereg['disclaimer_content']);?></textarea>
    296296              <br />
    297297              <label for="disclaimer_agree">
    298298                <?php _e('Agreement Text','piereg');?>
    299299              </label>
    300               <input type="text" name="piereg_disclaimer_agree" id="disclaimer_agree" value="<?php echo $piereg['disclaimer_agree'];?>" />
     300              <input type="text" name="piereg_disclaimer_agree" id="disclaimer_agree" value="<?php echo ($piereg['disclaimer_agree']);?>" />
    301301            </div></td>
    302302        </tr>
     
    313313                <?php _e('License Title','piereg');?>
    314314              </label>
    315               <input type="text" name="piereg_license_title" id="license_title" value="<?php echo $piereg['license_title'];?>" />
     315              <input type="text" name="piereg_license_title" id="license_title" value="<?php echo ($piereg['license_title']);?>" />
    316316              <br />
    317317              <label for="license_content">
     
    319319              </label>
    320320              <br />
    321               <textarea name="piereg_license_content" id="license_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo stripslashes($piereg['license_content']);?></textarea>
     321              <textarea name="piereg_license_content" id="license_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo html_entity_decode($piereg['license_content']);?></textarea>
    322322              <br />
    323323              <label for="license_agree">
    324324                <?php _e('Agreement Text','piereg');?>
    325325              </label>
    326               <input type="text" name="piereg_license_agree" id="license_agree" value="<?php echo $piereg['license_agree'];?>" />
     326              <input type="text" name="piereg_license_agree" id="license_agree" value="<?php echo ($piereg['license_agree']);?>" />
    327327            </div></td>
    328328        </tr>
     
    345345              </label>
    346346              <br />
    347               <textarea name="piereg_privacy_content" id="privacy_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo stripslashes($piereg['privacy_content']);?></textarea>
     347              <textarea name="piereg_privacy_content" id="privacy_content" cols="25" rows="10" style="width:80%;height:300px;display:block;"><?php echo html_entity_decode($piereg['privacy_content']);?></textarea>
    348348              <br />
    349349              <label for="privacy_agree">
  • pie-register/trunk/pie-register.php

    r738939 r740249  
    77
    88Author: Genetech
    9 Version: 1.30
     9Version: 1.31
    1010Author URI: http://www.genetechsolutions.com/
    1111
     
    3737        private $ipn_debug;
    3838        var $holdmsg = '';
     39        public $headmsg='';
     40        public $bodymsg='';
    3941        /**
    4042        * Constructor
     
    9496                    array_walk_recursive($_REQUEST, array(&$this,'disable_magic_quotes_gpc'));
    9597                }
     98               
    9699                if( ($this->ref == $this->admin_edit_profile_page) || ($this->ref == $this->admin_own_profile_page) ){
    97100                    add_action( 'admin_head', array($this, 'ProfilesHead') );
     
    601604            if(isset($_POST['email_notification_page'])){
    602605           
    603             $update['html'] = $this->disable_magic_quotes_gpc($_POST['piereg_html']);
    604             $update['from'] = $this->disable_magic_quotes_gpc($_POST['piereg_from']);
    605             $update['fromname'] = $this->disable_magic_quotes_gpc($_POST['piereg_fromname']);
    606             $update['subject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_subject']));
    607             $update['custom_msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_msg']));
     606            $update['html'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_html'],'HTML-ENTITIES','utf-8'));
     607            $update['from'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_from'],'HTML-ENTITIES','utf-8'));
     608            $update['fromname'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_fromname'],'HTML-ENTITIES','utf-8'));
     609            $update['subject'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_subject'],'HTML-ENTITIES','utf-8')));
     610            $update['custom_msg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_custom_msg'],'HTML-ENTITIES','utf-8')));
    608611            $update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_user_nl2br']));
    609612            $update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsguser_nl2br']));
    610613            $update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsguser_nl2br']));
    611             $update['msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_msg']));
    612             $update['adminvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsg']));
    613             $update['emailvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsg']));
     614            $update['msg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_msg'],'HTML-ENTITIES','utf-8')));
     615            $update['adminvmsg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_adminvmsg'],'HTML-ENTITIES','utf-8')));
     616            $update['emailvmsg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_emailvmsg'],'HTML-ENTITIES','utf-8')));
    614617            $update['disable_admin'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disable_admin']));
    615618            $update['adminhtml'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminhtml']));
    616             $update['adminfrom'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfrom']));
    617             $update['adminfromname'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfromname']));
    618             $update['adminsubject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminsubject']));
    619             $update['custom_adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_adminmsg']));
     619            $update['adminfrom'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_adminfrom'],'HTML-ENTITIES','utf-8')));
     620            $update['adminfromname'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_adminfromname'],'HTML-ENTITIES','utf-8')));
     621            $update['adminsubject'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_adminsubject'],'HTML-ENTITIES','utf-8')));
     622            $update['custom_adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_custom_adminmsg'],'HTML-ENTITIES','utf-8')));
    620623            $update['admin_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_admin_nl2br']));
    621             $update['adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminmsg']));
     624            $update['adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_adminmsg'],'HTML-ENTITIES','utf-8')));
    622625            }
    623626            if(isset($_POST['presentation_page'])){
     
    630633            $update["password"] = $this->disable_magic_quotes_gpc($_POST['piereg_password']);
    631634            $update["password_meter"] = $this->disable_magic_quotes_gpc($_POST['piereg_password_meter']);
    632             $update["short"] = $this->disable_magic_quotes_gpc($_POST['piereg_short']);
    633             $update["bad"] = $this->disable_magic_quotes_gpc($_POST['piereg_bad']);
    634             $update["good"] = $this->disable_magic_quotes_gpc($_POST['piereg_good']);
    635             $update["strong"] = $this->disable_magic_quotes_gpc($_POST['piereg_strong']);
    636             $update["mismatch"] = $this->disable_magic_quotes_gpc($_POST['piereg_mismatch']);
    637             $update["code"] = $this->disable_magic_quotes_gpc($_POST['piereg_code']);
     635            $update["short"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_short'],'HTML-ENTITIES','utf-8'));
     636            $update["bad"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_bad'],'HTML-ENTITIES','utf-8'));
     637            $update["good"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_good'],'HTML-ENTITIES','utf-8'));
     638            $update["strong"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_strong'],'HTML-ENTITIES','utf-8'));
     639            $update["mismatch"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_mismatch'],'HTML-ENTITIES','utf-8'));
     640            $update["code"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_code'],'HTML-ENTITIES','utf-8'));
    638641            $update["custom_logo_url"] = $this->disable_magic_quotes_gpc($_POST['custom_logo_url']);
    639642           
     
    642645            }
    643646            $update["code_auto_del"] = $this->disable_magic_quotes_gpc($_POST['piereg_code_auto_del']);
    644             $update["codename"] = $this->disable_magic_quotes_gpc($_POST['piereg_codename']);
     647            $update["codename"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($$_POST['piereg_codename'],'HTML-ENTITIES','utf-8'));
    645648            if( isset($_POST['piereg_code']) ) {
    646649                $update["codepass"] = $_POST['piereg_codepass'];
     
    657660            }
    658661            $update["captcha"] = $this->disable_magic_quotes_gpc($_POST['piereg_captcha']);
    659             $update["disclaimer"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disclaimer']));
    660             $update["disclaimer_title"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disclaimer_title']));
    661             $update["disclaimer_content"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disclaimer_content']));
    662             $update["disclaimer_agree"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disclaimer_agree']));
    663             $update["license"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_license']));
    664             $update["license_title"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_license_title']));
    665             $update["license_content"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_license_content']));
    666             $update["license_agree"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_license_agree']));
    667             $update["privacy"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_privacy']));
    668             $update["privacy_title"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_privacy_title']));
    669             $update["privacy_content"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_privacy_content']));
    670             $update["privacy_agree"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_privacy_agree']));
     662            $update["disclaimer"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_disclaimer'],'HTML-ENTITIES','utf-8')));
     663            $update["disclaimer_title"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_disclaimer_title'],'HTML-ENTITIES','utf-8'));
     664            $update["disclaimer_content"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_disclaimer_content'],'HTML-ENTITIES','utf-8')));
     665            $update["disclaimer_agree"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_disclaimer_agree'],'HTML-ENTITIES','utf-8')));
     666            $update["license"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_license'],'HTML-ENTITIES','utf-8')));
     667            $update["license_title"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_license_title'],'HTML-ENTITIES','utf-8'));
     668            $update["license_content"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_license_content'],'HTML-ENTITIES','utf-8')));
     669            $update["license_agree"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_license_agree'],'HTML-ENTITIES','utf-8')));
     670            $update["privacy"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_privacy'],'HTML-ENTITIES','utf-8')));
     671            $update["privacy_title"] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg_privacy_title'],'HTML-ENTITIES','utf-8'));
     672            $update["privacy_content"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_privacy_content'],'HTML-ENTITIES','utf-8')));
     673            $update["privacy_agree"] = $this->disable_magic_quotes_gpc(htmlentities(mb_convert_encoding($_POST['piereg_privacy_agree'],'HTML-ENTITIES','utf-8')));
    671674            $update["email_exists"] = $this->disable_magic_quotes_gpc($_POST['piereg_email_exists']);
    672675            $update["firstname"] = $this->disable_magic_quotes_gpc($_POST['piereg_firstname']);
    673676            $update["lastname"] = $this->disable_magic_quotes_gpc($_POST['piereg_lastname']);
    674677            $update["website"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_website']));
    675             $update["aim"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_aim']));
    676             $update["yahoo"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_yahoo']));
    677             $update["jabber"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_jabber']));
    678             $update["phone"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_phone']));
    679             $update["about"] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_about']));
     678            $update["aim"] = $this->disable_magic_quotes_gpc($_POST['piereg_aim']);
     679            $update["yahoo"] = $this->disable_magic_quotes_gpc($_POST['piereg_yahoo']);
     680            $update["jabber"] = $this->disable_magic_quotes_gpc($_POST['piereg_jabber']);
     681            $update["phone"] = $this->disable_magic_quotes_gpc($_POST['piereg_phone']);
     682            $update["about"] = $this->disable_magic_quotes_gpc($_POST['piereg_about']);
    680683            $update["profile_req"] = $this->disable_magic_quotes_gpc($_POST['piereg_profile_req']);
    681684            $update["require_style"] = $this->disable_magic_quotes_gpc(($_POST['piereg_require_style']));
     
    706709            }
    707710            if(isset($_POST['customised_messages_page'])){
    708                 $update['_admin_message_1'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_1']);
    709                 $update['_admin_message_2'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_2']);
    710                 $update['_admin_message_3'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_3']);
    711                 $update['_admin_message_4'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_4']);
    712                 $update['_admin_message_5'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_5']);
    713                 $update['_admin_message_6'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_6']);
    714                 $update['_admin_message_7'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_7']);
    715                 $update['_admin_message_8'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_8']);
    716                 $update['_admin_message_9'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_9']);
    717                 $update['_admin_message_10'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_10']);
    718                 $update['_admin_message_12'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_12']);
    719                 $update['_admin_message_13'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_13']);
    720                 $update['_admin_message_14'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_14']);
    721                 $update['_admin_message_15'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_15']);
    722                 $update['_admin_message_16'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_16']);
    723                 $update['_admin_message_17'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_17']);
    724                 $update['_admin_message_18'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_18']);
    725                 $update['_admin_message_19'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_19']);
    726                 $update['_admin_message_20'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_20']);
    727                 $update['_admin_message_21'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_21']);
    728                 $update['_admin_message_22'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_22']);
    729                 $update['_admin_message_23'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_23']);
    730                 $update['_admin_message_24'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_24']);
    731                 $update['_admin_message_25'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_25']);
    732                 $update['_admin_message_26'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_26']);
    733                 $update['_admin_message_27'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_27']);
    734                 $update['_admin_message_28'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_28']);
    735                 $update['_admin_message_29'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_29']);
    736                 $update['_admin_message_30'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_30']);
    737                 $update['_admin_message_31'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_31']);
    738                 $update['_admin_message_32'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_32']);
    739                 $update['_admin_message_33'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_33']);
    740                 $update['_admin_message_34'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_34']);
    741                 $update['_admin_message_35'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_35']);
    742                 $update['_admin_message_36'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_36']);
    743                 $update['_admin_message_37'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_37']);
    744                 $update['_admin_message_38'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_38']);
    745                 $update['_admin_message_39'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_39']);
    746                 $update['_admin_message_40'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_40']);
    747                 $update['_admin_message_41'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_41']);
    748                 $update['_admin_message_42'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_42']);
    749                 $update['_admin_message_43'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_43']);
    750                 $update['_admin_message_44'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_44']);
    751                 $update['_admin_message_45'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_45']);
    752                 $update['_admin_message_46'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_46']);
    753                 $update['_admin_message_47'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_47']);
    754                 $update['_admin_message_48'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_48']);
    755                 $update['_admin_message_49'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_49']);
    756                 $update['_admin_message_50'] = $this->disable_magic_quotes_gpc($_POST['piereg__admin_message_50']);
     711                $update['_admin_message_1'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_1'],'HTML-ENTITIES','utf-8'));
     712                $update['_admin_message_2'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_2'],'HTML-ENTITIES','utf-8'));
     713                $update['_admin_message_3'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_3'],'HTML-ENTITIES','utf-8'));
     714                $update['_admin_message_4'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_4'],'HTML-ENTITIES','utf-8'));
     715                $update['_admin_message_5'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_5'],'HTML-ENTITIES','utf-8'));
     716                $update['_admin_message_6'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_6'],'HTML-ENTITIES','utf-8'));
     717                $update['_admin_message_7'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_7'],'HTML-ENTITIES','utf-8'));
     718                $update['_admin_message_8'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_8'],'HTML-ENTITIES','utf-8'));
     719                $update['_admin_message_9'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_9'],'HTML-ENTITIES','utf-8'));
     720                $update['_admin_message_10'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_10'],'HTML-ENTITIES','utf-8'));
     721                $update['_admin_message_12'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_12'],'HTML-ENTITIES','utf-8'));
     722                $update['_admin_message_13'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_13'],'HTML-ENTITIES','utf-8'));
     723                $update['_admin_message_14'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_14'],'HTML-ENTITIES','utf-8'));
     724                $update['_admin_message_15'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_15'],'HTML-ENTITIES','utf-8'));
     725                $update['_admin_message_16'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_16'],'HTML-ENTITIES','utf-8'));
     726                $update['_admin_message_17'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_17'],'HTML-ENTITIES','utf-8'));
     727                $update['_admin_message_18'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_18'],'HTML-ENTITIES','utf-8'));
     728                $update['_admin_message_19'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_19'],'HTML-ENTITIES','utf-8'));
     729                $update['_admin_message_20'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_20'],'HTML-ENTITIES','utf-8'));
     730                $update['_admin_message_21'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_21'],'HTML-ENTITIES','utf-8'));
     731                $update['_admin_message_22'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_22'],'HTML-ENTITIES','utf-8'));
     732                $update['_admin_message_23'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_23'],'HTML-ENTITIES','utf-8'));
     733                $update['_admin_message_24'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_24'],'HTML-ENTITIES','utf-8'));
     734                $update['_admin_message_25'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_25'],'HTML-ENTITIES','utf-8'));
     735                $update['_admin_message_26'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_26'],'HTML-ENTITIES','utf-8'));
     736                $update['_admin_message_27'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_27'],'HTML-ENTITIES','utf-8'));
     737                $update['_admin_message_28'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_28'],'HTML-ENTITIES','utf-8'));
     738                $update['_admin_message_29'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_29'],'HTML-ENTITIES','utf-8'));
     739                $update['_admin_message_30'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_30'],'HTML-ENTITIES','utf-8'));
     740                $update['_admin_message_31'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_31'],'HTML-ENTITIES','utf-8'));
     741                $update['_admin_message_32'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_32'],'HTML-ENTITIES','utf-8'));
     742                $update['_admin_message_33'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_33'],'HTML-ENTITIES','utf-8'));
     743                $update['_admin_message_34'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_34'],'HTML-ENTITIES','utf-8'));
     744                $update['_admin_message_35'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_35'],'HTML-ENTITIES','utf-8'));
     745                $update['_admin_message_36'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_36'],'HTML-ENTITIES','utf-8'));
     746                $update['_admin_message_37'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_37'],'HTML-ENTITIES','utf-8'));
     747                $update['_admin_message_38'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_38'],'HTML-ENTITIES','utf-8'));
     748                $update['_admin_message_39'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_39'],'HTML-ENTITIES','utf-8'));
     749                $update['_admin_message_40'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_40'],'HTML-ENTITIES','utf-8'));
     750                $update['_admin_message_41'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_41'],'HTML-ENTITIES','utf-8'));
     751                $update['_admin_message_42'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_42'],'HTML-ENTITIES','utf-8'));
     752                $update['_admin_message_43'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_43'],'HTML-ENTITIES','utf-8'));
     753                $update['_admin_message_44'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_44'],'HTML-ENTITIES','utf-8'));
     754                $update['_admin_message_45'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_45'],'HTML-ENTITIES','utf-8'));
     755                $update['_admin_message_46'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_46'],'HTML-ENTITIES','utf-8'));
     756                $update['_admin_message_47'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_47'],'HTML-ENTITIES','utf-8'));
     757                $update['_admin_message_48'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_48'],'HTML-ENTITIES','utf-8'));
     758                $update['_admin_message_49'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_49'],'HTML-ENTITIES','utf-8'));
     759                $update['_admin_message_50'] = $this->disable_magic_quotes_gpc(mb_convert_encoding($_POST['piereg__admin_message_50'],'HTML-ENTITIES','utf-8'));
    757760            }
    758761           
     
    10051008            $piereg = get_option('pie_register');
    10061009           
    1007             $user = $wpdb->get_row("SELECT user_login, user_email FROM $wpdb->users WHERE ID='$user_id'");
     1010            //$user = $wpdb->get_row("SELECT user_login, user_email FROM $wpdb->users WHERE ID='$user_id'");
     1011            $user = get_user_by('id', $user_id);
    10081012            $message = __($piereg['_admin_message_17']) . "\r\n";
    10091013            $message .= sprintf(__('Username: %s', 'piereg'), $user->user_login) . "\r\n";
     
    12251229                foreach( $piereg_custom as $k=>$v ){
    12261230                    if( $v['required'] && $v['reg'] ){
    1227                         $id = $this->Label_ID($v['label']);
     1231                        $id = str_replace('.','_',$this->Label_ID($v['label']));
    12281232                        if(empty($_POST[$id]) || $_POST[$id] == ''){
    12291233                            $errors->add('empty_' . $id, __('<strong>ERROR</strong>: Please enter your ' . $v['label'] . '.', 'piereg'));
     
    12621266                require_once('recaptchalib.php');
    12631267                $privatekey = $piereg['reCAP_private_key'];
    1264                 $resp = rp_recaptcha_check_answer ($privatekey,
     1268                $resp = recaptcha_check_answer ($privatekey,
    12651269
    12661270                                                $_SERVER["REMOTE_ADDR"],
     
    13031307                    $CeRror=1;
    13041308                }elseif( ($Cexpiry > 0) && $this->SelectCode($_POST['regcode']) == $Cexpiry ){
    1305                     $this->UpdateCode($_POST['regcode']);
     1309                    //$this->UpdateCode($_POST['regcode']);
    13061310                    $errors->add('expired_regcode', __('<strong>ERROR</strong>: Your '.$piereg['codename'].' '.$piereg['_admin_message_35'], 'piereg'));
    13071311                    $CeRror=1;
     
    13451349            ?>
    13461350        <p><label for="firstname"><?php _e('First Name:', 'piereg');?><br />
    1347         <input autocomplete="off" name="firstname" id="firstname" size="25" value="<?php echo $_POST['firstname'];?>" type="text" /></label>
     1351        <input name="firstname" id="firstname" size="25" value="<?php echo sanitize_text_field($_POST['firstname']);?>" type="text" /></label>
    13481352        </p>
    13491353            <?php
     
    13531357            ?>
    13541358        <p><label for="lastname"><?php _e('Last Name:', 'piereg');?><br />
    1355         <input autocomplete="off" name="lastname" id="lastname" size="25" value="<?php echo $_POST['lastname'];?>" type="text" /></label></p>
     1359        <input name="lastname" id="lastname" size="25" value="<?php echo sanitize_text_field($_POST['lastname']);?>" type="text" /></label></p>
    13561360            <?php
    13571361            }
     
    13601364            ?>
    13611365            <p><label for="password"><?php _e('Password:', 'piereg');?><br />
    1362             <input autocomplete="off" name="pass1" id="pass1" size="25" value="<?php echo $_POST['pass1'];?>" type="password" /></label>
     1366            <input autocomplete="off" name="pass1" id="pass1" size="25" value="<?php echo sanitize_text_field($_POST['pass1']);?>" type="password" /></label>
    13631367          <br /> <label><?php _e('Confirm Password:', 'piereg');?><br />
    1364             <input autocomplete="off" name="pass2" id="pass2" size="25" value="<?php echo $_POST['pass2'];?>" type="password" /></label>
     1368            <input autocomplete="off" name="pass2" id="pass2" size="25" value="<?php echo sanitize_text_field($_POST['pass2']);?>" type="password" /></label>
    13651369            <?php if( $piereg['password_meter'] ){ ?>
    13661370          <br /> <span id="pass-strength-result"><?php echo $piereg['short'];?></span>
     
    13791383        <?php if( $v['fieldtype'] == 'text' ){ ?>
    13801384        <p><label for="<?php echo $id;?>"><?php echo $v['label'];?>:<br />
    1381         <input autocomplete="off" class="custom_field" name="<?php echo $id;?>" id="<?php echo $id;?>" size="25" value="<?php echo $_POST[$id];?>" type="text" /></label></p>
     1385        <input class="custom_field" name="<?php echo $id;?>" id="<?php echo $id;?>" size="25" value="<?php echo sanitize_text_field($_POST[$id]);?>" type="text" /></label></p>
    13821386       
    1383         <?php } else if( $v['fieldtype'] == 'date' ){ ?>
     1387        <?php } else if( $v['fieldtype'] == 'date' ){
     1388            /*$test_arr  = explode('/', $_POST[$id]);
     1389            if (count($test_arr) == 3) {
     1390                //date is valid
     1391                $sanitized_date=intval($test_arr[0]).'/'.intval($test_arr[1]).'/'.intval($test_arr[2]);
     1392            } else {
     1393                // problem with input ...
     1394                $sanitized_date = '';
     1395            }*/
     1396                       
     1397            ?>
    13841398       <p><label for="<?php echo $id;?>"><?php echo $v['label'];?>:<br />
    1385         <input autocomplete="off" class="custom_field date-pick" name="<?php echo $id;?>" id="<?php echo $id;?>" size="25" value="<?php echo $_POST[$id];?>" type="text" /></label></p>
     1399        <input class="custom_field date-pick" name="<?php echo $id;?>" id="<?php echo $id;?>" size="25" value="<?php echo $_POST[$id];?>" type="text" /></label></p>
    13861400       
    13871401        <?php } else if( $v['fieldtype'] == 'select' ){
     
    13901404            foreach( $ops as $op ){
    13911405                $options .= '<option value="'.$op.'" ';
    1392                 if( $_POST[$id] == $op ) $options .= 'selected="selected"';
     1406                if( $_POST[$id] == $op ) $options .= 'selected="selected" ';
    13931407                $options .= '>' . $op . '</option>';
    13941408            }
     
    14051419                    $check .= '<label><input type="checkbox" class="custom_checkbox" name="'.$id.'[]" id="'.$id.'" ';
    14061420                    //if( in_array($op, $_POST[$id]) ) $check .= 'checked="checked" ';
     1421                    if( $_POST[$id] == $op ) $check .= 'checked="checked" ';
    14071422                    $check .= 'value="'.$op.'" /> '.$op.'</label> ';
    14081423                }
     
    14151430                $radio = '';
    14161431                foreach( $ops as $op ){
    1417                     $radio .= '<label for="'.$id.'"><input type="radio" class="custom_radio" name="'.$id.'" id="'.$id.'" ';
     1432                    $radio .= '<label for="'.$id.'-'.$op.'"><input type="radio" class="custom_radio" name="'.$id.'" id="'.$id.'-'.$op.'" ';
    14181433                    //if( in_array($op, $_POST[$id]) ) $radio .= 'checked="checked" ';
     1434                    if( $_POST[$id] == $op ) $radio .= 'checked="checked" ';
    14191435                    $radio .= 'value="'.$op.'" /> '.$op.'</label> ';
    14201436                }
     
    14251441            } else if( $v['fieldtype'] == 'textarea' ){ ?>
    14261442           <p><label for="<?php echo $id;?>"><?php echo $v['label'];?>:<br />
    1427         <textarea name="<?php echo $id;?>" cols="25" rows="5" id="<?php echo $id;?>" class="custom_textarea"><?php echo $_POST[$id];?></textarea></label></p>   
     1443        <textarea name="<?php echo $id;?>" cols="25" rows="5" id="<?php echo $id;?>" class="custom_textarea"><?php echo sanitize_text_field($_POST[$id]);?></textarea></label></p> 
    14281444       
    14291445        <?php } else if( $v['fieldtype'] == 'hidden' ){ ?><p>
    1430         <input class="custom_field" name="<?php echo $id;?>" value="<?php echo $_POST[$id];?>" type="hidden" />  </p>           
     1446        <input class="custom_field" name="<?php echo $id;?>" value="<?php echo sanitize_text_field($_POST[$id]);?>" type="hidden" />  </p>         
    14311447        <?php } ?>     
    14321448               
     
    14371453            ?>
    14381454        <p><label for="website"><?php _e('Website:', 'piereg');?><br />
    1439         <input autocomplete="off" name="website" id="website" size="25" value="<?php echo $_POST['website'];?>" type="text" /></label></p>
     1455        <input name="website" id="website" size="25" value="<?php echo sanitize_text_field($_POST['website']);?>" type="text" /></label></p>
    14401456            <?php
    14411457            }
     
    14441460            ?>
    14451461        <p><label for="aim"><?php _e('AIM:', 'piereg');?><br />
    1446         <input autocomplete="off" name="aim" id="aim" size="25" value="<?php echo $_POST['aim'];?>" type="text" /></label></p>
     1462        <input name="aim" id="aim" size="25" value="<?php echo sanitize_text_field($_POST['aim']);?>" type="text" /></label></p>
    14471463            <?php
    14481464            }
     
    14511467            ?>
    14521468        <p><label for="yahoo"><?php _e('Yahoo IM:', 'piereg');?><br />
    1453         <input autocomplete="off" name="yahoo" id="yahoo" size="25" value="<?php echo $_POST['yahoo'];?>" type="text" /></label></p>
     1469        <input name="yahoo" id="yahoo" size="25" value="<?php echo sanitize_text_field($_POST['yahoo']);?>" type="text" /></label></p>
    14541470            <?php
    14551471            }
     
    14581474            ?>
    14591475        <p><label for="jabber"><?php _e('Jabber / Google Talk:', 'piereg');?><br />
    1460         <input autocomplete="off" name="jabber" id="jabber" size="25" value="<?php echo $_POST['jabber'];?>" type="text" /></label></p>
     1476        <input name="jabber" id="jabber" size="25" value="<?php echo sanitize_text_field($_POST['jabber']);?>" type="text" /></label></p>
    14611477            <?php
    14621478            }
     
    14651481            ?>
    14661482        <p><label for="phone"><?php _e('Phone # / Mobile #:', 'piereg');?><br />
    1467         <input autocomplete="off" name="phone" id="phone" size="25" value="<?php echo $_POST['phone'];?>" type="text" /></label></p>
     1483        <input name="phone" id="phone" size="25" value="<?php echo sanitize_text_field($_POST['phone']);?>" type="text" /></label></p>
    14681484            <?php
    14691485            }
     
    14721488            ?>
    14731489        <p><label for="about"><?php _e('About Yourself:', 'piereg');?><br />
    1474         <textarea autocomplete="off" name="about" id="about" cols="25" rows="5"><?php echo stripslashes($_POST['about']);?></textarea></label>
     1490        <textarea name="about" id="about" cols="25" rows="5"><?php echo stripslashes(sanitize_text_field($_POST['about']));?></textarea></label>
    14751491        <small><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.', 'piereg');?></small>
    14761492        </p>
     
    14841500            ?>
    14851501        <p><label for="code"><?php _e($piereg['codename'].' Code:', 'piereg');?><br />
    1486         <input name="regcode" id="regcode" size="25" value="<?php echo $_POST['regcode'];?>" type="text" /></label>
     1502        <input name="regcode" id="regcode" size="25" value="<?php echo sanitize_text_field($_POST['regcode']);?>" type="text" /></label>
    14871503        <?php if ($piereg['code_req']) {?>
    14881504        <p><small><?php _e(str_replace('[prcodename]',$piereg['codename'],$piereg['_admin_message_38']), 'piereg');?></small></p>
     
    15331549                $publickey = $piereg['reCAP_public_key'];
    15341550                echo '<div id="reCAPTCHA">';
    1535                 echo rp_recaptcha_get_html($publickey);
     1551                echo recaptcha_get_html($publickey);
    15361552                echo '</div>';
    15371553            }
     
    17831799            $piereg = get_option( 'pie_register' );
    17841800            $username = $_COOKIE['session_secure_id'];
    1785             $user_id = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE `user_login` = '".$username."'");
     1801            //$user_id = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE `user_login` = '".$username."'");
     1802            $user = get_user_by('login', $username);
     1803            $user_id = $user->ID;
    17861804            //var_dump($username,$user_id);
    17871805            $admin_verified_user = get_user_meta($user_id,'admin_verified_user',true);
     
    19011919                                break;
    19021920                            case "date" :
    1903                                 $outfield = '<input autocomplete="off" class="custom_field date-pick" tabindex="36" name="' . $id . '" id="' . $id . '" value="' . $value . '"  />';
     1921                                $outfield = '<input class="custom_field date-pick" tabindex="36" name="' . $id . '" id="' . $id . '" value="' . $value . '"  />';
    19041922                            break;
    19051923                        }
     
    19721990                        $paypalcode.="?cmd=_s-xclick&custom=".$user_id."&hosted_button_id=".$piereg['paypal_butt_id']."'><img src='https://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif' alt='PayPal - The safer, easier way to pay online' border='0' /></a>";
    19731991                        $msg = '<p style="margin-bottom:10px;">' . sprintf(__('Hello <strong>%s</strong>, '.$piereg['_admin_message_44'], 'piereg'), $login ) . '</p>'.$paypalcode;
    1974                         $func3 = function() use ($msg){ echo $msg; };
    1975                         add_action('login_form', $func3);
     1992                        //$func3 = function() use ($msg){ echo $msg; };
     1993                        $this->bodymsg = $msg;
     1994                        add_action('login_form', array(&$this,'pie_login_form_body_msg'));
    19761995                       
    19771996                        $message = __($piereg['_admin_message_43'], 'piereg');
    1978                         $func = function($ms) use ($message){ return $message; };
    1979                         add_filter('login_messages', $func);
     1997                        //$func = function($ms) use ($message){ return $message; };
     1998                        $this->headmsg = $message;
     1999                        add_filter('login_messages', array(&$this,'pie_login_head_message'));
    19802000                        return true;
    19812001                    }else{
    19822002                        ///die($username);
    1983                         $user_id = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE `user_login` = '".$username."'");
     2003                        //$user_id = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE `user_login` = '".$username."'");
     2004                        $user = get_user_by('login', $username);
     2005                        $user_id = $user->ID;
    19842006                        if($user_id){
    19852007                            $admin_verified_user = get_user_meta($user_id,'admin_verified_user',true);
    19862008                            if($admin_verified_user){
    19872009                                $message = __($piereg['_admin_message_17'], 'piereg');
    1988                                 $func = function($ms) use ($message){ return $message; };
    1989                                 add_filter('login_messages', $func);
     2010                                //$func = function($ms) use ($message){ return $message; };
     2011                                $this->headmsg = $message;
     2012                                add_filter('login_messages', array(&$this,'pie_login_head_message'));
    19902013                            }
    19912014                        }
     
    19932016                }elseif( $piereg['admin_verify']){
    19942017                    $message = __($piereg['_admin_message_41'], 'piereg');
    1995                     $func = function() use ($message){ return $message; };
    1996                     add_filter('login_messages', $func);
     2018                    //$func = function() use ($message){ return $message; };
     2019                    $this->headmsg = $message;
     2020                        add_filter('login_messages', array(&$this,'pie_login_head_message'));
    19972021                    return true;
    19982022                }elseif($piereg['email_verify']){
    19992023                    $message = __($piereg['_admin_message_42'], 'piereg');
    2000                     $func = function() use ($message){ return $message; };
    2001                     add_filter('login_messages', $func);
     2024                    //$func = function() use ($message){ return $message; };
     2025                    //die(__($piereg['_admin_message_42'], 'piereg'));
     2026                    $this->headmsg = $message;
     2027                    //$session[] = $message;
     2028                    add_filter('login_messages', array(&$this,'pie_login_head_message'));
    20022029                    return true;
    20032030                }
     
    20082035                if($user_id > 0){
    20092036                    $login = get_user_meta($user_id, 'email_verify_user',true);
     2037                    if(!$login){
     2038                        $user = get_user_by("id",$user_id);
     2039                        $login = $user->user_login;
     2040                    }
    20102041                    //var_dump($login);
    20112042                    update_user_meta( $user_id, 'is_email_verified', 'yes' );
     
    20222053                       
    20232054                        $msg = '<p style="margin-bottom:10px;">' . sprintf(__('Thank you <strong>%s</strong>, '.$piereg['_admin_message_46'], 'piereg'), $login ) . '</p>';
    2024                         $func3 = function() use ($msg){ echo $msg; };
    2025                         add_action('login_form', $func3);
     2055                        //$func3 = function() use ($msg){ echo $msg; };
     2056                        $this->bodymsg = $msg;
     2057                        add_action('login_form', array(&$this,'pie_login_form_body_msg'));
    20262058                    }
    20272059                    else{
     
    20352067                            $paypalcode.="?cmd=_s-xclick&custom=".$user_id."&hosted_button_id=".$piereg['paypal_butt_id']."'><img src='https://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif' alt='PayPal - The safer, easier way to pay online' border='0' /></a>";
    20362068                            $msg = '<p style="margin-bottom:10px;">' . sprintf(__('Hello <strong>%s</strong>, '.$piereg['_admin_message_45'], 'piereg'), $login ) . '</p>'.$paypalcode;
    2037                             $func3 = function() use ($msg){ echo $msg; };
    2038                             add_action('login_form', $func3);
     2069                            //$func3 = function() use ($msg){ echo $msg; };
     2070                            $this->bodymsg = $msg;
     2071                            add_action('login_form', array(&$this,'pie_login_form_body_msg'));
    20392072                           
    20402073                        }else{
     
    20472080                           
    20482081                            $msg = '<p style="margin-bottom:10px;">' . sprintf(__('Thank you <strong>%s</strong>, '.$piereg['_admin_message_46'], 'piereg'), $login ) . '</p>';
    2049                             $func3 = function() use ($msg){ echo $msg; };
    2050                             add_action('login_form', $func3);
     2082                            //$func3 = function() use ($msg){ echo $msg; };
     2083                            $this->bodymsg = $msg;
     2084                            add_action('login_form', array(&$this,'pie_login_form_body_msg'));
    20512085                        }
    20522086                    }
     
    22412275                }
    22422276            }elseif($_GET['action'] == 'payment_cancel'){
    2243                 echo '<p style="text-align:center;">' . __($piereg['_admin_message_49'], 'piereg') . '</p>';
     2277                //die('true');
     2278                //$this->headmsg = __($piereg['_admin_message_49'], 'piereg');
     2279                add_filter('login_message', array(&$this,'payment_error_msg'));
    22442280            }else{
    22452281                return false;
     
    22842320       
    22852321        function override_warning(){
     2322            $reflFunc = new ReflectionFunction('wp_new_user_notification');
     2323            print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();   
    22862324            //if( current_user_can('activate_plugins') &&  $_GET['page'] == 'pie-register' )
    22872325            echo "<div id='piereg-warning' class='updated fade-ff0000'><p><strong>".__('You have another plugin installed that is conflicting with Pie Register.  This other plugin is overriding the user notification emails.  Please contact <a href="http://www.genetechsolutions.com/support.html" target="_blank">support</a> with the list of your installed plugins and theme information.', 'piereg') . "</strong></p></div>";
     2326        }
     2327        /*
     2328        Backward Compatibility Issue fix
     2329        */
     2330        //Callback functions
     2331        function pie_login_head_message(){
     2332            return $this->headmsg;
     2333        }
     2334        //Callback functions
     2335        function pie_login_form_body_msg(){
     2336            echo $this->bodymsg;
    22882337        }
    22892338    }
  • pie-register/trunk/piewpnun.php

    r738939 r740249  
    11<?php
    2 
    3 if ( function_exists('wp_new_user_notification') )
    4 
    5     add_action('admin_notices', array($pie_register, 'override_warning'));
    6 
    7    
     2/*Deprecated Function*/
     3/*if ( function_exists('wp_new_user_notification') )
     4    add_action('admin_notices', array($pie_register, 'override_warning'));*/
    85
    96# Override set user password and send email to User #
     
    497494}
    498495
     496}else{
     497    add_action('user_register','pie_register_user_notification');
    499498}
    500 
     499function pie_register_user_notification($user_id){
     500   
     501
     502    $user = new WP_User($user_id); 
     503
     504   
     505
     506    #-- PIE REGESTER --#
     507
     508    global $wpdb, $pie_register;
     509
     510    $piereg = get_option( 'pie_register' );
     511
     512    $piereg_custom = get_option( 'pie_register_custom' );
     513
     514    $ref = explode( '?', $_SERVER['HTTP_REFERER']);
     515
     516    $ref = $ref[0];
     517
     518    $admin = trailingslashit( get_option('siteurl') ) . 'wp-admin/user-new.php';
     519
     520    if( !is_array( $piereg_custom ) ) $piereg_custom = array();
     521
     522    if( $piereg['password'] && !empty($_POST['user_pw'])){
     523        $plaintext_pass = $_POST['user_pw'];
     524    }else{
     525         // otherwise use the supplied password
     526         $plaintext_pass = $pie_register->RanPass(6);
     527    }
     528
     529   
     530
     531    if( $piereg['firstname'] && $_POST['firstname'] )   
     532
     533        update_usermeta( $user_id, 'first_name', $_POST['firstname']);
     534
     535    if( $piereg['lastname'] && $_POST['lastname'] )
     536
     537        update_usermeta( $user_id, 'last_name', $_POST['lastname']);
     538
     539    if( $piereg['website'] && $_POST['website'] )   
     540
     541        update_usermeta( $user_id, 'user_url', $_POST['website']);
     542
     543    if( $piereg['aim'] && $_POST['aim'] )   
     544
     545        update_usermeta( $user_id, 'aim', $_POST['aim']);
     546
     547    if( $piereg['yahoo'] && $_POST['yahoo'] )   
     548
     549        update_usermeta( $user_id, 'yim', $_POST['yahoo']);
     550
     551    if( $piereg['jabber'] && $_POST['jabber'] )
     552
     553        update_usermeta( $user_id, 'jabber', $_POST['jabber']);
     554
     555    if( $piereg['phone'] && $_POST['phone'] )   
     556
     557        update_usermeta( $user_id, 'phone', $_POST['phone']);
     558
     559    if( $piereg['about'] && $_POST['about'] )   
     560
     561        update_usermeta( $user_id, 'description',$_POST['about']);
     562
     563    if( $piereg['code'] && $_POST['regcode'] ) 
     564
     565        update_usermeta( $user_id, 'invite_code', $_POST['regcode']);
     566
     567    if( $ref != $admin && $piereg['admin_verify'] ){
     568
     569        update_usermeta( $user_id, 'admin_verify_user', $user->user_login );
     570
     571        update_usermeta( $user_id, 'email_verify_user_pwd', $user->user_pass );
     572
     573        update_usermeta( $user_id, 'email_verify_email', $user->user_email );
     574
     575        $temp_id = 'unverified__' . $pie_register->RanPass(7);
     576
     577        $notice = __('Your account requires activation by an administrator before you will be able to login.', 'piereg') . "\r\n";
     578
     579    }else if( $ref != $admin && $piereg['email_verify'] ){
     580
     581        $code = $pie_register->RanPass(25);
     582
     583        update_usermeta( $user_id, 'email_verify', $code );
     584
     585        update_usermeta( $user_id, 'email_verify_date', date('Ymd') );
     586
     587        update_usermeta( $user_id, 'email_verify_user', $user->user_login );
     588
     589        update_usermeta( $user_id, 'email_verify_user_pwd', $user->user_pass );
     590
     591        update_usermeta( $user_id, 'email_verify_email', $user->user_email );
     592
     593        $email_code = '?piereg_verification=' . $code.'&';
     594
     595        $prelink = __('Verification URL: ', 'piereg');
     596
     597        $notice = __('Please use the link above to verify and activate your account', 'piereg') . "\r\n";
     598
     599        $temp_id = 'unverified__' . $pie_register->RanPass(7);
     600
     601        delete_user_setting('default_password_nag', $user_id);
     602
     603        update_user_option($user_id, 'default_password_nag', false, true);
     604
     605    }else if( $ref != $admin && $piereg['paypal_option']){
     606
     607        $code = $pie_register->RanPass(25);
     608
     609        update_usermeta( $user_id, 'email_verify', $code );
     610       
     611        update_usermeta( $user_id, 'pending_payment', 'yes' );
     612
     613        update_usermeta( $user_id, 'email_verify_user', $user->user_login );
     614
     615        update_usermeta( $user_id, 'email_verify_user_pwd', $user->user_pass );
     616
     617        update_usermeta( $user_id, 'email_verify_email', $user->user_email );
     618
     619        $temp_id = 'unverified__' . $pie_register->RanPass(7);
     620
     621        $email_code = '?piereg_verification=' . $code.'&';
     622
     623
     624
     625        $prelink = __('Verification URL: ', 'piereg');
     626
     627        $notice = __('Please click on the above link to verify your email', 'piereg') . "\r\n";
     628
     629    }
     630
     631    if (!empty($piereg_custom)) {
     632
     633        foreach( $piereg_custom as $k=>$v ){
     634
     635            $id = $pie_register->Label_ID($v['label']);
     636
     637            if( $v['reg'] && $_POST[$id] ){
     638
     639                if( is_array( $_POST[$id] ) ) $_POST[$id] = implode(', ', $_POST[$id]);
     640
     641                update_usermeta( $user_id, $id, $_POST[$id]);
     642
     643            }
     644
     645        }
     646
     647    }
     648
     649    #-- END Pie Rgister --#
     650
     651   
     652
     653    wp_set_password($plaintext_pass, $user_id);
     654
     655    $user_login = stripslashes($user->user_login);
     656
     657    $user_email = stripslashes($user->user_email);
     658
     659
     660
     661    #-- Pie-Register --#
     662
     663    if( !$piereg['custom_adminmsg'] && !$piereg['disable_admin'] ){
     664
     665    #-- END Pie-Register --#
     666
     667   
     668
     669    $message  = sprintf(__('New user Register on your blog %s:', 'piereg'), get_option('blogname')) . "\r\n\r\n";
     670
     671    $message .= sprintf(__('Username: %s', 'piereg'), $user_login) . "\r\n\r\n";
     672
     673    $message .= sprintf(__('E-mail: %s', 'piereg'), $user_email) . "\r\n";
     674
     675
     676
     677    @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Register', 'piereg'), get_option('blogname')), $message);
     678
     679   
     680
     681    #-- Pie-Register --#
     682
     683    }else if( !$piereg['disable_admin'] ){     
     684
     685        if( $piereg['adminhtml'] ){
     686
     687            $headers  = 'MIME-Version: 1.0' . "\r\n";
     688
     689            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     690
     691        }
     692
     693        //$headers .= 'From: ' . $piereg['adminfrom'] . "\r\n" . 'Reply-To: ' . $piereg['adminfrom'] . "\r\n";
     694
     695        add_filter('wp_mail_from', array($pie_register, 'adminfrom'));
     696
     697        add_filter('wp_mail_from_name', array($pie_register, 'adminfromname'));
     698
     699        $subject = $piereg['adminsubject'];
     700
     701        $message = str_replace('%user_login%', $user_login, $piereg['adminmsg']);
     702
     703        $message = str_replace('%user_email%', $user_email, $message);
     704
     705        $message = str_replace('%blogname%', get_option('blogname'), $message);
     706
     707        $message = str_replace('%user_ip%', $_SERVER['REMOTE_ADDR'], $message);
     708
     709        $message = str_replace('%user_host%', gethostbyaddr($_SERVER['REMOTE_ADDR']), $message);
     710
     711        $message = str_replace('%user_ref%', $_SERVER['HTTP_REFERER'], $message);
     712
     713        $message = str_replace('%user_agent%', $_SERVER['HTTP_USER_AGENT'], $message);
     714
     715        if( $piereg['firstname'] ) $message = str_replace('%firstname%', $_POST['firstname'], $message);
     716
     717        if( $piereg['lastname'] ) $message = str_replace('%lastname%', $_POST['lastname'], $message);
     718
     719        if( $piereg['website'] ) $message = str_replace('%website%', $_POST['website'], $message);
     720
     721        if( $piereg['aim'] ) $message = str_replace('%aim%', $_POST['aim'], $message);
     722
     723        if( $piereg['yahoo'] ) $message = str_replace('%yahoo%', $_POST['yahoo'], $message);
     724
     725        if( $piereg['jabber'] ) $message = str_replace('%jabber%', $_POST['jabber'], $message);
     726
     727        if( $piereg['phone'] ) $message = str_replace('%phone%', $_POST['phone'], $message);
     728
     729        if( $piereg['about'] ) $message = str_replace('%about%', $_POST['about'], $message);
     730
     731        if( $piereg['code'] ) $message = str_replace('%'.$piereg['codename'].'code%', $_POST['regcode'], $message);
     732
     733       
     734
     735        if( !is_array( $piereg_custom ) ) $piereg_custom = array();
     736
     737        if (!empty($piereg_custom)) {
     738
     739            foreach( $piereg_custom as $k=>$v ){
     740
     741                $meta = $pie_register->Label_ID($v['label']);
     742
     743                $value = get_user_meta( $user_id, $meta ,true);
     744
     745                $message = str_replace('%'.$meta.'%', $value, $message);
     746
     747            }
     748
     749        }
     750
     751        $siteurl = get_option('siteurl');
     752
     753        $message = str_replace('%siteurl%', $siteurl, $message);
     754
     755       
     756
     757        if( $piereg['adminhtml'] && $piereg['admin_nl2br'] )
     758
     759            $message = nl2br($message);
     760
     761       
     762
     763        wp_mail(get_option('admin_email'), $subject, $message, $headers);
     764
     765    }
     766
     767    #-- END Pie-Register --#
     768
     769   
     770
     771    if ( empty($plaintext_pass) )
     772
     773        return;
     774
     775       
     776
     777    #-- Pie-Register --#
     778
     779    if( !$piereg['custom_msg'] ){
     780
     781    #-- END Pie-Register --#
     782
     783   
     784
     785        $message  = sprintf(__('Username: %s', 'piereg'), $user_login) . "\r\n";
     786
     787        $message .= sprintf(__('Password: %s', 'piereg'), $plaintext_pass) . "\r\n";
     788
     789        //$message .= get_option('siteurl') . "/wp-login.php";
     790
     791   
     792
     793    #-- Pie-Register --#
     794
     795        $message .= $email_code?$prelink . get_option('siteurl') . "/wp-login.php" . $email_code . "\r\n":"-xxx-";
     796
     797        $message .= $notice;
     798
     799    #-- END Pie-Register --#
     800
     801   
     802
     803        wp_mail($user_email, sprintf(__('[%s] Your username and password', 'piereg'), get_option('blogname')), $message);
     804
     805   
     806
     807    #-- Pie-Register --#
     808
     809    }
     810
     811    else{
     812
     813        $unvemailcheck=get_user_meta($user_id,'email_verify_email',true);
     814
     815       
     816
     817        if( ($unvemailcheck && $piereg['emailvmsghtml']) || ($unvemailcheck && $piereg['adminvmsghtml']) || (!$unvemailcheck && $piereg['html'])){
     818
     819            $headers  = 'MIME-Version: 1.0' . "\r\n";
     820
     821            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     822
     823        }
     824
     825        //$headers .= 'From: ' . $piereg['from'] . "\r\n" . 'Reply-To: ' . $piereg['from'] . "\r\n";
     826
     827        add_filter('wp_mail_from', array($pie_register, 'userfrom'));
     828
     829        add_filter('wp_mail_from_name', array($pie_register, 'userfromname'));
     830
     831        $subject = $piereg['subject'];
     832
     833//Here we need to put the PENDING VERIFICATION EMAIL
     834
     835        //Email Verification
     836
     837        if( ($unvemailcheck) && ($piereg['email_verify']) ){
     838
     839        $message = str_replace('%user_pass%', $plaintext_pass, $piereg['emailvmsg']);
     840
     841        }else if( ($unvemailcheck) && ($piereg['admin_verify']) ){
     842
     843        //Admin Verification
     844
     845        $message = str_replace('%user_pass%', $plaintext_pass, $piereg['adminvmsg']);
     846
     847        }else{
     848
     849        //Confirmed User Message
     850
     851        $message = str_replace('%user_pass%', $plaintext_pass, $piereg['msg']);
     852
     853        }
     854
     855        $message = str_replace('%user_login%', $user_login, $message);
     856
     857        $message = str_replace('%user_email%', $user_email, $message);
     858
     859        $message = str_replace('%blogname%', get_option('blogname'), $message);
     860
     861        $message = str_replace('%user_ip%', $_SERVER['REMOTE_ADDR'], $message);
     862
     863        $message = str_replace('%user_host%', gethostbyaddr($_SERVER['REMOTE_ADDR']), $message);
     864
     865        $message = str_replace('%user_ref%', $_SERVER['HTTP_REFERER'], $message);
     866
     867        $message = str_replace('%user_agent%', $_SERVER['HTTP_USER_AGENT'], $message);
     868
     869        if( $piereg['firstname'] ) $message = str_replace('%firstname%', $_POST['firstname'], $message);
     870
     871        if( $piereg['lastname'] ) $message = str_replace('%lastname%', $_POST['lastname'], $message);
     872
     873        if( $piereg['website'] ) $message = str_replace('%website%', $_POST['website'], $message);
     874
     875        if( $piereg['aim'] ) $message = str_replace('%aim%', $_POST['aim'], $message);
     876
     877        if( $piereg['yahoo'] ) $message = str_replace('%yahoo%', $_POST['yahoo'], $message);
     878
     879        if( $piereg['jabber'] ) $message = str_replace('%jabber%', $_POST['jabber'], $message);
     880
     881        if( $piereg['phone'] ) $message = str_replace('%phone%', $_POST['phone'], $message);
     882
     883        if( $piereg['about'] ) $message = str_replace('%about%', $_POST['about'], $message);
     884
     885        if( $piereg['code'] ) $message = str_replace('%'.$piereg['codename'].'code%', $_POST['regcode'], $message);
     886
     887       
     888
     889        if( !is_array( $piereg_custom ) ) $piereg_custom = array();
     890
     891        if (!empty($piereg_custom)) {
     892
     893            foreach( $piereg_custom as $k=>$v ){
     894
     895                $meta = $pie_register->Label_ID($v['label']);
     896
     897                $value = get_user_meta( $user_id, $meta ,true);
     898
     899                $message = str_replace('%'.$meta.'%', $value, $message);
     900
     901            }
     902
     903        }
     904
     905       
     906
     907        $redirect = 'redirect_to=' . $piereg['login_redirect'];
     908
     909        if( $piereg['email_verify'] &&  !$piereg['paypal_option'])
     910
     911            $siteurl = get_option('siteurl') . "/wp-login.php" . $email_code . $redirect;
     912
     913           
     914
     915        else if($piereg['paypal_option'])
     916
     917            $siteurl = get_option('siteurl') . "/wp-login.php" . $email_code;
     918
     919               
     920
     921        else
     922
     923            $siteurl = get_option('siteurl') . "/wp-login.php?" . $redirect;
     924
     925           
     926
     927        $message = str_replace('%siteurl%', $siteurl, $message);
     928
     929       
     930
     931        //Email Verification
     932
     933        if( ($unvemailcheck) && ($piereg['email_verify']) &&  $piereg['emailvhtml'] && $piereg['emailvuser_nl2br'] ){
     934
     935            $message = nl2br($message);
     936
     937        }else if( ($unvemailcheck) && ($piereg['admin_verify']) &&  $piereg['adminvhtml'] && $piereg['adminvuser_nl2br'] ){
     938
     939            $message = nl2br($message);
     940
     941        }else if( $piereg['html'] && $piereg['user_nl2br'] ){
     942
     943            $message = nl2br($message);
     944
     945        }
     946
     947       
     948
     949        wp_mail($user_email, $subject, $message, $headers);
     950
     951    }
     952
     953    if( $ref != $admin && ( $piereg['email_verify'] || $piereg['admin_verify'] ) ) {
     954
     955            $temp_user = $wpdb->query( "UPDATE $wpdb->users SET user_login = '$temp_id' WHERE ID = '$user_id'" );
     956
     957    }else if( $ref != $admin && ($piereg['paypal_option']) ) {
     958
     959   
     960
     961            $temp_user = $wpdb->query( "UPDATE $wpdb->users SET user_login = '$temp_id' WHERE ID = '$user_id'" );
     962
     963            $temp_email = $wpdb->query( "UPDATE $wpdb->users SET user_email = '$temp_id_".$user_email."' WHERE ID = '$user_id'" );
     964
     965            //$wpdb->query( "UPDATE $wpdb->users SET user_email = '$user_email_$temp_id' WHERE ID = '$user_id'" );
     966
     967            }
     968
     969           
     970
     971    if ( ! is_admin() ) {
     972        wp_safe_redirect( 'wp-login.php?checkemail=registered' );
     973        exit();
     974    }
     975    return $user_id;
     976}
    501977?>
  • pie-register/trunk/readme.txt

    r738939 r740249  
    1111== Description ==
    1212
    13 Welcome to Pie-Register by Genetech Solutions.
    14 So you want to have users register and login to your site before they interact with it? You need user registration and you don’t have to build it from scratch. With Pie-Register you can use your logo and color scheme to brand your registration pages to your liking.  Use this plugin to quickly add custom user registration to your WordPress based blog or site.
    15 Want your customers to pay for the service you provide? The plugin allows you to charge the users when they register with PayPal integration.
    16 And there is more, you can:
    17 
     13   Welcome to Pie-Register by Genetech Solutions.
     14   So you want to have users register and login to your site before they interact with it? You need user registration and you don't have to build it from scratch. With Pie-Register you can use your logo and color scheme to brand your registration pages to your liking.  Use this plugin to quickly add custom user registration to your WordPress based blog or site.
     15   Want your customers to pay for the service you provide? The plugin allows you to charge the users when they register with PayPal integration.
     16   And there is more, you can: 
    1817*Send Invitation Codes
    1918*Use CAPTCHA
    20 *Email Validation
     19*Email Validation       
    2120*User Profile Moderation
    2221*User Defined Fields
    2322
     23   Use the free Pie-Register plugin to easily add features like these to your service; they help you go above and beyond your competitors.
     24   There are more features to come in the weeks ahead. 
     25   See the plugin features section for complete details.
    2426
    25 Use the free Pie-Register plugin to easily add features like these to your service; they help you go above and beyond your competitors.
    26 There are more features to come in the weeks ahead. 
    27 See the plugin features section for complete details.
     27Features
     28--------
     29   Pie-Register has great features which you can’t find in any other free plugin.
     30   *Custom Logo and Color Scheme* Use your own logo and color scheme and get your brand in the spotlight.
     31Password Field Hate those forgettable auto-generated passwords? Allow your users to set their own passwords during registration.  The plugin includes that sweet Password Strength Meter.
     32   *Invitation Codes* Is your blog super exclusive? If so, you better require an invite to join your high end crew. Setup multiple codes and track where your new users are coming from with the optional Invitation Tracking Dashboard Widget.
     33   *Disclaimers* Worried about legal liabilities? Setup a general disclaimer, license agreement and/or privacy policy for new users to agree to during registration.
     34   *CAPTCHA Validation* If you don’t want those spam bots registering use CAPTCHA protection. The plugin includes a simple Captcha easy enough for real humans to read as well as the ability to add a re-CAPTCHA.
     35   *Email Validation* Ensure your users are registering with valid email accounts by forcing them to click a validation link that’s sent out with their registration email.  Email validation initially sets the username to a random generated string (something like: ‘unverified__h439herld3′). The user can’t login until they click on that validation link sent in the email. This will put their real username in place allowing them to login.
     36   *Unverified registrations* have a defined grace period. They are automatically deleted after a specified period of time so you don’t get clogged up with those fakes. (Manage under Users > Unverified Users)
    2837
    29 
    30 =Features=
    31 
    32 Pie-Register has great features which you can't find in any other free plugin.
    33 
    34 **Custom Logo and Color Scheme** Use your own logo and color scheme and get your brand in the spotlight.
    35 
    36 **Password Field** Hate those forgettable auto-generated passwords? Allow your users to set their own passwords during registration.  The plugin includes that sweet Password Strength Meter.
    37 
    38 **Invitation Codes** Is your blog super exclusive? If so, you better require an invite to join your high end crew. Setup multiple codes and track where your new users are coming from with the optional Invitation Tracking Dashboard Widget.
    39 
    40 **Disclaimers** Worried about legal liabilities? Setup a general disclaimer, license agreement and/or privacy policy for new users to agree to during registration.
    41 
    42 **CAPTCHA Validation** If you don’t want those spam bots registering use CAPTCHA protection. The plugin includes a simple Captcha easy enough for real humans to read as well as the ability to add a re-CAPTCHA.
    43 
    44 **Email Validation** Ensure your users are registering with valid email accounts by forcing them to click a validation link that’s sent out with their registration email.  <MORE>
    45 
    46 **User Moderation** Want absolute control? Check out every new user yourself and hand pick who can stay and who gets the boot before they are able to login to your site. (Manage under Users > Unverified Users)
    47 
    48 **Profile Fields** Have new users fill out there entire profile or just some fields. Make fields optional or required as needed.
    49 
    50 **User Defined Fields** Add your own defined fields to the registration page for users to fill out. Includes ability to add date, selection, checkbox, radio and text area fields!
    51 
    52 **Duplicate Email Registration** Got multiple users using the same email address? Easily solve this predicament without forcing them to sign up with unneeded email accounts.  This is also useful for administrators to create another account with one email address.
    53 
    54 **Customized Admin & User Registration Email** Tired of the same old emails when someone new registers? Spice it up with your own From/Reply-To address, customized subject and customize the entire message! You can even disable those tiresome Admin notifications for new registrations.
    55 
    56 **Membership Fee** Charge your users for membership via Pie-Register’s built-in PayPal integration.
    57 
     38   *User Moderation* Want absolute control? Check out every new user yourself and hand pick who can stay and who gets the boot before they are able to login to your site. (Manage under Users > Unverified Users)
     39   *Profile Fields* Have new users fill out there entire profile or just some fields. Make fields optional or required as needed.
     40   *User Defined Fields* Add your own defined fields to the registration page for users to fill out. Includes ability to add date, selection, checkbox, radio and text area fields!
     41   *Duplicate Email Registration* Got multiple users using the same email address? Easily solve this predicament without forcing them to sign up with unneeded email accounts.  This is also useful for administrators to create another account with one email address.
     42   *Customized Admin & User Registration Email* Tired of the same old emails when someone new registers? Spice it up with your own From/Reply-To address, customized subject and customize the entire message! You can even disable those tiresome Admin notifications for new registrations.
     43   *Membership Fee* Charge your users for membership via Pie-Register’s built-in PayPal integration.
    5844
    5945== Installation ==
     
    62481. Upload the `pie-register` directory to the `/wp-content/plugins/` directory
    63492. Activate the plugin through the 'Plugins' menu in WordPress
    64 3. Set the options in the Plugins Page
     503. Set the options in the Settings Panel
    6551
    6652
     
    7258
    7359== CHANGELOG ==
     60=v1.31 July 13 2013=
     61**Backward Compatibility Issues fixed.**
     62**Plugin Conflict Issue fixed.**
     63**Input has been sanitized.**
     64**UTF-8 characters are now supported by necessary text fields.**
     65**reCaptcha Library has been upgraded.**
     66
     67
    7468=v1.30 July 11 2013=
    7569**New Features:**
  • pie-register/trunk/recaptchalib.php

    r738939 r740249  
    11<?php
    2 
    32/*
    4 
    53 * This is a PHP library that handles calling reCAPTCHA.
    6 
    74 *    - Documentation and latest version
    8 
    95 *          http://recaptcha.net/plugins/php/
    10 
    116 *    - Get a reCAPTCHA API Key
    12 
    13  *          http://recaptcha.net/api/getkey
    14 
     7 *          https://www.google.com/recaptcha/admin/create
    158 *    - Discussion group
    16 
    179 *          http://groups.google.com/group/recaptcha
    18 
    19  *
    20 
     10 *
    2111 * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
    22 
    2312 * AUTHORS:
    24 
    2513 *   Mike Crawford
    26 
    2714 *   Ben Maurer
    28 
    29  *
    30 
     15 *
    3116 * Permission is hereby granted, free of charge, to any person obtaining a copy
    32 
    3317 * of this software and associated documentation files (the "Software"), to deal
    34 
    3518 * in the Software without restriction, including without limitation the rights
    36 
    3719 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    38 
    3920 * copies of the Software, and to permit persons to whom the Software is
    40 
    4121 * furnished to do so, subject to the following conditions:
    42 
    43  *
    44 
     22 *
    4523 * The above copyright notice and this permission notice shall be included in
    46 
    4724 * all copies or substantial portions of the Software.
    48 
    49  *
    50 
     25 *
    5126 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    52 
    5327 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    54 
    5528 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    56 
    5729 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    58 
    5930 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    60 
    6131 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    62 
    6332 * THE SOFTWARE.
    64 
    65  */
    66 
    67 
    68 
    69 /**
    70 
     33 */
     34
     35/**
    7136 * The reCAPTCHA server URL's
    72 
    73  */
    74 
    75 define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
    76 
    77 define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
    78 
    79 define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
    80 
    81 
    82 
    83 /**
    84 
     37 */
     38if(!defined("RECAPTCHA_API_SERVER"))
     39define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
     40if(!defined("RECAPTCHA_API_SECURE_SERVER"))
     41define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
     42if(!defined("RECAPTCHA_VERIFY_SERVER"))
     43define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
     44
     45/**
    8546 * Encodes the given data into a query string format
    86 
    8747 * @param $data - array of string elements to be encoded
    88 
    8948 * @return string - encoded request
    90 
    91  */
    92 
    93 function _rp_recaptcha_qsencode ($data) {
    94 
    95         $req = "";
    96 
    97         foreach ( $data as $key => $value )
    98 
    99                 $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
    100 
    101 
    102 
    103         // Cut the last '&'
    104 
    105         $req=substr($req,0,strlen($req)-1);
    106 
    107         return $req;
    108 
    109 }
    110 
    111 
    112 
    113 
    114 
    115 
    116 
    117 /**
    118 
     49 */
     50
     51if(!function_exists('_recaptcha_qsencode')){
     52    function _recaptcha_qsencode ($data) {
     53            $req = "";
     54            foreach ( $data as $key => $value )
     55                    $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
     56   
     57            // Cut the last '&'
     58            $req=substr($req,0,strlen($req)-1);
     59            return $req;
     60    }
     61}
     62
     63
     64
     65/**
    11966 * Submits an HTTP POST to a reCAPTCHA server
    120 
    12167 * @param string $host
    122 
    12368 * @param string $path
    124 
    12569 * @param array $data
    126 
    12770 * @param int port
    128 
    12971 * @return array response
    130 
    131  */
    132 
    133 function _rp_recaptcha_http_post($host, $path, $data, $port = 80) {
    134 
    135 
    136 
    137         $req = _rp_recaptcha_qsencode ($data);
    138 
    139 
    140 
    141         $http_request  = "POST $path HTTP/1.0\r\n";
    142 
    143         $http_request .= "Host: $host\r\n";
    144 
    145         $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
    146 
    147         $http_request .= "Content-Length: " . strlen($req) . "\r\n";
    148 
    149         $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
    150 
    151         $http_request .= "\r\n";
    152 
    153         $http_request .= $req;
    154 
    155 
    156 
    157         $response = '';
    158 
    159         if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
    160 
    161                 die ('Could not open socket');
    162 
    163         }
    164 
    165 
    166 
    167         fwrite($fs, $http_request);
    168 
    169 
    170 
    171         while ( !feof($fs) )
    172 
    173                 $response .= fgets($fs, 1160); // One TCP-IP packet
    174 
    175         fclose($fs);
    176 
    177         $response = explode("\r\n\r\n", $response, 2);
    178 
    179 
    180 
    181         return $response;
    182 
    183 }
    184 
    185 
    186 
    187 
    188 
    189 
    190 
    191 /**
    192 
     72 */
     73if(!function_exists('_recaptcha_http_post')){
     74    function _recaptcha_http_post($host, $path, $data, $port = 80) {
     75   
     76            $req = _recaptcha_qsencode ($data);
     77   
     78            $http_request  = "POST $path HTTP/1.0\r\n";
     79            $http_request .= "Host: $host\r\n";
     80            $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
     81            $http_request .= "Content-Length: " . strlen($req) . "\r\n";
     82            $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
     83            $http_request .= "\r\n";
     84            $http_request .= $req;
     85   
     86            $response = '';
     87            if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
     88                    die ('Could not open socket');
     89            }
     90   
     91            fwrite($fs, $http_request);
     92   
     93            while ( !feof($fs) )
     94                    $response .= fgets($fs, 1160); // One TCP-IP packet
     95            fclose($fs);
     96            $response = explode("\r\n\r\n", $response, 2);
     97   
     98            return $response;
     99    }
     100}
     101
     102
     103/**
    193104 * Gets the challenge HTML (javascript and non-javascript version).
    194 
    195105 * This is called from the browser, and the resulting reCAPTCHA HTML widget
    196 
    197106 * is embedded within the HTML form it was called from.
    198 
    199107 * @param string $pubkey A public key for reCAPTCHA
    200 
    201108 * @param string $error The error given by reCAPTCHA (optional, default is null)
    202 
    203109 * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
    204110
    205 
    206 
    207111 * @return string - The HTML to be embedded in the user's form.
    208 
    209  */
    210 
    211 function rp_recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
    212 
    213 {
    214 
    215     if ($pubkey == null || $pubkey == '') {
    216 
    217         die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
    218 
    219     }
    220 
    221    
    222 
    223     if ($use_ssl) {
    224 
    225                 $server = RECAPTCHA_API_SECURE_SERVER;
    226 
    227         } else {
    228 
    229                 $server = RECAPTCHA_API_SERVER;
    230 
    231         }
    232 
    233 
    234 
    235         $errorpart = "";
    236 
    237         if ($error) {
    238 
    239            $errorpart = "&amp;error=" . $error;
    240 
    241         }
    242 
    243         return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
    244 
    245 
    246 
    247     <noscript>
    248 
    249         <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
    250 
    251         <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
    252 
    253         <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
    254 
    255     </noscript>';
    256 
    257 }
    258 
    259 
    260 
    261 
    262 
    263 
    264 
    265 
    266 
    267 /**
    268 
     112 */
     113if(!function_exists('recaptcha_get_html')){
     114    function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
     115    {
     116        if ($pubkey == null || $pubkey == '') {
     117            die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
     118        }
     119       
     120        if ($use_ssl) {
     121                    $server = RECAPTCHA_API_SECURE_SERVER;
     122            } else {
     123                    $server = RECAPTCHA_API_SERVER;
     124            }
     125   
     126            $errorpart = "";
     127            if ($error) {
     128               $errorpart = "&amp;error=" . $error;
     129            }
     130            return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
     131   
     132        <noscript>
     133            <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
     134            <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
     135            <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
     136        </noscript>';
     137    }
     138}
     139
     140
     141
     142/**
    269143 * A ReCaptchaResponse is returned from recaptcha_check_answer()
    270 
    271  */
    272 
    273 class RP_ReCaptchaResponse {
    274 
    275         var $is_valid;
    276 
    277         var $error;
    278 
    279 }
    280 
    281 
    282 
    283 
    284 
    285 /**
    286 
     144 */
     145 
     146if(!class_exists('ReCaptchaResponse')){
     147    class ReCaptchaResponse {
     148            var $is_valid;
     149            var $error;
     150    }
     151}
     152
     153
     154/**
    287155  * Calls an HTTP POST function to verify if the user's guess was correct
    288 
    289156  * @param string $privkey
    290 
    291157  * @param string $remoteip
    292 
    293158  * @param string $challenge
    294 
    295159  * @param string $response
    296 
    297160  * @param array $extra_params an array of extra variables to post to the server
    298 
    299161  * @return ReCaptchaResponse
    300 
    301162  */
    302 
    303 function rp_recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
    304 
    305 {
    306 
    307     if ($privkey == null || $privkey == '') {
    308 
    309         die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
    310 
    311     }
    312 
    313 
    314 
    315     if ($remoteip == null || $remoteip == '') {
    316 
    317         die ("For security reasons, you must pass the remote ip to reCAPTCHA");
    318 
    319     }
    320 
    321 
    322 
    323    
    324 
    325    
    326 
    327         //discard spam submissions
    328 
    329         if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
    330 
    331                 $recaptcha_response = new RP_ReCaptchaResponse();
    332 
    333                 $recaptcha_response->is_valid = false;
    334 
    335                 $recaptcha_response->error = 'incorrect-captcha-sol';
    336 
    337                 return $recaptcha_response;
    338 
    339         }
    340 
    341 
    342 
    343         $response = _rp_recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify",
    344 
    345                                           array (
    346 
    347                                                  'privatekey' => $privkey,
    348 
    349                                                  'remoteip' => $remoteip,
    350 
    351                                                  'challenge' => $challenge,
    352 
    353                                                  'response' => $response
    354 
    355                                                  ) + $extra_params
    356 
    357                                           );
    358 
    359 
    360 
    361         $answers = explode ("\n", $response [1]);
    362 
    363         $recaptcha_response = new RP_ReCaptchaResponse();
    364 
    365 
    366 
    367         if (trim ($answers [0]) == 'true') {
    368 
    369                 $recaptcha_response->is_valid = true;
    370 
    371         }
    372 
    373         else {
    374 
    375                 $recaptcha_response->is_valid = false;
    376 
    377                 $recaptcha_response->error = $answers [1];
    378 
    379         }
    380 
    381         return $recaptcha_response;
    382 
    383 
    384 
    385 }
    386 
    387 
    388 
    389 /**
    390 
     163if(!function_exists('recaptcha_check_answer')){
     164    function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
     165    {
     166        if ($privkey == null || $privkey == '') {
     167            die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
     168        }
     169   
     170        if ($remoteip == null || $remoteip == '') {
     171            die ("For security reasons, you must pass the remote ip to reCAPTCHA");
     172        }
     173   
     174       
     175       
     176            //discard spam submissions
     177            if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
     178                    $recaptcha_response = new ReCaptchaResponse();
     179                    $recaptcha_response->is_valid = false;
     180                    $recaptcha_response->error = 'incorrect-captcha-sol';
     181                    return $recaptcha_response;
     182            }
     183   
     184            $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
     185                                              array (
     186                                                     'privatekey' => $privkey,
     187                                                     'remoteip' => $remoteip,
     188                                                     'challenge' => $challenge,
     189                                                     'response' => $response
     190                                                     ) + $extra_params
     191                                              );
     192   
     193            $answers = explode ("\n", $response [1]);
     194            $recaptcha_response = new ReCaptchaResponse();
     195   
     196            if (trim ($answers [0]) == 'true') {
     197                    $recaptcha_response->is_valid = true;
     198            }
     199            else {
     200                    $recaptcha_response->is_valid = false;
     201                    $recaptcha_response->error = $answers [1];
     202            }
     203            return $recaptcha_response;
     204   
     205    }
     206}
     207/**
    391208 * gets a URL where the user can sign up for reCAPTCHA. If your application
    392 
    393209 * has a configuration page where you enter a key, you should provide a link
    394 
    395210 * using this function.
    396 
    397211 * @param string $domain The domain where the page is hosted
    398 
    399212 * @param string $appname The name of your application
    400 
    401  */
    402 
    403 function rp_recaptcha_get_signup_url ($domain = null, $appname = null) {
    404 
    405     return "http://recaptcha.net/api/getkey?" .  _rp_recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname));
    406 
    407 }
    408 
    409 
    410 
    411 function _rp_recaptcha_aes_pad($val) {
    412 
    413     $block_size = 16;
    414 
    415     $numpad = $block_size - (strlen ($val) % $block_size);
    416 
    417     return str_pad($val, strlen ($val) + $numpad, chr($numpad));
    418 
    419 }
    420 
    421 
     213 */
     214if(!function_exists('recaptcha_get_signup_url')){
     215    function recaptcha_get_signup_url ($domain = null, $appname = null) {
     216        return "https://www.google.com/recaptcha/admin/create?" .  _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
     217    }
     218}
     219
     220if(!function_exists('_recaptcha_aes_pad')){
     221    function _recaptcha_aes_pad($val) {
     222        $block_size = 16;
     223        $numpad = $block_size - (strlen ($val) % $block_size);
     224        return str_pad($val, strlen ($val) + $numpad, chr($numpad));
     225    }
     226}
    422227
    423228/* Mailhide related code */
    424229
    425 
    426 
    427 function _rp_recaptcha_aes_encrypt($val,$ky) {
    428 
    429     if (! function_exists ("mcrypt_encrypt")) {
    430 
    431         die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
    432 
    433     }
    434 
    435     $mode=MCRYPT_MODE_CBC;   
    436 
    437     $enc=MCRYPT_RIJNDAEL_128;
    438 
    439     $val=_rp_recaptcha_aes_pad($val);
    440 
    441     return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
    442 
    443 }
    444 
    445 
    446 
    447 
    448 
    449 function _rp_recaptcha_mailhide_urlbase64 ($x) {
    450 
    451     return strtr(base64_encode ($x), '+/', '-_');
    452 
    453 }
    454 
    455 
    456 
     230if(!function_exists('_recaptcha_aes_encrypt')){
     231    function _recaptcha_aes_encrypt($val,$ky) {
     232        if (! function_exists ("mcrypt_encrypt")) {
     233            die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
     234        }
     235        $mode=MCRYPT_MODE_CBC;   
     236        $enc=MCRYPT_RIJNDAEL_128;
     237        $val=_recaptcha_aes_pad($val);
     238        return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
     239    }
     240}
     241
     242if(!function_exists('_recaptcha_mailhide_urlbase64')){
     243    function _recaptcha_mailhide_urlbase64 ($x) {
     244        return strtr(base64_encode ($x), '+/', '-_');
     245    }
     246}
     247
     248if(!function_exists('recaptcha_mailhide_url')){
    457249/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
    458 
    459 function rp_recaptcha_mailhide_url($pubkey, $privkey, $email) {
    460 
    461     if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
    462 
    463         die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
    464 
    465              "you can do so at <a href='http://mailhide.recaptcha.net/apikey'>http://mailhide.recaptcha.net/apikey</a>");
    466 
    467     }
    468 
    469    
    470 
    471 
    472 
    473     $ky = pack('H*', $privkey);
    474 
    475     $cryptmail = _rp_recaptcha_aes_encrypt ($email, $ky);
    476 
    477    
    478 
    479     return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _rp_recaptcha_mailhide_urlbase64 ($cryptmail);
    480 
    481 }
    482 
    483 
    484 
    485 /**
    486 
     250    function recaptcha_mailhide_url($pubkey, $privkey, $email) {
     251        if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
     252            die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
     253                 "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
     254        }
     255       
     256   
     257        $ky = pack('H*', $privkey);
     258        $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
     259       
     260        return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
     261    }
     262}
     263
     264/**
    487265 * gets the parts of the email to expose to the user.
    488 
    489266 * eg, given johndoe@example,com return ["john", "example.com"].
    490 
    491267 * the email is then displayed as john...@example.com
    492 
    493  */
    494 
    495 function _rp_recaptcha_mailhide_email_parts ($email) {
    496 
    497     $arr = preg_split("/@/", $email );
    498 
    499 
    500 
    501     if (strlen ($arr[0]) <= 4) {
    502 
    503         $arr[0] = substr ($arr[0], 0, 1);
    504 
    505     } else if (strlen ($arr[0]) <= 6) {
    506 
    507         $arr[0] = substr ($arr[0], 0, 3);
    508 
    509     } else {
    510 
    511         $arr[0] = substr ($arr[0], 0, 4);
    512 
    513     }
    514 
    515     return $arr;
    516 
    517 }
    518 
    519 
    520 
    521 /**
    522 
     268 */
     269if(!function_exists('_recaptcha_mailhide_email_parts')){
     270    function _recaptcha_mailhide_email_parts ($email) {
     271        $arr = preg_split("/@/", $email );
     272   
     273        if (strlen ($arr[0]) <= 4) {
     274            $arr[0] = substr ($arr[0], 0, 1);
     275        } else if (strlen ($arr[0]) <= 6) {
     276            $arr[0] = substr ($arr[0], 0, 3);
     277        } else {
     278            $arr[0] = substr ($arr[0], 0, 4);
     279        }
     280        return $arr;
     281    }
     282}
     283
     284/**
    523285 * Gets html to display an email address given a public an private key.
    524 
    525286 * to get a key, go to:
    526 
    527  *
    528 
    529  * http://mailhide.recaptcha.net/apikey
    530 
    531  */
    532 
    533 function rp_recaptcha_mailhide_html($pubkey, $privkey, $email) {
    534 
    535     $emailparts = _rp_recaptcha_mailhide_email_parts ($email);
    536 
    537     $url = rp_recaptcha_mailhide_url ($pubkey, $privkey, $email);
    538 
    539    
    540 
    541     return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
    542 
    543         "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
    544 
    545 
    546 
    547 }
    548 
    549 
    550 
    551 
     287 *
     288 * http://www.google.com/recaptcha/mailhide/apikey
     289 */
     290if(!function_exists('recaptcha_mailhide_html')){
     291    function recaptcha_mailhide_html($pubkey, $privkey, $email) {
     292        $emailparts = _recaptcha_mailhide_email_parts ($email);
     293        $url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
     294       
     295        return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
     296            "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
     297   
     298    }
     299}
    552300
    553301?>
    554 
Note: See TracChangeset for help on using the changeset viewer.