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


PHP user_isloggedin函数代码示例

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


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

示例1: session_pagestart

function session_pagestart($user_ip, $thispage_id)
{
    global $db, $lang, $board_config;
    global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
    $cookiename = $board_config['cookie_name'];
    $cookiepath = $board_config['cookie_path'];
    $cookiedomain = $board_config['cookie_domain'];
    $cookiesecure = $board_config['cookie_secure'];
    $current_time = time();
    unset($userdata);
    if (isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data'])) {
        $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
        $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
        $sessionmethod = SESSION_METHOD_COOKIE;
    } else {
        $sessiondata = array();
        $session_id = isset($HTTP_GET_VARS['sid']) ? $HTTP_GET_VARS['sid'] : '';
        $sessionmethod = SESSION_METHOD_GET;
    }
    //
    if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) {
        $session_id = '';
    }
    $thispage_id = (int) $thispage_id;
    //
    // Does a session exist?
    //
    if (!empty($session_id)) {
        //
        // session_id exists so go ahead and attempt to grab all
        // data in preparation
        //
        $sql = "SELECT u.*, s.*\n\t\t\tFROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u\n\t\t\tWHERE s.session_id = '{$session_id}'\n\t\t\t\tAND u.user_id = s.session_user_id";
        if (!($result = $db->sql_query($sql))) {
            message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
        }
        $userdata = $db->sql_fetchrow($result);
        //
        // Did the session exist in the DB?
        //
        if (isset($userdata['user_id'])) {
            // Added by FAI
            // Find Public Whip user id
            $logged_into_pw = user_isloggedin();
            global $user_name;
            // Look it up in PHPBB user account list
            $result = $db->sql_query("select user_id from phpbb_users where username = '" . mysql_escape_string($user_name) . "'");
            if ($result) {
                $row = $db->sql_fetchrow($result);
                $user_id_for_phpbb = $row['user_id'];
            }
            $url = !empty($HTTP_POST_VARS['redirect']) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : str_replace("/forum/", "", $_SERVER['REQUEST_URI']);
            if ($logged_into_pw) {
                // If user id is wrong, log into it
                if ($user_id_for_phpbb && $user_id_for_phpbb != $userdata['user_id']) {
                    if ($userdata['user_id'] > 0) {
                        session_end($userdata['session_id'], $userdata['user_id']);
                        redirect(append_sid($url, true));
                    }
                    $session_id = session_begin($user_id_for_phpbb, $user_ip, PAGE_INDEX, FALSE, TRUE);
                    redirect(append_sid($url, true));
                    exit;
                }
                // Otherwise make new account
                if (!$user_id_for_phpbb) {
                    // Log out first if logged in
                    if ($userdata['user_id'] > 0) {
                        session_end($userdata['session_id'], $userdata['user_id']);
                        redirect(append_sid($url, true));
                        exit;
                    }
                    $sql = "SELECT MAX(user_id) AS total FROM " . USERS_TABLE;
                    if (!($result = $db->sql_query($sql))) {
                        message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
                    }
                    if (!($row = $db->sql_fetchrow($result))) {
                        message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
                    }
                    $user_id = $row['total'] + 1;
                    $notifyreply = 1;
                    $sql = "INSERT INTO " . USERS_TABLE . "\t \nVALUES ('" . mysql_escape_string($user_id) . "',1,'" . mysql_escape_string($user_name) . "','NEVER***',0,0,0," . time() . ",0,0,0.00,1,'english','D M d, Y g:i a',0,0,0,NULL,0,1,1,1,1,1,1,1,1,1,1,0,'',0,'" . mysql_escape_string(user_getemail()) . "','','','','','','','','','','','',NULL,0,0)";
                    /*				VALUES ($user_id, '" . str_replace("\'", "''", $user_name) . "', " . time() . ", '" . str_replace("\'", "''", "NOT VALID ***") . "', '" . str_replace("\'", "''", user_getemail()) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
                    */
                    if (!($result = $db->sql_query($sql, BEGIN_TRANSACTION))) {
                        message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
                    }
                    $sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)\n\t\t\t\tVALUES ('', 'Personal User', 1, 0)";
                    if (!($result = $db->sql_query($sql))) {
                        message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
                    }
                    $group_id = $db->sql_nextid();
                    $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)\n\t\t\t\tVALUES ({$user_id}, {$group_id}, 0)";
                    if (!($result = $db->sql_query($sql, END_TRANSACTION))) {
                        message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
                    }
                    $session_id = session_begin($user_id, $user_ip, PAGE_INDEX, FALSE, TRUE);
                    redirect(append_sid($url, true));
                    exit;
                }
            } else {
//.........这里部分代码省略.........
开发者ID:damncabbage,项目名称:publicwhip,代码行数:101,代码来源:sessions.php

示例2: session_require

function session_require($req)
{
    global $Language;
    /*
    	Codendi admins always return true
    */
    if (user_is_super_user()) {
        return true;
    }
    if (isset($req['group']) && $req['group']) {
        $query = "SELECT user_id FROM user_group WHERE user_id=" . user_getid() . " AND group_id=" . db_ei($req['group']);
        if (isset($req['admin_flags']) && $req['admin_flags']) {
            $query .= " AND admin_flags = '" . db_escape_string($req['admin_flags']) . "'";
        }
        if (db_numrows(db_query($query)) < 1 || !$req['group']) {
            exit_error($Language->getText('include_session', 'insufficient_g_access'), $Language->getText('include_session', 'no_perm_to_view'));
        }
    } elseif (isset($req['user']) && $req['user']) {
        if (user_getid() != $req['user']) {
            exit_error($Language->getText('include_session', 'insufficient_u_access'), $Language->getText('include_session', 'no_perm_to_view'));
        }
    } elseif (isset($req['isloggedin']) && $req['isloggedin']) {
        if (!user_isloggedin()) {
            exit_error($Language->getText('include_session', 'required_login'), $Language->getText('include_session', 'login'));
        }
    } else {
        exit_error($Language->getText('include_session', 'insufficient_access'), $Language->getText('include_session', 'no_access'));
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:session.php

示例3: user_isadministrator

function user_isadministrator()
{
    if (user_isloggedin() and session_is_registered('type') and $_SESSION['type'] == 0) {
        return true;
    }
    return false;
}
开发者ID:navtej,项目名称:grinder,代码行数:7,代码来源:user.php

示例4: commits_header

function commits_header($params)
{
    global $group_id, $Language;
    $params['toptab'] = 'cvs';
    $params['group'] = $group_id;
    $pm = ProjectManager::instance();
    $project = $pm->getProject($group_id);
    if (!$project->usesCVS()) {
        exit_error($Language->getText('global', 'error'), $Language->getText('cvs_commit_utils', 'error_off'));
    }
    echo site_project_header($params);
    echo '<P><B><A HREF="/cvs/?func=info&group_id=' . $group_id . '">' . $Language->getText('cvs_commit_utils', 'menu_info') . '</A>';
    if ($project->isPublic() || user_isloggedin()) {
        $uri = session_make_url('/cvs/viewvc.php/?root=' . $project->getUnixName(false) . '&roottype=cvs');
        echo ' | <A HREF="' . $uri . '">' . $Language->getText('cvs_commit_utils', 'menu_browse') . '</A>';
    }
    if (user_isloggedin()) {
        echo ' | <A HREF="/cvs/?func=browse&group_id=' . $group_id . '&set=my">' . $Language->getText('cvs_commit_utils', 'menu_my') . '</A>';
        echo ' | <A HREF="/cvs/?func=browse&group_id=' . $group_id . '">' . $Language->getText('cvs_commit_utils', 'menu_query') . '</A>';
    }
    if (user_ismember($group_id, 'A')) {
        echo ' | <A HREF="/cvs/?func=admin&group_id=' . $group_id . '">' . $Language->getText('cvs_commit_utils', 'menu_admin') . '</A>';
    }
    if (!isset($params['help'])) {
        $params['help'] = "cvs.html";
    }
    echo ' | ' . help_button($params['help'], false, $Language->getText('global', 'help'));
    echo '</B>';
    echo ' <hr width="300" size="1" align="left" noshade>';
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:30,代码来源:commit_utils.php

示例5: user_isadministrator

function user_isadministrator()
{
    if (user_isloggedin() and isset($_SESSION['type']) and $_SESSION['type'] == 0) {
        return true;
    }
    return false;
}
开发者ID:ZionOps,项目名称:grinder,代码行数:7,代码来源:user.php

示例6: patch_header

function patch_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    $params['toptab'] = 'patch';
    $params['group'] = $group_id;
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Patch Manager');
    }
    if (!$project->usesPatch()) {
        exit_error('Error', 'This Project Has Turned Off The Patch Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/patch/?func=addpatch&group_id=' . $group_id . '">Submit A Patch</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/patch/?func=browse&group_id=' . $group_id . '&set=my">My Patches</A>';
    }
    echo ' | <A HREF="/patch/?func=browse&group_id=' . $group_id . '&set=open">Open Patches</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/patch/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/patch/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B>';
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:25,代码来源:patch_utils.php

示例7: bug_header

function bug_header($params)
{
    global $group_id, $is_bug_page, $DOCUMENT_ROOT;
    //used so the search box will add the necessary element to the pop-up box
    $is_bug_page = 1;
    //required params for site_project_header();
    $params['group'] = $group_id;
    $params['toptab'] = 'bugs';
    $project = project_get_object($group_id);
    //only projects can use the bug tracker, and only if they have it turned on
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Bug Tracker');
    }
    if (!$project->usesBugs()) {
        exit_error('Error', 'This Project Has Turned Off The Bug Tracker');
    }
    echo site_project_header($params);
    echo '<P><B><A HREF="/bugs/?func=addbug&group_id=' . $group_id . '">Submit A Bug</A>
	 | <A HREF="/bugs/?func=browse&group_id=' . $group_id . '&set=open">Open Bugs</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/bugs/?func=browse&group_id=' . $group_id . '&set=my">My Bugs</A>';
        echo ' | <A HREF="/bugs/?func=modfilters&group_id=' . $group_id . '">Filters</A>';
        echo ' | <A HREF="/bugs/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/bugs/admin/?group_id=' . $group_id . '">Admin</A></B>';
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:26,代码来源:bug_utils.php

示例8: feature_header

function feature_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    //required by new site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'feature';
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Feature Request Manager');
    }
    if (!$project->usesFeature()) {
        exit_error('Error', 'This Project Has Turned Off The Feature Request Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/feature/?func=addfeature&group_id=' . $group_id . '">Submit A Feature Request</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/feature/?func=browse&group_id=' . $group_id . '&set=my">My Feature Requests</A>';
    }
    echo ' | <A HREF="/feature/?func=browse&group_id=' . $group_id . '&set=open">Open Feature Requests</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/feature/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/feature/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B><P>';
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:26,代码来源:feature_utils.php

示例9: support_header

function support_header($params)
{
    global $group_id, $DOCUMENT_ROOT;
    //required by new site_project_header
    $params['group'] = $group_id;
    $params['toptab'] = 'support';
    //only projects can use the bug tracker, and only if they have it turned on
    $project = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Tech Support Manager');
    }
    if (!$project->usesSupport()) {
        exit_error('Error', 'This Project Has Turned Off The Tech Support Manager');
    }
    site_project_header($params);
    echo '<P><B><A HREF="/support/?func=addsupport&group_id=' . $group_id . '">Submit A Request</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/support/?func=browse&group_id=' . $group_id . '&set=my">My Requests</A>';
    }
    echo ' | <A HREF="/support/?func=browse&group_id=' . $group_id . '&set=open">Open Requests</A>';
    if (user_isloggedin()) {
        echo ' | <A HREF="/support/reporting/?group_id=' . $group_id . '">Reporting</A>';
    }
    echo ' | <A HREF="/support/admin/?group_id=' . $group_id . '">Admin</A>';
    echo '</B>';
    echo '<HR NoShade SIZE="1" SIZE="300">';
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:27,代码来源:support_utils.php

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

示例11: getMemberGroups

 /**
  *	return a resultset of Group for the current user
  *
  *	@return	resultset
  */
 function getMemberGroups()
 {
     global $Language;
     if (!user_isloggedin()) {
         $this->setError($Language->getText('include_exit', 'perm_denied'));
         return false;
     }
     $sql = "SELECT g.group_id,g.group_name " . "FROM groups g, user_group ug " . "WHERE g.group_id <> 100 AND g.status = 'A' AND g.group_id = ug.group_id " . "AND ug.user_id=" . user_getid() . " " . "ORDER BY g.group_name ASC";
     //echo $sql;
     $result = db_query($sql);
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $this->setError($Language->getText('include_common_groupfactory', 'none_found', db_error()));
         return false;
     }
     return $result;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:22,代码来源:GroupFactory.class.php

示例12: pm_header

function pm_header($params)
{
    global $group_id, $is_pm_page, $words, $group_project_id, $DOCUMENT_ROOT, $order;
    //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 = project_get_object($group_id);
    if (!$project->isProject()) {
        exit_error('Error', 'Only Projects Can Use The Task Manager');
    }
    if (!$project->usesPm()) {
        exit_error('Error', 'This Project Has Turned Off The Task Manager');
    }
    site_project_header($params);
    echo "<P><B>";
    echo "<A HREF=\"/pm/?group_id={$group_id}\">Subproject List</A>";
    $need_bar = 1;
    if ($group_project_id) {
        if (user_isloggedin()) {
            if ($need_bar) {
                echo ' | ';
            }
            echo "<A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=addtask\">Add Task</A>";
            echo " | <A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=browse&set=my\">My Tasks</A>";
            $need_bar = 1;
        }
        if ($need_bar) {
            echo ' | ';
        }
        echo "<A HREF=\"/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=browse&set=open\">Browse Open Tasks</A>";
        $need_bar = 1;
    }
    if (user_isloggedin()) {
        if ($need_bar) {
            echo ' | ';
        }
        echo '<A HREF="/pm/reporting/?group_id=' . $group_id . '">Reporting</A>';
        $need_bar = 1;
    }
    if ($need_bar) {
        echo ' | ';
    }
    echo " <A HREF=\"/pm/admin/?group_id={$group_id}\">Admin</A>";
    echo "</B>";
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:46,代码来源:pm_utils.php

示例13: people_add_to_skill_inventory

function people_add_to_skill_inventory($skill_id, $skill_level_id, $skill_year_id)
{
    global $feedback, $Language;
    if (user_isloggedin()) {
        //check if they've already added this skill
        $sql = "SELECT * FROM people_skill_inventory WHERE user_id='" . user_getid() . "' AND skill_id='{$skill_id}'";
        $result = db_query($sql);
        if (!$result || db_numrows($result) < 1) {
            //skill not already in inventory
            $sql = "INSERT INTO people_skill_inventory (user_id,skill_id,skill_level_id,skill_year_id) " . "VALUES ('" . user_getid() . "','{$skill_id}','{$skill_level_id}','{$skill_year_id}')";
            $result = db_query($sql);
            if (!$result || db_affected_rows($result) < 1) {
                $feedback .= ' ' . $Language->getText('people_utils', 'error_inserting') . ' ';
                echo db_error();
            } else {
                $feedback .= ' ' . $Language->getText('people_utils', 'added_skill') . ' ';
            }
        } else {
            $feedback .= ' ' . $Language->getText('people_utils', 'error_skill_already') . ' ';
        }
    } else {
        echo '<H1>' . $Language->getText('people_utils', 'must_be_loggin') . '</H1>';
    }
}
开发者ID:nterray,项目名称:tuleap,代码行数:24,代码来源:people_utils.php

示例14: displayCopy


//.........这里部分代码省略.........
                 // Details field must be on one row
                 if ($sz > $max_size || $field->getName() == 'details') {
                     $fieldset_html .= "\n<TR>" . '<TD valign="middle">' . $label . $star . '</td>' . '<TD valign="middle" colspan="' . ($columns_number - 1) . '">' . $value . '</TD>' . "\n</TR>";
                     $i = 0;
                 } else {
                     $fieldset_html .= $i % $fields_per_line ? '' : "\n<TR>";
                     $fieldset_html .= '<TD valign="middle">' . $label . $star . '</td>' . '<TD valign="middle">' . $value . '</TD>';
                     $i++;
                     $fieldset_html .= $i % $fields_per_line ? '<td class="artifact_spacer">&nbsp;</td>' : "\n</TR>";
                 }
             }
         }
         // while
         // We display the fieldset only if there is at least one field inside that we can display
         if ($display_fieldset) {
             $html .= '<TR><TD COLSPAN="' . (int) $columns_number . '">&nbsp</TD></TR>';
             $html .= '<TR class="boxtitle"><TD class="left" COLSPAN="' . (int) $columns_number . '">&nbsp;<span title="' . $hp->purify(SimpleSanitizer::unsanitize($result_fieldset->getDescriptionText()), CODENDI_PURIFIER_CONVERT_HTML) . '">' . $hp->purify(SimpleSanitizer::unsanitize($result_fieldset->getLabel()), CODENDI_PURIFIER_CONVERT_HTML) . '</span></TD></TR>';
             $html .= $fieldset_html;
         }
     }
     $html .= '</TABLE>';
     echo $this->_getSection('artifact_section_details', $Language->getText('tracker_include_artifact', 'details'), $html, true);
     //
     // Followups comments
     //
     $html = '';
     $html .= '<div>';
     if (!$ro) {
         if (db_numrows($this->ArtifactType->getCannedResponses())) {
             $html .= '<p><b>' . $Language->getText('tracker_include_artifact', 'use_canned') . '</b>&nbsp;';
             $html .= $this->ArtifactType->cannedResponseBox();
             $html .= '</p>';
         }
         $field = $art_field_fact->getFieldFromName('comment_type_id');
         if ($field && $field->isUsed() && db_numrows($field->getFieldPredefinedValues($group_artifact_id)) > 1) {
             $field_html = new ArtifactFieldHtml($field);
             $html .= '<P><B>' . $Language->getText('tracker_include_artifact', 'comment_type') . '</B>' . $field_html->fieldBox('', $group_artifact_id, $field->getDefaultValue(), true, $Language->getText('global', 'none')) . '<BR>';
         }
         // This div id used just to show the toggle of html format
         $html .= '<DIV ID="follow_up_comment_label"></DIV>';
         $html .= '<TEXTAREA NAME="follow_up_comment" id="tracker_artifact_comment" ROWS="10" style="width:700px;" WRAP="SOFT">';
         $html .= $hp->purify($Language->getText('tracker_include_artifact', 'is_copy', array($this->ArtifactType->getItemName(), $this->ArtifactType->getItemName() . ' #' . $this->getID())), CODENDI_PURIFIER_CONVERT_HTML);
         $html .= '</TEXTAREA>';
     } else {
         if ($pv == 0) {
             $html .= '<b>' . $Language->getText('tracker_include_artifact', 'add_comment') . '</b>';
             $html .= '<DIV ID="follow_up_comment_label"></DIV>';
             $html .= '<TEXTAREA NAME="follow_up_comment" id="tracker_artifact_comment" ROWS="10" style="width:700px;" WRAP="SOFT">' . $hp->purify($Language->getText('tracker_include_artifact', 'is_copy', array($this->ArtifactType->getItemName(), $this->ArtifactType->getItemName() . ' #' . $this->getID())), CODENDI_PURIFIER_CONVERT_HTML) . '</TEXTAREA>';
         }
     }
     if (!user_isloggedin() && $pv == 0) {
         $html .= $Language->getText('tracker_include_artifact', 'not_logged_in', '/account/login.php?return_to=' . urlencode($_SERVER['REQUEST_URI']));
         $html .= '<br><input type="text" name="email" maxsize="100" size="50"/><p>';
     }
     $html .= '</div>';
     $html .= "<br />";
     $title = $Language->getText('tracker_include_artifact', 'follow_ups') . ' ';
     $title .= help_button('tracker-v3.html#comments');
     echo $this->_getSection('artifact_section_followups', $title, $html, true);
     //
     // CC List
     //
     $html = '';
     $html .= $Language->getText('tracker_include_artifact', 'fill_cc_list_msg');
     $html .= $Language->getText('tracker_include_artifact', 'fill_cc_list_lbl');
     $html .= '<textarea type="text" name="add_cc" id="tracker_cc" rows="2" cols="60" wrap="soft"></textarea>';
     $html .= '<B>&nbsp;&nbsp;&nbsp;' . $Language->getText('tracker_include_artifact', 'fill_cc_list_cmt') . ":&nbsp</b>";
     $html .= '<input type="text" name="cc_comment" size="40" maxlength="255">';
     echo $this->_getSection('artifact_section_cc', $Language->getText('tracker_include_artifact', 'cc_list') . ' ' . help_button('tracker-v3.html#cc-list'), $html, true);
     //
     // File attachments
     //
     $html = '';
     $html .= '<input type="file" name="input_file" size="40">';
     $html .= $Language->getText('tracker_include_artifact', 'upload_file_msg', formatByteToMb($sys_max_size_attachment));
     $html .= $Language->getText('tracker_include_artifact', 'upload_file_desc');
     $html .= '<input type="text" name="file_description" size="60" maxlength="255">';
     echo $this->_getSection('artifact_section_attachments', $Language->getText('tracker_include_artifact', 'attachment') . ' ' . help_button('tracker-v3.html#artifact-attachments'), $html, true);
     //
     // Artifact dependencies
     //
     $html = '
     <P><B>' . $Language->getText('tracker_include_artifact', 'dependent_on') . '</B><BR>
     <P>';
     if (!$ro) {
         $html .= '
                     <B>' . $Language->getText('tracker_include_artifact', 'aids') . '</B>&nbsp;
                     <input type="text" name="artifact_id_dependent" size="20" maxlength="255" value="' . (int) $this->getID() . '">
                     &nbsp;<span style="color:#666">' . $Language->getText('tracker_include_artifact', 'fill') . '</span><p>';
     }
     echo $this->_getSection('artifact_section_dependencies', $Language->getText('tracker_include_artifact', 'dependencies') . ' ' . help_button('tracker-v3.html#artifact-dependencies'), $html, true);
     //
     // Final submit button
     //
     echo '<p><B><span class="highlight">' . $Language->getText('tracker_include_artifact', 'check_already_submitted') . '</b></p>';
     echo '<div style="text-align:center"><INPUT CLASS="btn btn-primary" TYPE="SUBMIT" NAME="SUBMIT" VALUE="' . $Language->getText('tracker_include_artifact', 'submit') . '"></div>';
     echo '</td></tr>';
     echo '</table>';
     echo '</form>';
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:101,代码来源:ArtifactHtml.class.php

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


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