本文整理汇总了PHP中Session::getFormToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getFormToken方法的具体用法?PHP Session::getFormToken怎么用?PHP Session::getFormToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::getFormToken方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_open
public static function form_open($array = array())
{
$attributes = self::get_attributes($array);
$html = '<form ' . $attributes . ' >';
$html .= '<input type="hidden" name="token" value="' . Session::getFormToken() . '">';
return $html;
}
示例2: onDisplay
/**
* Display the button
*
* @return array A four element array of (article_id, article_title, category_id, object)
*/
public function onDisplay($name)
{
// Javascript to insert the link
// View element calls jSelectArticle when an article is clicked
// jSelectArticle creates the link tag, sends it to the editor,
// and closes the select frame.
$js = "\n\t\tfunction jSelectArticle(id, title, catid, object, link, lang) {\n\t\t\tvar hreflang = '';\n\t\t\tif (lang !== '') {\n\t\t\t\tvar hreflang = ' hreflang = \"' + lang + '\"';\n\t\t\t}\n\t\t\tvar tag = '<a' + hreflang + ' href=\"' + link + '\">' + title + '</a>';\n\t\t\tjInsertEditorText(tag, '" . $name . "');\n\t\t\t\$.fancybox.close();\n\t\t}";
Document::addScriptDeclaration($js);
Html::behavior('modal');
// Use the built-in element view to select the article.
// Currently uses blank class.
$link = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&' . Session::getFormToken() . '=1';
$button = new \Hubzero\Base\Object();
$button->set('modal', true);
$button->set('link', $link);
$button->set('text', Lang::txt('PLG_ARTICLE_BUTTON_ARTICLE'));
$button->set('name', 'article');
$button->set('options', "{handler: 'iframe', size: {x: 770, y: 400}}");
return $button;
}
示例3:
?>
</span>
</span>
<?php
}
?>
</td>
<td class="priority-4">
<?php
if ($canDo->get('core.edit.state')) {
?>
<a class="state <?php
echo $scls;
?>
" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&category_id=' . $this->filters['category_id'] . '&task=sticky&sticky=' . $stickyTask . '&id=' . $row->id . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_FORUM_SET_TO', $stickyTitle);
?>
">
<span><?php
echo $stickyAlt;
?>
</span>
</a>
<?php
} else {
?>
<span class="state <?php
echo $scls;
示例4:
<a href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=edit&id=' . $row->get('id') . '&qid=' . $this->question->get('id'));
?>
">
<span><?php
echo $this->truncate(strip_tags($row->get('answer')), 75);
?>
</span>
</a>
</td>
<td>
<a class="state <?php
echo $cls;
?>
" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=' . $task . '&id=' . $row->get('id') . '&qid=' . $this->question->get('id') . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_ANSWERS_SET_STATE', $task);
?>
">
<span><?php
echo $alt;
?>
</span>
</a>
</td>
<td class="priority-4">
<time datetime="<?php
echo $row->created();
?>
示例5: deleteFile
?>
<tr>
<td>
<input type="radio" name="slctdfile" value="<?php
echo $this->escape($this->listdir . $subdird . $docs[$docName]);
?>
" />
</td>
<td width="100%">
<?php
echo $docs[$docName];
?>
</td>
<td>
<a class="state trash" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=deletefile&delFile=' . $docs[$docName] . '&listdir=' . $this->listdir . '&tmpl=component&subdir=' . $this->subdir . '&' . Session::getFormToken() . '=1');
?>
" target="filer" onclick="return deleteFile('<?php
echo $docs[$docName];
?>
');" title="<?php
echo Lang::txt('JACTION_DELETE');
?>
">
<span><?php
echo Lang::txt('JACTION_DELETE');
?>
</span>
</a>
</td>
</tr>
示例6:
$span_title = Lang::txt('COM_MEMBERS_PUBLIC_PROFILE_TITLE');
$title = Lang::txt('COM_MEMBERS_PUBLIC_PROFILE_SET_PRIVATE_TITLE');
if ($this->profile->get('access') == 2) {
$cls = 'protected';
$span_title = Lang::txt('COM_MEMBERS_PROTECTED_PROFILE_TITLE');
$title = Lang::txt('COM_MEMBERS_PRIVATE_PROFILE_SET_PUBLIC_TITLE');
}
if ($this->profile->get('access') > 2) {
$cls = 'private';
$span_title = Lang::txt('COM_MEMBERS_PRIVATE_PROFILE_TITLE');
$title = Lang::txt('COM_MEMBERS_PRIVATE_PROFILE_SET_PUBLIC_TITLE');
}
if ($this->active == 'profile') {
?>
<a id="profile-privacy" href="<?php
echo Route::url($this->profile->link() . '&' . Session::getFormToken() . '=1');
?>
"
data-id="<?php
echo $this->profile->get('id');
?>
"
data-private="<?php
echo Lang::txt('Click here to set your profile private.');
?>
"
data-public="<?php
echo Lang::txt('Click here to set your profile public.');
?>
"
class="<?php
示例7: substr
<?php
$clientInfo = \Hubzero\Base\ClientManager::client($row->client_id);
echo '<span class="client client-' . $clientInfo->name . '" data-client="' . substr($clientInfo->name, 0, 1) . '">' . ucfirst($clientInfo->name) . '</span>';
?>
</td>
<td class="priority-3">
<?php
echo Lang::txt('MOD_WHOSONLINE_HOURS_AGO', (time() - $row->time) / 3600.0);
?>
</td>
<?php
if ($editAuthorized) {
?>
<td>
<a class="force-logout" href="<?php
echo Route::url('index.php?option=com_login&task=logout&uid=' . $row->userid . '&' . Session::getFormToken() . '=1');
?>
">
<span><?php
echo Lang::txt('JLOGOUT');
?>
</span>
</a>
</td>
<?php
}
?>
</tr>
<?php
}
?>
示例8: defined
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @author Christopher Smoak <csmoak@purdue.edu>
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// no direct access
defined('_HZEXEC_') or die;
$token = Session::getFormToken();
if (is_object($this->mailinglist)) {
?>
<div class="mailinglist-details">
<span class="name">
<?php
echo $this->mailinglist->name;
?>
</span>
<span class="description">
<?php
echo nl2br($this->mailinglist->description);
?>
</span>
</div>
示例9:
<th><?php
echo Lang::txt('COM_COURSES_FILE');
?>
:</th>
<td>
<span id="img-name"><?php
echo $this->row->params('logo', Lang::txt('COM_COURSES_NONE'));
?>
</span>
</td>
<td>
<a id="img-delete" <?php
echo $logo ? '' : 'style="display: none;"';
?>
href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=logo&tmpl=component&task=remove¤tfile=' . $logo . '&type=section&id=' . $this->row->get('id') . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_COURSES_DELETE');
?>
">[ x ]</a>
</td>
</tr>
<tr>
<th><?php
echo Lang::txt('COM_COURSES_PICTURE_SIZE');
?>
:</th>
<td><span id="img-size"><?php
echo \Hubzero\Utility\Number::formatBytes($this_size);
?>
示例10:
</a>
</td>
<td style="text-align:center;">
<?php
$calt = Lang::txt('JNO');
$cls = 'unpublish';
if ($data['private_comments']['read']) {
$calt = Lang::txt('JYES');
$cls = 'publish';
}
?>
<a class="state <?php
echo $cls;
?>
" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=update&id=' . $data['tickets']['id'] . '&action=read&value=' . ($data['private_comments']['read'] ? '0' : '1') . '&' . Session::getFormToken() . '=1');
?>
">
<span><?php
echo $calt;
?>
</span>
</a>
</td>
<td> </td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
示例11: Node
if ($user->authorise('core.admin')) {
$menu->addChild(new Node(Lang::txt('MOD_MENU_UPDATE'), 'index.php?option=com_update', 'class:update'));
}
$menu->addChild(new Node(Lang::txt('MOD_MENU_SYS_LDAP'), 'index.php?option=com_system&controller=ldap', 'class:ldap'));
$menu->addChild(new Node(Lang::txt('MOD_MENU_SYS_GEO'), 'index.php?option=com_system&controller=geodb', 'class:geo'));
$menu->addChild(new Node(Lang::txt('MOD_MENU_SYS_APC'), 'index.php?option=com_system&controller=apc', 'class:apc'));
//$menu->addChild(new Node(Lang::txt('MOD_MENU_SYS_SCRIPTS'), 'index.php?option=com_system&controller=scripts', 'class:scripts'));
$menu->addChild(new Node(Lang::txt('MOD_MENU_SYS_ROUTES'), 'index.php?option=com_redirect', 'class:routes'));
$menu->getParent();
}
$menu->addSeparator();
if ($user->authorise('core.admin')) {
$menu->addChild(new Node(Lang::txt('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_system&controller=info', 'class:info'));
$menu->addSeparator();
}
$menu->addChild(new Node(Lang::txt('MOD_MENU_LOGOUT'), 'index.php?option=com_login&task=logout&' . Session::getFormToken() . '=1', 'class:logout'));
$menu->getParent();
//
// Users Submenu
//
if ($user->authorise('core.manage', 'com_users')) {
$menu->addChild(new Node(Lang::txt('MOD_MENU_COM_USERS_USERS'), '#'), true);
$createUser = $shownew && $user->authorise('core.create', 'com_users');
$createGrp = $user->authorise('core.admin', 'com_users');
$menu->addChild(new Node(Lang::txt('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'));
/*if ($createUser)
{
$menu->addChild(
new Node(Lang::txt('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle')
);
$menu->getParent();
示例12:
</a>
</td>
<td class="priority-4">
<a class="tool" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&exechost=' . $row->exechost);
?>
">
<span><?php
echo $this->escape($row->exechost);
?>
</span>
</a>
</td>
<td>
<a class="state trash" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=remove&id=' . $row->sessnum . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_TOOLS_TERMINATE');
?>
">
<span><?php
echo Lang::txt('COM_TOOLS_TERMINATE');
?>
</span>
</a>
</td>
</tr>
<?php
$i++;
}
示例13:
:: <?php
echo Lang::txt('COM_RESOURCES_SET_TASK_TO', $task);
?>
">
<span><?php
echo $alt;
?>
</span>
</a>
</td>
<td class="priority-3">
<a class="access <?php
echo $color_access;
?>
" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=' . $task_access . '&id=' . $row->id . $filterstring . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_RESOURCES_CHANGE_ACCESS');
?>
">
<span><?php
echo $this->escape(Lang::txt($row->groupname));
?>
</span>
</a>
</td>
<td class="priority-4" style="white-space: nowrap">
<?php
if ($row->modified == '0000-00-00 00:00:00') {
echo Lang::txt('COM_RESOURCES_NOT_MODIFIED');
示例14:
</a>
</td>
<td>
<?php
echo $this->escape(stripslashes($row->publish_up));
?>
</td>
<td>
<span><?php
echo $this->escape(stripslashes($row->publish_down));
?>
</span>
</td>
<td>
<a class="state trash" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=removeZone&id=' . $row->id . '&version=' . $this->version . '&tmpl=component&' . Session::getFormToken() . '=1');
?>
">
<span><?php
echo Lang::txt('X');
?>
</span>
</a>
</td>
</tr>
<?php
$i++;
$k = 1 - $k;
}
?>
</tbody>
示例15:
echo $this->escape(stripslashes($row->title));
?>
</span>
<?php
}
?>
</td>
<td class="priority-2">
<?php
if ($canDo->get('core.edit.state')) {
?>
<a class="state <?php
echo $cls;
?>
" href="<?php
echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '§ion_id=' . $this->filters['section_id'] . '&task=' . $task . '&id=' . $row->id . '&' . Session::getFormToken() . '=1');
?>
" title="<?php
echo Lang::txt('COM_FORUM_SET_TO', $task);
?>
">
<span><?php
echo $alt;
?>
</span>
</a>
<?php
} else {
?>
<span class="state <?php
echo $cls;