From 007c46e729c209e1424076cfd476afd76115176f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 24 Nov 2007 19:56:58 +0000 Subject: [PATCH] next steps: UI to add remote sites, remote admin needs not to be configured/allowed on the remote side --- admin/inc/class.admin_cmd.inc.php | 70 ++++++++++++++++ admin/inc/class.admin_cmds.inc.php | 122 ++++++++++++++++++++++++++-- admin/inc/hook_admin.inc.php | 1 + admin/remote.php | 17 ++-- admin/setup/etemplates.inc.php | 18 +++- admin/templates/default/cmds.xet | 65 +++++++++++++++ admin/templates/default/config.tpl | 5 ++ admin/templates/default/remotes.xet | 102 +++++++++++++++++++++++ 8 files changed, 385 insertions(+), 15 deletions(-) create mode 100644 admin/templates/default/cmds.xet create mode 100644 admin/templates/default/remotes.xet diff --git a/admin/inc/class.admin_cmd.inc.php b/admin/inc/class.admin_cmd.inc.php index 5dd693eac8..315592e999 100644 --- a/admin/inc/class.admin_cmd.inc.php +++ b/admin/inc/class.admin_cmd.inc.php @@ -345,6 +345,10 @@ abstract class admin_cmd { admin_cmd::_instanciate_sql(); + if ((string)$query['col_filter']['remote_id'] === '0') + { + $query['col_filter']['remote_id'] = null; + } return admin_cmd::$sql->get_rows($query,$rows,$readonlys); } @@ -555,6 +559,7 @@ abstract class admin_cmd if (!($remotes = admin_cmd::$remote->search(array( 'remote_id' => $id_or_name, 'remote_name' => $id_or_name, + 'remote_domain' => $id_or_name, ),true,'','','',false,'OR')) || count($remotes) != 1) { throw new Exception(lang('Invalid remote id or name "%1"!',$id_or_name),997); @@ -707,4 +712,69 @@ abstract class admin_cmd return admin_cmd::_set_async_job(); } + + /** + * Return a list of defined remote instances + * + * @return array remote_id => remote_name pairs, plus 0 => local + */ + static function remote_sites() + { + admin_cmd::_instanciate_remote(); + + return array(lang('local'))+admin_cmd::$remote->query_list('remote_name','remote_id'); + } + + /** + * get_rows for remote instances + * + * @param array $query + * @param array &$rows + * @param array &$readonlys + * @return int + */ + static function get_remotes($query,&$rows,&$readonlys) + { + admin_cmd::_instanciate_remote(); + + return admin_cmd::$remote->get_rows($query,$rows,$readonlys); + } + + /** + * Read data of a remote instance + * + * @param array/int $keys + * @return array + */ + static function read_remote($keys) + { + admin_cmd::_instanciate_remote(); + + return admin_cmd::$remote->read($keys); + } + + /** + * Save / adds a remote instance + * + * @param array $data + * @return array/boolean data including remote_id or false on failure + */ + static function save_remote(array $data) + { + admin_cmd::_instanciate_remote(); + + if ($data['install_id'] && $data['config_passwd']) // calculate hash + { + $pw = preg_match('/^[a-f0-9]{32}$/',$data['config_passwd']) ? $data['config_passwd'] : md5($data['config_passwd']); + $data['remote_hash'] = md5($pw.$data['install_id']); + } + elseif ($data['install_id'] || $data['config_passwd'] || !$data['remote_hash']) + { + return false; // we need either install_id AND config_passwd OR the remote_hash + } + //_debug_array($data); + admin_cmd::$remote->init($data); + + return admin_cmd::$remote->save() == 0 ? admin_cmd::$remote->data : false; + } } diff --git a/admin/inc/class.admin_cmds.inc.php b/admin/inc/class.admin_cmds.inc.php index 1d5bfbf00c..a6690762d4 100644 --- a/admin/inc/class.admin_cmds.inc.php +++ b/admin/inc/class.admin_cmds.inc.php @@ -20,6 +20,7 @@ class admin_cmds { var $public_functions = array( 'index' => true, + 'remotes' => true, ); /** @@ -27,17 +28,17 @@ class admin_cmds * * @param array $query * @param array &$rows - * @param array $readonlys + * @param array &$readonlys * @return int */ - function get_rows($query,&$rows,$readonlys) + static function get_rows($query,&$rows,&$readonlys) { + $GLOBALS['egw']->session->appsession('cmds','admin',$query); + $total = admin_cmd::get_rows($query,$rows,$readonlys); - $readonlys = array(); - if (!$rows) return array(); - + foreach($rows as &$row) { try { @@ -53,13 +54,18 @@ class admin_cmds return $total; } - function index(array $content=null) + /** + * Showing the command history and the scheduled commands + * + * @param array $content=null + */ + static function index(array $content=null) { $tpl = new etemplate('admin.cmds'); - + if (!is_array($content)) { - $content['nm'] = $GLOBALS['egw']->x; sessions::appsession('cmds','admin'); + $content['nm'] = $GLOBALS['egw']->session->appsession('cmds','admin'); if (!is_array($content['nm'])) { $content['nm'] = array( @@ -72,8 +78,106 @@ class admin_cmds ); } } + elseif ($content['nm']['rows']['delete']) + { + list($id) = each($content['nm']['rows']['delete']); + unset($content['nm']['rows']); + + if (($cmd = admin_cmd::read($id))) + { + $cmd->delete(); + } + unset($cmd); + } $tpl->exec('admin.admin_cmds.index',$content,array( 'status' => admin_cmd::$stati, - )); + 'remote_id' => admin_cmd::remote_sites(), + ),array(),$content); + } + + /** + * get_rows for remote instances + * + * @param array $query + * @param array &$rows + * @param array &$readonlys + * @return int + */ + static function get_remotes($query,&$rows,&$readonlys) + { + return admin_cmd::get_remotes($query,$rows,$readonlys); + } + + /** + * Showing remote administration instances + * + * @param array $content=null + */ + static function remotes(array $content=null) + { + $tpl = new etemplate('admin.remotes'); + + if (!is_array($content)) + { + $content['nm'] = $GLOBALS['egw']->session->appsession('remotes','admin'); + if (!is_array($content['nm'])) + { + $content['nm'] = array( + 'get_rows' => 'admin.admin_cmds.get_remotes', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows' + 'no_filter' => true, // I disable the 1. filter + 'no_filter2' => true, // I disable the 2. filter (params are the same as for filter) + 'no_cat' => true, // I disable the cat-selectbox + 'order' => 'remote_name', + 'sort' => 'ASC', + 'header_right' => 'admin.remotes.header_right', + ); + } + } + else + { + //_debug_array($content); + unset($content['msg']); + + if ($content['nm']['rows']['edit']) + { + list($id) = each($content['nm']['rows']['edit']); + unset($content['nm']['rows']); + + $content['remote'] = admin_cmd::read_remote($id); + } + elseif($content['remote']['button']) + { + list($button) = each($content['remote']['button']); + unset($content['remote']['button']); + switch($button) + { + case 'save': + case 'apply': + if ($content['remote']['install_id'] && !$content['remote']['config_passwd'] || + !$content['remote']['install_id'] && $content['remote']['config_passwd'] || + !$content['remote']['remote_hash'] && !$content['remote']['install_id'] && !$content['remote']['config_passwd']) + { + $content['msg'] = lang('You need to enter Install ID AND Password!'); + break; + } + if (($content['remote'] = admin_cmd::save_remote($content['remote']))) + { + $content['msg'] = lang('Remote instance saved'); + } + if ($button == 'apply') break; + // fall through for save + case 'cancel': + unset($content['remote']); + break; + } + } + elseif ($content['nm']['add']) + { + $content['remote'] = array('remote_domain' => 'default'); + unset($content['nm']['add']); + } + } + $tpl->exec('admin.admin_cmds.remotes',$content,array(),array(),$content); + } } diff --git a/admin/inc/hook_admin.inc.php b/admin/inc/hook_admin.inc.php index 247aad97d0..1c60fe9962 100644 --- a/admin/inc/hook_admin.inc.php +++ b/admin/inc/hook_admin.inc.php @@ -82,6 +82,7 @@ $file['phpInfo'] = "javascript:openwindow('" . $GLOBALS['egw']->link('/admin/phpinfo.php') . "')"; //$GLOBALS['egw']->link('/admin/phpinfo.php'); } $file['Admin queue and history'] = $GLOBALS['egw']->link('/index.php','menuaction=admin.admin_cmds.index'); + $file['Remote administration instances'] = $GLOBALS['egw']->link('/index.php','menuaction=admin.admin_cmds.remotes'); /* Do not modify below this line */ display_section('admin',$file); diff --git a/admin/remote.php b/admin/remote.php index 4ed65f2c8b..91dc2f3471 100644 --- a/admin/remote.php +++ b/admin/remote.php @@ -29,15 +29,22 @@ if (!isset($GLOBALS['egw_domain'][$instance])) $domain_data = $GLOBALS['egw_domain'][$instance]; //echo $instance; _debug_array($domain_data); +// as a security measure remote administration need to be enabled under Admin > Site configuration +list(,$remote_admin_install_id) = explode('-',$_REQUEST['uid']); +$allowed_remote_admin_ids = $GLOBALS['egw_info']['server']['allow_remote_admin'] ? explode(',',$GLOBALS['egw_info']['server']['allow_remote_admin']) : array(); // to authenticate with the installation we use a secret, which is a md5 hash build from the uid // of the command (to not allow to send new commands with an earsdroped secret) and the md5 hash // of the md5 hash of the config password and the install_id (egw_admin_remote.remote_hash) -if (!$domain_data || is_numeric($_REQUEST['uid']) || +if (!$domain_data || is_numeric($_REQUEST['uid']) || !in_array($remote_admin_install_id,$allowed_remote_admin_ids) || $_REQUEST['secret'] != ($md5=md5($_REQUEST['uid'].md5($domain_data['config_passwd'].$GLOBALS['egw_info']['server']['install_id'])))) { - header("HTTP/1.1 401 Unauthorized"); + header("HTTP/1.1 200 Unauthorized"); //die("0 secret != '$md5'"); echo lang('0 Permission denied!'); + if (!in_array($remote_admin_install_id,$allowed_remote_admin_ids)) + { + echo "\n".lang('Remote administration need to be enabled in the remote instance under Admin > Site configuration!'); + } $GLOBALS['egw']->common->egw_exit(); } @@ -56,7 +63,7 @@ if (!$_REQUEST['uid'] || // no uid !$_REQUEST['type'] || // no command class name !$_REQUEST['creator_email']) // no creator email { - header("HTTP/1.1 400 Bad format!"); + header("HTTP/1.1 200 Bad format!"); echo lang('0 Bad format!'); $GLOBALS['egw']->common->egw_exit(); } @@ -77,7 +84,7 @@ try { $success_msg = $cmd->run(); } catch (Exception $e) { - header('HTTP/1.1 400 '.$e->getMessage()); + header('HTTP/1.1 200 '.$e->getMessage()); echo $e->getCode().' '.$e->getMessage(); $GLOBALS['egw']->common->egw_exit(); } @@ -88,7 +95,7 @@ function exit_with_status($cmd,$success_msg='Successful') switch($cmd->status) { case admin_cmd::failed: // errors are returned as 400 HTTP status - header('HTTP/1.1 400 '.$cmd->error); + header('HTTP/1.1 200 '.$cmd->error); echo $cmd->errno.' '.$cmd->error; break; diff --git a/admin/setup/etemplates.inc.php b/admin/setup/etemplates.inc.php index 9b7f8f654a..251baa7303 100644 --- a/admin/setup/etemplates.inc.php +++ b/admin/setup/etemplates.inc.php @@ -2,7 +2,7 @@ /** * eGroupWare - eTemplates for Application admin * http://www.egroupware.org - * generated by soetemplate::dump4setup() 2007-07-11 11:18 + * generated by soetemplate::dump4setup() 2007-11-24 20:46 * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package admin @@ -12,6 +12,14 @@ $templ_version=1; +$templ_data[] = array('name' => 'admin.accesslog','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:24:"admin.accesslog.get_rows";s:4:"name";s:2:"nm";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1164479537',); + +$templ_data[] = array('name' => 'admin.accesslog.get_rows','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:4:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"LoginID";s:4:"name";s:7:"loginid";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:2:"IP";s:4:"name";s:2:"ip";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:9:"Logintime";s:4:"name";s:2:"li";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:9:"Logoutime";s:4:"name";s:2:"lo";}}i:2;a:4:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:15:"${row}[loginid]";s:8:"readonly";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"name";s:10:"${row}[ip]";s:7:"no_lang";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:10:"${row}[li]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:10:"${row}[lo]";s:8:"readonly";s:1:"1";}}}s:4:"rows";i:2;s:4:"cols";i:4;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1164479930',); + +$templ_data[] = array('name' => 'admin.cmds','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:15:"admin.cmds.rows";s:4:"name";s:2:"nm";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1195518120',); + +$templ_data[] = array('name' => 'admin.cmds.rows','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:3:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:2:"h2";s:4:",!@1";}i:1;a:10:{s:1:"A";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Title";s:4:"name";s:5:"title";}s:1:"B";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:9:"Requested";s:4:"name";s:9:"requested";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:9:"Scheduled";s:4:"name";s:13:"cmd_scheduled";}s:1:"D";a:3:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"size";s:6:"Remote";s:4:"name";s:9:"remote_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Created";s:4:"name";s:11:"cmd_created";}s:1:"F";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"name";s:7:"creator";s:4:"size";s:7:"Creator";}s:1:"G";a:3:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"name";s:6:"status";s:4:"size";s:6:"Status";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:12:"cmd_modified";}s:1:"I";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:8:"Modifier";s:4:"name";s:8:"modifier";}s:1:"J";a:1:{s:4:"type";s:5:"label";}}i:2;a:10:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[title]";}s:1:"B";a:3:{s:4:"type";s:13:"email-address";s:4:"name";s:17:"${row}[requested]";s:4:"size";s:26:"$row_cont[requested_email]";}s:1:"C";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:17:"${row}[scheduled]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:6:"select";s:4:"name";s:17:"${row}[remote_id]";s:8:"readonly";s:1:"1";}s:1:"E";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:15:"${row}[created]";s:8:"readonly";s:1:"1";}s:1:"F";a:3:{s:4:"type";s:13:"email-address";s:4:"name";s:15:"${row}[creator]";s:4:"size";s:24:"$row_cont[creator_email]";}s:1:"G";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:3:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[status]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[error]";s:4:"span";s:10:",redItalic";}}s:1:"H";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:16:"${row}[modified]";s:8:"readonly";s:1:"1";}s:1:"I";a:4:{s:4:"type";s:13:"email-address";s:4:"name";s:16:"${row}[modifier]";s:8:"readonly";s:1:"1";s:4:"size";s:25:"$row_cont[modifier_email]";}s:1:"J";a:6:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:5:"label";s:6:"Cancel";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"help";s:29:"Cancel this scheduled command";s:7:"onclick";s:48:"return confirm(\'Cancel this scheduled command\');";}}}s:4:"rows";i:2;s:4:"cols";i:10;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1195518170',); + $templ_data[] = array('name' => 'admin.customfields','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:2:{s:1:"F";s:3:"80%";s:2:"c2";s:6:"header";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:9:"error_msg";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:25:"admin.customfields.fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:4;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } .error_msg { color: red; font-style: italics; }','modified' => '1130271259',); @@ -25,3 +33,11 @@ $templ_data[] = array('name' => 'admin.customfields.fields','template' => '','la $templ_data[] = array('name' => 'admin.customfields.types','template' => '','lang' => '','group' => '0','version' => '1.2','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:1:"D";s:15:",@non_deletable";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:8:"app-name";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"- type";}s:1:"C";a:4:{s:4:"type";s:6:"select";s:4:"name";s:5:"types";s:8:"onchange";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"D";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:6:"delete";s:7:"onclick";s:110:"return confirm(\'WARNING: You are about to delete this type. Entries of this type won\\\'t be accessable then.\');";}s:1:"E";a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"name";s:4:"blur";s:8:"new name";}s:1:"F";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:6:"create";}}}s:4:"rows";i:1;s:4:"cols";i:6;}}','size' => '','style' => '','modified' => '1139823458',); +$templ_data[] = array('name' => 'admin.remotes','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:3:{s:2:"h2";s:9:",!@remote";s:2:"h1";s:6:",!@msg";s:2:"h3";s:2:",1";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"remote";s:4:"span";s:10:"all,border";s:4:"name";s:18:"admin.remotes.edit";}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:26:"admin.remotes.header_right";}}i:4;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"name";s:2:"nm";s:4:"size";s:18:"admin.remotes.rows";}}}s:4:"rows";i:4;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.border { border: black solid 2px; }','modified' => '1195926693',); + +$templ_data[] = array('name' => 'admin.remotes.edit','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:9:{i:0;a:8:{s:2:"c2";s:2:"th";s:2:"c3";s:3:"row";s:2:"c5";s:3:"row";s:2:"c6";s:3:"row";s:2:"c4";s:3:"row";s:2:"c7";s:3:"row";s:2:"h5";s:14:",!@remote_hash";s:2:"h1";s:11:",@remote_id";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:5:"label";s:97:"Remote administration need to be enabled in the remote instance under Admin > Site configuration!";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"size";s:14:",,,remote_name";s:5:"label";s:4:"Name";s:6:"needed";s:1:"1";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"name";s:11:"remote_name";s:6:"needed";s:1:"1";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,install_id";s:5:"label";s:10:"Install ID";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:24:"40,32,/^[a-f0-9]{0,32}$/";s:4:"name";s:10:"install_id";s:4:"help";s:75:"The install ID of an instance can be found under Admin > Site configuration";}}i:4;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:16:",,,config_passwd";s:5:"label";s:8:"Password";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"40,32";s:4:"name";s:13:"config_passwd";s:4:"help";s:51:"Config password or md5 hash from the header.inc.php";}}i:5;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Hash";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:11:"remote_hash";}}i:6;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:13:",,,remote_url";s:5:"label";s:3:"URL";}s:1:"B";a:5:{s:4:"type";s:4:"text";s:4:"size";s:62:"64,128,/^https?:\\/\\/[a-z0-9._-]+(\\:[0-9]+)?(\\/[a-z0-9._-]+)*$/";s:4:"name";s:10:"remote_url";s:6:"needed";s:1:"1";s:4:"help";s:68:"URL of the eGroupWare installation, eg. http://domain.com/egroupware";}}i:7;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:16:",,,remote_domain";s:5:"label";s:8:"Instance";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"name";s:13:"remote_domain";s:4:"help";s:44:"Name of the eGroupWare instance, eg. default";}}i:8;a:2:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:16:"Saves this entry";}s:4:"span";s:3:"all";i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:13:"button[apply]";s:5:"label";s:5:"Apply";s:4:"help";s:17:"Apply the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:31:"leave without saveing the entry";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:8;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1195927476',); + +$templ_data[] = array('name' => 'admin.remotes.header_right','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:7:{s:4:"type";s:6:"button";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"name";s:3:"add";s:5:"label";s:3:"Add";s:4:"help";s:25:"Add a new remote instance";}}','size' => '','style' => '','modified' => '1195931282',); + +$templ_data[] = array('name' => 'admin.remotes.rows','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:4:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:11:"remote_name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:3:"URL";s:4:"name";s:10:"remote_url";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Instance";s:4:"name";s:13:"remote_domain";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[remote_name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"size";s:64:",$row_cont[remote_url]/?domain=$row_cont[remote_domain],,,_blank";s:4:"name";s:18:"${row}[remote_url]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:4:"name";s:21:"${row}[remote_domain]";s:7:"no_lang";s:1:"1";}s:1:"D";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"1";i:1;a:5:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:26:"edit[$row_cont[remote_id]]";i:1;a:1:{s:4:"type";s:4:"hbox";}}s:5:"align";s:6:"center";}}}s:4:"rows";i:2;s:4:"cols";i:4;}}','size' => '','style' => '','modified' => '1195925625',); + diff --git a/admin/templates/default/cmds.xet b/admin/templates/default/cmds.xet new file mode 100644 index 0000000000..c8a3b2152d --- /dev/null +++ b/admin/templates/default/cmds.xet @@ -0,0 +1,65 @@ + + + + + + \ No newline at end of file diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index 7bb608980b..193ba1566a 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -251,6 +251,11 @@ {lang_How_many_entries_should_non-admins_be_able_to_export_(empty_=_no_limit,_no_=_no_export)}: + + + {lang_Allow_remote_administration_from_following_install_ID's_(comma_separated)}:
{lang_Own_install_ID:_}{value_install_id} + + diff --git a/admin/templates/default/remotes.xet b/admin/templates/default/remotes.xet new file mode 100644 index 0000000000..2b3fb0a2c4 --- /dev/null +++ b/admin/templates/default/remotes.xet @@ -0,0 +1,102 @@ + + + + + + +