本文整理汇总了PHP中user_ismember函数的典型用法代码示例。如果您正苦于以下问题:PHP user_ismember函数的具体用法?PHP user_ismember怎么用?PHP user_ismember使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_ismember函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: svn_header
function svn_header($params)
{
global $group_id, $Language, $there_are_specific_permissions;
$params['toptab'] = 'svn';
$params['group'] = $group_id;
$project = ProjectManager::instance()->getProject($group_id);
$service = $project->getService('svn');
if (!$service) {
exit_error($Language->getText('global', 'error'), $Language->getText('svn_utils', 'svn_off'));
}
$toolbar = array();
$toolbar[] = array('title' => $Language->getText('svn_utils', 'svn_info'), 'url' => '/svn/?func=info&group_id=' . $group_id);
if ($project->isPublic() || user_isloggedin()) {
$toolbar[] = array('title' => $Language->getText('svn_utils', 'browse_tree'), 'url' => '/svn/viewvc.php/?roottype=svn&root=' . $project->getUnixName(false));
}
if (user_isloggedin()) {
$toolbar[] = array('title' => $Language->getText('svn_utils', 'my_ci'), 'url' => '/svn/?func=browse&group_id=' . $group_id . '&set=my');
$toolbar[] = array('title' => $Language->getText('svn_utils', 'svn_query'), 'url' => '/svn/?func=browse&group_id=' . $group_id);
}
if (user_ismember($group_id, 'A') || user_ismember($group_id, 'SVN_ADMIN')) {
$toolbar[] = array('title' => $Language->getText('svn_utils', 'svn_admin'), 'url' => '/svn/admin/?group_id=' . $group_id);
if (isset($params['path']) && !empty($params['path'])) {
// TODO: Validate the path
$toolbar[] = array('title' => $Language->getText('svn_utils', 'notif'), 'url' => '/svn/admin/?group_id=' . $group_id . '&func=notification&path=' . $params['path']);
}
}
if (!isset($params['help']) || !$params['help']) {
$params['help'] = "svn.html";
}
$toolbar[] = array('title' => $Language->getText('global', 'help'), 'url' => 'javascript:help_window(\'' . get_server_url() . '/doc/' . UserManager::instance()->getCurrentUser()->getShortLocale() . '/user-guide/' . $params['help'] . '\');');
$service->displayHeader($params['title'], array(array('title' => $params['title'], 'url' => '/svn/?group_id=' . $group_id)), $toolbar);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:32,代码来源:svn_utils.php
示例2: PHPWikiService
/**
* Constructor
*/
function PHPWikiService($id)
{
global $LANG, $is_wiki_page;
//used so the search box will add the necessary element to the pop-up box
$is_wiki_page = 1;
/*
* Check given id
*/
$this->gid = (int) $id;
if (empty($this->gid)) {
exit_no_group();
}
$pm = ProjectManager::instance();
$go = $pm->getProject($this->gid);
if (!$go) {
exit_no_group();
}
$this->wiki = new PHPWiki($this->gid);
// Check access right
$this->checkPermissions();
// If Wiki for project doesn't exist, propose creation ... if user is project admin or wiki admin
if (!$this->wiki->exist()) {
if (!user_ismember($this->gid, 'W2') && !user_ismember($this->gid, 'A')) {
exit_wiki_empty();
}
}
// Set language for phpWiki
if ($this->wiki->getLanguage_id()) {
define('DEFAULT_LANGUAGE', $this->wiki->getLanguage_id());
$LANG = $this->wiki->getLanguage_id();
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:35,代码来源:PHPWikiService.class.php
示例3: survey_header
function survey_header($params)
{
global $group_id, $is_admin_page, $Language;
$params['toptab'] = 'survey';
$params['group'] = $group_id;
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
if (!$project->usesSurvey()) {
exit_error($Language->getText('global', 'error'), $Language->getText('survey_s_utils', 's_off'));
}
site_project_header($params);
echo "<P><B>";
// Admin link is displayed only if the user is a project administrator
if (user_ismember($group_id, 'A')) {
echo "<A HREF=\"/survey/admin/?group_id={$group_id}\">" . $Language->getText('survey_s_utils', 'admin') . "</A>";
}
if ($is_admin_page && $group_id && user_ismember($group_id, 'A')) {
echo " | <A HREF=\"/survey/admin/add_survey.php?group_id={$group_id}\">" . $Language->getText('survey_admin_index', 'add_s') . "</A>";
echo " | <A HREF=\"/survey/admin/edit_survey.php?func=browse&group_id={$group_id}\">" . $Language->getText('survey_admin_browse_survey', 'edit_s') . "</A>";
echo " | <A HREF=\"/survey/admin/add_question.php?group_id={$group_id}\">" . $Language->getText('survey_admin_index', 'add_q') . "</A>";
echo " | <A HREF=\"/survey/admin/edit_question.php?func=browse&group_id={$group_id}\">" . $Language->getText('survey_admin_browse_question', 'edit_q') . "</A>";
echo " | <A HREF=\"/survey/admin/show_results.php?group_id={$group_id}\">" . $Language->getText('survey_s_utils', 'show_r') . "</A>";
}
if (isset($params['help'])) {
if (user_ismember($group_id, 'A')) {
echo ' | ';
}
echo help_button($params['help'], false, $Language->getText('global', 'help'));
}
echo "</B><P>";
}
开发者ID:nterray,项目名称:tuleap,代码行数:31,代码来源:survey_utils.php
示例4: checkAccess
private function checkAccess()
{
try {
$project = $this->getProjectFromRequest();
} catch (Exception $e) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('include_html', 'g_not_exist'));
}
// admin pages can be reached by news admin (N2) or project admin (A)
if (!user_ismember($project->getID(), 'A') && !user_ismember($project->getID(), 'N2')) {
exit_error($GLOBALS['Language']->getText('news_admin_index', 'permission_denied'), $GLOBALS['Language']->getText('news_admin_index', 'need_to_be_admin'));
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:ChooseNewsItemController.class.php
示例5: header
function header()
{
$request = HTTPRequest::instance();
$group_id = $request->get('group_id');
if ($this->getControler()->view == 'codendi_im_admin') {
$GLOBALS['HTML']->header(array('title' => $this->_getTitle(), 'selected_top_tab' => 'admin'));
} else {
$GLOBALS['HTML']->header(array('title' => $this->_getTitle(), 'group' => $group_id, 'toptab' => 'IM'));
if (user_ismember($request->get('group_id'))) {
echo '<b><a href="/plugins/IM/?group_id=' . $request->get('group_id') . '&action=muc_logs">' . $GLOBALS['Language']->getText('plugin_im', 'toolbar_muc_logs') . '</a> | </b>';
}
echo $this->_getHelp();
}
}
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:14,代码来源:IMViews.class.php
示例6: validate
function validate($data)
{
if (!$data['project']['built_from_template']) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('register_projectname', 'info_missed'));
return false;
} else {
$pm = ProjectManager::instance();
$p = $pm->getProject($data['project']['built_from_template']);
if (!$p->isTemplate() && !user_ismember($data['project']['built_from_template'], 'A')) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('global', 'perm_denied'));
return false;
}
}
return true;
}
开发者ID:nterray,项目名称:tuleap,代码行数:15,代码来源:RegisterProjectStep_Template.class.php
示例7: PHPWikiServiceAdmin
function PHPWikiServiceAdmin($id)
{
global $LANG, $is_wiki_page;
//used so the search box will add the necessary element to the pop-up box
$is_wiki_page = 1;
$this->gid = (int) $id;
if (empty($this->gid)) {
exit_no_group();
}
if (!user_ismember($this->gid, 'W2')) {
exit_permission_denied();
}
$this->wiki = new PHPWiki($this->gid);
// If Wiki for project doesn't exist, propose creation...
if (!$this->wiki->exist()) {
header('Location: ' . PHPWIKI_PLUGIN_BASE_URL . '/index.php?group_id=' . $this->gid . '&view=install');
}
// Set language for phpWiki
if ($this->wiki->getLanguage_id()) {
define('DEFAULT_LANGUAGE', $this->wiki->getLanguage_id());
$LANG = $this->wiki->getLanguage_id();
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:PHPWikiServiceAdmin.class.php
示例8: mail_header
function mail_header($params)
{
global $group_id, $Language;
//required for site_project_header
$params['group'] = $group_id;
$params['toptab'] = 'mail';
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
if (!$project->usesMail()) {
exit_error($Language->getText('global', 'error'), $Language->getText('mail_utils', 'mail_turned_off'));
}
site_project_header($params);
echo '<P><B>';
// admin link is only displayed if the user is a project administrator
if (user_ismember($group_id, 'A')) {
echo '<A HREF="/mail/admin/?group_id=' . $group_id . '">' . $Language->getText('mail_utils', 'admin') . '</A>';
echo ' | ';
}
if ($params['help']) {
echo help_button($params['help'], false, $Language->getText('global', 'help'));
}
echo '</B><P>';
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:mail_utils.php
示例9: _CodendiPassUser
function _CodendiPassUser($UserName = '', $prefs = false)
{
if ($prefs) {
$this->_prefs = $prefs;
}
/* Actually, we cannot set preferences here because PhpWiki instanciate
* _PassUser class before. So we had to modify _PassUser constructor to
instanciate CodendiUserPreferences instead of UserPreferences.
* if (!$this->_prefs) {
$this->_prefs = new CodendiUserPreferences();
$this->hasHomePage();
$this->getPreferences();
print_r($this->_prefs);
}*/
$this->_userid = $UserName;
if (!isset($this->_prefs->_method)) {
_PassUser::_PassUser($this->_userid);
}
switch ($this->_userid) {
case '':
case 'NA':
$this->_level = WIKIAUTH_ANON;
break;
case 'admin':
$this->_level = WIKIAUTH_ADMIN;
// admin Codendi
break;
default:
$this->_level = WIKIAUTH_USER;
}
if (user_ismember(GROUP_ID, 'W2')) {
$this->_level = WIKIAUTH_ADMIN;
}
//admin wiki
$this->_authmethod = 'Codendi';
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:Codendi.php
示例10: getIntFromRequest
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'survey/survey_utils.php';
$is_admin_page = 'y';
$group_id = getIntFromRequest('group_id');
$survey_id = getIntFromRequest('survey_id');
$customer_id = getIntFromRequest('customer_id');
survey_header(array('title' => _('Results')));
if (!session_loggedin() || !user_ismember($group_id, 'A')) {
echo "<h1>" . _('Permission denied') . "</h1>";
survey_footer(array());
exit;
}
?>
<form action="none">
<?php
/*
Select this survey from the database
*/
$sql = "SELECT * FROM surveys WHERE survey_id='{$survey_id}' AND group_id='{$group_id}'";
$result = db_query($sql);
echo "\n<h2>" . db_result($result, 0, "survey_title") . "</h2><p> </p>";
/*
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:show_results_individual.php
示例11: exit_no_group
exit_no_group();
}
// Check permissions
$Group =& group_get_object_by_name($projectName);
if (!$Group || !is_object($Group) || $Group->isError()) {
exit_no_group();
}
if (!$Group->usesSCM()) {
exit_error(_('Error'), _('Error - This project has turned off SCM.'));
}
// check if the scm_box is located in another server
$scm_box = $Group->getSCMBox();
//$external_scm = (gethostbyname($sys_default_domain) != gethostbyname($scm_box));
$external_scm = !$sys_scm_single_host;
if (session_loggedin()) {
if (user_ismember($Group->getID())) {
$perm =& $Group->getPermission(session_get_user());
if (!($perm && is_object($perm) && $perm->isCVSReader()) && !$Group->enableAnonSCM()) {
exit_permission_denied();
}
} else {
if (!$Group->enableAnonSCM()) {
exit_permission_denied();
}
}
} else {
if (!$Group->enableAnonSCM()) {
// user is not logged in... check if group accepts anonymous CVS
exit_permission_denied();
}
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:viewvc.php
示例12: outerTabs
function outerTabs($params)
{
global $Language;
$TABS_DIRS[] = '/';
$TABS_TITLES[] = $Language->getText('menu', 'home');
if (user_isloggedin()) {
$TABS_DIRS[] = '/my/';
$TABS_TITLES[] = $Language->getText('menu', 'my_personal_page');
}
if ($GLOBALS['sys_use_trove'] != 0) {
$TABS_DIRS[] = '/softwaremap/';
$TABS_TITLES[] = $Language->getText('menu', 'projectree');
}
if ($GLOBALS['sys_use_snippet'] != 0) {
$TABS_DIRS[] = '/snippet/';
$TABS_TITLES[] = $Language->getText('menu', 'code_snippet');
}
if (user_ismember(1, 'A')) {
$TABS_DIRS[] = '/admin/';
$TABS_TITLES[] = $Language->getText('menu', 'admin');
}
$TABS_DIRS[] = '/site/';
$TABS_TITLES[] = $Language->getText('include_layout', 'Help');
/*
if (user_ismember($GLOBALS['sys_stats_group'])) {
$TABS_DIRS[]='/reporting/';
$TABS_TITLES[]=$Language->getText('menu','reporting');
}
*/
$selected_top_tab = isset($params['selected_top_tab']) ? $params['selected_top_tab'] : '';
if (isset($params['group']) && $params['group']) {
// get group info using the common result set
$pm = ProjectManager::instance();
$project = $pm->getProject($params['group']);
if ($project && is_object($project)) {
if ($project->isError()) {
} else {
$selected = array_search("/softwaremap/", $TABS_DIRS);
}
}
} else {
if (strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/themes/') || strstr(getStringFromServer('REQUEST_URI'), '/account/')) {
$selected = array_search("/my/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), 'softwaremap')) {
$selected = array_search("/softwaremap/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/snippet/')) {
$selected = array_search("/snippet/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/site/')) {
$selected = array_search("/site/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/reporting/')) {
$selected = array_search('/reporting/', $TABS_DIRS);
} elseif ((strstr(getStringFromServer('REQUEST_URI'), '/admin/') || $selected_top_tab == 'admin') && user_ismember(1, 'A')) {
$selected = array_search('/admin/', $TABS_DIRS);
} elseif ($selected_top_tab && array_search($selected_top_tab, $TABS_DIRS) !== FALSE) {
$selected = array_search($selected_top_tab, $TABS_DIRS);
} else {
$selected = 0;
}
}
echo $this->tabGenerator($TABS_DIRS, $TABS_TITLES, false, $selected, null, '100%');
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:61,代码来源:TabbedLayout.class.php
示例13: isInDebugMode
private function isInDebugMode()
{
return ForgeConfig::get('DEBUG_MODE') && (ForgeConfig::get('DEBUG_DISPLAY_FOR_ALL') || user_ismember(1, 'A'));
}
开发者ID:rinodung,项目名称:tuleap,代码行数:4,代码来源:FlamingParrot_Theme.class.php
示例14: check_cvs_access
function check_cvs_access($username, $group_name, $cvspath)
{
$pm = ProjectManager::instance();
$project = $pm->getProjectByUnixName($group_name);
//accept old url containing a .diff at the end of the filename
if (strpos($cvspath, '.diff') == strlen($cvspath) - 5) {
$cvspath = substr($cvspath, 0, strlen($cvspath) - 5);
}
// if the file path exists as such then it's a directory
// else add the ,v extension because it's a file
$path = "/cvsroot/" . $group_name . '/' . $cvspath;
if (!is_dir($path)) {
$path = $path . ',v';
}
$mode = fileperms($path);
// Also check permissions on top directory (in case of private repo)
$mode_top = fileperms("/cvsroot/" . $group_name);
// A directory that is not world readable can only be viewed
// through viewvc if the user is a project member
if ($project && (($mode_top & 0x4) == 0 || ($mode & 0x4) == 0) && !user_ismember($project->getID())) {
return false;
} else {
return true;
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:25,代码来源:commit_utils.php
示例15: outerTabs
function outerTabs($params)
{
global $Language, $sys_use_trove, $sys_use_snippet;
$selected_top_tab = '';
if (isset($params['selected_top_tab'])) {
$selected_top_tab = $params['selected_top_tab'];
}
$menuTree = new TreeNode();
$sthSelected = false;
$menuTree->addChild(new TreeNode(array('link' => '/', 'title' => $Language->getText('menu', 'home'))));
// We need to keep a reference on this node in order to set the
// selected value in the data. See bottom of this function.
$homeNode =& $menuTree->getChild(0);
if (user_isloggedin()) {
$selected = isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/' || strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/account/');
$sthSelected = $sthSelected || $selected;
$mynode = new TreeNode(array('link' => '/my/', 'title' => $Language->getText('menu', 'my_personal_page'), 'selected' => $selected));
if ($selected) {
$selected = isset($params['selected_top_tab']) && $params['selected_top_tab'] == '/my/' || (bool) strstr(getStringFromServer('REQUEST_URI'), '/my/');
$mynode->addChild(new TreeNode(array('link' => '/my/', 'title' => $Language->getText('my_index', 'my_dashboard'), 'selected' => $selected)));
$selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/account/');
$mynode->addChild(new TreeNode(array('link' => '/account/', 'title' => $Language->getText('my_index', 'account_maintenance'), 'selected' => $selected)));
}
$menuTree->addChild($mynode);
} else {
$selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/my/');
$sthSelected = $sthSelected || $selected;
$menuTree->addChild(new TreeNode(array('link' => '/my/', 'title' => $Language->getText('menu', 'my_personal_page'), 'selected' => $selected)));
}
if ($GLOBALS['sys_use_trove'] != 0 || isset($params['group']) && $params['group']) {
$selected = false;
if (isset($params['group']) && $params['group']) {
// get group info using the common result set
$pm = ProjectManager::instance();
$project = $pm->getProject($params['group']);
if ($project && is_object($project)) {
if ($project->isError()) {
die('is error');
} else {
$sthSelected = true;
$projTree = $this->project_tabs($params['toptab'], $params['group']);
$projTree->setData(array('link' => '/softwaremap/', 'title' => $Language->getText('menu', 'projectree'), 'selected' => true));
//'link'=>'/projects/'.$project->getUnixName().'/'
//,'title'=>$project->getPublicName()
//,'selected' => true));
$menuTree->addChild($projTree);
}
}
} else {
$selected = (bool) strstr(getStringFromServer('REQUEST_URI'), 'softwaremap');
$sthSelected = $sthSelected || $selected;
$menuTree->addChild(new TreeNode(array('link' => '/softwaremap/', 'title' => $Language->getText('menu', 'projectree'), 'selected' => $selected)));
}
}
if ($GLOBALS['sys_use_snippet'] != 0) {
$selected = (bool) strstr(getStringFromServer('REQUEST_URI'), '/snippet/');
$sthSelected = $sthSelected || $selected;
$menuTree->addChild(new TreeNode(array('link' => '/snippet/', 'title' => $Language->getText('menu', 'code_snippet'), 'selected' => $selected)));
}
if (user_ismember(1, 'A')) {
$selected = strpos(getStringFromServer('REQUEST_URI'), '/admin/') === 0 || $selected_top_tab === 'admin';
$sthSelected = $sthSelected || $selected;
$menuTree->addChild(new TreeNode(array('link' => '/admin/', 'title' => $Language->getText('menu', 'admin'), 'selected' => $selected)));
}
$selected = (bool) (strstr(getStringFromServer('REQUEST_URI'), '/site/') || $selected_top_tab === 'site');
$sthSelected = $sthSelected || $selected;
$menuTree->addChild(new TreeNode(array('link' => '/site/', 'title' => $Language->getText('include_layout', 'Help'), 'selected' => $selected)));
$additional_tabs = array();
include $GLOBALS['Language']->getContent('layout/extra_tabs', null, null, '.php');
foreach ($additional_tabs as $t) {
$sthSelected = $sthSelected || $t['selected'];
$menuTree->addChild(new TreeNode($t));
}
// Set selected value for 'home' link (this is the selected tab
// if no other was previously selected)
$homeNodeData =& $homeNode->getData();
$homeNodeData['selected'] = !$sthSelected;
$buildMenuVisitor = new BuildMenuVisitor();
$menuTree->accept($buildMenuVisitor);
echo $buildMenuVisitor->getHtml();
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:81,代码来源:DivBasedTabbedLayout.class.php
示例16: displayMenu
/**
* displayMenu - public
*/
function displayMenu()
{
print '
<table class="ServiceMenu">
<tr>
<td>';
switch (DEFAULT_LANGUAGE) {
case 'fr_FR':
$attatch_page = "DéposerUnFichier";
$preferences_page = "PréférencesUtilisateurs";
break;
case 'en_US':
default:
$attatch_page = 'UpLoad';
$preferences_page = 'UserPreferences';
break;
}
$attatch_menu = $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuattch');
$preferences_menu = $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuprefs');
$help_menu = $GLOBALS['Language']->getText('global', 'help');
print '
<ul class="ServiceMenu">
<li><a href="' . $this->wikiLink . '&view=browsePages">' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menupages') . '</a> | </li>';
if (UserManager::instance()->getCurrentUser()->isLoggedIn()) {
print '<li><a href="javascript:help_window(\'' . $this->wikiLink . '&pagename=' . $attatch_page . '&pv=1\')">' . $attatch_menu . '</a> | </li>';
print '<li><a href="' . $this->wikiLink . '&pagename=' . $preferences_page . '">' . $preferences_menu . '</a> | </li>';
}
if (user_ismember($this->gid, 'W2')) {
print '<li><a href="' . $this->wikiAdminLink . '">' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'menuadmin') . '</a> | </li>';
}
print '<li>' . help_button('WikiService.html', false, $help_menu) . '</li>
</ul>';
print '
</td>
<td align="right" valign="top">';
if (user_ismember($this->gid, 'W2')) {
$wiki = new Wiki($this->gid);
$permInfo = "";
if ('wiki' == $this->view) {
// User is browsing a wiki page
$wp = new WikiPage($this->gid, $_REQUEST['pagename']);
$permLink = $this->wikiAdminLink . '&view=pagePerms&id=' . $wp->getId();
if ($wp->permissionExist()) {
$permInfo = '<a href="' . $permLink . '"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_title_spec') . '"/></a>';
}
}
if ($wiki->permissionExist()) {
$permInfo .= '<a href="/wiki/admin/index.php?group_id=' . $this->gid . '&view=wikiPerms"> ' . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_alt') . '" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lock_title_set') . '"/>' . '</a>';
}
if ($permInfo) {
print $permInfo;
}
}
//Display printer_version link only in wiki pages
if (isset($_REQUEST['pagename'])) {
print '
(<a href="' . $_SERVER['REQUEST_URI'] . '&pv=1" title="' . $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'lighter_display') . '">
<img src="' . util_get_image_theme("msg.png") . '" border="0"> ' . $GLOBALS['Language']->getText('global', 'printer_version') . '</A> )
</li>';
}
print '
</td>
</tr>
</table>';
}
开发者ID:nterray,项目名称:tuleap,代码行数:68,代码来源:WikiServiceViews.class.php
示例17: exit_no_group
// Codendi
// Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
// http://www.codendi.com
//
//
//
// Originally written by Quentin Cregan, SourceForge 06/2000
// Modified by Laurent Julliard 2001-2004, Codendi Team, Xerox
require_once 'pre.php';
require_once '../doc_utils.php';
require_once 'www/project/admin/project_admin_utils.php';
require_once 'www/project/admin/permissions.php';
if (!$group_id) {
exit_no_group();
}
if (!user_ismember($group_id, "D2")) {
$feedback .= $Language->getText('docman_admin_index', 'error_perm');
exit_permission_denied();
}
function main_page($group_id)
{
global $Language;
docman_header_admin(array('title' => $Language->getText('docman_admin_index', 'title')));
echo '<h2>' . $Language->getText('docman_admin_index', 'header_doc_mgt') . '</h2>';
display_docs($group_id);
docman_footer(array());
}
function group_main_page($group_id)
{
global $Language;
docman_header_admin(array('title' => $Language->getText('docman_admin_index', 'title_group_mgt')));
开发者ID:pombredanne,项目名称:tuleap,代码行数:31,代码来源:index.php
示例18: VALUES
<?php
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
//
require_once 'pre.php';
require '../people_utils.php';
if (user_ismember(1, 'A')) {
if ($post_changes) {
/*
Update the database
*/
if ($people_cat) {
$sql = "INSERT INTO people_job_category (name) VALUES ('{$cat_name}')";
$result = db_query($sql);
if (!$result) {
echo db_error();
$feedback .= ' ' . $Language->getText('people_admin_index', 'insert_error') . ' ';
}
$feedback .= ' ' . $Language->getText('people_admin_index', 'category_inserted') . ' ';
} else {
if ($people_skills) {
$sql = "INSERT INTO people_skill (name) VALUES ('{$skill_name}')";
$result = db_query($sql);
if (!$result) {
echo db_error();
$feedback .= ' ' . $Language->getText('people_admin_index', 'insert_error') . ' ';
}
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:31,代码来源:index.php
示例19: frs_process_release_form
//.........这里部分代码省略.........
if ($is_update) {
$res = $frsrf->update($array);
if (!$res) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_update_failed'));
//insert failed - go back to definition screen
} else {
//release added - now show the detail page for this new release
$release_id = $array['release_id'];
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_updated', $release['name']));
}
} else {
$res = $frsrf->create($array);
if (!$res) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language'] > getText('file_admin_editreleases', 'add_rel_fail'));
//insert failed - go back to definition screen
} else {
//release added - now show the detail page for this new release
$release_id = $res;
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_added'));
}
}
if ($res) {
// extract cross references
$reference_manager =& ReferenceManager::instance();
$reference_manager->extractCrossRef($release['release_notes'], $release_id, ReferenceManager::REFERENCE_NATURE_RELEASE, $group_id);
$reference_manager->extractCrossRef($release['change_log'], $release_id, ReferenceManager::REFERENCE_NATURE_RELEASE, $group_id);
//set the release permissions
list($return_code, $feedbacks) = permission_process_selection_form($group_id, 'RELEASE_READ', $release_id, $ugroups);
if (!$return_code) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editpackages', 'perm_update_err'));
$GLOBALS['Response']->addFeedback('error', $feedbacks);
}
//submit news if requested
if ($release_id && user_ismember($group_id, 'A') && $release_submit_news) {
news_submit($group_id, $release_news_subject, $release_news_details, $private_news, 3);
}
// Send notification
if ($notification) {
$rel = $frsrf->getFRSReleaseFromDb($release_id);
$count = $frsrf->emailNotification($rel);
if ($count === false) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])));
} else {
if ($count > 0) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'email_sent', $count));
}
}
}
$group = $pm->getProject($group_id);
$group_unix_name = $group->getUnixName(false);
$project_files_dir = $GLOBALS['ftp_frs_dir_prefix'] . '/' . $group_unix_name;
if ($is_update) {
$files =& $rel->getFiles();
//remove files
foreach ($release_files_to_delete as $rel_file) {
$res =& $frsff->getFRSFileFromDb($rel_file);
$fname = $res->getFileName();
$res = $frsff->delete_file($group_id, $rel_file);
if ($res == 0) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editreleases', 'f_not_yours', basename($fname)));
} else {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'file_deleted', basename($fname)));
}
}
//update files
$index = 0;
开发者ID:rinodung,项目名称:tuleap,代码行数:67,代码来源:file_utils.php
示例20: mainMenu
function mainMenu($params)
{
global $sys_use_trove, $sys_use_snippet, $sys_use_people;
$TABS_DIRS[] = '/';
$TABS_DIRS[] = '/my/';
if ($sys_use_trove) {
$TABS_DIRS[] = '/softwaremap/';
}
if ($sys_use_snippet) {
$TABS_DIRS[] = '/snippet/';
}
if ($sys_use_people) {
$TABS_DIRS[] = '/people/';
}
$TABS_TITLES[] = _('Home');
$TABS_TITLES[] = _('My Page');
if ($sys_use_trove) {
$TABS_TITLES[] = _('Project Tree');
}
if ($sys_use_snippet) {
$TABS_TITLES[] = _('Code Snippets');
}
if ($sys_use_people) {
$TABS_TITLES[] = _('Project Openings');
}
// outermenu hook
$PLUGIN_TABS_DIRS = array();
$hookParams['DIRS'] =& $PLUGIN_TABS_DIRS;
$hookParams['TITLES'] =& $TABS_TITLES;
plugin_hook("outermenu", $hookParams);
$TABS_DIRS = array_merge($TABS_DIRS, $PLUGIN_TABS_DIRS);
if (user_ismember(1, 'A')) {
$TABS_DIRS[] = '/admin/';
$TABS_TITLES[] = _('Admin');
}
if (user_ismember($GLOBALS['sys_stats_group'])) {
$TABS_DIRS[] = '/reporting/';
$TABS_TITLES[] = _('Reporting');
}
if (isset($params['group']) && $params['group']) {
// get group info using the common result set
$project =& group_get_object($params['group']);
if ($project && is_object($project)) {
if ($project->isError()) {
} elseif (!$project->isProject()) {
} else {
if (isset($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
$TABS_DIRS[] = '/project/?group_id=' . $params['group'];
} else {
$TABS_DIRS[] = '/projects/' . $project->getUnixName() . '/';
}
$TABS_TITLES[] = $project->getPublicName();
$selected = count($TABS_DIRS) - 1;
}
}
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/my/') || strstr(getStringFromServer('REQUEST_URI'), '/account/') || strstr(getStringFromServer('REQUEST_URI'), '/themes/')) {
$selected = array_search("/my/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), 'softwaremap')) {
$selected = array_search("/softwaremap/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/snippet/')) {
$selected = array_search("/snippet/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/people/')) {
$selected = array_search("/people/", $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/reporting/')) {
$selected = array_search('/reporting/', $TABS_DIRS);
} elseif (strstr(getStringFromServer('REQUEST_URI'), '/admin/') && user_ismember(1, 'A')) {
$selected = array_search('/admin/', $TABS_DIRS);
} elseif (count($PLUGIN_TABS_DIRS) > 0) {
foreach ($PLUGIN_TABS_DIRS as $PLUGIN_TABS_DIRS_VALUE) {
if (strstr($GLOBALS['REQUEST_URI'], $PLUGIN_TABS_DIRS_VALUE)) {
$selected = array_search($PLUGIN_TABS_DIRS_VALUE, $TABS_DIRS);
break;
}
}
} else {
$selected = 0;
}
if (!isset($this->COLOR_SELECTED_TAB)) {
$this->COLOR_SELECTED_TAB = '#e0e0e0';
}
echo $this->tabGenerator($TABS_DIRS, $TABS_TITLES, false, $selected, $this->COLOR_SELECTED_TAB, '100%');
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:82,代码来源:Theme.class.php
注:本文中的user_ismember函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有 |
请发表评论