22 function _actionAdministration($sOptionApiKey, $sLangSettingsTitle, $sLangInfoTitle =
'', $sLangInfoText =
'', $sInfoTextParam =
'')
30 $iCatId = $this-> _oDb -> getSettingsCategoryId($sOptionApiKey);
39 if(isset($_POST[
'save']) && isset($_POST[
'cat']))
40 $mixedResult =
$oSettings -> saveChanges($_POST);
43 if ($mixedResult !==
true && !
empty($mixedResult))
44 $sOptions = $mixedResult . $sOptions;
47 $sCssStyles = $this->_oTemplate->addCss(
'forms_adv.css',
true);
49 $this->_oTemplate->pageCodeAdminStart();
53 'content' =>
_t($sLangInfoText, CH_WSB_URL_ROOT, $sInfoTextParam)
58 'content' => $sCssStyles . $sOptions
61 $this -> _oTemplate->pageCodeAdmin(
_t($sLangSettingsTitle));
79 $sCallbackUrl = $sCallbackUrl
81 : $this -> _oConfig -> sDefaultRedirectUrl;
83 header(
'Location: ' . $sCallbackUrl);
105 }
while ($sRetNickName ==
'');
107 return $sRetNickName;
123 $oSession->setValue($this->_oConfig->sSessionProfile,
$aProfileInfo);
125 header(
'Location: ' . CH_WSB_URL_ROOT .
'join.php');
134 $aRemoteSessionProfile = $oSession->getValue($this->_oConfig->sSessionProfile);
135 if(
empty($aRemoteSessionProfile) || !is_array($aRemoteSessionProfile))
138 $oSession->unsetValue($this->_oConfig->sSessionProfile);
140 $aResult = $this->serviceLogin($aRemoteSessionProfile);
146 $oAlert->aExtras[
'override'] =
true;
170 $sTmpFile = tempnam(
$GLOBALS[
'dir'][
'tmp'],
'bxoauth');
173 'medTitle' =>
_t(
'_sys_member_thumb_avatar'),
174 'medDesc' =>
_t(
'_sys_member_thumb_avatar'),
175 'medTags' =>
_t(
'_ProfilePhotos'),
176 'Categories' => array(
_t(
'_ProfilePhotos')),
178 'albumPrivacy' => $oPrivacy->getDefaultValueModule(
'photos',
'album_view'),
180 ChWsbService::call(
'photos',
'perform_photo_upload', array($sTmpFile, $aFileInfo,
false),
'Uploader');
198 if (is_string($mixed)) {
199 $this->_oTemplate->getPage(
_t($this->_oConfig->sDefaultTitleLangKey),
MsgBox($mixed));
204 if (is_array($mixed) && isset($mixed[
'join_page_redirect'])) {
205 $this->
_getJoinPage($mixed[
'profile_fields'], $mixed[
'remote_profile_info'][
'id']);
210 if (is_array($mixed) && isset($mixed[
'profile_id'])) {
212 $sMemberAvatar = !
empty($mixed[
'remote_profile_info'][
'picture']) ? $mixed[
'remote_profile_info'][
'picture'] :
'';
224 if($sMemberAvatar && !$mixed[
'existing_profile'])
233 $this->_oTemplate->getPage(
_t($this->_oConfig->sDefaultTitleLangKey),
MsgBox(
_t(
'_Error Occured')) );
260 if (
getParam(
'reg_by_inv_only') ==
'on' && (!isset($_COOKIE[
'idFriend']) ||
getID($_COOKIE[
'idFriend']) == 0) )
261 return _t(
'_registration by invitation only');
266 if (
empty($aProfileFields[
'Email']))
267 return _t(
'_Incorrect Email');
273 return _t(
'_Sorry, your IP been banned');
274 elseif ((
'on' ==
getParam(
'sys_dnsbl_enable') &&
'block' ==
getParam(
'sys_dnsbl_behaviour') &&
ch_is_ip_dns_blacklisted(
'',
'join oauth')) || $oChWsbStopForumSpam->isSpammer(array(
'email' => $aProfileFields[
'Email'],
'ip' =>
getVisitorIP(
false)),
'join oauth'))
275 return sprintf(
_t(
'_sys_spam_detected'), CH_WSB_URL_ROOT .
'contact.php');
279 foreach($aProfileFields
as $sKey => $mValue) {
280 if( !$this->_oDb->isFieldExist($sKey) ) {
282 unset($aProfileFields[$sKey]);
290 $aProfileFields[
'Password'] =
encryptUserPwd($sNewPassword, $sPasswordSalt);
292 $aProfileFields[
'DateReg'] = date(
'Y-m-d H:i:s' );
293 $aProfileFields[
'Salt'] = $sPasswordSalt;
298 $aProfileFields[
'allow_view_to'] = $oPrivacy->getDefaultValueModule(
'profile',
'view_block');
301 $iExistingProfileId = $this->_oDb->isEmailExisting($aProfileFields[
'Email']);
304 if (
'join' == $this->_oConfig->sRedirectPage && !$iExistingProfileId)
305 return array(
'remote_profile_info' =>
$aProfileInfo,
'profile_fields' => $aProfileFields,
'join_page_redirect' =>
true);
308 if ($iExistingProfileId)
311 $iProfileId = $this->_oDb->createProfile($aProfileFields);
319 if (!$iExistingProfileId) {
320 if (
getParam(
'autoApproval_ifNoConfEmail') ==
'on' ) {
321 if (
getParam(
'autoApproval_ifJoin') ==
'on' ) {
322 $sProfileStatus =
'Active';
324 $oProfileFields -> sendActivationMail(
$iProfileId);
327 $sProfileStatus =
'Approval';
335 $sProfileStatus =
'Unconfirmed';
337 if (
getParam(
'autoApproval_ifJoin') ==
'on' ) {
338 $sProfileStatus =
'Active';
340 $sProfileStatus =
'Approval';
346 $this->_oDb->updateProfileStatus(
$iProfileId, $sProfileStatus);
352 $aTemplate = $oEmailTemplate->getTemplate($this->_oConfig->sEmailTemplatePasswordGenerated,
$iProfileId);
357 'NewPassword' => $sNewPassword,
360 sendMail($aNewProfileInfo[
'Email'], $aTemplate[
'Subject'], $aTemplate[
'Body'],
'', $aPlus);
377 if ($isAutoFriends && method_exists($this,
'_makeFriends'))
381 if ($isSetLoggedIn) {
386 return array(
'remote_profile_info' =>
$aProfileInfo,
'profile_id' =>
$iProfileId,
'existing_profile' => $iExistingProfileId ?
true :
false);
400 $oSession->setValue($this->_oConfig->sSessionUid, $iRemoteProfileId);
404 $GLOBALS[
'oSysTemplate']->addJs(array(
'join.js',
'jquery.form.min.js'));
409 foreach($aProfileFields
as $sFieldName => $sValue)
410 $oJoin -> aValues[0][$sFieldName] = $sValue;
412 $this->_oTemplate->getPage(
_t(
'_JOIN_H'), $this->_oTemplate->parseHtmlByName(
'default_padding.html', array(
'content' => $oJoin->process())));
424 if ($isExistingProfile)
425 return 'index' == $this->_oConfig->sRedirectPage ? CH_WSB_URL_ROOT : CH_WSB_URL_ROOT .
'member.php';
427 $sRedirectUrl = $this->_oConfig->sDefaultRedirectUrl;
429 switch($this->_oConfig->sRedirectPage) {
432 $sRedirectUrl = CH_WSB_URL_ROOT .
'pedit.php?ID=' . (int)
$iProfileId;
441 $sRedirectUrl = CH_WSB_URL_ROOT;
446 $sRedirectUrl = CH_WSB_URL_ROOT .
'member.php';
450 return $sRedirectUrl;
455 header(
"Location:{$sUrl}",
true, $iStatus);