BLAH; if($bbAjaxMode) { $sMemberLoginFormAjx = $GLOBALS['oFunctions']->transBox( DesignBoxContent(_t('_Member Login'), $sFormCode, 1, $sCaptionItem), true ); echo $sMemberLoginFormAjx; exit; } $sMemberLoginForm = << {$sFormCode} EOF; $_page['header'] = $site['title'] . ' ' . _t("_Member Login"); $_page['header_text'] = _t("_Member Login"); if ($bbAjaxMode && $member==1) $template = BX_DIRECTORY_PATH_ROOT . "templates/base/login_form_ajax_a.html"; if ($bbAjaxMode==false && $member==0) { $_page_cont[0]['page_main_code'] = $sMemberLoginForm; } else { $_page_cont[0]['page_main_code'] = PageCompLoginForm($text,$member,$mem,$login_page,$join_page,$forgot_page,$template); } if ($bbAjaxMode) { echo << {$_page_cont[0]['page_main_code']} EOF; exit; } $_page['name_index'] = 0; PageCode(); exit; } function PageCompLoginForm($text, $member, $mem, $login_page, $join_page, $forgot_page, $template = '') { global $site; $aFormReplace = array(); if ($member == 1) $name_label = _t("_Log In"); else $name_label = ($member == 2) ? _t("_ID") : _t("_E-mail or ID"); $aFormReplace['header_text'] = $site['title'] . ' ' . $mem . ' Login'; $aFormReplace['warning_text'] = $text; $aFormReplace['action_url'] = $login_page; if (! $sUrlRelocate = $_REQUEST['relocate'] or basename($_REQUEST['relocate']) == 'index.php' or basename($_REQUEST['relocate']) == 'join.php') $sUrlRelocate = $_SERVER['PHP_SELF']; $aFormReplace['site_a_url'] = BX_DOL_URL_ROOT; $aFormReplace['relocate_url'] = htmlspecialchars( $sUrlRelocate ); //$_SERVER['PHP_SELF']; $aFormReplace['images'] = $site['images']; $aFormReplace['name_label'] = $name_label; $aFormReplace['password_label'] = _t("_Password"); $aFormReplace['submit_label'] = _t("_Log In"); $aFormReplace['member_label'] = _t('_Member Login'); $aFormReplace['remeber_label'] = _t("_Remember password"); $aFormReplace['form_onsubmit'] = "validateLoginForm( this, '" . BX_DOL_URL_ROOT . "', '" . addslashes( htmlspecialchars( _t('_PROFILE_ERR') ) ) . "'); return false;"; if ($forgot_page) { $aFormReplace['forgot_page_url'] = $forgot_page; $aFormReplace['forgot_label'] = _t("_forgot_your_password") . '?'; $aFormReplace['clickhere_label'] = _t("_Click here"); } else { $aFormReplace['forgot_page_url'] = ''; $aFormReplace['forgot_label'] = ''; } if ($join_page) { $aFormReplace['not_a_member'] = _t('_not_a_member'); $aFormReplace['or'] = _t( '_or' ); $aFormReplace['join_label'] = _t( '_Join now' ); $aFormReplace['join_page_url'] = $join_page; } else { $aFormReplace['or'] = ''; $aFormReplace['not_a_member'] = ''; $aFormReplace['join_label'] = ''; $aFormReplace['join_page_url'] = ''; } $sTemplateFilename = basename($template); return $GLOBALS['oSysTemplate']->parseHtmlByName($sTemplateFilename, $aFormReplace); } function activation_mail( $ID, $text = 1 ) { global $ret; $ID = (int)$ID; $p_arr = db_arr( "SELECT `Email` FROM `Profiles` WHERE `ID` = '$ID'" ); if ( !$p_arr ) { $ret['ErrorCode'] = 7; return false; } $rEmailTemplate = new BxDolEmailTemplates(); $aTemplate = $rEmailTemplate -> getTemplate( 't_Confirmation' ) ; $recipient = $p_arr['Email']; $sConfirmationCode = base64_encode( base64_encode( crypt( $recipient, CRYPT_EXT_DES ? "secret_co" : "se" ) ) ); $sConfirmationLink = BX_DOL_URL_ROOT . "profile_activate.php?ConfID={$ID}&ConfCode=" . urlencode( $sConfirmationCode ); $aPlus = array(); $aPlus['ConfCode'] = $sConfirmationCode; $aPlus['ConfirmationLink'] = $sConfirmationLink; $mail_ret = sendMail( $recipient, $aTemplate['Subject'], $aTemplate['Body'], $ID, $aPlus ); if ( $mail_ret ) { if ( $text ) { $page_text .= '
' . _t("_EMAIL_CONF_SENT") . "
"; $page_text .= "
"; $page_text .= "'; $page_text .= '
"._t("_ENTER_CONF_CODE").": "; $page_text .= ' 
'; $page_text .= '

'; } else return true; } else { if ( $text ) $page_text .= "

"._t("_EMAIL_CONF_NOT_SENT"); else { $ret['ErrorCode'] = 10; return false; } } return ($text) ? $page_text : true; } function mem_expiration_letter( $ID, $membership_name, $expire_days ) { $ID = (int)$ID; if ( !$ID ) return false; $p_arr = db_arr( "SELECT `Email` FROM `Profiles` WHERE `ID` = $ID", 0 ); if ( !$p_arr ) return false; $rEmailTemplate = new BxDolEmailTemplates(); $aTemplate = $rEmailTemplate -> getTemplate( 't_MemExpiration', $ID ) ; $recipient = $p_arr['Email']; $aPlus = array(); $aPlus['MembershipName'] = $membership_name; $aPlus['ExpireDays'] = $expire_days; $mail_ret = sendMail( $recipient, $aTemplate['Subject'], $aTemplate['Body'], $ID, $aPlus ); if ($mail_ret) return true; else return false; } function get_vars($with_page = 1, $with_per_page = 1, $with_sort_by = 1, $with_sort_order = 1, $with_gallery_view = 1) { global $affID; $get_parameters = "?"; // common parameters if ( isset($_REQUEST['ID']) && (int)$_REQUEST['ID'] > 0 ) $get_parameters .= 'ID='. (int)$_REQUEST['ID'] .'&'; if ( isset($_REQUEST['NickName']) && strlen($_REQUEST['NickName']) > 0 ) $get_parameters .= 'NickName='. process_pass_data($_REQUEST['NickName']) .'&'; if ( isset($_REQUEST['gallery_view']) && (int)$_REQUEST['gallery_view'] > 0 && $with_gallery_view ) $get_parameters .= 'gallery_view='. (int)$_REQUEST['gallery_view'] .'&'; if ( isset($_REQUEST['photos_only']) && strlen($_REQUEST['photos_only']) > 0 ) $get_parameters .= ($_REQUEST['photos_only'] == 'on' ? 'photos_only=on&' : ''); if ( isset($_REQUEST['online_only']) && strlen($_REQUEST['online_only']) > 0 ) { $get_parameters .= 'online_only=on&'; } // navigation parameters if ( isset($_REQUEST['page']) && (int)$_REQUEST['page'] > 0 && $with_page ) $get_parameters .= 'page='. (int)$_REQUEST['page'] .'&'; if ( isset($_REQUEST['p_per_page']) && (int)$_REQUEST['p_per_page'] > 0 && $with_per_page ) $get_parameters .= 'p_per_page='. (int)$_REQUEST['p_per_page'] .'&'; if ( isset($_REQUEST['sortby']) && strlen($_REQUEST['sortby']) > 0 && $with_sort_by ) $get_parameters .= 'sortby='. process_pass_data($_REQUEST['sortby']) .'&'; if ( isset($_REQUEST['sortorder']) && strlen($_REQUEST['sortorder']) > 0 && $with_sort_order ) $get_parameters .= ($_REQUEST['sortorder'] == 'ASC' ? 'sortorder=ASC&' : 'sortorder=DESC&'); // ZIP search parameters if ( isset($_REQUEST['zip']) && strlen($_REQUEST['zip']) > 0 ) $get_parameters .= 'zip='. process_pass_data($_REQUEST['zip']) .'&'; if ( isset($_REQUEST['metric']) && strlen($_REQUEST['metric']) > 0 ) $get_parameters .= ($_REQUEST['metric'] == 'miles' ? 'metric=miles&' : 'metric=km&'); if ( isset($_REQUEST['distance']) ) $get_parameters .= 'distance='. (int)$_REQUEST['distance'] .'&'; // extra parameters if ( isset($_REQUEST['profiles']) && strlen($_REQUEST['profiles']) > 0 ) $get_parameters .= 'profiles='. process_pass_data($_REQUEST['profiles']) .'&'; if ( isset($_REQUEST['status']) && strlen($_REQUEST['status']) > 0 ) $get_parameters .= 'status='. process_pass_data($_REQUEST['status']) .'&'; // admin parameters if ( isset($_REQUEST['search']) && strlen($_REQUEST['search']) > 0 ) $get_parameters .= 'search='. process_pass_data($_REQUEST['search']) .'&'; if ( isset($_REQUEST['s_nickname']) && strlen($_REQUEST['s_nickname']) > 0 ) $get_parameters .= 's_nickname='. process_pass_data($_REQUEST['s_nickname']) .'&'; // affiliate parameters if ( isset($affID) && (int)$affID > 0 ) $get_parameters .= 'affID='. (int)$affID .'&'; $respd = db_res("SELECT * FROM `sys_profile_fields` WHERE `Type` <> 'none' ORDER BY `Type` ASC"); while ( $arrpd = mysql_fetch_array($respd) ) { //$fname = get_field_name ( $arrpd ); $fname = $arrpd['Name']; switch ($arrpd['search_type']) { case 'select_one': case 'text': case 'area': $fval = process_pass_data($_REQUEST[$fname]); if ( isset($_REQUEST[$fname]) && strlen($fval) ) { $get_parameters .= "{$fname}={$fval}&"; } break; /*case 'list': $fval = $_REQUEST[$fname]; if ( is_array($fval) && count($fval) > 0 ) { while ( list( $key, $val ) = each( $fval ) ) $get_parameters .= "{$fname}[]=". process_pass_data($val) ."&"; } break;*/ /*case 'check': if ( $arrpd['type'] == 'r' ) { $findok = 0; $funcbody = $arrpd['extra']; $func = create_function("", $funcbody); $ar = $func(); foreach ( $ar as $key => $value ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) { $findok = 1; break; } } if ( is_array($ar) && $findok ) { foreach ( $ar as $key => $value ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) $get_parameters .= "{$fname}_{$key}=on&"; } } } elseif ( $arrpd['type'] == 'e' ) { $findok = 0; $vals = preg_split ("/[,\']+/", $arr['extra'], -1, PREG_SPLIT_NO_EMPTY); foreach ( $vals as $key ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) { $findok = 1; break; } } if ( $findok ) { foreach ( $vals as $key ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) $get_parameters .= "{$fname}_{$key}=on&"; } } } break;*/ /*case 'check_set': $vals = preg_split ("/[,\']+/", $arrpd['extra'], -1, PREG_SPLIT_NO_EMPTY); $offset = 0; foreach ( $vals as $v ) { if ( $_REQUEST["{$fname}_{$offset}"] == "on" ) $get_parameters .= "{$fname}_{$offset}=on&"; $offset++; } break;*/ case 'date': $fval_s = process_pass_data($_REQUEST["{$fname}_start"]); $fval_e = process_pass_data($_REQUEST["{$fname}_end"]); if ( strlen($fval_s) ) { $get_parameters .= "{$fname}_start={$fval_s}&"; } if ( strlen($fval_e) ) { $get_parameters .= "{$fname}_end={$fval_e}&"; } break; } } // exclude last character from the string return $get_parameters; } function get_vars_controls($with_page = 1, $with_per_page = 1, $with_sort_by = 1, $with_sort_order = 1, $with_gallery_view = 1) { global $affID; $get_inputs = ""; // common parameters if ( isset($_REQUEST['ID']) && (int)$_REQUEST['ID'] > 0 ) $get_inputs .= ''; if ( isset($_REQUEST['NickName']) && strlen($_REQUEST['NickName']) > 0 ) $get_inputs .= ''; if ( isset($_REQUEST['gallery_view']) && (int)$_REQUEST['gallery_view'] > 0 && $with_gallery_view ) $get_inputs .= ''; if ( isset($_REQUEST['photos_only']) && strlen($_REQUEST['photos_only']) > 0 ) $get_inputs .= ($_REQUEST['photos_only'] == 'on' ? '' : ''); if ( isset($_REQUEST['online_only']) && strlen($_REQUEST['online_only']) > 0 ) { $get_inputs .= ''; } // navigation parameters if ( isset($_REQUEST['page']) && (int)$_REQUEST['page'] > 0 && $with_page ) $get_inputs .= ''; if ( isset($_REQUEST['p_per_page']) && (int)$_REQUEST['p_per_page'] > 0 && $with_per_page ) $get_inputs .= ''; if ( isset($_REQUEST['sortby']) && strlen($_REQUEST['sortby']) > 0 && $with_sort_by ) $get_inputs .= ''; if ( isset($_REQUEST['sortorder']) && strlen($_REQUEST['sortorder']) > 0 && $with_sort_order ) $get_inputs .= ($_REQUEST['sortorder'] == 'ASC' ? '' : ''); // ZIP search parameters if ( isset($_REQUEST['zip']) && strlen($_REQUEST['zip']) > 0 ) $get_inputs .= ''; if ( isset($_REQUEST['metric']) && strlen($_REQUEST['metric']) > 0 ) $get_inputs .= ($_REQUEST['metric'] == 'miles' ? '' : ''); if ( isset($_REQUEST['distance']) ) $get_inputs .= ''; // extra parameters if ( isset($_REQUEST['profiles']) && strlen($_REQUEST['profiles']) > 0 ) $get_inputs .= ''; if ( isset($_REQUEST['status']) && strlen($_REQUEST['status']) > 0 ) $get_inputs .= ''; // admin parameters if ( isset($_REQUEST['search']) && strlen($_REQUEST['search']) > 0 ) $get_inputs .= ''; if ( isset($_REQUEST['s_nickname']) && strlen($_REQUEST['s_nickname']) > 0 ) $get_inputs .= ''; // affiliate parameters if ( isset($affID) && (int)$affID > 0 ) $get_inputs .= ''; $respd = db_res("SELECT * FROM `sys_profile_fields` WHERE `Type` <> 'none' ORDER BY `Type` ASC"); while ( $arrpd = mysql_fetch_array($respd) ) { //$fname = get_field_name( $arrpd ); $fname = $arrpd['Name']; switch ($arrpd['Type']) { case 'select_one': case 'text': case 'area': $fval = process_pass_data($_REQUEST[$fname]); if ( isset($_REQUEST[$fname]) && strlen($fval) ) { $get_inputs .= ""; } break; /*case 'list': $fval = $_REQUEST[$fname]; if ( is_array($fval) && count($fval) > 0 ) { while ( list( $key, $val ) = each( $fval ) ) $get_inputs .= ""; } break;*/ /*case 'check': if ($arrpd['type'] == 'r') { $findok = 0; $funcbody = $arrpd['extra']; $func = create_function("", $funcbody); $ar = $func(); foreach ( $ar as $key => $value ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) { $findok = 1; break; } } if ( $findok ) { foreach ( $ar as $key => $value ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) $get_inputs .= ""; } } } elseif ($arrpd['type'] == 'e') { $findok = 0; $vals = preg_split ("/[,\']+/", $arr['extra'], -1, PREG_SPLIT_NO_EMPTY); foreach ( $vals as $key ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) { $findok = 1; break; } } if ( $findok ) { foreach ( $vals as $key ) { if ( $_REQUEST["{$fname}_{$key}"] == "on" ) $get_inputs .= ""; } } } break;*/ /*case 'check_set': $vals = preg_split ("/[,\']+/", $arrpd['extra'], -1, PREG_SPLIT_NO_EMPTY); $offset = 0; foreach ( $vals as $v ) { if ( $_REQUEST["{$fname}_{$offset}"] == "on" ) $get_inputs .= ""; $offset++; } break;*/ case 'date': $fval_s = process_pass_data($_REQUEST["{$fname}_start"]); $fval_e = process_pass_data($_REQUEST["{$fname}_end"]); if ( isset($_REQUEST["{$fname}_start"]) && strlen($fval_s) ) { $get_inputs .= ""; } if ( isset($_REQUEST["{$fname}_end"]) && strlen($fval_e) ) { $get_inputs .= ""; } break; } } return $get_inputs; } function ResNavigationRet( $form_name, $short = 0, $function='', $aVar = '' ) { global $p_num; global $page; global $_page; global $p_per_page; global $page_first_p; global $pages_num; global $oTemplConfig; global $gallery_view; $pages_around = 5; if ( !is_array($aVar) ) { $per_page_array = array(10, 15, 20, 30, 50); } else { $per_page_array = $aVar; } if ( $GLOBALS['logged']['admin'] ) array_push($per_page_array, 100); if ( !$function ) { $get_vars_controls = get_vars_controls(1, 0, 1, 1, 1); $get_vars = get_vars(0, 1, 1, 1, 0); } else { $func = create_function( '', $function ); $get_vars = $func(); } $gallery_view = (int)$gallery_view; ob_start(); if ( $p_num ) { ?>
show_gallery_link_in_page_navigation ) { if ( $gallery_view ) { echo " "; } else { echo " "; } } else { echo " "; } ?>
- |   |   
1 ) { echo " ". _t("_First") ." |  ". _t("_Prev") ." | "; } // print all previous pages for ( $i = max($page - $pages_around, 1); $i < $page ; $i++ ) { echo " {$i} "; } // print current page echo " [{$page}] "; // print all next pages for ( $i = $page + 1; $i <= min($page + $pages_around, $pages_num); $i++ ) { echo " {$i} "; } if ( $page < $pages_num ) { echo " ". _t("_Next") ." |  ". _t("_Last") .""; } ?> ". _t("_view as profile details") ."". _t("_view as photo gallery") ." 
'admin', 0 => 'member' ); $bLogged = false; foreach($aAccTypes as $iKey => $sValue) if($GLOBALS['logged'][$sValue] = member_auth($iKey, false)) { $bLogged = true; break; } if((isset($_COOKIE['memberID']) || isset($_COOKIE['memberPassword'])) && !$bLogged) bx_logout(false); } // 0 - member, 1 - admin function member_auth($member = 0, $error_handle = true, $bAjx = false) { global $site; switch ($member) { case 0: $mem = 'member'; $login_page = BX_DOL_URL_ROOT . "member.php"; $iRole = BX_DOL_ROLE_MEMBER; break; case 1: $mem = 'admin'; $login_page = BX_DOL_URL_ADMIN . "index.php"; $iRole = BX_DOL_ROLE_ADMIN; break; } if (!$_COOKIE['memberID'] || !$_COOKIE['memberPassword']) { if ($error_handle) { $text = _t("_LOGIN_REQUIRED_AE1"); if ($member == 0) $text .= "
"._t("_LOGIN_REQUIRED_AE2", $site['images'], BX_DOL_URL_ROOT, $site['title']); $bAjxMode = (isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false; if ($member=1 && $bAjx==true) $bAjxMode = true; login_form($text, $member, $bAjxMode); } return false; } return check_login(process_pass_data($_COOKIE['memberID']), process_pass_data($_COOKIE['memberPassword' ]), $iRole, $error_handle); } // check unencrypted password function check_password($sUsername, $sPassword, $iRole = BX_DOL_ROLE_MEMBER, $error_handle = true) { $iId = getID($sUsername); if (!$iId) return false; $aUser = getProfileInfo($iId); $sPassCheck = encryptUserPwd($sPassword, $aUser['Salt']); return check_login($iId, $sPassCheck, $iRole, $error_handle); } function profile_delete($ID) { //global $MySQL; global $dir; //recompile global profiles cache clearCacheFile(BX_DIRECTORY_PATH_DBCACHE . 'sys_browse_peoples.inc'); $ID = (int)$ID; if ( !$ID ) return false; if ( !getProfileInfo( $ID ) ) return false; db_res( "DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='". $ID . "' LIMIT 1"); db_res( "DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'" ); db_res( "DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'" ); db_res( "DELETE FROM `sys_messages` WHERE Recipient = {$ID} " ); db_res( "DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}" ); db_res( "DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}" ); db_res( "DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}" ); db_res( "DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'" ); // delete profile votings require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php' ); $oVotingProfile = new BxDolVoting ('profile', 0, 0); $oVotingProfile->deleteVotings ($ID); // delete profile comments require_once (BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php'); $oCmts = new BxDolCmts('profile', $ID); $oCmts->onObjectDelete(); // delete all comments in all comments' systems, this user posted $oCmts->onAuthorDelete($ID); $iPossibleCoupleID = (int)db_value( "SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'" ); if ($iPossibleCoupleID) { db_res( "DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'" ); //delete cache file deleteUserDataFile( $iPossibleCoupleID ); } db_res( "DELETE FROM `Profiles` WHERE `ID` = '{$ID}'" ); // create system event require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'); $oZ = new BxDolAlerts('profile', 'delete', $ID); $oZ->alert(); //delete cache file deleteUserDataFile( $ID ); } function get_user_online_status ($ID) { $iOnline = 0; if($ID && is_numeric($ID) ) { $aMemberInfo = getProfileInfo($ID); // check user status; if($aMemberInfo['UserStatus'] != 'offline') { $min = getParam( "member_online_time" ); $iOnline = db_value("SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL {$min} MINUTE) AND ID={$ID}"); } } return $iOnline; } ?>