commit b776d40055e0f30f0f7940391a0ba19f45acb206
parent 7e2dd3d3e9477db74bf8d38823cd70c8877a90f1
Author: dankert <devnull@localhost>
Date: Thu, 16 Dec 2004 00:23:11 +0100
Anpassung an Session-Funktionen
Diffstat:
6 files changed, 246 insertions(+), 206 deletions(-)
diff --git a/actionClasses/FileAction.class.php b/actionClasses/FileAction.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.10 2004-11-30 22:28:20 dankert
+// Revision 1.11 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.10 2004/11/30 22:28:20 dankert
// Automatische Feststellen, ob GD installiert und welche Bildformate unterstuetzt werden
//
// Revision 1.9 2004/11/29 23:24:36 dankert
@@ -69,8 +72,16 @@ class FileAction extends ObjectAction
*/
function FileAction()
{
- $this->file = new File( $this->getSessionVar('objectid') );
- $this->file->load();
+ if ( $this->getRequestId() != 0 )
+ {
+ $this->file = new File( $this->getRequestId() );
+ $this->file->load();
+ Session::setObject( $this->file );
+ }
+ else
+ {
+ $this->file = Session::getObject();
+ }
}
diff --git a/actionClasses/FolderAction.class.php b/actionClasses/FolderAction.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.15 2004-11-29 23:24:36 dankert
+// Revision 1.16 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.15 2004/11/29 23:24:36 dankert
// Korrektur Veroeffentlichung
//
// Revision 1.14 2004/11/29 21:09:51 dankert
@@ -83,11 +86,16 @@ class FolderAction extends ObjectAction
function FolderAction()
{
- $this->folder = new Folder( $this->getSessionVar('objectid') );
- $this->folder->load();
-
- if ( ! $this->folder->isFolder )
- die( ' id '.$this->folder->objectid.' is not a folder' );
+ if ( $this->getRequestId() != 0 )
+ {
+ $this->folder = new Folder( $this->getRequestId() );
+ $this->folder->load();
+ Session::setObject( $this->folder );
+ }
+ else
+ {
+ $this->folder = Session::getObject();
+ }
}
@@ -489,18 +497,10 @@ class FolderAction extends ObjectAction
}
- function move()
- {
- $this->objectMove();
-
- $this->callSubAction('show');
- }
-
-
function create()
{
$this->setTemplateVar('templates',Template::getAll());
- $this->setTemplateVar('new_folder',$this->folder->hasRight(ACL_CREATE_FOLDER));
+ $this->setTemplateVar('new_folder',$this->folder->hasRight(ACL_CREATE_FOLDER) && count($this->folder->parentObjectIds(true,true)) < MAX_FOLDER_DEPTH );
$this->setTemplateVar('new_file' ,$this->folder->hasRight(ACL_CREATE_FILE ));
$this->setTemplateVar('new_link' ,$this->folder->hasRight(ACL_CREATE_LINK ));
$this->setTemplateVar('new_page' ,$this->folder->hasRight(ACL_CREATE_PAGE ));
@@ -578,7 +578,7 @@ class FolderAction extends ObjectAction
}
}
- if ( $o->hasRight(ACL_WRITE) )
+ if ( $this->folder->hasRight(ACL_WRITE) )
{
// Alle anderen Ordner ermitteln
$otherfolder = array();
diff --git a/actionClasses/GroupAction.class.php b/actionClasses/GroupAction.class.php
@@ -1,176 +1,179 @@
-<?php
-// ---------------------------------------------------------------------------
-// $Id$
-// ---------------------------------------------------------------------------
-// OpenRat Content Management System
-// Copyright (C) 2002-2004 Jan Dankert, cms@jandankert.de
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ---------------------------------------------------------------------------
+<?php
+// ---------------------------------------------------------------------------
+// $Id$
+// ---------------------------------------------------------------------------
+// OpenRat Content Management System
+// Copyright (C) 2002-2004 Jan Dankert, cms@jandankert.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.2 2004-05-02 14:49:37 dankert
-// Einfügen package-name (@package)
-//
-// Revision 1.1 2004/04/24 15:14:52 dankert
-// Initiale Version
-//
-// ---------------------------------------------------------------------------
-
-
-/**
- * Action-Klasse zum Bearbeiten einer Benutzergruppe
- * @author $Author$
- * @version $Revision$
- * @package openrat.actions
- */
-
-class GroupAction extends Action
-{
- var $group;
- var $defaultSubAction = 'edit';
-
-
- function GroupAction()
- {
- $this->group = new Group( $this->getSessionVar('groupid') );
- $this->group->load();
- }
-
-
- function save()
- {
- global $SESS;
-
- if ( $this->getRequestVar('delete')!='' )
- {
- $this->group->delete();
-
- unset( $SESS['groupid'] );
- $this->setTemplateVar['tree_refresh'] = true;
-
- $this->callSubAction('listing');
- }
- else
- {
- $this->group->name = $this->getRequestVar('name');
- $this->group->save();
-
- $this->callSubAction('edit');
- }
- }
-
-
- function add()
- {
- global $REQ;
-
- $this->group->name = $REQ['name'];
- $this->group->add();
-
- $this->setTemplateVar('tree_refresh',true);
-
- $this->callSubAction('listing');
- }
-
-
- function adduser()
- {
- // Benutzer der Gruppe hinzufügen
- $this->group->addUser( $this->getRequestVar('userid') );
-
- $this->callSubAction('users');
- }
-
-
- function deluser()
- {
- global $REQ;
- $this->group->delUser( $REQ['userid'] );
-
- $this->callSubAction('users');
- }
-
-
- function delright()
- {
-
- $this->group->addRight( $REQ['aclid'] );
-
- // Berechtigungen anzeigen
- $SESS['groupaction'] = 'rights';
-
- }
-
-
- function addright()
- {
- $this->group->addRight( $REQ );
-
- // Berechtigungen anzeigen
- $SESS['groupaction'] = 'rights';
- }
-
-
- function listing()
- {
- global $conf_php;
- // Liste aller Gruppen
- $list = array();
-
- foreach( Group::getAll() as $id=>$name )
- {
- $list[$id] = array();
- $list[$id]['url' ] = Html::url(array('action'=>'main','callAction'=>'group','callSubaction'=>'edit','groupid'=>$id));
- $list[$id]['name'] = $name;
- }
-
- $this->setTemplateVar('el', $list);
-
- $this->forward('group_list');
- }
-
-
- function edit()
- {
- $this->setTemplateVars( $this->group->getProperties() );
-
- $this->forward('group_edit');
- }
-
-
- function users()
- {
- // Mitgliedschaften ermitteln
- //
- $this->setTemplateVar('memberships',$this->group->getUsers());
-
-
- // Alle hinzufügbaren Benutzer ermitteln
- //
- $this->setTemplateVar('users',$this->group->getOtherUsers());
-
- $this->forward('group_users');
-
- }
-
-
- function rights()
- {
- $this->setTemplateVar('projects',$this->group->getRights());
-
- $this->forward('group_rights');
-
- }
+// Revision 1.3 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.2 2004/05/02 14:49:37 dankert
+// Einf?gen package-name (@package)
+//
+// Revision 1.1 2004/04/24 15:14:52 dankert
+// Initiale Version
+//
+// ---------------------------------------------------------------------------
+
+
+/**
+ * Action-Klasse zum Bearbeiten einer Benutzergruppe
+ * @author $Author$
+ * @version $Revision$
+ * @package openrat.actions
+ */
+
+class GroupAction extends Action
+{
+ var $group;
+ var $defaultSubAction = 'edit';
+
+
+ function GroupAction()
+ {
+ $this->group = new Group( $this->getRequestId() );
+ $this->group->load();
+ }
+
+
+ function save()
+ {
+ global $SESS;
+
+ if ( $this->getRequestVar('delete')!='' )
+ {
+ $this->group->delete();
+
+ unset( $SESS['groupid'] );
+ $this->setTemplateVar['tree_refresh'] = true;
+
+ $this->callSubAction('listing');
+ }
+ else
+ {
+ $this->group->name = $this->getRequestVar('name');
+ $this->group->save();
+
+ $this->callSubAction('edit');
+ }
+ }
+
+
+ function add()
+ {
+ global $REQ;
+
+ $this->group->name = $REQ['name'];
+ $this->group->add();
+
+ $this->setTemplateVar('tree_refresh',true);
+
+ $this->callSubAction('listing');
+ }
+
+
+ function adduser()
+ {
+ // Benutzer der Gruppe hinzuf?gen
+ $this->group->addUser( $this->getRequestVar('userid') );
+
+ $this->callSubAction('users');
+ }
+
+
+ function deluser()
+ {
+ global $REQ;
+ $this->group->delUser( $REQ['userid'] );
+
+ $this->callSubAction('users');
+ }
+
+
+ function delright()
+ {
+
+ $this->group->addRight( $REQ['aclid'] );
+
+ // Berechtigungen anzeigen
+ $SESS['groupaction'] = 'rights';
+
+ }
+
+
+ function addright()
+ {
+ $this->group->addRight( $REQ );
+
+ // Berechtigungen anzeigen
+ $SESS['groupaction'] = 'rights';
+ }
+
+
+ function listing()
+ {
+ global $conf_php;
+ // Liste aller Gruppen
+ $list = array();
+
+ foreach( Group::getAll() as $id=>$name )
+ {
+ $list[$id] = array();
+ $list[$id]['url' ] = Html::url('main','group',$id);
+ $list[$id]['name'] = $name;
+ }
+
+ $this->setTemplateVar('el', $list);
+
+ $this->forward('group_list');
+ }
+
+
+ function edit()
+ {
+ $this->setTemplateVars( $this->group->getProperties() );
+
+ $this->forward('group_edit');
+ }
+
+
+ function users()
+ {
+ // Mitgliedschaften ermitteln
+ //
+ $this->setTemplateVar('memberships',$this->group->getUsers());
+
+
+ // Alle hinzuf?gbaren Benutzer ermitteln
+ //
+ $this->setTemplateVar('users',$this->group->getOtherUsers());
+
+ $this->forward('group_users');
+
+ }
+
+
+ function rights()
+ {
+ $this->setTemplateVar('projects',$this->group->getRights());
+
+ $this->forward('group_rights');
+
+ }
}
\ No newline at end of file
diff --git a/actionClasses/LinkAction.class.php b/actionClasses/LinkAction.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.4 2004-11-24 21:28:36 dankert
+// Revision 1.5 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.4 2004/11/24 21:28:36 dankert
// "Verschieben" entfernt
//
// Revision 1.3 2004/05/02 14:49:37 dankert
@@ -51,8 +54,16 @@ class LinkAction extends ObjectAction
*/
function LinkAction()
{
- $this->link = new Link( $this->getSessionVar('objectid') );
- $this->link->load();
+ if ( $this->getRequestId() != 0 )
+ {
+ $this->link = new Link( $this->getRequestId() );
+ $this->link->load();
+ Session::setObject( $this->link );
+ }
+ else
+ {
+ $this->link = Session::getObject();
+ }
}
diff --git a/actionClasses/PageAction.class.php b/actionClasses/PageAction.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.17 2004-11-29 23:52:33 dankert
+// Revision 1.18 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.17 2004/11/29 23:52:33 dankert
// Korrektur Vorversion
//
// Revision 1.16 2004/11/29 23:48:00 dankert
@@ -88,11 +91,18 @@ class PageAction extends ObjectAction
function PageAction()
{
- if ( $this->getRequestVar('objectid') != '' )
- $this->page = new Page( $this->getRequestVar('objectid') );
- else $this->page = new Page( $this->getSessionVar('objectid') );
-
- $this->page->load();
+ $this->page = Session::getObject();
+
+ if ( $this->getRequestId() != 0 )
+ {
+ $this->page = new Page( $this->getRequestId() );
+ $this->page->load();
+ Session::setObject( $this->page );
+ }
+ else
+ {
+ $this->page = Session::getObject();
+ }
}
@@ -464,8 +474,10 @@ class PageAction extends ObjectAction
$this->page->load();
$this->page->generate();
$this->page->write();
- require( $this->page->tmpfile() );
+ require( $this->page->tmpfile );
+
+ unlink( $this->page->tmpfile );
}
diff --git a/actionClasses/UserAction.class.php b/actionClasses/UserAction.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.5 2004-11-28 22:46:55 dankert
+// Revision 1.6 2004-12-15 23:23:11 dankert
+// Anpassung an Session-Funktionen
+//
+// Revision 1.5 2004/11/28 22:46:55 dankert
// Rechte des Benutzers anzeigen
//
// Revision 1.4 2004/11/10 22:42:10 dankert
@@ -57,7 +60,7 @@ class UserAction extends Action
function UserAction()
{
- $this->user = new User( $this->getSessionVar('userid') );
+ $this->user = new User( $this->getRequestId() );
$this->user->load();
}
@@ -207,7 +210,7 @@ class UserAction extends Action
foreach( $this->user->listAll() as $userid=>$name )
{
$list[$userid] = array();
- $list[$userid]['url' ] = Html::url(array('action'=>'main','callAction'=>'user','callSubaction'=>'edit','userid'=>$userid));
+ $list[$userid]['url' ] = Html::url('main','user',$userid);
$list[$userid]['name'] = $name;
}
$this->setTemplateVar('el',$list);