function before() { $ci = &get_instance(); if (!property_exists (&$ci, "noRender") && isLogged()) { $ci->smarty->setPartial('content', 'area'); } }
function actionAuth() { $oRequest = OAuth2\Request::createFromGlobals(); $oResponse = new OAuth2\Response(); // validate the authorize request if (!$this->_oServer->validateAuthorizeRequest($oRequest, $oResponse)) { require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; $o = json_decode($oResponse->getResponseBody()); $this->_oTemplate->getPage(false, MsgBox($o->error_description)); } if (!isLogged()) { require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; $sForceRelocate = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'auth/?client_id=' . bx_get('client_id') . '&response_type=' . bx_get('response_type') . '&state=' . bx_get('state') . '&redirect_uri=' . bx_get('redirect_uri'); bx_login_form(false, false, $sForceRelocate); return; } $aProfiles = BxDolAccount::getInstance()->getProfiles(); if (!($iProfileId = $this->_oDb->getSavedProfile($aProfiles)) && empty($_POST)) { $oPage = BxDolPage::getObjectInstanceByURI('oauth-authorization'); $this->_oTemplate->getPage(false, $oPage->getCode()); return; } if (!$iProfileId) { $iProfileId = bx_get('profile_id'); } $this->_oServer->handleAuthorizeRequest($oRequest, $oResponse, (bool) $iProfileId, $iProfileId); $oResponse->send(); }
function genSiteServiceMenu() { $bLogged = isLogged(); $aMenuItem = array(); $sMenuPopupId = ''; $sMenuPopupContent = ''; if ($bLogged) { bx_import('BxTemplMenuService'); $oMenu = new BxTemplMenuService(); if ($oMenu->aMenuInfo['memberID'] != 0) { $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']); } $sThumbSetting = getParam('sys_member_info_thumb_icon'); bx_import('BxDolMemberInfo'); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting); $sThumbUrl = $o ? $o->get($aProfile) : ''; $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x'); $sThumbTwiceUrl = $o ? $o->get($aProfile) : ''; if (!$sThumbTwiceUrl) { $sThumbTwiceUrl = $sThumbUrl; } $bThumb = !empty($sThumbUrl); $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'thumbnail' => get_member_icon($oMenu->aMenuInfo['memberID']), 'title' => getNickName($oMenu->aMenuInfo['memberID'])); $sMenuPopupId = 'sys-service-menu-' . time(); $sMenuPopupContent = $this->transBox($oMenu->getCode()); } return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged, 'content' => array()), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent)); }
function __construct() { parent::__construct(); $this->is_admin_protected = TRUE; isLogged(); $this->load->model('user/usermodel'); }
function index() { if (!isLogged()) { redirect('/admin/login'); } }
function serviceHelpdeskCode() { $sChatUrl = getParam('bx_chat_plus_url'); if (!getParam('bx_chat_plus_helpdesk') || !$sChatUrl) { return ''; } if (getParam('bx_chat_plus_helpdesk_guest_only') && isLogged()) { return ''; } $aUrl = parse_url($sChatUrl); $sChatUrl = $aUrl['scheme'] . '://' . $aUrl['host'] . ($aUrl['port'] ? ':' . $aUrl['port'] : ''); return <<<EOS <!-- Start of Helpdesk Livechat Script --> <script type="text/javascript"> (function(w, d, s, u) { \tw.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u; \tvar h = d.getElementsByTagName(s)[0], j = d.createElement(s); \tj.async = true; j.src = '{$sChatUrl}/packages/rocketchat_livechat/assets/rocket-livechat.js'; \th.parentNode.insertBefore(j, h); })(window, document, 'script', '{$sChatUrl}/livechat'); </script> <!-- End of Helpdesk Livechat Script --> EOS; }
public function serviceLoginForm($sParams = '', $sForceRelocate = '') { if (isLogged()) { return false; } // get all auth types $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`'); // define additional auth types if ($aAuthTypes) { $aAddInputEl[''] = _t('_Basic'); // procces all additional menu's items foreach ($aAuthTypes as $iKey => $aItems) { $aAddInputEl[$aItems['Link']] = _t($aItems['Title']); } $aAuthTypes = array('type' => 'select', 'caption' => _t('_Auth type'), 'values' => $aAddInputEl, 'value' => '', 'attrs' => array('onchange' => 'if (this.value) { location.href = "' . BX_DOL_URL_ROOT . '" + this.value }')); } else { $aAuthTypes = array('type' => 'hidden'); } $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login'); $sCustomHtmlBefore = ''; $sCustomHtmlAfter = ''; bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes)); if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) { $oForm->aInputs['relocate']['value'] = $sForceRelocate; } elseif ('homepage' == $sForceRelocate) { $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT; } $sFormCode = $oForm->getCode(); $sJoinText = ''; if (strpos($sParams, 'no_join_text') === false) { $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div>' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>'; } BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js')); return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText; }
function genSiteServiceMenu() { $bLogged = isLogged(); $aMenuItem = array(); $sMenuPopupId = ''; $sMenuPopupContent = ''; $bShowVisitor = false; bx_import('BxTemplMenuService'); $oMenu = new BxTemplMenuService(); if ($bLogged) { $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']); $sThumbSetting = getParam('sys_member_info_thumb_icon'); bx_import('BxDolMemberInfo'); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting); $sThumbUrl = $o ? $o->get($aProfile) : ''; $bThumb = !empty($sThumbUrl); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x'); $sThumbTwiceUrl = $o ? $o->get($aProfile) : ''; if (!$sThumbTwiceUrl) { $sThumbTwiceUrl = $sThumbUrl; } $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'title' => getNickName($oMenu->aMenuInfo['memberID'])); $sMenuPopupId = 'sys-service-menu-' . time(); $sMenuPopupContent = $this->transBox($oMenu->getCode()); } else { $aItems = $oMenu->getItemsArray(); if (!empty($aItems)) { $bShowVisitor = true; $bLoginOnly = $aItems[0]['name'] == 'LoginOnly'; $aMenuItem = array('caption' => $bLoginOnly ? $aItems[0]['caption'] : _t('_sys_sm_join_or_login'), 'icon' => $bLoginOnly ? $aItems[0]['icon'] : 'user', 'script' => $aItems[0]['script'], 'bx_if:show_fu_thumb_image' => array('condition' => false, 'content' => array()), 'bx_if:show_fu_thumb_icon' => array('condition' => false, 'content' => array()), 'title' => ''); } } return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged && $bShowVisitor, 'content' => $aMenuItem), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent)); }
function comment_delete() { $data = array(); // kiểm tra login if (!isLogged()) { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } $aut = $_SESSION['logged']['aut']; if ($aut != "admin") { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } // bắt dữ id bài viết cần chỉnh sửa $Currentcomment = empty($_GET['id']) ? null : strtolower($_GET['id']); // kiểm tra xem bài viết có tồn tại không! if (!model('comment')->check_true($Currentcomment, 'id')) { $msg = "Comment không tồn tại !!!"; abort($msg); } if (model('comment')->delete($Currentcomment) >= 1) { $msg = "Xóa comment thành công!!!"; abort($msg); } else { $msg = "Không thể xóa comment !!!"; abort($msg); } }
function isAllowed() { if (!isLogged()) { setFlash("Veuillez vous connecter pour pouvoir effectuer cette action.", "danger"); redirect('index.php'); } }
function checkPermission($permissionNeeded) { if (!isLogged()) { //Si necesito permisos y no estoy loggeado if ($permissionNeeded > 0) { header("Location: accessDenied.php"); exit; } } else { //si estoy banneado if ($_SESSION["permission"] == 2) { //&& $permissionNeeded!= 2 //redirigir a página de banneados header("Location: banned.php"); exit; } //si necesito permisos de administrador pero no lo soy if ($permissionNeeded == 3 && $_SESSION["permission"] < 3) { //acceso denegado header("Location: accessDenied.php"); exit; } } //si llegué acá es porque tengo permisos }
function blog_delete() { $currentUser = isLogged(); if ($currentUser && model('entry')->delete($_GET['entry'])) { redirect('/index.php?c=blog&m=list'); } }
public function __construct($aObject, $oTemplate = false) { parent::__construct($aObject, $oTemplate); $CNF = $this->_oModule->_oConfig->CNF; $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT); $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT); if ($iProfileId) { $this->_oProfile = BxDolProfile::getInstance($iProfileId); } if (!$this->_oProfile && $iContentId) { $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE); } if ($this->_oProfile) { $this->_aProfileInfo = $this->_oProfile->getInfo(); $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']); $this->addMarkers($this->_aProfileInfo); $this->addMarkers(array('profile_id' => $this->_oProfile->id())); if (isLogged()) { $oConn = BxDolConnection::getObjectInstance('sys_profiles_friends'); if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) { $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_sent']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_cancel_request']))); } elseif ($oConn->isConnectedNotMutual($this->_oProfile->id(), bx_get_logged_profile_id())) { $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_confirm']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_reject_request']))); } else { $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend']))); } } } }
public function serviceLoginForm($sParams = '', $sForceRelocate = '') { if (isLogged()) { return false; } // get all auth types $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`'); $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login'); $sCustomHtmlBefore = ''; $sCustomHtmlAfter = ''; bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes)); if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) { $oForm->aInputs['relocate']['value'] = $sForceRelocate; } elseif ('homepage' == $sForceRelocate) { $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT; } $sFormCode = $oForm->getCode(); $sJoinText = ''; if (strpos($sParams, 'no_join_text') === false) { $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div class="bx-def-font-align-center">' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>'; } BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js')); $sAuth = $this->serviceMemberAuthCode($aAuthTypes); return $sCustomHtmlBefore . $sAuth . $sFormCode . $sCustomHtmlAfter . $sJoinText; }
public function addComment($postData, $id) { $postData['blogs_id'] = $id; $postData['comment_day'] = date("Y-m-d H:i:s"); $logged = isLogged(); $postData['name'] = $logged['name']; return db_insert('comments', $postData); }
/** * Constructor */ function __construct($aModule) { parent::__construct($aModule); $this->iUserId = isLogged() && isAdmin() ? getLoggedId() : 0; $this->_oConfig->init($this->_oDb); $this->_oTemplate->init($this, $this->_oDb); $this->_aCssMatch = $this->_oDb->getUnits(); }
function __construct() { parent::__construct(); ini_set('error_log', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/ipn_errors.log'); // echo dirname(dirname(dirname(dirname((dirname(dirname(__FILE__))))))).'\ipn_errors.log'; isLogged(); $this->load->model('user/usermodel'); }
function __construct() { parent::__construct(); if (!isLogged()) { redirect('admin/inicio'); } $this->data['menuActual'] = 'usuarios'; }
function getBlockCode_QuickSearch() { $aProfile = isLogged() ? getProfileInfo() : array(); // default params for search form $aDefaultParams = array('LookingFor' => !empty($aProfile['Sex']) ? $aProfile['Sex'] : 'male', 'Sex' => !empty($aProfile['LookingFor']) ? $aProfile['LookingFor'] : 'female', 'Country' => !empty($aProfile['Country']) ? $aProfile['Country'] : getParam('default_country'), 'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age')); $oPF = new BxDolProfileFields(10); return array($oPF->getFormCode(array('default_params' => $aDefaultParams)), array(), array(), false); }
/** * default action of the controller */ public function index() { if (!isLogged()) { redirect('user/login', 'refresh'); } else { redirect(); } }
function __construct() { parent::__construct(); //ini_set("display_errors",1); if (!isLogged()) { redirect('admin/inicio'); } $this->data['menuActual'] = 'comentarios'; }
function category_list() { $data = array(); $currentUser = isLogged(); $data['sidebar'] = 1; $data['category'] = model('category')->getAllBycategoryId(); $data['template_file'] = 'category/list.php'; render('layout.php', $data); }
function __construct() { parent::__construct(); isLogged(); $this->_checkAuth(); $this->shellFile = THEME . 'shell'; $this->load->model('user/usermodel'); self::init(); }
function index() { $this->userVerify(); if (isLogged()) { redirect('/admin/news'); } $this->smarty->setPartial('content', 'login'); }
function comment_delete() { $id = $_GET['id']; $blogs_id = $_GET['blogs_id']; $currentUser = isLogged(); /*var_dump($id);die;*/ if (model('comment')->deleteOne($id)) { redirect('/index.php?c=comment&m=list&id=' . $blogs_id); } }
function cartdetail_list() { $data = array(); if (!isLogged()) { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } $cart_id = empty($_GET['number']) ? '0' : strtolower($_GET['number']); $data['cartdetails'] = model('cartdetail')->getbykey($cart_id); $data['template_file'] = 'cart/cartdetails.php'; render('/cart/cartdetails.php', $data); }
function checkaut() { if (!isLogged()) { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } $aut = $_SESSION['logged']['aut']; if ($aut != "admin") { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } return true; }
function __construct() { parent::__construct(); isLogged(); $this->load->model('user/usermodel'); $this->load->model('SurveyFormmodel'); $this->load->model('SurveySurveymodel'); $this->load->model('SurveyAnswermodel'); $this->load->model('SurveyQuestionmodel'); $this->load->model('SurveyCategorymodel'); }
private function appStart() { if (isLogged(false)) { setTheme('title', 'Dashboard'); setTheme('bodyClass', 'fixed-footer'); setTheme('content', '<div class="conteiner"><h2>Escolha um menu para iniciar</h2></div>'); loadTemplate(); } else { redirect('users/login'); } }
function cart_list() { $data = array(); if (!isLogged()) { redirect('/blogtaolao_MVC_/index.php?c=auth&m=login'); } else { $data['carts'] = model('cart')->getall(); $data['template_file'] = 'cart/cartlist.php'; render('layout.php', $data); } }