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

PHP user_isloggedin函数代码示例

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

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



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


示例16: formatChanges

 /**
  * Format the changes
  *
  * @param changes: array of changes
  * @param $field_perm an array with the permission associated to each field. false to no check perms
  * @param $visible_change only needed when using permissions. Returns true if there is any change 
  * that the user has permission to see
  *
  * @return string
  */
 function formatChanges($changes, $field_perm, &$visible_change)
 {
     global $art_field_fact, $Language;
     $visible_change = false;
     $out_hdr = '';
     $out = '';
     $out_com = '';
     $out_att = '';
     reset($changes);
     $fmt = "%20s | %-25s | %s" . $GLOBALS['sys_lf'];
     if ($this->hasFieldPermission($field_perm, 'assigned_to') || $this->hasFieldPermission($field_perm, 'multi_assigned_to') || !isset($field_perm['assigned_to']) && !isset($field_perm['multi_assigned_to'])) {
         if (user_isloggedin()) {
             $user_id = user_getid();
             $out_hdr = $Language->getText('tracker_include_artifact', 'changes_by') . ' ' . user_getrealname($user_id) . ' <' . user_getemail($user_id) . ">" . $GLOBALS['sys_lf'] . "";
             $out_hdr .= $Language->getText('tracker_import_utils', 'date') . ': ' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), time()) . ' (' . user_get_timezone() . ')';
         } else {
             $out_hdr = $Language->getText('tracker_include_artifact', 'changes_by') . ' ' . $Language->getText('tracker_include_artifact', 'anon_user') . '        ' . $Language->getText('tracker_import_utils', 'date') . ': ' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), time());
         }
     }
     //Process special cases first: follow-up comment
     if (array_key_exists('comment', $changes) && $changes['comment']) {
         $visible_change = true;
         $out_com = $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . "---------------   " . $Language->getText('tracker_include_artifact', 'add_flup_comment') . "   ----------------" . $GLOBALS['sys_lf'] . "";
         if (isset($changes['comment']['type']) && $changes['comment']['type'] != $Language->getText('global', 'none') && $changes['comment']['type'] != '') {
             $out_com .= "[" . $changes['comment']['type'] . "]" . $GLOBALS['sys_lf'];
         }
         $out_com .= $this->formatFollowUp(null, $changes['comment']['format'], $changes['comment']['add'], self::OUTPUT_MAIL_TEXT);
         unset($changes['comment']);
     }
     //Process special cases first: file attachment
     if (array_key_exists('attach', $changes) && $changes['attach']) {
         $visible_change = true;
         $out_att = "" . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . "---------------    " . $Language->getText('tracker_include_artifact', 'add_attachment') . "     -----------------" . $GLOBALS['sys_lf'] . "";
         $out_att .= sprintf($Language->getText('tracker_include_artifact', 'file_name') . " %-30s " . $Language->getText('tracker_include_artifact', 'size') . ":%d KB" . $GLOBALS['sys_lf'] . "", $changes['attach']['name'], intval($changes['attach']['size'] / 1024));
         $out_att .= $changes['attach']['description'] . $GLOBALS['sys_lf'] . $changes['attach']['href'];
         unset($changes['attach']);
     }
     // All the rest of the fields now
     reset($changes);
     while (list($field_name, $h) = each($changes)) {
         // If both removed and added items are empty skip - Sanity check
         if ((isset($h['del']) && $h['del'] || isset($h['add']) && $h['add']) && $this->hasFieldPermission($field_perm, $field_name)) {
             $visible_change = true;
             $label = $field_name;
             $field = $art_field_fact->getFieldFromName($field_name);
             if ($field) {
                 $label = $field->getLabel();
                 if (isset($h['del'])) {
                     $h['del'] = SimpleSanitizer::unsanitize(util_unconvert_htmlspecialchars($h['del']));
                 }
                 if (isset($h['add'])) {
                     $h['add'] = SimpleSanitizer::unsanitize(util_unconvert_htmlspecialchars($h['add']));
                 }
             }
             $out .= sprintf($fmt, SimpleSanitizer::unsanitize($label), isset($h['del']) ? $h['del'] : "", isset($h['add']) ? $h['add'] : "");
         }
     }
     // while
     if ($out) {
         $out = $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . sprintf($fmt, $Language->getText('tracker_include_artifact', 'what') . '    ', $Language->getText('tracker_include_artifact', 'removed'), $Language->getText('tracker_include_artifact', 'added')) . "------------------------------------------------------------------" . $GLOBALS['sys_lf'] . $out;
     }
     return $out_hdr . $out . $out_com . $out_att;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:73,代码来源:Artifact.class.php


示例17: htmlspecialchars

<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: edit_question.php,v 1.3 2003/11/27 15:05:42 helix Exp $
require 'pre.php';
require '../survey_utils.php';
$is_admin_page = 'y';
if ($group_id && $question_id) {
    if (!user_isloggedin() || !user_ismember($group_id, 'A')) {
        exit_permission_denied();
        exit;
    }
    survey_header(array('title' => 'Edit A Question'));
    if ($post_changes) {
        $sql = "UPDATE survey_questions SET question='" . htmlspecialchars($question) . "', question_type='{$question_type}' where question_id='{$question_id}' AND group_id='{$group_id}'";
        $result = db_query($sql);
        if (db_affected_rows($result) < 1) {
            $feedback .= ' UPDATE FAILED ';
        } else {
            $feedback .= ' UPDATE SUCCESSFUL ';
        }
    }
    $sql = "SELECT * FROM survey_questions WHERE question_id='{$question_id}' AND group_id='{$group_id}'";
    $result = db_query($sql);
    if ($result) {
        $question = db_result($result, 0, "question");
        $question_type = db_result($result, 0, "question_type");
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:31,代码来源:edit_question.php


示例18: _getProjectTabs


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP user_ismember函数代码示例发布时间:2022-05-23
下一篇:
PHP user_is_super_user函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap