コード例 #1
0
ファイル: count_access.php プロジェクト: pombredanne/tuleap
function display($label, $date)
{
    echo "<td>{$label}</td>";
    $datestr = date('j/m/y H:i', $date);
    echo "<td>{$datestr}</td>";
    $res = db_query("SELECT count(*) access FROM user WHERE last_access_date >= {$date}");
    if (db_numrows($res)) {
        $cntlast = db_result($res, 0, 'access');
    }
    echo "<td>{$cntlast}</td>";
    $res = db_query("SELECT count(*) access FROM user WHERE last_access_date >= {$date} AND email LIKE '*****@*****.**'");
    if (db_numrows($res)) {
        $cntft = db_result($res, 0, 'access');
    }
    $percentft = round($cntft * 100 / $cntlast, 2);
    echo "<td>{$cntft} en @orange.com [{$percentft} %]</td>";
    $res = db_query("SELECT count(*) access FROM user WHERE last_access_date >= {$date} AND email LIKE '*****@*****.**'");
    if (db_numrows($res)) {
        $cntext = db_result($res, 0, 'access');
    }
    $percentext = round($cntext * 100 / $cntlast, 2);
    echo "<td>dont {$cntext} en .ext@orange.com [{$percentext} %]</td>";
    $cntother = $cntlast - $cntft;
    $percentother = round($cntother * 100 / $cntlast, 2);
    echo "<td>et autres {$cntother} [{$percentother} %]</td>";
}
コード例 #2
0
ファイル: verify.php プロジェクト: uniteddiversity/tuleap
function verify_login_valid()
{
    global $Language;
    $request =& HTTPRequest::instance();
    if (!$request->existAndNonEmpty('form_loginname')) {
        $GLOBALS['Response']->addFeedback('error', $Language->getText('include_session', 'missing_pwd'));
        return 0;
    }
    // first check just confirmation hash
    $res = db_query('SELECT confirm_hash,status FROM user WHERE ' . 'user_name=\'' . db_es($request->get('form_loginname')) . '\'');
    if (db_numrows($res) < 1) {
        $GLOBALS['Response']->addFeedback('error', $Language->getText('account_verify', 'err_user'));
        return 0;
    }
    $usr = db_fetch_array($res);
    //if sys_user_approval=1 then check if the admin aldready validates the account
    if ($GLOBALS['sys_user_approval'] == 0 || $usr['status'] == 'V' || $usr['status'] == 'W') {
        if (strcmp($request->get('confirm_hash'), $usr['confirm_hash'])) {
            $GLOBALS['Response']->addFeedback('error', $Language->getText('account_verify', 'err_hash'));
            return 0;
        }
    } else {
        $GLOBALS['Response']->addFeedback('error', $Language->getText('account_verify', 'err_status'));
        return 0;
    }
    // then check valid login
    return UserManager::instance()->login($request->get('form_loginname'), $request->get('form_pw'), true);
}
コード例 #3
0
 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>';
 }
コード例 #4
0
 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;
 }
コード例 #5
0
ファイル: forum.php プロジェクト: nterray/tuleap
function forum_show_nested_messages($thread_id, $msg_id)
{
    global $total_rows, $Language;
    $sql = "SELECT user.user_name,forum.has_followups,user.realname,user.user_id,forum.msg_id,forum.group_forum_id,forum.subject,forum.thread_id,forum.body,forum.date,forum.is_followup_to, forum_group_list.group_id " . "FROM forum,user,forum_group_list WHERE forum.thread_id=" . db_ei($thread_id) . " AND user.user_id=forum.posted_by AND forum.is_followup_to=" . db_ei($msg_id) . " AND forum_group_list.group_forum_id = forum.group_forum_id " . "ORDER BY forum.date ASC;";
    $result = db_query($sql);
    $rows = db_numrows($result);
    $ret_val = '';
    if ($result && $rows > 0) {
        $ret_val .= '
			<UL>';
        /*
        	iterate and show the messages in this result
        	for each message, recurse to show any submessages
        */
        for ($i = 0; $i < $rows; $i++) {
            //	increment the global total count
            $total_rows++;
            //	show the actual nested message
            $ret_val .= forum_show_a_nested_message($result, $i) . '<P>';
            if (db_result($result, $i, 'has_followups') > 0) {
                //	Call yourself if there are followups
                $ret_val .= forum_show_nested_messages($thread_id, db_result($result, $i, 'msg_id'));
            }
        }
        $ret_val .= '
			</UL>';
    }
    return $ret_val;
}
コード例 #6
0
 /**
  * Fill the arrays $this->source_refs_datas and $this->target_refs_datas
  * for the current CrossReferenceFactory  
  */
 function fetchDatas()
 {
     $sql = "SELECT * \n                FROM cross_references \n                WHERE  (target_gid=" . $this->entity_gid . " AND target_id='" . $this->entity_id . "' AND target_type='" . $this->entity_type . "' ) \n                     OR (source_gid=" . $this->entity_gid . " AND source_id='" . $this->entity_id . "' AND source_type='" . $this->entity_type . "' )";
     $res = db_query($sql);
     if ($res && db_numrows($res) > 0) {
         $this->source_refs_datas = array();
         $this->target_refs_datas = array();
         while ($field_array = db_fetch_array($res)) {
             $target_id = $field_array['target_id'];
             $target_gid = $field_array['target_gid'];
             $target_type = $field_array['target_type'];
             $target_key = $field_array['target_keyword'];
             $source_id = $field_array['source_id'];
             $source_gid = $field_array['source_gid'];
             $source_type = $field_array['source_type'];
             $source_key = $field_array['source_keyword'];
             $user_id = $field_array['user_id'];
             $created_at = $field_array['created_at'];
             if ($target_id == $this->entity_id && $target_gid == $this->entity_gid && $target_type == $this->entity_type) {
                 $this->source_refs_datas[] = new CrossReference($source_id, $source_gid, $source_type, $source_key, $target_id, $target_gid, $target_type, $target_key, $user_id);
             }
             if ($source_id == $this->entity_id && $source_gid == $this->entity_gid && $source_type == $this->entity_type) {
                 $this->target_refs_datas[] = new CrossReference($source_id, $source_gid, $source_type, $source_key, $target_id, $target_gid, $target_type, $target_key, $user_id);
             }
         }
     }
 }
コード例 #7
0
ファイル: msp.php プロジェクト: neymanna/fusionforge
/**
return data:

	$array[success]=true;
	$array[session_hash]=jkjkjkjkjkjkjkj;
	$array[subprojects]=array(
						55=>'Subproject 1', 
						77=>'Subproject2'
						);

**OR**

	$array[success]=false;
	$array[errormessage]='Bad Password';
*/
function &MSPLogin($username, $password)
{
    global $feedback, $session_ser, $sys_database_type;
    $success = session_login_valid(strtolower($username), $password);
    if ($success) {
        $array['success'] = true;
        $array['session_hash'] = $session_ser;
        if ($sys_database_type == "mysql") {
            $sql = "SELECT pgl.group_project_id, CONCAT(g.group_name, ': ', pgl.project_name) AS name";
        } else {
            $sql = "SELECT pgl.group_project_id, g.group_name || ': ' || pgl.project_name AS name";
        }
        $sql .= "\n\t\t\tFROM groups g, project_group_list pgl, role_setting rs, user_group ug\n\t\t\tWHERE ug.user_id='" . user_getid() . "' \n\t\t\tAND g.group_id=pgl.group_id\n\t\t\tAND rs.value::integer > 0\n\t\t\tAND rs.group_project_id = pgl.group_project_id\n                        AND ug.role_id = rs.role_id\n                        AND rs.section_name='pm'";
        $res = db_query($sql);
        $rows = db_numrows($res);
        if (!$res || $rows < 1) {
            $array['success'] = false;
            $array['errormessage'] = 'No Subprojects Found';
        } else {
            for ($i = 0; $i < $rows; $i++) {
                $array['subprojects'][db_result($res, $i, 'group_project_id')] = db_result($res, $i, 'name');
            }
        }
    } else {
        $array['success'] = false;
        $array['errormessage'] = $feedback;
    }
    printr($array, 'MSPLogin::return-array');
    return $array;
}
コード例 #8
0
 public function getContent()
 {
     $request =& HTTPRequest::instance();
     $group_id = $request->get('group_id');
     $pm = ProjectManager::instance();
     $project = $pm->getProject($group_id);
     $res_admin = db_query("SELECT user.user_id AS user_id,user.user_name AS user_name, user.realname as realname " . "FROM user,user_group " . "WHERE user_group.user_id=user.user_id AND user_group.group_id=" . db_ei($group_id) . " AND " . "user_group.admin_flags = 'A'");
     if (db_numrows($res_admin) > 0) {
         $user_helper = UserHelper::instance();
         $hp = Codendi_HTMLPurifier::instance();
         $em = EventManager::instance();
         echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_admins') . ':</span><br />';
         while ($row_admin = db_fetch_array($res_admin)) {
             $display_name = '';
             $em->processEvent('get_user_display_name', array('user_id' => $row_admin['user_id'], 'user_name' => $row_admin['user_name'], 'realname' => $row_admin['realname'], 'user_display_name' => &$display_name));
             if (!$display_name) {
                 $display_name = $hp->purify($user_helper->getDisplayNameFromUserId($row_admin['user_id']));
             }
             echo '<a href="/users/' . $row_admin['user_name'] . '/">' . $display_name . '</a><br />';
         }
     }
     echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_members') . ':</span><br />';
     // count of developers on this project
     $res_count = db_query("SELECT user_id FROM user_group WHERE group_id=" . db_ei($group_id));
     echo db_numrows($res_count);
     echo ' <a href="/project/memberlist.php?group_id=' . $group_id . '">[' . $GLOBALS['Language']->getText('include_project_home', 'view_members') . ']</a>';
 }
コード例 #9
0
 function loadContent($id)
 {
     $this->content_id = $id;
     $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name='" . $this->widget_id . "' AND owner_id = " . $this->owner_id . " AND owner_type = '" . $this->owner_type . "' AND id = " . $id;
     $res = db_query($sql);
     if ($res && db_numrows($res)) {
         $data = db_fetch_array($res);
         $this->job_id = $data['job_id'];
         $jobs = $this->getAvailableJobs();
         if (array_key_exists($this->job_id, $jobs)) {
             try {
                 $used_job = $jobs[$this->job_id];
                 $this->job_url = $used_job->getUrl();
                 $this->job = $used_job;
                 $this->last_build_url = $this->job_url . '/lastBuild/';
                 $this->build = new HudsonBuild($this->last_build_url);
             } catch (Exception $e) {
                 $this->job = null;
                 $this->build = null;
             }
         } else {
             $this->job = null;
             $this->build = null;
         }
     }
 }
コード例 #10
0
ファイル: session.php プロジェクト: pombredanne/tuleap
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'));
    }
}
コード例 #11
0
ファイル: tool_reports.php プロジェクト: neymanna/fusionforge
/**
 * reports_quick_graph() - Show a quick graph of data.
 *
 * @param		string	Graph title
 * @param		int		First query resource ID
 * @param		int		Second query resource ID
 * @param		string	The bar colors
 */
function reports_quick_graph($title, $sql1, $sql2, $bar_colors)
{
    $result1 = db_query($sql1);
    $result2 = db_query($sql2);
    if ($result1 && $result2 && db_numrows($result2) > 0) {
        $assoc_open = util_result_columns_to_assoc($result1);
        $assoc_all = util_result_columns_to_assoc($result2);
        while (list($key, $val) = each($assoc_all)) {
            $titles[] = $key;
            $all[] = $val;
            if ($assoc_open[$key]) {
                $open[] = $assoc_open[$key];
            } else {
                $open[] = 0;
            }
        }
        /*	       	for ($i=0; $i<db_numrows($result1); $i++) {
        			echo "$titles[$i]=>$opened[$i]/$all[$i]<br />";
        		}
        */
        $scale = graph_calculate_scale(array($opened, $all), 400);
        $props["scale"] = $scale;
        $props["cellspacing"] = 5;
        $props = hv_graph_defaults($props);
        start_graph($props, $titles);
        horizontal_multisection_graph($titles, array($open, $all), $bar_colors, $props);
        end_graph();
        print '<p /><br />';
        print '<table cellspacing="0" border="0"><tr align="center"><td width="15%">' . _('Key') . ':</td><td width="5%">(</td><td width="35%" style="background-color:' . $bar_colors[0] . '">' . _('Open') . '</td>' . '<td width="5%">/</td><td width="35%" style="background-color:' . $bar_colors[1] . '">' . _('All') . ' </td><td width="5%">)</td></tr></table>';
        print '<p />';
        //      		GraphResult($result,$title);
    } else {
        echo "<h2>" . _('No data found to report') . "</h2>";
    }
}
コード例 #12
0
 function ArtifactFromID($id, $data = false)
 {
     if ($data) {
         $art_arr =& $data;
     } else {
         $res = db_query("SELECT * FROM artifact_vw WHERE artifact_id='{$id}'");
         if (!$res || db_numrows($res) < 1) {
             $this->setError("Invalid Artifact ID");
             return false;
         } else {
             $art_arr =& db_fetch_array($res);
         }
     }
     $at = artifactType_get_object($art_arr['group_artifact_id']);
     if (!$at || !is_object($at)) {
         $this->setError("Could Not Create ArtifactType");
         return false;
     } elseif ($at->isError()) {
         $this->setError($at->getErrorMessage());
         return false;
     }
     $this->ArtifactType =& $at;
     $a = artifact_get_object($id, $art_arr);
     if (!$a || !is_object($a)) {
         $this->setError("Could Not Create Artifact");
         return false;
     } elseif ($a->isError()) {
         $this->setError($a->getErrorMessage());
         return false;
     }
     $this->Artifact =& $a;
     return true;
 }
 protected function extractDataFromResult($res, $ids, $column)
 {
     $data = array();
     if ($res && db_numrows($res)) {
         db_reset_result($res);
         while ($d = db_fetch_array($res)) {
             if (!isset($data[$d['day']])) {
                 $data[$d['day']] = array();
                 foreach ($ids as $id) {
                     $data[$d['day']][$id] = 0;
                 }
             }
             $data[$d['day']][$d['id']] += $d[$column];
         }
         ksort($data);
         $previous = array();
         foreach ($data as $k => $d) {
             if (count($previous)) {
                 foreach ($d as $id => $v) {
                     if ($v == 0 && $previous[$id]) {
                         $data[$k][$id] = $previous[$id];
                     }
                 }
             }
             $previous = $data[$k];
         }
     }
     return $data;
 }
コード例 #14
0
    /**
     * It display a table with commit related to this tracker or task_extra_detail
     *
     * @param   string   $Query Query to be executed to get the commit entries.
     * @param   integer  $group_id Group_id of the actual Group_id
     *
     */
    function getCommitEntries($Query, $group_id)
    {
        $group =& group_get_object($group_id);
        if (!$group->usesPlugin($this->name)) {
            return;
        }
        $DBResult = db_query($Query);
        $Rows = db_numrows($DBResult);
        if ($Rows > 0) {
            echo '<tr><td colspan="2">';
            echo '<h4>' . _('Links to related CVS commits') . ':</h4>';
            $title_arr = $this->getTitleArr();
            echo $GLOBALS['HTML']->listTableTop($title_arr);
            for ($i = 0; $i < $Rows; $i++) {
                $Row = db_fetch_array($DBResult);
                echo '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle($i) . '>' . '<td>' . $this->getFileLink($group->getUnixName(), $Row['file'], $Row['actual_version']) . '</td>' . '<td>' . date(_('Y-m-d'), $Row['cvs_date']) . '</td>' . '<td>' . $this->getDiffLink($group->getUnixName(), $Row['file'], $Row['prev_version'], $Row['actual_version']) . '</td>' . '<td>' . $this->getActualVersionLink($group->getUnixName(), $Row['file'], $Row['actual_version']) . '</td>
				<td>' . htmlspecialchars($Row['log_text']) . '</td>
				<td>' . util_make_link_u($Row['author'], user_get_object_by_name($Row['author'])->getId(), $Row['author']) . '</td>
				</tr>';
            }
            echo $GLOBALS['HTML']->listTableBottom();
            echo '</td></tr>';
        } else {
            echo '<h4>' . _('No commits have been made.') . '</h4>';
        }
    }
コード例 #15
0
 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');
     }
 }
コード例 #16
0
 function update()
 {
     $db_res = db_query("SELECT * FROM group_type");
     $this->data_array = array();
     $rows = db_numrows($db_res);
     for ($i = 0; $i < $rows; $i++) {
         $this->data_array[db_result($db_res, $i, 'type_id')] = db_result($db_res, $i, 'name');
     }
 }
コード例 #17
0
function send_new_project_email($group_id)
{
    $res_grp = db_query("SELECT * FROM groups WHERE group_id='{$group_id}'");
    if (db_numrows($res_grp) < 1) {
        echo "Group [ {$group_id} ] does not exist. Shame on you, sysadmin.";
    }
    $row_grp = db_fetch_array($res_grp);
    $res_admins = db_query("SELECT users.user_name,users.email FROM users,user_group WHERE " . "users.user_id=user_group.user_id AND user_group.group_id='{$group_id}' AND " . "user_group.admin_flags='A'");
    if (db_numrows($res_admins) < 1) {
        echo "Group [ {$group_id} ] does not seem to have any administrators.";
    }
    // send one email per admin
    while ($row_admins = db_fetch_array($res_admins)) {
        $message = 'Your project registration for ' . $GLOBALS['sys_default_name'] . ' has been approved. 

Project Full Name:  ' . $row_grp['group_name'] . '
Project Unix Name:  ' . $row_grp['unix_group_name'] . '
CVS Server:         cvs.' . $row_grp['unix_group_name'] . '.' . $GLOBALS['sys_default_domain'] . '
Shell Server:       ' . $GLOBALS['sys_shell_host'] . '
Web Server:         ' . $row_grp['unix_group_name'] . '.' . $GLOBALS['sys_default_domain'] . '

Your DNS will take up to a day to become active on our site. Your shell
accounts will become active at the next 6-hour cron update. While
waiting for your DNS to resolve, you may try shelling into 
' . $GLOBALS['sys_shell_host'] . ' and pointing CVS to ' . $GLOBALS['sys_cvs_host'] . '.

If after six hours your shell accounts still do not work, please
open a support ticket so that we may take a look at the problem.
Please note that all shell accounts are closed to telnet and only
work with SSH2.

Your web site is accessible through your shell account. Directory
information will be displayed immediately after logging in.

Please take some time to read the site documentation about project
administration. If you visit your own project page in ' . $GLOBALS['sys_default_name'] . '
while logged in, you will find additional menu functions to your
left labeled "Project Administrator". 

We highly suggest that you now visit  and create a public
description for your project. This can be done by visiting your project
page while logged in, and selecting \'Project Admin\' from the menus
on the left.

Your project will also not appear in the Trove software map until
you categorize it in the project administration screens. So that
people can find your project, you should do this now. Visit your project
while logged in, and select \'Project Admin\' from the menus on the
left.

Enjoy the system, and please tell others about ' . $GLOBALS['sys_default_name'] . '. Let us know
if there is anything we can do to help you.

 -- the ' . $GLOBALS['sys_default_name'] . ' crew';
        mail($row_admins['email'], $GLOBALS['sys_default_name'] . " Project Approved", $message, "From: noreply@{$GLOBALS['sys_default_domain']}");
    }
}
コード例 #18
0
ファイル: donate.php プロジェクト: BackupTheBerlios/berlios
function req_user_donate($user_id)
{
    $donate = "";
    $query = "SELECT user_id " . "FROM user_donate " . "WHERE user_id={$user_id}";
    $res = db_query($query);
    if ($res && db_numrows($res) > 0) {
        $donate = '&nbsp;<a href="/developer/make_donation.php?user_id=' . $user_id . '"><img src="/images/iconTealStar_16x16.png" alt="User Donate" border="0" width="16" height="16">&euro;</a>';
    }
    return $donate;
}
コード例 #19
0
ファイル: database.php プロジェクト: pombredanne/tuleap
function db_query_params($sql, $params)
{
    global $conn;
    $dar = $conn->query($sql, $params);
    $GLOBALS['db_qhandle'] = $dar->getResult();
    if (db_numrows($GLOBALS['db_qhandle'])) {
        db_reset_result($GLOBALS['db_qhandle']);
    }
    return $GLOBALS['db_qhandle'];
}
コード例 #20
0
 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;
 }
コード例 #21
0
 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;
 }
コード例 #22
0
 public function getContent()
 {
     $html = '';
     $uh = UserHelper::instance();
     $request = HTTPRequest::instance();
     $hp = Codendi_HTMLPurifier::instance();
     $user = UserManager::instance()->getCurrentUser();
     $pm = ProjectManager::instance();
     $project_ids = $user->getProjects();
     foreach ($project_ids as $project_id) {
         $project = $pm->getProject($project_id);
         if ($project->usesSVN()) {
             list($hide_now, $count_diff, $hide_url) = my_hide_url('my_svn_group', $project_id, $request->get('hide_item_id'), count($project_ids), $request->get('hide_my_svn_group'));
             $html .= $hide_url;
             $html .= '<strong>' . $project->getPublicName() . '</strong>';
             if (!$hide_now) {
                 list($latest_revisions, $nb_revisions) = svn_get_revisions($project, 0, $this->_nb_svn_commits, '', $user->getUserName(), '', '', 0, false);
                 if (db_numrows($latest_revisions) > 0) {
                     $i = 0;
                     while ($data = db_fetch_array($latest_revisions)) {
                         $html .= '<div class="' . util_get_alt_row_color($i++) . '" style="border-bottom:1px solid #ddd">';
                         $html .= '<div style="font-size:0.98em;">';
                         $html .= '<a href="' . $this->_getLinkToCommit($project->getGroupId(), $data['revision']) . '">rev #' . $data['revision'] . '</a>';
                         $html .= ' ' . $GLOBALS['Language']->getText('my_index', 'my_latest_svn_commit_on') . ' ';
                         //In the db, svn dates are stored as int whereas cvs dates are stored as timestamp
                         $html .= format_date($GLOBALS['Language']->getText('system', 'datefmt'), is_numeric($data['date']) ? $data['date'] : strtotime($data['date']));
                         $html .= ' ' . $GLOBALS['Language']->getText('my_index', 'my_latest_svn_commit_by') . ' ';
                         if (isset($data['whoid'])) {
                             $name = $uh->getDisplayNameFromUserId($data['whoid']);
                         } else {
                             $name = $uh->getDisplayNameFromUserName($data['who']);
                         }
                         $html .= $hp->purify($name, CODENDI_PURIFIER_CONVERT_HTML);
                         $html .= '</div>';
                         $html .= '<div style="padding-left:20px; padding-bottom:4px; color:#555">';
                         $html .= util_make_links(substr($data['description'], 0, 255), $project->getGroupId());
                         if (strlen($data['description']) > 255) {
                             $html .= '&nbsp;[...]';
                         }
                         $html .= '</div>';
                         $html .= '</div>';
                     }
                     $html .= '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">';
                     $html .= '<a href="' . $this->_getLinkToMore($project->getGroupId(), $user->getUserName()) . '">[ More ]</a>';
                     $html .= '</div>';
                 } else {
                     $html .= '<div></div>';
                 }
             } else {
                 $html .= '<div></div>';
             }
         }
     }
     return $html;
 }
コード例 #23
0
 /**
  *  fetchData - re-fetch the data for this category from the database.
  *
  *  @param  int	 The category_id.
  *	@return	boolean	success.
  */
 function fetchData($categoryId)
 {
     global $Language;
     $res = db_query("SELECT *\n\t\t\tFROM trove_cat\n\t\t\tWHERE trove_cat_id='" . $categoryId . "'", -1, 0, SYS_DB_TROVE);
     if (!$res || db_numrows($res) < 1) {
         return false;
     }
     $this->dataArray =& db_fetch_array($res);
     db_free_result($res);
     return true;
 }
コード例 #24
0
 function loadContent($id)
 {
     $sql = "SELECT * FROM tracker_widget_renderer WHERE owner_id = " . $this->owner_id . " AND owner_type = '" . $this->owner_type . "' AND id = " . $id;
     $res = db_query($sql);
     if ($res && db_numrows($res)) {
         $data = db_fetch_array($res);
         $this->renderer_title = $data['title'];
         $this->renderer_id = $data['renderer_id'];
         $this->content_id = $id;
     }
 }
コード例 #25
0
 function loadContent($id)
 {
     $sql = "SELECT * FROM widget_image WHERE owner_id = " . $this->owner_id . " AND owner_type = '" . $this->owner_type . "' AND id = " . $id;
     $res = db_query($sql);
     if ($res && db_numrows($res)) {
         $data = db_fetch_array($res);
         $this->image_title = $data['title'];
         $this->image_url = $data['url'];
         $this->content_id = $id;
     }
 }
コード例 #26
0
 function loadContent($id)
 {
     $sql = "SELECT * FROM plugin_graphontrackersv5_widget_chart WHERE owner_id = " . $this->owner_id . " AND owner_type = '" . $this->owner_type . "' AND id = " . $id;
     $res = db_query($sql);
     if ($res && db_numrows($res)) {
         $data = db_fetch_array($res);
         $this->chart_title = $data['title'];
         $this->chart_id = $data['chart_id'];
         $this->content_id = $id;
     }
 }
コード例 #27
0
 public function userIsGitAdmin(PFUser $user, Project $project)
 {
     $database_result = $this->getCurrentGitAdminPermissionsForProject($project);
     if (db_numrows($database_result) < 1) {
         $database_result = $this->getDefaultGitAdminPermissions();
     }
     $has_permission = false;
     while (!$has_permission && ($row = db_fetch_array($database_result))) {
         $has_permission = ugroup_user_is_member($user->getId(), $row['ugroup_id'], $project->getID());
     }
     return $has_permission;
 }
コード例 #28
0
 function getContent()
 {
     require_once 'www/forum/forum_utils.php';
     require_once 'www/project/admin/ugroup_utils.php';
     $html_my_admin = '';
     // Get the number of pending users and projects
     db_query("SELECT count(*) AS count FROM groups WHERE status='P'");
     $row = db_fetch_array();
     $pending_projects = $row['count'];
     if ($GLOBALS['sys_user_approval'] == 1) {
         db_query("SELECT count(*) AS count FROM user WHERE status='P'");
         $row = db_fetch_array();
         $pending_users = $row['count'];
     } else {
         db_query("SELECT count(*) AS count FROM user WHERE status='P' OR status='V' OR status='W'");
         $row = db_fetch_array();
         $pending_users = $row['count'];
     }
     db_query("SELECT count(*) AS count FROM user WHERE status='V' OR status='W'");
     $row = db_fetch_array();
     $validated_users = $row['count'];
     $sql = "SELECT * FROM news_bytes WHERE is_approved=0 OR is_approved=3";
     $result = db_query($sql);
     $pending_news = 0;
     $rows = db_numrows($result);
     for ($i = 0; $i < $rows; $i++) {
         //if the news is private, not display it in the list of news to be approved
         $forum_id = db_result($result, $i, 'forum_id');
         $res = news_read_permissions($forum_id);
         // check on db_result($res,0,'ugroup_id') == $UGROUP_ANONYMOUS only to be consistent
         // with ST DB state
         if (db_numrows($res) < 1 || db_result($res, 0, 'ugroup_id') == $GLOBALS['UGROUP_ANONYMOUS']) {
             $pending_news++;
         }
     }
     $i = 0;
     $html_my_admin .= '<table width="100%">';
     $html_my_admin .= $this->_get_admin_row($i++, $GLOBALS['Language']->getText('admin_main', 'pending_user', array("/admin/approve_pending_users.php?page=pending")), $pending_users, $this->_get_color($pending_users));
     if ($GLOBALS['sys_user_approval'] == 1) {
         $html_my_admin .= $this->_get_admin_row($i++, $GLOBALS['Language']->getText('admin_main', 'validated_user', array("/admin/approve_pending_users.php?page=validated")), $validated_users, $this->_get_color($validated_users));
     }
     $html_my_admin .= $this->_get_admin_row($i++, $GLOBALS['Language']->getText('admin_main', 'pending_group', array("/admin/approve-pending.php")), $pending_projects, $this->_get_color($pending_projects));
     $html_my_admin .= $this->_get_admin_row($i++, '<a href="/news/admin">' . $GLOBALS['Language']->getText('admin_main', 'site_news_approval') . '</a>', $pending_news, $this->_get_color($pending_news));
     $result = array();
     $em =& EventManager::instance();
     $em->processEvent('widget_myadmin', array('result' => &$result));
     foreach ($result as $entry) {
         $html_my_admin .= $this->_get_admin_row($i++, $entry['text'], $entry['value'], $entry['bgcolor'], isset($entry['textcolor']) ? $entry['textcolor'] : 'white');
     }
     $html_my_admin .= '</table>';
     return $html_my_admin;
 }
コード例 #29
0
 /**
  * Gets a list of tasks for this user
  *
  * @param the SQL query to use to fetch the tasks
  *	@return	an array of ProjectTask objects
  */
 function &getTasksFromSQL($sql)
 {
     $tasks = array();
     $result = db_query($sql);
     $rows = db_numrows($result);
     for ($i = 0; $i < $rows; $i++) {
         $project_task_id = db_result($result, $i, 'project_task_id');
         $arr =& db_fetch_array($result);
         $task =& projecttask_get_object($project_task_id, $arr);
         $tasks[] =& $task;
     }
     return $tasks;
 }
コード例 #30
0
ファイル: account.php プロジェクト: BackupTheBerlios/berlios
function account_register_new($unix_name, $realname, $password1, $password2, $email, $language, $timezone, $mail_site, $mail_va, $language_id, $timezone)
{
    global $feedback;
    if (db_numrows(db_query("SELECT user_id FROM users WHERE user_name LIKE '{$unix_name}'")) > 0) {
        $feedback .= "That username already exists.";
        return false;
    }
    // Check that username is not identical with an existing unix groupname (groups) helix 22.06.2001
    if (db_numrows(db_query("SELECT unix_group_name FROM groups WHERE unix_group_name LIKE '{$unix_name}'")) > 0) {
        $feedback .= "That username is identical with the unixname of an existing group.";
        return false;
    }
    // End of change helix 22.06.2001
    if (!$unix_name) {
        $feedback .= "You must supply a username.";
        return false;
    }
    if (!$password1) {
        $feedback .= "You must supply a password.";
        return false;
    }
    if ($password1 != $password2) {
        $feedback .= "Passwords do not match.";
        return false;
    }
    if (!account_pwvalid($password1)) {
        $feedback .= ' Password must be at least 6 characters. ';
        return false;
    }
    if (!account_namevalid($unix_name)) {
        $feedback .= ' Invalid Unix Name ';
        return false;
    }
    if (!validate_email($email)) {
        $feedback .= ' Invalid Email Address ';
        return false;
    }
    // if we got this far, it must be good
    $confirm_hash = substr(md5($session_hash . $HTTP_POST_VARS['form_pw'] . time()), 0, 16);
    $result = db_query("INSERT INTO users (user_name,user_pw,unix_pw,realname,email,add_date," . "status,confirm_hash,mail_siteupdates,mail_va,language,timezone) " . "VALUES ('{$unix_name}'," . "'" . md5($password1) . "'," . "'" . account_genunixpw($password1) . "'," . "'" . "{$realname}'," . "'{$email}'," . "'" . time() . "'," . "'P'," . "'{$confirm_hash}'," . "'" . ($mail_site ? "1" : "0") . "'," . "'" . ($mail_va ? "1" : "0") . "'," . "'{$language_id}'," . "'{$timezone}')");
    $user_id = db_insertid($result, 'users', 'user_id');
    if (!$result || !$user_id) {
        $feedback .= ' Insert Failed ' . db_error();
        return false;
    } else {
        // send mail
        $message = "Thank you for registering on the " . $GLOBALS['sys_default_name'] . " web site. In order\n" . "to complete your registration, visit the following url: \n\n" . "https://" . $GLOBALS['HTTP_HOST'] . "/account/verify.php?confirm_hash={$confirm_hash}\n\n" . "Enjoy the site.\n\n" . " -- the " . $GLOBALS['sys_default_name'] . " staff\n";
        mail($email, $GLOBALS['sys_default_name'] . " Account Registration", $message, "From: noreply@" . $GLOBALS['sys_default_domain']);
        return $user_id;
    }
}