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


PHP user_getid函数代码示例

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


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

示例1: display

 function display($data)
 {
     echo '<fieldset><legend style="font-size:1.2em;">Choose the template of the project</legend>';
     include $GLOBALS['Language']->getContent('project/template');
     $rows = db_numrows($this->db_templates);
     if ($rows > 0) {
         //echo '<h3>From templates</h3><blockquote>';
         $GLOBALS['HTML']->box1_top($GLOBALS['Language']->getText('register_template', 'choose'));
         print '
       <TABLE width="100%">';
         for ($i = 0; $i < $rows; $i++) {
             $this->_displayProject(db_result($this->db_templates, $i, 'group_id'), db_result($this->db_templates, $i, 'group_name'), db_result($this->db_templates, $i, 'register_time'), db_result($this->db_templates, $i, 'unix_group_name'), db_result($this->db_templates, $i, 'short_description'));
         }
         print '</TABLE>';
         $GLOBALS['HTML']->box1_bottom();
         //echo '</blockquote>';
     }
     //{{{ Projects where current user is admin
     $result = db_query("SELECT groups.group_name AS group_name, " . "groups.group_id AS group_id, " . "groups.unix_group_name AS unix_group_name, " . "groups.register_time AS register_time, " . "groups.short_description AS short_description " . "FROM groups, user_group " . "WHERE groups.group_id = user_group.group_id " . "AND user_group.user_id = '" . user_getid() . "' " . "AND user_group.admin_flags = 'A' " . "AND groups.status='A' ORDER BY group_name");
     echo db_error($result);
     $rows = db_numrows($result);
     if ($result && $rows) {
         include $GLOBALS['Language']->getContent('project/template_my');
         echo '<br />';
         $GLOBALS['HTML']->box1_top($GLOBALS['Language']->getText('register_template', 'choose_admin'));
         print '<TABLE width="100%">';
         for ($i = 0; $i < $rows; $i++) {
             $this->_displayProject(db_result($result, $i, 'group_id'), db_result($result, $i, 'group_name'), db_result($result, $i, 'register_time'), db_result($result, $i, 'unix_group_name'), db_result($result, $i, 'short_description'));
         }
         print '</TABLE>';
         $GLOBALS['HTML']->box1_bottom();
     }
     //}}}
     echo '</fieldset>';
 }
开发者ID:nterray,项目名称:tuleap,代码行数:35,代码来源:RegisterProjectStep_Template.class.php

示例2: Widget_MySurveys

 function Widget_MySurveys()
 {
     $this->Widget('mysurveys');
     $no_survey = true;
     // Get id and title of the survey that will be promoted to user page. default = survey whose id=1
     if ($GLOBALS['sys_my_page_survey']) {
         $developer_survey_id = $GLOBALS['sys_my_page_survey'];
     } else {
         $developer_survey_id = "1";
     }
     $survey = SurveySingleton::instance();
     $sql = "SELECT * from surveys WHERE survey_id=" . db_ei($developer_survey_id);
     $result = db_query($sql);
     $group_id = db_result($result, 0, 'group_id');
     $purifier = Codendi_HTMLPurifier::instance();
     $survey_title = $purifier->purify($survey->getSurveyTitle(db_result($result, 0, 'survey_title')));
     // Check that the survey is active
     $devsurvey_is_active = db_result($result, 0, 'is_active');
     if ($devsurvey_is_active == 1) {
         $sql = "SELECT * FROM survey_responses " . "WHERE survey_id='" . db_ei($developer_survey_id) . "' AND user_id='" . db_ei(user_getid()) . "'";
         $result = db_query($sql);
         if (db_numrows($result) < 1) {
             $no_survey = false;
             $this->content .= '<a href="/survey/survey.php?group_id=' . $group_id . '&survey_id=' . $developer_survey_id . '">' . $survey_title . '</a>';
         }
     }
     if ($no_survey) {
         $this->content .= $GLOBALS['Language']->getText('my_index', 'no_survey');
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:30,代码来源:Widget_MySurveys.class.php

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

示例4: getContent

 function getContent()
 {
     $html_my_bookmarks = '';
     $result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where " . "user_id='" . user_getid() . "' ORDER BY bookmark_title");
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_bookmarks .= $GLOBALS['Language']->getText('my_index', 'no_bookmark');
         $html_my_bookmarks .= db_error();
     } else {
         $purifier = Codendi_HTMLPurifier::instance();
         $html_my_bookmarks .= '<table style="width:100%">';
         for ($i = 0; $i < $rows; $i++) {
             $bookmark_url = $purifier->purify(db_result($result, $i, 'bookmark_url'), CODENDI_PURIFIER_CONVERT_HTML);
             if (my_has_URL_invalid_content($bookmark_url)) {
                 $bookmark_url = '';
             }
             $bookmark_title = $purifier->purify(db_result($result, $i, 'bookmark_title'), CODENDI_PURIFIER_CONVERT_HTML);
             $html_my_bookmarks .= '<TR class="' . util_get_alt_row_color($i) . '"><TD>';
             $html_my_bookmarks .= '<A HREF="' . $bookmark_url . '">' . $bookmark_title . '</A> ';
             $html_my_bookmarks .= '<small><A HREF="/my/bookmark_edit.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">[' . $GLOBALS['Language']->getText('my_index', 'edit_link') . ']</A></SMALL></TD>';
             $html_my_bookmarks .= '<td style="text-align:right"><A HREF="/my/bookmark_delete.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">';
             $html_my_bookmarks .= '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="DELETE"></A></td></tr>';
         }
         $html_my_bookmarks .= '</table>';
     }
     $html_my_bookmarks .= '<div style="text-align:center; font-size:0.8em;"><a href="/my/bookmark_add.php">[' . $GLOBALS['Language']->getText('my_index', 'add_bookmark') . ']</a></div>';
     return $html_my_bookmarks;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:28,代码来源:Widget_MyBookmarks.class.php

示例5: register_valid

function register_valid()
{
    if (!$GLOBALS["Update"]) {
        return 0;
    }
    // check against old pw
    $res = db_query("SELECT user_pw, status FROM users WHERE user_id=" . user_getid());
    $row_pw = db_fetch_array($res);
    if ($row_pw[user_pw] != md5($GLOBALS[form_oldpw])) {
        $GLOBALS[register_error] = "Old password is incorrect.";
        return 0;
    }
    if ($row_pw[status] != 'A') {
        $GLOBALS[register_error] = "Account must be active to change password.";
        return 0;
    }
    if (!$GLOBALS[form_pw]) {
        $GLOBALS[register_error] = "You must supply a password.";
        return 0;
    }
    if ($GLOBALS[form_pw] != $GLOBALS[form_pw2]) {
        $GLOBALS[register_error] = "Passwords do not match.";
        return 0;
    }
    if (!account_pwvalid($GLOBALS[form_pw])) {
        return 0;
    }
    // if we got this far, it must be good
    $user =& user_get_object(user_getid());
    if (!$user->setPasswd($GLOBALS['form_pw'])) {
        $GLOBALS['register_error'] = $user->getErrorMessage();
        return 0;
    }
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:35,代码来源:change_pw.php

示例6: getPublicArea

 /**
  * getPublicArea
  * 
  * Return the link which will be displayed in public area in summary page
  */
 function getPublicArea()
 {
     $html = '';
     $html .= '<p><a href="/file/showfiles.php?group_id=' . $this->getGroupId() . '">';
     $html .= $GLOBALS['Response']->getImage("ic/file.png", array('width' => '20', 'height' => '20', 'alt' => $GLOBALS['Language']->getText('include_project_home', 'files')));
     $html .= ' ' . $GLOBALS['Language']->getText('include_project_home', 'file_releases') . '</a>';
     $html .= ' ( ' . $GLOBALS['Language']->getText('include_project_home', 'packages', count($this->_getPackagesForUser(user_getid()))) . ' )';
     $html .= '</p>';
     return $html;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:ServiceFile.class.php

示例7: getContent

 function getContent()
 {
     $html_my_monitored_forums = '';
     $sql = "SELECT groups.group_id, groups.group_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.status = 'A' " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' ";
     $um =& UserManager::instance();
     $current_user =& $um->getCurrentUser();
     if ($current_user->isRestricted()) {
         $projects = $current_user->getProjects();
         $sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
     }
     $sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
     $result = db_query($sql);
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_monitored_forums .= $GLOBALS['Language']->getText('my_index', 'my_forums_msg');
     } else {
         $request =& HTTPRequest::instance();
         $html_my_monitored_forums .= '<table style="width:100%">';
         for ($j = 0; $j < $rows; $j++) {
             $group_id = db_result($result, $j, 'group_id');
             $sql2 = "SELECT forum_group_list.group_forum_id,forum_group_list.forum_name " . "FROM groups,forum_group_list,forum_monitored_forums " . "WHERE groups.group_id=forum_group_list.group_id " . "AND groups.group_id={$group_id} " . "AND forum_group_list.is_public <> 9 " . "AND forum_group_list.group_forum_id=forum_monitored_forums.forum_id " . "AND forum_monitored_forums.user_id='" . user_getid() . "' LIMIT 100";
             $result2 = db_query($sql2);
             $rows2 = db_numrows($result2);
             $vItemId = new Valid_UInt('hide_item_id');
             $vItemId->required();
             if ($request->valid($vItemId)) {
                 $hide_item_id = $request->get('hide_item_id');
             } else {
                 $hide_item_id = null;
             }
             $vForum = new Valid_WhiteList('hide_forum', array(0, 1));
             $vForum->required();
             if ($request->valid($vForum)) {
                 $hide_forum = $request->get('hide_forum');
             } else {
                 $hide_forum = null;
             }
             list($hide_now, $count_diff, $hide_url) = my_hide_url('forum', $group_id, $hide_item_id, $rows2, $hide_forum);
             $html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/forum/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A>&nbsp;&nbsp;&nbsp;&nbsp;';
             $html = '';
             $count_new = max(0, $count_diff);
             for ($i = 0; $i < $rows2; $i++) {
                 if (!$hide_now) {
                     $group_forum_id = db_result($result2, $i, 'group_forum_id');
                     $html .= '
                 <TR class="' . util_get_alt_row_color($i) . '"><TD WIDTH="99%">' . '&nbsp;&nbsp;&nbsp;-&nbsp;<A HREF="/forum/forum.php?forum_id=' . $group_forum_id . '">' . stripslashes(db_result($result2, $i, 'forum_name')) . '</A></TD>' . '<TD ALIGN="center"><A HREF="/my/stop_monitor.php?forum_id=' . $group_forum_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_forum') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0 ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
                 }
             }
             $html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
             $html_my_monitored_forums .= $html_hdr . $html;
         }
         $html_my_monitored_forums .= '</table>';
     }
     return $html_my_monitored_forums;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:55,代码来源:Widget_MyMonitoredForums.class.php

示例8: getContent

 function getContent()
 {
     $frsrf = new FRSReleaseFactory();
     $html_my_monitored_fp = '';
     $sql = "SELECT groups.group_name,groups.group_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "' ";
     $um =& UserManager::instance();
     $current_user =& $um->getCurrentUser();
     if ($current_user->isRestricted()) {
         $projects = $current_user->getProjects();
         $sql .= "AND groups.group_id IN (" . implode(',', $projects) . ") ";
     }
     $sql .= "GROUP BY group_id ORDER BY group_id ASC LIMIT 100";
     $result = db_query($sql);
     $rows = db_numrows($result);
     if (!$result || $rows < 1) {
         $html_my_monitored_fp .= $GLOBALS['Language']->getText('my_index', 'my_files_msg');
     } else {
         $html_my_monitored_fp .= '<table style="width:100%">';
         $request =& HTTPRequest::instance();
         for ($j = 0; $j < $rows; $j++) {
             $group_id = db_result($result, $j, 'group_id');
             $sql2 = "SELECT frs_package.name,filemodule_monitor.filemodule_id " . "FROM groups,filemodule_monitor,frs_package " . "WHERE groups.group_id=frs_package.group_id " . "AND groups.group_id={$group_id} " . "AND frs_package.status_id !=" . $frsrf->STATUS_DELETED . " " . "AND frs_package.package_id=filemodule_monitor.filemodule_id " . "AND filemodule_monitor.user_id='" . user_getid() . "'  LIMIT 100";
             $result2 = db_query($sql2);
             $rows2 = db_numrows($result2);
             $vItemId = new Valid_UInt('hide_item_id');
             $vItemId->required();
             if ($request->valid($vItemId)) {
                 $hide_item_id = $request->get('hide_item_id');
             } else {
                 $hide_item_id = null;
             }
             $vFrs = new Valid_WhiteList('hide_frs', array(0, 1));
             $vFrs->required();
             if ($request->valid($vFrs)) {
                 $hide_frs = $request->get('hide_frs');
             } else {
                 $hide_frs = null;
             }
             list($hide_now, $count_diff, $hide_url) = my_hide_url('frs', $group_id, $hide_item_id, $rows2, $hide_frs);
             $html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '') . $hide_url . '<A HREF="/project/?group_id=' . $group_id . '">' . db_result($result, $j, 'group_name') . '</A>&nbsp;&nbsp;&nbsp;&nbsp;';
             $html = '';
             $count_new = max(0, $count_diff);
             for ($i = 0; $i < $rows2; $i++) {
                 if (!$hide_now) {
                     $html .= '
                     <TR class="' . util_get_alt_row_color($i) . '">' . '<TD WIDTH="99%">&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<A HREF="/file/showfiles.php?group_id=' . $group_id . '">' . db_result($result2, $i, 'name') . '</A></TD>' . '<TD><A HREF="/file/filemodule_monitor.php?filemodule_id=' . db_result($result2, $i, 'filemodule_id') . '&group_id=' . $group_id . '" onClick="return confirm(\'' . $GLOBALS['Language']->getText('my_index', 'stop_file') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" ' . 'BORDER=0" ALT="' . $GLOBALS['Language']->getText('my_index', 'stop_monitor') . '"></A></TD></TR>';
                 }
             }
             $html_hdr .= my_item_count($rows2, $count_new) . '</td></tr>';
             $html_my_monitored_fp .= $html_hdr . $html;
         }
         $html_my_monitored_fp .= '</table>';
     }
     return $html_my_monitored_fp;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:55,代码来源:Widget_MyMonitoredFp.class.php

示例9: logUser

 /**
  * $params['isScript']
  * $params['groupId']
  * $params['time']
  */
 function logUser($params)
 {
     if (!$params['isScript']) {
         $uid = 0;
         $uid = user_getid();
         $request = HTTPRequest::instance();
         $cookie_manager = new CookieManager();
         $userLogManager = new UserLogManager();
         $userLogManager->logAccess($params['time'], $params['groupId'], $uid, $cookie_manager->getCookie('session_hash'), $request->getFromServer('HTTP_USER_AGENT'), $request->getFromServer('REQUEST_METHOD'), $request->getFromServer('REQUEST_URI'), HTTPRequest::instance()->getIPAddress(), $request->getFromServer('HTTP_REFERER'));
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:16,代码来源:userlogPlugin.class.php

示例10: register_valid

function register_valid()
{
    if (!$GLOBALS["Update"]) {
        return 0;
    }
    $GLOBALS[form_authorized_keys] = trim($GLOBALS[form_authorized_keys]);
    $GLOBALS[form_authorized_keys] = ereg_replace("(\r\n)|(\n)", "###", $GLOBALS[form_authorized_keys]);
    // if we got this far, it must be good
    db_query("UPDATE users SET authorized_keys='{$GLOBALS['form_authorized_keys']}' WHERE user_id=" . user_getid());
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:11,代码来源:editsshkeys.php

示例11: getSummaryPageContent

 /**
  * getSummaryPageContent
  *
  * Return the text to display on the summary page
  * @return arr[title], arr[content]
  */
 function getSummaryPageContent()
 {
     $hp = Codendi_HTMLPurifier::instance();
     $ret = array('title' => $GLOBALS['Language']->getText('include_project_home', 'latest_file_releases'), 'content' => '');
     $packages = $this->_getPackagesForUser(user_getid());
     if (count($packages)) {
         $ret['content'] .= '
             <table cellspacing="1" cellpadding="5" width="100%" border="0">
                 <tr class="boxitem">
                     <td>
                         ' . $GLOBALS['Language']->getText('include_project_home', 'package') . '
                     </td>
                     <td>
                         ' . $GLOBALS['Language']->getText('include_project_home', 'version') . '
                     </td>
                     <td>
                         ' . $GLOBALS['Language']->getText('include_project_home', 'download') . '
                     </td>
                 </tr>
         ';
         require_once 'FileModuleMonitorFactory.class.php';
         $fmmf = new FileModuleMonitorFactory();
         foreach ($packages as $package) {
             // the icon is different whether the package is monitored or not
             if ($fmmf->isMonitoring($package['package_id'])) {
                 $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_stop.png", array('alt' => $GLOBALS['Language']->getText('include_project_home', 'stop_monitoring'), 'title' => $GLOBALS['Language']->getText('include_project_home', 'stop_monitoring')));
             } else {
                 $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_start.png", array('alt' => $GLOBALS['Language']->getText('include_project_home', 'start_monitoring'), 'title' => $GLOBALS['Language']->getText('include_project_home', 'start_monitoring')));
             }
             $ret['content'] .= '
               <TR class="boxitem">
               <TD>
                 <B>' . $hp->purify(util_unconvert_htmlspecialchars($package['package_name']), CODENDI_PURIFIER_CONVERT_HTML) . '</B>&nbsp;
                 <a HREF="/file/filemodule_monitor.php?filemodule_id=' . $package['package_id'] . '">' . $monitor_img . '     
                 </a>
               </TD>';
             // Releases to display
             $ret['content'] .= '<TD>' . $hp->purify($package['release_name'], CODENDI_PURIFIER_CONVERT_HTML) . '&nbsp;<A href="/file/shownotes.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">' . $GLOBALS['HTML']->getImage("ic/text.png", array('alt' => $GLOBALS['Language']->getText('include_project_home', 'release_notes'), 'title' => $GLOBALS['Language']->getText('include_project_home', 'release_notes'))) . ' 
               </TD>
               <TD><A HREF="/file/showfiles.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">' . $GLOBALS['Language']->getText('include_project_home', 'download') . '</A></TD></TR>';
         }
         $ret['content'] .= '</table>';
     } else {
         $ret['content'] .= '<b>' . $GLOBALS['Language']->getText('include_project_home', 'no_files_released') . '</b>';
     }
     $ret['content'] .= '
         <div align="center">
             <a href="/file/showfiles.php?group_id=' . $this->getGroupId() . '">[' . $GLOBALS['Language']->getText('include_project_home', 'view_all_files') . ']</A>
         </div>
     ';
     return $ret;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:58,代码来源:ServiceFile.class.php

示例12: User_nforge

 function User_nforge($id = '')
 {
     if ($id) {
         $this->setID($id);
         $u =& user_get_object_by_name($id);
     } else {
         $u =& user_get_object(user_getid());
         if ($u and is_object($u) and !$u->isError()) {
             global $DBInfo;
             $id = $u->getUnixName();
         }
         if (!empty($id)) {
             $this->setID($id);
             $udb = new UserDB($DBInfo);
             $tmp = $udb->getUser($id);
             // get timezone and make timezone offset
             $tz_offset = date('Z');
             $update = 0;
             if ($tz_offset != $tmp->info['tz_offset']) {
                 $update = 1;
             }
             if (!empty($DBInfo->use_homepage_url) and empty($tmp->info['home']) or $update or empty($tmp->info['nick']) or $tmp->info['nick'] != $u->data_array['realname']) {
                 // register user
                 $tmp->info['tz_offset'] = $tz_offset;
                 $tmp->info['nick'] = $u->data_array['realname'];
                 if (!empty($DBInfo->use_homepage_url)) {
                     $tmp->info['home'] = util_make_url_u($u->getID(), true);
                 }
                 $udb->saveUser($tmp);
             }
         } else {
             $id = 'Anonymous';
             $this->setID('Anonymous');
         }
     }
     $this->css = isset($_COOKIE['MONI_CSS']) ? $_COOKIE['MONI_CSS'] : '';
     $this->theme = isset($_COOKIE['MONI_THEME']) ? $_COOKIE['MONI_THEME'] : '';
     $this->bookmark = isset($_COOKIE['MONI_BOOKMARK']) ? $_COOKIE['MONI_BOOKMARK'] : '';
     $this->trail = isset($_COOKIE['MONI_TRAIL']) ? _stripslashes($_COOKIE['MONI_TRAIL']) : '';
     $this->tz_offset = isset($_COOKIE['MONI_TZ']) ? _stripslashes($_COOKIE['MONI_TZ']) : '';
     $this->nick = isset($_COOKIE['MONI_NICK']) ? _stripslashes($_COOKIE['MONI_NICK']) : '';
     if ($this->tz_offset == '') {
         $this->tz_offset = date('Z');
     }
     if (!empty($id) and $id != 'Anonymous') {
         global $DBInfo;
         $udb = new UserDB($DBInfo);
         if (!$udb->_exists($id)) {
             $dummy = $udb->saveUser($this);
         }
     }
 }
开发者ID:ahastudio,项目名称:moniwiki,代码行数:52,代码来源:nforge.php

示例13: processUpload

 public function processUpload(HTTPRequest $request)
 {
     $attch = new PHPWikiAttachment();
     $request_uri = preg_replace('/^\\/wiki/', PHPWIKI_PLUGIN_BASE_URL, $request->getFromServer('REQUEST_URI'));
     $attch->setUri($request_uri);
     if ($attch->exist() && $attch->isActive()) {
         if ($attch->isAutorized(user_getid())) {
             $attch->htmlDump();
         }
     } else {
         exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('plugin_phpwiki_attachment_upload', 'err_not_exist'));
     }
 }
开发者ID:sunmoonone,项目名称:tuleap,代码行数:13,代码来源:phpwikiPlugin.class.php

示例14: groupAddHistory

 /**
  * handle the insertion of history for corresponding  parameters
  * $args is an array containing a list of parameters to use when
  * the message is to be displayed by the history.php script
  * The array is stored as a string at the end of the field_name
  * with the following format:
  * field_name %% [arg1, arg2...]
  *
  * @param String  $fieldName Event category
  * @param String  $oldValue  Event value
  * @param Integer $groupId   Project ID
  * @param Array   $args      list of parameters used for message display
  *
  * @return DataAccessResult
  */
 function groupAddHistory($fieldName, $oldValue, $groupId, $args = false)
 {
     if ($args) {
         $fieldName .= " %% " . implode("||", $args);
     }
     $userId = user_getid();
     if ($userId == 0) {
         $userId = 100;
     }
     $sql = 'insert into ' . $this->table_name . '(group_id,field_name,old_value,mod_by,date)
            VALUES (' . $this->da->escapeInt($groupId) . ' , ' . $this->da->quoteSmart($fieldName) . ', ' . $this->da->quoteSmart($oldValue) . ' , ' . $this->da->escapeInt($userId) . ' , ' . $this->da->escapeInt($_SERVER['REQUEST_TIME']) . ')';
     $this->retrieve($sql);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:28,代码来源:ProjectHistoryDao.class.php

示例15: register_valid

function register_valid()
{
    if (!$GLOBALS["Update"]) {
        return 0;
    }
    if (!$GLOBALS[form_shell]) {
        $GLOBALS[register_error] = "You must supply a new login shell.";
        return 0;
    }
    // if we got this far, it must be good
    db_query("UPDATE users SET shell='{$GLOBALS['form_shell']}' WHERE user_id=" . user_getid());
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:13,代码来源:change_shell.php


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