本文整理汇总了PHP中pnSecAuthAction函数的典型用法代码示例。如果您正苦于以下问题:PHP pnSecAuthAction函数的具体用法?PHP pnSecAuthAction怎么用?PHP pnSecAuthAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnSecAuthAction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: blocks_rss2_block
function blocks_rss2_block($row)
{
if (!pnSecAuthAction(0, 'RSSblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
advheadlines2($row);
}
示例2: blocks_search_block
function blocks_search_block($row)
{
if (!pnSecAuthAction(0, 'Searchblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
$vars = getVarsFrom_search_Content($row);
$content = "<form method=\"post\" action=\"modules.php\">" . "<input type=\"hidden\" name=\"op\" value=\"modload\">" . "<input type=\"hidden\" name=\"name\" value=\"Search\">" . "<input type=\"hidden\" name=\"file\" value=\"index\">" . "<input type=\"hidden\" name=\"action\" value=\"search\">" . "<input type=\"hidden\" name=\"overview\" value=\"1\">";
$content .= "<br><center><input type=\"text\" name=\"q\" size=\"14\">";
if (isset($vars[_SEARCH_DISPLAY_BTN])) {
$content .= ' <input type="submit" value="' . _SEARCH . '">';
}
$content .= '</center>';
// list of vars that don't need to be saved
$avdsearch_reserved_vars = array(_SEARCH_DISPLAY_BTN, 'authid', 'bid', 'title', 'position', 'language', 'refresh');
foreach ($vars as $key => $value) {
if (in_array($key, $avdsearch_reserved_vars)) {
continue;
}
if (is_array($value)) {
foreach ($value as $val) {
$content .= "<input type=\"hidden\" name=\"{$key}\" value=\"{$val}\">\n";
}
} else {
$content .= "<input type=\"hidden\" name=\"{$key}\" value=\"{$value}\">\n";
}
}
$content .= "</form>";
if (empty($row['title'])) {
$row['title'] = _SEARCH;
}
$row['content'] = $content;
return themesideblock($row);
}
示例3: blocks_related_block
function blocks_related_block($row)
{
global $sid, $story;
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
if (!pnSecAuthAction(0, 'Relatedblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
if ($story['topic']) {
$row['content'] = '<font class="pn-normal">';
$column =& $pntable['stories_column'];
$sql = "SELECT {$column['sid']} as sid, {$column['title']} as title FROM {$pntable['stories']} WHERE {$column['topic']}=" . pnVarPrepForStore($story['topic']) . " ORDER BY {$column['counter']} DESC";
$result = $dbconn->SelectLimit($sql, 1);
$mrow = $result->GetRowAssoc(false);
$result->MoveNext();
$column =& $pntable['related_column'];
$result = $dbconn->Execute("SELECT {$column['name']} as name, {$column['url']} as url FROM {$pntable['related']} WHERE {$column['tid']}=" . pnVarPrepForStore($story['topic']) . "");
while (!$result->EOF) {
$lrow = $result->GetRowAssoc(false);
$result->MoveNext();
$row['content'] .= "<strong><big>·</big></strong> <a href=\"{$lrow['url']}\" target=\"_blank\">" . pnVarPrepForDisplay($lrow['name']) . "</a><br>\n";
}
$row['content'] .= "<strong><big>·</big></strong> <a href=\"advtopics.php?topic={$story['topic']}\">" . _MOREABOUT . " " . pnVarPrepForDisplay($story['topicname']) . "</a><br>\n" . "<strong><big>·</big></strong> <a class=\"pn-normal\" href=\"modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1&stories_author={$story['aid']}\">" . _NEWSBY . " " . pnVarPrepForDisplay($story['aid']) . "</a><br>\n" . '</font><br><hr noshade width="95%" size="1"><b>' . _MOSTREAD . " " . pnVarPrepForDisplay($story['topicname']) . ":</b><br>\n" . "<center><a href=\"advarticle.php?sid={$mrow['sid']}\">" . pnVarPrepForDisplay($mrow['title']) . "</a></center><br><br>\n" . '<div align="right">' . "<a href=\"print.php?sid={$mrow['sid']}\"><img src=\"images/global/print.gif\" border=\"0\" alt=\"" . _PRINTER . "\"></a> " . "<a class=\"pn-normal\" href=\"modules.php?op=modload&name=Recommend_Us&file=index&req=FriendSend&sid={$sid}\"><img src=\"images/global/friend.gif\" border=\"0\" Alt=\"" . _FRIEND . "\"></a>\n" . '</div>';
return themesideblock($row);
}
}
示例4: smarty_function_exampleadminlinks
/**
* Smarty function to display admin links for the example module
* based on the user's permissions
*
* Example
* <!--[exampleadminlinks start="[" end="]" seperator="|" class="pn-menuitem-title"]-->
*
* @author Andreas Krapohl
* @since 10/01/04
* @see function.exampleadminlinks.php::smarty_function_exampleadminlinks()
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @param string $start start string
* @param string $end end string
* @param string $seperator link seperator
* @param string $class CSS class
* @return string the results of the module function
*/
function smarty_function_exampleadminlinks($params, &$smarty)
{
extract($params);
unset($params);
// set some defaults
if (!isset($start)) {
$start = '[';
}
if (!isset($end)) {
$end = ']';
}
if (!isset($seperator)) {
$seperator = '|';
}
if (!isset($class)) {
$class = 'pn-menuitem-title';
}
$adminlinks = "<span class=\"{$class}\">{$start} ";
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_READ)) {
$adminlinks .= "<a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'view')) . "\">" . _VIEW . "</a> ";
}
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_ADD)) {
$adminlinks .= "{$seperator} <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'new')) . "\">" . _NEW . "</a> ";
}
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_ADMIN)) {
$adminlinks .= "{$seperator} <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'modifyconfig')) . "\">" . _MODIFYCONFIG . "</a> ";
}
$adminlinks .= "{$end}</span>\n";
return $adminlinks;
}
示例5: blocks_html_block
function blocks_html_block($row)
{
if (!pnSecAuthAction(0, 'HTMLblock::', "{$row['title']}::", ACCESS_OVERVIEW)) {
return;
}
return themesideblock($row);
}
示例6: SERVICE_CMSOPEN_postnuke
function SERVICE_CMSOPEN_postnuke($authenticate_only)
{
global $phpnuke, $default_access, $web_root, $root_dir, $cms_user_access, $cms_type, $include_path;
if (!defined("LOADED_AS_MODULE") and $phpnuke == "false") {
die("You can't access this file directly...<br><br>Generally this means that Jinzora was " . "installed as a PostNuke module and you're trying to access it outside of PostNuke");
}
if (function_exists('pnSecAuthAction')) {
if (!pnSecAuthAction(0, 'Jinzora::', "::", ACCESS_READ)) {
include 'header.php';
die('Access Denied');
include 'footer.php';
}
}
// Now let's get the users name IF we need it
if (pnUserGetVar('uname') != "") {
$username = pnUserGetVar('uname');
} else {
$username = "anonymous";
}
// Ok, now let's authenticate this user
userAuthenticate($username);
// Now let's see if we only wanted the user access
if ($authenticate_only == true) {
return;
}
include_once "header.php";
// Now let's open the table
OpenTable();
}
示例7: blocks_ephem_block
function blocks_ephem_block($row)
{
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$currentlang = pnUserGetLang();
if (!pnSecAuthAction(0, 'Ephemeridsblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
if (pnConfigGetVar('multilingual') == 1) {
$column =& $pntable['ephem_column'];
$querylang = "AND ({$column['elanguage']}='" . pnVarPrepForStore($currentlang) . "' OR {$column['elanguage']}='')";
} else {
$querylang = "";
}
$today = getdate();
$eday = $today['mday'];
$emonth = $today['mon'];
$column =& $pntable['ephem_column'];
$result = $dbconn->Execute("SELECT {$column['yid']}, {$column['content']}\n FROM {$pntable['ephem']}\n WHERE {$column['did']}='" . pnVarPrepForStore($eday) . "' AND {$column['mid']}='" . pnVarPrepForStore($emonth) . "' {$querylang}");
$boxstuff = '<span class="pn-normal"><b>' . _ONEDAY . '</b></span><br />';
while (list($yid, $content) = $result->fields) {
$result->MoveNext();
$boxstuff .= '<br /><br />';
$boxstuff .= '<b>' . pnVarPrepForDisplay($yid) . '</b><br />' . pnVarPrepHTMLDisplay(nl2br($content)) . '';
}
if (empty($row['title'])) {
$row['title'] = _EPHEMERIDS;
}
$row['content'] = $boxstuff;
return themesideblock($row);
}
示例8: blocks_rss_block
function blocks_rss_block($row)
{
if (!pnSecAuthAction(0, 'RSSblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
$row = blocks_rss_refresh($row);
blocks_rss_display($row);
}
示例9: blocks_thelang_block
function blocks_thelang_block($row)
{
$currentlang = pnUserGetLang();
if (!pnSecAuthAction(0, 'Languageblock::', "{$row['title']}::", ACCESS_OVERVIEW)) {
return;
}
if (!pnConfigGetVar('multilingual')) {
return;
}
$currentURL = $_SERVER['REQUEST_URI'];
if ($currentURL === "") {
$currentURL = "index.php";
}
$pattern = '/\\?newlang=.../';
$currentURL = preg_replace($pattern, '', $currentURL);
$pattern = '/\\&newlang=.../';
$currentURL = pnVarPrepForDisplay(preg_replace($pattern, '', $currentURL));
$append = "&";
if (strpos($currentURL, '?') === false) {
$append = "?";
}
$lang = languagelist();
$handle = opendir('language');
while ($f = readdir($handle)) {
if (is_dir("language/{$f}") && !empty($lang[$f])) {
$langlist[$f] = $lang[$f];
$sel_lang[$f] = '';
}
}
asort($langlist);
$content = '<center><font class="pn-normal">' . _SELECTGUILANG . '</font><br><br>';
if (pnConfigGetVar('useflags')) {
$i = 1;
foreach ($langlist as $k => $v) {
if ($i > 3) {
$content .= "<br>\n";
$i = 1;
}
$imgsize = @getimagesize("images/flags/flag-{$k}.png");
$content .= "<a href=\"{$currentURL}" . $append . "newlang={$k}\"><img src=\"images/flags/flag-{$k}.png\" border=\"0\" alt=\"{$lang[$k]}\" hspace=\"3\" vspace=\"3\" {$imgsize['3']}></a>";
$i++;
}
$content .= '</center>';
} else {
$content .= '<form method="post" action="index.php"><select class="pn-text" name="newlanguage" onChange="top.location.href=this.options[this.selectedIndex].value">';
$sel_lang[$currentlang] = ' selected';
foreach ($langlist as $k => $v) {
$content .= "<option value=\"{$currentURL}" . $append . "newlang={$k}\"{$sel_lang[$k]}>{$v}</option>\n";
}
$content .= '</select></form></center>';
}
if (empty($row['title'])) {
$row['title'] = _SELECTLANGUAGE;
}
$row['content'] = $content;
return themesideblock($row);
}
示例10: blocks_topic_block
function blocks_topic_block($row)
{
//global $topic, $catid;
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$currentlang = pnUserGetLang();
if (!pnSecAuthAction(0, 'Topicblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
$language = pnConfigGetVar('language');
$topic = "";
$catid = "";
if (pnConfigGetVar('multilingual') == 1) {
$column =& $pntable['stories_column'];
$querylang = "AND ({$column['alanguage']}='{$currentlang}' OR {$column['alanguage']}='')";
/* the OR is needed to display stories who are posted to ALL languages */
} else {
$querylang = '';
}
$column =& $pntable['topics_column'];
$result = $dbconn->Execute("SELECT {$column['topicid']} AS topicid, {$column['topicname']} as topicname FROM {$pntable['topics']} ORDER BY topicname");
if ($result->EOF) {
return;
} else {
$boxstuff = '<span class="pn-normal">';
if ($topic == "") {
$boxstuff .= "<strong><big>·</big></strong> <b><a href=\"modules.php?op=modload&name=Topics&file=index\">" . _ALL_TOPICS . "</a></b><br>";
} else {
$boxstuff .= "<strong><big>·</big></strong> <a href=\"modules.php?op=modload&name=News&file=index&catid={$catid}\">" . _ALL_TOPICS . "</a><br>";
}
while (!$result->EOF) {
$srow = $result->GetRowAssoc(false);
$result->MoveNext();
if (pnSecAuthAction(0, 'Topics::Topic', "{$srow['topicname']}::{$srow['topicid']}", ACCESS_READ)) {
$column =& $pntable['stories_column'];
$result2 = $dbconn->Execute("SELECT {$column['time']} AS unixtime FROM {$pntable['stories']} WHERE {$column['topic']}={$srow['topicid']} {$querylang} ORDER BY {$column['time']} DESC");
if (!$result2->EOF) {
$story = $result2->GetRowAssoc(false);
$story['unixtime'] = $result2->UnixTimeStamp($story['unixtime']);
$sdate = ml_ftime(_DATEBRIEF, $story['unixtime']);
if ($topic == $srow['topicid']) {
$boxstuff .= "<strong><big>·</big></strong> <span class=\"pn-title\"><b>{$srow['topicname']}</b></span> <span class=\"pn-sub\">({$sdate})</span><br>";
} else {
$boxstuff .= "<strong><big>·</big></strong> <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid={$catid}&topic={$srow['topicid']}\">{$srow['topicname']}</a> <span class=\"pn-sub\">({$sdate})</span><br>";
}
}
}
}
}
$boxstuff .= '</span>';
if (empty($row['title'])) {
$row['title'] = _TOPICS;
}
$row['content'] = $boxstuff;
return themesideblock($row);
}
示例11: blocks_login_block
function blocks_login_block($row)
{
global $HTTP_SERVER_VARS;
if (empty($row['title'])) {
$row['title'] = 'Login';
}
if (!pnSecAuthAction(0, 'Loginblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
// code taken pnGetBaseURI to fix issue with IIS not passing request_uri
// markwest
// Start of with REQUEST_URI
if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) {
$path = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
$path = getenv('REQUEST_URI');
}
if (empty($path) || substr($path, -1, 1) == '/') {
// REQUEST_URI was empty or pointed to a path
// Try looking at PATH_INFO
$path = getenv('PATH_INFO');
if (empty($path)) {
// No luck there either
// Try SCRIPT_NAME
if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
$path = $HTTP_SERVER_VARS['SCRIPT_NAME'];
} else {
$path = getenv('SCRIPT_NAME');
}
}
}
if (!pnUserLoggedIn()) {
// prettified a little with a table for inputs and button to avoid bugs like #493456 (Andy Varganov)
$boxstuff = '<form action="user.php" method="post">';
$boxstuff .= '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td>';
$boxstuff .= '<span class="pn-normal"> ' . _BLOCKNICKNAME . '</span></td></tr><tr><td>';
$boxstuff .= '<input type="text" name="uname" size="14" maxlength="25"></td></tr><tr><td>';
$boxstuff .= '<span class="pn-normal"> ' . _BLOCKPASSWORD . '</span></td></tr><tr><td>';
$boxstuff .= '<input type="password" name="pass" size="14" maxlength="20"></td></tr><tr><td>';
if (pnConfigGetVar('seclevel') != 'High') {
$boxstuff .= '<input type="checkbox" value="1" name="rememberme" />';
$boxstuff .= '<span class="pn-normal"> ' . _REMEMBERME . '</span></td></tr><tr><td>';
}
$boxstuff .= '<br>';
$boxstuff .= '<input type="hidden" name="module" value="NS-User" />';
$boxstuff .= '<input type="hidden" name="op" value="login" />';
$boxstuff .= '<input type="hidden" name="url" value="' . pnVarPrepForDisplay($path) . '" />';
$boxstuff .= '<input type="submit" value="' . _LOGIN . '" /></td></tr><tr><td>';
$boxstuff .= '<br /><span class="pn-normal">' . _ASREGISTERED . '</span></td></tr><tr><td></table></form>';
if (empty($row['title'])) {
$row['title'] = _LOGIN;
}
$row['content'] = $boxstuff;
return themesideblock($row);
}
}
示例12: search_comments_opt
function search_comments_opt()
{
global $bgcolor2, $textcolor1, $info;
$output = new pnHTML();
$output->SetInputMode(_PNH_VERBATIMINPUT);
if (pnSecAuthAction(0, 'Stories::', "::", ACCESS_READ)) {
$output->Text("<table border=\"0\" width=\"100%\"><tr bgcolor=\"{$bgcolor2}\"><td><font class=\"pn-normal\" style=\"text-color:{$textcolor1}\"><input type=\"checkbox\" name=\"active_comments\" id=\"active_comments\" value=\"1\" checked> " . _SEARCH_COMMENTS . "</font></td></tr></table>");
}
return $output->GetOutput();
}
示例13: admin_menu
function admin_menu($help_file = '')
{
$pntable = pnDBGetTables();
list($newsubs) = db_select_one_row("SELECT count(*) FROM {$pntable['queue']}");
if (!pnSecAuthAction(0, "::", '::', ACCESS_EDIT)) {
// suppress admin display - return to index.
pnRedirect('index.php');
} else {
menu_title('admin.php', _ADMINMENU);
menu_graphic(pnConfigGetVar('admingraphic'));
if ($help_file != '') {
menu_help($help_file, _ONLINEMANUAL);
}
$mods = pnModGetAdminMods();
if ($mods == false) {
// there aren't admin modules
return;
}
foreach ($mods as $mod) {
// Hack until the new news module comes into being
// TODO - remove this at appropriate time
if ($mod['name'] == 'AddStory') {
$mod['name'] = 'Stories';
}
if (pnSecAuthAction(0, "{$mod['name']}::", '::', ACCESS_EDIT)) {
if (file_exists("modules/" . pnVarPrepForOS($mod['directory']) . "/pnadmin.php")) {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/pnimages/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option(pnVarPrepForDisplay(pnModURL($mod['name'], 'admin')), $mod['displayname'], $imgfile);
} else {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/images/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option("admin.php?module={$mod['directory']}&op=main", $mod['displayname'], $imgfile);
}
}
}
}
}
示例14: Tools_admin_main
function Tools_admin_main()
{
// Permission check.
if (!pnSecAuthAction(0, 'Tools::', '::', ACCESS_ADMIN)) {
return pnVarPrepHTMLDisplay(_MODNOAUTH);
}
// Create a new output object.
$pnRender =& new pnRender('Tools');
// Return template.
return $pnRender->fetch('tools_admin.htm');
}
示例15: blocks_php_block
function blocks_php_block($row)
{
if (!pnSecAuthAction(0, 'PHPblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
ob_start();
print eval($row['content']);
$row['content'] = ob_get_contents();
ob_end_clean();
return themesideblock($row);
}