当前位置: 首页>>代码示例>>PHP>>正文


PHP encryptUserPwd函数代码示例

本文整理汇总了PHP中encryptUserPwd函数的典型用法代码示例。如果您正苦于以下问题:PHP encryptUserPwd函数的具体用法?PHP encryptUserPwd怎么用?PHP encryptUserPwd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了encryptUserPwd函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generateUserNewPwd

function generateUserNewPwd($ID)
{
    $sPwd = genRndPwd();
    $sSalt = genRndSalt();
    $sQuery = "\n        UPDATE `Profiles`\n        SET\n            `Password` = '" . encryptUserPwd($sPwd, $sSalt) . "',\n            `Salt` = '{$sSalt}'\n        WHERE\n            `ID`='{$ID}'\n    ";
    db_res($sQuery);
    createUserDataFile($ID);
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
    $oZ = new BxDolAlerts('profile', 'edit', $ID);
    $oZ->alert();
    return $sPwd;
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:12,代码来源:forgot.php

示例2: onProfileCreated

 public function onProfileCreated($sProfileId, $sToken)
 {
     if (empty($sProfileId) || empty($sToken)) {
         return;
     }
     $sSid = encryptUserPwd($sProfileId, genRndSalt());
     $this->_oModule->_oDb->updatePaymentDetails(array('profile_id' => $sProfileId, 'profile_sid' => $sSid), array('token' => $sToken));
     $aAccount = $this->_oModule->_oDb->getAccount(array('type' => 'profile_id', 'value' => $sProfileId));
     if (!empty($aAccount) && is_array($aAccount)) {
         $this->_oModule->_oDb->updateAccount(array('status' => BX_SITES_ACCOUNT_STATUS_PENDING), array('id' => $aAccount['id']));
         // perform action
         $this->_oModule->isAllowedAdd(true);
         // alert
         bx_alert($this->_oModule->getName(), 'added', $aAccount['id']);
     }
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:16,代码来源:BxSitesAccount.php

示例3: update

 function update($val, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
 {
     $sPwd = $this->getCleanValue(self::$FIELD_PASSWORD);
     if ($sPwd) {
         $sSalt = genRndSalt();
         $sPasswordHash = encryptUserPwd($sPwd, $sSalt);
     }
     $aValsToAdd = array_merge($aValsToAdd, array(self::$FIELD_CHANGED => time()), $sPwd ? array(self::$FIELD_PASSWORD => $sPasswordHash, self::$FIELD_SALT => $sSalt) : array());
     return parent::update($val, $aValsToAdd, $aTrackTextFieldsChanges);
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:10,代码来源:BxBaseFormAccount.php

示例4: createProfile


//.........这里部分代码省略.........
                     $aNewProfile[$sItemName] = (int) $aItem['Default'];
                     break;
                 case 'bool':
                     $aNewProfile[$sItemName] = (bool) $aItem['Default'];
                     break;
                 case 'system':
                     switch ($sItemName) {
                         case 'ID':
                             //set automatically
                         //set automatically
                         case 'Captcha':
                             //not been inserted
                         //not been inserted
                         case 'Location':
                             //not been inserted
                         //not been inserted
                         case 'Keyword':
                             //not been inserted
                         //not been inserted
                         case 'TermsOfUse':
                             //not been inserted
                             //pass
                             break;
                         case 'DateReg':
                             $aNewProfile[$sItemName] = date('Y-m-d H:i:s');
                             // set current date
                             break;
                         case 'DateLastEdit':
                         case 'DateLastLogin':
                             $aNewProfile[$sItemName] = '0000-00-00';
                             break;
                         case 'Couple':
                             $aNewProfile[$sItemName] = $aMainMember ? $iMainMemberID : 0;
                             //if main member exists, set him as a couple link
                             break;
                         case 'Featured':
                             $aNewProfile[$sItemName] = false;
                             break;
                         case 'Status':
                             if (getParam('autoApproval_ifNoConfEmail') == 'on') {
                                 if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) {
                                     $aNewProfile[$sItemName] = 'Active';
                                 } else {
                                     $aNewProfile[$sItemName] = 'Approval';
                                 }
                             } else {
                                 $aNewProfile[$sItemName] = 'Unconfirmed';
                             }
                             break;
                     }
                     break;
                 default:
                     $aNewProfile[$sItemName] = $aItem['Default'];
             }
         }
     }
     //we completed collecting
     // set default language
     $aNewProfile['LangID'] = getLangIdByName(getCurrentLangName());
     // set default privacy
     bx_import('BxDolPrivacyQuery');
     $oPrivacy = new BxDolPrivacyQuery();
     $aNewProfile['allow_view_to'] = $oPrivacy->getDefaultValueModule('profile', 'view_block');
     $sSet = $this->collectSetString($aNewProfile);
     $sQuery = "INSERT INTO `Profiles` SET \n{$sSet}";
     $rRes = db_res($sQuery);
     if ($rRes) {
         $iNewID = db_last_id();
         $this->createProfileCache($iNewID);
         if ($aMainMember) {
             $this->updateProfile($iMainMemberID, array('Couple' => $iNewID));
         }
         //set main member's couple. they will be linked each other
         //collect status text
         if ($bSendMails and !$aMainMember) {
             //send mail only to main member, not to couple
             $sStatusText = $aNewProfile['Status'];
             if (getParam('autoApproval_ifNoConfEmail') == 'on') {
                 if ('Active' == $sStatusText) {
                     $this->sendActivationMail($iNewID);
                 } else {
                     $this->sendApprovalMail($iNewID);
                 }
             } else {
                 if (!$this->sendConfMail($iNewID)) {
                     $sStatusText = 'NotSent';
                 }
             }
         } else {
             $sStatusText = 'OK';
         }
         //set crypted password
         $sSalt = genRndSalt();
         $this->updateProfile($iNewID, array('Password' => encryptUserPwd($aNewProfile['Password'], $sSalt), 'Salt' => $sSalt));
         bx_member_ip_store($iNewID);
         return array($iNewID, $sStatusText);
     } else {
         return array(false, 'Failed');
     }
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:101,代码来源:BxDolProfilesController.php

示例5: processPostValues


//.........这里部分代码省略.........
                     case 'bool':
                         if (isset($_POST[$sItemName]) and isset($_POST[$sItemName][$iHuman]) and $_POST[$sItemName][$iHuman] == 'yes') {
                             $mValue = true;
                         } else {
                             $mValue = false;
                         }
                         break;
                     case 'num':
                         if (isset($_POST[$sItemName]) and isset($_POST[$sItemName][$iHuman]) and trim($_POST[$sItemName][$iHuman]) !== '') {
                             $mValue = (int) trim($_POST[$sItemName][$iHuman]);
                         }
                         break;
                     case 'date':
                         if (isset($_POST[$sItemName]) and isset($_POST[$sItemName][$iHuman]) and trim($_POST[$sItemName][$iHuman]) !== '') {
                             list($iYear, $iMonth, $iDay) = explode('-', $_POST[$sItemName][$iHuman]);
                             // 1985-10-28
                             $iDay = intval($iDay);
                             $iMonth = intval($iMonth);
                             $iYear = intval($iYear);
                             $mValue = sprintf("%04d-%02d-%02d", $iYear, $iMonth, $iDay);
                         }
                         break;
                     case 'select_set':
                         $mValue = array();
                         if (isset($_POST[$sItemName]) and isset($_POST[$sItemName][$iHuman]) and is_array($_POST[$sItemName][$iHuman])) {
                             foreach ($_POST[$sItemName][$iHuman] as $sValue) {
                                 $mValue[] = process_pass_data($sValue);
                             }
                         }
                         break;
                     case 'range':
                         if (isset($_POST[$sItemName]) and isset($_POST[$sItemName][$iHuman])) {
                             if (is_array($_POST[$sItemName][$iHuman])) {
                                 $aRange = $_POST[$sItemName][$iHuman];
                             } else {
                                 $aRange = explode('-', $_POST[$sItemName][$iHuman], 2);
                             }
                             $mValue = array(null, null);
                             $aRange[0] = isset($aRange[0]) ? trim($aRange[0]) : '';
                             $aRange[1] = isset($aRange[1]) ? trim($aRange[1]) : '';
                             if ($aRange[0] !== '') {
                                 $mValue[0] = (int) $aRange[0];
                             }
                             if ($aRange[1] !== '') {
                                 $mValue[1] = (int) $aRange[1];
                             }
                         }
                         break;
                     case 'system':
                         switch ($aItem['Name']) {
                             case 'Couple':
                             case 'TermsOfUse':
                             case 'Featured':
                                 //they are boolean
                                 if (isset($_POST[$sItemName]) and $_POST[$sItemName] == 'yes') {
                                     $mValue = true;
                                 } else {
                                     $mValue = false;
                                 }
                                 break;
                             case 'Captcha':
                             case 'Status':
                                 // they are select_one
                                 if (isset($_POST[$sItemName])) {
                                     $mValue = process_pass_data($_POST[$sItemName]);
                                 }
                                 break;
                             case 'ProfilePhoto':
                                 if (isset($_FILES['ProfilePhoto'])) {
                                     if ($_FILES['ProfilePhoto']['error'] == UPLOAD_ERR_OK) {
                                         $sTmpName = tempnam($GLOBALS['dir']['tmp'], 'pphot');
                                         if (move_uploaded_file($_FILES['ProfilePhoto']['tmp_name'], $sTmpName)) {
                                             $mValue = basename($sTmpName);
                                         }
                                     }
                                 } elseif (isset($_POST['ProfilePhoto']) && trim($_POST['ProfilePhoto'])) {
                                     $mValue = preg_replace('/[^a-zA-Z0-9\\.]/', '', $_POST['ProfilePhoto']);
                                 }
                                 break;
                         }
                         break;
                 }
                 $rRes = $this->checkPostValue($iBlockID, $iItemID, $mValue, $iHuman, $iProfileID);
                 if ($rRes !== true) {
                     $aErrors[$iHuman][$sItemName] = $rRes;
                 }
                 //it is returned error text
                 //if password on edit page
                 if ($aItem['Type'] == 'pass' and ($this->iAreaID == 2 or $this->iAreaID == 3 or $this->iAreaID == 4)) {
                     if (empty($mValue)) {
                         $mValue = $aValues[$iHuman][$sItemName];
                     } else {
                         $mValue = encryptUserPwd($mValue, $aValues[$iHuman]['Salt']);
                     }
                 }
                 $aValues[$iHuman][$sItemName] = $mValue;
             }
         }
     }
 }
开发者ID:noormcs,项目名称:studoro,代码行数:101,代码来源:BxDolProfileFields.php

示例6: _createProfileRaw

 /**
  * Create new profile;
  *
  * @param  : $aProfileInfo (array) - remote profile's information;
  *
  * @param  : $sAlternativeName (string) - profiles alternative nickname;
  * @return : error string or error or profile info array on success
  */
 function _createProfileRaw($aProfileInfo, $sAlternativeName = '', $isAutoFriends = true, $isSetLoggedIn = true)
 {
     $sCountry = '';
     $sCity = '';
     // join by invite only
     if (getParam('reg_by_inv_only') == 'on' && (!isset($_COOKIE['idFriend']) || getID($_COOKIE['idFriend']) == 0)) {
         return _t('_registration by invitation only');
     }
     // convert fields
     $aProfileFields = $this->_convertRemoteFields($aProfileInfo, $sAlternativeName);
     if (empty($aProfileFields['Email'])) {
         return _t('_Incorrect Email');
     }
     // antispam check
     bx_import('BxDolStopForumSpam');
     $oBxDolStopForumSpam = new BxDolStopForumSpam();
     if (2 == getParam('ipBlacklistMode') && bx_is_ip_blocked()) {
         return _t('_Sorry, your IP been banned');
     } elseif ('on' == getParam('sys_dnsbl_enable') && 'block' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join oauth') || $oBxDolStopForumSpam->isSpammer(array('email' => $aProfileFields['Email'], 'ip' => getVisitorIP(false)), 'join oauth')) {
         return sprintf(_t('_sys_spam_detected'), BX_DOL_URL_ROOT . 'contact.php');
     }
     // check fields existence;
     foreach ($aProfileFields as $sKey => $mValue) {
         if (!$this->_oDb->isFieldExist($sKey)) {
             // (field not existence) remove from array;
             unset($aProfileFields[$sKey]);
         }
     }
     // add some system values
     $sNewPassword = genRndPwd();
     $sPasswordSalt = genRndSalt();
     $aProfileFields['Password'] = encryptUserPwd($sNewPassword, $sPasswordSalt);
     $aProfileFields['Role'] = BX_DOL_ROLE_MEMBER;
     $aProfileFields['DateReg'] = date('Y-m-d H:i:s');
     // set current date;
     $aProfileFields['Salt'] = $sPasswordSalt;
     // set default privacy
     bx_import('BxDolPrivacyQuery');
     $oPrivacy = new BxDolPrivacyQuery();
     $aProfileFields['allow_view_to'] = $oPrivacy->getDefaultValueModule('profile', 'view_block');
     // check if user with the same email already exists
     $iExistingProfileId = $this->_oDb->isEmailExisting($aProfileFields['Email']);
     // check redirect page
     if ('join' == $this->_oConfig->sRedirectPage && !$iExistingProfileId) {
         return array('remote_profile_info' => $aProfileInfo, 'profile_fields' => $aProfileFields, 'join_page_redirect' => true);
     }
     // create new profile
     if ($iExistingProfileId) {
         $iProfileId = $iExistingProfileId;
     } else {
         $iProfileId = $this->_oDb->createProfile($aProfileFields);
     }
     $oProfileFields = new BxDolProfilesController();
     // remember remote profile id for created member
     $this->_oDb->saveRemoteId($iProfileId, $aProfileInfo['id']);
     // check profile status;
     if (!$iExistingProfileId) {
         if (getParam('autoApproval_ifNoConfEmail') == 'on') {
             if (getParam('autoApproval_ifJoin') == 'on') {
                 $sProfileStatus = 'Active';
                 if (!empty($aProfileInfo['email'])) {
                     $oProfileFields->sendActivationMail($iProfileId);
                 }
             } else {
                 $sProfileStatus = 'Approval';
                 if (!empty($aProfileInfo['email'])) {
                     $oProfileFields->sendApprovalMail($iProfileId);
                 }
             }
         } else {
             if (!empty($aProfileInfo['email'])) {
                 $oProfileFields->sendConfMail($iProfileId);
                 $sProfileStatus = 'Unconfirmed';
             } else {
                 if (getParam('autoApproval_ifJoin') == 'on') {
                     $sProfileStatus = 'Active';
                 } else {
                     $sProfileStatus = 'Approval';
                 }
             }
         }
         // update profile's status;
         $this->_oDb->updateProfileStatus($iProfileId, $sProfileStatus);
         $oProfileFields->createProfileCache($iProfileId);
         // send email notification
         if (!empty($aProfileInfo['email'])) {
             $oEmailTemplate = new BxDolEmailTemplates();
             $aTemplate = $oEmailTemplate->getTemplate($this->_oConfig->sEmailTemplatePasswordGenerated, $iProfileId);
             $aNewProfileInfo = getProfileInfo($iProfileId);
             $aPlus = array('NickName' => getNickName($aNewProfileInfo['ID']), 'NewPassword' => $sNewPassword);
             sendMail($aNewProfileInfo['Email'], $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus);
         }
//.........这里部分代码省略.........
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:101,代码来源:BxDolConnectModule.php

示例7: generateUserNewPwd

 /**
  * Generate new password.
  */
 protected function generateUserNewPwd($iAccountId)
 {
     $sPwd = genRndPwd();
     $sSalt = genRndSalt();
     $sPasswordHash = encryptUserPwd($sPwd, $sSalt);
     $this->_oAccountQuery->updatePassword($sPasswordHash, $sSalt, $iAccountId);
     bx_alert('account', 'edit', $iAccountId, $iAccountId, array('action' => 'forgot_password'));
     return $sPwd;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:12,代码来源:BxBaseServiceAccount.php

示例8: check_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);
}
开发者ID:newton27,项目名称:dolphin.pro,代码行数:10,代码来源:admin.inc.php

示例9: bx_check_password

/**
 * Check unencrypted password
 * @return empty string on success or error string on error
 */
function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
{
    bx_import('BxDolAccount');
    $oAccount = BxDolAccount::getInstance($sLogin);
    if (!$oAccount) {
        bx_import('BxDolLanguages');
        return _t("_sys_txt_login_error");
    }
    $aAccountInfo = $oAccount->getInfo();
    $sPassCheck = encryptUserPwd($sPassword, $aAccountInfo['salt']);
    if ($sErrorMsg = bx_check_login($aAccountInfo['id'], $sPassCheck, $iRole)) {
        return $sErrorMsg;
    }
    // Admin can always login even if he is blocked/banned/suspended/etc
    if (isAdmin($aAccountInfo['id'])) {
        return '';
    }
    $sErrorMsg = '';
    bx_alert('account', 'check_login', $aAccountInfo['id'], false, array('error_msg' => &$sErrorMsg));
    return $sErrorMsg;
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:25,代码来源:profiles.inc.php

示例10: encryptPassword

function encryptPassword($sId, $sPassword)
{
    $aUser = getProfileInfo($sId);
    return encryptUserPwd($sPassword, $aUser['Salt']);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:5,代码来源:customFunctions.inc.php

示例11: _saveCatAdminPassword

 function _saveCatAdminPassword(&$aData)
 {
     $iId = (int) $_COOKIE['memberID'];
     $aAdmin = $this->_oDb->getRow("SELECT `Password`, `Salt` FROM `Profiles` WHERE `ID`= ?", [$iId]);
     if (encryptUserPwd($aData['pwd_old'], $aAdmin['Salt']) != $aAdmin['Password']) {
         return MsgBox(_t('_adm_txt_settings_wrong_old_pasword'), $this->_iResultTimer);
     }
     $iLength = strlen($aData['pwd_new']);
     if ($iLength < 3) {
         return MsgBox(_t('_adm_txt_settings_wrong_new_pasword'), $this->_iResultTimer);
     }
     if ($aData['pwd_new'] != $aData['pwd_conf']) {
         return MsgBox(_t('_adm_txt_settings_wrong_conf_pasword'), $this->_iResultTimer);
     }
     $this->_oDb->query("UPDATE `Profiles` SET `Password`='" . encryptUserPwd($aData['pwd_new'], $aAdmin['Salt']) . "' WHERE `ID`='{$iId}'");
     createUserDataFile($iId);
     return true;
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:18,代码来源:BxDolAdminSettings.php

示例12: _createProfileRaw

 /**
  * Create new profile;
  *
  * @param  : $aProfileInfo (array) - some profile's information;
  *          @see : $this -> aFacebookProfileFields;
  *
  * @param  : $sAlternativeName (string) - profiles alternative nickname;
  * @return : error string or error or profile info array on success
  */
 function _createProfileRaw($aProfileInfo, $sAlternativeName = '', $isAutoFriends = true, $isSetLoggedIn = true)
 {
     $sCountry = '';
     $sCity = '';
     //-- join by invite only --//
     if (getParam('reg_by_inv_only') == 'on' && (!isset($_COOKIE['idFriend']) || getID($_COOKIE['idFriend']) == 0)) {
         return _t('_registration by invitation only');
     }
     //--
     // process the date of birth;
     if (isset($aProfileInfo['birthday'])) {
         $aProfileInfo['birthday'] = isset($aProfileInfo['birthday']) ? date('Y-m-d', strtotime($aProfileInfo['birthday'])) : '';
     }
     // generate new password for profile;
     $sNewPassword = genRndPwd();
     $sPasswordSalt = genRndSalt();
     $aProfileInfo['password'] = encryptUserPwd($sNewPassword, $sPasswordSalt);
     //-- define user's country and city --//
     $aLocation = array();
     if (isset($aProfileInfo['location']['name'])) {
         $aLocation = $aProfileInfo['location']['name'];
     } else {
         if (isset($aProfileInfo['hometown']['name'])) {
             $aLocation = $aProfileInfo['hometown']['name'];
         }
     }
     if ($aLocation) {
         $aCountryInfo = explode(',', $aLocation);
         $sCountry = $this->_oDb->getCountryCode(trim($aCountryInfo[1]));
         $sCity = trim($aCountryInfo[0]);
         //set default country name, especially for American brothers
         if ($sCity && !$sCountry) {
             $sCountry = $this->_oConfig->sDefaultCountryCode;
         }
     }
     //--
     //try define the user's email
     $sEmail = !empty($aProfileInfo['email']) ? $aProfileInfo['email'] : $aProfileInfo['proxied_email'];
     //-- fill array with all needed values --//
     $aProfileFields = array('NickName' => $aProfileInfo['nick_name'] . $sAlternativeName, 'Email' => $sEmail, 'Sex' => isset($aProfileInfo['gender']) ? $aProfileInfo['gender'] : '', 'DateOfBirth' => $aProfileInfo['birthday'], 'Password' => $aProfileInfo['password'], 'FullName' => (isset($aProfileInfo['first_name']) ? $aProfileInfo['first_name'] : '') . (isset($aProfileInfo['last_name']) ? ' ' . $aProfileInfo['last_name'] : ''), 'DescriptionMe' => clear_xss(isset($aProfileInfo['bio']) ? $aProfileInfo['bio'] : ''), 'Interests' => isset($aProfileInfo['interests']) ? $aProfileInfo['interests'] : '', 'Religion' => isset($aProfileInfo['religion']) ? $aProfileInfo['religion'] : '', 'Country' => $sCountry, 'City' => $sCity);
     //--
     bx_import('BxDolStopForumSpam');
     $oBxDolStopForumSpam = new BxDolStopForumSpam();
     if (2 == getParam('ipBlacklistMode') && bx_is_ip_blocked()) {
         return _t('_Sorry, your IP been banned');
     } elseif ('on' == getParam('sys_dnsbl_enable') && 'block' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join facebook') || $oBxDolStopForumSpam->isSpammer(array('email' => $aProfileFields['Email'], 'ip' => getVisitorIP(false)), 'join facebook')) {
         return sprintf(_t('_sys_spam_detected'), BX_DOL_URL_ROOT . 'contact.php');
     }
     // check fields existence;
     foreach ($aProfileFields as $sKey => $mValue) {
         if (!$this->_oDb->isFieldExist($sKey)) {
             // (field not existence) remove from array;
             unset($aProfileFields[$sKey]);
         }
     }
     //-- add some system values --//
     $aProfileFields['Role'] = BX_DOL_ROLE_MEMBER;
     $aProfileFields['DateReg'] = date('Y-m-d H:i:s');
     // set current date;
     $aProfileFields['Salt'] = $sPasswordSalt;
     //--
     $iExistingProfileId = $this->_oDb->isEmailExisting($sEmail);
     //check redirect page
     if ('join' == $this->_oConfig->sRedirectPage && !$iExistingProfileId) {
         return array('profile_info_fb' => $aProfileInfo, 'profile_fields' => $aProfileFields, 'join_page_redirect' => true);
     }
     // create new profile;
     if ($iExistingProfileId) {
         $iProfileId = $iExistingProfileId;
     } else {
         $iProfileId = $this->_oDb->createProfile($aProfileFields);
     }
     $oProfileFields = new BxDolProfilesController();
     //remember FB uid for created member
     $this->_oDb->saveFbUid($iProfileId, $aProfileInfo['id']);
     // check profile status;
     if (!$iExistingProfileId) {
         if (getParam('autoApproval_ifNoConfEmail') == 'on') {
             if (getParam('autoApproval_ifJoin') == 'on') {
                 $sProfileStatus = 'Active';
                 if (!empty($aProfileInfo['email'])) {
                     $oProfileFields->sendActivationMail($iProfileId);
                 }
             } else {
                 $sProfileStatus = 'Approval';
                 if (!empty($aProfileInfo['email'])) {
                     $oProfileFields->sendApprovalMail($iProfileId);
                 }
             }
         } else {
             if (!empty($aProfileInfo['email'])) {
//.........这里部分代码省略.........
开发者ID:vongalpha,项目名称:dolphin.pro,代码行数:101,代码来源:BxFaceBookConnectModule.php

示例13: getMarkers

 protected function getMarkers($a)
 {
     $aMarkers = array();
     foreach ($this->_aConfig as $sKey => $r) {
         $aMarkers[$sKey] = isset($a[$sKey]) ? $a[$sKey] : '';
     }
     $aMarkers['admin_pwd_salt'] = genRndPwd();
     $aMarkers['admin_pwd_hash'] = encryptUserPwd($a['admin_password'], $aMarkers['admin_pwd_salt']);
     $aMarkers['current_timestamp'] = time();
     $aMarkers['version'] = BX_DOL_VER;
     $aMarkers['time'] = time();
     $aMarkers['secret'] = genRndPwd(11);
     $aMarkers['ffmpeg_path'] = $aMarkers['root_dir'] . 'plugins/ffmpeg/ffmpeg.exe';
     return $aMarkers;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:15,代码来源:BxDolInstallSiteConfig.php

示例14: _createProfile

 /**
  * Create new profile;
  *
  * @param  : $aProfileInfo (array) - some profile's information; 
  *          @see : $this -> aFacebookProfileFields;
  *          
  * @param  : $sAlternativeName (string) - profiles alternative nickname; 
  * @return : (integer) profile's id; 
  */
 function _createProfile($aProfileInfo, $sAlternativeName = '')
 {
     $sCountry = '';
     $sCity = '';
     $bAvatarRedirect = false;
     $sMemberAvatar = !empty($aProfileInfo['picture']) ? $aProfileInfo['picture'] : '';
     //-- join by invite only --//
     if (getParam('reg_by_inv_only') == 'on' && (!isset($_COOKIE['idFriend']) || getID($_COOKIE['idFriend']) == 0)) {
         $this->_oTemplate->getPage(_t('_bx_facebook'), MsgBox(_t('_registration by invitation only')));
         exit;
     }
     //--
     // process the date of birth;
     if (isset($aProfileInfo['birthday'])) {
         $aProfileInfo['birthday'] = isset($aProfileInfo['birthday']) ? date('Y-m-d', strtotime($aProfileInfo['birthday'])) : '';
     }
     // generate new password for profile;
     $sNewPassword = genRndPwd();
     $sPasswordSalt = genRndSalt();
     $aProfileInfo['password'] = encryptUserPwd($sNewPassword, $sPasswordSalt);
     //-- define user's country and city --//
     $aLocation = array();
     if (isset($aProfileInfo['location']['name'])) {
         $aLocation = $aProfileInfo['location']['name'];
     } else {
         if (isset($aProfileInfo['hometown']['name'])) {
             $aLocation = $aProfileInfo['hometown']['name'];
         }
     }
     if ($aLocation) {
         $aCountryInfo = explode(',', $aLocation);
         $sCountry = $this->_oDb->getCountryCode(trim($aCountryInfo[1]));
         $sCity = trim($aCountryInfo[0]);
         //set default country name, especially for American brothers
         if ($sCity && !$sCountry) {
             $sCountry = $this->_oConfig->sDefaultCountryCode;
         }
     }
     //--
     //try define the user's email
     $sEmail = !empty($aProfileInfo['email']) ? $aProfileInfo['email'] : $aProfileInfo['proxied_email'];
     //check email
     if ($this->_oDb->isEmailExisting($sEmail)) {
         $this->_oTemplate->getPage(_t('_bx_facebook'), MsgBox(_t('_bx_facebook_error_email')));
         exit;
     }
     //-- fill array with all needed values --//
     $aProfileFields = array('NickName' => $aProfileInfo['nick_name'] . $sAlternativeName, 'Email' => $sEmail, 'Sex' => isset($aProfileInfo['gender']) ? $aProfileInfo['gender'] : '', 'DateOfBirth' => $aProfileInfo['birthday'], 'Password' => $aProfileInfo['password'], 'FirstName' => isset($aProfileInfo['first_name']) ? $aProfileInfo['first_name'] : '', 'LastName' => isset($aProfileInfo['last_name']) ? $aProfileInfo['last_name'] : '', 'DescriptionMe' => isset($aProfileInfo['bio']) ? $aProfileInfo['bio'] : '', 'Interests' => isset($aProfileInfo['interests']) ? $aProfileInfo['interests'] : '', 'Religion' => isset($aProfileInfo['religion']) ? $aProfileInfo['religion'] : '', 'Country' => $sCountry, 'City' => $sCity);
     //--
     // check fields existence;
     foreach ($aProfileFields as $sKey => $mValue) {
         if (!$this->_oDb->isFieldExist($sKey)) {
             // (field not existence) remove from array;
             unset($aProfileFields[$sKey]);
         }
     }
     //-- add some system values --//
     $aProfileFields['Role'] = BX_DOL_ROLE_MEMBER;
     $aProfileFields['DateReg'] = date('Y-m-d H:i:s');
     // set current date;
     $aProfileFields['Salt'] = $sPasswordSalt;
     //--
     //check redirect page
     switch ($this->_oConfig->sRedirectPage) {
         case 'join':
             return $this->_getJoinPage($aProfileFields, $aProfileInfo['id']);
         case 'pedit':
             $sRedirectUrl = BX_DOL_URL_ROOT . 'pedit.php';
             break;
         case 'avatar':
             $bAvatarRedirect = true;
             break;
         case 'index':
             $sRedirectUrl = BX_DOL_URL_ROOT;
             break;
         case 'member':
         default:
             $sRedirectUrl = BX_DOL_URL_ROOT . 'member.php';
             break;
     }
     // create new profile;
     $iProfileId = $this->_oDb->createProfile($aProfileFields);
     $oProfileFields = new BxDolProfilesController();
     //remember FB uid for created member
     $this->_oDb->saveFbUid($iProfileId, $aProfileInfo['id']);
     // check profile status;
     if (getParam('autoApproval_ifNoConfEmail') == 'on') {
         if (getParam('autoApproval_ifJoin') == 'on') {
             $sProfileStatus = 'Active';
             if (!empty($aProfileInfo['email'])) {
                 $oProfileFields->sendActivationMail($iProfileId);
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:shopexts,代码行数:101,代码来源:BxFaceBookConnectModule.php


注:本文中的encryptUserPwd函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。