本文整理汇总了PHP中Valid_UInt::required方法的典型用法代码示例。如果您正苦于以下问题:PHP Valid_UInt::required方法的具体用法?PHP Valid_UInt::required怎么用?PHP Valid_UInt::required使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Valid_UInt
的用法示例。
在下文中一共展示了Valid_UInt::required方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
function getContent()
{
$frsrf = new FRSReleaseFactory();
$html_my_monitored_fp = '';
$sql = "SELECT groups.group_name,groups.group_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "' ";
$um =& UserManager::instance();
$current_user =& $um->getCurrentUser();
if ($current_user->isRestricted()) {
$projects = $current_user->getProjects();
$sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
}
$sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$html_my_monitored_fp .= $GLOBALS['Language']->getText('my_index', 'my_files_msg');
} else {
$html_my_monitored_fp .= '<table style="width:100%">';
$request =& HTTPRequest::instance();
for ($j = 0; $j < $rows; $j++) {
$group_id = db_result($result, $j, 'group_id');
$sql2 = "SELECT frs_package.name,filemodule_monitor.filemodule_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND groups.group_id={$group_id} " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "' LIMIT 100";
$result2 = db_query($sql2);
$rows2 = db_numrows($result2);
$vItemId = new Valid_UInt('hide_item_id');
$vItemId->required();
if ($request->valid($vItemId)) {
$hide_item_id = $request->get('hide_item_id');
} else {
$hide_item_id = null;
}
$vFrs = new Valid_WhiteList('hide_frs', array(0, 1));
$vFrs->required();
if ($request->valid($vFrs)) {
$hide_frs = $request->get('hide_frs');
} else {
$hide_frs = null;
}
list($hide_now, $count_diff, $hide_url) = my_hide_url('frs', $group_id, $hide_item_id, $rows2, $hide_frs);
$html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/project/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A> ';
$html = '';
$count_new = max(0, $count_diff);
for ($i = 0; $i < $rows2; $i++) {
if (!$hide_now) {
$html .= '
<TR class="' . util_get_alt_row_color($i) . '">' . '<TD WIDTH="99%"> - <A HREF="/file/showfiles.php?group_id=' . $group_id . '">' . db_result($result2, $i, 'name') . '</A></TD>' . '<TD><A HREF="/file/filemodule_monitor.php?filemodule_id=' . db_result($result2, $i, 'filemodule_id') . '&group_id=' . $group_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_file') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0" ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
}
}
$html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
$html_my_monitored_fp .= $html_hdr . $html;
}
$html_my_monitored_fp .= '</table>';
}
return $html_my_monitored_fp;
}
示例2: getContent
function getContent()
{
$html_my_monitored_forums = '';
$sql = "SELECT groups.group_id, groups.group_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.status = 'A' " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' ";
$um =& UserManager::instance();
$current_user =& $um->getCurrentUser();
if ($current_user->isRestricted()) {
$projects = $current_user->getProjects();
$sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
}
$sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$html_my_monitored_forums .= $GLOBALS['Language']->getText('my_index', 'my_forums_msg');
} else {
$request =& HTTPRequest::instance();
$html_my_monitored_forums .= '<table style="width:100%">';
for ($j = 0; $j < $rows; $j++) {
$group_id = db_result($result, $j, 'group_id');
$sql2 = "SELECT forum_group_list.group_forum_id,forum_group_list.forum_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.group_id={$group_id} " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' LIMIT 100";
$result2 = db_query($sql2);
$rows2 = db_numrows($result2);
$vItemId = new Valid_UInt('hide_item_id');
$vItemId->required();
if ($request->valid($vItemId)) {
$hide_item_id = $request->get('hide_item_id');
} else {
$hide_item_id = null;
}
$vForum = new Valid_WhiteList('hide_forum', array(0, 1));
$vForum->required();
if ($request->valid($vForum)) {
$hide_forum = $request->get('hide_forum');
} else {
$hide_forum = null;
}
list($hide_now, $count_diff, $hide_url) = my_hide_url('forum', $group_id, $hide_item_id, $rows2, $hide_forum);
$html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/forum/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A> ';
$html = '';
$count_new = max(0, $count_diff);
for ($i = 0; $i < $rows2; $i++) {
if (!$hide_now) {
$group_forum_id = db_result($result2, $i, 'group_forum_id');
$html .= '
<TR class="' . util_get_alt_row_color($i) . '"><TD WIDTH="99%">' . ' - <A HREF="/forum/forum.php?forum_id=' . $group_forum_id . '">' . stripslashes(db_result($result2, $i, 'forum_name')) . '</A></TD>' . '<TD ALIGN="center"><A HREF="/my/stop_monitor.php?forum_id=' . $group_forum_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_forum') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0 ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
}
}
$html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
$html_my_monitored_forums .= $html_hdr . $html;
}
$html_my_monitored_forums .= '</table>';
}
return $html_my_monitored_forums;
}
示例3: getUGroupIdInRequest
private function getUGroupIdInRequest($request)
{
$vUgroupId = new Valid_UInt('ugroup_id');
$vUgroupId->required();
if ($request->valid($vUgroupId)) {
$ugroupId = $request->get('ugroup_id');
} else {
$ugroupId = null;
}
return $ugroupId;
}
示例4: initDisplay
function initDisplay()
{
$request =& HTTPRequest::instance();
//
// User may request a specific table id
$vVersion = new Valid_UInt('version');
$vVersion->required();
if ($request->valid($vVersion)) {
$this->version = $request->get('version');
}
$this->atf =& Docman_ApprovalTableFactoriesFactory::getFromItem($this->item, $this->version);
$this->table =& $this->atf->getTable();
}
示例5: update
public function update()
{
$vChildren = new Valid_UInt('children');
$vChildren->required();
if ($this->request->validArray($vChildren)) {
$this->dao->updateChildren($this->tracker->getId(), $this->request->get('children'));
} else {
if ($this->request->exist('children')) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_hierarchy', 'controller_bad_request'));
} else {
$this->dao->deleteAllChildren($this->tracker->getId());
}
}
$this->redirect(array('tracker' => $this->tracker->getId(), 'func' => 'admin-hierarchy'));
}
示例6: getContent
function getContent()
{
$folder_or_document = is_a($this->item, 'Docman_Folder') ? 'folder' : (is_a($this->item, 'Docman_File') ? 'file' : 'document');
$item_type = $this->_controller->_getItemFactory()->getItemTypeForItem($this->item);
$vVersion = new Valid_UInt('version');
$vVersion->required();
if ($this->_controller->request->valid($vVersion)) {
$version = $this->_controller->request->get('version');
$label = $this->_controller->request->get('label');
} else {
$version = false;
}
$content = '';
$content .= '<dl><dt>' . $GLOBALS['Language']->getText('plugin_docman', 'details_actions_delete') . '</dt><dd>';
$content .= '<form action="' . $this->url . '" method="POST">';
$content .= '<div class="docman_confirm_delete">';
if ($version !== false) {
$content .= $GLOBALS['Language']->getText('plugin_docman', 'details_delete_warning_version', array($this->hp->purify($this->item->getTitle(), CODENDI_PURIFIER_CONVERT_HTML), $version));
} else {
$content .= $GLOBALS['Language']->getText('plugin_docman', 'details_delete_warning_' . $folder_or_document, $this->hp->purify($this->item->getTitle(), CODENDI_PURIFIER_CONVERT_HTML));
}
if ($item_type == PLUGIN_DOCMAN_ITEM_TYPE_WIKI) {
$content .= $this->getWikiDeleteInfo();
}
$content .= '<div class="docman_confirm_delete_buttons">';
if ($this->token) {
$content .= '<input type="hidden" name="token" value="' . $this->token . '" />';
}
$content .= ' <input type="hidden" name="section" value="actions" />';
if ($version !== false) {
$content .= ' <input type="hidden" name="action" value="deleteVersion" />';
$content .= ' <input type="hidden" name="version" value="' . $version . '" />';
} else {
$content .= ' <input type="hidden" name="action" value="delete" />';
}
$content .= ' <input type="hidden" name="id" value="' . $this->item->getId() . '" />';
$content .= ' <input type="submit" tabindex="2" name="confirm" value="' . $GLOBALS['Language']->getText('plugin_docman', 'details_delete_confirm') . '" />';
$content .= ' <input type="submit" tabindex="1" name="cancel" value="' . $GLOBALS['Language']->getText('plugin_docman', 'details_delete_cancel') . '" />';
$content .= '</div>';
$content .= '</div>';
$content .= '</form>';
$content .= '</dd></dl>';
return $content;
}
示例7: getContent
function getContent()
{
$html = '';
$request = HTTPRequest::instance();
$um = UserManager::instance();
$user = $um->getCurrentUser();
$vFunc = new Valid_WhiteList('docman_func', array('show_docman'));
$vFunc->required();
if ($request->valid($vFunc)) {
$func = $request->get('docman_func');
} else {
$func = '';
}
$vDocmanId = new Valid_UInt('docman_id');
$vDocmanId->required();
if ($request->valid($vDocmanId)) {
$docman_id = $request->get('docman_id');
} else {
$docman_id = '';
}
$html .= '<form method="post" action="?">';
$html .= '<label>' . $GLOBALS['Language']->getText('plugin_docman', 'widget_my_docman_search_label') . '</label>';
$html .= '<input type="hidden" name="docman_func" value="show_docman" />';
$html .= '<input type="text" name="docman_id" value="' . $docman_id . '" id="docman_id" />';
$html .= ' ';
$html .= '<input type="submit" value="' . $GLOBALS['Language']->getText('plugin_docman', 'widget_my_docman_search_btn') . '"/>';
$html .= '</form>';
if ($func == 'show_docman' && $docman_id) {
$res = $this->returnAllowedGroupId($docman_id, $user);
if ($res) {
$dPm = Docman_PermissionsManager::instance($res['group_id']);
$itemPerm = $dPm->userCanAccess($user, $docman_id);
if ($itemPerm) {
$html .= '<p><a href="/plugins/docman/?group_id=' . $res['group_id'] . '&action=details&id=' . $docman_id . '§ion=properties">Show "' . $res['title'] . '" Properties</a></p>';
return $html;
}
}
$html .= '<p>' . $GLOBALS['Language']->getText('plugin_docman', 'perm_denied') . '</p>';
}
return $html;
}
示例8:
$forum_name = $request->get('forum_name');
$is_public = $request->get('is_public');
$description = $request->get('description');
$is_monitored = $request->get('is_monitored');
$fid = forum_create_forum($group_id, $forum_name, $is_public, 1, $description);
if ($is_monitored) {
forum_add_monitor($fid, user_getid());
}
}
} else {
if ($request->existAndNonEmpty('change_status')) {
/*
Change a forum to public/private
*/
$vGrpForum = new Valid_UInt('group_forum_id');
$vGrpForum->required();
if ($request->valid($vForumName) && $request->valid($vDescription) && $request->valid($vIsPublic) && $request->valid($vGrpForum)) {
$forum_name = $request->get('forum_name');
$is_public = $request->get('is_public');
$description = $request->get('description');
$group_forum_id = $request->get('group_forum_id');
$sql = "UPDATE forum_group_list SET is_public=" . db_ei($is_public) . ",forum_name='" . db_es(htmlspecialchars($forum_name)) . "'," . "description='" . db_es(htmlspecialchars($description)) . "' " . "WHERE group_forum_id=" . db_ei($group_forum_id) . " AND group_id=" . db_ei($group_id);
$result = db_query($sql);
if (!$result || db_affected_rows($result) < 1) {
$feedback .= ' ' . $Language->getText('forum_admin_index', 'upd_err') . ' ';
} else {
$feedback .= ' ' . $Language->getText('forum_admin_index', 'upd_success') . ' ';
}
}
}
}
示例9: inconsistentArtifactsIdsAreValid
private function inconsistentArtifactsIdsAreValid(array $artifact_ids)
{
$validator = new Valid_UInt();
$validator->required();
$artifact_factory = Tracker_ArtifactFactory::instance();
foreach ($artifact_ids as $artifact_id) {
if (!($validator->validate($artifact_id) && $artifact_factory->getArtifactById($artifact_id))) {
return false;
}
}
return true;
}
示例10:
<?php
require_once 'pre.php';
$valid = new Valid_UInt('tracker_id');
$valid->required();
if ($request->valid($valid)) {
if (user_get_preference('tracker_comment_invertorder_' . $request->get('tracker_id'))) {
user_del_preference('tracker_comment_invertorder_' . $request->get('tracker_id'));
} else {
user_set_preference('tracker_comment_invertorder_' . $request->get('tracker_id'), '1');
}
}
示例11: updatePreferences
function updatePreferences($request)
{
$done = false;
$vContentId = new Valid_UInt('content_id');
$vContentId->required();
if (($rss = $request->get('rss')) && $request->valid($vContentId)) {
$vUrl = new Valid_String('url');
if ($request->validInArray('rss', $vUrl)) {
$url = " url = '" . db_escape_string($rss['url']) . "' ";
} else {
$url = '';
}
$vTitle = new Valid_String('title');
if ($request->validInArray('rss', $vTitle)) {
$title = " title = '" . db_escape_string($rss['title']) . "' ";
} else {
$title = '';
}
if ($url || $title) {
$sql = "UPDATE widget_rss SET " . $title . ", " . $url . " WHERE owner_id = " . $this->owner_id . " AND owner_type = '" . $this->owner_type . "' AND id = " . (int) $request->get('content_id');
$res = db_query($sql);
$done = true;
}
}
return $done;
}
示例12: deleteAttachments
/**
* Perform wiki attachment removal.
*/
function deleteAttachments()
{
$request = HTTPRequest::instance();
if ($request->isPost() && $request->exist('attachments_to_delete')) {
$args = $request->get('attachments_to_delete');
$deleteStatus = true;
$um = UserManager::instance();
$user = $um->getCurrentUser();
foreach ($args as $id) {
$valid = new Valid_UInt('repo_id');
$valid->required();
if ($valid->validate($id)) {
$wa = new WikiAttachment();
$wa->initWithId($id);
if ($wa->validate() && $wa->gid == $_REQUEST['group_id'] && $wa->isAutorized($user->getId())) {
if (!$wa->deleteAttachment()) {
$deleteStatus = false;
}
} else {
$deleteStatus = false;
}
} else {
$deleteStatus = false;
}
}
if ($deleteStatus) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('wiki_actions_wikiserviceadmin', 'delete_attachment_success'));
} else {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('wiki_actions_wikiserviceadmin', 'delete_attachment_failure'));
}
}
}
示例13: array
$vRelative = new Valid_WhiteList('relative', array('true'));
$vRelative->required();
if ($request->valid($vRelative)) {
$relative = true;
} else {
$relative = false;
}
$vOrder = new Valid_WhiteList('order', array('start_size', 'end_size', 'evolution', 'evolution_rate'));
$vOrder->required();
if ($request->valid($vOrder)) {
$order = $request->get('order');
} else {
$order = 'end_size';
}
$vOffset = new Valid_UInt('offset');
$vOffset->required();
if ($request->valid($vOffset)) {
$offset = $request->get('offset');
} else {
$offset = 0;
}
$title = 'Disk usage';
$GLOBALS['HTML']->includeCalendarScripts();
$GLOBALS['HTML']->header(array('title' => $title));
echo '<h1>' . $title . '</h1>';
echo '
<table>
<tr>
<th align="center">Service/Projects</th>
<th align="center">Users</th>
</tr>
示例14: FRSFileFactory
<?php
//
// Codendi
// Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
// Copyright (c) Enalean, 2015. All Rights Reserved.
// http://www.codendi.com
//
//
require_once 'pre.php';
require_once 'common/frs/FRSFileFactory.class.php';
require_once 'common/frs/FRSPackageFactory.class.php';
$vGroupId = new Valid_GroupId();
$vGroupId->required();
$vFileId = new Valid_UInt('file_id');
$vFileId->required();
if ($request->valid($vGroupId) && $request->valid($vFileId)) {
$group_id = $request->get('group_id');
$file_id = $request->get('file_id');
} else {
exit_missing_param();
}
$frsff = new FRSFileFactory();
$frspf = new FRSPackageFactory();
// Must have a group_id and file_id otherwise
// we cannot do much
if (!$file_id || !$group_id) {
exit_missing_param();
}
if (!$GLOBALS['sys_frs_license_mandatory']) {
// Display license popup?
示例15: CSRFSynchronizerToken
<?php
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright (c) Enalean, 2015. All rights reserved
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
require_once 'pre.php';
require_once 'bookmarks.php';
require_once 'my_utils.php';
$request = HTTPRequest::instance();
$vId = new Valid_UInt('bookmark_id');
$vId->setErrorMessage('bookmark_id is required');
$vId->required();
if (!$request->valid($vId)) {
$GLOBALS['Response']->redirect('/my');
} else {
$bookmark_id = (int) $request->get('bookmark_id');
}
$vUrl = new Valid_String('bookmark_url');
$vUrl->setErrorMessage('Url is required');
$vUrl->required();
$vTitle = new Valid_String('bookmark_title');
$vTitle->setErrorMessage('Title is required');
$vTitle->required();
$bookmark_url_id = '/my/bookmark_edit.php?bookmark_id=' . $bookmark_id;
$csrf_token = new CSRFSynchronizerToken($bookmark_url_id);
if ($request->isPost() && $request->valid($vUrl) && $request->valid($vTitle)) {
$csrf_token->check();
$bookmark_url = $request->get('bookmark_url');