当前位置: 首页>>代码示例>>PHP>>正文


PHP getXSRFToken函数代码示例

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


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

示例1: elFinder_tinymce

function elFinder_tinymce($discard)
{
    $file = FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/elFinder/elfinder.php?XSRFToken=' . getXSRFToken('elFinder');
    ?>
	<script type="text/javascript">
		// <!-- <![CDATA[
		function elFinderBrowser(field_name, url, type, win) {
			tinymce.activeEditor.windowManager.open({
				file: '<?php 
    echo $file;
    ?>
', // use an absolute path!
				title: 'elFinder 2.0',
				width: 900,
				height: 450,
				close_previous: 'no',
				inline: 'yes', // This parameter only has an effect if you use the inlinepopups plugin!
				popup_css: false, // Disable TinyMCE's default popup CSS
				resizable: 'yes'
			}, {
				setUrl: function(url) {
					win.document.getElementById(field_name).value = url;
				}
			});
			return false;
		}
		// ]]> -->
	</script>

	<?php 
    return 'elFinderBrowser';
}
开发者ID:rb26,项目名称:zenphoto,代码行数:32,代码来源:elFinder.php

示例2: gettext

echo gettext('Zenphoto License agreement');
?>
</h1>
		<div id="container">
			<p class="notebox">
				<?php 
printf(gettext('This license is in English because the <em>Free Software Foundation</em> does not approve translations as officially valid. Unofficial translations are available <a href="%s">here</a>.'), 'http://www.gnu.org/licenses/old-licenses/gpl-2.0-translations.html');
?>
			</p>
			<?php 
if (!getOption('license_accepted')) {
    $_SESSION['license_return'] = getRequestURI();
    ?>
				<p class="buttons">
					<a href="<?php 
    echo FULLWEBPATH . '/' . ZENFOLDER . '/license.php?licenseAccept&amp;XSRFToken=' . getXSRFToken('ZenphotoLicense');
    ?>
" alt="<?php 
    echo gettext('You must accept this license to continue to use Zenphoto.');
    ?>
"><?php 
    echo gettext('I agree to these terms and conditions');
    ?>
</a>
				</p>
				<br class="clearall" />
				<?php 
}
?>
			<br class="clearall" />
			<div class="tabbox">
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:license.php

示例3: handleSelectorChange

			<script type="text/javascript">
				// <!-- <![CDATA[
				function handleSelectorChange(type) {
					$('#add,#titlelabel,#link_row,#link,#link_label,#visible_row,#show_visible,#span_row').show();
					$('#include_li_label').hide();
					$('#type').val(type);
					$('#link_label').html('<?php 
echo js_encode(gettext('URL'));
?>
');
					$('#titlelabel').html('<?php 
echo js_encode(gettext('Title'));
?>
');
					$('#XSRFToken').val('<?php 
echo getXSRFToken('update_menu');
?>
');
					switch (type) {
						case 'all_items':
							$('#albumselector,#pageselector,#categoryselector,#custompageselector,#titleinput,#titlelabel,#link_row,#visible_row,#span_row').hide();
							$('#selector').html('<?php 
echo js_encode(gettext("All menu items"));
?>
');
							$('#description').html('<?php 
echo js_encode(gettext('This adds menu items for all zenphoto objects. (It creates a "default" menuset.)'));
?>
');
							break;
						case "galleryindex":
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:menu_tab_edit.php

示例4: query

        query($sql);
        $sql = "UPDATE " . prefix('images') . " SET `mtime`=0 {$imagewhere};";
        query($sql);
    }
    if (!empty($folder) && empty($id)) {
        echo "<p> " . sprintf(gettext("<em>%s</em> not found"), $folder) . "</p>";
    } else {
        if (empty($r)) {
            echo "<p>" . $allset . "</p>";
        } else {
            echo "<p>" . sprintf(gettext("We are all set to refresh the metadata for <em>%s</em>"), $r) . "</p>";
        }
        echo '<p>' . gettext('This process should start automatically. If not press: ') . '</p>';
        ?>
				<p><a href="<?php 
        echo $starturl . '&amp;XSRFToken=' . getXSRFToken('refresh');
        ?>
"
							title="<?php 
        echo gettext("Refresh image metadata.");
        ?>
" style="font-size: 15pt; font-weight: bold;">
						<?php 
        echo gettext("Go!");
        ?>
</a>
				</p>
				<?php 
    }
}
echo "\n" . '</div>';
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-refresh-metadata.php

示例5: gettext

										<button type="reset" onclick="$('.copydelete').hide();">
											<img src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/images/reset.png" alt="" />
											<strong><?php 
    echo gettext("Reset");
    ?>
</strong>
										</button>
										<div class="floatright">
											<strong><a href="admin-edit.php?<?php 
    echo $admintype;
    ?>
&amp;add&amp;XSRFToken=<?php 
    echo getXSRFToken('add');
    ?>
" title="<?php 
    echo $additem;
    ?>
"><img src="<?php 
    echo WEBPATH . '/' . ZENFOLDER;
    ?>
/images/add.png" alt="" /> <?php 
    echo $additem;
    ?>
</a></strong>
											<?php 
    if (!$result->transient) {
        if (is_AdminEditPage("newscategory")) {
            ?>
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-edit.php

示例6: cron_starter

/**
 * Starts a sechedule script run
 * @param string $script The script file to load
 * @param array $params "POST" parameters
 * @param bool $inline set to true to run the task "in-line". Set false run asynchronously
 */
function cron_starter($script, $params, $offsetPath, $inline = false)
{
    global $_zp_authority, $_zp_loggedin, $_zp_current_admin_obj, $_zp_HTML_cache;
    $admin = $_zp_authority->getMasterUser();
    if ($inline) {
        $_zp_current_admin_obj = $admin;
        $_zp_loggedin = $_zp_current_admin_obj->getRights();
        foreach ($params as $key => $value) {
            if ($key == 'XSRFTag') {
                $key = 'XSRFToken';
                $value = getXSRFToken($value);
            }
            $_POST[$key] = $_GET[$key] = $_REQUEST[$key] = $value;
        }
        require_once $script;
    } else {
        $auth = sha1($script . serialize($admin));
        $paramlist = 'link=' . $script;
        foreach ($params as $key => $value) {
            $paramlist .= '&' . $key . '=' . $value;
        }
        $paramlist .= '&auth=' . $auth . '&offsetPath=' . $offsetPath;
        $_zp_HTML_cache->abortHTMLCache();
        ?>
		<script type="text/javascript">
			// <!-- <![CDATA[
			$.ajax({
				type: 'POST',
				cache: false,
				data: '<?php 
        echo $paramlist;
        ?>
',
				url: '<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/cron_runner.php'
			});
			// ]]> -->
		</script>
		<?php 
    }
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:49,代码来源:functions.php

示例7: sprintf

                    }
                    if ($commentexists_count != 0) {
                        $postinfo .= '<li class="import-exists">' . sprintf(ngettext('%1$u comment already exists.', '%1$u comments already exist.', $commentexists_count), $commentexists_count) . '</li>';
                    }
                    if ($commentcount != 0) {
                        $postinfo .= '<li class="import-success">' . sprintf(ngettext('%1$u comment imported.', '%1$u comments imported.', $commentcount), $commentcount) . '</li>';
                    }
                } else {
                    $postinfo .= '<ul><li class="import-nothing">' . gettext('No comments to import') . '</li>';
                }
                debugLogVar('Wordpress import - Comments for "' . $post['title'] . '" (' . $post['type'] . ')', $comments);
                $postinfo .= '</ul></li>';
                $postcount++;
            }
            // posts foreach
            $metaURL = 'wordpress_import.php?refresh=' . $postcount . '&amp;dbname=' . $wp_dbname . '&amp;dbuser=' . $wp_dbbuser . '&amp;dbpass=' . $wp_dbpassword . '&amp;dbhost=' . $wp_dbhost . '&amp;tableprefix=' . $wp_prefix . '&amp;convertlinefeeds=' . getcheckboxState('convertlinefeeds') . '&amp;XSRFToken=' . getXSRFToken('wordpress');
        } else {
            // if posts are available at all
            $metaURL = '';
            // to be sure...
            $postinfo .= "<li class='import-nothing'>" . gettext("No posts or pages to import.") . "</li>";
        }
    }
    // if db data set
    $zenphoto_tabs['overview']['subtabs'] = array(gettext('Wordpress') => '');
    printAdminHeader('overview', 'wordpress');
    if (!empty($metaURL) && $postcount < $posttotalcount) {
        ?>
		<meta http-equiv="refresh" content="1; url=<?php 
        echo $metaURL;
        ?>
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:wordpress_import.php

示例8: XSRFdefender

/**
 * Checks for Cross Site Request Forgeries
 * @param string $action
 */
function XSRFdefender($action)
{
    $token = getXSRFToken($action);
    if (!isset($_REQUEST['XSRFToken']) || $_REQUEST['XSRFToken'] != $token) {
        zp_apply_filter('admin_XSRF_access', false, $action);
        header("HTTP/1.0 302 Found");
        header("Status: 302 Found");
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=external&error&msg=' . sprintf(gettext('“%s” Cross Site Request Forgery blocked.'), $action));
        exitZP();
    }
    unset($_REQUEST['XSRFToken']);
    unset($_POST['XSRFToken']);
    unset($_GET['XSRFToken']);
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:18,代码来源:admin-functions.php

示例9: printItemsListTable

/**
 * Prints the table part of a single page item for the sortable pages list
 *
 * @param object $page The array containing the single page
 * @param bool $flag set to true to flag the element as having a problem with nesting level
 */
function printItemsListTable($item, $flag)
{
    $gallery = new Gallery();
    ?>
 <div class="page-list_row">
	<div class="page-list_title">
			<?php 
    $array = getItemTitleAndURL($item);
    printItemEditLink($item);
    ?>
		</div>
		<div class="page-list_extra"><?php 
    echo html_encode(truncate_string($array['name'], 40, '...'));
    ?>
</div>
		<div class="page-list_extra"><em><?php 
    echo $item['type'];
    ?>
</em></div>
		<div class="page-list_iconwrapper">
		<div class="page-list_icon">
			<?php 
    if ($array['protected']) {
        ?>
				<img src="../../images/lock_2.png" alt="<?php 
        echo gettext("The object of this menu is under password protection");
        ?>
" title="<?php 
        echo gettext("The object of this menu is under password protection");
        ?>
" style="border: 0px;" />
				<?php 
    } else {
        ?>
				<img src="../../images/place_holder_icon.png" alt="<?php 
        echo gettext("under password protection");
        ?>
"style="border: 0px;" />
				<?php 
    }
    ?>
		</div>
		<div class="page-list_icon">
		<?php 
    if ($item['show'] === '1') {
        ?>
			<a href="menu_tab.php?publish&amp;id=<?php 
        echo $item['id'] . "&amp;show=0";
        ?>
&amp;add&amp;XSRFToken=<?php 
        echo getXSRFToken('update_menu');
        ?>
" title="<?php 
        echo gettext('hide');
        ?>
" >
				<img src="../../images/pass.png"	alt="<?php 
        echo gettext('hide');
        ?>
" style="border: 0px;" />
			</a>
			<?php 
    } else {
        ?>
			<a href="menu_tab.php?publish&amp;id=<?php 
        echo $item['id'] . "&amp;show=1";
        ?>
&amp;add&amp;XSRFToken=<?php 
        echo getXSRFToken('update_menu');
        ?>
"  title="<?php 
        echo gettext('show');
        ?>
">
				<img src="../../images/action.png"	alt="<?php 
        echo gettext('show');
        ?>
" style="border: 0px;" />
			</a>
			<?php 
    }
    ?>
	</div>
		<div class="page-list_icon">
			<?php 
    switch ($item['type']) {
        default:
            if (!empty($array['url'])) {
                ?>
						<a href="<?php 
                echo $array['url'];
                ?>
">
							<img src="../../images/view.png" alt="<?php 
//.........这里部分代码省略.........
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:101,代码来源:menu_manager-admin-functions.php

示例10: upload_extra

function upload_extra($uploadlimit, $passedalbum)
{
    global $_zp_current_admin_obj, $upload_extensions;
    ?>
	<script type="text/javascript">
		// <!-- <![CDATA[
		if (FlashDetect.installed) {
			$(document).ready(function() {
				$('#fileUpload').uploadify({
					'uploader': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/uploadify.swf',
					'cancelImg': 'images/fail.png',
					'script': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/uploader.php',
					'scriptData': {
												'auth': '<?php 
    echo $_zp_current_admin_obj->getPass();
    ?>
',
												'id': '<?php 
    echo $_zp_current_admin_obj->getID();
    ?>
',
												'XSRFToken': '<?php 
    echo getXSRFToken('upload');
    ?>
'
												},
					'folder': '/',
					'multi': true,
					<?php 
    $uploadbutton = SERVERPATH . '/' . ZENFOLDER . '/locale/' . getOption('locale') . '/select_files_button.png';
    if (!file_exists($uploadbutton)) {
        $uploadbutton = SERVERPATH . '/' . ZENFOLDER . '/images/select_files_button.png';
    }
    $discard = NULL;
    $info = zp_imageDims($uploadbutton, $discard);
    if ($info['height'] > 60) {
        $info['height'] = round($info['height'] / 3);
        $rollover = "'rollover': true,";
    } else {
        $rollover = "";
    }
    $uploadbutton = str_replace(SERVERPATH, WEBPATH, $uploadbutton);
    ?>
					'buttonImg': '<?php 
    echo $uploadbutton;
    ?>
',
					'height': '<?php 
    echo $info['height'];
    ?>
',
					'width': '<?php 
    echo $info['width'];
    ?>
',
					<?php 
    echo $rollover;
    ?>
					'checkScript': '<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER;
    ?>
/uploader_flash/check.php',
					'displayData': 'speed',
					'simUploadLimit': 3,
					'sizeLimit': <?php 
    echo $uploadlimit;
    ?>
,
					'onAllComplete':	function(event, data) {
															if (data.errors) {
																return false;
															} else {
															<?php 
    if (zp_loggedin(ALBUM_RIGHTS | MANAGE_ALL_ALBUM_RIGHTS)) {
        ?>
																launchScript('admin-edit.php',['page=edit','subpage=1','tab=imageinfo','album='+encodeURIComponent($('#folderdisplay').val()),'uploaded=1','albumimagesort=id_desc']);
																<?php 
    } else {
        ?>
																launchScript('admin-upload.php',['uploaded=1']);
																<?php 
    }
    ?>
															}
														},
					'fileDesc': '<?php 
    echo gettext('Zenphoto supported file types | all files');
    ?>
',
					'fileExt': '<?php 
    $list = implode(';*.', $upload_extensions);
    echo '*.' . $list . ' | *.*';
    ?>
'
//.........这里部分代码省略.........
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:101,代码来源:upload_form.php

示例11: gettext

</p>

				<?php 
if (!extensionEnabled('downloadList')) {
    echo '<strong>' . gettext('The downloadList plugin is not active') . '</strong>';
} else {
    ?>
					<p class="buttons"><a href="?removeoutdateddownloads&amp;XSRFToken=<?php 
    echo getXSRFToken('removeoutdateddownloads');
    ?>
"><?php 
    echo gettext('Clear outdated downloads from database');
    ?>
</a></p>
					<p class="buttons"><a href="?removealldownloads&amp;XSRFToken=<?php 
    echo getXSRFToken('removealldownloads');
    ?>
"><?php 
    echo gettext('Clear all downloads from database');
    ?>
</a></p><br class="clearall" />
					<br class="clearall" /><br />
					<?php 
    printBarGraph();
}
?>

			</div>
		</div><!-- content -->
		<?php 
printAdminFooter();
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:download_statistics.php

示例12: admin_toolbox_news

    static function admin_toolbox_news($redirect, $zf)
    {
        global $_zp_CMS, $_zp_current_category, $_zp_current_article;
        if (is_NewsArticle()) {
            if (zp_loggedin(ZENPAGE_NEWS_RIGHTS) && $_zp_CMS && $_zp_CMS->news_enabled) {
                // page is a NewsArticle--provide zenpage edit, delete, and Add links
                echo "<li><a href=\"" . $zf . '/' . PLUGIN_FOLDER . "/zenpage/admin-edit.php?newsarticle&amp;edit&amp;titlelink=" . html_encode($_zp_current_article->getTitleLink()) . "&amp;subpage=object\">" . gettext("Edit Article") . "</a></li>";
                if (GALLERY_SESSION) {
                    // XSRF defense requires sessions
                    ?>
					<li>
						<a href="javascript:confirmDelete('<?php 
                    echo $zf . '/' . PLUGIN_FOLDER;
                    ?>
/zenpage/admin-news.php?del=<?php 
                    echo getNewsID();
                    ?>
&amp;XSRFToken=<?php 
                    echo getXSRFToken('delete');
                    ?>
',deleteArticle)"
							 title="<?php 
                    echo gettext("Delete article");
                    ?>
"><?php 
                    echo gettext("Delete Article");
                    ?>
	</a>
					</li>
					<?php 
                }
                echo "<li><a href=\"" . $zf . '/' . PLUGIN_FOLDER . "/zenpage/admin-edit.php?newsarticle&amp;add\">" . gettext("Add Article") . "</a></li>";
            }
            $redirect .= '&amp;title=' . urlencode($_zp_current_article->getTitlelink());
        } else {
            if (!empty($_zp_current_category)) {
                $redirect .= '&amp;category=' . $_zp_current_category->getTitlelink();
            }
        }
        return $redirect;
    }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:41,代码来源:zenpage.php

示例13: zp_apply_filter

zp_apply_filter('admin_note', 'upload', $subtab);
?>
					<h1><?php 
echo $title;
?>
</h1>
					<script type="text/javascript">
						$().ready(function () {
							var elf = $('#elfinder').elfinder({
								lang: '<?php 
echo $locale;
?>
', // language (OPTIONAL)
								customData: {
									'XSRFToken': '<?php 
echo getXSRFToken('elFinder');
?>
',
									'zp_user_auth': '<?php 
echo zp_getCookie('zp_user_auth');
?>
',
<?php 
if ($theme) {
    if (zp_loggedin(THEMES_RIGHTS) && is_dir(SERVERPATH . '/' . THEMEFOLDER . '/' . $theme)) {
        ?>
											'themeEdit': '<?php 
        echo $theme;
        ?>
',
		<?php 
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:filemanager.php

示例14: gettext

            }
            ?>
										</td>
										<td style="border-top: 4px solid #D1DBDF;" valign="top">
										<?php 
            if (!empty($groupname)) {
                $msg = gettext('Are you sure you want to delete this group?');
                ?>
											<a href="javascript:if(confirm(<?php 
                echo "'" . $msg . "'";
                ?>
)) { launchScript('',['action=deletegroup','group=<?php 
                echo addslashes($groupname);
                ?>
','XSRFToken=<?php 
                echo getXSRFToken('deletegroup');
                ?>
']); }"
																title="<?php 
                echo gettext('Delete this group.');
                ?>
" style="color: #c33;">
												<img src="../../images/fail.png" style="border: 0px;" alt="Delete" />
											</a>
											<?php 
            }
            ?>
										</td>
									</tr>
									<?php 
            $id++;
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:user_groups-tab.php

示例15: gettext

";
	var deleteAlbum2 = "<?php 
echo gettext("Are you Absolutely Positively sure you want to delete the album? THIS CANNOT BE UNDONE!");
?>
";
	function newAlbum(folder,albumtab) {
		var album = prompt('<?php 
echo gettext('New album name?');
?>
', '<?php 
echo gettext('new album');
?>
');
		if (album) {
			launchScript('',['action=newalbum','album='+folder,'name='+encodeURIComponent(album),'albumtab='+albumtab,'XSRFToken=<?php 
echo getXSRFToken('newalbum');
?>
']);
		}
	}
	function confirmAction() {
		if ($('#checkallaction').val() == 'deleteall') {
			return confirm('<?php 
echo js_encode(gettext("Are you sure you want to delete the checked items?"));
?>
');
		} else {
			return true;
		}
	}
	// ]]> -->
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:admin-edit.php


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