• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_nonce函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_nonce函数的典型用法代码示例。如果您正苦于以下问题:PHP get_nonce函数的具体用法?PHP get_nonce怎么用?PHP get_nonce使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_nonce函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: nonce

function nonce($action = null)
{
    echo get_nonce($action);
}
开发者ID:asalce,项目名称:wp-ci,代码行数:4,代码来源:wpci_helper.php


示例2: htmlentities

echo $i18n['ADD_COMPONENT'];
?>
</a>
		<div class="clear"></div>
	</div>
	
	<form class="manyinputs" action="<?php 
echo htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES);
?>
" method="post" accept-charset="utf-8" >
		<input type="hidden" id="id" value="<?php 
echo @$count;
?>
" />
		<input type="hidden" id="nonce" name="nonce" value="<?php 
echo get_nonce("modify_components");
?>
" />
		<p><input type="submit" class="submit" name="submitted" id="button" value="<?php 
echo $i18n['SAVE_COMPONENTS'];
?>
" /> &nbsp;&nbsp;<?php 
echo $i18n['OR'];
?>
&nbsp;&nbsp; <a class="cancel" href="theme.php"><?php 
echo $i18n['CANCEL'];
?>
</a></p>

		<div id="divTxt"></div> 
		<?php 
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:components.php


示例3: exec_action

			<div class="edit-nav clearfix" >
				<?php 
exec_action(get_filename_id() . '-edit-nav');
?>
			</div>		
			<?php 
exec_action(get_filename_id() . '-body');
?>
			
			<!-- user form -->
			<form class="largeform" action="<?php 
myself();
?>
" method="post" accept-charset="utf-8" >
			<input id="nonce" name="nonce" type="hidden" value="<?php 
echo get_nonce("save_profile");
?>
" />
			<?php 
if ($adding === true) {
    ?>
 <input id="add" name="add" type="hidden" value="1" /> <?php 
}
?>
		
			<div class="leftsec">
				<p><label for="user" ><?php 
i18n('LABEL_USERNAME');
?>
:</label><input class="text" id="user" name="user" type="text" <?php 
echo $adding === true ? '' : 'readonly';
开发者ID:CodeCharming,项目名称:GetSimpleCMS,代码行数:31,代码来源:profile.php


示例4: get_pages_menu_content

function get_pages_menu_content($parent, $menu, $level)
{
    global $pagesSorted;
    $items = array();
    foreach ($pagesSorted as $page) {
        $items[(string) $page['url']] = $page;
    }
    if (count($items) > 0) {
        foreach ($items as $page) {
            $dash = "";
            if ($page['parent'] != '') {
                $parentdata = getXML(GSDATAPAGESPATH . $page['parent'] . '.xml');
                $parentTitle = $parentdata->parent;
                $dash = "<b>" . $parentTitle . "</b>:" . $page['parent'] . " ";
            }
            $menu .= '<tr id="tr-' . $page['url'] . '" >';
            if ($page['title'] == '') {
                $page['title'] = '[No Title] &nbsp;&raquo;&nbsp; <em>' . $page['url'] . '</em>';
            }
            if ($page['menuStatus'] != '') {
                $page['menuStatus'] = ' <sup>[' . i18n_r('MENUITEM_SUBTITLE') . ']</sup>';
            } else {
                $page['menuStatus'] = '';
            }
            if ($page['private'] != '') {
                $page['private'] = ' <sup>[' . i18n_r('PRIVATE_SUBTITLE') . ']</sup>';
            } else {
                $page['private'] = '';
            }
            if ($page['url'] == 'index') {
                $homepage = ' <sup>[' . i18n_r('HOMEPAGE_SUBTITLE') . ']</sup>';
            } else {
                $homepage = '';
            }
            $menu .= '<td class="pagetitle">' . $dash . '<a title="' . i18n_r('EDITPAGE_TITLE') . ': ' . cl($page['title']) . '" href="cedit.php?id=' . $page['url'] . '" >' . cl($page['title']) . '</a><span class="showstatus toggle" >' . $homepage . $page['menuStatus'] . $page['private'] . '</span></td>';
            $menu .= '<td style="width:80px;text-align:right;" ><span>' . shtDate($page['pubDate']) . '</span></td>';
            $menu .= '<td class="secondarylink" >';
            $menu .= '<a title="' . i18n_r('VIEWPAGE_TITLE') . ': ' . cl($page['title']) . '" target="_blank" href="' . find_url($page['url'], $page['parent']) . '">#</a>';
            $menu .= '</td>';
            if ($page['url'] != 'index') {
                $menu .= '<td class="delete" ><a class="delconfirm" href="cdeletefile.php?id=' . $page['url'] . '&amp;nonce=' . get_nonce("cdelete", "cdeletefile.php") . '" title="' . i18n_r('DELETEPAGE_TITLE') . ': ' . cl($page['title']) . '" >&times;</a></td>';
            } else {
                $menu .= '<td class="delete" ></td>';
            }
            $menu .= '</tr>';
        }
    }
    return $menu;
}
开发者ID:Emmett-Brown,项目名称:linea,代码行数:49,代码来源:template_functions.php


示例5: foreach

    foreach ($fields as $key => $value) {
        $r[] = rawurlencode($key) . "=" . rawurlencode($value);
    }
    return implode($delim, $r);
    //return complete base string
}
/**
 * Returns typical headers needed for a request
 * @param $consumer_key
 * @param $nonce
 */
function auth_headers($consumer_key, $nonce = '')
{
    return array('oauth_consumer_key' => $consumer_key, 'oauth_nonce' => $nonce, 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => time(), 'oauth_version' => '1.0');
}
$nonce = get_nonce('https://api.elucidat.com/v2/releases/launch', $api_key, $api_secret);
$headers = auth_headers($api_key, $nonce);
$fields = array('release_code' => $release_code, 'name' => $learner_name, 'email_address' => $learner_email);
$result = call_elucidat($headers, $fields, 'GET', 'https://api.elucidat.com/v2/releases/launch', $api_secret);
?>
<!DOCTYPE html>
<!--[if IE 6]>         <html class="no-js ie6 ie-lt9"> <![endif]-->
<!--[if IE 7]>         <html class="no-js ie7 ie-lt9"> <![endif]-->
<!--[if IE 8]>         <html class="no-js ie8 ie-lt9"> <![endif]-->
<!--[if IE 9]>         <html class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Elucidat website integration example</title>
        <!-- viewport behaviour IMPORTANT -->
开发者ID:elucidat,项目名称:website-integration-example,代码行数:31,代码来源:index.php


示例6: get_template

get_template('header', cl($SITENAME) . ' &raquo; ' . i18n_r('GENERAL_SETTINGS'));
?>
	
<?php 
include 'template/include-nav.php';
?>

<div class="bodycontent clearfix">
	
	<div id="maincontent">
		<form class="largeform" action="<?php 
myself();
?>
" method="post" accept-charset="utf-8" >
		<input id="nonce" name="nonce" type="hidden" value="<?php 
echo get_nonce("save_settings");
?>
" />
		
		<div class="main">
		<h3><?php 
i18n('WEBSITE_SETTINGS');
?>
</h3>
		
		<div class="leftsec">
			<p><label for="sitenameinput" ><?php 
i18n('LABEL_WEBSITE');
?>
:</label><input class="text" id="sitenameinput" name="sitename" type="text" value="<?php 
if (isset($SITENAME1)) {
开发者ID:Vin985,项目名称:clqweb,代码行数:31,代码来源:settings.php


示例7: doNotify

        doNotify(i18n_r('FLUSHCACHE-SUCCESS'), 'success');
        break;
    case 'del-error':
        doNotify('<b>' . i18n_r('ERROR') . ':</b> ' . i18n_r('ER_PROBLEM_DEL') . '.', 'error');
        break;
    case 'comp-success':
        doNotify(i18n_r('ER_COMPONENT_SAVE') . '. <a href="components.php?undo&nonce=' . get_nonce("undo") . '">' . i18n_r('UNDO') . '</a>', 'success');
        break;
    case 'comp-restored':
        doNotify(i18n_r('ER_COMPONENT_REST') . '. <a href="components.php?undo&nonce=' . get_nonce("undo") . '">' . i18n_r('UNDO') . '</a>', 'success');
        break;
    case 'profile-restored':
        doNotify(i18n_r('ER_PROFILE_RESTORED') . '. <a href="profile.php?undo&nonce=' . get_nonce("undo") . '&userid=' . $userid . '">' . i18n_r('UNDO') . '</a>', 'success');
        break;
    case 'settings-restored':
        doNotify(i18n_r('ER_OLD_RESTORED') . '. <a href="settings.php?undo&nonce=' . get_nonce("undo") . '">' . i18n_r('UNDO') . '</a>', 'success');
        break;
    default:
        if (isset($error)) {
            doNotify('<b>' . i18n_r('ERROR') . ':</b> ' . $error, 'error');
        } elseif (isset($_GET['cancel'])) {
            doNotify(i18n_r('ER_CANCELLED_FAIL'), 'error');
        } elseif (isset($_GET['logout'])) {
            doNotify(i18n_r('MSG_LOGGEDOUT'), 'info');
        } elseif (!empty($err)) {
            doNotify('<b>' . i18n_r('ERROR') . ':</b> ' . $err, 'error');
        } elseif (isset($success)) {
            doNotify($success, 'success');
        }
        break;
}
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:error_checking.php


示例8: antixss

        $plugin = antixss($pluginid);
        change_plugin($pluginid);
        redirect('plugins.php');
    }
}
// Variable settings
login_cookie_check();
$counter = 0;
$table = null;
$pluginfiles = getFiles(GSPLUGINPATH);
sort($pluginfiles);
$needsupdate = false;
foreach ($pluginfiles as $fi) {
    $pathExt = pathinfo($fi, PATHINFO_EXTENSION);
    $pathName = pathinfo_filename($fi);
    $setNonce = '&amp;nonce=' . get_nonce("set", "plugins.php");
    if ($pathExt == "php") {
        if ($live_plugins[$fi] == 'true') {
            $cls_Enabled = 'hidden';
            $cls_Disabled = '';
            $trclass = 'enabled';
        } else {
            $cls_Enabled = '';
            $cls_Disabled = 'hidden';
            $trclass = 'disabled';
        }
        $api_data = json_decode(get_api_details('plugin', $fi));
        $updatelink = null;
        if (is_object($api_data) && $api_data->status == 'successful') {
            if ($api_data->version > $plugin_info[$pathName]['version']) {
                $updatelink = '<br /><a class="updatelink" href="' . $api_data->path . '" target="_blank">' . i18n_r('UPDATE_AVAILABLE') . ' ' . $api_data->version . '</a>';
开发者ID:google-code-backups,项目名称:get-simple-cms,代码行数:31,代码来源:plugins.php


示例9: tsl

$count = "0";
$path = tsl(GSBACKUPSPATH . 'zip/');
$filenames = getFiles($path);
natsort($filenames);
rsort($filenames);
foreach ($filenames as $file) {
    if ($file[0] != ".") {
        $timestamp = explode('_', $file);
        $name = lngDate($timestamp[0]);
        clearstatcache();
        $ss = stat($path . $file);
        $size = fSize($ss['size']);
        echo '<tr>
								<td><a title="' . i18n_r('DOWNLOAD') . ' ' . $name . '" href="download.php?file=' . $path . $file . '&amp;nonce=' . get_nonce("archive", "download.php") . '">' . $name . '</a></td>
								<td style="width:70px;text-align:right;" ><span>' . $size . '</span></td>
								<td class="delete" ><a class="delconfirm" title="' . i18n_r('DELETE_ARCHIVE') . ': ' . $name . '?" href="deletefile.php?zip=' . $file . '&amp;nonce=' . get_nonce("delete", "deletefile.php") . '">&times;</a></td>
							  </tr>';
        $count++;
    }
}
?>
			</table>
			<p><em><b><span id="pg_counter"><?php 
echo $count;
?>
</span></b> <?php 
i18n('TOTAL_ARCHIVES');
?>
</em></p>
		</div>
	</div>
开发者ID:Emmett-Brown,项目名称:linea,代码行数:31,代码来源:archive.php


示例10: die

    $nonce = $_GET['nonce'];
    if (!check_nonce($nonce, "undo", "support.php")) {
        die("CSRF detected!");
    }
    $ufile = 'cp_settings.xml';
    undo($ufile, $path, $bakpath);
    header('Location: support.php?rest=true');
}
if (isset($_GET['restored'])) {
    $restored = 'true';
} else {
    $restored = 'false';
}
// were changes submitted?
if (isset($_POST['submitted'])) {
    $success = $i18n['SETTINGS_UPDATED'] . '. <a href="support.php?undo&nonce=' . get_nonce("restore", "support.php") . '">' . $i18n['UNDO'] . '</a>';
}
?>

<?php 
get_template('header', cl($SITENAME) . ' &raquo; ' . $i18n['SUPPORT']);
?>
	
	<h1><a href="<?php 
echo $SITEURL;
?>
" target="_blank" ><?php 
echo cl($SITENAME);
?>
</a> <span>&raquo;</span> <?php 
echo $i18n['SUPPORT'];
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:support.php


示例11: elseif

} elseif ($err == 'false') {
    echo '<div class="updated">' . $i18n['ER_SETTINGS_UPD'] . '. <a href="settings.php?undo&nonce=' . get_nonce("undo") . '">' . $i18n['UNDO'] . '</a></div>';
} elseif ($restored == 'true') {
    echo '<div class="updated">' . $i18n['ER_OLD_RESTORED'] . '. <a href="settings.php?undo&nonce=' . get_nonce("undo") . '">' . $i18n['UNDO'] . '</a></div>';
} elseif (@$_GET['rest'] == 'true') {
    echo '<div class="updated">' . $i18n['ER_OLD_RESTORED'] . '. <a href="support.php?undo&nonce=' . get_nonce("undo", "support.php") . '">' . $i18n['UNDO'] . '</a></div>';
} elseif ($err == 'true') {
    echo '<div class="error"><b>' . $i18n['ERROR'] . ':</b> ' . @$msg . '</div>';
} elseif ($update == 'pwd-success') {
    echo '<div class="updated">' . $i18n['ER_NEW_PWD_SENT'] . '. <a href="index.php">' . $i18n['LOGIN'] . '</a></div>';
} elseif ($update == 'pwd-error') {
    echo '<div class="error"><b>' . $i18n['ERROR'] . ':</b> ' . $i18n['ER_SENDMAIL_ERR'] . '.</div>';
} elseif ($update == 'del-success') {
    echo '<div class="updated">' . $i18n['ER_FILE_DEL_SUC'] . ': <b>' . $_GET['id'] . '</b></div>';
} elseif ($update == 'del-error') {
    echo '<div class="error"><b>' . $i18n['ERROR'] . ':</b> ' . $i18n['ER_PROBLEM_DEL'] . '.</div>';
} elseif ($update == 'comp-success') {
    echo '<div class="updated">' . $i18n['ER_COMPONENT_SAVE'] . '. <a href="components.php?undo&nonce=' . get_nonce("undo") . '">' . $i18n['UNDO'] . '</a></div>';
} elseif ($update == 'comp-restored') {
    echo '<div class="updated">' . $i18n['ER_COMPONENT_REST'] . '. <a href="components.php?undo&nonce=' . get_nonce("undo") . '">' . $i18n['UNDO'] . '</a></div>';
} elseif (isset($_GET['cancel'])) {
    echo '<div class="error">' . $i18n['ER_CANCELLED_FAIL'] . '</div>';
} elseif (isset($error)) {
    echo '<div class="error">' . $error . '</div>';
} elseif (isset($success)) {
    echo '<div class="updated">' . $success . '</div>';
} elseif (isset($_GET['err'])) {
    echo '<div class="error"><b>' . $i18n['ERROR'] . ':</b> ' . $_GET['err'] . '</div>';
} elseif (isset($_GET['success'])) {
    echo '<div class="updated">' . $_GET['success'] . '</div>';
}
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:error_checking.php


示例12: i18n

	
	<div id="maincontent">
		<div class="main" >
		
		<h3><?php 
i18n('RESET_PASSWORD');
?>
</h3>
		<p class="desc"><?php 
i18n('MSG_PLEASE_EMAIL');
?>
</p>
		
		<form class="login" action="" method="post" >
			<input name="nonce" id="nonce" type="hidden" value="<?php 
echo get_nonce("reset_password");
?>
"/>
			<p><b><?php 
i18n('LABEL_USERNAME');
?>
:</b><br /><input class="text" name="username" type="text" value="" /></p>
			<p><input class="submit" type="submit" name="submitted" value="<?php 
echo i18n_r('SEND_NEW_PWD');
?>
" /></p>
		</form>
		<p class="cta"><a href="<?php 
echo $SITEURL;
?>
"><?php 
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:30,代码来源:resetpassword.php


示例13: trim

?>
</a>
</div>

<div style="width:770px;margin:0px auto 2px auto;padding:0px 0px 0px 0px;color:black;font-size:18px;font-weight:bold;"><?php 
echo $t_ct_code;
?>
</div>
<form  method="post" action="codetester.php" style="width:760px;margin:0px auto 0px auto;padding:10px;background-color:#EEEEEE;-moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;">
	<textarea name="sourcecode" rows="10" style="width:748px;margin:0px;padding:5px;border:1px solid #c0c0c0;"><?php 
echo '' . trim(file_get_contents('codesource.php'));
?>
</textarea>
	<input type="hidden" name="to" value="interpretcode" />
        <input type="hidden" name="nonce" value="<?php 
echo get_nonce();
/* Russell, 2012-11-10 */
?>
" />
	<input type="submit" value="Interpret the code" class="submit" style="width:150px;margin:4px 0px 0px 0px;padding:0px;border:solid 1px silver;cursor:pointer;-moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;" />
</form>

<br />
<div style="width:770px;margin:0px auto 2px auto;padding:0px 0px 0px 0px;color:black;font-size:18px;font-weight:bold;"><?php 
echo $t_ct_codeinterpreted;
?>
</div>
<div style="width:760px;margin:0px auto 0px auto;padding:10px;font-size:12px;background-color:#FFF3AF;-moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;"><?php 
include 'codesource.php';
?>
</div>
开发者ID:relliance,项目名称:easyphp-codetester-fix,代码行数:31,代码来源:codetester.php


示例14: tsl

$count = "0";
$path = tsl(GSBACKUPSPATH . 'zip/');
$filenames = getFiles($path);
natsort($filenames);
rsort($filenames);
foreach ($filenames as $file) {
    if ($file != "." && $file != ".." && $file != ".htaccess") {
        $timestamp = explode('_', $file);
        $name = shtDate($timestamp[0]);
        clearstatcache();
        $ss = @stat($path . $file);
        $size = fSize($ss['size']);
        echo '<tr>
							<td><a title="Download Archive ' . $name . '" target="_blank" href="download.php?file=' . $path . $file . '&nonce=' . get_nonce("archive", "download.php") . '">' . $name . '</a></td>
							<td style="width:70px;text-align:right;" ><span>' . $size . '</span></td>
							<td class="delete" ><a class="delconfirm" title="Delete Archive ' . $name . '?" href="deletefile.php?zip=' . $file . '&nonce=' . get_nonce("delete", "deletefile.php") . '">X</a></td>
						  </tr>';
        $count++;
    }
}
?>
		</table>
		<p><em><b><?php 
echo $count;
?>
</b> <?php 
echo $i18n['TOTAL_ARCHIVES'];
?>
</em></p>
		</div>
	</div>
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:archive.php


示例15: getPublishedPageHead

function getPublishedPageHead($editing = true, $path = '')
{
    global $id, $draftExists, $pageExists;
    echo '<h3 class="floated">' . ($editing ? i18n_r('PAGE_EDIT_MODE') : i18n_r('CREATE_NEW_PAGE')) . '</h3>';
    if (getDef('GSUSEDRAFTS', true) && $pageExists && getDef('GSSDRAFTSPUBLISHEDTAG', true)) {
        echo '<div class="title label label-ok unselectable">' . i18n_r('LABEL_PUBLISHED') . '</div>';
    }
    echo '<!-- pill edit navigation -->', "\n", '<div class="edit-nav clearfix" >';
    if ($editing) {
        echo '<a class="pageview" href="' . $path . '" target="_blank" accesskey="' . find_accesskey(i18n_r('VIEW')) . '" >' . i18n_r('VIEW') . '</a>';
        if ($path != '') {
            echo '<a class="pageclone" href="pages.php?id=' . $id . '&amp;action=clone&amp;nonce=' . get_nonce("clone", "pages.php") . '" >' . i18n_r('CLONE') . '</a>';
        }
    }
    exec_action(get_filename_id() . '-edit-nav');
    echo "\n</div>";
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:17,代码来源:edit.php


示例16: find_url

    echo '<a href="', find_url($url, $parent), '" target="_blank" accesskey="', find_accesskey(i18n_r('VIEW')), '" >', i18n_r('VIEW'), ' </a>';
}
?>
			<a href="#" id="metadata_toggle" accesskey="<?php 
echo find_accesskey(i18n_r('PAGE_OPTIONS'));
?>
" ><?php 
i18n('PAGE_OPTIONS');
?>
</a>
			<div class="clear" ></div>
		</div>	
			
		<form class="largeform" id="editform" action="cchangedata.php" method="post" accept-charset="utf-8" >
			<input id="nonce" name="nonce" type="hidden" value="<?php 
echo get_nonce("cedit", "cedit.php");
?>
" />			
			<input id="author" name="post-author" type="hidden" value="<?php 
echo $USR;
?>
" />	

			<!-- page title toggle screen -->
			<p id="edit_window">
				<label for="post-title" style="display:none;"><?php 
i18n('PAGE_TITLE');
?>
</label>
				<input class="text title" id="post-title" name="post-title" type="text" value="<?php 
echo $title;
开发者ID:Emmett-Brown,项目名称:linea,代码行数:31,代码来源:cedit.php


示例17: i18n

</a></li>
						<?php 
}
?>
						<li id="cancel-updates" class="alertme"><a href="pages.php?cancel" ><?php 
i18n('CANCEL');
?>
</a></li>
						<?php 
if ($url != 'index' && $url != '') {
    ?>
							<li class="alertme" ><a href="deletefile.php?id=<?php 
    echo $url;
    ?>
&amp;nonce=<?php 
    echo get_nonce("delete", "deletefile.php");
    ?>
" ><?php 
    echo strip_tags(i18n_r('ASK_DELETE'));
    ?>
</a></li>
						<?php 
}
?>
					</ul>
				</div>
				
			</div>
			
			<?php 
if ($url != '') {
开发者ID:hatasu,项目名称:appdroid,代码行数:31,代码来源:edit.php


示例18: changedataAjaxSave

 /**
  * do changedata ajax save checking for legacy
  * @param  str $url     [description]
  * @param  str $oldslug [description]
  */
 function changedataAjaxSave($url, $oldslug)
 {
     global $draft, $pageIsNew;
     if (isset($_POST['ajaxsave'])) {
         // force redirects
         //
         // @todo we update the slug with the assigned slug, but there could be other things plugins need to do when adding a page,
         //  that needs to be available to the page after, things like custom link menus, actions etc.
         //  for now we redirect, so pagestack works since it is not implemented yet for ajax
         if ($pageIsNew) {
             redirect('edit.php?id=' . $url . '&nodraft&upd=edit-success&ptype=new', true);
         }
         // ajax response wrapper, still using html parsing for now
         echo "<div>";
         // if this was an autosave add autosave response
         if (isset($_POST['autosave']) && $_POST['autosave'] == '1') {
             echo '<div class="autosavenotify">' . sprintf(i18n_r('AUTOSAVE_NOTIFY'), output_time(date())) . '</div>';
         }
         // setup error checking vars and include error checking for notifications
         $id = $url;
         $update = 'edit-success';
         $ptype = 'edit';
         if ($url !== $oldslug) {
             $oldid = $oldslug;
         }
         // if slug was changed set $oldid
         $upddraft = $draft;
         include 'template/error_checking.php';
         // send new inputs for slug changes and new nonces
         echo '<input id="nonce" name="nonce" type="hidden" value="' . get_nonce("edit", "edit.php") . '" />';
         echo '<input id="existing-url" name="existing-url" type="hidden" value="' . $url . '" />';
         echo '<input id="post-id" name="post-id" type="hidden" value="' . $url . '" />';
         echo "</div>";
         die;
     }
 }
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:41,代码来源:changedata.php


示例19: check_nonce

/**
 * Check Nonce
 *
 * @since 2.03
 * @author tankmiche
 * @uses get_nonce
 *
 * @param string $nonce
 * @param string $action
 * @param string $file Optional, default is empty string
 * @return bool
 */
function check_nonce($nonce, $action, $file = "")
{
    return $nonce === get_nonce($action, $file) || $nonce === get_nonce($action, $file, true);
}
开发者ID:Foltys,项目名称:Masopust,代码行数:16,代码来源:security_functions.php


示例20: getPagesRow

/**
 * get table row for pages display
 *
 * @since 3.4
 * @param  array $page   page array
 * @param  int $level    current level
 * @param  int $index    current index
 * @param  int $parent   parent index
 * @param  int $children number of children
 * @return str           html for table row
 */
function getPagesRow($page, $level, $index, $parent, $children)
{
    $indentation = $menu = '';
    // indentation
    $indent = '<span class="tree-indent"></span>';
    $last = '<span class="tree-indent indent-last">&ndash;</span>';
    // add indents based on level
    $indentation .= $level > 0 ? str_repeat($indent, $level - 1) : '';
    $indentation .= $level > 0 ? $last : '';
    // add indents or expanders
    $isParent = $children > 0;
    // add expanders in php
    // $expander = '<span class="tree-expander tree-expander-expanded"></span>';
    // $expander = $isParent ? $expander : '<span class="tree-indent"></span>';
    // $indentation = $indentation . $expander;
    // depth level identifiers
    $class = 'depth-' . $level;
    $class .= $isParent ? ' tree-parent' : '';
    $menu .= '<tr id="tr-' . $page['url'] . '" class="' . $class . '" data-depth="' . $level . '">';
    $pagetitle = $pagemenustatus = $pageprivate = $pagedraft = $pageindex = '';
    if ($page['title'] == '') {
        $pagetitle = '[No Title] &nbsp;&raquo;&nbsp; <em>' . $page['url'] . '</em>';
    } else {
        $pagetitle = $page['title'];
    }
    if ($page['menuStatus'] != '') {
        $pagemenustatus = ' <span class="label label-ghost">' . i18n_r('MENUITEM_SUBTITLE') . '</span>';
    }
    if ($page['private'] != '') {
        $pageprivate = ' <span class="label label-ghost">' . i18n_r('PRIVATE_SUBTITLE') . '</span>';
    }
    if (pageHasDraft($page['url'])) {
        $pagedraft = ' <span class="label label-ghost">' . lowercase(i18n_r('LABEL_DRAFT')) . '</span>';
    }
    if ($page['url'] == getDef('GSINDEXSLUG')) {
        $pageindex = ' <span class="label label-ghost">' . i18n_r('HOMEPAGE_SUBTITLE') . '</span>';
    }
    if (dateIsToday($page['pubDate'])) {
        $pagepubdate = ' <span class="datetoday">' . output_date($page['pubDate']) . '</span>';
    } else {
        $pagepubdate = '<span>' . output_date($page['pubDate']) . "</span>";
    }
    $pagetitle = cl($pagetitle);
    $menu .= '<td class="pagetitle">' . $indentation . '<a title="' . i18n_r('EDITPAGE_TITLE') . ': ' . var_out($pagetitle) . '" href="edit.php?id=' . $page['url'] . '" >' . $pagetitle . '</a>';
    $menu .= '<div class="showstatus toggle" >' . $pageindex . $pagedraft . $pageprivate . $pagemenustatus . '</div></td>';
    // keywords used for filtering
    $menu .= '<td style="width:80px;text-align:right;" ><span>' . $pagepubdate . '</span></td>';
    $menu .= '<td class="secondarylink" >';
    $menu .= '<a title="' . i18n_r('VIEWPAGE_TITLE') . ': ' . var_out($pagetitle) . '" target="_blank" href="' . find_url($page['url'], $page['parent']) . '">#</a>';
    $menu .= '</td>';
    // add delete buttons, exclude index page
    if ($page['url'] != 'index') {
        $menu .= '<td class="delete" ><a class="delconfirm" href="deletefile.php?id=' . $page['url'] . '&amp;nonce=' . get_nonce("delete", "deletefile.php") . '" title="' . i18n_r('DELETEPAGE_TITLE') . ': ' . cl($page['title']) . '" >&times;</a></td>';
    } else {
        $menu .= '<td class="delete" ></td>';
    }
    // add indexcolumn and tagcolumn for filtering
    $menu .= '<td class="indexColumn hidden">' . strip_tags(lowercase($pagetitle . $pageindex . $pagemenustatus . $pageprivate . $pagedraft)) . '</div></td>';
    // keywords used for filtering
    $menu .= '<td class="tagColumn hidden">' . str_replace(',', ' ', $page['meta']) . '</div></td>';
    // keywords used for filtering
    $menu .= '</tr>';
    return $menu;
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:75,代码来源:template_functions.php



注:本文中的get_nonce函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_nonuser_cals函数代码示例发布时间:2022-05-15
下一篇:
PHP get_nom_prenom_eleve函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap