phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: wcm/wcm-site README.Install.txt,NONE,1.1 README.


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: wcm/wcm-site README.Install.txt,NONE,1.1 README.Themes.txt,NONE,1.1 TODO,NONE,1.1 config.inc.php.sample,NONE,1.1 index.php,NONE,1.1 security.inc.php,NONE,1.1
Date: Tue, 27 Aug 2002 04:34:51 -0400

Update of /cvsroot/phpgroupware/wcm/wcm-site
In directory subversions:/tmp/cvs-serv32185/wcm-site

Added Files:
        README.Install.txt README.Themes.txt TODO 
        config.inc.php.sample index.php security.inc.php 
Log Message:
added new coded from patricks team

--- NEW FILE ---
Directions for getting wcm working on your system.

1) Go to the phpGroupWare setup program (http://yourmachine/phpgw-path/setup/) 
and install wcm and wcm-pub.  Double check to make sure they are properly 
installed before continuing.

2) Log in to phpGroupWare as an admin and create an anonymous phpgw user and 
assign it a password.  The only app (I assume) that they should have access to 
is wcm-pub.  wcm-pub is a dummy application that redirects phpGW users to the 
generated site.

3) Users who you wish to see wcm (aka contributors) or who you want to be able 
to link to the wcm site from phpGW should be given rights to the application.  
The easiest way to do this is to go to User groups and give groups permissions 
to use the applications.

4) Move the wcm-site directory somewhere.  This is the directory that serves 
the dynamic web site.  The directory can be located anywhere.  For example, you 
could put it in /var/www/html.  You could make the root location of your web 
server point to it, if you wish (ie, http://yourmachine/ refers to 
/var/www/html/wcm-site).  Make a mental note of the directory where you put it 
and the url that it is accessed by.

5) Now go to the wcm-site directory and edit the config.inc.php file.  You'll 
need to know the directory that phpGroupWare resides in as well as the above 
mentioned things.  Edit the values in the top section, as directed.  Make sure 
you replace the password for the anonymous user with the password that you 
chose when creating the account.

6) You're almost set to go.  This step includes some additional configuration, 
some of which duplicates your efforts from step 5.  Log in to phpGroupWare as 
an administrator.  Make sure you gave yourself the wcm and wcm-pub applications 
so that you see them on your navbar.  Go to the wcm application and select 
"Setup wcm-pub".  Fill in the directory and URL information as directed and any 
other information requested.  Note: at this time you have not created any pages 
so of course it does not make sense to fill in a default page.

        That's it.  Go to the Category manager, add a category or three and 
check who can view and edit them, then go to the page manager, add a page or 
three to each category, set up your site header, site footer, etc., and go view 
your recently created site by clicking on the wcm-pub application.  Voila!  

--- NEW FILE ---
The Web Content Manager was designed to use phpNuke themes.  Unfortunately, 
phpNuke's haphazard design makes it very difficult to plug stuff in without 
some effort.  If you want to port a phpNuke theme to work with wcm, follow the 
instructions below.

$header, $user



--- NEW FILE ---
2)  Addition of a Everybody group that overrides other permissions to make a 
category globally readable.
3)  Addition of a couple more themes, and ability to have session handling 
links in them.
4)  Blocks (I think these are pretty important and would like to have some 
basic support for them).
7)  _editCategory uses two arrays, grouplist (userlist) and permissionlist and 
assumes the accounts are in the same order in both arrays.  fix this to use 
account_id's as the key and thus insure syncronization.

--- NEW FILE ---
<?php
        /***********************************************************\
        * Edit the values in the following array to configure       *
        * the site generator.                                       *
        \***********************************************************/
        $wcm_info = array(
                'phpgw_path'      => '/var/www/phpgroupware/',
                'wcm_path'        => '/var/www/',
                'wcm_url'         => '/',
                'themes_path'     => '/themes/',
                'domain'          => 'default',
                'login'                   => 'anonymous',
                'passwd'                  => 'anonymous',
                'themesel'                => 'NukeNews'
        );
        

        /***********************************************************\
        * Leave the rest of this file alone.                        *
        \***********************************************************/
        if (
                ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'wcm-site') 
                && 
                ($GLOBALS['phpgw_info']['flags']['currentapp'] != 
'wcm-site-link')
                && 
                ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'wcm')
           )
        {
                require_once($wcm_info['wcm_path'] . 'security.inc.php');
                include($wcm_info['phpgw_path'] . 'header.inc.php');
                $GLOBALS['phpgw_info']['flags']['currentapp'] = 'login';
                include(PHPGW_SERVER_ROOT . '/phpgwapi/inc/functions.inc.php');
                $GLOBALS['phpgw_info']['flags']['currentapp'] = 'wcm-gen';

                if (! $GLOBALS['phpgw']->session->verify())
                {
                        $GLOBALS['sessionid'] = 
$GLOBALS['phpgw']->session->create($wcm_info['login'],$wcm_info['passwd'], 
'text');
                        if (!$GLOBALS['sessionid'])
                        {
                                echo 'NO ANONYMOUS USER ACCOUNTS INSTALLED.  
NOTIFY THE ADMINISTRATOR.';
                                exit;
                        }
                        
//$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link($wcm_url . 'index.php'));
                }
                else
                {
                //      echo "session verified";
                }
        }
        else
        {
        //      echo "hi";
        }

        function phpgw_link($url, $extravars = '')
        {
                return $GLOBALS['phpgw']->session->link($url, $extravars);
        } 

        function wcm_link2($url, $extravars = '')
        {
                $kp3 = $GLOBALS['HTTP_GET_VARS']['kp3'] ? 
$GLOBALS['HTTP_GET_VARS']['kp3'] : $GLOBALS['HTTP_COOKIE_VARS']['kp3'];

                if (! $kp3)
                {
                        $kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
                }


                $url = $GLOBALS['wcm_info']['wcm_url'] . $url;

                // build the extravars string from a array
                        
                if (is_array($extravars))
                {
                        while(list($key,$value) = each($extravars))
                        {
                                if (!empty($new_extravars))
                                {
                                        $new_extravars .= '&';
                                }
                                $new_extravars .= "$key=$value";
                        }
                        // This needs to be explictly reset to a string 
variable type for PHP3
                        settype($extravars,'string');
                        $extravars = $new_extravars;
                }
                if (isset($GLOBALS['phpgw_info']['server']['usecookies']) && 
$GLOBALS['phpgw_info']['server']['usecookies'])
                {
                        if ($extravars)
                        {
                                $url .= '?' . $extravars;
                        }
                }
                else
                {
                        $sessionID  = 'sessionid=' . 
@$GLOBALS['phpgw_info']['user']['sessionid'];
                        $sessionID .= '&kp3=' . $kp3;
                        $sessionID .= '&domain=' . 
@$GLOBALS['phpgw_info']['user']['domain'];
                        // This doesn't belong in the API.
                        // Its up to the app to pass this value. (jengo)
                        // Putting it into the app requires a massive number of 
updates in email app. 
                        // Until that happens this needs to stay here (seek3r)
                        if (isset($GLOBALS['phpgw_info']['flags']['newsmode']) 
&& 
                                $GLOBALS['phpgw_info']['flags']['newsmode'])
                        {
                                $url .= '&newsmode=on';
                        }
                        if ($extravars)
                        {
                                $url .= '?' . $extravars . '&' . $sessionID;
                        }
                        else
                        {
                                $url .= '?' . $sessionID;
                        }
                }
                return $url;
        }
        

        function wcm_link($url, $extravars = '')
        {
                $kp3 = $GLOBALS['HTTP_GET_VARS']['kp3'] ? 
$GLOBALS['HTTP_GET_VARS']['kp3'] : $GLOBALS['HTTP_COOKIE_VARS']['kp3'];

                if (! $kp3)
                {
                        $kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
                }

                if (! $url)
                {
                        $url_root = split ('/', 
$GLOBALS['wcm_info']['wcm_url']);
                        $patched_php_self = $GLOBALS['PHP_SELF'];
                        $url = (strlen($url_root[0])? $url_root[0].'//':'') . 
$url_root[2] . $patched_php_self;
                }

                // build the extravars string from an array
                if (is_array($extravars))
                {
                        while(list($key,$value) = each($extravars))
                        {
                                if (!empty($new_extravars))
                                {
                                        $new_extravars .= '&';
                                }
                                $new_extravars .= "$key=$value";
                        }

                        // This needs to be explicitly reset to a string var 
for php3
                        settype($extravars,'string');
                        $extravars = $new_extravars;
                }

                if (isset($GLOBALS['phpgw_info']['server']['usecookies']) && 
$GLOBALS['phpgw_info']['server']['usecookies'])
                {
                        if ($extravars)
                        {
                                $url .= '?' . $extravars;
                        }
                }
                else
                {
                        $sessionID = 'sessionid=' . 
@$GLOBALS['phpgw_info']['user']['sessionid'];
                        $sessionID .= '&kp3=' . $kp3;
                        $sessionID .= '&domain=' . 
@$GLOBALS['phpgw_info']['user']['domain'];
                }

                $url = str_replace('/?', '/index.php?', $url);
                $webserver_url_count = strlen($GLOBALS['wcm_info']['wcm_url']);
                $slash_check = strtolower(substr($url,0,1));
                if (substr($url,0,$webserver_url_count) != 
$GLOBALS['wcm_info']['wcm_url'])
                {
                        $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
                        if ($slash_check == '/')
                        {
                                $url = $GLOBALS['wcm_info']['wcm_url'] . $url;
                        }
                        else
                        {
                                $url = $GLOBALS['wcm_info']['wcm_url'] . '/' . 
$app . '/' . $url;
                        }
                }
                return $url;
        }

?>

***** Error reading new file: [Errno 2] No such file or directory: 'index.php'
--- NEW FILE ---
<?php
        // Security precaution: prevent script tags: <script>, <javascript "">, 
etc.
        foreach ($HTTP_GET_VARS as $secvalue) 
        {
                if (eregi("<[^>]*script*\"?[^>]*>", $secvalue)) 
                {
                        die("A security breach has been attempted and 
refused.");
                }
        }

        // Security precaution: don't let anyone call xxx.inc.php files or
    // construct URLs with relative paths (ie, /dir1/../dir2/)
    if (eregi("\.inc\.php",$PHP_SELF) || ereg("\.\.",$PHP_SELF)) 
        {
                Header("Location: index.php");
                die();
        }
?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]