| 1 | <? |
|---|
| 2 | |
|---|
| 3 | /*************************************************************************** |
|---|
| 4 | * Dolphin Smart Community Builder |
|---|
| 5 | * ----------------- |
|---|
| 6 | * begin : Mon Mar 23 2006 |
|---|
| 7 | * copyright : (C) 2006 BoonEx Group |
|---|
| 8 | * website : http://www.boonex.com/ |
|---|
| 9 | * This file is part of Dolphin - Smart Community Builder |
|---|
| 10 | * |
|---|
| 11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. |
|---|
| 12 | * http://creativecommons.org/licenses/by/3.0/ |
|---|
| 13 | * |
|---|
| 14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 16 | * See the Creative Commons Attribution 3.0 License for more details. |
|---|
| 17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, |
|---|
| 18 | * see license.txt file; if not, write to marketing@boonex.com |
|---|
| 19 | ***************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | require_once( 'inc/header.inc.php' ); |
|---|
| 22 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); |
|---|
| 23 | require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); |
|---|
| 24 | require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); |
|---|
| 25 | require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolProfilesController.php' ); |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | // --------------- page variables |
|---|
| 29 | |
|---|
| 30 | $_page['name_index'] = 40; |
|---|
| 31 | $_page['css_name'] = 'profile_activate.css'; |
|---|
| 32 | |
|---|
| 33 | $ID = (int)$_GET['ConfID']; |
|---|
| 34 | $ConfCode = $_GET['ConfCode']; |
|---|
| 35 | |
|---|
| 36 | if ( !$ID && !$ConfCode ) |
|---|
| 37 | exit; |
|---|
| 38 | |
|---|
| 39 | $logged['member'] = member_auth( 0, false ); |
|---|
| 40 | |
|---|
| 41 | $_page['header'] = _t("_Email confirmation"); |
|---|
| 42 | $_page['header_text'] = _t("_Email confirmation Ex"); |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | // --------------- page components |
|---|
| 46 | |
|---|
| 47 | $_ni = $_page['name_index']; |
|---|
| 48 | $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode(); |
|---|
| 49 | |
|---|
| 50 | // --------------- [END] page components |
|---|
| 51 | |
|---|
| 52 | PageCode(); |
|---|
| 53 | |
|---|
| 54 | // --------------- page components functions |
|---|
| 55 | |
|---|
| 56 | /** |
|---|
| 57 | * page code function |
|---|
| 58 | */ |
|---|
| 59 | function PageCompPageMainCode() |
|---|
| 60 | { |
|---|
| 61 | global $ID; |
|---|
| 62 | global $ConfCode; |
|---|
| 63 | global $site; |
|---|
| 64 | |
|---|
| 65 | $oPC = new BxDolProfilesController(); |
|---|
| 66 | |
|---|
| 67 | $autoApproval_ifJoin = isAutoApproval('join'); |
|---|
| 68 | |
|---|
| 69 | $p_arr = getProfileInfo( $ID ); |
|---|
| 70 | |
|---|
| 71 | if ( !$p_arr ) |
|---|
| 72 | { |
|---|
| 73 | $_page['header'] = _t("_Error"); |
|---|
| 74 | $_page['header_text'] = _t("_Profile Not found"); |
|---|
| 75 | $ret = "<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>"; |
|---|
| 76 | $ret .= _t('_Profile Not found Ex'); |
|---|
| 77 | $ret.= "</td></table>"; |
|---|
| 78 | return $ret; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | ob_start(); |
|---|
| 82 | |
|---|
| 83 | echo "<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>"; |
|---|
| 84 | |
|---|
| 85 | if ( $p_arr['Status'] == 'Unconfirmed' ) |
|---|
| 86 | { |
|---|
| 87 | $ConfCodeReal = base64_encode( base64_encode( crypt( $p_arr[Email], "secret_confirmation_string" ) ) ); |
|---|
| 88 | if ( strcmp( $ConfCode, $ConfCodeReal ) != 0 ) |
|---|
| 89 | { |
|---|
| 90 | ?> |
|---|
| 91 | <b><?=_t("_Profile activation failed")?></b><br /><br /> |
|---|
| 92 | <?=_t("_EMAIL_CONF_FAILED_EX")?><br /> |
|---|
| 93 | <center><form action="<? echo $_SERVER[PHP_SELF]; ?>" method=get> |
|---|
| 94 | <input type=hidden name="ConfID" value="<? echo $ID; ?>"> |
|---|
| 95 | <table class=text> |
|---|
| 96 | <td><b><?=_t("_Confirmation code")?>:</b> </td> |
|---|
| 97 | <td><input class=no name="ConfCode"></td> |
|---|
| 98 | <td> </td> |
|---|
| 99 | <td><input class=no type="submit" value=" <?=_t("_Submit")?> "></td> |
|---|
| 100 | </table> |
|---|
| 101 | </form></center> |
|---|
| 102 | <? |
|---|
| 103 | } |
|---|
| 104 | else |
|---|
| 105 | { |
|---|
| 106 | if ( $autoApproval_ifJoin ) |
|---|
| 107 | { |
|---|
| 108 | $status = "Active"; |
|---|
| 109 | $oPC -> sendActivationMail( $ID ); |
|---|
| 110 | } |
|---|
| 111 | else |
|---|
| 112 | $status = 'Approval'; |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | $update = db_res( "UPDATE `Profiles` SET `Status` = '{$status}' WHERE `ID` = '{$ID}';" ); |
|---|
| 116 | createUserDataFile( $ID ); |
|---|
| 117 | reparseObjTags( 'profile', $ID ); |
|---|
| 118 | |
|---|
| 119 | $iPossibleCoupleID = (int)db_value( "SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'" ); |
|---|
| 120 | if ($iPossibleCoupleID) { |
|---|
| 121 | db_res( "UPDATE `Profiles` SET `Status` = '{$status}' WHERE `ID` = '{$iPossibleCoupleID}';" ); |
|---|
| 122 | createUserDataFile($iPossibleCoupleID); |
|---|
| 123 | reparseObjTags( 'profile', $iPossibleCoupleID ); |
|---|
| 124 | } |
|---|
| 125 | |
|---|
| 126 | // Promotional membership |
|---|
| 127 | if ( getParam('enable_promotion_membership') == 'on' ) |
|---|
| 128 | { |
|---|
| 129 | $memership_days = getParam('promotion_membership_days'); |
|---|
| 130 | setMembership( $p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true ); |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | ?> |
|---|
| 134 | <?php |
|---|
| 135 | if ( $autoApproval_ifJoin ) |
|---|
| 136 | { |
|---|
| 137 | echo _t( "_PROFILE_CONFIRM" ); |
|---|
| 138 | } |
|---|
| 139 | else |
|---|
| 140 | { |
|---|
| 141 | echo _t("_EMAIL_CONF_SUCCEEDED", $site['title']); |
|---|
| 142 | } |
|---|
| 143 | ?> |
|---|
| 144 | <br /><br /> |
|---|
| 145 | <center><a href="member.php"><b><?=_t("_Continue")?> >></b></a></center> |
|---|
| 146 | <? |
|---|
| 147 | if( getParam('newusernotify') == 'on' ) |
|---|
| 148 | $oPC -> sendNewUserNotify( $ID ); |
|---|
| 149 | } |
|---|
| 150 | } |
|---|
| 151 | else |
|---|
| 152 | echo _t('_ALREADY_ACTIVATED'); |
|---|
| 153 | |
|---|
| 154 | echo "</td></table>"; |
|---|
| 155 | |
|---|
| 156 | $ret = ob_get_contents(); |
|---|
| 157 | ob_end_clean(); |
|---|
| 158 | |
|---|
| 159 | return $ret; |
|---|
| 160 | } |
|---|
| 161 | |
|---|
| 162 | ?> |
|---|