本文整理汇总了PHP中isAdmin函数的典型用法代码示例。如果您正苦于以下问题:PHP isAdmin函数的具体用法?PHP isAdmin怎么用?PHP isAdmin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isAdmin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
public function find()
{
if (!$this->uri->segment(3)) {
show_404(current_url(), FALSE);
} else {
if ($this->data['Treasure'] = $this->treasure_model->get_by('md5', $this->uri->segment(3))) {
if (isFound($this->data['Treasure']->id, $this->session->userdata('id'))) {
$found = TRUE;
} else {
$found = FALSE;
if (isLoggedIn()) {
if (!isBanned($this->session->userdata('id'))) {
if (!isAdmin()) {
$this->mytreasure_model->insert(array('pirate' => $this->session->userdata('id'), 'treasure' => $this->data['Treasure']->id, 'time' => time()));
}
}
}
}
$this->data['found'] = $found;
$this->template->write_view('content', 'views/treasure/find', $this->data);
$this->template->render();
} else {
show_404(current_url(), FALSE);
}
}
}
示例2: actionAdministration
/**
* Function will generate facebook's admin page;
*
* @return : (text) - html presentation data;
*/
function actionAdministration()
{
$GLOBALS['iAdminPage'] = 1;
if (!isAdmin()) {
header('location: ' . BX_DOL_URL_ROOT);
}
// get sys_option's category id;
$iCatId = $this->_oDb->getSettingsCategoryId('bx_facebook_connect_api_key');
if (!$iCatId) {
$sOptions = MsgBox(_t('_Empty'));
} else {
bx_import('BxDolAdminSettings');
$oSettings = new BxDolAdminSettings($iCatId);
$mixedResult = '';
if (isset($_POST['save']) && isset($_POST['cat'])) {
$mixedResult = $oSettings->saveChanges($_POST);
}
// get option's form;
$sOptions = $oSettings->getForm();
if ($mixedResult !== true && !empty($mixedResult)) {
$sOptions = $mixedResult . $sOptions;
}
}
$sCssStyles = $this->_oTemplate->addCss('forms_adv.css', true);
$this->_oTemplate->pageCodeAdminStart();
echo DesignBoxAdmin(_t('_bx_facebook_information'), $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => _t('_bx_facebook_information_block', BX_DOL_URL_ROOT))));
echo DesignBoxAdmin(_t('_Settings'), $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => $sCssStyles . $sOptions)));
$this->_oTemplate->pageCodeAdmin(_t('_bx_facebook_settings'));
}
示例3: _actionAdministration
/**
* Generate admin page;
*
* @return : (text) - html presentation data;
*/
function _actionAdministration($sOptionApiKey, $sLangSettingsTitle, $sLangInfoTitle = '', $sLangInfoText = '')
{
$GLOBALS['iAdminPage'] = 1;
if (!isAdmin()) {
$this->_redirect(BX_DOL_URL_ROOT);
}
// get sys_option's category id;
$iCatId = $this->_oDb->getSettingsCategoryId($sOptionApiKey);
if (!$iCatId) {
$sOptions = MsgBox(_t('_Empty'));
} else {
bx_import('BxDolAdminSettings');
$oSettings = new BxDolAdminSettings($iCatId);
$mixedResult = '';
if (isset($_POST['save']) && isset($_POST['cat'])) {
$mixedResult = $oSettings->saveChanges($_POST);
}
$sOptions = $oSettings->getForm();
if ($mixedResult !== true && !empty($mixedResult)) {
$sOptions = $mixedResult . $sOptions;
}
}
$sCssStyles = $this->_oTemplate->addCss('forms_adv.css', true);
$this->_oTemplate->pageCodeAdminStart();
if ($sLangInfoText) {
echo DesignBoxAdmin(_t($sLangInfoTitle), $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => _t($sLangInfoText, BX_DOL_URL_ROOT))));
}
echo DesignBoxAdmin(_t('_Settings'), $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => $sCssStyles . $sOptions)));
$this->_oTemplate->pageCodeAdmin(_t($sLangSettingsTitle));
}
示例4: getNavItem
function getNavItem($key, $label)
{
$query =& Dataface_Application::getInstance()->getQuery();
if (!isAdmin()) {
switch ($key) {
case 'help':
return array('href' => DATAFACE_SITE_HREF . '?-action=help', 'label' => $label, 'selected' => $query['-action'] == 'help');
// non-admin users can see these
throw new Exception("Use default rendering");
}
// Non-admin users can't see any other table.
return null;
} else {
//Admin users can see everything..
switch ($key) {
case 'help':
// reports is not a table so we need to return custom properties.
return array('href' => DATAFACE_SITE_HREF . '?-action=help', 'label' => $label, 'selected' => $query['-action'] == 'help');
}
// For other actions we need to make sure that they aren't selected
// if the current action is reports because we want the 'reports'
// tab to be selected only in that case.
return array('selected' => $query['-table'] == $key and $query['-action'] != 'help');
}
}
示例5: serviceGetBlockFormInvite
public function serviceGetBlockFormInvite()
{
$iProfileId = $this->getProfileId();
$iAccountId = $this->getAccountId($iProfileId);
$mixedAllowed = $this->isAllowedInvite($iProfileId);
if ($mixedAllowed !== true) {
return array('content' => MsgBox($mixedAllowed));
}
$mixedInvites = false;
if (!isAdmin($iAccountId)) {
$iInvited = (int) $this->_oDb->getInvites(array('type' => 'count_by_account', 'value' => $iAccountId));
$mixedInvites = $this->_oConfig->getCountPerUser() - $iInvited;
if ($mixedInvites <= 0) {
return array('content' => MsgBox(_t('_bx_invites_err_limit_reached')));
}
}
$oForm = $this->getFormObjectInvite();
$oForm->aInputs['text']['value'] = _t('_bx_invites_msg_invitation');
$sResult = '';
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$sEmails = bx_process_input($oForm->getCleanValue('emails'));
$sText = bx_process_pass($oForm->getCleanValue('text'));
$mixedResult = $this->invite(BX_INV_TYPE_FROM_MEMBER, $sEmails, $sText, $mixedInvites, $oForm);
if ($mixedResult !== false) {
$sResult = _t('_bx_invites_msg_invitation_sent', (int) $mixedResult);
} else {
$sResult = _t('_bx_invites_err_not_available');
}
$sResult = MsgBox($sResult);
}
return array('content' => $sResult . $oForm->getCode());
}
示例6: isRemoveAllowed
public function isRemoveAllowed($aCmt, $isPerformAction = false)
{
if (isAdmin()) {
return true;
}
return false;
}
示例7: requireAdmin
function requireAdmin() {
global $service, $session;
if (isAdmin()) return true;
if (empty($session['id']) || !isLoggedIn()) requireLogin();
func::printError(_t('이 페이지에 접근할 권한이 없습니다.'));
requireLogin();
}
示例8: checkAdmin
function checkAdmin()
{
if (!isAdmin()) {
header('Location: login.php?msg=notAdmin');
exit;
}
}
示例9: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights to set initial metadata"));
return true;
}
if (empty($args))
{
$stdout = "Usage: maddinit [class name] [metadata name] [value]\n";
$stdout .= "Example: maddinit file_folder view thumbnail";
}
else
{
list($class_name, $name, $value) = splitArgs($args);
$return = setInitialMetadata($class_name, $name, $value);
if ($return === true)
$stdout = "Updated metadata successfully";
else
$stderr = $return;
}
return true;
}
示例10: login
function login()
{
$data = array('logged' => $this->auth->logged(), 'page_title' => 'Login', 'titulo' => 'Efetuar login');
if ($this->validation->run()) {
$dados = array('email' => $this->input->post('email'), 'senha' => md5($this->input->post('senha')));
$dados = $this->input->xss_clean($dados);
if ($this->user->loginUser($dados)) {
$user = $this->user->getUserDataByEmail($dados['email']);
$session_data = array('email' => $user['email'], 'logado' => true, 'nome' => $user['nome'], 'ativo' => $user['status']);
$this->session->set_userdata($session_data);
if (isAdmin()) {
if ($user['controle'] == 'first_login') {
$this->messages->add('Verificamos que esta é a primeira vez que está acessando o sistema, você precisa trocar a senha neste momento.', 'warning');
// Atualiza o controle de promeiro acesso
$dados = array('controle' => "");
$this->user->updateUser($dados);
redirect('profile');
die;
} else {
redirect('admin');
die;
}
} else {
redirect(getLastUri());
die;
}
}
$this->messages->add("Usuário ou senha inválida!");
}
$this->load->view('inicio', $data);
return false;
}
示例11: Profile
function Profile()
{
parent::Controller();
$this->load->library('validation');
$this->load->library('session');
$this->load->model('user');
$this->auth->verificaLogin();
/*-------------validações------------*/
$rules['nome'] = "trim|required|xss_clean";
if (!isAdmin()) {
$rules['telefone'] = "trim|required|xss_clean";
}
$requerido = $this->pass_check($this->input->post('senha2'));
$rules['senha'] = "trim" . $requerido . "|callback_senha_check";
$requerido = $this->pass_check($this->input->post('senha'));
$rules['senha2'] = "trim|matches[senha3]" . $requerido;
$rules['senha3'] = "trim|" . $requerido;
$this->validation->set_rules($rules);
$fields['nome'] = 'Nome';
$fields['telefone'] = 'Telefone';
$fields['senha'] = 'Senha antiga';
$fields['senha2'] = 'Nova senha';
$fields['senha3'] = 'Confirmação da senha';
$this->validation->set_fields($fields);
$this->validation->set_message('required', 'O campo <i>%s</i> não pode ser vazio!');
$this->validation->set_message('senha_check', '%s não confere!');
$this->validation->set_message('valid_email', 'O campo <i>%s</i> não contém um email válido!');
$this->validation->set_message('matches', 'Senhas não conferem!');
$this->validation->set_error_delimiters('<small class="error">', '</small>');
}
示例12: getBlockCode_ActionList
function getBlockCode_ActionList()
{
$sCode = null;
$sMainPrefix = $this->oConfig->getMainPrefix();
bx_import('BxDolSubscription');
$oSubscription = BxDolSubscription::getInstance();
$aButton = $oSubscription->getButton($this->iProfileId, $sMainPrefix, '', (int) $this->aFileInfo['medID']);
bx_import('BxDolAlbums');
$sProfileAlbumUri = BxDolAlbums::getAbumUri($this->oConfig->getGlParam('profile_album_name'), $this->iProfileId);
$aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'approvedCpt' => '', 'approvedAct' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'fileKey' => $this->aFileInfo['Hash'], 'fileExt' => $this->aFileInfo['medExt'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'Tags' => bx_php_string_apos($this->aFileInfo['medTags']), 'TitleAvatar' => $this->aFileInfo['medProfId'] == $this->iProfileId && 'sys_avatar' == getParam('sys_member_info_thumb') ? _t('_' . $sMainPrefix . '_set_as_avatar') : '', 'SetAvatarCpt' => $this->aFileInfo['medProfId'] == $this->iProfileId && $sProfileAlbumUri == $this->aFileInfo['albumUri'] && 'bx_photos_thumb' == getParam('sys_member_info_thumb') ? _t('_' . $sMainPrefix . '_set_as_avatar') : '', 'sbs_' . $sMainPrefix . '_title' => $aButton['title'], 'sbs_' . $sMainPrefix . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'cropCpt' => $this->oModule->isAllowedEdit($this->aFileInfo) && $this->aFileInfo['medProfId'] == $this->iProfileId ? _t('_bx_photos_crop_action') : '');
if (isAdmin($this->iProfileId)) {
$sMsg = $aReplacement['featured'] > 0 ? 'un' : '';
$aReplacement['featuredCpt'] = _t('_' . $sMainPrefix . '_action_' . $sMsg . 'feature');
}
if ($this->oModule->isAllowedApprove($this->aFileInfo)) {
$sMsg = '';
$iAppr = 1;
if ($this->aFileInfo['Approved'] == 'approved') {
$sMsg = 'de';
$iAppr = 0;
}
$aReplacement['approvedCpt'] = _t('_' . $sMainPrefix . '_admin_' . $sMsg . 'activate');
$aReplacement['approvedAct'] = $iAppr;
}
$sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $sMainPrefix);
if (!is_null($sActionsList)) {
$sCode = $oSubscription->getData() . $sActionsList;
}
return $sCode;
}
示例13: popup
function popup()
{
$ou = $_GET["ou"];
$t = $_GET["t"];
$ldap = new clladp();
$tpl = new templates();
$page = CurrentPageName();
if (!is_numeric($t)) {
$t = time();
}
$EnCryptedFunction = $_GET["EnCryptedFunction"];
if (strlen($EnCryptedFunction) > 3) {
$EnCryptedFunction = base64_decode($EnCryptedFunction) . "\n";
} else {
$EnCryptedFunction = null;
}
if ($ou == null) {
if (isAdmin()) {
$OUS = $ldap->hash_get_ou(true);
$FieldOu = Field_array_Hash($OUS, "ou-{$t}", null, null, null, 0, "font-size:18px");
} else {
$FieldOu = Field_hidden("ou-{$t}", $_SESSION["ou"]) . "<span style='font-size:18px'>{$_SESSION["ou"]}</span>";
}
} else {
$FieldOu = Field_hidden("ou-{$t}", $ou) . "<span style='font-size:18px'>{$_SESSION["ou"]}</span>";
}
$html = "\n\t\t\t\n\t<div id='animate-{$t}'></div>\t\t\n\t<table style='width:98%' class=form>\n\t\t<tr>\n\t\t <td class=legend style='font-size:18px'>{domain}:</td>\n\t\t <td>" . Field_text("domain-{$t}", null, "font-size:18px;font-weigth:bold", null, null, null, false, "AddDomainCk{$t}(event)") . "</td>\n\t\t</tr>\n\t\t<td class=legend style='font-size:18px'>{organization}:</td> \t\t\n\t\t <td>{$FieldOu}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'>" . button("{add}", "AddDomain{$t}()", "20px") . "</td>\n\t\t</tr>\n\t</table>\n\t\t\t\t\t\n<script>\nvar x_AddDomain{$t}=function(obj){\n\tdocument.getElementById('animate-{$t}').innerHTML='';\n\tvar text;\n\ttext=obj.responseText;\n\tif(text.length>3){alert(text);return;}\n\t\$('#flexRT{$t}').flexReload();\n\tYahooUserHide();\n\t{$EnCryptedFunction}\n\t\n\t\n}\n\nfunction AddDomainCk{$t}(e){\n\tif(checkEnter(e)){ AddDomain{$t}();}\n}\n\nfunction AddDomain{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('perform','yes');\n\tvar ou=document.getElementById('ou-{$t}').value;\n\tif(ou.length<3){alert('Organization:`'+ou+'` not supported');return;}\n\tXHR.appendData('ou',document.getElementById('ou-{$t}').value);\n\tXHR.appendData('domain',document.getElementById('domain-{$t}').value);\n\tAnimateDiv('animate-{$t}');\n\tXHR.sendAndLoad('{$page}', 'POST',x_AddDomain{$t}); \n}\n</script>\t\t\t\t\t\n";
echo $tpl->_ENGINE_parse_body($html);
}
示例14: ProjectCases
/**
* Constructor
*
* Loads language files and models needed for this controller
*/
function ProjectCases()
{
parent::Controller();
//Check For Admin Logged in
if (!isAdmin()) {
redirect_admin('login');
}
//Get Config Details From Db
$this->config->db_config_fetch();
//Debug Tool
//$this->output->enable_profiler=true;
// loading the lang files
$this->lang->load('admin/common', $this->config->item('language_code'));
$this->lang->load('admin/dispute', $this->config->item('language_code'));
$this->lang->load('admin/validation', $this->config->item('language_code'));
//Load Models Common to all the functions in this controller
$this->load->model('common_model');
$this->load->model('admin_model');
$this->load->model('dispute_model');
$this->load->model('email_model');
$this->load->model('skills_model');
//Load helper files
$this->load->helper('form');
$this->load->helper('projectcases');
$this->load->helper('users');
}
示例15: getMainMenu
function getMainMenu()
{
if (!isAdmin()) {
return '';
}
$sUri = $_SERVER['REQUEST_URI'];
$sPath = parse_url(BX_DOL_URL_ROOT, PHP_URL_PATH);
if ($sPath && $sPath != '/' && 0 == strncmp($sPath, $sUri, strlen($sPath))) {
$sUri = substr($sUri, strlen($sPath) - strlen($sUri));
}
$sUri = BX_DOL_URL_ROOT . $sUri;
$sFile = basename($_SERVER['PHP_SELF']);
$oPermalinks = new BxDolPermalinks();
$aMenu = $GLOBALS['MySQL']->getAll("SELECT `id`, `name`, `title`, `url`, `icon` FROM `sys_menu_admin` WHERE `parent_id`='0' ORDER BY `order`");
$aItems = array();
foreach ($aMenu as $aMenuItem) {
$aMenuItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aMenuItem['url']);
$bActiveCateg = $sFile == 'index.php' && !empty($_GET['cat']) && $_GET['cat'] == $aMenuItem['name'];
$aSubmenu = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_menu_admin` WHERE `parent_id`='" . $aMenuItem['id'] . "' ORDER BY `order`");
$aSubitems = array();
foreach ($aSubmenu as $aSubmenuItem) {
$aSubmenuItem['url'] = $oPermalinks->permalink($aSubmenuItem['url']);
$aSubmenuItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aSubmenuItem['url']);
if (!defined('BX_DOL_ADMIN_INDEX') && $aSubmenuItem['url'] != '' && (strpos($sUri, $aSubmenuItem['url']) !== false || strpos($aSubmenuItem['url'], $sUri) !== false)) {
$bActiveCateg = $bActiveItem = true;
} else {
$bActiveItem = false;
}
$aSubitems[] = BxDolAdminMenu::_getMainMenuSubitem($aSubmenuItem, $bActiveItem);
}
$aItems[] = BxDolAdminMenu::_getMainMenuItem($aMenuItem, $aSubitems, $bActiveCateg);
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('main_menu.html', array('bx_repeat:items' => $aItems));
}