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

PHP exit_no_group函数代码示例

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

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



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

示例1: docman_header

function docman_header($title, $pagehead, $style = 'xyz')
{
    global $group_id, $HTML, $sys_use_docman;
    if (!$sys_use_docman) {
        exit_disabled();
    }
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    if (!$project->usesDocman()) {
        exit_error(_('Error'), _('This project has turned off the Doc Manager.'));
    }
    site_project_header(array('title' => $title, 'group' => $group_id, 'toptab' => 'docman'));
    $menu_text = array();
    $menu_links = array();
    $menu_text[] = _('Submit new documentation');
    $menu_links[] = '/docman/new.php?group_id=' . $group_id;
    $menu_text[] = _('View Documentation');
    $menu_links[] = '/docman/index.php?group_id=' . $group_id;
    $menu_text[] = _('Search in documents');
    $menu_links[] = '/docman/search.php?group_id=' . $group_id;
    if (session_loggedin()) {
        $perm =& $project->getPermission(session_get_user());
        if ($perm && is_object($perm) && !$perm->isError() && $perm->isDocEditor()) {
            $menu_text[] = _('Admin');
            $menu_links[] = '/docman/admin/index.php?group_id=' . $group_id;
        }
    }
    echo $HTML->subMenu($menu_text, $menu_links);
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:doc_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: display_groups_option

function display_groups_option($group_id = false, $checkedval = 'xyxy')
{
    if (!$group_id) {
        exit_no_group();
    } else {
        $query = "select doc_group, groupname " . "from doc_groups " . "where group_id = {$group_id} " . "order by groupname";
        $result = db_query($query);
        echo html_build_select_box($result, 'doc_group', $checkedval);
    }
    //end else
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:11,代码来源:doc_utils.php


示例4: pm_header

function pm_header($params)
{
    // XXX ogi: What to do with these?
    global $group_id, $is_pm_page, $words, $group_project_id, $HTML, $order, $pg, $sys_use_pm;
    if (!$sys_use_pm) {
        exit_disabled();
    }
    //required by site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'pm';
    //only projects can use the bug tracker, and only if they have it turned on
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    if (!$project->usesPm()) {
        exit_error(_('Error'), _('This Project Has Turned Off The Task Manager'));
    }
    site_project_header($params);
    $labels = array();
    $links = array();
    if ($group_project_id) {
        $labels[] = ($pg ? $pg->getName() . ': ' : '') . _('Browse tasks');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=browse';
        if (session_loggedin()) {
            $labels[] = _('Add task');
            $links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=addtask';
        }
        if ($group_project_id) {
            $gantt_width = 820;
            $gantt_height = 680;
            $gantt_url = "/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=ganttpage";
            $gantt_title = _('Gantt Chart');
            $gantt_winopt = 'scrollbars=yes,resizable=yes,toolbar=no,height=' . $gantt_height . ',width=' . $gantt_width;
            $labels[] = $gantt_title;
            $links[] = $gantt_url . '" onclick="window.open(this.href, \'' . preg_replace('/\\s/', '_', $gantt_title) . '\', \'' . $gantt_winopt . '\'); return false;';
        }
        //upload/download as CSV files
        $labels[] = _('Download as CSV');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=downloadcsv';
        $labels[] = _('Upload CSV');
        $links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=uploadcsv';
    }
    if ($pg && is_object($pg) && $pg->userIsAdmin()) {
        $labels[] = _('Reporting');
        $links[] = '/pm/reporting/?group_id=' . $group_id;
        $labels[] = _('Admin');
        $links[] = '/pm/admin/?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&update_pg=1';
    }
    if (!empty($labels)) {
        echo $HTML->subMenu($labels, $links);
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:53,代码来源:ProjectGroupHTML.class.php


示例5: 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


示例6: frs_header

function frs_header($params)
{
    global $group_id, $HTML, $sys_use_frs;
    /*
    	Does this site use FRS?
    */
    if (!$sys_use_frs) {
        exit_disabled();
    }
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        exit_no_group();
    }
    $params['toptab'] = 'frs';
    $params['group'] = $group_id;
    site_project_header($params);
    if (session_loggedin()) {
        $perm =& $project->getPermission(session_get_user());
        if ($perm && is_object($perm) && !$perm->isError() && $perm->isReleaseTechnician()) {
            echo $HTML->subMenu(array(_('Files'), _('Admin')), array('/frs/?group_id=' . $group_id, '/frs/admin/?group_id=' . $group_id));
        }
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:23,代码来源:frs_utils.php


示例7: mail_header

/**
 * GForge Mailing Lists Facility
 *
 * Portions Copyright 1999-2001 (c) VA Linux Systems
 * The rest Copyright 2003 (c) Guillaume Smet
 *
 * @version   $Id$
 *
 */
function mail_header($params)
{
    global $HTML, $group_id;
    if ($group_id) {
        //required for site_project_header
        $params['group'] = $group_id;
        $params['toptab'] = 'mail';
        $project =& group_get_object($group_id);
        if ($project && is_object($project)) {
            if (!$project->usesMail()) {
                exit_error(_('Error'), _('This Project Has Turned Off The Mailing Lists'));
            }
        }
        site_project_header($params);
        if (session_loggedin()) {
            $perm =& $project->getPermission(session_get_user());
            if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
                echo $HTML->subMenu(array(_('Admin')), array('/mail/admin/?group_id=' . $group_id));
            }
        }
    } else {
        exit_no_group();
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:33,代码来源:mail_utils.php


示例8: displaySearch

 /**
  * Display the submit form
  */
 public function displaySearch(Tracker_IDisplayTrackerLayout $layout, $request, $current_user)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $pm = ProjectManager::instance();
     $group_id = $request->get('group_id');
     $group = $pm->getProject($group_id);
     if (!$group || !is_object($group) || $group->isError()) {
         exit_no_group();
     }
     $breadcrumbs = array(array('title' => $GLOBALS['Language']->getText('plugin_tracker_browse', 'search_result'), 'url' => TRACKER_BASE_URL . '/?tracker=' . $this->getId()));
     $this->displayHeader($layout, $this->name, $breadcrumbs);
     $html = '';
     $words = $request->get('words');
     $criteria = 'OR';
     if ($request->exist('exact') && $request->get('exact') == '1') {
         $criteria = 'AND';
     }
     $offset = 0;
     if ($request->exist('offset')) {
         $offset = $request->get('offset');
     }
     $limit = 25;
     $tracker_artifact_dao = new Tracker_ArtifactDao();
     $dar = $tracker_artifact_dao->searchByKeywords($this->getId(), $words, $criteria, $offset, $limit);
     $rows_returned = $tracker_artifact_dao->foundRows();
     $no_rows = false;
     if ($dar->rowCount() < 1 || $rows_returned < 1) {
         $no_rows = true;
         $html .= '<h2>' . $GLOBALS['Language']->getText('search_index', 'no_match_found', $hp->purify($words, CODENDI_PURIFIER_CONVERT_HTML)) . '</h2>';
     } else {
         $html .= '<h3>' . $GLOBALS['Language']->getText('search_index', 'search_res', array($hp->purify($words, CODENDI_PURIFIER_CONVERT_HTML), $rows_returned)) . '</h3>';
         $title_arr = array();
         $art_field_fact = Tracker_FormElementFactory::instance();
         $artifact_factory = Tracker_ArtifactFactory::instance();
         $user_helper = UserHelper::instance();
         $summary_field = $this->getTitleField();
         if ($summary_field && $summary_field->userCanRead()) {
             $title_arr[] = $GLOBALS['Language']->getText('plugin_tracker_search_index', 'artifact_title');
         }
         $submitted_field = $art_field_fact->getFormElementByName($this->getId(), 'submitted_by');
         if ($submitted_field && $submitted_field->userCanRead()) {
             $title_arr[] = $GLOBALS['Language']->getText('search_index', 'submitted_by');
         }
         $date_field = $art_field_fact->getFormElementByName($this->getId(), 'open_date');
         if ($date_field && $date_field->userCanRead()) {
             $title_arr[] = $GLOBALS['Language']->getText('search_index', 'date');
         }
         $status_field = $this->getStatusField();
         if ($status_field && $status_field->userCanRead()) {
             $title_arr[] = $GLOBALS['Language']->getText('global', 'status');
         }
         $html .= html_build_list_table_top($title_arr);
         $nb_artifacts = 0;
         while ($row = $dar->getRow()) {
             $nb_artifacts++;
             $artifact_id = $row['artifact_id'];
             $artifact = $artifact_factory->getArtifactById($artifact_id);
             if ($artifact->userCanView()) {
                 $html .= '<tr class="' . html_get_alt_row_color($nb_artifacts) . '">';
                 if ($summary_field->userCanRead()) {
                     $html .= '<td><a href="' . TRACKER_BASE_URL . '/?aid=' . $artifact_id . '"><img src="' . util_get_image_theme('msg.png') . '" border="0" height="12" width="10"> ' . $artifact->getTitle() . '</a></td>';
                 }
                 if ($submitted_field->userCanRead()) {
                     $html .= '<td>' . $hp->purify($user_helper->getDisplayNameFromUserId($artifact->getSubmittedBy())) . '</td>';
                 }
                 if ($date_field->userCanRead()) {
                     $html .= '<td>' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $artifact->getSubmittedOn()) . '</td>';
                 }
                 if ($status_field->userCanRead()) {
                     $html .= '<td>' . $artifact->getStatus() . '</td>';
                 }
                 $html .= '</tr>';
             }
         }
         $html .= '</table>';
     }
     // Search result pagination
     if (!$no_rows && ($rows_returned > $nb_artifacts || $offset != 0)) {
         $html .= '<br />';
         $url_params = array('exact' => $request->get('exact') === '1' ? 1 : 0, 'group_id' => $this->getGroupId(), 'tracker' => $this->getId(), 'type_of_search' => 'tracker', 'words' => urlencode($words), 'offset' => $offset - $limit);
         $html .= '<table class="boxitem" width="100%" cellpadding="5" cellspacing="0">';
         $html .= '<tr>';
         $html .= '<td align="left">';
         if ($offset != 0) {
             $html .= '<span class="normal"><b>';
             $html .= '<a href="/search/?' . http_build_query($url_params);
             $html .= '">' . "<b><img src=\"" . util_get_image_theme('t2.png') . "\" height=15 width=15 border=0 align=middle> " . $GLOBALS['Language']->getText('search_index', 'prev_res') . " </a></b></span>";
         } else {
             $html .= '&nbsp;';
         }
         $html .= '</td><td align="right">';
         if ($rows_returned > $nb_artifacts && $rows_returned > $offset + $limit) {
             $url_params['offset'] = $offset + $limit;
             $html .= '<span class="normal"><b>';
             $html .= '<a href="/search/?' . http_build_query($url_params);
             $html .= '"><b>' . $GLOBALS['Language']->getText('search_index', 'next_res') . ' <img src="' . util_get_image_theme('t.png') . '" height="15" width="15" border="0" align="middle"></a></b></span>';
         } else {
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:Tracker.class.php


示例9: create_project

/**
* create_project
* 
* Create a new project
*
* @param  data  
*/
function create_project($data, $do_not_exit = false)
{
    srand((double) microtime() * 1000000);
    $random_num = rand(0, 1000000);
    // Make sure default project privacy status is defined. If not
    // then default to "public"
    if (!isset($GLOBALS['sys_is_project_public'])) {
        $GLOBALS['sys_is_project_public'] = 1;
    }
    if (isset($GLOBALS['sys_disable_subdomains']) && $GLOBALS['sys_disable_subdomains']) {
        $http_domain = $GLOBALS['sys_default_domain'];
    } else {
        $http_domain = $data['project']['form_unix_name'] . '.' . $GLOBALS['sys_default_domain'];
    }
    //Verify if the approbation of the new project is automatic or not
    $auto_approval = ForgeConfig::get('sys_project_approval', 1) ? PROJECT_APPROVAL_BY_ADMIN : PROJECT_APPROVAL_AUTO;
    if (isset($data['project']['is_public'])) {
        $access = $data['project']['is_public'] ? Project::ACCESS_PUBLIC : Project::ACCESS_PRIVATE;
    } else {
        $access = ForgeConfig::get('sys_is_project_public') ? Project::ACCESS_PUBLIC : Project::ACCESS_PRIVATE;
    }
    // make group entry
    $insert_data = array('group_name' => "'" . htmlspecialchars(mysql_real_escape_string($data['project']['form_full_name'])) . "'", 'access' => "'" . $access . "'", 'unix_group_name' => "'" . db_es($data['project']['form_unix_name']) . "'", 'http_domain' => "'" . db_es($http_domain) . "'", 'status' => "'P'", 'unix_box' => "'shell1'", 'cvs_box' => "'cvs1'", 'license' => "'" . htmlspecialchars(mysql_real_escape_string($data['project']['form_license'])) . "'", 'license_other' => "'" . htmlspecialchars(mysql_real_escape_string($data['project']['form_license_other'])) . "'", 'short_description' => "'" . htmlspecialchars(mysql_real_escape_string($data['project']['form_short_description'])) . "'", 'register_time' => time(), 'rand_hash' => "'" . md5($random_num) . "'", 'built_from_template' => db_ei($data['project']['built_from_template']), 'type' => $data['project']['is_test'] ? 3 : 1);
    $sql = 'INSERT INTO groups(' . implode(', ', array_keys($insert_data)) . ') VALUES (' . implode(', ', array_values($insert_data)) . ')';
    $result = db_query($sql);
    if (!$result) {
        exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('register_confirmation', 'upd_fail', array($GLOBALS['sys_email_admin'], db_error())));
    } else {
        $group_id = db_insertid($result);
        // insert descriptions
        $descfieldsinfos = getProjectsDescFieldsInfos();
        for ($i = 0; $i < sizeof($descfieldsinfos); $i++) {
            if (isset($data['project']["form_" . $descfieldsinfos[$i]["group_desc_id"]]) && $data['project']["form_" . $descfieldsinfos[$i]["group_desc_id"]] != '') {
                $sql = "INSERT INTO group_desc_value (group_id, group_desc_id, value) VALUES ('" . db_ei($group_id) . "','" . db_ei($descfieldsinfos[$i]["group_desc_id"]) . "','" . db_escape_string(trim($data['project']["form_" . $descfieldsinfos[$i]["group_desc_id"]])) . "')";
                $result = db_query($sql);
                if (!$result) {
                    list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
                    exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('register_confirmation', 'ins_desc_fail', array($host, db_error())));
                }
            }
        }
        // insert trove categories
        if (isset($data['project']['trove'])) {
            foreach ($data['project']['trove'] as $root => $values) {
                foreach ($values as $value) {
                    db_query("INSERT INTO trove_group_link (trove_cat_id,trove_cat_version," . "group_id,trove_cat_root) VALUES (" . db_ei($value) . "," . time() . "," . db_ei($group_id) . "," . db_ei($root) . ")");
                }
            }
        }
        // define a module
        $project_manager = ProjectManager::instance();
        $result = db_query("INSERT INTO filemodule (group_id,module_name) VALUES ('{$group_id}','" . $project_manager->getProject($group_id)->getUnixName() . "')");
        if (!$result) {
            list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
            exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('register_confirmation', 'ins_file_fail', array($host, db_error())));
        }
        // make the current user a project admin as well as admin
        // on all Codendi services
        $result = db_query("INSERT INTO user_group (user_id,group_id,admin_flags,bug_flags,forum_flags,project_flags,patch_flags,support_flags,doc_flags,file_flags,wiki_flags,svn_flags,news_flags) VALUES (" . user_getid() . "," . $group_id . "," . "'A'," . "2," . "2," . "2," . "2," . "2," . "2," . "2," . "2," . "2," . "2)");
        // news_flags
        if (!$result) {
            exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('register_confirmation', 'set_owner_fail', array($GLOBALS['sys_email_admin'], db_error())));
        }
        // clear the user data to take into account this new group.
        $user = UserManager::instance()->getCurrentUser();
        $user->clearGroupData();
        // Instanciate all services from the project template that are 'active'
        $group = $project_manager->getProject($group_id);
        if (!$group || !is_object($group)) {
            exit_no_group();
        }
        //set up the group_id
        $_REQUEST['group_id'] = $_GET['group_id'] = $group_id;
        $request =& HTTPRequest::instance();
        $request->params['group_id'] = $_REQUEST['group_id'];
        $template_id = $group->getTemplate();
        $template_group = $project_manager->getProject($template_id);
        if (!$template_group || !is_object($template_group) || $template_group->isError()) {
            exit_no_group();
        }
        $system_template = $template_group->getStatus() == 's' || $template_group->getStatus() == 'S';
        if (!$system_template) {
            $template_name = $template_group->getUnixName();
        }
        $sql = "SELECT * FROM service WHERE group_id={$template_id} AND is_active=1";
        $result = db_query($sql);
        while ($arr = db_fetch_array($result)) {
            if (isset($data['project']['services'][$arr['service_id']]['is_used'])) {
                $is_used = $data['project']['services'][$arr['service_id']]['is_used'];
            } else {
                $is_used = '0';
                if ($arr['short_name'] == 'admin' || $arr['short_name'] == 'summary') {
                    $is_used = '1';
//.........这里部分代码省略.........
开发者ID:rinodung,项目名称:tuleap,代码行数:101,代码来源:create_project.php


示例10: getContent


//.........这里部分代码省略.........
     if ($project->usesCVS()) {
         print '<HR SIZE="1" width="99%" NoShade><A href="' . $project->getCvsPage() . '">';
         html_image("ic/cvs16b.png", array('width' => '20', 'height' => '20', 'alt' => 'CVS'));
         print ' ' . $GLOBALS['Language']->getText('include_project_home', 'cvs_repo') . '</A>';
         // LJ Cvs checkouts added
         $sql = "SELECT SUM(cvs_commits) AS commits, SUM(cvs_adds) AS adds, SUM(cvs_checkouts) AS checkouts from stats_project where group_id='{$group_id}'";
         $result = db_query($sql);
         $cvs_commit_num = db_result($result, 0, 0);
         $cvs_add_num = db_result($result, 0, 1);
         $cvs_co_num = db_result($result, 0, 2);
         if (!$cvs_commit_num) {
             $cvs_commit_num = 0;
         }
         if (!$cvs_add_num) {
             $cvs_add_num = 0;
         }
         if (!$cvs_co_num) {
             $cvs_co_num = 0;
         }
         $uri = session_make_url('/cvs/viewvc.php/?root=' . $project->getUnixName(false) . '&roottype=cvs');
         echo ' ( ' . $GLOBALS['Language']->getText('include_project_home', 'commits', $cvs_commit_num) . ', ' . $GLOBALS['Language']->getText('include_project_home', 'adds', $cvs_add_num) . ', ' . $GLOBALS['Language']->getText('include_project_home', 'co', $cvs_co_num) . ' )';
         if ($cvs_commit_num || $cvs_add_num || $cvs_co_num) {
             echo '<br> &nbsp; - <a href="' . $uri . '">' . $GLOBALS['Language']->getText('include_project_home', 'browse_cvs') . '</a>';
         }
     }
     // ######################### Subversion (only for Active)
     if ($project->usesService('svn')) {
         print '<HR SIZE="1" width="99%" NoShade><A href="' . $project->getSvnPage() . '">';
         html_image("ic/svn16b.png", array('width' => '20', 'height' => '20', 'alt' => 'Subversion'));
         print ' ' . $GLOBALS['Language']->getText('include_project_home', 'svn_repo') . '</A>';
         $sql = "SELECT SUM(svn_access_count) AS accesses from group_svn_full_history where group_id='{$group_id}'";
         $result = db_query($sql);
         $svn_accesses = db_result($result, 0, 0);
         if (!$svn_accesses) {
             $svn_accesses = 0;
         }
         echo ' ( ' . $GLOBALS['Language']->getText('include_project_home', 'accesses', $svn_accesses) . ' )';
         if ($svn_accesses) {
             $uri = session_make_url('/svn/viewvc.php/?root=' . $project->getUnixName(false) . '&roottype=svn');
             echo '<br> &nbsp; - <a href="' . $uri . '">' . $GLOBALS['Language']->getText('include_project_home', 'browse_svn') . '</a>';
         }
     }
     // ######################### File Releases (only for Active)
     if ($project->usesFile()) {
         echo $project->services['file']->getPublicArea();
     }
     // ######################### Trackers (only for Active)
     if ($project->usesTracker()) {
         print '<HR SIZE="1" width="99%" NoShade><A href="' . $project->getTrackerPage() . '">';
         html_image("ic/tracker20w.png", array('width' => '20', 'height' => '20', 'alt' => $GLOBALS['Language']->getText('include_project_home', 'trackers')));
         print ' ' . $GLOBALS['Language']->getText('include_project_home', 'trackers') . '</A>';
         //
         //  get the Group object
         //
         $pm = ProjectManager::instance();
         $group = $pm->getProject($group_id);
         if (!$group || !is_object($group) || $group->isError()) {
             exit_no_group();
         }
         $atf = new ArtifactTypeFactory($group);
         if (!$group || !is_object($group) || $group->isError()) {
             exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('include_project_home', 'no_arttypefact'));
         }
         // Get the artfact type list
         $at_arr = $atf->getArtifactTypes();
         if (!$at_arr || count($at_arr) < 1) {
             echo '<br><i>' . $GLOBALS['Language']->getText('include_project_home', 'no_trackers_accessible') . '</i>';
         } else {
             for ($j = 0; $j < count($at_arr); $j++) {
                 if ($at_arr[$j]->userCanView()) {
                     echo '<br><i>-&nbsp;
                 <a href="/tracker/?atid=' . $at_arr[$j]->getID() . '&group_id=' . $group_id . '&func=browse">' . $at_arr[$j]->getName() . '</a></i>';
                 }
             }
         }
     }
     // ######################## AnonFTP (only for Active)
     if ($project->isActive()) {
         print '<HR SIZE="1" width="99%" NoShade>';
         list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
         if ($GLOBALS['sys_disable_subdomains']) {
             $ftp_subdomain = "";
         } else {
             $ftp_subdomain = $project->getUnixName() . ".";
         }
         print "<A href=\"ftp://" . $ftp_subdomain . $host . "/pub/" . $project->getUnixName(false) . "/\">";
         // keep the first occurence in lower case
         print html_image("ic/ftp16b.png", array('width' => '20', 'height' => '20', 'alt' => $GLOBALS['Language']->getText('include_project_home', 'anon_ftp_space')));
         print $GLOBALS['Language']->getText('include_project_home', 'anon_ftp_space') . '</A>';
     }
     // ######################## Plugins
     $areas = array();
     $params = array('project' => &$project, 'areas' => &$areas);
     $em =& EventManager::instance();
     $em->processEvent(Event::SERVICE_PUBLIC_AREAS, $params);
     foreach ($areas as $area) {
         print '<HR SIZE="1" width="99%" NoShade>';
         print $area;
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:Widget_ProjectPublicAreas.class.php


示例11: createProject

 /**
  * createProject
  *
  * Create a new project
  *
  * Insert in group table
  * Insert group_desc_value, trove_group_link
  * Create filemodule in DB
  * Assign an admin user
  * Copy from template:
  * - activate the same services (using the ame server id and options)
  * - send message to the project requested (pepend on template values)
  * - create forums with the same name and public status
  * - copy CVS properties
  * - copy SVN settings and start .SVNAccessFile hisr=tiry
  * - add system references withut services
  * - copy ugroups and save mapping for further import
  * - copy FRS packages with permissions
  * - copy trackers
  * - copy wiki
  * - copy layout summary page
  * - Add the template as a project reference
  * - Copy Truncated email option
  * - Raise an event for plugin configuration
  *
  * @param  data ProjectCreationData
  */
 protected function createProject(ProjectCreationData $data)
 {
     $admin_user = UserManager::instance()->getCurrentUser();
     $group_id = $this->createGroupEntry($data);
     if ($group_id === false) {
         return;
     }
     $this->setCategories($data, $group_id);
     $this->initFileModule($group_id);
     $this->setProjectAdmin($group_id, $admin_user);
     // Instanciate all services from the project template that are 'active'
     $group = $this->projectManager->getProject($group_id);
     if (!$group || !is_object($group)) {
         exit_no_group();
     }
     $this->fakeGroupIdIntoHTTPParams($group_id);
     $template_id = $group->getTemplate();
     $template_group = $this->projectManager->getProject($template_id);
     if (!$template_group || !is_object($template_group) || $template_group->isError()) {
         exit_no_group();
     }
     $this->activateServicesFromTemplate($group_id, $template_group, $data);
     $this->setMessageToRequesterFromTemplate($group_id, $template_id);
     $this->initForumModuleFromTemplate($group_id, $template_id);
     $this->initCVSModuleFromTemplate($group_id, $template_id);
     $this->initSVNModuleFromTemplate($group_id, $template_id);
     // Activate other system references not associated with any service
     $this->reference_manager->addSystemReferencesWithoutService($template_id, $group_id);
     //Copy ugroups
     $ugroup_mapping = array();
     ugroup_copy_ugroups($template_id, $group_id, $ugroup_mapping);
     $this->initFRSModuleFromTemplate($group_id, $template_id, $ugroup_mapping);
     list($tracker_mapping, $report_mapping) = $this->initTrackerV3ModuleFromTemplate($group, $template_group, $ugroup_mapping);
     $this->initWikiModuleFromTemplate($group_id, $template_id);
     $this->initLayoutFromTemplate($group_id, $template_id);
     //Create project specific references if template is not default site template
     if (!$template_group->isSystem()) {
         $this->reference_manager->addProjectReferences($template_id, $group_id);
     }
     $this->copyEmailOptionsFromTemplate($group_id, $template_id);
     // Raise an event for plugin configuration
     $em = EventManager::instance();
     $em->processEvent('register_project_creation', array('reportMapping' => $report_mapping, 'trackerMapping' => $tracker_mapping, 'ugroupsMapping' => $ugroup_mapping, 'group_id' => $group_id, 'template_id' => $template_id));
     $this->autoActivateProject($group);
     return $group_id;
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:73,代码来源:ProjectCreator.class.php


示例12: account_remove_user_from_group

/**
 * Remove a user from a project
 *
 * @param Integer $groupId      Project id
 * @param Integer $userId       User id
 * @param Boolean $adminAction  Default value set to true, manage the displayed message according to the person that asked for the action (admin/self remove) 
 */
function account_remove_user_from_group($groupId, $userId, $adminAction = true)
{
    $pm = ProjectManager::instance();
    $res = db_query("DELETE FROM user_group WHERE group_id='{$groupId}' AND user_id='{$userId}' AND admin_flags <> 'A'");
    if (!$res || db_affected_rows($res) < 1) {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('project_admin_index', 'user_not_removed'));
    } else {
        // Raise an event
        $em = EventManager::instance();
        $em->processEvent('project_admin_remove_user', array('group_id' => $groupId, 'user_id' => $userId));
        //
        //  get the Group object
        //
        $group = $pm->getProject($groupId);
        if (!$group || !is_object($group) || $group->isError()) {
            exit_no_group();
        }
        $atf = new ArtifactTypeFactory($group);
        if (!$group || !is_object($group) || $group->isError()) {
            $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('project_admin_index', 'not_get_atf'));
        }
        // Get the artfact type list
        $at_arr = $atf->getArtifactTypes();
        if ($at_arr && count($at_arr) > 0) {
            for ($j = 0; $j < count($at_arr); $j++) {
                if (!$at_arr[$j]->deleteUser($userId)) {
                    $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('project_admin_index', 'del_tracker_perm_fail', $at_arr[$j]->getName()));
                }
            }
        }
        // Remove user from ugroups attached to this project
        if (!ugroup_delete_user_from_project_ugroups($groupId, $userId)) {
            $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('project_admin_index', 'del_user_from_ug_fail'));
        }
        $name = user_getname($userId);
        if ($adminAction) {
            $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('project_admin_index', 'user_removed') . ' (' . $name . ')');
        } else {
            $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('project_admin_index', 'self_user_remove') . ' (' . $group->getPublicName() . ')');
        }
        group_add_history('removed_user', user_getname($userId) . " ({$userId})", $groupId);
        return true;
    }
    return false;
}
开发者ID:nterray,项目名称:tuleap,代码行数:52,代码来源:account.php


示例13: session_require

/**
 *
 *   Method of easily enforcing permissions
 *   Page will terminate with error message if you fail checks
 *
 */
function session_require($req)
{
    if (!user_isloggedin()) {
        exit_permission_denied();
    }
    /*
    	SF Admins always have permission
    */
    if (user_is_super_user()) {
        return true;
    }
    if ($req['group']) {
        $group =& group_get_object($req['group']);
        if (!$group) {
            exit_no_group();
        }
        if ($req['admin_flags']) {
            //$query .= " AND admin_flags = '$req[admin_flags]'";
            if (!$group->userIsAdmin()) {
                exit_permission_denied();
            }
        } else {
            if (!$group->userIsMember()) {
                exit_permission_denied();
            }
        }
    } else {
        if ($req['isloggedin']) {
            //no need to check as long as the check is present at top of function
        } else {
            exit_permission_denied();
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:40,代码来源:session.php


示例14: validate

 /**
  * @access
  * @param
  * @return
  */
 function validate()
 {
     // Validate Group id
     $pm = ProjectManager::instance();
     $go = $pm->getProject($this->gid);
     if (!$go) {
         exit_no_group();
     }
     // Validate filename
     if (!is_dir($this->basedir . '/' . $this->getFilesystemName())) {
         return false;
         //      print "error ".$this->basedir.'/'.$this->filename;
     }
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:PHPWikiAttachment.class.php


示例15: _display_artifacts

 function _display_artifacts($list_trackers, $print_box_begin)
 {
     $request = HTTPRequest::instance();
     $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;
     }
     $vArtifact = new Valid_WhiteList('hide_artifact', array(0, 1));
     $vArtifact->required();
     if ($request->valid($vArtifact)) {
         $hide_artifact = $request->get('hide_artifact');
     } else {
         $hide_artifact = null;
     }
     $j = $print_box_begin;
     $html_my_artifacts = "";
     $html = "";
     $html_hdr = "";
     $aid_old = 0;
     $atid_old = 0;
     $group_id_old = 0;
     $count_aids = 0;
     $group_name = "";
     $tracker_name = "";
     $artifact_types = array();
     $pm = ProjectManager::instance();
     while ($trackers_array = db_fetch_array($list_trackers)) {
         $atid = $trackers_array['group_artifact_id'];
         $group_id = $trackers_array['group_id'];
         // {{{ check permissions
         //create group
         $group = $pm->getProject($group_id);
         if (!$group || !is_object($group) || $group->isError()) {
             exit_no_group();
         }
         //Create the ArtifactType object
         if (!isset($artifact_types[$group_id])) {
             $artifact_types[$group_id] = array();
         }
         if (!isset($artifact_types[$group_id][$atid])) {
             $artifact_types[$group_id][$atid] = array();
             $artifact_types[$group_id][$atid]['at'] = new ArtifactType($group, $atid);
             $artifact_types[$group_id][$atid]['user_can_view_at'] = $artifact_types[$group_id][$atid]['at']->userCanView();
             $artifact_types[$group_id][$atid]['user_can_view_summary_or_aid'] = null;
         }
         //Check if user can view artifact
         if ($artifact_types[$group_id][$atid]['user_can_view_at'] && $artifact_types[$group_id][$atid]['user_can_view_summary_or_aid'] !== false) {
             if (is_null($artifact_types[$group_id][$atid]['user_can_view_summary_or_aid'])) {
                 $at = $artifact_types[$group_id][$atid]['at'];
                 //Create ArtifactFieldFactory object
                 if (!isset($artifact_types[$group_id][$atid]['aff'])) {
                     $artifact_types[$group_id][$atid]['aff'] = new ArtifactFieldFactory($at);
                 }
                 $aff = $artifact_types[$group_id][$atid]['aff'];
                 //Retrieve artifact_id field
                 $field = $aff->getFieldFromName('artifact_id');
                 //Check if user can read it
                 $user_can_view_aid = $field->userCanRead($group_id, $atid);
                 //Retrieve percent_complete field
                 $field = $aff->getFieldFromName('percent_complete');
                 //Check if user can read it
                 $user_can_view_percent_complete = $field && $field->userCanRead($group_id, $atid);
                 //Retriebe summary field
                 $field = $aff->getFieldFromName('summary');
                 //Check if user can read it
                 $user_can_view_summary = $field->userCanRead($group_id, $atid);
                 $artifact_types[$group_id][$atid]['user_can_view_summary_or_aid'] = $user_can_view_aid || $user_can_view_summary;
             }
             if ($artifact_types[$group_id][$atid]['user_can_view_summary_or_aid']) {
                 //work on the tracker of the last round if there was one
                 if ($atid != $atid_old && $count_aids != 0) {
                     list($hide_now, $count_diff, $hide_url) = my_hide_url('artifact', $atid_old, $hide_item_id, $count_aids, $hide_artifact);
                     $html_hdr = ($j ? '<tr class="boxitem"><td colspan="3">' : '') . $hide_url . '<A HREF="/tracker/?group_id=' . $group_id_old . '&atid=' . $atid_old . '">' . $group_name . " - " . $tracker_name . '</A>&nbsp;&nbsp;&nbsp;&nbsp;';
                     $count_new = max(0, $count_diff);
                     $html_hdr .= my_item_count($count_aids, $count_new) . '</td></tr>';
                     $html_my_artifacts .= $html_hdr . $html;
                     $count_aids = 0;
                     $html = '';
                     $j++;
                 }
                 if ($count_aids == 0) {
                     //have to call it to get at least the hide_now even if count_aids is false at this point
                     $hide_now = my_hide('artifact', $atid, $hide_item_id, $hide_artifact);
                 }
                 $group_name = $trackers_array['group_name'];
                 $tracker_name = $trackers_array['name'];
                 $aid = $trackers_array['artifact_id'];
                 $summary = $trackers_array['summary'];
                 $atid_old = $atid;
                 $group_id_old = $group_id;
                 // If user is assignee and submitter of an artifact, it will
                 // appears 2 times in the result set.
                 if ($aid != $aid_old) {
                     $count_aids++;
                 }
                 if (!$hide_now && $aid != $aid_old) {
                     // Form the 'Submitted by/Assigned to flag' for marking
//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:tuleap,代码行数:101,代码来源:Widget_MyArtifacts.class.php


示例16: removeProjectMembers

 /**
  * Remove Project members from a project
  *
  * @param Project $project Affected project
  *
  * @return Boolean
  */
 public function removeProjectMembers($project)
 {
     if (!$project || !is_object($project) || $project->isError()) {
         exit_no_group();
     }
     $dao = new UserGroupDao(CodendiDataAccess::instance());
     return $dao->removeProjectMembers($project->getID());
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:15,代码来源:ProjectManager.class.php


示例17: e


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP exit_not_logged_in函数代码示例发布时间:2022-05-15
下一篇:
PHP exit_msg函数代码示例发布时间: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