コード例 #1
0
 function registerMember()
 {
     $oPC = new BxDolProfilesController();
     $oZ = new BxDolAlerts('profile', 'before_join', 0, 0, $this->aValues[0]);
     $oZ->alert();
     $aProfile1 = $this->oPF->getProfileFromValues($this->aValues[0]);
     if (empty($aProfile1['NickName'])) {
         $aProfile1['NickName'] = uriGenerate(empty($aProfile1['FirstName']) ? genRndPwd(10, false) : $aProfile1['FirstName'], 'Profiles', 'NickName');
     }
     list($iId1, $sStatus1) = $oPC->createProfile($aProfile1);
     //--- check whether profile was created successfully or not
     if (!$iId1) {
         if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
             @unlink($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']);
         }
         return array(false, 'Fail');
     }
     //--- check for couple profile
     if ($this->bCouple) {
         $aProfile2 = $this->oPF->getProfileFromValues($this->aValues[1]);
         list($iId2, $sStatus2) = $oPC->createProfile($aProfile2, false, $iId1);
         if (!$iId2) {
             $oPC->deleteProfile($iId1);
             return array(false, 'Fail');
         }
     }
     //--- upload profile photo
     if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
         $sPass1 = getPassword($iId1);
         bx_login($iId1);
         check_logged();
         BxDolService::call('avatar', 'set_image_for_cropping', array($iId1, $GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']));
         if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) {
             $aFileInfo = array('medTitle' => _t('_sys_member_thumb_avatar'), 'medDesc' => _t('_sys_member_thumb_avatar'), 'medTags' => _t('_ProfilePhotos'), 'Categories' => array(_t('_ProfilePhotos')), 'album' => str_replace('{nickname}', getUsername($iId1), getParam('bx_photos_profile_album_name')), 'albumPrivacy' => BX_DOL_PG_ALL);
             BxDolService::call('photos', 'perform_photo_upload', array($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader');
         }
     }
     if (BxDolModule::getInstance('BxWmapModule')) {
         BxDolService::call('wmap', 'response_entry_add', array('profiles', $iId1));
     }
     //--- create system event
     bx_import('BxDolAlerts');
     $oZ = new BxDolAlerts('profile', 'join', $iId1, 0, array('status_text' => &$sStatus1));
     $oZ->alert();
     return array($iId1, $sStatus1);
 }
コード例 #2
0
 function registerMember()
 {
     $bEnAff = getParam('en_aff') == 'on';
     $oPC = new BxDolProfilesController();
     //convert to profile
     $aProfile = $this->oPF->getProfileFromValues($this->aValues[0]);
     //create it
     list($iMemID, $sStatus) = $oPC->createProfile($aProfile);
     if (!$iMemID) {
         return array(false, 'Fail');
     }
     if ($this->bCouple) {
         //convert
         $aProfile = $this->oPF->getProfileFromValues($this->aValues[1]);
         //create
         list($iMem1ID, $sStatus1) = $oPC->createProfile($aProfile, false, $iMemID);
         if (!$iMem1ID) {
             $oPC->deleteProfile($iMemID);
             return array(false, 'Fail');
         }
     }
     //send new user notification
     if (getParam('newusernotify') == 'on') {
         $oPC->sendNewUserNotify($iMemID);
     }
     // Affiliate and friend checking
     if ($bEnAff && $_COOKIE['idAff']) {
         $vRes = db_res("SELECT `ID` FROM `aff` WHERE `ID` = {$_COOKIE['idAff']} AND `Status` = 'active'");
         if (mysql_num_rows($vRes)) {
             $vRes = db_res("INSERT INTO `aff_members` (`idAff`,`idProfile`) VALUES ('{$_COOKIE['idAff']}', '{$iMemID}')");
         }
     }
     if ($bEnAff && $_COOKIE['idFriend']) {
         $iFriendID = getID($_COOKIE['idFriend']);
         if ($iFriendID) {
             $vRes = db_res("UPDATE `Profiles` SET `aff_num` = `aff_num` + 1 WHERE `ID` = '{$iFriendID}'");
             createUserDataFile($iFriendID);
         }
     }
     reparseObjTags('profile', $iMemID);
     return array($iMemID, $sStatus);
 }
コード例 #3
0
 function registerMember()
 {
     $oPC = new BxDolProfilesController();
     require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
     $oZ = new BxDolAlerts('profile', 'before_join', 0, 0, $this->aValues[0]);
     $oZ->alert();
     $aProfile1 = $this->oPF->getProfileFromValues($this->aValues[0]);
     list($iId1, $sStatus1) = $oPC->createProfile($aProfile1);
     //--- check whether profile was created successfully or not
     if (!$iId1) {
         if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
             @unlink($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']);
         }
         return array(false, 'Fail');
     }
     //--- check for couple profile
     if ($this->bCouple) {
         $aProfile2 = $this->oPF->getProfileFromValues($this->aValues[1]);
         list($iId2, $sStatus2) = $oPC->createProfile($aProfile2, false, $iId1);
         if (!$iId2) {
             $oPC->deleteProfile($iId1);
             return array(false, 'Fail');
         }
     }
     //--- upload profile photo
     if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
         $sPass1 = getPassword($iId1);
         bx_login($iId1);
         check_logged();
         BxDolService::call('avatar', 'set_image_for_cropping', array($iId1, $GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']));
         if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) {
             $aFileInfo = array('medTitle' => _t('_bx_ava_avatar'), 'medDesc' => _t('_bx_ava_avatar'), 'medTags' => _t('_ProfilePhotos'), 'Categories' => array(_t('_ProfilePhotos')), 'album' => str_replace('{nickname}', getNickName($iId1), getParam('bx_photos_profile_album_name')));
             BxDolService::call('photos', 'perform_photo_upload', array($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader');
         }
     }
     //--- create system event
     bx_import('BxDolAlerts');
     $oZ = new BxDolAlerts('profile', 'join', $iId1, 0, array('status_text' => &$sStatus1));
     $oZ->alert();
     return array($iId1, $sStatus1);
 }