[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: wiki/lib defaults.php,1.4,1.5 init.php,1.4,1.5 m
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: wiki/lib defaults.php,1.4,1.5 init.php,1.4,1.5 main.php,1.6,1.7 url.php,1.3,1.4 |
Date: |
Thu, 06 Mar 2003 19:19:17 -0500 |
Update of /cvsroot/phpgroupware/wiki/lib
In directory subversions:/tmp/cvs-serv22386/lib
Modified Files:
defaults.php init.php main.php url.php
Log Message:
some new features and some fixes
- wiki is now configurable to run anonymous, access can be restricted to ro
- admin's are always able to edit a page
- fixed blocking of hosts
Index: defaults.php
===================================================================
RCS file: /cvsroot/phpgroupware/wiki/lib/defaults.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** defaults.php 4 Mar 2003 18:05:40 -0000 1.4
--- defaults.php 7 Mar 2003 00:19:14 -0000 1.5
***************
*** 85,90 ****
// Initialize the default user name to empty.
! $UserName = ExecMethod('phpgwapi.accounts.id2name',get_account_id());
! #$UserName = '';
// Default time zone offset (in minutes) for visitors who haven't yet set
their
--- 85,89 ----
// Initialize the default user name to empty.
! $UserName = '';
// Default time zone offset (in minutes) for visitors who haven't yet set
their
Index: init.php
===================================================================
RCS file: /cvsroot/phpgroupware/wiki/lib/init.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** init.php 4 Mar 2003 20:55:15 -0000 1.4
--- init.php 7 Mar 2003 00:19:14 -0000 1.5
***************
*** 5,25 ****
require('lib/defaults.php');
! require('config.php');
require('lib/url.php');
require('lib/messages.php');
- /*
- require('lib/pagestore.php');
- require('lib/rate.php');
-
- $PgTbl = $DBTablePrefix . 'pages';
- $IwTbl = $DBTablePrefix . 'interwiki';
- $SwTbl = $DBTablePrefix . 'sisterwiki';
- $LkTbl = $DBTablePrefix . 'links';
- $RtTbl = $DBTablePrefix . 'rate';
- $RemTbl = $DBTablePrefix . 'remote_pages';
- $pagestore = new PageStore();
- $db = $pagestore->dbh;
- */
$pagestore = CreateObject('wiki.sowiki');
--- 5,77 ----
require('lib/defaults.php');
! require('config.php'); // this has to go into a admin-page
!
! $sessionid =
(isset($GLOBALS['HTTP_GET_VARS']['sessionid'])?$GLOBALS['HTTP_GET_VARS']['sessionid']:(isset($GLOBALS['HTTP_COOKIE_VARS']['sessionid'])?$GLOBALS['HTTP_COOKIE_VARS']['sessionid']:''));
!
! if ($sessionid || !(AnonymousSession == 'readonly' || AnonymousSession ==
'editable'))
! {
! $GLOBALS['phpgw_info']['flags']['noheader'] = True;
!
! include('../header.inc.php');
! }
! else
! {
! $login = AnonymousUser;
! $passwd = AnonymousPasswd;
!
! $GLOBALS['phpgw_info']['flags'] = array(
! 'disable_Template_class' => True,
! 'login' => True,
! 'currentapp' => 'login',
! 'noheader' => True
! );
! include('../header.inc.php');
!
! if (! $GLOBALS['phpgw']->session->verify())
! {
! $login = AnonymousUser;
! $passwd = AnonymousPasswd;
!
! $sessionid =
$GLOBALS['phpgw']->session->create($login,$passwd,'text');
! }
! if (!$sessionid) {
! echo "<p>Can't create session for user '".AnonymousUser."'
!!!</p>\n";
! }
! else
! {
!
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/wiki/index.php',$GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']));
! }
! $GLOBALS['phpgw']->common->phpgw_exit();
! }
!
! $UserName = ExecMethod('phpgwapi.accounts.id2name',get_account_id());
! $anonymous = $UserName == AnonymousUser;
! //echo "<p>user='$UserName', AnonymousUser='$AnonymousUser',
anonymous=".($anonymous?'True':'False').", action='$action'</p>\n";
! if ($action != 'save' && $action != 'admin')
! {
! $GLOBALS['phpgw_info']['flags']['nonavbar'] = $anonymous;
! $GLOBALS['phpgw']->common->phpgw_header();
! }
!
! /*!
! @function isEditable
! @abstract check if a page is editable for the user
! @syntax isEditable($page_mutable=True)
! @param $page_mutable Setting of the page in the db, independent of user
! */
! function isEditable($page_mutable=True)
! {
! global $anonymous;
!
! return $GLOBALS['phpgw_info']['user']['apps']['admin'] || //
always editable for admins or
! // only editable if set in the db AND (user is no anonymous or
the anonymous sessions are editable)
! $page_mutable && (!$anonymous || AnonymousSession == 'editable');
! }
!
! $WikiLogo = $GLOBALS['phpgw']->common->find_image('wiki','navbar.gif');
!
require('lib/url.php');
require('lib/messages.php');
$pagestore = CreateObject('wiki.sowiki');
Index: main.php
===================================================================
RCS file: /cvsroot/phpgroupware/wiki/lib/main.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** main.php 6 Mar 2003 17:38:20 -0000 1.6
--- main.php 7 Mar 2003 00:19:14 -0000 1.7
***************
*** 83,87 ****
'macro' => array('action/macro.php', 'action_macro',
'search'),
'rss' => array('action/rss.php', 'action_rss', 'view'),
! 'style' => array('action/style.php', 'action_style', '')
);
--- 83,88 ----
'macro' => array('action/macro.php', 'action_macro',
'search'),
'rss' => array('action/rss.php', 'action_rss', 'view'),
! 'style' => array('action/style.php', 'action_style', ''),
! 'admin' => array('action/admin.php','','')
);
***************
*** 103,107 ****
{
include($ActionList[$action][0]);
! $ActionList[$action][1]();
}
--- 104,109 ----
{
include($ActionList[$action][0]);
! if ($ActionList[$action][1])
! $ActionList[$action][1]();
}
***************
*** 109,112 ****
$pagestore->maintain();
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
--- 111,117 ----
$pagestore->maintain();
! if (!$anonymous)
! {
! $GLOBALS['phpgw']->common->phpgw_footer();
! }
?>
Index: url.php
===================================================================
RCS file: /cvsroot/phpgroupware/wiki/lib/url.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** url.php 6 Mar 2003 17:38:20 -0000 1.3
--- url.php 7 Mar 2003 00:19:14 -0000 1.4
***************
*** 6,10 ****
$ScriptBase = $GLOBALS['phpgw']->link('/wiki/index.php');
$ScriptBase .= strstr($ScriptBase,'?') ? '&' : '?';
! $AdminScript = $GLOBALS['phpgw']->link('/wiki/admin/index.php');
//if(!isset($ViewBase))
--- 6,11 ----
$ScriptBase = $GLOBALS['phpgw']->link('/wiki/index.php');
$ScriptBase .= strstr($ScriptBase,'?') ? '&' : '?';
!
! $AdminScript = $ScriptBase . 'action=admin';
//if(!isset($ViewBase))
***************
*** 81,83 ****
}
! ?>
\ No newline at end of file
--- 82,84 ----
}
! ?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: wiki/lib defaults.php,1.4,1.5 init.php,1.4,1.5 main.php,1.6,1.7 url.php,1.3,1.4,
Ralf Becker <address@hidden> <=