/** * page code function */ function PageCompPageMainCode() { if ($_POST['DELETE']) { profile_delete(getLoggedId()); bx_logout(); return MsgBox(_t("_DELETE_SUCCESS")); } $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account")))); $oForm = new BxTemplFormView($aForm); return $oForm->getCode(); }
/** * page code function */ function PageCompPageMainCode() { $iUserId = getLoggedId(); if ($_POST['DELETE']) { profile_delete($iUserId); bx_logout(); return MsgBox(_t("_DELETE_SUCCESS")); } $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account")))); $oForm = new BxTemplFormView($aForm); $GLOBALS['oTopMenu']->setCurrentProfileID($iUserId); return $GLOBALS['oSysTemplate']->parseHtmlByName('default_margin.html', array('content' => $oForm->getCode())); }
<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ * * @defgroup TridentCore Trident Core * @{ */ ob_start(); require_once './inc/header.inc.php'; require_once BX_DIRECTORY_PATH_INC . "design.inc.php"; ob_end_clean(); bx_import('BxDolLanguages'); if (isset($_COOKIE['memberID']) && isset($_COOKIE['memberPassword'])) { bx_logout(); } $oTemplate = BxDolTemplate::getInstance(); $oTemplate->setPageNameIndex(BX_PAGE_TRANSITION); $oTemplate->setPageHeader(_t('_Please Wait')); $oTemplate->setPageContent('page_main_code', MsgBox(_t('_Please Wait'))); $oTemplate->setPageContent('url_relocate', BX_DOL_URL_ROOT); send_headers_page_changed(); $oTemplate->getPageCode(); /** @} */
function check_logged() { $aAccTypes = array(1 => '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); } }
/** * Check if user is logged in (necessary cookies are present) and set some global variables */ function check_logged() { $aAccTypes = array(BX_DOL_ROLE_ADMIN => 'admin', BX_DOL_ROLE_MEMBER => 'member'); $sID = isset($_COOKIE['memberID']) ? bx_process_input($_COOKIE['memberID']) : false; $sPassword = isset($_COOKIE['memberPassword']) ? bx_process_input($_COOKIE['memberPassword']) : false; $bLogged = false; foreach ($aAccTypes as $iRole => $sValue) { if ($GLOBALS['logged'][$sValue] = $sID && !bx_check_login($sID, $sPassword, $iRole)) { $bLogged = true; break; } } if ((isset($_COOKIE['memberID']) || isset($_COOKIE['memberPassword'])) && !$bLogged) { bx_logout(false); } }
protected function _editAccountForm($iAccountId, $sDisplayName) { $oAccount = BxDolAccount::getInstance($iAccountId); $aAccountInfo = $oAccount ? $oAccount->getInfo() : false; if (!$aAccountInfo) { return MsgBox(_t('_sys_txt_error_account_is_not_defined')); } // check access if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = BxDolAccount::isAllowedEdit($this->_iProfileId, $aAccountInfo))) { return MsgBox($sMsg); } // check and display form $oForm = BxDolForm::getObjectInstance('sys_account', $sDisplayName); if (!$oForm) { return MsgBox(_t('_sys_txt_error_occured')); } if (!$oForm->isSubmitted()) { unset($aAccountInfo['password']); } $oForm->initChecker($aAccountInfo); if (!$oForm->isSubmittedAndValid()) { return $oForm->getCode(); } $aTrackTextFieldsChanges = array(); // track text fields changes, not-null(for example empty array) - means track, null - means don't track // update email and email setting in DB if (!$oForm->update($aAccountInfo['id'], array(), $aTrackTextFieldsChanges)) { if (!$oForm->isValid()) { return $oForm->getCode(); } else { return MsgBox(_t('_sys_txt_error_account_update')); } } // check if email was changed if (!empty($aTrackTextFieldsChanges['changed_fields']) && in_array('email', $aTrackTextFieldsChanges['changed_fields'])) { $oAccount->updateEmailConfirmed(false); } // mark email as unconfirmed // check if password was changed if ($oForm->getCleanValue('password')) { // relogin with new password bx_logout(); bx_login($aAccountInfo['id']); } // check if other text info was changed - if auto-appproval is off $isAutoApprove = $oForm->isSetPendingApproval() ? false : true; if (!$isAutoApprove) { bx_import('BxDolProfile'); $oProfile = BxDolProfile::getInstanceAccountProfile($aAccountInfo['id']); // get profile associated with account, not current porfile $aProfileInfo = $oProfile->getInfo(); unset($aTrackTextFieldsChanges['changed_fields']['email']); // email confirmation is automatic and separate, don't need to deactivate whole profile if email is changed if (BX_PROFILE_STATUS_ACTIVE == $aProfileInfo['status'] && !empty($aTrackTextFieldsChanges['changed_fields'])) { $oProfile->disapprove(BX_PROFILE_ACTION_AUTO); } // change profile to 'pending' only if some text fields were changed and profile is active } // create an alert bx_alert('account', 'edited', $aAccountInfo['id'], $aAccountInfo['id'], array('display' => $sDisplayName)); // display result message $sMsg = MsgBox(_t('_sys_txt_data_successfully_submitted')); return $sMsg . $oForm->getCode(); }
function check_logged() { $aAccTypes = array(1 => '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); } if ($bLogged) { $GLOBALS['oSysTemplate']->addCssStyle('.bx-hide-when-logged-in', array('display' => 'none')); } }