[20839] update admin

Sigurd Nes <[email protected]>
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20839
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20839
Author:   sigurdne
Date:     2009-11-20 10:27:15 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
update admin

Modified Paths:
--------------
    people/sigurdne/modules/admin/trunk/inc/class.bo_custom.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.boaccounts.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.boaclmanager.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.boconfig.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.bocurrentsessions.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.menu.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.ui_custom.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiaccess_history.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiaccounts.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiaclmanager.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiapplications.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiasyncservice.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uicategories.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiconfig.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uicurrentsessions.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uilog.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiloglevels.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uimainscreen.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uimenuclass.inc.php
    people/sigurdne/modules/admin/trunk/inc/class.uiserver.inc.php
    people/sigurdne/modules/admin/trunk/inc/hook_add_def_pref.inc.php
    people/sigurdne/modules/admin/trunk/inc/hook_after_navbar.inc.php
    people/sigurdne/modules/admin/trunk/inc/hook_config.inc.php
    people/sigurdne/modules/admin/trunk/inc/hook_deleteaccount.inc.php
    people/sigurdne/modules/admin/trunk/phpinfo.php
    people/sigurdne/modules/admin/trunk/templates/base/app_data.xsl
    people/sigurdne/modules/admin/trunk/templates/base/config.tpl
    people/sigurdne/modules/admin/trunk/templates/base/css/base.css
    people/sigurdne/modules/admin/trunk/templates/base/currentusers.tpl
    people/sigurdne/modules/admin/trunk/templates/base/custom.xsl
    people/sigurdne/modules/admin/trunk/templates/base/errorlog_view.tpl
    people/sigurdne/modules/admin/trunk/templates/base/form_button_script.tpl
    people/sigurdne/modules/admin/trunk/templates/base/groups.xsl
    people/sigurdne/modules/admin/trunk/templates/base/log_level_select.tpl
    people/sigurdne/modules/admin/trunk/templates/base/menurow.tpl
    people/sigurdne/modules/admin/trunk/templates/base/users.xsl

Added Paths:
-----------
    people/sigurdne/modules/admin/trunk/class.admin.php
    people/sigurdne/modules/admin/trunk/class.base.php
    people/sigurdne/modules/admin/trunk/navbar-sel.php
    people/sigurdne/modules/admin/trunk/templates/base/confirm_delete.xsl
    people/sigurdne/modules/admin/trunk/templates/portico/
    people/sigurdne/modules/admin/trunk/templates/portico/images/
    people/sigurdne/modules/admin/trunk/templates/portico/images/navbar.png
    people/sigurdne/modules/admin/trunk/testbutton.php

Added: people/sigurdne/modules/admin/trunk/class.admin.php
===================================================================
--- people/sigurdne/modules/admin/trunk/class.admin.php	                        (rev 0)
+++ people/sigurdne/modules/admin/trunk/class.admin.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -0,0 +1,65 @@
+<?php
+	/**************************************************************************\
+	* phpGroupWare                                                             *
+	* http://www.phpgroupware.org                                              *
+	* This file written by Dan Kuykendall <[email protected]>                 *
+	* Copyright (C) 2003 Dan Kuykendall                                        *
+	* -------------------------------------------------------------------------*
+  * 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.                                               *
+	\**************************************************************************/
+
+	/* $Id$ */
+
+	class admin_admin
+	{
+		function adduser ()
+		{
+			$args = new safe_args();
+			$args->set('username');
+			$args->set('passwd', '');
+			$args->set('fname', '');
+			$args->set('lname', '');
+			$args->set('isadmin', False, 'bool');
+			$args = $args->get(func_get_args(),__LINE__,__FILE__);
+
+			if(isset($args['username']))
+			{
+				$account_info['account_lid'] = $args['username'];
+				$account_info['account_passwd'] = $args['passwd'];
+				$account_info['account_firstname'] = $args['fname'];
+				$account_info['account_lastname'] = $args['lname'];
+				$account_info['account_type'] = 'u';
+				$account_info['account_status'] = 'A';
+				$account_info['account_expires'] = mktime (0,0,0,12,31,2005);
+				$newid = $GLOBALS['phpgw']->accounts->create($account_info);
+				if($newid === False)
+				{
+					$result['text'] = '';
+					return $result;
+				}
+				$result['text'] = 'Created '.$args['username'].' which has id of '.$newid;
+
+				$acl = createobject('api_acl', array('account_id'=>$newid));
+				if($args['username'])
+				{
+					$acl->add('.',63);
+				}
+				else
+				{
+					$acl->add('api.base',1);
+					$acl->add('skel.base',1);
+					$acl->add('wcm.base',1);
+					$acl->add('admin.base',1);
+				}
+			}
+			else
+			{
+				$result['text'] = 'Enter details';
+			}
+			$GLOBALS['phpgw']->add_xsl('admin.adduser');
+			return $result;
+		}	
+	}


Property changes on: people/sigurdne/modules/admin/trunk/class.admin.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Added: people/sigurdne/modules/admin/trunk/class.base.php
===================================================================
--- people/sigurdne/modules/admin/trunk/class.base.php	                        (rev 0)
+++ people/sigurdne/modules/admin/trunk/class.base.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -0,0 +1,25 @@
+<?php
+	/**************************************************************************\
+	* phpGroupWare                                                             *
+	* http://www.phpgroupware.org                                              *
+	* This file written by Dan Kuykendall <[email protected]>                 *
+	* Copyright (C) 2003 Dan Kuykendall                                        *
+	* -------------------------------------------------------------------------*
+  * 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.                                               *
+	\**************************************************************************/
+
+	/* $Id$ */
+
+	class admin_base
+	{
+		var $sec;
+		function start()
+		{
+			$result['text'] = '|| admin app ||';
+			$GLOBALS['phpgw']->add_xsl('admin.base');
+			return $result;
+		}
+	}


Property changes on: people/sigurdne/modules/admin/trunk/class.base.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Modified: people/sigurdne/modules/admin/trunk/inc/class.bo_custom.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.bo_custom.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.bo_custom.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,7 +1,8 @@
 <?php
 	/**
-	* phpGroupWare - property: a Facilities Management System.
+	* phpGroupWare - admin
 	*
+	* @author Dave Hall <[email protected]>
 	* @author Sigurd Nes <[email protected]>
 	* @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. http://www.fsf.org/
 	* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
@@ -16,7 +17,7 @@
 	 * @package property
 	 */
 
-	class bo_custom
+	class admin_bo_custom
 	{
 		var $start;
 		var $query;
@@ -54,10 +55,10 @@
 			)
 		);
 
-		function bo_custom($session=False)
+		public function __construct($session=False)
 		{
 			$this->currentapp	= $GLOBALS['phpgw_info']['flags']['currentapp'];
-			$this->so 		= CreateObject('phpgwapi.custom_fields');
+			$this->so			= createObject('phpgwapi.custom_fields');
 
 			if ($session)
 			{
@@ -106,7 +107,7 @@
 
 			$this->start	= (isset($data['start'])?$data['start']:'');
 			$this->query	= (isset($data['query'])?$data['query']:'');
-		//	$this->filter	= $data['filter'];
+			//$this->filter	= $data['filter'];
 			$this->sort		= (isset($data['sort'])?$data['sort']:'');
 			$this->order	= (isset($data['order'])?$data['order']:'');
 			$this->location	= (isset($data['location'])?$data['location']:'');
@@ -114,17 +115,31 @@
 			$this->allrows	= (isset($data['allrows'])?$data['allrows']:'');
 		}
 
-		function delete($location='',$appname='',$attrib_id='',$custom_function_id='')
+		/**
+		 * Delete what ever data you feel like, we can just keep on adding conditions to the if block here for you
+		 *
+		 * @param string $location the location
+		 * @param string $appname the application name
+		 * @param int $attrib_id the db pk for the attribute to delete
+		 * @param int $attrib_id the db pk for the attribute to delete
+		 *
+		 * @return void
+		 */
+		public function delete($location = '', $appname = '', $attrib_id = 0, $custom_function_id = 0)
 		{
-			if($attrib_id && $location && $appname && !$custom_function_id):
+			if ( !$attrib_id || !$location )
+		{
+				return;
+			}
+				
+			if ( $attrib_id && !$custom_function_id )
 			{
-				$this->so->_delete_attrib($location,$appname,$attrib_id);
+				$this->so->delete($appname, $location, $attrib_id);
 			}
-			elseif($custom_function_id && $appname && $location):
+			else if ( $custom_function_id )
 			{
-				$this->so->_delete_custom_function($appname,$location,$custom_function_id);
+				$GLOBALS['phpgw']->custom_functions->delete($appname, $location, $custom_function_id);
 			}
-			endif;
 		}
 
 		function get_attribs($appname = '',$location = '', $allrows = null)
@@ -133,8 +148,9 @@
 			{
 				$this->allrows = $allrows;
 			}
+
 			$inc_choices = false;
-		 	$attribs = $this->so->get_attribs($appname, $location, $this->start, $this->query, $this->sort, $this->order, $this->allrows, $inc_choices);
+		 	$attribs = $this->so->find($appname, $location, $this->start, $this->query, $this->sort, $this->order, $this->allrows, $inc_choices);
 
 			foreach( $attribs as &$attrib )
 			{
@@ -148,156 +164,208 @@
 
 		function get_attrib_single($appname,$location,$id)
 		{
-			return $this->so->get_attrib_single($appname,$location,$id);
+			return $this->so->get($appname,$location,$id);
 		}
 
 		function resort_attrib($id,$resort)
 		{
-			$this->so->resort_attrib($id, $resort, $this->appname, $this->location);
+			$this->so->resort($id, $resort, $this->appname, $this->location);
 		}
 
 		function save_attrib($attrib)
 		{
 			if (isset($attrib['id']) && $attrib['id'])
 			{
-					$receipt = $this->so->edit_attrib($attrib);
+				if ( $this->so->edit($attrib) )
+				{
+					return array
+					(
+						'msg'	=> array('msg' => lang('Custom field has been created'))
+					);
+				}
+
+				return array('error' => lang('Unable to edit custom field'));
 			}
 			else
 			{
-				$receipt = $this->so->add_attrib($attrib);
+				$id = $this->so->add($attrib);
+
+				if ( $id == 0  )
+				{
+					return array('error' => lang('Unable to add field'));
+				}
+				else if ( $id == -1 )
+				{
+					return array
+					(
+						'id'	=> '',
+						'error'	=> array
+						(
+							array('msg' => lang('Table is not defined')),
+							array('msg' => lang('Attribute has NOT been saved'))
+						)
+					);
 			}
-			return $receipt;
+				else if ( $id == -2 )
+				{
+					return array
+					(
+						'id'	=> '',
+						'error'	=> array
+						(
+							array('msg' => lang('field already exists, please choose another name')),
+							array('msg' => lang('Attribute has NOT been saved'))
+						)
+					);
 		}
 
+				return array
+				(
+					'id'	=> $id,
+					'msg'	=> array('msg' => lang('Custom field has been created'))
+				);
+			}
+		}
 
-		function read_custom_function($appname='',$location='',$allrows='')
+		function read_custom_function($appname, $location, $allrows = false)
 		{
-			if($allrows)
+			if ( $allrows )
 			{
 				$this->allrows = $allrows;
 			}
 
-			$custom_function = $this->so->read_custom_function(array('start' => $this->start,'query' => $this->query,'sort' => $this->sort,'order' => $this->order,
-											'appname' => $appname,'location' => $location,'allrows'=>$this->allrows));
+			$criteria = array
+			(
+				'start'		=> $this->start,
+				'query'		=> $this->query,
+				'sort'		=> $this->sort,
+				'order'		=> $this->order,
+				'appname'	=> $appname,
+				'location'	=> $location,
+				'allrows'	=> $this->allrows
+			);
 
-			$this->total_records = $this->so->total_records;
+			$custom_function = $GLOBALS['phpgw']->custom_functions->find($criteria);
 
+			$this->total_records = $GLOBALS['phpgw']->custom_functions->total_records;
+
 			return $custom_function;
 		}
 
-		function resort_custom_function($id,$resort)
+		/**
+		 * Resort a list of custom functions
+		 *
+		 * @param integer $id the db key of the function
+		 * @param string  $resort the direction to resort the item (up/down)
+		 *
+		 * @return void
+		 */
+		public function resort_custom_function($id, $resort)
 		{
-			$this->so->resort_custom_function(array('resort'=>$resort,'appname' => $this->appname,'location' => $this->location,'id'=>$id));
+			$GLOBALS['phpgw']->custom_functions->resort($id, $resort, $this->appname, $this->location);
 		}
 
-		function save_custom_function($custom_function,$action='')
+		/**
+		 * Sigurd knows what I do
+		 *
+		 * @param string $custom_function ????
+		 * @param string $action          ????
+		 */
+		public function save_custom_function($custom_function, $action = '')
 		{
-			if ($action=='edit')
+			$cfuncs =& $GLOBALS['phpgw']->custom_functions;
+
+			if ( $action == 'edit' )
 			{
-				if ($custom_function['id'] != '')
+				if ( $custom_function['id'] != '' )
 				{
-
-					$receipt = $this->so->edit_custom_function($custom_function);
+					if ( $cfuncs->edit($custom_function) )
+					{
+						return array('msg' => lang('Custom function has been updated'));
+					}
 				}
+				return array('error' => lang('Unable to edit custom function'));
 			}
 			else
 			{
-				$receipt = $this->so->add_custom_function($custom_function);
+				$id = $cfuncs->add($custom_function);
+				if ( $id )
+				{
+					return array('id' => $id);
 			}
-			return $receipt;
+				return array('error' => lang('Unable to add custom function'));
 		}
-
-		function select_custom_function($selected='', $appname)
-		{
-			$file_list = array();
-			$dir = PHPGW_SERVER_ROOT . "{$appname}/inc/custom";
-			if ( !is_dir($dir) )
-			{
-				return $file_list;
 			}
 
-			$dir_handle = opendir($dir);
-			$myfilearray = '';
-			if ($dir_handle)
-			{
-				while ($file = readdir($dir_handle))
+		/**
+		 * Create an XSLT select widget compatiable array containing custom functions
+		 *
+		 * @param string $selected the name of the currently selected file
+		 * @param string $appname  the name of the module requesting the list
+		 *
+		 * @return array list of custom functions
+		 */
+		public static function select_custom_function($selected, $appname)
 				{
-					if ((substr($file, 0, 1) != '.') && is_file("{$dir}/{$file}") )
+			$dirname = PHPGW_SERVER_ROOT . "/{$appname}/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}";
+			// prevent path traversal
+			if ( preg_match('/\./', $appname) 
+			 || !is_dir($dirname) )
 					{
-						$myfilearray[] = $file;
-					}
-				}
-				closedir($dir_handle);
-				sort($myfilearray);
+				return array();
 			}
 
-			if(isset($myfilearray)&&is_array($myfilearray))
+			$find = array('/_/', '/\.php$/');
+			$replace = array(' ', '');
+
+			$file_list = array();
+			$dir = new DirectoryIterator(PHPGW_SERVER_ROOT . "/{$appname}/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}"); 
+			if ( is_object($dir) )
 			{
-				for ($i=0;$i<count($myfilearray);$i++)
+				foreach ( $dir as $file )
 				{
-					$fname = ereg_replace('_',' ',$myfilearray[$i]);
-					$sel_file = '';
-					if ($myfilearray[$i]==$selected)
+					if ( $file->isDot() || !$file->isFile() || !$file->isReadable() )
 					{
-						$sel_file = 'selected';
+						continue;
 					}
 
 					$file_list[] = array
 					(
-						'id'		=> $myfilearray[$i],
-						'name'		=> $fname,
-						'selected'	=> $sel_file
+						'id'		=> (string) $file,
+						'name'		=> preg_replace($find, $replace, $file),
+						'selected'	=> (int) ($file == $selected)
 					);
 				}
 			}
 
-			for ($i=0;$i<count($file_list);$i++)
-			{
-				if ($file_list[$i]['selected'] != 'selected')
-				{
-					unset($file_list[$i]['selected']);
-				}
-			}
-
 			return $file_list;
 		}
 
-		function read_single_custom_function($appname='',$location='',$id)
+		/**
+		 * Fetch a single custom function
+		 *
+		 * @param string  $appname  the module the function belongs to
+		 * @param string  $location the location the function is used
+		 * @param integer $id       the ID for the function
+		 *
+		 * @return array the function values - null if not found
+		 */
+		function read_single_custom_function($appname, $location, $id)
 		{
-			return $this->so->read_single_custom_function($appname,$location,$id);
+			return $GLOBALS['phpgw']->custom_functions->get($appname, $location, $id);
 		}
 
 		function select_datatype($selected='')
 		{
-			$datatypes[0]['id']= 'V';
-			$datatypes[0]['name']= lang('varchar');
-			$datatypes[1]['id']= 'C';
-			$datatypes[1]['name']= lang('Character');
-			$datatypes[2]['id']= 'I';
-			$datatypes[2]['name']= lang('Integer');
-			$datatypes[3]['id']= 'N';
-			$datatypes[3]['name']= lang('Decimal');
-			$datatypes[4]['id']= 'D';
-			$datatypes[4]['name']= lang('Date');
-			$datatypes[5]['id']= 'T';
-			$datatypes[5]['name']= lang('Memo');
-			$datatypes[6]['id']= 'R';
-			$datatypes[6]['name']= lang('Multiple radio');
-			$datatypes[7]['id']= 'CH';
-			$datatypes[7]['name']= lang('Multiple Checkbox');
-			$datatypes[8]['id']= 'LB';
-			$datatypes[8]['name']= lang('ListBox');
-			$datatypes[9]['id']= 'AB';
-			$datatypes[9]['name']= lang('Contact');
-			$datatypes[10]['id']= 'VENDOR';
-			$datatypes[10]['name']= lang('Vendor');
-			$datatypes[11]['id']= 'email';
-			$datatypes[11]['name']= lang('Email');
-			$datatypes[12]['id']= 'link';
-			$datatypes[12]['name']= lang('Link');
-
+			foreach( $this->so->datatype_text as $key => $name)
+			{
+				$datatypes[] = array
+				(
+					'id'	=> $key,
+					'name'	=> $name,
+				);
+			}
 			return $this->select_list($selected,$datatypes);
-
 		}
 
 		function select_nullable($selected='')
@@ -338,4 +406,3 @@
 			return $entry_list;
 		}
 	}
-?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.boaccounts.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.boaccounts.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.boaccounts.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -4,7 +4,7 @@
 	* @author coreteam <[email protected]>
 	* @author Dave Hall <[email protected]>
 	* @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc. http://www.fsf.org/
-	* @license http://www.gnu.org/licenses/ GNU General Public License v3 or later
+	* @license http://www.gnu.org/licenses/ GNU General Public License v2 or later
 	* @package admin
 	* @subpackage accounts
 	* @version $Id$
@@ -13,7 +13,7 @@
 	/*
 	   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 3 of the License, or
+	   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,
@@ -191,8 +191,16 @@
 			else //edit group
 			{
 				$GLOBALS['phpgw']->accounts->update_group($new_group, $values['account_user'],
-														array_keys($values['account_apps']));
+														$values['account_apps']);
 			}
+
+			//Delete cached menu for members of group
+			$members = $GLOBALS['phpgw']->accounts->member($id);
+			foreach($members as $entry)
+			{
+				phpgwapi_cache::user_clear('phpgwapi', 'menu', $entry['account_id']);
+			}
+			return $id;
 		}
 
 		/**
@@ -285,7 +293,7 @@
 				'lid'				=> $values['lid'],
 				'firstname'			=> $values['firstname'],
 				'lastname'			=> $values['lastname'],
-				'enabled'			=> $values['enabled'],
+				'enabled'			=> isset($values['enabled']) ? $values['enabled'] : '',
 				'expires'			=> $values['expires'],
 				'quota'				=> $values['quota']
 			);
@@ -303,10 +311,29 @@
 
 			$groups = $values['account_groups'];
 			$acls = array();
-			$apps = is_array($values['account_permissions']) ? array_keys($values['account_permissions']) : array();
+			if ( $values['changepassword'] )
+			{
+				$acls[] = array
+				(
+					'appname' 	=> 'preferences',
+					'location'	=> 'changepassword',
+					'rights'	=> 1
+				);
+			}
+			if ( $values['anonymous'] )
+			{
+				$acls[] = array
+				(
+					'appname' 	=> 'phpgwapi',
+					'location'	=> 'anonymous',
+					'rights'	=> 1
+				);
+			}
+
+			$apps = $values['account_permissions'] ? array_keys($values['account_permissions']) : array();
+
 			unset($values['account_groups'], $values['account_permissions']);
 
-
 			try
 			{
 				foreach ( $user_data as $key => $val )
@@ -319,6 +346,11 @@
 				throw $e;
 			}
 
+			if ( $user->id )
+			{
+				phpgwapi_cache::user_clear('phpgwapi', 'menu', $user->id);
+			}
+
 			if ( !$user->is_dirty() )
 			{
 				return $user->id;

Modified: people/sigurdne/modules/admin/trunk/inc/class.boaclmanager.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.boaclmanager.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.boaclmanager.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,105 +1,166 @@
 <?php
-	/**************************************************************************\
-	* phpGroupWare - Administration                                            *
-	* http://www.phpgroupware.org                                              *
-	* --------------------------------------------                             *
-	*  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.                                              *
-	\**************************************************************************/
-	/* $Id$ */
+	/**
+	 * phpGroupWare - Administration - ACL manager logic
+	 *
+	 * @author Dave Hall <[email protected]>
+	 * @author Others <unknown>
+	 * @copyright Copyright (C) 2007-2008 Free Software Foundation, Inc. http://www.fsf.org/
+	 * @license http://www.fsf.org/licenses/gpl.html GNU General Public License
+	 * @package phpgroupware
+	 * @subpackage admin
+	 * @version $Id$
+	 */
 
-	class boaclmanager
+	/*
+	   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, see <http://www.gnu.org/licenses/>.
+	 */
+
+	/*
+	 * phpGroupWare - Administration - ACL manager logic
+	 *
+	 * @package phpgroupware
+	 * @subpackage admin
+	 */
+
+	class admin_boaclmanager
 	{
-		var $public_functions = array
+		/**
+		 * Publicly available methods of the class
+		 */
+		public $public_functions = array
 		(
-			'submit' => True
+			'submit' => true
 		);
 
-		function boaclmanager()
+		/**
+		 * Constructor
+		 *
+		 * @return void
+		 */
+		public function __construct()
 		{
-			//$this->ui = createobject('admin.uiaclmanager');
+			//i do nothing!
 		}
 
-		function submit()
+		/**
+		 * Handle the form submission
+		 *
+		 * @return void
+		 */
+		public function submit()
 		{
-			if ($GLOBALS['cancel'])
+			if ( phpgw::get_var('cancel', 'bool') )
 			{
-				//$this->ui->list_apps();
-				return False;
+				return false;
 			}
 
-			$location = base64_decode($GLOBALS['location']);
+			$app = phpgw::get_var('acl_app', 'string');
+			$account_id = phpgw::get_var('account_id', 'int');
+			$location = phpgw::get_var('location', 'string');
 
 			$total_rights = 0;
-			while (is_array($GLOBALS['acl_rights']) && list(,$rights) = each($GLOBALS['acl_rights']))
+			$acl_rights = phpgw::get_var('acl_rights', 'int');
+			if ( !is_array($acl_rights) )
 			{
+				return;
+			}
+
+			foreach ( $acl_rights as $rights )
+			{
 				$total_rights += $rights;
 			}
 
-			$GLOBALS['phpgw']->acl->add_repository($GLOBALS['acl_app'], $location, $GLOBALS['account_id'], $total_rights);
-
-			//$this->ui->list_apps();
+			$GLOBALS['phpgw']->acl->add_repository($acl_app, $location, $account_id, $total_rights);
 		}
 
-		function get_addressmaster_ids()
+		/**
+		 * Get the list of "addressmasters" ids
+		 *
+		 * @return array list of addressmaster id
+		 */
+		public function get_addressmaster_ids()
 		{
-			return $GLOBALS['phpgw']->acl->get_ids_for_location('addressmaster',7,'addressbook');
+			return $GLOBALS['phpgw']->acl->get_ids_for_location('addressmaster', 7, 'addressbook');
 		}
 
-		function list_addressmasters()
+		/**
+		 * Get a list of users who are address masters
+		 *
+		 * @return array list of addressmasters
+		 */
+		public function list_addressmasters()
 		{
 			$admins = $this->get_addressmaster_ids();
 			//_debug_array($admins);
 
 			$data = array();
-			for ( $i = count($admins) - 1; $i >= 0; --$i)
+			foreach ( $admins as $admin )
 			{
-				$acc_name = $GLOBALS['phpgw']->accounts->get($admins[$i]);
+				$acct = $GLOBALS['phpgw']->accounts->get($admin);
 
-				if ( isset($admins[$i]) )
+				if ( is_object($acct) )
 				{
 					$data[] = array
 					(
-						'account_id'	=> $admins[$i],
-						'lid'			=> $acc_name->lid,
-						'firstname'		=> $acc_name->firstname,
-						'lastname'		=> $acc_name->lastname
+						'account_id'	=> $acct->id,
+						'lid'			=> $acct->lid,
+						'firstname'		=> $acct->firstname,
+						'lastname'		=> $acct->lastname
 					);
 				}
 			}
-
- 			$this->total = count($data);
 			return $data;
 		}
 
-		function check_values($users = 0, $groups = 0)
+		/**
+		 * Check the the values for the addressmasters are valid
+		 *
+		 * @param array $users  list of users to check
+		 * @param array $groups list of groups to check
+		 *
+		 * @return array empty array if ok or list of errors if invalid
+		 */
+		public function check_values($users = array(), $groups = array())
 		{
 			$errors = array();
 			if ( !count($users) && !count($groups) )
 			{
 				$errors[] = lang('please choose at least one addressmaster');
 			}
-			if ( count($errors) )
-			{
 				return $errors;
 			}
-		}
 
-		function edit_addressmasters($master,$group = 0)
+		/**
+		 * Update the list of addressmasters
+		 *
+		 * @param array $masters list of users who are addressmasters
+		 * @param array $groups  list of groups who are addressmasters
+		 *
+		 * @return void
+		 */
+		public function edit_addressmasters($masters, $groups = array())
 		{
-			$GLOBALS['phpgw']->acl->delete_repository('addressbook','addressmaster',False);
+			$GLOBALS['phpgw']->acl->delete_repository('addressbook', 'addressmaster', false);
 
-			for($i=0;$i<count($master);$i++)
+			foreach ( $masters as $master )
 			{
-				$GLOBALS['phpgw']->acl->add_repository('addressbook', 'addressmaster',$master[$i],7);
+				$GLOBALS['phpgw']->acl->add_repository('addressbook', 'addressmaster', $master, 7);
 			}
 
-			for($i=0;$i<count($group);$i++)
+			foreach ( $groups as $group )
 			{
-				$GLOBALS['phpgw']->acl->add_repository('addressbook', 'addressmaster',$group[$i],7);
+				$GLOBALS['phpgw']->acl->add_repository('addressbook', 'addressmaster', $group, 7);
 			}
 		}
 	}
-?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.boconfig.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.boconfig.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.boconfig.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -85,7 +85,7 @@
 
 			$conf = CreateObject('phpgwapi.config', $data['appname']);
 
-			$conf->read_repository();
+			$conf->read();
 			reset($newsettings);
 			while(list($key,$val) = each($newsettings))
 			{

Modified: people/sigurdne/modules/admin/trunk/inc/class.bocurrentsessions.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.bocurrentsessions.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.bocurrentsessions.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -16,8 +16,9 @@
 	{
 		var $ui;
 		var $so;
-		var $public_functions = array(
-			'kill' => True
+		var $public_functions = array
+		(
+			'kill' => true
 		);
 
 		function total()
@@ -25,33 +26,44 @@
 			return $GLOBALS['phpgw']->session->total();
 		}
 
-		function list_sessions($start,$order,$sort)
+		function list_sessions($start, $order, $sort)
 		{
-			$values = $GLOBALS['phpgw']->session->list_sessions($start,$sort,$order);
 
-			while (list(,$value) = @each($values))
+			$view_ip = false;
+			if ( !$GLOBALS['phpgw']->acl->check('current_sessions_access', phpgwapi_acl::EDIT, 'admin') )
 			{
-				if (ereg('@',$value['session_lid']))
+				$view_ip = true;
+			}
+
+			$view_action = false;
+			if ( !$GLOBALS['phpgw']->acl->check('current_sessions_access', phpgwapi_acl::ADD, 'admin') )
 				{
-					$t = split('@',$value['session_lid']);
-					$session_lid = $t[0];
+				$view_action = true;
 				}
-				else
+
+			$values = $GLOBALS['phpgw']->session->list_sessions($start, $sort, $order);
+			foreach ( $values as &$value )
 				{
-					$session_lid = $value['session_lid'];
+				if ( preg_match('/^(.*)@(.*)$/', $value['lid'], $m) )
+				{
+					$value['lid'] = $m[1];
 				}
 
-				$_values[] = array(
-					'session_id'        => $value['session_id'],
-					'session_lid'       => $session_lid,
-					'session_ip'        => $value['session_ip'],
-					'session_logintime' => $GLOBALS['phpgw']->common->show_date($value['session_logintime']),
-					'session_action'    => $value['session_action'],
-					'session_dla'       => $value['session_dla'],
-					'session_idle'      => gmdate('G:i:s',(time() - $value['session_dla']))
-				);
+				if ( !$view_action )
+				{
+					$value['action'] = ' -- ';
 			}
-			return $_values;
+
+				if ( !$view_ip )
+				{
+					$value['ip'] = ' -- ';
+				}
+				
+				$value['idle'] = gmdate('G:i:s', time() - $value['dla']);
+				$value['logintime'] = $GLOBALS['phpgw']->common->show_date($value['logints']);
+			}
+			
+			return $values;
 		}
 
 		function kill()
@@ -60,7 +72,7 @@
 				($GLOBALS['sessionid'] != $_GET['ksession']) &&
 				! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
 			{
-				$GLOBALS['phpgw']->session->destroy($_GET['ksession'],0);
+				$GLOBALS['phpgw']->session->destroy($_GET['ksession']);
 			}
 			$this->ui = createobject('admin.uicurrentsessions');
 			$this->ui->list_sessions();

Modified: people/sigurdne/modules/admin/trunk/inc/class.menu.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.menu.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.menu.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -3,16 +3,16 @@
 	 * Admin - Menus
 	 *
 	 * @author Dave Hall <[email protected]>
-	 * @copyright Copyright (C) 2007 Free Software Foundation, Inc. http://www.fsf.org/
+	 * @copyright Copyright (C) 2007 - 2008 Free Software Foundation, Inc. http://www.fsf.org/
 	 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
 	 * @package addressbook 
-	 * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
+	 * @version $Id: class.menu.inc.php 1781 2008-11-02 19:51:19Z sigurd $
 	 */
 
 	/*
 	   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 3 of the License, or
+	   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,
@@ -46,7 +46,8 @@
 				'admin'	=> array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Administration', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'admin.uimainscreen.mainscreen') ),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction'=> 'admin.uimainscreen.mainscreen')),
 					'image'	=> array('admin', 'navbar'),
 					'order'	=> -5,
 					'group'	=> 'systools'
@@ -54,139 +55,162 @@
 			);
 
 			$menus['admin'] = array();
-			if (! $GLOBALS['phpgw']->acl->check('site_config_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('site_config_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['index'] = array
 				(
-					'text'	=> $GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiconfig.index', 'appname' => 'admin') )
+					'text'	=> $GLOBALS['phpgw']->translation->translate('global configuration', array(), true),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiconfig.index', 'appname' => 'admin'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('account_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['users'] = array
 				(
-					'text'	=> $GLOBALS['phpgw']->translation->translate('User Accounts', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.list_users') )
+					'text'	=> $GLOBALS['phpgw']->translation->translate('manage users', array(), true),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiaccounts.list_users'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['groups'] = array
 				(
-					'text'	=> $GLOBALS['phpgw']->translation->translate('User Groups', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.list_groups') )
+					'text'	=> $GLOBALS['phpgw']->translation->translate('manage groups', array(), true),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiaccounts.list_groups'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('applications_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('sync_account', PHPGW_ACL_READ, 'admin'))
 			{
+				$menus['admin']['sync_account'] = array
+				(
+					'text'	=> $GLOBALS['phpgw']->translation->translate('Sync Account-Contact', array(), true),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.sync_accounts_contacts') )
+				);
+			}
+
+			if (! $GLOBALS['phpgw']->acl->check('applications_access', phpgwapi_acl::READ, 'admin'))
+			{
 				$menus['admin']['apps'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Applications', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiapplications.get_list') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiapplications.get_list'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('global_categories_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('global_categories_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['categories'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uicategories.index') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uicategories.index'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('account_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['addressmasters'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('addressmasters', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaclmanager.list_addressmasters', 'account_id' => $GLOBALS['phpgw_info']['user']['account_id']) )
-				);
-			}
-
-			if (! $GLOBALS['phpgw']->acl->check('custom_fields_access', PHPGW_ACL_READ, 'admin'))
-			{
-				$menus['admin']['list_functions'] = array
+					'url'	=> $GLOBALS['phpgw']->link('/index.php', array
 				(
-					'text'	=> $GLOBALS['phpgw']->translation->translate('custom functions', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.ui_custom.list_custom_function', 'appname' => 'tts') )
+									'menuaction' => 'admin.uiaclmanager.list_addressmasters',
+									'account_id' => $GLOBALS['phpgw_info']['user']['account_id']
+								))
 				);
 			}
 
-			if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access', PHPGW_ACL_READ, 'admin') || !$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin'))
+			if ( !$GLOBALS['phpgw']->acl->check('mainscreen_message_access', phpgwapi_acl::READ, 'admin')
+				|| !$GLOBALS['phpgw']->acl->check('mainscreen_message_access', phpgwapi_acl::ADD, 'admin'))
 			{
 				$menus['admin']['mainscreen'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Change Main Screen Message', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uimainscreen.index') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uimainscreen.index'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('current_sessions_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('current_sessions_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['sessions'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('View Sessions', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uicurrentsessions.list_sessions') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uicurrentsessions.list_sessions'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('access_log_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('access_log_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['access_log'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('View Access Log', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccess_history.list_history') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiaccess_history.list_history'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('error_log_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('error_log_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['error_log'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('View Error Log', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uilog.list_log') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uilog.list_log'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('error_log_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('error_log_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['log_levels'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Edit Log Levels', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiloglevels.edit_log_levels') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiloglevels.edit_log_levels'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('applications_access', PHPGW_ACL_PRIVATE, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('applications_access', phpgwapi_acl::PRIV, 'admin'))
 			{
+				$text = $GLOBALS['phpgw']->translation->translate('Find and Register all Application Hooks',
+						array(), true);
+
 				$menus['admin']['hooks'] = array
 				(
-					'text'	=> $GLOBALS['phpgw']->translation->translate('Find and Register all Application Hooks', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiapplications.register_all_hooks') )
+					'text'	=> $text,
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiapplications.register_all_hooks'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('asyncservice_access', PHPGW_ACL_READ, 'admin'))
+			if (! $GLOBALS['phpgw']->acl->check('asyncservice_access', phpgwapi_acl::READ, 'admin'))
 			{
 				$menus['admin']['async'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Asynchronous timed services', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiasyncservice.index') )
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiasyncservice.index'))
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('info_access', PHPGW_ACL_READ, 'admin') && function_exists('phpinfo') ) // it is possible to disable commands in php.ini
+			if (! $GLOBALS['phpgw']->acl->check('info_access', phpgwapi_acl::READ, 'admin')
+					&& function_exists('phpinfo') ) // it is possible to disable commands in php.ini
 			{
 				$menus['admin']['phpinfo'] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('PHP Configuration', array(), true),
-					// degrade gracefully hack
-					'url'	=> $GLOBALS['phpgw']->link('/admin/phpinfo.php') . '" onclick="window.open(\'' . $GLOBALS['phpgw']->link('/admin/phpinfo.php', array('noheader' => 1)) . '\'); return false;',
+					'url'	=> $GLOBALS['phpgw']->link('/admin/phpinfo.php')
+								. '" onclick="window.open(\''
+								. $GLOBALS['phpgw']->link('/admin/phpinfo.php', array('noheader' => 1))
+								. '\'); return false;',
 				);
 			}
 
@@ -197,33 +221,40 @@
 			}
 
 			$menus['toolbar'] = array();
-			if ( $GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_ADD, 'admin') || $GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_PRIVATE, 'admin') )
+			if ( $GLOBALS['phpgw']->acl->check('account_access', phpgwapi_acl::ADD, 'admin')
+					|| $GLOBALS['phpgw']->acl->check('account_access', phpgwapi_acl::PRIV, 'admin') )
 			{
 				$menus['toolbar'][] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Add User', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.edit_account', 'account_id' => 0) ),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiaccounts.edit_account', 'account_id' => 0)),
 					'image'	=> array('admin', 'user')
 				);
 			}
 			
-			if ( $GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_ADD, 'admin') || $GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_PRIVATE, 'admin') )
+			if ( $GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::ADD, 'admin')
+				|| $GLOBALS['phpgw']->acl->check('group_access', phpgwapi_acl::PRIV, 'admin') )
 			{
 				$menus['toolbar'][] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('Add Group', array(), true),
-					'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.edit_group', 'account_id' => 0) ),
+					'url'	=> $GLOBALS['phpgw']->link('/index.php',
+								array('menuaction' => 'admin.uiaccounts.edit_group', 'account_id' => 0)),
 					'image'	=> array('admin', 'group')
 				);
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('info_access', PHPGW_ACL_READ, 'admin') )
+			if ( !$GLOBALS['phpgw']->acl->check('info_access', phpgwapi_acl::READ, 'admin')
+					&& function_exists('phpinfo') )
 			{
 				$menus['toolbar'][] = array
 				(
 					'text'	=> $GLOBALS['phpgw']->translation->translate('phpInfo', array(), true),
-					// degrade gracefully hack
-					'url'	=> $GLOBALS['phpgw']->link('/admin/phpinfo.php') . '" onclick="window.open(\'' . $GLOBALS['phpgw']->link('/admin/phpinfo.php') . '\'); return false;"',
+					'url'	=> $GLOBALS['phpgw']->link('/admin/phpinfo.php')
+								. '" onclick="window.open(\''
+								. $GLOBALS['phpgw']->link('/admin/phpinfo.php')
+								. '\'); return false;"',
 					'image'	=> array('admin', 'php')
 				);
 			}

Modified: people/sigurdne/modules/admin/trunk/inc/class.ui_custom.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.ui_custom.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.ui_custom.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -24,7 +24,7 @@
 		var $sort;
 		var $order;
 		var $sub;
-		var $currentapp;
+		var $local_menu_selection = false;
 
 		var $public_functions = array
 		(
@@ -48,13 +48,16 @@
 			$this->allrows				= $this->bo->allrows;
 
 			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-			$this->currentapp			= $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$this->nextmatchs			= CreateObject('phpgwapi.nextmatchs');
 			$this->account				= $GLOBALS['phpgw_info']['user']['account_id'];
 			$this->bolocation			= CreateObject('preferences.boadmin_acl');
 			$this->bolocation->acl_app 	= $this->appname;
 
+			if(!$GLOBALS['phpgw_info']['flags']['menu_selection'] = phpgw::get_var('menu_selection'))
+			{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] = "admin::{$this->appname}";
+				$this->local_menu_selection = true;
+			}
 		}
 
 		function save_sessiondata()
@@ -80,7 +83,10 @@
 			$id			= phpgw::get_var('id', 'int');
 			$resort		= phpgw::get_var('resort');
 
+			if($this->local_menu_selection)
+			{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::list_atrribs';
+			}
 
 			$GLOBALS['phpgw']->xslttpl->add_file(array(
 								'custom',
@@ -105,10 +111,10 @@
 						'input_text'			=> $entry['input_text'],
 						'sorting'				=> $entry['attrib_sort'],
 						'search'				=> $entry['search'],
-						'link_up'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_attribute', 'resort'=>'up', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-						'link_down'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_attribute', 'resort'=>'down', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-						'link_edit'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.edit_attrib', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'])),
-						'link_delete'			=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.delete', 'appname'=> $appname, 'location'=> $location, 'attrib_id'=> $entry['id'])),
+						'link_up'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.list_attribute', 'resort'=>'up', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
+						'link_down'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.list_attribute', 'resort'=>'down', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
+						'link_edit'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.edit_attrib', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
+						'link_delete'			=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.delete', 'appname'=> $appname, 'location'=> $location, 'attrib_id'=> $entry['id'], 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
 						'lang_up_text'			=> lang('shift up'),
 						'lang_down_text'		=> lang('shift down'),
 						'lang_edit_text'		=> lang('edit the attrib'),
@@ -137,20 +143,24 @@
 											'sort'	=> $this->sort,
 											'var'	=> 'column_name',
 											'order'	=> $this->order,
-											'extra'	=> array('menuaction'	=> $this->currentapp.'.ui_custom.list_attribute',
+											'extra'	=> array('menuaction'	=> 'admin.ui_custom.list_attribute',
 														'appname'	=> $appname,
 														'location'	=> $location,
-														'allrows'	=> $this->allrows)
+														'allrows'	=> $this->allrows,
+														'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
+														 )
 										)),
 				'sort_sorting'		=> $this->nextmatchs->show_sort_order(array
 										(
 											'sort'	=> $this->sort,
 											'var'	=> 'attrib_sort',
 											'order'	=> $this->order,
-											'extra'	=> array('menuaction'	=> $this->currentapp.'.ui_custom.list_attribute',
+											'extra'	=> array('menuaction'	=> 'admin.ui_custom.list_attribute',
 														'appname'	=> $appname,
 														'location'	=> $location,
-														'allrows'	=> $this->allrows)
+														'allrows'	=> $this->allrows,
+														'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)
 										)),
 				'lang_name'		=> lang('Name'),
 			);
@@ -160,7 +170,7 @@
 			(
 				'lang_add'				=> lang('add'),
 				'lang_add_attribtext'	=> lang('add an attrib'),
-				'add_action'			=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.edit_attrib', 'appname'=> $appname, 'location'=> $location)),
+				'add_action'			=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.edit_attrib', 'appname'=> $appname, 'location'=> $location, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
 				'lang_done'				=> lang('done'),
 				'lang_done_attribtext'	=> lang('Return to admin'),
 				'done_action'			=> $GLOBALS['phpgw']->link('/admin/index.php'),
@@ -177,12 +187,13 @@
 
 			$link_data = array
 			(
-				'menuaction'	=> $this->currentapp.'.ui_custom.list_attribute',
+				'menuaction'	=> 'admin.ui_custom.list_attribute',
 				'sort'			=> $this->sort,
 				'order'			=> $this->order,
 				'query'			=> $this->query,
 				'appname'		=> $appname,
-				'location'		=> $location
+				'location'		=> $location,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			$data = array
@@ -215,7 +226,7 @@
 
 			$function_msg	= lang('list custom attribute');
 
-			$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->currentapp) . ' - ' .lang('attribute') . ': ' . $function_msg;
+			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ' - ' .lang('attribute') . ': ' . $function_msg;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
 			$this->save_sessiondata();
 		}
@@ -255,12 +266,21 @@
 				{
 					$receipt['error'][] = array('msg'=>lang('location not selected!'));
 				}
+				else
+				{
+					$location = $values['location'];
+				}
 
 				if (!$values['column_name'])
 				{
 					$receipt['error'][] = array('msg'=>lang('Column name not entered!'));
 				}
 
+				if(!preg_match('/^[a-z0-9_]+$/i',$values['column_name']))
+				{
+					$receipt['error'][] = array('msg'=>lang('Column name %1 contains illegal character', $values['column_name']));
+				}
+
 				if (!$values['input_text'])
 				{
 					$receipt['error'][] = array('msg'=>lang('Input text not entered!'));
@@ -305,7 +325,7 @@
 					{
 						$id=$receipt['id'];
 					}
-					$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'admin.ui_custom.edit_attrib', 'appname' => $values['appname'], 'location' => $values['location'], 'id' => $id));
+				//	$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'admin.ui_custom.edit_attrib', 'appname' => $values['appname'], 'location' => $values['location'], 'id' => $id, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']));
 
 				}
 				else
@@ -328,10 +348,11 @@
 
 			$link_data = array
 			(
-				'menuaction'	=> $this->currentapp.'.ui_custom.edit_attrib',
+				'menuaction'	=> 'admin.ui_custom.edit_attrib',
 				'appname'		=> $appname,
 				'location'		=> $values['location'],
-				'id'			=> $id
+				'id'			=> $id,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			$multiple_choice = '';
@@ -361,7 +382,7 @@
 
 				'msgbox_data'						=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
 				'form_action'						=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-				'done_action'						=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_attribute', 'appname'=> $appname, 'location'=>$location)),
+				'done_action'						=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.list_attribute', 'appname'=> $appname, 'location'=>$location, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
 				'lang_id'							=> lang('Attribute ID'),
 				'lang_entity_type'					=> lang('Entity type'),
 				'lang_no_entity_type'				=> lang('No entity type'),
@@ -426,7 +447,7 @@
 				'lang_location_statustext'			=> lang('Select submodule'),
 				'select_name_location'				=> 'values[location]',
 
-				'location_list'						=> $this->bolocation->select_location('select',(isset($values['location'])?$values['location']:''),False,True),
+				'location_list'						=> $this->bolocation->select_location('select', $location, false, true),
 
 				'value_disabled'					=> isset($values['disabled']) ? $values['disabled'] : '',
 				'lang_disabled'						=> lang('disabled'),
@@ -435,19 +456,22 @@
 				'value_helpmsg'						=> isset($values['helpmsg']) ? $values['helpmsg'] : '',
 				'lang_helpmsg'						=> lang('help message'),
 				'lang_helpmsg_statustext'			=> lang('Enables help message for this attribute'),
-				'value_location'					=> isset($values['location']) ? $values['location'] : ''
+				'value_location'					=> $location
 			);
 //_debug_array($values);
 
 			$appname	= lang('appname');
 
-			$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ' - ' . $appname . ': ' . $function_msg;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
 		}
 
 		function list_custom_function()
 		{
+			if($this->local_menu_selection)
+			{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::list_functions';
+			}
 
 			$appname	= $this->appname;
 			$location	= $this->location;
@@ -476,10 +500,42 @@
 						'descr'						=> $entry['descr'],
 						'sorting'					=> $entry['sorting'],
 						'active'					=> $entry['active']?'X':'',
-						'link_up'					=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_custom_function', 'resort'=> 'up', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-						'link_down'					=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_custom_function', 'resort'=> 'up', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-						'link_edit'					=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.edit_custom_function', 'appname'=> $appname, 'location'=> $location, 'id'=> $entry['id'])),
-						'link_delete'				=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.delete', 'appname'=> $appname, 'location'=> $location, 'custom_function_id'=> $entry['id'])),
+						'link_up'					=> $GLOBALS['phpgw']->link('/index.php',array
+														(
+															'menuaction'		=> 'admin.ui_custom.list_custom_function',
+															'resort'			=> 'up',
+															'appname'			=> $appname,
+															'location'			=> $location,
+															'id'				=> $entry['id'],
+															'allrows'			=> $this->allrows,
+															'menu_selection'	=> $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)),
+						'link_down'					=> $GLOBALS['phpgw']->link('/index.php',array
+														(
+															'menuaction'		=> 'admin.ui_custom.list_custom_function',
+															'resort'			=> 'down',
+															'appname'			=> $appname,
+															'location'			=> $location,
+															'id'				=> $entry['id'],
+															'allrows'			=> $this->allrows,
+															'menu_selection'	=> $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)),
+						'link_edit'					=> $GLOBALS['phpgw']->link('/index.php',array
+														(
+															'menuaction'		=> 'admin.ui_custom.edit_custom_function',
+															'appname'			=> $appname,
+															'location'			=> $location,
+															'id'				=> $entry['id'],
+															'menu_selection'	=> $GLOBALS['phpgw_info']['flags']['menu_selection']
+															)),
+						'link_delete'				=> $GLOBALS['phpgw']->link('/index.php',array
+														(
+															'menuaction'		=> 'admin.ui_custom.delete',
+															'appname'			=> $appname,
+															'location'			=> $location,
+															'custom_function_id'=> $entry['id'],
+															'menu_selection'	=> $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)),
 						'lang_up_text'				=> lang('shift up'),
 						'lang_down_text'			=> lang('shift down'),
 						'lang_edit_text'			=> lang('edit the custom_function'),
@@ -506,20 +562,24 @@
 											'sort'	=> $this->sort,
 											'var'	=> 'column_name',
 											'order'	=> $this->order,
-											'extra'	=> array('menuaction'	=> $this->currentapp.'.ui_custom.list_custom_function',
+											'extra'	=> array('menuaction'	=> 'admin.ui_custom.list_custom_function',
 														'appname'	=> $appname,
 														'location'	=> $location,
-														'allrows'	=> $this->allrows)
+														'allrows'	=> $this->allrows,
+														'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)
 										)),
 				'sort_sorting'		=> $this->nextmatchs->show_sort_order(array
 										(
 											'sort'	=> $this->sort,
 											'var'	=> 'custom_function_sort',
 											'order'	=> $this->order,
-											'extra'	=> array('menuaction'	=> $this->currentapp.'.ui_custom.list_custom_function',
+											'extra'	=> array('menuaction'	=> 'admin.ui_custom.list_custom_function',
 														'appname'	=> $appname,
 														'location'	=> $location,
-														'allrows'	=> $this->allrows)
+														'allrows'	=> $this->allrows,
+														'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
+														)
 										)),
 				'lang_name'			=> lang('Name'),
 			);
@@ -528,7 +588,7 @@
 			(
 				'lang_add'						=> lang('add'),
 				'lang_add_custom_functiontext'	=> lang('add a custom_function'),
-				'add_action'					=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.edit_custom_function', 'appname'=> $appname, 'location'=> $location)),
+				'add_action'					=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.edit_custom_function', 'appname'=> $appname, 'location'=> $location, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
 				'lang_done'						=> lang('done'),
 				'lang_done_custom_functiontext'	=> lang('Return to admin'),
 				'done_action'					=> $GLOBALS['phpgw']->link('/admin/index.php'),
@@ -545,12 +605,13 @@
 
 			$link_data = array
 			(
-				'menuaction'	=> $this->currentapp.'.ui_custom.list_custom_function',
+				'menuaction'	=> 'admin.ui_custom.list_custom_function',
 				'sort'			=> $this->sort,
 				'order'			=> $this->order,
 				'query'			=> $this->query,
 				'appname'		=> $appname,
-				'location'		=> $location
+				'location'		=> $location,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			$data = array
@@ -582,14 +643,14 @@
 
 			$function_msg	= lang('list custom function');
 
-			$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->currentapp) . ' - ' .lang('custom function') . ': ' . $function_msg;	
+			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ' - ' .lang('custom function') . ': ' . $function_msg;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_custom_function' => $data));
 			$this->save_sessiondata();
 		}
 
 		function edit_custom_function()
 		{
-			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::list_functions';
+	//		$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::list_functions';
 			$appname	= $this->appname;
 			$location	= $this->location;
 			$id			= phpgw::get_var('id', 'int');
@@ -658,10 +719,11 @@
 
 			$link_data = array
 			(
-				'menuaction'	=> $this->currentapp.'.ui_custom.edit_custom_function',
+				'menuaction'	=> 'admin.ui_custom.edit_custom_function',
 				'appname'		=> $appname,
 				'location'		=> $location,
-				'id'			=> $id
+				'id'			=> $id,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 
@@ -678,7 +740,7 @@
 
 				'msgbox_data'						=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
 				'form_action'						=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-				'done_action'						=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> $this->currentapp.'.ui_custom.list_custom_function', 'appname'=> $appname, 'location'=> $location)),
+				'done_action'						=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'admin.ui_custom.list_custom_function', 'appname'=> $appname, 'location'=> $location, 'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
 				'lang_id'							=> lang('Custom function ID'),
 				'lang_entity_type'					=> lang('Entity type'),
 				'lang_no_entity_type'				=> lang('No entity type'),
@@ -704,7 +766,7 @@
 			);
 
 
-			$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->currentapp) . ' - ' . lang('custom function') . ': ' . $function_msg;
+			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ' - ' . lang('custom function') . ': ' . $function_msg;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_custom_function' => $data));
 		}
 
@@ -714,46 +776,50 @@
 			$location				= phpgw::get_var('location');
 			$attrib_id				= phpgw::get_var('attrib_id', 'int');
 			$custom_function_id		= phpgw::get_var('custom_function_id', 'int');
-			$confirm				= phpgw::get_var('confirm', 'bool', 'POST');
 
-			if ( $attrib_id )
+			$function = 'list_attribute';
+			if ( $custom_function_id )
 			{
-				$function='list_attribute';
+				$function = 'list_custom_function';
 			}
-			else if($custom_function_id)
-			{
-				$function='list_custom_function';
-			}
 
-			$link_data = array
+			$redirect_args = array
 			(
-				'menuaction'	=> $this->currentapp.'.ui_custom.'.$function,
+				'menuaction'	=> "admin.ui_custom.{$function}",
 				'location'		=> $location,
 				'appname'		=> $appname,
-				'attrib_id'		=> $attrib_id
+				'attrib_id'		=> $attrib_id,
+				//FIXME this hack won't be merged upstream
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
-			$delete_data = array
+			if ( phpgw::get_var('confirm', 'bool', 'POST') )
+			{
+				$this->bo->delete($location, $appname, $attrib_id, $custom_function_id);
+				$GLOBALS['phpgw']->redirect_link('/index.php', $redirect_args);
+			}
+
+			if ( phpgw::get_var('cancel', 'bool', 'POST') )
+			{
+				$GLOBALS['phpgw']->redirect_link('/index.php', $redirect_args);
+			}
+
+			$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_delete'));
+
+			$link_data = array
 			(
-				'menuaction'			=> $this->currentapp.'.ui_custom.delete',
+				'menuaction'			=> 'admin.ui_custom.delete',
 				'location'				=> $location,
 				'appname'				=> $appname,
 				'attrib_id'				=> $attrib_id,
-				'custom_function_id' 	=> $custom_function_id
+				'custom_function_id' 	=> $custom_function_id,
+				//FIXME this hack won't be merged upstream
+				'menu_selection'		=> $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
-			if ( $confirm )
-			{
-				$this->bo->delete($location,$appname,$attrib_id,$custom_function_id);
-				$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
-			}
-
-			$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
 			$data = array
 			(
-				'done_action'				=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-				'delete_action'				=> $GLOBALS['phpgw']->link('/index.php',$delete_data),
+				'form_action'				=> $GLOBALS['phpgw']->link('/index.php', $link_data),
 				'lang_confirm_msg'			=> lang('do you really want to delete this entry'),
 				'lang_yes'					=> lang('yes'),
 				'lang_yes_standardtext'		=> lang('Delete the entry'),
@@ -764,8 +830,7 @@
 			$appname	= lang('Custom fields');
 			$function_msg	= lang('delete entity type');
 
-			$GLOBALS['phpgw_info']['flags']['app_header'] = lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ' - ' . $appname . ': ' . $function_msg;
 			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
 		}
 	}
-?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiaccess_history.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiaccess_history.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiaccess_history.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -11,46 +11,40 @@
 
 	/* $Id$ */
 
-	class uiaccess_history
+	class admin_uiaccess_history
 	{
-		var $template;
-		var $public_functions = array(
+		public $public_functions = array
+		(
 			'list_history' => True
 		);
 
-		function uiaccess_history()
+		public function list_history()
 		{
 			if ($GLOBALS['phpgw']->acl->check('access_log_access',1,'admin'))
 			{
 				$GLOBALS['phpgw']->redirect_link('/index.php');
 			}
 			
-			$this->bo         = createobject('admin.boaccess_history');
-			$this->nextmatchs = createobject('phpgwapi.nextmatchs');
-			$this->template   = $GLOBALS['phpgw']->template;
-			$this->template->set_file(
-				Array(
-					'accesslog' => 'accesslog.tpl'
-				)
-			);
-			$this->template->set_block('accesslog','list');
-			$this->template->set_block('accesslog','row');
-			$this->template->set_block('accesslog','row_empty');
-		}
-
-		public function list_history()
-		{
 			$bo         = createobject('admin.boaccess_history');
 			$nextmatches = createobject('phpgwapi.nextmatchs');
 
 			$account_id	= phpgw::get_var('account_id', 'int', 'REQUEST');
-			$start		= phpgw::get_var('start', 'int', 'POST', 0);
+			$start		= phpgw::get_var('start', 'int', 'GET', 0);
 			$sort		= phpgw::get_var('sort', 'int', 'POST', 0);
 			$order		= phpgw::get_var('order', 'int', 'POST', 0);
 			
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View access log');
+			$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin::access_log';
+
 			$GLOBALS['phpgw']->common->phpgw_header(true);
 
+			$t   =& $GLOBALS['phpgw']->template;
+			$t->set_root(PHPGW_APP_TPL);
+			$t->set_file('accesslog', 'accesslog.tpl');
+			$t->set_block('accesslog','list');
+			$t->set_block('accesslog','row');
+			$t->set_block('accesslog','row_empty');
+
 			$total_records = $bo->total($account_id);
 
 			$var = array
@@ -80,14 +74,14 @@
 				$var['lang_last_x_logins'] = lang('Last %1 logins',$total_records);
 			}
 
-			$this->template->set_var($var);
+			$t->set_var($var);
 
 			$records = $bo->list_history($account_id, $start, $order, $sort);
 			if ( is_array($records) )
 			{
 				foreach ( $records as &$record )
 				{
-					$nextmatches->template_alternate_row_class($this->template);
+					$nextmatches->template_alternate_row_class($t);
 
 					$var = array
 					(
@@ -97,16 +91,16 @@
 						'row_lo'      => $record['account_id'] ? $record['lo'] : '<b>' . lang($record['sessionid']) . '</b>',
 						'row_total'   => ($record['lo'] ? $record['total'] : '&nbsp;')
 					);
-					$this->template->set_var($var);
-					$this->template->fp('rows_access','row', true);
+					$t->set_var($var);
+					$t->fp('rows_access','row', true);
 				}
 			}
 
 			if (! $total_records && $account_id)
 			{
-				$nextmatches->template_alternate_row_class($this->template);
-				$this->template->set_var('row_message',lang('No login history exists for this user'));
-				$this->template->fp('rows_access','row_empty', true);
+				$nextmatches->template_alternate_row_class($t);
+				$t->set_var('row_message',lang('No login history exists for this user'));
+				$t->fp('rows_access','row_empty', true);
 			}
 
 			$loggedout = $bo->return_logged_out($account_id);
@@ -124,6 +118,7 @@
 			(
 				'footer_total' => lang('Total records') . ': ' . $total_records
 			);
+
 			if ($account_id)
 			{
 				$var['lang_percent'] = lang('Percent this user has logged out') . ': ' . $percent . '%';
@@ -134,10 +129,9 @@
 			}
 
 			// create the menu on the left, if needed
-			$menuClass = CreateObject('admin.uimenuclass');
-			$var['rows'] = $menuClass->createHTMLCode('view_account');
+			$var['rows'] = createObject('admin.uimenuclass')->createHTMLCode('view_account');
 
-			$this->template->set_var($var);
-			$this->template->pfp('out','list');
+			$t->set_var($var);
+			$t->pfp('out','list');
 		}
 	}

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiaccounts.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiaccounts.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiaccounts.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -5,7 +5,7 @@
 	* @author coreteam <[email protected]>
 	* @author Dave Hall <[email protected]>
 	* @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc. http://www.fsf.org/
-	* @license http://www.gnu.org/licenses/ GNU General Public License v3 or later
+	* @license http://www.gnu.org/licenses/ GNU General Public License v2 or later
 	* @package phpgroupware
 	* @subpackage admin
 	* @version $Id$
@@ -14,7 +14,7 @@
 	/*
 	   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 3 of the License, or
+	   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,
@@ -34,7 +34,7 @@
 	* @author coreteam <[email protected]>
 	* @author Dave Hall <[email protected]>
 	* @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc. http://www.fsf.org/
-	* @license http://www.gnu.org/licenses/ GNU General Public License v3 or later
+	* @license http://www.gnu.org/licenses/ GNU General Public License v2 or later
 	* @package phpgroupware
 	* @subpackage admin
 	* @category accounts
@@ -53,6 +53,7 @@
 			'edit_user'		=> true,
 			'edit_group'	=> true,
 			'view_user'		=> true,
+			'sync_accounts_contacts'	=> true
 		);
 
 		/**
@@ -114,7 +115,7 @@
 			$order = phpgw::get_var('order', 'string', 'GET', 'account_lid');
 			$sort = phpgw::get_var('sort', 'string', 'GET', 'ASC');
 			$total = 0;
-			$query = phpgw::get_var('query', 'string', 'POST');
+			$query = phpgw::get_var('query', 'string');
 			$GLOBALS['cd'] = phpgw::get_var('cd', 'int', 'GET');
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration')
 															. ': ' . lang('list groups');
@@ -135,7 +136,7 @@
 				'sort_name'				=> $this->_nextmatches->show_sort_order(array
 											(
 												'sort'	=> $sort,
-												'var'	=> 'account_lid',
+												'var'	=> 'lid',
 												'order'	=> $order,
 												'extra'	=> $link_data
 											)),
@@ -250,14 +251,20 @@
 			}
 
 			$query	= phpgw::get_var('query', 'string');
-			$start	= phpgw::get_var('start', 'int');
+			$start		= phpgw::get_var('start', 'int', 'GET', 0);
 			$order	= phpgw::get_var('order', 'string', 'GET', 'account_lid');
 			$sort	= phpgw::get_var('sort', 'string', 'GET', 'ASC');
+			$allrows	= phpgw::get_var('allrows', 'bool');
 
 			//this is a work around hack for the ugly nextmatch code
 			$GLOBALS['query'] = $query;
 
 			$total = 0;
+			if( $allrows )
+			{
+				$start = -1;
+				$total = -1;
+			}
 
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . lang('list users');
 
@@ -320,8 +327,8 @@
 
 			$status_data = array
 			(
-				'img_disabled'	=> $GLOBALS['phpgw']->common->image('phpgwapi', 'disabled', '.png'),
-				'img_enabled'	=> $GLOBALS['phpgw']->common->image('phpgwapi', 'enabled', '.png'),
+//				'img_disabled'	=> $GLOBALS['phpgw']->common->image('phpgwapi', 'disabled', '.png'),
+//				'img_enabled'	=> $GLOBALS['phpgw']->common->image('phpgwapi', 'enabled', '.png'),
 				'lang_disabled'	=> lang('disabled'),
 				'lang_enabled'	=> lang('enabled')
 			);
@@ -396,9 +403,10 @@
 					'lastname'					=> $account->lastname,
 
 					'status'					=> $account->enabled,
-					'status_img'				=> $account->enabled
+/*					'status_img'				=> $account->enabled
 													? $status_data['img_enabled']
 													: $status_data['img_disabled'],
+*/
 					'status_text'				=> $account->enabled
 													? $status_data['lang_enabled']
 													: $status_data['lang_disabled'],
@@ -427,10 +435,12 @@
 
 			$nm = array
 			(
-				'start'			=> $start,
+ 				'start'				=> $start == -1 ? 0 : $start,
  				'num_records'	=> count($account_info),
  				'all_records'	=> $total,
-				'link_data'		=> $link_data
+				'link_data'			=> $link_data,
+				'allow_all_rows'	=> true,
+				'allrows'			=> $allrows
 			);
 
 			$data = array
@@ -494,7 +504,7 @@
 				{
 					$GLOBALS['phpgw']->redirect_link('/index.php', array
 					(
-						'menuaction' => 'admin.uiaccounts.view_group',
+						'menuaction' => 'admin.uiaccounts.edit_group',
 						'account_id' => $account_id
 					));
 				}
@@ -561,7 +571,7 @@
 			$url_acl = $GLOBALS['phpgw']->link('/index.php', array
 			(
 				'menuaction'		=> 'preferences.uiadmin_acl.list_acl',
-				'acl_app'			=> '__APP__',
+				'acl_app'			=> '##APP##',
 				'cat_id'			=> 'groups',
 				'module'			=> '.'
 			));
@@ -569,7 +579,7 @@
 			$url_grant = $GLOBALS['phpgw']->link('/index.php', array
 			(
 				'menuaction'		=> 'preferences.uiadmin_acl.aclprefs',
-				'acl_app'			=> '__APP__',
+				'acl_app'			=> '##APP##',
 				'cat_id'			=> 'groups',
 				'module'			=> '.',
 				'granting_group'	=> $account_id
@@ -577,6 +587,7 @@
 
 			foreach ( $apps as $app )
 			{
+
 				if ($GLOBALS['phpgw_info']['apps'][$app]['enabled']
 						&& $GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
 				{
@@ -586,8 +597,8 @@
 					$grant_url = '';
 					if ( $grants_enabled )
 					{
-						$acl_url = preg_replace('/__APP__/', $app, $url_acl);
-						$grant_url = preg_replace('/__APP__/', $app, $url_acl);
+						$acl_url = preg_replace('/%23%23APP%23%23/', $app, $url_acl);
+						$grant_url = preg_replace('/%23%23APP%23%23/', $app, $url_grant);
 					}
 
 					$app_list[] = array
@@ -749,7 +760,7 @@
 				return;
 			}
 			$GLOBALS['phpgw']->redirect_link('/index.php',
-					array('menuaction' => 'admin.uiaccounts.view_user', 'account_id' => $account_id));
+					array('menuaction' => 'admin.uiaccounts.edit_user', 'account_id' => $account_id));
 		}
 
 		/**
@@ -785,7 +796,7 @@
 			if ( $account_id )
 			{
 				$user_data['anonymous'] = $acl->check('anonymous', 1, 'phpgwapi');
-				$user_data['changepassword'] = $acl->check('changepassword', 0xFFFF, 'preferences');
+				$user_data['changepassword'] = $acl->check('changepassword', 1, 'preferences');
 				$user_data['account_permissions'] = $this->_bo->load_apps($account_id);
 				$user_groups = $account->membership($account_id);
 
@@ -941,6 +952,7 @@
 			$tabs = array
 			(
 				'data'	=> array('label' => lang('user data'), 'link' => '#user'),
+				'groups'	=> array('label' => lang('groups'), 'link' => '#groups'),
 				'apps'	=> array('label' => lang('applications'), 'link' => '#apps')
 			);
 			phpgwapi_yui::tabview_setup('account_edit_tabview');
@@ -1064,8 +1076,8 @@
 			$perms = array_keys($apps->read_account_specific());
 			if ( is_array($available_apps) && count($available_apps) )
 			{
-				$img_disabled = $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_no', '.png', false);
-				$img_enabled = $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_yes', '.png', false);
+	//			$img_disabled = $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_no', '.png', false);
+	//			$img_enabled = $GLOBALS['phpgw']->common->image('phpgwapi', 'stock_yes', '.png', false);
 
 				sort($available_apps);
 				foreach ( $available_apps as $app )
@@ -1078,8 +1090,8 @@
 					$user_data['permissions'][] = array
 					(
 						'name'	=> lang($app['name']),
-						'img'	=> $enabled ? $img_enabled : $img_disabled,
-						'alt'	=> $enabled ? $lang_enabled : $lang_disabled
+				//		'img'	=> $enabled ? $img_enabled : $img_disabled,
+				//		'alt'	=> $enabled ? $lang_enabled : $lang_disabled
 					);
 				}
 			}
@@ -1182,6 +1194,11 @@
 					//TODO Make this nicer
 					echo 'Failed to delete user';
 				}
+				else
+				{
+					$GLOBALS['phpgw']->redirect_link('/index.php',
+						array('menuaction' => 'admin.uiaccounts.list_users'));
+				}
 			}
 			if( phpgw::get_var('cancel', 'bool') )
 			{
@@ -1204,7 +1221,6 @@
 				$accounts_list = $accounts->get_list('accounts');
 
 				$account_id = phpgw::get_var('account_id', 'int');
-				$new_owner = phpgw::get_var('new_owner', 'int');
 				foreach ( $accounts_list as $account )
 				{
 					if ( (int) $account->id != $account_id )
@@ -1256,4 +1272,17 @@
 
 			return "<a href=\"{$url}\">{$lang_action}</a>";
 		}
+
+		/**
+		* Generates contacts from users
+		*
+		* @return void
+		*/
+
+		function sync_accounts_contacts()
+		{
+			$GLOBALS['phpgw']->accounts->sync_accounts_contacts();
+			$GLOBALS['phpgw']->redirect_link('/admin/index.php');
+		}
+
 	}

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiaclmanager.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiaclmanager.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiaclmanager.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,23 +1,56 @@
 <?php
-	/**************************************************************************\
-	* phpGroupWare - Administration                                            *
-	* http://www.phpgroupware.org                                              *
-	* ------------------------------------------------------------------------ *
-	* Copyright 2001 - 2003 Free Software Foundation, Inc                      *
-	* This program is part of the GNU project, see http://www.gnu.org/         *
-	* ------------------------------------------------------------------------ *
-	* 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.                                               *
-	\**************************************************************************/
-	/* $Id$ */
+	/**
+	 * phpGroupWare - Administration - ACL manager logic
+	 *
+	 * @author Dave Hall <[email protected]>
+	 * @author Others <unknown>
+	 * @copyright Copyright (C) 2007-2008 Free Software Foundation, Inc. http://www.fsf.org/
+	 * @license http://www.fsf.org/licenses/gpl.html GNU General Public License
+	 * @package phpgroupware
+	 * @subpackage admin
+	 * @version $Id$
+	 */
 
-	class uiaclmanager
+	/*
+	   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, see <http://www.gnu.org/licenses/>.
+	 */
+
+	/*
+	 * phpGroupWare - Administration - ACL manager logic
+	 *
+	 * @package phpgroupware
+	 * @subpackage admin
+	 *
+	 * @internal FIXME this is shitty insecure code - someone needs to fix this
+	 */
+
+	class admin_uiaclmanager
 	{
-		var $template;
-		var $nextmatchs;
-		var $public_functions = array
+		/**
+		 * @var object $_template reference to global template object
+		 */
+		protected $_template;
+
+		/**
+		 *@var object $_boacl business logic
+		 */
+		protected $_boacl;
+
+		/**
+		 * @var array $public_functions publicly available methods class
+		 */
+		public $public_functions = array
 		(
 			'list_apps'				=> true,
 			'access_form'			=> true,
@@ -25,150 +58,192 @@
 			'list_addressmasters'	=> true,
 			'edit_addressmasters'	=> true,
 			'accounts_popup'		=> true,
-			'java_script'			=> true
 		);
 
+		/**
+		 * Constructor
+		 *
+		 * @return void
+		 */
 		public function __construct()
 		{
-			$this->account_id	= phpgw::get_var('account_id', 'int', 'GET', $GLOBALS['phpgw_info']['user']['account_id']);
+			$this->account_id = phpgw::get_var('account_id', 'int', 'GET',
+								$GLOBALS['phpgw_info']['user']['account_id']);
 
-			if (!$this->account_id || $GLOBALS['phpgw']->acl->check('account_access',64,'admin'))
+			if ( !$this->account_id
+				|| $GLOBALS['phpgw']->acl->check('account_access', 64, 'admin') )
 			{
 				$GLOBALS['phpgw']->redirect_link('/index.php');
 			}
-			$this->template		=& $GLOBALS['phpgw']->template;
-			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
-			$this->boacl		= CreateObject('admin.boaclmanager');
+
+			$this->_template	=& $GLOBALS['phpgw']->template;
+			$this->_boacl		= CreateObject('admin.boaclmanager');
 		}
 
-		function common_header()
+		/**
+		 * Prepare the common template header
+		 *
+		 * @return void
+		 */
+		protected function _common_header()
 		{
 			$GLOBALS['phpgw']->common->phpgw_header();
-			$this->template->set_root(PHPGW_APP_TPL);
+			$this->_template->set_root(PHPGW_APP_TPL);
 		}
 
-		function list_apps()
+		/**
+		 * This does something - ask ceb and jengo what - they wrote it
+		 *
+		 * @return void
+		 */
+		public function list_apps()
 		{
-			$this->common_header();
+			$this->_common_header();
 
-			$GLOBALS['phpgw']->hooks->process('acl_manager',array('preferences'));
+			$GLOBALS['phpgw']->hooks->process('acl_manager', array('preferences'));
 
-			$this->template->set_file(array(
-				'app_list'   => 'acl_applist.tpl'
-			));
-			$this->template->set_block('app_list','list');
-			$this->template->set_block('app_list','app_row');
-			$this->template->set_block('app_list','app_row_noicon');
-			$this->template->set_block('app_list','link_row');
-			$this->template->set_block('app_list','spacer_row');
+			$this->_template->set_file('app_list', 'acl_applist.tpl');
+			$this->_template->set_block('app_list', 'list');
+			$this->_template->set_block('app_list', 'app_row');
+			$this->_template->set_block('app_list', 'app_row_noicon');
+			$this->_template->set_block('app_list', 'link_row');
+			$this->_template->set_block('app_list', 'spacer_row');
 
-			$this->template->set_var('lang_header',lang('ACL Manager'));
+			$this->_template->set_var('lang_header', lang('ACL Manager'));
 
-			while (is_array($GLOBALS['acl_manager']) && list($app,$locations) = each($GLOBALS['acl_manager']))
+			while (is_array($GLOBALS['acl_manager']) && list($app, $locations) = each($GLOBALS['acl_manager']))
 			{
-				$icon = $GLOBALS['phpgw']->common->image($app,array('navbar.gif',$app.'.gif'));
-				$this->template->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
-				$this->template->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
-				$this->template->set_var('app_name',lang($GLOBALS['phpgw_info']['navbar'][$app]['title']));
-				$this->template->set_var('a_name',$appname);
-				$this->template->set_var('app_icon',$icon);
+				$icon = $GLOBALS['phpgw']->common->image($app, array('navbar.gif', $app.'.gif'));
+				$this->_template->set_var('icon_backcolor', $GLOBALS['phpgw_info']['theme']['row_off']);
+				$this->_template->set_var('link_backcolor', $GLOBALS['phpgw_info']['theme']['row_off']);
+				$this->_template->set_var('app_name', lang($GLOBALS['phpgw_info']['navbar'][$app]['title']));
+				$this->_template->set_var('a_name', $appname);
+				$this->_template->set_var('app_icon', $icon);
 
 				if ($icon)
 				{
-					$this->template->fp('rows','app_row',True);
+					$this->_template->fp('rows', 'app_row', true);
 				}
 				else
 				{
-					$this->template->fp('rows','app_row_noicon',True);
+					$this->_template->fp('rows', 'app_row_noicon', true);
 				}
 
-				while (is_array($locations) && list($loc,$value) = each($locations))
+				while (is_array($locations) && list($loc, $value) = each($locations))
 				{
 					$total_rights = 0;
-					while (list($k,$v) = each($value['rights']))
+					while (list($k, $v) = each($value['rights']))
 					{
 						$total_rights += $v;
 					}
 					reset($value['rights']);
 
 					// If all of there rights are denied, then they shouldn't even see the option
-					if ($total_rights != $GLOBALS['phpgw']->acl->get_rights($loc,$app))
+					if ($total_rights != $GLOBALS['phpgw']->acl->get_rights($loc, $app))
 					{
-						$link_values = array(
+						$link_values = array
+						(
 							'menuaction' => 'admin.uiaclmanager.access_form',
-							'location'   => urlencode(base64_encode($loc)),
+							'location'   => $loc,
 							'acl_app'    => $app,
 							'account_id' => $GLOBALS['account_id']
 						);
 
-						$this->template->set_var('link_location',$GLOBALS['phpgw']->link('/index.php',$link_values));
-						$this->template->set_var('lang_location',lang($value['name']));
-						$this->template->fp('rows','link_row',True);
+						$this->_template->set_var('link_location', $GLOBALS['phpgw']->link('/index.php', $link_values));
+						$this->_template->set_var('lang_location', lang($value['name']));
+						$this->_template->fp('rows', 'link_row', true);
 					}
 				}
 
-				$this->template->parse('rows','spacer_row',True);
+				$this->_template->parse('rows', 'spacer_row', true);
 			}
-			$this->template->pfp('out','list');
+			$this->_template->pfp('out', 'list');
 		}
 
-		function access_form()
+		/**
+		 * This does something - don't ask me what, but I suspect it involves rendering a form
+		 *
+		 * @return void
+		 */
+		public function access_form()
 		{
-			$GLOBALS['phpgw']->hooks->single('acl_manager',$GLOBALS['acl_app']);
-			$location = base64_decode($GLOBALS['location']);
+			$acl_app	= phpgw::get_var('acl_app');
+			$location	= phpgw::get_var('location');
+			$account_id	= phpgw::get_var('account_id', 'int');
+			$acl_man	= phpgw::get_var('acl_manager');
 
-			$acl_manager = $GLOBALS['acl_manager'][$GLOBALS['acl_app']][$location];
+			$acl_manager = $acl_man[$acl_app][$location];
 
-			$this->common_header();
-			$this->template->set_file('form','acl_manager_form.tpl');
+			$GLOBALS['phpgw']->hooks->single('acl_manager', $acl_app);
 
-			$acc = createobject('phpgwapi.accounts',$GLOBALS['account_id']);
-			$acc->read_repository();
-			$afn = $GLOBALS['phpgw']->common->display_fullname($acc->data['account_lid'],$acc->data['firstname'],$acc->data['lastname']);
 
-			$this->template->set_var('lang_message',lang('Check items to <b>%1</b> to %2 for %3',$acl_manager['name'],$GLOBALS['acl_app'],$afn));
-			$link_values = array(
-				'menuaction' => 'admin.boaclmanager.submit',
-				'acl_app'    => $GLOBALS['acl_app'],
-				'location'   => urlencode($GLOBALS['location']),
-				'account_id' => $GLOBALS['account_id']
+			$this->_common_header();
+			$this->_template->set_file('form', 'acl_manager_form.tpl');
+
+			$acc = createobject('phpgwapi.accounts', $account_id);
+			$afn = (string) $GLOBALS['phpgw']->accounts->get($account_id);
+
+			$msg = lang('Check items to <b>%1</b> to %2 for %3', $acl_manager['name'], $acl_app, $afn);
+			$this->_template->set_var('lang_message', $msg);
+			$link_values = array
+			(
+				'menuaction' => 'admin._boaclmanager.submit',
+				'acl_app'    => $acl_app,
+				'location'   => phpgw::get_var('location', 'string'),
+				'account_id' => $account_id
 			);
 
-			$acl    = createobject('phpgwapi.acl',$GLOBALS['account_id']);
-			$acl->read_repository();
+			$acl    = createobject('phpgwapi.acl', $account_id);
+			$acl->read();
 
-			$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php',$link_values));
-			$this->template->set_var('lang_title',lang('ACL Manager'));
+			$this->_template->set_var('form_action', $GLOBALS['phpgw']->link('/index.php', $link_values));
+			$this->_template->set_var('lang_title', lang('ACL Manager'));
 
-			$total = 0;
-			while (list($name,$value) = each($acl_manager['rights']))
+			$grants = $acl->get_rights($location, $acl_app);
+
+			$select = <<<HTML
+				<select name="acl_rights[]" multiple size="7">
+
+HTML;
+
+			foreach ( $acl_manager['rights'] as $name => $value )
 			{
-				$grants = $acl->get_rights($location,$GLOBALS['acl_app']);
+				if ( !$GLOBALS['phpgw']->acl->check($location, $value, $acl_app) )
+				{
+					$s = '';
+					$name = lang($name);
 
-				if (! $GLOBALS['phpgw']->acl->check($location,$value,$GLOBALS['acl_app']))
+					if ( $grants & $value )
 				{
-					$s .= '<option value="' . $value . '"';
-					$s .= (($grants & $value)?' selected="selected"':'');
-					$s .= '>' . lang($name) . '</option>';
-					$total++;
-				}
+						$s = ' selected';
 			}
 
-			$size = 7;
-			if ($total < 7)
-			{
-				$size = $total;
+					$select .= <<<HTML
+					<option value="{$value}{$s}">{$name}</option>
+
+HTML;
+				}
 			}
-			$this->template->set_var('select_values','<select name="acl_rights[]" multiple size="' . $size . '">' . $s . '</select>');
-			$this->template->set_var('lang_submit',lang('Submit'));
-			$this->template->set_var('lang_cancel',lang('Cancel'));
+			$select = <<<HTML
+				</select>
 
-			$this->template->pfp('out','form');
+HTML;
+
+			$this->_template->set_var('select_values', $select);
+			$this->_template->set_var('lang_submit', lang('submit'));
+			$this->_template->set_var('lang_cancel', lang('cancel'));
+
+			$this->_template->pfp('out', 'form');
 		}
 
-		function list_addressmasters()
+		/**
+		 * List current addressmasters
+		 *
+		 * @return void
+		 */
+		public function list_addressmasters()
 		{
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+			$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
 			$link_data = array
 			(
@@ -178,7 +253,7 @@
 
 			if ( phpgw::get_var('edit', 'bool', 'POST') )
 			{
-				$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+				$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
 			}
 
 			if ( phpgw::get_var('done', 'bool', 'POST') )
@@ -189,10 +264,9 @@
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ': ' . lang('list addressmasters');
 			$GLOBALS['phpgw']->xslttpl->add_file('addressmaster');
 
-			//XXX Caeies Jan09 : I put this here, since we don't realy need this acl before setting up the addessmaster
-			//XXX Anyway, I still think this is broken design. This should be done at setup for this application.
-			try {
-				if($GLOBALS['phpgw']->locations->get_id('addressbook', 'addressmaster') == False)
+			try
+			{
+				if($GLOBALS['phpgw']->locations->get_id('addressbook', 'addressmaster') == 0)
 				{
 					$GLOBALS['phpgw']->locations->add('addressmaster', 'Address Master', 'addressbook');
 				}
@@ -201,7 +275,8 @@
 			{
 				$GLOBALS['phpgw']->locations->add('addressmaster', 'Address Master', 'addressbook');
 			}
-			$admins = $this->boacl->list_addressmasters();
+
+			$admins = $this->_boacl->list_addressmasters();
 			
 			//_debug_array($admins);
 			//exit;
@@ -222,7 +297,7 @@
 							'lastname'	=> $admin['lastname']
 						);
 					}
-					elseif ($admin['lastname'] == 'Group')
+					else if ($admin['lastname'] == 'Group')
 					{
 						$groups[] = array
 						(
@@ -251,23 +326,28 @@
 				'addressmaster_group'	=> $groups,
 				'lang_edit'				=> lang('edit'),
 				'lang_done'				=> lang('done'),
-				'action_url'			=> $GLOBALS['phpgw']->link('/index.php',$link_data) 
+				'action_url'			=> $GLOBALS['phpgw']->link('/index.php', $link_data)
 			);
-			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('addressmaster_list' => $data));
+			$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('addressmaster_list' => $data));
 		}
 
-		function accounts_popup()
+		/**
+		 * Render the accounts popup widget
+		 *
+		 * @return string html snippet
+		 */
+		public function accounts_popup()
 		{
-			return $GLOBALS['phpgw']->accounts->accounts_popup('admin_acl');
+			return $GLOBALS['phpgw']->accounts_popup->render('admin_acl');
 		}
 
-		function java_script()
+		/**
+		 * Render for for editting addressmasters
+		 *
+		 * @return void
+		 */
+		public function edit_addressmasters()
 		{
-			//return $GLOBALS['phpgw']->accounts->java_script('admin_acl');
-		}
-
-		function edit_addressmasters()
-		{
 			$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
 			$link_data = array
@@ -278,24 +358,24 @@
 
 			if ( phpgw::get_var('save', 'bool', 'POST') ) 
 			{
-				$account_addressmaster = phpgw::get_var('account_addressmaster', 'int', 'POST', array());
+				$account_addressmaster = phpgw::get_var('account_addressmaster', 'string', 'POST', array());
 				$group_addressmaster = phpgw::get_var('group_addressmaster', 'int', 'POST', array());
 
-				$error = $this->boacl->check_values($account_addressmaster, $group_addressmaster);
-				if(is_array($error))
+				$error = array();//$this->_boacl->check_values($account_addressmaster, $group_addressmaster);
+				if ( count($error) )
 				{
 					$error_message = $GLOBALS['phpgw']->common->error_list($error);
 				}
 				else
 				{
-					$this->boacl->edit_addressmasters($account_addressmaster, $group_addressmaster);
-					$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+					$this->_boacl->edit_addressmasters($account_addressmaster, $group_addressmaster);
+					$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
 				}
 			}
 
 			if ( phpgw::get_var('cancel', 'bool', 'POST') )
 			{
-				$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+				$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
 			}
 
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('admin') . ': ' . lang('edit addressmaster list');
@@ -304,22 +384,23 @@
 			$popwin_user = array();
 			$select_user = array();
 			if ( isset($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'])
-				&& $GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'] == 'popup')
+				&& $GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'] == 'popup_xxxx') // FIXME 'popup is broken'
 			{
-				$usel = $this->boacl->list_addressmasters();
+				$usel = $this->_boacl->list_addressmasters();
 				foreach ( $usel as $acc )
 				{
 					$user_list[] = array
 					(
 						'account_id'	=> $acc['account_id'],
 						'select_value'	=> 'yes',
-						'fullname'		=> $GLOBALS['phpgw']->common->display_fullname($acc['lid'],$acc['firstname'],$acc['lastname'])
+						'fullname'		=> (string) $GLOBALS['phpgw']->accounts->get($acc['lid'])
 					);
 				}
 
 				$popwin_user = array
 				(
-					'url'				=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaclmanager.accounts_popup'), true),
+					'url'				=> $GLOBALS['phpgw']->link('/index.php',
+											array('menuaction' => 'admin.uiaclmanager.accounts_popup'), true),
 					'width'				=> '800',
 					'height'			=> '600',
 					'lang_open_popup'	=> lang('open popup window'),
@@ -328,12 +409,21 @@
 			}
 			else
 			{
-				$app_user = $GLOBALS['phpgw']->acl->get_ids_for_location('run',1,'addressbook');
+				$app_user = (array) $GLOBALS['phpgw']->acl->get_ids_for_location('run', 1, 'addressbook');
 
+				$add_users = array
+				(
+					'users'		=> array(),
+					'groups'	=> array()
+				);
+
+				if ( is_array($app_user) )
+				{
 				$add_users = $GLOBALS['phpgw']->accounts->return_members($app_user);
+				}
 				$add_users['groups'] = $GLOBALS['phpgw']->accounts->get_list('groups');
 
-				$usel = $this->boacl->get_addressmaster_ids();
+				$usel = $this->_boacl->get_addressmaster_ids();
 
 				//_debug_array($usel);
 				foreach ( $add_users['users'] as $user )
@@ -387,11 +477,10 @@
 				'lang_select_addressmasters'	=> lang('Select addressmasters'),
 				'lang_save'						=> lang('save'),
 				'lang_cancel'					=> lang('cancel'),
-				'action_url'					=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+				'action_url'					=> $GLOBALS['phpgw']->link('/index.php', $link_data),
 				'popwin_user'					=> $popwin_user,
 				'select_user'					=> $select_user
 			);
-			$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('addressmaster_edit' => $data));
+			$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('addressmaster_edit' => $data));
 		}
 	}
-?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiapplications.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiapplications.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiapplications.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -11,9 +11,9 @@
 
   /* $Id$ */
 
-	class uiapplications
+	class admin_uiapplications
 	{
-		var $public_functions = array
+		public $public_functions = array
 		(
 			'get_list'	=> true,
 			'add'		=> true,
@@ -28,11 +28,11 @@
 		public function __construct()
 		{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin';
-			$this->bo =& CreateObject('admin.boapplications');
-			$this->nextmatchs =& CreateObject('phpgwapi.nextmatchs');
+			$this->bo = createObject('admin.boapplications');
+			$this->nextmatchs = createObject('phpgwapi.nextmatchs', false);
 		}
 
-		function get_list()
+		public function get_list()
 		{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::apps';
 			$GLOBALS['phpgw']->common->phpgw_header(true);
@@ -65,11 +65,11 @@
 			{
 				$limit = $start + $offset;
 			}
-			elseif ($start && !$offset)
+			else if ($start && !$offset)
 			{
 				$limit = $start;
 			}
-			elseif(!$start && !$offset)
+			else if(!$start && !$offset)
 			{
 				$limit = $total;
 			}
@@ -86,9 +86,10 @@
 
 			$i = 0;
 			$applications = array();
-			while(list($app,$data) = @each($apps))
+			foreach ( $apps as $app => $data )
 			{
-				if($i >= $start && $i<= $limit)
+				if ( $i >= $start
+					&& $i<= $limit )
 				{
 					$applications[$app] = $data;
 				}
@@ -136,15 +137,15 @@
 
 				if ($app['status']==1)
 				{
-					$status = lang('Yes');
+					$status = lang('yes');
 				}
 				else if ($app['status']==2)
 				{
-					$status = lang('Hidden');
+					$status = lang('hidden');
 				}
 				else
 				{
-					$status = '<b>' . lang('No') . '</b>';
+					$status = '<b>' . lang('no') . '</b>';
 				}
 				$GLOBALS['phpgw']->template->set_var('status',$status);
 
@@ -166,6 +167,7 @@
 		{
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::apps';
 
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl'));
 			$GLOBALS['phpgw']->template->set_block('application','form','form');
 			$GLOBALS['phpgw']->template->set_block('application','row','row');
@@ -252,6 +254,7 @@
 
 			$app_name = phpgw::get_var('app_name', 'string', 'GET');
 
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl'));
 			$GLOBALS['phpgw']->template->set_block('application','form','form');
 			$GLOBALS['phpgw']->template->set_block('application','row','row');
@@ -339,6 +342,7 @@
 				$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'admin.uiapplications.get_list') );
 			}
 
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('body' => 'delete_common.tpl'));
 
 			if ( phpgw::get_var('confirm', 'bool') )
@@ -376,4 +380,3 @@
 HTML;
 		}
 	}
-?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiasyncservice.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiasyncservice.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiasyncservice.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -22,28 +22,30 @@
 
 	/* $Id$ */
 
-	class uiasyncservice
+	class admin_uiasyncservice
 	{
-		var $public_functions = array(
-			'index' => True,
-		);
-		function uiasyncservice()
+		public $public_functions = array('index' => True);
+
+		public function __construct()
 		{
-			if (!is_object($GLOBALS['phpgw']->asyncservice))
+			if ( !isset($GLOBALS['phpgw']->asyncservice)
+				|| !is_object($GLOBALS['phpgw']->asyncservice) )
 			{
 				$GLOBALS['phpgw']->asyncservice = CreateObject('phpgwapi.asyncservice');
 			}
 		}
 
-		function index()
+		public function index()
 		{
 			if ($GLOBALS['phpgw']->acl->check('asyncservice_access',1,'admin'))
 			{
 				$GLOBALS['phpgw']->redirect_link('/index.php');
 			}
+
+			$GLOBALS['phpgw_info']['flags']['current_selection'] = 'admin::admin::async';
+
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Asynchronous timed services');
-			$GLOBALS['phpgw']->common->phpgw_header();
-			echo parse_navbar();
+			$GLOBALS['phpgw']->common->phpgw_header(true);
 
 			$async = clone($GLOBALS['phpgw']->asyncservice);	// use an own instance, as we might set debug=True
 
@@ -83,7 +85,7 @@
 				if ( $test )
 				{
 					$prefs = $GLOBALS['phpgw']->preferences->create_email_preferences();
-					if (!$async->set_timer($times,'test','admin.uiasyncservice.test',$prefs['email']['address']))
+					if (!$async->set_timer($times,'test','admin.uiasyncservice.test',array('to' => $prefs['email']['address'])))
 					{
 						echo '<p><b>'.lang("Error setting timer, wrong syntax or maybe there's one already running !!!")."</b></p>\n";
 					}
@@ -102,7 +104,30 @@
 					{
 						echo '<p><b>'.lang('Error: %1 not found or other error !!!',$async->crontab)."</b></p>\n";
 					}
+					else
+					{
+						$asyncservice = 'cron';
+					}
 				}
+
+				if ( $asyncservice )
+				{
+					if (!isset($GLOBALS['phpgw_info']['server']['asyncservice'])
+						|| $asyncservice != $GLOBALS['phpgw_info']['server']['asyncservice'] )
+					{
+						$config = CreateObject('phpgwapi.config','phpgwapi');
+						$config->read();
+						$config->value('asyncservice', $asyncservice);
+						$config->save_repository();
+						unset($config);
+						$GLOBALS['phpgw_info']['server']['asyncservice'] = $asyncservice;
+					}
+
+					if(($asyncservice == 'off' || $asyncservice == 'fallback') && !$install)
+					{
+						$async->uninstall();
+					}
+				}
 			}
 			else
 			{
@@ -115,16 +140,6 @@
 			$lr_date = $last_run['end'] ? $GLOBALS['phpgw']->common->show_date($last_run['end']) : lang('never');
 			echo '<p><b>'.lang('Async services last executed').'</b>: '.$lr_date.' ('.$last_run['run_by'].")</p>\n<hr>\n";
 
-			if ( !isset($GLOBALS['phpgw_info']['server']['asyncservice'])
-				|| $asyncservice != $GLOBALS['phpgw_info']['server']['asyncservice'] )
-			{
-				$config = CreateObject('phpgwapi.config','phpgwapi');
-				$config->read_repository();
-				$config->value('asyncservice', $asyncservice);
-				$config->save_repository();
-				unset($config);
-				$GLOBALS['phpgw_info']['server']['asyncservice'] = $asyncservice;
-			}
 			if (!$async->only_fallback)
 			{
 				$installed = $async->installed();
@@ -133,7 +148,7 @@
 					$async_use['cron'] = lang('crontab only (recomended)');
 				}
 			}
-			$async_use['']    = lang('fallback (after each pageview)');
+			$async_use['fallback']    = lang('fallback (after each pageview)');
 			$async_use['off'] = lang('disabled (not recomended)');
 			echo '<p><b>'.lang('Run Asynchronous services').'</b>'.
 				' <select name="asyncservice" onChange="this.form.submit();">';
@@ -212,13 +227,15 @@
 			
 		}
 		
-		private function test($to)
+		public function test($data)
 		{
+			$to = $data['to'];
+			$from = $GLOBALS['phpgw']->preferences->values['email'];
 			if (!is_object($GLOBALS['phpgw']->send))
 			{
 				$GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
 			}
-			$returncode = $GLOBALS['phpgw']->send->msg('email',$to,$subject='Asynchronous timed services','Greatings from cron ;-)');
+			$returncode = $GLOBALS['phpgw']->send->msg('email', $to, $subject='Asynchronous timed services', 'Greatings from cron ;-)', '', '', '', $from);
 
 			if (!$returncode)	// not nice, but better than failing silently
 			{

Modified: people/sigurdne/modules/admin/trunk/inc/class.uicategories.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uicategories.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uicategories.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -12,7 +12,7 @@
 	/* $Id$ */
 	/* $Source$ */
 
-	class uicategories
+	class admin_uicategories
 	{
 		var $bo;
 		var $nextmatchs;
@@ -37,8 +37,12 @@
 			$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
 
 			$appname = phpgw::get_var('appname', 'string', 'REQUEST', 'admin');
-			$GLOBALS['phpgw_info']['flags']['menu_selection'] = "admin::$appname::categories";
 
+			if(!$GLOBALS['phpgw_info']['flags']['menu_selection'] = phpgw::get_var('menu_selection'))
+			{
+				$GLOBALS['phpgw_info']['flags']['menu_selection'] = "admin::{$appname}::categories";
+			}
+
 			$this->bo			= CreateObject('admin.bocategories');
 			$this->nextmatchs	= CreateObject('phpgwapi.nextmatchs');
 
@@ -91,12 +95,14 @@
 			(
 				'menuaction'  => 'admin.uicategories.index',
 				'appname'     => $appname,
-				'global_cats' => $global_cats
+				'global_cats' => $global_cats,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			if ( phpgw::get_var('add', 'bool') )
 			{
 				$link_data['menuaction'] = 'admin.uicategories.edit';
+				$link_data['menu_selection'] = $GLOBALS['phpgw_info']['flags']['menu_selection'];
 				$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
 			}
 
@@ -128,7 +134,8 @@
 											'sort'	=> $this->sort,
 											'var'	=> 'cat_name',
 											'order'	=> $this->order,
-											'extra'	=> $link_data
+											'extra'	=> $link_data,
+											'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 										)),
 				'lang_add_sub'			=> lang('add sub'),
 				'lang_name'				=> lang('name'),
@@ -141,7 +148,8 @@
 												'sort'	=> $this->sort,
 												'var'	=> 'cat_description',
 												'order'	=> $this->order,
-												'extra'	=> $link_data
+												'extra'	=> $link_data,
+												'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 											))
 			);
 
@@ -188,6 +196,7 @@
 				{
 					$link_data['cat_id']		= $cat['id'];
 					$link_data['menuaction']	= 'admin.uicategories.edit';
+					$link_data['menu_selection'] = $GLOBALS['phpgw_info']['flags']['menu_selection'];
 					$edit_url			= $GLOBALS['phpgw']->link('/index.php',$link_data);
 					$lang_edit			= lang('edit');
 
@@ -205,6 +214,7 @@
 
 				$link_data['menuaction'] = 'admin.uicategories.edit';
 				$link_data['parent'] = $cat['id'];
+				$link_data['menu_selection'] = $GLOBALS['phpgw_info']['flags']['menu_selection'];
 				unset($link_data['cat_id']);
 				$add_sub_url = $GLOBALS['phpgw']->link('/index.php',$link_data);
 
@@ -264,7 +274,7 @@
 		{
 			$appname		= phpgw::get_var('appname');
 			$global_cats	= phpgw::get_var('global_cats');
-			$parent			= phpgw::get_var('parent', 'int', 'GET');
+			$parent			= phpgw::get_var('parent', 'int', 'GET', 0);
 			$values			= phpgw::get_var('values', 'string', 'POST');
 
 			$message = '';
@@ -272,7 +282,8 @@
 			(
 				'menuaction'  => 'admin.uicategories.index',
 				'appname'     => $appname,
-				'global_cats' => $global_cats
+				'global_cats' => $global_cats,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			if ( isset($values['cancel']) && $values['cancel'] )
@@ -316,7 +327,7 @@
 					'id'			=> 0,
 					'name'			=> '',
 					'description'	=> '',
-					'parent'		=> 0
+					'parent'		=> $parent
 				));
 			}
 			$parent = $cats[0]['parent'];
@@ -382,7 +393,8 @@
 			(
 				'menuaction'  => 'admin.uicategories.index',
 				'appname'     => $appname,
-				'global_cats' => $global_cats
+				'global_cats' => $global_cats,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
 			);
 
 			if ( phpgw::get_var('cancel', 'bool') || !$this->cat_id )
@@ -390,7 +402,7 @@
 				$GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
 			}
 
-			if ( phpgw::get_var('confirm', bool) )
+			if ( phpgw::get_var('confirm', 'bool') )
 			{
 				$subs = phpgw::get_var('subs');
 				if ( $subs )
@@ -418,7 +430,7 @@
 				}
 			}
 
-			$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+			$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_delete'));
 
 			$GLOBALS['phpgw_info']['flags']['app_header'] = ( $appname ? lang($appname) . ' ' : '' ) . lang('global categories') . ': ' . lang('delete category');
 
@@ -465,13 +477,19 @@
 				}
 			}
 
-			$link_data['menuaction']	= 'admin.uicategories.delete';
-			$link_data['cat_id']		= $this->cat_id;
+			$link_data = array
+			(
+				'menuaction'	=> 'admin.uicategories.delete',
+				'cat_id'		=> $this->cat_id,
+				'appname'     => $appname,
+				'global_cats' => $global_cats,
+				'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection']
+			);
+			$link_data['menu_selection'] = $GLOBALS['phpgw_info']['flags']['menu_selection'];
 
 			$data = array
 			(
-				'delete_action'			=> $GLOBALS['phpgw']->link('/index.php', $link_data),
-				'done_action'			=> $GLOBALS['phpgw']->link('/index.php', $link_data),
+				'form_action'			=> $GLOBALS['phpgw']->link('/index.php', $link_data),
 				'show_done'				=> $show_done,
 				'msgbox_data'			=> $msgbox_error,
 				'lang_delete'			=> lang('delete'),

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiconfig.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiconfig.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiconfig.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -12,9 +12,9 @@
 
   /* $Id$ */
 
-	class uiconfig
+	class admin_uiconfig
 	{
-		var $public_functions = array('index' => True);
+		public $public_functions = array('index' => True);
 
 		function index()
 		{
@@ -172,10 +172,14 @@
 				'title'			=> lang('Site Configuration'),
 			));
 
+	//		$t->unknown_regexp = 'loose';
 			$vars = $t->get_undefined('body');
+	//		$t->unknown_regexp = '';
 
 			$GLOBALS['phpgw']->hooks->single('config',$appname);
 
+			if(is_array($vars))
+			{
 			foreach ( $vars as $value )
 			{
 				$valarray = explode('_', $value);
@@ -191,7 +195,7 @@
 				switch($type)
 				{
 					case 'lang':
-						$t->set_var($value,lang($newval));
+							$t->set_var($value,$GLOBALS['phpgw']->translation->translate($newval, array(),false, $appname));
 						break;
 					case 'value':
 						$newval = ereg_replace(' ','_',$newval);
@@ -255,6 +259,7 @@
 						break;
 				}
 			}
+			}
 			$GLOBALS['phpgw']->common->phpgw_header(true);
 			$t->pfp('out','config');
 		}

Modified: people/sigurdne/modules/admin/trunk/inc/class.uicurrentsessions.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uicurrentsessions.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uicurrentsessions.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -12,38 +12,45 @@
 
 	/* $Id$ */
 
-	class uicurrentsessions
+	class admin_uicurrentsessions
 	{
-		var $template;
-		var $bo;
-		var $public_functions = array(
-			'list_sessions' => True,
-			'kill'          => True
+		private $template;
+
+		private $bo;
+
+		public $public_functions = array
+		(
+			'list_sessions' => true,
+			'kill'          => true
 		);
 
-		function uicurrentsessions()
+		public function __construct()
 		{
-			$this->template   = createobject('phpgwapi.Template',PHPGW_APP_TPL);
 			$this->bo         = createobject('admin.bocurrentsessions');
-			$this->nextmatchs = createobject('phpgwapi.nextmatchs');
 		}
 
-		function header()
+		private function header()
 		{
 			$GLOBALS['phpgw']->common->phpgw_header(true);
+
+			$this->template =& $GLOBALS['phpgw']->template;
+			$this->template->set_root(PHPGW_APP_TPL);
 		}
 
-		function store_location($info)
+		private function store_location($info)
 		{
 			$GLOBALS['phpgw']->session->appsession('currentsessions_session_data','admin',$info);
 		}
 
-		function list_sessions()
+		public function list_sessions()
 		{
+			$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin::sessions';
+
 			$info = $GLOBALS['phpgw']->session->appsession('currentsessions_session_data','admin');
 			if (! is_array($info))
 			{
-				$info = array(
+				$info = array
+				(
 					'start' => 0,
 					'sort'  => 'asc',
 					'order' => 'session_dla'
@@ -51,114 +58,85 @@
 				$this->store_location($info);
 			}
 
-			if ((isset($_GET['start']) && $_GET['start']) || ( isset($_GET['sort']) && $_GET['sort']) || ( isset($_GET['order']) && $_GET['order']))
+			$vars = array
+			(
+				'start'	=> 'int',
+				'sort'	=> 'string',
+				'order'	=> 'string'
+			);
+			foreach ( $vars as $var => $type )
 			{
-				if ($_GET['start'] == 0 || $_GET['start'] && $_GET['start'] != $info['start'])
+				$val = phpgw::get_var($var, $type, 'GET');
+				if ( $val )
 				{
-					$info['start'] = $_GET['start'];
+					$info[$var] = $val;
 				}
-
-				if ($_GET['sort'] && $_GET['sort'] != $info['sort'])
-				{
-					$info['sort'] = $_GET['sort'];
 				}
 
-				if ($_GET['order'] && $_GET['order'] != $info['order'])
-				{
-					$info['order'] = $_GET['order'];
-				}
-
 				$this->store_location($info);
-			}
 
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('List of current users');
-			$this->header();
 
-			$this->template->set_file('current','currentusers.tpl');
-			$this->template->set_block('current','list','list');
-			$this->template->set_block('current','row','row');
-
-			if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',4,'admin'))
+			$can_kill = false;
+			$lang_kill = '';
+			if ( !$GLOBALS['phpgw']->acl->check('current_sessions_access', phpgwapi_acl::DELETE, 'admin') )
 			{
-				$can_view_ip = True;
+				$can_kill = true;
+				$lang_kill = lang('kill');
 			}
 
-			if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',2,'admin'))
-			{
-				$can_view_action = True;
-			}
-
 			$total = $this->bo->total();
-
 			$nextmatchs = createobject('phpgwapi.nextmatchs');
 
-			$this->template->set_var('left_next_matchs',$nextmatchs->left('/admin/currentusers.php',$info['start'],$total));
-			$this->template->set_var('right_next_matchs',$nextmatchs->right('/admin/currentusers.php',$info['start'],$total));
+			$header = array
+			(
+				'left_next_matchs'	=> $nextmatchs->left('/admin/currentusers.php', $info['start'], $total),
+				'right_next_matchs' => $nextmatchs->right('/admin/currentusers.php',$info['start'],$total), 
+				'sort_loginid'		=> $nextmatchs->show_sort_order($info['sort'], 'lid', $info['order'], '/admin/currentusers.php', lang('LoginID')),
+				'sort_ip'			=> $nextmatchs->show_sort_order($info['sort'], 'ip', $info['order'], '/admin/currentusers.php',lang('IP')),
+				'sort_login_time'	=> $nextmatchs->show_sort_order($info['sort'], 'logints', $info['order'], '/admin/currentusers.php', lang('Login Time')),
+				'sort_action'		=> $nextmatchs->show_sort_order($info['sort'], 'action', $info['order'], '/admin/currentusers.php', lang('Action')),
+				'sort_idle'			=> $nextmatchs->show_sort_order($info['sort'], 'dla', $info['order'], '/admin/currentusers.php', lang('idle')),
+				'lang_kill'			=> $lang_kill
+			);
 
-			$this->template->set_var('sort_loginid',$nextmatchs->show_sort_order($info['sort'],'session_lid',$info['order'],
-				'/admin/currentusers.php',lang('LoginID')));
-			$this->template->set_var('sort_ip',$nextmatchs->show_sort_order($info['sort'],'session_ip',$info['order'],
-				'/admin/currentusers.php',lang('IP')));
-			$this->template->set_var('sort_login_time',$nextmatchs->show_sort_order($info['sort'],'session_logintime',$info['order'],
-				'/admin/currentusers.php',lang('Login Time')));
-			$this->template->set_var('sort_action',$nextmatchs->show_sort_order($info['sort'],'session_action',$info['order'],
-				'/admin/currentusers.php',lang('Action')));
-			$this->template->set_var('sort_idle',$nextmatchs->show_sort_order($info['sort'],'session_dla',$info['order'],
-				'/admin/currentusers.php',lang('idle')));
-			$this->template->set_var('lang_kill',lang('Kill'));
+			$this->header();
+			$this->template->set_file('current', 'currentusers.tpl');
+			$this->template->set_block('current', 'rows', 'row');
+			$this->template->set_block('current', 'list', 'list');
 
-			$values = $this->bo->list_sessions($info['start'],$info['order'],$info['sort']);
+			$this->template->set_var($header);
 
-			while (list(,$value) = @each($values))
-			{
-				$nextmatchs->template_alternate_row_class($this->template);
+			$tr_class = '';
 
-				$this->template->set_var('row_loginid',$value['session_lid']);
-
-				if ($can_view_ip)
+			$values = $this->bo->list_sessions($info['start'], $info['order'] ,$info['sort']);
+			foreach ( $values as $value )
 				{
-					$this->template->set_var('row_ip',$value['session_ip']);
-				}
-				else
-				{
-					$this->template->set_var('row_ip','&nbsp; -- &nbsp;');
-				}
+				$tr_class = $nextmatchs->alternate_row_class($tr_class);
+				$value['tr_class'] = $tr_class;
+				$value['kill'] = '&nbsp;';
 
-				$this->template->set_var('row_logintime',$value['session_logintime']);
-				$this->template->set_var('row_idle',$value['session_idle']);
-
-				if ($value['session_action'] && $can_view_action)
+				if ( $can_kill && $value['id'] != $GLOBALS['phpgw_info']['user']['sessionid'] )
 				{
-					$this->template->set_var('row_action',$GLOBALS['phpgw']->strip_html($value['session_action']));
+					$kill_url = $GLOBALS['phpgw']->link('/index.php', array
+					(
+						'menuaction'	=> 'admin.uicurrentsessions.kill',
+						'ksession'		=> $value['id'],
+						'kill'			=> 'true'
+					));
+					$value['kill'] = "<a href=\"{$kill_url}\">{$lang_kill}</a>";
 				}
-				elseif(! $can_view_action)
-				{
-					$this->template->set_var('row_action','&nbsp; -- &nbsp;');
-				}
-				else
-				{
-					$this->template->set_var('row_action','&nbsp;');
-				}
 
-				if ($value['session_id'] != $GLOBALS['phpgw_info']['user']['sessionid'] && ! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
-				{
-					$this->template->set_var('row_kill','<a href="' . $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.uicurrentsessions.kill',
-						'ksession'=> $value['session_id'], 'kill'=>'true')) . '">' . lang('Kill').'</a>');
-				}
-				else
-				{
-					$this->template->set_var('row_kill','&nbsp;');
-				}
-
-				$this->template->parse('rows','row',True);
+				$this->template->set_var($value);
+				$this->template->parse('row', 'rows', true);
 			}
 
-			$this->template->pfp('out','list');
+			$this->template->pfp('out', 'list');
 		}
 
 		public function kill()
 		{
-			if ($GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
+			if ($GLOBALS['phpgw']->acl->check('current_sessions_access', phpgwapi_acl::DELETE, 'admin'))
 			{
 				$this->list_sessions();
 				return False;

Modified: people/sigurdne/modules/admin/trunk/inc/class.uilog.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uilog.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uilog.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -11,49 +11,36 @@
 
 	/* $Id$ */
 
-	class uilog
+	class admin_uilog
 	{
-		var $template;
-		var $public_functions = array
+		public $public_functions = array
 		(
 			'list_log'	=> true,
 			'purge_log'	=> true
 		);
 
-		function uilog()
+		public function __construct()
 		{
 			if ($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
 			{
 				$GLOBALS['phpgw']->redirect_link('/index.php');
 			}
 			
-			$this->bo         = createobject('admin.bolog');
-			$this->nextmatchs = createobject('phpgwapi.nextmatchs');
-			$this->template   =& $GLOBALS['phpgw']->template;
-
+			$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin::error_log';
 		}
 
-		function list_log()
+		public function list_log()
 		{
 			if ($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
 			{
-				$GLOBALS['phpgw']->redirect_link('/index.php');
+				$GLOBALS['phpgw']->redirect_link('/admin/index.php');
 			}
 			
 			$account_id		= phpgw::get_var('account_id', 'int');
-			$start			= phpgw::get_var('start', 'int', 'POST', 0);
-			$sort			= phpgw::get_var('sort', 'int', 'POST',0);
-			$order			= phpgw::get_var('order', 'int', 'POST',0);
-			
-			$this->template->set_file(array
-			(
-				'errorlog'		=> 'errorlog_view.tpl',
-				'form_button'	=> 'form_button_script.tpl'
-			));
+			$start			= phpgw::get_var('start', 'int', 'POST');
+			$sort			= phpgw::get_var('sort', 'int', 'POST');
+			$order			= phpgw::get_var('order', 'int', 'POST');
 
-			$this->template->set_block('errorlog','list');
-			$this->template->set_block('errorlog','row');
-			$this->template->set_block('errorlog','row_empty');
 			
 			$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View error log');
 			if ( $account_id )
@@ -66,6 +53,19 @@
 			$bo = createObject('admin.bolog');
 			$nextmatches = createObject('phpgwapi.nextmatchs');
 
+			$t   =& $GLOBALS['phpgw']->template;
+			$t->set_root(PHPGW_APP_TPL);
+
+			$t->set_file(array
+			(
+				'errorlog'		=> 'errorlog_view.tpl',
+				'form_button'	=> 'form_button_script.tpl'
+			));
+
+			$t->set_block('errorlog','list');
+			$t->set_block('errorlog','row');
+			$t->set_block('errorlog','row_empty');
+	
 			$total_records = $bo->total($account_id);
 
 			$var = array
@@ -83,26 +83,25 @@
 				'lang_total'       => lang('Total')
 			);
 
-			$this->template->set_var($var);
+			$t->set_var($var);
 
-			$records = $bo->list_log($account_id,$start,$order,$sort);
+			$records = $bo->list_log($account_id, $start, $order, $sort);
 			if ( !is_array($records) || !count($records) )
 			{
-				$this->template->set_var(array
+				$t->set_var(array
 				(
 					'row_message'	=> lang('No error log records exist for this user'),
 					'tr_class'		=> 'row_on'
 				));
-				$this->template->fp('rows_access','row_empty',True);
+				$t->fp('rows_access', 'row_empty', true);
 			}
 			else
 			{
 				$tr_class = '';
 				foreach ( $records as $record )
 				{
-
 					$tr_class = $nextmatches->alternate_row_class($tr_class);
-					$this->template->set_var(array
+					$t->set_var(array
 					(
 						'row_date' 		=> $record['log_date'],
 						'row_loginid'   => $record['log_account_lid'],
@@ -110,10 +109,10 @@
 						'row_severity'  => $record['log_severity'],
 						'row_file'      => $record['log_file'],
 						'row_line'      => $record['log_line'],
-						'row_message'   => nl2br(htmlspecialchars($record['log_msg'])),
+						'row_message'   => $record['log_msg'],
 						'tr_class'		=> $tr_class
 					));
-					$this->template->fp('rows_access','row',True);
+					$t->parse('rows_access', 'row', true);
 				}
 			}
 
@@ -121,17 +120,19 @@
 			{
 				if ( $account_id ) 
 				{
-					$var = Array(
+					$var = array
+					(
 						'submit_button' => lang('Submit'),
 						'action_url_button'     => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uilog.purge_log', 'account_id' => $account_id)),
-						'action_text_button'    => ' '.lang('Delete all log records for ').$GLOBALS['phpgw']->common->grab_owner_name($account_id),
+						'action_text_button'    => ' '.lang('Delete all log records for %1', $GLOBALS['phpgw']->common->grab_owner_name($account_id)),
 						'action_confirm_button' => '',
 						'action_extra_field'    => ''
 					);
 				}
 				else 
 				{
-					$var = Array(
+					$var = array
+					(
 						'submit_button' => lang('Submit'),
 						'action_url_button'     => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uilog.purge_log') ),
 						'action_text_button'    => ' '.lang('Delete all log records'),
@@ -139,14 +140,16 @@
 						'action_extra_field'    => ''
 					);
 				}
-				$this->template->set_var($var);
-				$var['purge_log_button'] = $this->template->fp('button', 'form_button', True);
-				$this->template->set_var($var);
+				$t->set_var($var);
+				$var['purge_log_button'] = $t->fp('button', 'form_button', true);
+
+				$t->set_var($var);
 			}
 
 			if ( $account_id ) 
 			{
-				$var = array('footer_total' => lang('Total records for %1 : %2', $GLOBALS['phpgw']->common->grab_owner_name($account_id), $total_records) );
+				$account_name = $GLOBALS['phpgw']->common->grab_owner_name($account_id);
+				$var = array('footer_total' => lang('Total records for %1 : %2', $account_name, $total_records) );
 			}
 			else
 			{
@@ -154,11 +157,10 @@
 			}
 
 			// create the menu on the left, if needed
-			$menuClass = CreateObject('admin.uimenuclass');
-			$var['rows'] = $menuClass->createHTMLCode('view_account');
+			//$var['rows'] = createObject('admin.uimenuclass')->createHTMLCode('view_account');
 
-			$this->template->set_var($var);
-			$this->template->pfp('out','list');
+			//$t->set_var($var);
+			$t->pfp('out', 'list');
 		}
 		
 		public function purge_log()

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiloglevels.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiloglevels.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiloglevels.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -11,15 +11,16 @@
 
 	/* $Id$ */
 
-	class uiloglevels
+	class admin_uiloglevels
 	{
-		var $template;
-		var $select_template;
-		var $public_functions = array(
+		private $template;
+		private $select_template;
+		public $public_functions = array
+		(
 			'edit_log_levels' => True
 		);
 
-		function uiloglevels()
+		public function __construct()
 		{
 			
 			if ($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
@@ -103,13 +104,14 @@
 			$apps_with_logging = $GLOBALS['phpgw_info']['server']['log_levels']['module'];
 			$sorted_apps = array();
 			$app_add_list = array();
-			foreach ($GLOBALS['phpgw_info']['apps'] as $app => $app_data)
+			foreach ( $GLOBALS['phpgw_info']['apps'] as $app => $app_data )
 			{
 				$sorted_apps[$app] = $app_data['title']; 
 			}	
 			
+			asort($sorted_apps);
+			
 			$add_options = '';
-			asort($sorted_apps);
 			$tr_class = 'row_on';
 		    foreach ( $sorted_apps as $app => $title) 
 		    {
@@ -136,7 +138,7 @@
 		    	}
 		    	else 
 		    	{
-					$add_options = $add_options . '<option value="' . $app . '">' . $title . '</option>';
+					$add_options .= "<option value=\"{$app}\">{$title}</option>\n";
 		    	}
 		    }	
 				
@@ -167,21 +169,24 @@
 			$add_options = '';
 			$tr_class = 'row_on';
 			$accounts = $GLOBALS['phpgw']->accounts->get_list('accounts');
-			foreach($accounts as $account)
+			foreach ( $accounts as $account )
 			{
 				$account_lid = $account->lid;
+				$name = (string) $account;
 		    	if ( isset($GLOBALS['phpgw_info']['server']['log_levels']['user'][$account_lid]) ) 
 		    	{
 					$var = array
 					(
 						'tr_class' 		=> $tr_class,
-						'module_name'   => $account_lid,
+						'module_name'   => (string) $account,
 						'module_option' => $this->create_select_box('user', $account_lid, $GLOBALS['phpgw_info']['server']['log_levels']['user'][$account_lid]),
 						'remove_url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiloglevels.edit_log_levels', 'level_type' => 'user', 'level_key' => $account_lid) ),
 						'lang_remove'   => lang('remove')
 					);
+
 					$this->template->set_var($var);
-					$this->template->fp('user_list','module',True);
+					$this->template->fp('user_list', 'module', true);
+
 					if ($tr_class == 'row_on')
 					{
 						$tr_class = 'row_off';
@@ -193,7 +198,7 @@
 		    	}
 		    	else 
 		    	{
-					$add_options .= '<option value="' . $account_lid . '">' . $account_lid . '</option>';
+					$add_options .= "<option value=\"{$account_lid}\">{$name}</option>\n";
 		    	}
 		    }	
 				
@@ -233,12 +238,14 @@
 				'lang_info'		=> lang('info'),
 				'lang_notice'	=> lang('notice'),
 				'lang_debug'	=> lang('debug'),
+				'lang_strict'	=> 'strict',
 				'F_selected'	=> '',
 				'E_selected'	=> '',
 				'N_selected'	=> '',
 				'W_selected'	=> '',
 				'I_selected'	=> '',
-				'D_selected'	=> ''
+				'D_selected'	=> '',
+				'S_selected'	=> ''
 			);
 			
 			if ( $current_level ) 

Modified: people/sigurdne/modules/admin/trunk/inc/class.uimainscreen.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uimainscreen.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uimainscreen.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,64 +1,96 @@
 <?php
-	/**************************************************************************\
-	* phpGroupWare - Administration                                            *
-	* http://www.phpgroupware.org                                              *
-	* Written by coreteam <[email protected]>                    *
-	* --------------------------------------------                             *
-	*  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.                                              *
-	\**************************************************************************/
-	/* $Id$ */
+	/**
+	 * phpGroupWare Administration Misc Page Renderers
+	 *
+	 * @author Dave Hall <[email protected]>
+	 * @author coreteam <[email protected]>
+	 * @author Various Others <unknown>
+	 * @copyright Copyright (C) 2003-2008 Free Software Foundation, Inc. http://www.fsf.org/
+	 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+	 * @package phpgroupware
+	 * @subpackage phpgwapi
+	 * @category gui
+	 * @version $Id$
+	 */
 
-	class uimainscreen
+	/*
+	   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, see <http://www.gnu.org/licenses/>.
+	 */
+
+	/**
+	 *  Miscellaneous Admin Pages renderer 
+	 *
+	 * @author Dave Hall <[email protected]>
+	 * @author coreteam <[email protected]>
+	 * @author Various Others <unknown>
+	 * @copyright Copyright (C) 2003-2008 Free Software Foundation, Inc. http://www.fsf.org/
+	 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+	 * @package phpgroupware
+	 * @subpackage phpgwapi
+	 */
+	class admin_uimainscreen
 	{
-		var $public_functions = array
+		/**
+		 * @var array $public_functions the publicly callable methods
+		 */
+		public $public_functions = array
 		(
-			'index'		=> True,
-			'mainscreen'	=> True
+			'index'			=> true,
+			'mainscreen'	=> true
 		);
 
+		/**
+		 * Constucttor
+		 */
 		public function __construct()
 		{
 			$menuaction = phpgw::get_var('menuaction', 'location');
-			$GLOBALS['phpgw_info']['flags']['xslt_app'] = false; //$menuaction == 'admin.uimainscreen.mainscreen';
+			$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
 			$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin';
 		}
 
-		public function mainscreen()
+		/**
+		 * Render the admin menu
+		 *
+		 * @return void
+		 */
+		function mainscreen()
 		{
-			$menu = execMethod('phpgwapi.menu.get', 'admin');
-			// this is any ugly hack cos the XSLT template engine sucks
-			$html = '';
-			foreach ( $menu as $module => $entries )
-			{
-				$html .= <<<HTML
-				<h2>$module</h2>
-				<ul>
+			$menu		= createObject('phpgwapi.menu');
+			$navbar		= $menu->get('navbar');
+			$navigation = $menu->get('admin');
 
-HTML;
-				$i = 0;
-				foreach ( $entries as $entry )
+			$treemenu = '';
+			foreach ( $GLOBALS['phpgw_info']['user']['apps'] as $app => $app_info )
+		{
+				if(!in_array($app, array('logout', 'about', 'preferences')) && isset($navbar[$app]))
 				{
-					$row = $i % 2 ? 'on' : 'off';
-					$html .= <<<HTML
-					<li class="row_{$row}"><a href="{$entry['url']}">{$entry['text']}</a></li>
-HTML;
-					++$i;
+					$treemenu .= $menu->render_menu($app, $navigation[$app], $navbar[$app], true);
 				}
-				$html .= <<<HTML
-				</ul>
-HTML;
 			}
 			$GLOBALS['phpgw']->common->phpgw_header(true);
-			echo $html;
+			echo $treemenu;
 		}
 
+		/**
+		 * Render the welcome screen editor
+		 *
+		 * @return void
+		 */
 		public function index()
 		{
-			$message = '';
 			if ( phpgw::get_var('cancel', 'bool', 'POST') )
 			{
 				$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'admin.uimainscreen.mainscreen'));
@@ -66,6 +98,7 @@
 
 			$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::admin::mainscreen';
 
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('message' => 'mainscreen_message.tpl'));
 			$GLOBALS['phpgw']->template->set_block('message','form','form');
 			$GLOBALS['phpgw']->template->set_block('message','row','row');
@@ -112,7 +145,7 @@
 				$GLOBALS['phpgw']->template->set_var('value',$select_lang);
 				$GLOBALS['phpgw']->template->fp('rows','row',True);
 
-				$tr_class = 'row_on'; 
+				$tr_class = $GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_class);
 				$GLOBALS['phpgw']->template->set_var('tr_class',$tr_class);
 				$select_section = '<select name="section"><option value="mainscreen">' . lang('Main screen')
 					. '</option><option value="loginscreen">' . lang("Login screen") . '</option>'

Modified: people/sigurdne/modules/admin/trunk/inc/class.uimenuclass.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uimenuclass.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uimenuclass.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -2,7 +2,6 @@
   /**************************************************************************\
   * phpGroupWare - Administration                                            *
   * http://www.phpgroupware.org                                              *
-  * edited by jason king                                                     *
   * --------------------------------------------                             *
   *  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   *
@@ -12,44 +11,77 @@
  
   /* $Id$ */
 
-	class admin_uimenuclass
+	class uimenuclass
 	{
-		/**
-		 * @var object $t reference to the global template object
-		 */
-		protected $t;
+		var $t;
+		var $rowColor = Array();
 
-		/**
-		 * @var object $nextmatchs paging object
-		 */
-		protected $nextmatchs;
-
-		/**
-		 * Constructor
-		 *
-		 * @return void
-		 */
-		public function __construct()
+		function uimenuclass()
 		{
-			$this->t =& $GLOBALS['phpgw']->template;
-			$this->t->set_root(PHPGW_APP_TPL);
+			$this->t = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('admin'));
 
-			$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
-
 			$this->t->set_file(array('menurow' => 'menurow.tpl'));
 			$this->t->set_block('menurow','menu_links','menu_links');
 			$this->t->set_block('menurow','link_row','link_row');
+
+			$this->rowColor[0] = $GLOBALS['phpgw_info']['theme']['row_on'];
+			$this->rowColor[1] = $GLOBALS['phpgw_info']['theme']['row_off'];
 		}
 
-		/**
-		 * Create the html markup for the menu
-		 *
-		 * @param string $hookname the name of the hook to call to get the items
-		 *
-		 * @return string the menu
-		 */
-		public function createHTMLCode($_hookname)
+		function section_item($pref_link='',$pref_text='', $bgcolor)
 		{
+			$this->t->set_var('row_link',$pref_link);
+			$this->t->set_var('row_text',$pref_text);
+			$this->t->set_var('tr_color',$bgcolor);
+			$this->t->parse('all_rows','link_row',True);
+		}
+
+		// $file must be in the following format:
+		// $file = array(
+		//  'Login History' => array('/index.php','menuaction=admin.uiaccess_history.list')
+		// );
+		// This allows extra data to be sent along
+		function display_section($_menuData)
+		{
+			$i=0;
+
+			while(list($key,$value) = each($_menuData))
+			{
+				if (!empty($value['extradata']))
+				{
+					$link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . $GLOBALS['account_id'] . '&' . $value['extradata']);
+				}
+				else
+				{
+					$link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . $GLOBALS['account_id']);
+				}
+				$this->section_item($link,lang($value['description']),$this->rowColor[($i % 2)]);
+				$i++;
+			}
+
+			$this->t->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+
+			if(strpos($_menuData[0]['extradata'],'user'))
+			{
+				$destination = 'users';
+			}
+			else
+			{
+				$destination = 'groups';
+			}
+			$this->t->set_var('link_done',$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.list_').$destination));
+			$this->t->set_var('lang_done',lang('Back'));
+
+			$this->t->set_var('row_on',$this->rowColor[0]);
+
+			$this->t->parse('out','menu_links');
+			
+			return $this->t->get('out','menu_links');
+		}
+
+		// create the html code for the menu
+		function createHTMLCode($_hookname)
+		{
 			switch ($_hookname)
 			{
 				case 'edit_user':
@@ -84,84 +116,19 @@
 
 			$GLOBALS['phpgw']->hooks->process($_hookname);
 
-			if ( isset($GLOBALS['menuData']) && count($GLOBALS['menuData']) >= 1) 
+			if (count($GLOBALS['menuData']) >= 1) 
 			{
 				$result = $this->display_section($GLOBALS['menuData']);
 				//clear $menuData
-				unset($GLOBALS['menuData']);
+				$GLOBALS['menuData'] = '';
 				return $result;
 			}
-
-			// clear $menuData
-			unset($GLOBALS['menuData']);
-			return '';
-		}
-
-		/**
-		 * Display an item in the menu
-		 *
-		 * @param string $pref_link the url for the item
-		 * @param string $pref_text the text for the item
-		 * @param string $row_class the css class to apply to the table cell
-		 *
-		 * @return void
-		 *
-		 * @todo TODO this current generates a table row, we should switch to list items <li>s
-		 */
-		protected function section_item($pref_link, $pref_text, $row_class)
-		{
-			$this->t->set_var(array
-			(
-				'row_link'	=> $pref_link,
-				'row_text'	=> $pref_text,
-				'tr_class'	=> $row_class
-			));
-
-			$this->t->parse('all_rows','link_row',True);
-		}
-
-		/**
-		 * Generate the menu itesms
-		 *
-		 * @param array $_menuData the data for the menu
-		 *
-		 * @return string the rendered menu items
-		 */
-		protected function display_section($_menuData)
-		{
-			$tr_class = 'row_on';
-			foreach($_menuData as $key => $value) 
-			{
-				if (!empty($value['extradata']))
-				{
-					$link = $GLOBALS['phpgw']->link( $value['url'],
-									array( 'account_id' => $GLOBALS['account_id'].'&'.$value['extradata'])
-									);
-				}
 				else
 				{
-					$link = $GLOBALS['phpgw']->link($value['url'],array('account_id' => $GLOBALS['account_id']));
-				}
-
-				$tr_class = $this->nextmatchs->alternate_row_class($tr_class);
-				$this->section_item($link, lang($value['description']), $tr_class);
+				// clear $menuData
+				$GLOBALS['menuData'] = '';
+				return '';
 			}
-
-			$dest = 'users';
-			if ( strpos($_menuData[0]['extradata'],'user') !== false)
-			{
-				$dest = 'groups';
-			}
-
-			$link_done = $GLOBALS['phpgw']->link('/index.php', 
-				array('menuaction' => "admin.uiaccounts.list_{$dest}"));
-
-			$this->t->set_var('link_done', $link_done);
-			$this->t->set_var('lang_done', lang('Back'));
-
-			$this->t->parse('out', 'menu_links');
-			
-			return $this->t->get('out', 'menu_links');
 		}
 	}
-
+?>

Modified: people/sigurdne/modules/admin/trunk/inc/class.uiserver.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/class.uiserver.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/class.uiserver.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -13,15 +13,14 @@
 
 	class uiserver
 	{
-		var $public_functions = array();
-		/* as it doesn't work lets disable it for now - skwashd
+		var $public_functions = array(
 			'list_servers' => True,
 			'edit'         => True,
 			'add'          => True,
 			'delete'       => True
 		);
-		*/
 
+
 		var $start = 0;
 		var $limit = 0;
 		var $query = '';
@@ -96,8 +95,8 @@
 
 		function list_servers()
 		{
-			$GLOBALS['phpgw']->common->phpgw_header();
-
+			$GLOBALS['phpgw']->common->phpgw_header(true);
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('server_list_t' => 'listservers.tpl'));
 			$GLOBALS['phpgw']->template->set_block('server_list_t','server_list','list');
 
@@ -150,7 +149,7 @@
 
 			while(list($key,$server) = @each($servers))
 			{
-				$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+				$tr_color = $this->nextmatchs->alternate_row_class($tr_color);
 				$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
 				$server_id = $server['server_id'];
 
@@ -178,6 +177,8 @@
 		{
 			$is = CreateObject('phpgwapi.interserver');
 
+			$GLOBALS['phpgw']->common->phpgw_header(true);
+			$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 			$GLOBALS['phpgw']->template->set_file(array('form' => 'server_form.tpl'));
 			$GLOBALS['phpgw']->template->set_block('form','add','addhandle');
 			$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
@@ -297,8 +298,9 @@
 			}
 			else
 			{
-				$GLOBALS['phpgw']->common->phpgw_header();
+				$GLOBALS['phpgw']->common->phpgw_header(true);
 
+				$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 				$GLOBALS['phpgw']->template->set_file(array('server_delete' => 'delete_common.tpl'));
 
 				$nolink = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiserver.list_servers'));

Modified: people/sigurdne/modules/admin/trunk/inc/hook_add_def_pref.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/hook_add_def_pref.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/hook_add_def_pref.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,8 +1,10 @@
 <?php
-  $GLOBALS['pref']->add('common','maxmatchs','15');
-  $GLOBALS['pref']->add('common','theme','default');
-  $GLOBALS['pref']->add('common','tz_offset',0);
-  $GLOBALS['pref']->add('common','dateformat','m/d/Y');
-  $GLOBALS['pref']->add('common','timeformat',12);
-  $GLOBALS['pref']->add('common','lang','en');
+
+// 	Better to get these values from default settings
+//  $GLOBALS['pref']->add('common','maxmatchs','10');
+//  $GLOBALS['pref']->add('common','theme','default');
+//  $GLOBALS['pref']->add('common','tz_offset',0);
+//  $GLOBALS['pref']->add('common','dateformat','m/d/Y');
+//  $GLOBALS['pref']->add('common','timeformat',12);
+//  $GLOBALS['pref']->add('common','lang','en');
 ?>

Modified: people/sigurdne/modules/admin/trunk/inc/hook_after_navbar.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/hook_after_navbar.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/hook_after_navbar.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -14,22 +14,34 @@
 
 	/* Check currentapp and API upgrade status */
 
-	if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
-		$GLOBALS['phpgw_info']['flags']['currentapp'] != 'welcome' &&
-		(isset($GLOBALS['phpgw_info']['server']['checkappversions']) &&
-		$GLOBALS['phpgw_info']['server']['checkappversions']))
+	if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home'
+		&& $GLOBALS['phpgw_info']['flags']['currentapp'] != 'welcome'
+		&& $GLOBALS['phpgw_info']['flags']['currentapp'] != 'about'
+//		&& (isset($GLOBALS['phpgw_info']['server']['checkappversions']) &&	$GLOBALS['phpgw_info']['server']['checkappversions'])
+		)
 	{
 		if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) &&
 			$GLOBALS['phpgw_info']['user']['apps']['admin']) ||
 			$GLOBALS['phpgw_info']['server']['checkappversions'] == 'All')
 		{
+			$require_upgrade = false;
 			$_current = array();
 			$app_name = $GLOBALS['phpgw_info']['flags']['currentapp'];
 			$GLOBALS['phpgw']->db->query("SELECT app_name,app_version FROM phpgw_applications WHERE app_name='$app_name' OR app_name='phpgwapi'",__LINE__,__FILE__);
+			$app_info = array();
 			while($GLOBALS['phpgw']->db->next_record())
 			{
-				$_db_version  = $GLOBALS['phpgw']->db->f('app_version');
-				$app_name     = $GLOBALS['phpgw']->db->f('app_name');
+				$app_info[] = array
+				(
+					'db_version'	=> $GLOBALS['phpgw']->db->f('app_version'),
+					'app_name'		=> $GLOBALS['phpgw']->db->f('app_name')
+				); 
+			}
+			
+			foreach($app_info as $app)
+			{
+				$_db_version  = $app['db_version'];
+				$app_name	  = $app['app_name'];
 				$_versionfile = $GLOBALS['phpgw']->common->get_app_dir($app_name) . '/setup/setup.inc.php';
 				if(file_exists($_versionfile))
 				{
@@ -46,14 +58,15 @@
 						$_current[$app_name] = True;
 						if($app_name == 'phpgwapi')
 						{
-							$api_str = '<br>' . lang('The API is current');
+							$api_str = lang('The API is current');
 						}
 					}
 					else
 					{
 						if($app_name == 'phpgwapi')
 						{
-							$api_str = '<br>' . lang('The API requires an upgrade');
+							$api_str = lang('The API requires an upgrade');
+							$require_upgrade = true;
 						}
 					}
 					unset($test);
@@ -63,20 +76,37 @@
 				unset($_db_version);
 				unset($_versionfile);
 			}
-			if(!@isset($_current[$GLOBALS['phpgw_info']['flags']['currentapp']]))
+			if(!isset($_current[$GLOBALS['phpgw_info']['flags']['currentapp']]))
 			{
-				echo '<center>';
-				echo $api_str;
-				echo '<br>' . lang('This application requires an upgrade') . ':' . "\n";
-				echo '<br>' . lang('Please run setup to become current') . '.' . "\n";
-				echo '</center>';
+				$app_str  = '<br>' . lang('This application requires an upgrade') . ':' . "\n";
+				$app_str .= '<br>' . lang('Please run setup to become current') . '.' . "\n";
+				$require_upgrade = true;
 			}
 			else
 			{
-				echo '<center>';
+				$app_str  =  '<br>' . lang('This application is current') . "\n";
+			}
+		
+			if($require_upgrade)
+			{
+				echo '<div class="error">';
 				echo $api_str;
-				echo '<br>' . lang('This application is current') . "\n";
-				echo '</center>';
+				echo $app_str;
+				echo '</div>';
 			}
 		}
+			}
+	
+	if( phpgw::get_var('phpgw_return_as') != 'json' && $receipt = phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+	{
+		phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+		$msgbox_data = $GLOBALS['phpgw']->common->msgbox_data($receipt);
+		$msgbox_data = $GLOBALS['phpgw']->common->msgbox($msgbox_data);
+		foreach($msgbox_data as & $message)
+		{
+			echo "<div class='{$message['msgbox_class']}'>";
+//			echo "<img src='{$message['msgbox_img']}' alt='{$message['msgbox_img_alt']}' title='{$message['msgbox_img_alt']}'/>";
+			echo $message['msgbox_text'];
+			echo '</div>';
+		}
 	}

Modified: people/sigurdne/modules/admin/trunk/inc/hook_config.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/hook_config.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/hook_config.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -18,14 +18,14 @@
 	*/
 	function encryptalgo($config)
 	{
-		if ( function_exists('mcrypt_list_algorithms') )
+		if(@function_exists('mcrypt_list_algorithms'))
 		{
 			$listed = array();
 			if(!isset($config['mcrypt_algo']))
 			{
 				$config['mcrypt_algo'] = 'tripledes';  /* MCRYPT_TRIPLEDES */
 			}
-			$algos = mcrypt_list_algorithms();
+			$algos = @mcrypt_list_algorithms();
 			$found = False;
 
 			while (list ($key, $value) = each ($algos))
@@ -63,14 +63,14 @@
 
 	function encryptmode($config)
 	{
-		if ( function_exists('mcrypt_list_modes') )
+		if(@function_exists('mcrypt_list_modes'))
 		{
 			$listed = array();
 			if(!isset($config['mcrypt_mode']))
 			{
 				$config['mcrypt_mode'] = 'cbc'; /* MCRYPT_MODE_CBC */
 			}
-			$modes = mcrypt_list_modes();
+			$modes = @mcrypt_list_modes();
 			$found = False;
 
 			while (list ($key, $value) = each ($modes))
@@ -105,3 +105,4 @@
 		}
 		return $out;
 	}
+?>

Modified: people/sigurdne/modules/admin/trunk/inc/hook_deleteaccount.inc.php
===================================================================
--- people/sigurdne/modules/admin/trunk/inc/hook_deleteaccount.inc.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/inc/hook_deleteaccount.inc.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -30,8 +30,4 @@
 			$account_lid = $data['account_lid'];
 			$GLOBALS['phpgw']->mapping->delete_mapping(array('account_lid' => $account_lid));
 		}											
-		
-		$GLOBALS['phpgw']->accounts->delete($account_id);
-		//XXX Caeies Jan09: No needs to delete acls, since it's already done in the accounts->delete call
 	}
-?>

Added: people/sigurdne/modules/admin/trunk/navbar-sel.php
===================================================================
--- people/sigurdne/modules/admin/trunk/navbar-sel.php	                        (rev 0)
+++ people/sigurdne/modules/admin/trunk/navbar-sel.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -0,0 +1,74 @@
+<?php
+//
+// SourceForge Knowledge Base Module v.1.0.0
+// 
+// Created by Patrick Walsh ([email protected]) 6/00
+// Copyright (c) ... aw, hell, copy all the code you want
+//
+// $Id$
+
+/*
+	This code was adapted from Rasmus Lerdorf's article on PHPBuilder
+	http://www.phpbuilder.com/columns/rasmus19990124.php3
+*/
+
+function openGif($filename) {
+
+	if (!$filename) { $filename = "navbar.gif"; }
+        $im = @imagecreatefromgif($filename);
+	if ($im == "") { /* test for success of file creation */
+		$im = imagecreate(300,15); /* Create a blank image */
+		$bgc = imagecolorallocate($im, 255, 255, 255);
+		$tc = imagecolorallocate($im, 0, 0, 0);
+		imagefilledrectangle($im, 0, 0, 300, 15, $bgc);
+		imagestring($im,1,2,2,"Error loading $filename", $tc);
+	}
+	return $im;
+}
+
+function getRGB($web_color) {
+	if (strlen($web_color) != 6) {
+		return false;
+	} else {
+		$retval["r"] = hexdec(substr($web_color,0,2));
+		$retval["g"] = hexdec(substr($web_color,2,2));
+		$retval["b"] = hexdec(substr($web_color,4,2));
+		return $retval;
+	}
+}
+  $phpgw_info = array();
+  $phpgw_info["flags"]["currentapp"] = "admin";
+  $phpgw_info["flags"]["nonavbar"] = True;
+  $phpgw_info["flags"]["noheader"] = True;
+  include("../header.inc.php");
+
+	
+  Header( "Content-type: image/gif");
+
+  $border = 1;
+
+//echo $filename;
+  $im = openGif($filename); /* Open the provided file */
+  $bg = getRGB($phpgw_info["theme"]["navbar_bg"]); /* get navbar theme */
+  $fg = getRGB($phpgw_info["theme"]["navbar_text"]);
+  $navbar_bg = ImageColorAllocate($im, $bg["r"], $bg["g"], $bg["b"]);
+  $navbar_fg = ImageColorAllocate($im, $fg["r"], $fg["g"], $fg["b"]);
+
+  $dk_gray = ImageColorAllocate($im, 128, 128, 128);
+  $lt_gray = ImageColorAllocate($im, 192, 192, 192);
+
+  $dx = ImageSX($im);  /* get image size */
+  $dy = ImageSY($im);
+
+  ImageFilledRectangle($im,0, 0, $dx, $border,$dk_gray); /* top */
+  ImageFilledRectangle($im,0, 0, $border, $dy,$dk_gray); /* left */
+  ImageFilledRectangle($im,$dx-$border-1, 0, $dx, $dy,$lt_gray); /* right */
+  ImageFilledRectangle($im,0, $dy-$border-1, $dx, $dy,$lt_gray); /* bottom */
+
+  //ImageGif($im,"$DOCUMENT_ROOT/kb/xml/$filename");
+
+  ImageGif($im);
+	
+  ImageDestroy($im);
+?>
+


Property changes on: people/sigurdne/modules/admin/trunk/navbar-sel.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Modified: people/sigurdne/modules/admin/trunk/phpinfo.php
===================================================================
--- people/sigurdne/modules/admin/trunk/phpinfo.php	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/phpinfo.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -12,12 +12,23 @@
 
 	$GLOBALS['phpgw_info']['flags'] = array
 	(
+		'currentapp'		=> 'admin',
+		'menu_selection'	=> 'admin::admin::phpinfo'
+	);
+
+	if ( isset($_GET['noheader']) && $_GET['noheader'] )
+	{
+		$GLOBALS['phpgw_info']['flags'] = array
+		(
 		'nofooter'		=> true,
 		'noframework'	=> true,
 		'noheader'		=> true,
 		'nonavbar'		=> true,
-		'currentapp'	=> 'admin'
+			'currentapp'		=> 'admin',
+			'menu_selection'	=> 'admin::admin::phpinfo'
 	);
+	}
+
   	include_once('../header.inc.php');
  
  	if ( phpgw::get_var('noheader', 'bool', 'GET') )

Modified: people/sigurdne/modules/admin/trunk/templates/base/app_data.xsl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/app_data.xsl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/app_data.xsl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -30,7 +30,7 @@
 				<xsl:apply-templates select="new_owner_list"/>
 			</xsl:when>
 			<xsl:when test="delete">
-				<xsl:call-template name="app_delete"/>
+				<xsl:call-template name="confirm_delete"/>
 			</xsl:when>
 			<xsl:when test="addressmaster_list">
 				<xsl:call-template name="addressmaster"/>
@@ -123,4 +123,3 @@
 	<xsl:template match="accountlist">
 		<option value="{account_id}"><xsl:value-of select="account_name"/></option>
 	</xsl:template>
-	

Modified: people/sigurdne/modules/admin/trunk/templates/base/config.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/config.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/config.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -2,14 +2,18 @@
 <div class="{error_class} msg">
 	{error}
 </div>
-<h1>{title}</h1>
 <form method="post" action="{action_url}">
+<table>
+	<thead>
+		<tr>
+			<th colspan="2">{title}</th>
+		</tr>
+	</thead>
+	<tbody>
 <!-- END header -->
 <!-- BEGIN body -->
-<h2>{lang_updates}</h2>
-<table>
 	<tr class="row_on">
-		<td>{lang_automatically_check_for_updates}:</td>
+    <td>{lang_Would_you_like_phpGroupWare_to_check_for_a_new_version_when_admins_login_?}:</td>
 		<td>
 			<select name="newsettings[checkfornewversion]">
 				<option value="">{lang_No}</option>
@@ -19,8 +23,17 @@
 	</tr>
 	
 	<tr class="row_off">
-		<td>{lang_show_application_upgrade_status}:</td>
-		<td>
+    <td>{lang_Timeout_for_sessions_in_seconds_(default_14400_=_4_hours)}:</td>
+    <td><input size="8" name="newsettings[sessions_timeout]" value="{value_sessions_timeout}"></td>
+   </tr>
+
+   <tr class="row_on">
+    <td>{lang_Timeout_for_application_session_data_in_seconds_(default_86400_=_1_day)}:</td>
+    <td><input size="8" name="newsettings[sessions_app_timeout]" value="{value_sessions_app_timeout}"></td>
+   </tr>
+
+   <tr class="row_off">
+    <td>{lang_Would_you_like_to_show_each_application's_upgrade_status_?}:</td><td>
 			<select name="newsettings[checkappversions]">
 				<option value="">{lang_No}</option>
 				<option value="Admin"{selected_checkappversions_Admin}>{lang_Admins}</option>
@@ -28,76 +41,117 @@
 			</select>
 		</td>
 	</tr>
-</table>
 
-<h2>{lang_mail}</h2>
-<table>
 	<tr class="row_on">
-		<td>{lang_SMTP_server_hostname_or_IP_address}:</td>
-		<td><input name="newsettings[smtp_server]" value="{value_smtp_server}"></td>
+    <td>{lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array_?}:</td>
+    <td>
+     <select name="newsettings[cache_phpgw_info]">
+      <option value="">{lang_No}</option>
+      <option value="True"{selected_cache_phpgw_info_True}>{lang_Yes}</option>
+     </select>
+    </td>
+   </tr>
+
+   <tr class="row_off">
+    <td>{lang_Maximum_entries_in_click_path_history}:</td>
+    <td><input size="8" name="newsettings[max_history]" value="{value_max_history}"></td>
+   </tr>
+
+   <tr class="row_on">
+    <td>{lang_Would_you_like_to_automaticaly_load_new_langfiles_(at_login-time)_?}:</td>
+    <td>
+     <select name="newsettings[disable_autoload_langfiles]">
+      <option value="">{lang_Yes}</option>
+      <option value="True"{selected_disable_autoload_langfiles_True}>{lang_No}</option>
+     </select>
+    </td>
+   </tr>
+
+    <tr class="row_on">
+    <td>{lang_Would_you_like_phpGroupWare_to_cache_data_in_shared_memory_?}:</td>
+    <td>
+     <select name="newsettings[shm_enable]">
+      <option value="">{lang_No}</option>
+      <option value="True"{selected_shm_enable_True}>{lang_Yes}</option>
+     </select>
+    </td>
+   </tr>
+
+    <tr class="th">
+    <td colspan="2">&nbsp;<b>{lang_SMTP_settings}</b></td>
+   </tr>
+
+   <tr class="row_on">
+   	<td>{lang_SMTP_server_hostname_(or_IP_address)}:</td>
+	<td><input name="newsettings[smtp_server]" value="{value_smtp_server}" /></td>
 	</tr>
 	
 	<tr class="row_off">
 		<td>{lang_SMTP_server_port_number}:</td>
-		<td><input name="newsettings[smtp_port]" value="{value_smtp_port}"></td>
+	<td><input name="newsettings[smtp_port]" value="{value_smtp_port}" /></td>
 	</tr>
 	
 	<tr class="row_on">
 		<td>{lang_Use_SMTP_auth}:</td>
 		<td>
-			<select name="newsettings[smtp_auth]">
+     <select name="newsettings[smtpAuth]">
 				<option value="">{lang_no}</option>
-				<option value="True" {selected_smtpAuth_True}>{lang_yes}</option>
+      <option value="yes" {selected_smtpAuth_yes}>{lang_yes}</option>
 			</select>
 		</td>
 	</tr>
-	
 	<tr class="row_off">
 		<td>{lang_Enter_your_SMTP_server_user}:</td>
-		<td><input name="newsettings[smtp_user]" value="{value_smtp_user}"></td>
+    <td><input name="newsettings[smtpUser]" value="{value_smtpUser}"></td>
 	</tr>
-	
 	<tr class="row_on">
 		<td>{lang_Enter_your_SMTP_server_password}:</td>
-		<td><input type= "password" name="newsettings[smtp_password]" value="{value_smtp_password}"></td>
+    <td><input type= "password" name="newsettings[smtpPassword]" value="{value_smtpPassword}"></td>
 	</tr>
 	
-	<tr class="row_off">
-		<td>{lang_administrator_notification_email_addresses}:</td>
-		<td><input name="newsettings[admin_mails]" value="{value_admin_mails}" size="40"></td>
+   <tr class="th">
+    <td colspan="2">&nbsp;<b>{lang_appearance}</b></td>
 	</tr>
-</table>
 
-<h2>{lang_branding}</h2>
-<table>
 	<tr class="row_on">
-		<td>{lang_name_of_site}:</td>
+    <td>{lang_Enter_the_title_for_your_site}:</td>
 		<td><input name="newsettings[site_title]" value="{value_site_title}"></td>
 	</tr>
 	
 	<tr class="row_off">
-		<td>{lang_Descriptive_text_for_logo_on_login_page}:</td>
+    <td>{lang_Enter_the_background_color_for_the_site_title}:</td>
+    <td>#<input name="newsettings[login_bg_color_title]" value="{value_login_bg_color_title}"></td>
+   </tr>
+
+   <tr class="row_on">
+    <td>{lang_Enter_the_background_color_for_the_login_page}:</td>
+    <td>#<input name="newsettings[login_bg_color]" value="{value_login_bg_color}"></td>
+   </tr>
+
+   <tr class="row_off">
+    <td>{lang_Enter_the_file_name_of_your_logo_at_login}:</td>
 		<td><input name="newsettings[login_logo_file]" value="{value_login_logo_file}"></td>
 	</tr>
 	
 	<tr class="row_on">
-		<td>{lang_Full_url_to_logo_on_login_page}:</td>
+    <td>{lang_Enter_the_file_name_of_your_logo}:</td>
 		<td><input name="newsettings[logo_file]" value="{value_logo_file}"></td>
 	</tr>
 	
 	<tr class="row_off">
-		<td>{lang_Full_url_for_logo_on_login_page_to_link_to}:</td>
-		<td><input name="newsettings[login_logo_url]" value="{value_login_logo_url}"></td>
+    <td>{lang_Enter_the_url_where_your_logo_should_link_to}:</td>
+    <td>http://<input name="newsettings[login_logo_url]" value="{value_login_logo_url}"></td>
 	</tr>
 	
 	<tr class="row_on">
 		<td>{lang_Enter_the_title_of_your_logo}:</td>
 		<td><input name="newsettings[login_logo_title]" value="{value_login_logo_title}"></td>
 	</tr>
-</table>
 
-<h2>{lang_security}</h2>
-<table>
+   <tr class="th">
+    <td colspan="2">&nbsp;<b>{lang_security}</b></td>
+   </tr>
+
 	<tr class="row_on">
 		<td>{lang_Use_cookies_to_pass_sessionid}:</td>
 		<td>
@@ -130,7 +184,9 @@
 	
 	<tr class="row_off">
 		<td>{lang_How_many_days_should_entries_stay_in_the_access_log,_before_they_get_deleted_(default_90)_?}:</td>
-		<td><input name="newsettings[max_access_log_age]" value="{value_max_access_log_age}" size="5"></td>
+    <td>
+     <input name="newsettings[max_access_log_age]" value="{value_max_access_log_age}" size="5">
+    </td>
 	</tr>
 	
 	<tr class="row_on">
@@ -142,12 +198,23 @@
 	
 	<tr class="row_off">
 		<td>{lang_After_how_many_unsuccessful_attempts_to_login,_an_IP_should_be_blocked_(default_3)_?}:</td>
-		<td><input name="newsettings[num_unsuccessful_ip]" value="{value_num_unsuccessful_ip}" size="5"></td>
+    <td>
+     <input name="newsettings[num_unsuccessful_ip]" value="{value_num_unsuccessful_ip}" size="5">
+    </td>
 	</tr>
 	
 	<tr class="row_on">
-		<td>{lang_How_many_minutes_should_an_account_or_IP_be_blocked}:</td>
-		<td><input name="newsettings[block_time]" value="{value_block_time}" size="5"></td>
+    <td>{lang_How_many_minutes_should_an_account_or_IP_be_blocked_(default_30)_?}:</td>
+    <td>
+     <input name="newsettings[block_time]" value="{value_block_time}" size="5">
+    </td>
+   </tr>
+   
+   <tr class="row_off">
+    <td>{lang_Admin_email_addresses_(comma-separated)_to_be_notified_about_the_blocking_(empty_for_no_notify)}:</td>
+    <td>
+     <input name="newsettings[admin_mails]" value="{value_admin_mails}" size="40">
+    </td>
 	</tr>
 	
 	<tr class="row_on">
@@ -159,17 +226,31 @@
 			</select>
 		</td>
 	</tr>
-</table>
+   <tr class="row_off">
+    <td>{lang_collect_missing_translations_}:</td>
+    <td>
+      <select name="newsettings[collect_missing_translations]">
+         <option value="">{lang_No}</option>
+	 <option value="True"{selected_collect_missing_translations_True}>{lang_Yes}</option>
+       </select>
+    </td>
+   </tr>
+   <tr class="row_on">
+    <td>{lang_use_HTML_Filtering}:<br>
+    <td>
+     <select name="newsettings[html_filtering]">
+      <option value="" {selected_html_filtering_}>NO</option>
+      <option value="1" {selected_html_filtering_1}>YES</option>
+     </select>
+    </td>
+   </tr>
+
 	
-	<input type="hidden" name="newsettings[sessions_timeout]" value="14400">
-    <input type="hidden" name="newsettings[sessions_app_timeout]" value="86400">
-    <input type="hidden" name="newsettings[cache_phpgw_info]" value="">
-    <input type="hidden" name="newsettings[max_history]" value="10">
-	<input type="hidden" name="newsettings[disable_autoload_langfiles]" value="True">
-    <input type="hidden" name="newsettings[shm_lang]" value="">
 <!-- END body -->
 
 <!-- BEGIN footer -->
+	</tbody>
+</table>
 <div class="button_group">
       <input type="submit" name="submit" value="{lang_submit}">
       <input type="submit" name="cancel" value="{lang_cancel}">

Added: people/sigurdne/modules/admin/trunk/templates/base/confirm_delete.xsl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/confirm_delete.xsl	                        (rev 0)
+++ people/sigurdne/modules/admin/trunk/templates/base/confirm_delete.xsl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -0,0 +1,16 @@
+<!-- $Id$ -->
+
+	<xsl:template name="confirm_delete">
+		<xsl:apply-templates select="delete"/>
+	</xsl:template>
+
+	<xsl:template match="delete">
+			<h1><xsl:value-of select="lang_confirm_msg"/></h1>
+			<div class="button_group">
+				<form method="post" action="{form_action}">
+					<input type="submit" name="cancel" value="{lang_no}" />
+
+					<input type="submit" name="confirm" value="{lang_yes}"/>
+				</form>
+			</div>
+	</xsl:template>


Property changes on: people/sigurdne/modules/admin/trunk/templates/base/confirm_delete.xsl
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Modified: people/sigurdne/modules/admin/trunk/templates/base/css/base.css
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/css/base.css	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/css/base.css	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,24 +1,53 @@
-/* TODO : These spans should be moved into the api */
-span.label
+#admin_account_form label, span.label
 {
 	display: block;
 	float: left;
-	font-weight: bold;
 	width: 200px;
 }
 
-span.value
+#admin_account_form input, #admin_account_form select, #admin_account_form textarea, span.value
 {
 	display: block;
 	float: left;
 	width: 300px;
 }
 
-#admin_view_user div
+#admin_account_form label.check
 {
-	height: 225px;
+	padding-left: 1em;
+	width: 500px;
+}
+
+#admin_account_form input[type=checkbox], #admin_account_form input.check
+{
+	text-align: right;
+	width: auto;
+}
+
+#admin_account_form span.dates input, #admin_account_form span.dates select
+{
+	display: auto;
+	width: auto;
+}
+
+table tbody .inactive td
+{
+	text-decoration: line-through;
+}
+
+.button_group input, .button_group button
+{
+	display: inline;
+	margin: 5px;
+	text-align: right;
+	width: auto;
+}
+
+
+#admin_view_user div ul
+{
+	height: 20em;
 	overflow: auto;
-	width: 320px;
 }
 
 #admin_view_user ul
@@ -31,7 +60,6 @@
 #admin_view_user li 
 {
 	padding: 2px 0px;
-	width: 300px;
 }
 
 #admin_view_user li span
@@ -41,3 +69,48 @@
 	text-align: center;
 	width: 25px;
 }
+
+div.search
+{
+	text-align: right;
+}
+
+#admin_accounts_list tbody td, #admin_group_list tbody td
+{
+	width: 75em;
+}
+
+#admin_accounts_list tbody td.icon
+{
+	text-align: center;
+	width: 20px;
+}
+
+#admin_accounts_list tbody td.action, #admin_group_list tbody td.action
+{
+	text-align: center;
+	width: 20em;
+	max-width: 20em;
+}
+
+#admin_accounts_list th, #admin_group_list th
+{
+	text-align: center;
+}
+
+ul.app_list
+{
+	height: 20em;
+	overflow: auto;
+}
+
+#account_edit_tabview div.yui-content, #group_edit_tabview div.yui-content
+{
+	/*height: 25em;*/
+	min-height: 25em;
+}
+
+br.eol, div.yui-content br
+{
+	clear: both;
+}

Modified: people/sigurdne/modules/admin/trunk/templates/base/currentusers.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/currentusers.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/currentusers.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,5 +1,4 @@
 <!-- BEGIN list -->
-<br>
 <table border="0" width="95%" align="center">
  <tr>
    {left_next_matchs}
@@ -16,20 +15,17 @@
   <td>{sort_idle}</td>
   <td>{lang_kill}</td>
  </tr>
-
- {rows}
-
+<!-- BEGIN rows -->
+ <tr class="{tr_class}">
+  <td>{lid}</td>
+  <td>{ip}</td>
+  <td>{logintime}</td>
+  <td>{action}</td>
+  <td>{idle}</td>
+  <td>{kill}</td>
+ </tr>
+<!-- END rows -->
 </table>
-<br>
 <!-- END list -->
 
-<!-- BEGIN row -->
- <tr class="{tr_class}">
-  <td>{row_loginid}</td>
-  <td>{row_ip}</td>
-  <td>{row_logintime}</td>
-  <td>{row_action}</td>
-  <td>{row_idle}</td>
-  <td>{row_kill}</td>
- </tr>
-<!-- END row -->
+

Modified: people/sigurdne/modules/admin/trunk/templates/base/custom.xsl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/custom.xsl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/custom.xsl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -649,8 +649,7 @@
 				</xsl:when>
 			</xsl:choose>
 			
-			<xsl:variable name="form_action"><xsl:value-of select="form_action"/></xsl:variable>
-			<form method="post" action="{$form_action}">
+			<form method="post" action="{form_action}">
 
 			<tr>
 				<td class="th_text" align="left">
@@ -701,8 +700,7 @@
 					<xsl:value-of select="lang_custom_function"/>
 				</td>
 				<td valign="top">
-					<xsl:variable name="lang_custom_function_statustext"><xsl:value-of select="lang_custom_function_statustext"/></xsl:variable>
-					<select name="values[custom_function_file]" class="forms" onMouseover="window.status='{$lang_custom_function_statustext}'; return true;" onMouseout="window.status='';return true;">
+					<select name="values[custom_function_file]" class="forms">
 						<option value=""><xsl:value-of select="lang_no_custom_function"/></option>
 						<xsl:apply-templates select="custom_function_list"/>
 					</select>
@@ -801,15 +799,12 @@
 <!-- custom_function_list -->	
 
 	<xsl:template match="custom_function_list">
-	<xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-		<xsl:choose>
-			<xsl:when test="selected='selected'">
-				<option value="{$id}" selected="selected"><xsl:value-of disable-output-escaping="yes" select="name"/></option>
-			</xsl:when>
-			<xsl:otherwise>
-				<option value="{$id}"><xsl:value-of disable-output-escaping="yes" select="name"/></option>
-			</xsl:otherwise>
-		</xsl:choose>
+		<option value="{id}">
+			<xsl:if test="selected = 1">
+				<xsl:attribute name="selected" value="selected" />
+			</xsl:if>
+			<xsl:value-of disable-output-escaping="yes" select="name"/>
+		</option>
 	</xsl:template>
 
 <!-- nullable_list -->	

Modified: people/sigurdne/modules/admin/trunk/templates/base/errorlog_view.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/errorlog_view.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/errorlog_view.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -44,8 +44,8 @@
 		<td>{row_line}</td>
 	</tr>
 	<tr class="{tr_class}">
-	    <td></td>
-		<td colspan="5">{row_message}</td>
+	    <td>&nbsp;</td>
+		<td colspan="5"><pre>{row_message}</pre></td>
 	</tr>
 <!-- END row -->
 

Modified: people/sigurdne/modules/admin/trunk/templates/base/form_button_script.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/form_button_script.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/form_button_script.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,6 +1,6 @@
 <!-- $Id$ -->
 <!-- BEGIN form_button -->
 <form action="{action_url_button}" method="post" name="{action_text_button}form">
- {action_extra_field} <input type="submit" value="{action_text_button}" {action_confirm_button}>
+ {action_extra_field} <input type="submit" title="{action_text_button}" style="cursor:help" value="{submit_button}" {action_confirm_button}>
 </form>
 <!-- END form_button -->

Modified: people/sigurdne/modules/admin/trunk/templates/base/groups.xsl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/groups.xsl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/groups.xsl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -41,7 +41,7 @@
 
 	<xsl:template match="group_header">
 		<tr>
-			<th><a href="$sort_name"><xsl:value-of select="lang_name"/></a></th>
+			<th><a href="{sort_name}"><xsl:value-of select="lang_name"/></a></th>
 			<th><xsl:value-of select="lang_edit"/></th>
 			<th><xsl:value-of select="lang_delete"/></th>
 		</tr>

Modified: people/sigurdne/modules/admin/trunk/templates/base/log_level_select.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/log_level_select.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/log_level_select.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -10,6 +10,7 @@
 			<option value="N" {N_selected}>{lang_notice}</option>
 			<option value="I" {I_selected}>{lang_info}</option>
 			<option value="D" {D_selected}>{lang_debug}</option>
+			<option value="S" {S_selected}>{lang_strict}</option>
 		</select>
 		<noscript><input type="submit"></noscript>
    </form>

Modified: people/sigurdne/modules/admin/trunk/templates/base/menurow.tpl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/menurow.tpl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/menurow.tpl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -1,21 +1,19 @@
 <!-- BEGIN menu_links -->
-<table border="0" width="100%">
-	<thead>
-		<tr>
-			<th>&nbsp;</th>
+				<table border="0" width="100%">
+					<tr class="th">
+						<td>&nbsp;</td>
 		</tr>
-	</thead>
-	<tbody>
-		</tr>
 			{all_rows}
 		<tr>
+						<td>&nbsp;</td>
+					</tr>
+					<tr>
 			<td class="row_on">&nbsp;&nbsp;<a href="{link_done}">{lang_done}</a></td>
 		</tr>
-	</tbody>
-</table>
+				</table>
 <!-- END menu_links -->
 <!-- BEGIN link_row -->
-		<tr class="{tr_class}">
-			<td><a href="{row_link}">{row_text}</a></td>
+					<tr class="{tr_color}">
+						<td>&nbsp;&nbsp;<a href="{row_link}">{row_text}</a></td>
 		</tr>
 <!-- END link_row -->

Modified: people/sigurdne/modules/admin/trunk/templates/base/users.xsl
===================================================================
--- people/sigurdne/modules/admin/trunk/templates/base/users.xsl	2009-11-20 10:27:07 UTC (rev 20838)
+++ people/sigurdne/modules/admin/trunk/templates/base/users.xsl	2009-11-20 10:27:15 UTC (rev 20839)
@@ -73,10 +73,11 @@
 					</xsl:when>
 				</xsl:choose>
 			</xsl:attribute>
-			<td><xsl:value-of select="lid" /></td>
-			<td><xsl:value-of select="firstname" /></td>
-			<td><xsl:value-of select="lastname" /></td>
-			<td class="icon"><img src="{status_img}" alt="{status_text}" /></td>
+			<td align = 'center'><xsl:value-of select="lid" /></td>
+			<td align = 'center'><xsl:value-of select="firstname" /></td>
+			<td align = 'center'><xsl:value-of select="lastname" /></td>
+		<!--	<td class="icon"><img src="{status_img}" alt="{status_text}" /></td> -->
+			<td align = 'center'><xsl:value-of select="status_text"/></td>
 			<td class="action">
 				<a href="{view_url}"><xsl:value-of select="lang_view"/></a>
 			</td>
@@ -204,15 +205,7 @@
 									</input>
 									<label for="changepassword"><xsl:value-of select="lang_changepassword" class="check" /></label><br />
 								</li>
-
 								<li>
-									<label for="account_groups"><xsl:value-of select="lang_groups"/></label>
-									<select name="account_groups[]" id="account_groups" multiple="multiple">
-										<xsl:apply-templates select="group_list"/>
-									</select><br />
-								</li>
-
-								<li>
 									<input type="checkbox" name="values[anonymous]" value="1" class="check">
 										<xsl:if test="anonymous = 1">
 											<xsl:attribute name="checked" value="checked" />
@@ -241,6 +234,12 @@
 								</li>
 							</ul>
 						</div>
+						<div id="groups">
+							<h2><xsl:value-of select="lang_groups" /></h2>
+							<ul class="group_list">
+								<xsl:apply-templates select="group_list" />
+							</ul>
+						</div>
 						<div id="apps">
 							<h2><xsl:value-of select="lang_applications" /></h2>
 							<ul class="app_list">
@@ -258,16 +257,27 @@
 	</xsl:template>
 
 <!-- BEGIN group_list -->
-
 	<xsl:template match="group_list">
-		<option value="{account_id}">
+		<li>
+			<xsl:attribute name="class">
+				<xsl:choose>
+					<xsl:when test="position() mod 2 = 0">
+						<xsl:text>row_off</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>row_on</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:attribute>
+			<input type="checkbox" id="account_groups{account_id}" name="account_groups[]" value="{account_id}">
 			<xsl:choose>
 				<xsl:when test="selected != ''">
-					<xsl:attribute name="selected" value="selected" />
+						<xsl:attribute name="checked" value="checked" />
 				</xsl:when>
 			</xsl:choose>
+			</input>
 			<xsl:value-of select="account_lid"/>
-		</option>
+		</li>
 	</xsl:template>
 
 <!-- BEGIN app_list -->

Added: people/sigurdne/modules/admin/trunk/templates/portico/images/navbar.png
===================================================================
(Binary files differ)


Property changes on: people/sigurdne/modules/admin/trunk/templates/portico/images/navbar.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: people/sigurdne/modules/admin/trunk/testbutton.php
===================================================================
--- people/sigurdne/modules/admin/trunk/testbutton.php	                        (rev 0)
+++ people/sigurdne/modules/admin/trunk/testbutton.php	2009-11-20 10:27:15 UTC (rev 20839)
@@ -0,0 +1,31 @@
+<?php
+  /**************************************************************************\
+  * phpGroupWare - administration                                            *
+  * http://www.phpgroupware.org                                              *
+  * --------------------------------------------                             *
+  *  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.                                              *
+  \**************************************************************************/
+  	/* $Id$ */
+  	
+  	$phpgw_info["flags"] = array(
+  		"currentapp" => "admin"
+  	);
+  	
+  	include("../header.inc.php");
+
+	$button = CreateObject('phpgwapi.graphics');
+
+	$button->parseHTTPPostVars();
+	$button->createInputButton(lang('save'), 'save');
+
+	if (isset($submit)) print "is worked $submit<br>";
+
+	print "<form method=post>";
+	print $button->createInputButton("Lars is the best ;)",'submit');
+	print "<br>the same as ascii<br>";
+	print $button->createInputButton("Lars is the best ;)",'submit','ascii');
+	print "</form>";
+?>


Property changes on: people/sigurdne/modules/admin/trunk/testbutton.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.