5 * SourceForge: Breaking Down the Barriers to Open Source Development
6 * Copyright 1999-2001 (c) VA Linux Systems
7 * http://sourceforge.net
14 $group_id=getIntFromRequest('group_id');
15 $form_grp=getIntFromRequest('form_grp');
16 if (isset($group_id) && is_numeric($group_id) && $group_id) {
18 } else if (isset($form_grp) && is_numeric($form_grp) && $form_grp) {
20 } else if (isset($group_name) && $group_name) {
21 $group =& group_get_object_by_name($group_name);
23 $log_group=$group->getID();
30 // This is a hack to allow the logger to have a group_id present
31 // for foundry and project summary pages
34 $pos = strpos (getStringFromServer('REQUEST_URI'),
35 normalized_urlprefix ());
36 if (($pos !== false) && ($pos == 0)) {
37 $pathwithoutprefix = substr (getStringFromServer('REQUEST_URI'),
38 strlen (normalized_urlprefix ()) - 1);
40 $expl_pathinfo = explode('/',$pathwithoutprefix);
41 if (($expl_pathinfo[1]=='foundry') || ($expl_pathinfo[1]=='projects')) {
42 $res_grp = db_query_params ('
45 WHERE unix_group_name=$1
46 AND status IN ($2,$3)',
47 array ($expl_pathinfo[2],
51 // store subpage id for analyzing later
52 $subpage = @$expl_pathinfo[3];
53 $subpage2 = isset($expl_pathinfo[4]) ? $expl_pathinfo[4] : '';
56 $group_id=db_result($res_grp,0,'group_id');
57 //set up a foundry object for reference all over the place
59 $grp =& group_get_object($group_id,$res_grp);
61 //this is a project - so set up the project var properly
63 //echo "IS PROJECT: ".$group_id;
73 // Is it a Personal wiki URL (see phpwiki plugin)
74 if (($expl_pathinfo[1]=='wiki') && ($expl_pathinfo[2]=='u')) {
75 // URLs are /wiki/u/<user_name>/<page_name>
76 // Fake group_name which is in fact the user_name.
77 $group_name = $expl_pathinfo[3];
80 // Is it a Project wiki URL (see phpwiki plugin)
81 if (($expl_pathinfo[1]=='wiki') && ($expl_pathinfo[2]=='g')) {
82 // URLs are /wiki/g/<user_name>/<page_name>
83 $group_name = $expl_pathinfo[3];
84 $res_grp=db_query_params ('
87 WHERE unix_group_name=$1
94 // store subpage id for analyzing later
95 $subpage = @$expl_pathinfo[4];
96 $subpage2 = @$expl_pathinfo[5];
99 $group_id=db_result($res_grp,0,'group_id');
100 //set up a foundry object for reference all over the place
102 $grp =& group_get_object($group_id,$res_grp);
104 //this is a project - so set up the project var properly
106 //echo "IS PROJECT: ".$group_id;
107 $log_group=$group_id;
118 $sql = "INSERT INTO activity_log
119 (day,hour,group_id,browser,ver,platform,time,page,type)
120 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);";
122 $res_logger = db_query_params ($sql, array(date('Ymd'), date('H'),
123 $log_group, browser_get_agent(), browser_get_version(), browser_get_platform(),
124 time(), getStringFromServer('PHP_SELF'), '0'));
129 $sys_db_is_dirty=false;
132 echo "An error occured in the logger.\n";
133 echo htmlspecialchars(db_error());