diff --git a/about.php b/about.php index fefaa531b8..6353e9f64c 100644 --- a/about.php +++ b/about.php @@ -1,78 +1,128 @@ xslttpl->add_file(array('about')); - - if ($app == 'phpGroupWare' || $app == 'about') + if ($app) { - $app = 'phpgwapi'; - } - - $setup_file = PHPGW_INCLUDE_ROOT . '/' . $app . '/setup/setup.inc.php'; - - if (@file_exists($setup_file)) - { - include($setup_file); - - $fields = array - ( - 'version', - 'description', - 'note', - 'author', - 'license', - 'based_on', - 'maintainer' - ); - while (list(,$field) = each($fields)) + if (!($included = $GLOBALS['phpgw']->hooks->single('about',$app))) { - $app_data[$field] = $setup_info[$app][$field]; - - if ($field == 'description') - { - $app_data[$field] = lang($setup_info[$app][$field]); - } - } - - if (isset($app_data['note']) && !empty($app_data['note'])) - { - $app_data['note'] = lang($app_data['note']); - } - } - - $data = array - ( - 'phpgw_logo' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'), - 'lang_url_statustext' => lang('phpGroupWare --> homepage'), - 'lang_version' => lang('version'), - 'phpgw_version' => 'phpGroupWare API ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'], - 'phpgw_descr' => lang('is a multi-user, web-based groupware suite written in PHP'), - 'about_app' => $app_data + array - ( - 'title' => lang($app), - 'icon' => $GLOBALS['phpgw']->common->image($app,'navbar','',True), - 'lang_version' => lang('version'), - 'lang_author' => lang('author'), - 'lang_based_on' => lang('based on'), - 'lang_maintainer' => lang('maintainer'), - 'lang_license' => lang('license') - ) +function about_app() +{ + global $app; + $icon = $GLOBALS['phpgw']->common->image($app,'navbar.gif'); + include (PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php"); + $info = $setup_info[$app]; + $info['title'] = $GLOBALS['phpgw_info']['apps'][$app]['title']; + $other_infos = array( + 'author' => lang('Author'), + 'maintainer' => lang('Maintainer'), + 'version' => lang('Version'), + 'license' => lang('License') ); - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('about_data' => $data)); + $s = "\n"; + + if ($info['description']) + { + $info['description'] = lang($info['description']); + $s .= "\n"; + if ($info['note']) + { + $info['note'] = lang($info['note']); + $s .= "\n"; + } + } + foreach ($other_infos as $key => $val) + { + if (isset($info[$key])) + { + $s .= "\n"; + } + } + $s .= "
$info[title]
$info[description]
$info[note]
$val"; + $infos = $info[$key]; + for ($n = 0; is_array($info[$key][$n]) && ($infos = $info[$key][$n]) || !$n; ++$n) + { + if (!is_array($infos) && isset($info[$key.'_email'])) + { + $infos = array('email' => $info[$key.'_email'],'name' => $infos); + } + if (is_array($infos)) + { + $names = explode('
',$infos['name']); + $emails = split('@|
',$infos['email']); + if (count($names) < count($emails)/2) + { + $names = ''; + } + $infos = ''; + while (list($user,$domain) = $emails) + { + if ($infos) $infos .= '
'; + $name = $names ? array_shift($names) : $user; + $infos .= "$name"; + array_shift($emails); array_shift($emails); + } + } + $s .= ($n ? '
' : '') . $infos; + } + $s .= "
\n"; + + return $s; +} + $api_only = !($included = file_exists(PHPGW_INCLUDE_ROOT . "/$app/setup/setup.inc.php")); + } + } + else + { + $api_only = True; + } + + $tpl = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi')); + $tpl->set_file(array( + 'phpgw_about' => 'about.tpl', + 'phpgw_about_unknown' => 'about_unknown.tpl' + )); + + $tpl->set_var('webserver_url',$GLOBALS['phpgw']->common->get_image_path('phpgwapi')); + $tpl->set_var('phpgw_version','phpGroupWare API version ' . $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']); + if ($included) + { + $tpl->set_var('phpgw_app_about',about_app('','')); + //about_app($tpl,"phpgw_app_about"); + } + else + { + if ($api_only) + { + $tpl->set_var('phpgw_app_about',''); + } + else + { + $tpl->set_var('app_header',$app); + $tpl->parse('phpgw_app_about','phpgw_about_unknown'); + } + } + + $title = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : 'phpGroupWare'; + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('About %1',$title); + $GLOBALS['phpgw']->common->phpgw_header(); + $tpl->pparse('out','phpgw_about'); + $GLOBALS['phpgw']->common->phpgw_footer(); ?> diff --git a/addressbook/admin.php b/addressbook/admin.php new file mode 100644 index 0000000000..78ac03a64e --- /dev/null +++ b/addressbook/admin.php @@ -0,0 +1,69 @@ + 'addressbook', + 'noheader' => True, + 'nonavbar' => True, + 'noappheader' => True, + 'noappfooter' => True, + 'enable_config_class' => True, + 'enable_nextmatchs_class' => True + ); + + include('../header.inc.php'); + + $phpgw->config->read_repository(); + + if ($submit) + { + if ($usecountrylist) + { + $phpgw->config->config_data['countrylist'] = True; + } + else + { + unset($phpgw->config->config_data['countrylist']); + } + + $phpgw->config->save_repository(True); + Header('Location: ' . $phpgw->link('/admin/index.php')); + } + + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file(array('admin' => 'admin.tpl')); + + $t->set_var('action_url',$phpgw->link('/addressbook/admin.php')); + + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + $t->set_var('tr_color',$tr_color); + + $t->set_var('lang_countrylist',lang('Use Country List')); + if ($phpgw->config->config_data['countrylist']) + { + $t->set_var('countrylist',' checked'); + } + else + { + $t->set_var('countrylist',''); + } + + $t->set_var('lang_admin',lang('Addressbook').' '.lang('Admin')); + $t->set_var('lang_submit',lang('submit')); + + $t->pparse('out','admin'); + $phpgw->common->phpgw_footer(); +?> diff --git a/addressbook/csv_import.php b/addressbook/csv_import.php index 7718b015c9..01cacefa28 100644 --- a/addressbook/csv_import.php +++ b/addressbook/csv_import.php @@ -12,27 +12,32 @@ /* $Id$ */ - $GLOBALS['phpgw_info'] = array(); - $GLOBALS['phpgw_info']['flags']['currentapp'] = 'addressbook'; - $GLOBALS['phpgw_info']['flags']['enable_contacts_class'] = True; + $GLOBALS['phpgw_info']['flags'] = array( + 'currentapp' => 'addressbook', + 'noheader' => True, + 'enable_contacts_class' => True, + ); include('../header.inc.php'); + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Import CSV-File into Addressbook'); + $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['phpgw']->contacts = createobject('phpgwapi.contacts'); - $GLOBALS['phpgw']->template->set_file(array('import_t' => 'csv_import.tpl')); - $GLOBALS['phpgw']->template->set_block('import_t','filename'); - $GLOBALS['phpgw']->template->set_block('import_t','fheader'); - $GLOBALS['phpgw']->template->set_block('import_t','fields'); - $GLOBALS['phpgw']->template->set_block('import_t','ffooter'); - $GLOBALS['phpgw']->template->set_block('import_t','imported'); - $GLOBALS['phpgw']->template->set_block('import_t','import'); + $GLOBALS['phpgw']->template->set_file(array('import' => 'csv_import.tpl')); + $GLOBALS['phpgw']->template->set_block('import','filename','filenamehandle'); + $GLOBALS['phpgw']->template->set_block('import','fheader','fheaderhandle'); + $GLOBALS['phpgw']->template->set_block('import','fields','fieldshandle'); + $GLOBALS['phpgw']->template->set_block('import','ffooter','ffooterhandle'); + $GLOBALS['phpgw']->template->set_block('import','imported','importedhandle'); - if($action == 'download' && (!$fieldsep || !$csvfile || !($fp=fopen($csvfile,'rb')))) + $csvfile = isset($_POST['csvfile']) ? $_POST['csvfile'] : $_FILES['csvfile']['tmp_name']; + + if($_POST['action'] == 'download' && (!$_POST['fieldsep'] || !$csvfile || !($fp=fopen($csvfile,'rb')))) { - $action = ''; + $_POST['action'] = ''; } $GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php')); - $GLOBALS['phpgw']->template->set_var('lang_addr_action',lang('Import CSV-File into Addressbook')); $PSep = '||'; // Pattern-Separator, separats the pattern-replacement-pairs in trans $ASep = '|>'; // Assignment-Separator, separats pattern and replacesment @@ -125,18 +130,18 @@ return $id_str; } - switch($action) + switch($_POST['action']) { case '': // Start, ask Filename $GLOBALS['phpgw']->template->set_var('lang_csvfile',lang('CSV-Filename')); $GLOBALS['phpgw']->template->set_var('lang_fieldsep',lang('Fieldseparator')); - $GLOBALS['phpgw']->template->set_var('fieldsep',$fieldsep ? $fieldsep : ','); + $GLOBALS['phpgw']->template->set_var('fieldsep',$_POST['fieldsep'] ? $_POST['fieldsep'] : ','); $GLOBALS['phpgw']->template->set_var('submit',lang('Download')); $GLOBALS['phpgw']->template->set_var('csvfile',$csvfile); $GLOBALS['phpgw']->template->set_var('enctype','ENCTYPE="multipart/form-data"'); $hiddenvars .= ''."\n"; - $GLOBALS['phpgw']->template->parse('rows','filename'); + $GLOBALS['phpgw']->template->parse('filenamehandle','filename'); break; case 'download': @@ -151,9 +156,9 @@ $GLOBALS['phpgw']->template->set_var('lang_translation',lang("Translation").' '.lang('help').''); $GLOBALS['phpgw']->template->set_var('submit',lang('Import')); $GLOBALS['phpgw']->template->set_var('lang_debug',lang('Test Import (show importable records only in browser)')); - $GLOBALS['phpgw']->template->parse('rows','fheader'); + $GLOBALS['phpgw']->template->parse('fheaderhandle','fheader'); $hiddenvars .= ''."\n" - . '\n"; + . '\n"; $addr_names = $GLOBALS['phpgw']->contacts->stock_contact_fields + array( 'cat_id' => 'Categories: @cat_id(Cat1,Cat2)', @@ -161,8 +166,7 @@ 'owner' => 'Owner: defaults to user', 'address2' => 'address line 2', 'address3' => 'address line 3', - 'ophone' => 'Other Phone', - 'ab_id' => 'Address Id: @addr_id(n_family,n_given,org_name)' + 'ophone' => 'Other Phone' ); $config = CreateObject('phpgwapi.config','addressbook'); $config->read_repository(); @@ -172,7 +176,7 @@ } unset($config); - while(list($field,$name) = each($addr_names)) + foreach($addr_names as $field => $name) { if($dn = display_name($field)) { @@ -180,23 +184,22 @@ } } $addr_name_options = "'; } - $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); - $GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category')); - $GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion')); - $GLOBALS['phpgw']->template->set_var('export_path',lang('Enter the path to the export file here')); - $GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']); - $GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']); - $GLOBALS['phpgw']->template->set_var('mark_private',lang('Mark records as private')); - $GLOBALS['phpgw']->template->set_var('help_import',lang('In Netscape, open the Addressbook and select Export from the File menu.
The file exported will be in LDIF format.

Or, in Outlook, select your Contacts folder, select Import and Export... from')); - $GLOBALS['phpgw']->template->set_var('help_import2',lang('the File menu and export your contacts into a comma separated text (CSV) file.

Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. The file exported will be in VCard format.

')); - $GLOBALS['phpgw']->template->set_var('none',lang('none')); - $GLOBALS['phpgw']->template->set_var('debug_browser',lang('Debug output in browser')); - $GLOBALS['phpgw']->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard')); - $GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import')); - $GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False)); - $GLOBALS['phpgw']->template->set_var('tsvfilename',''); - $GLOBALS['phpgw']->template->set_var('conv',$conv); - $GLOBALS['phpgw']->template->set_var('debug',lang('Debug output in browser')); - $GLOBALS['phpgw']->template->set_var('filetype',lang('LDIF')); - $GLOBALS['phpgw']->template->set_var('download',lang('Submit')); - $GLOBALS['phpgw']->template->set_var('start',$this->start); - $GLOBALS['phpgw']->template->set_var('sort',$this->sort); - $GLOBALS['phpgw']->template->set_var('order',$this->order); - $GLOBALS['phpgw']->template->set_var('filter',$this->filter); - $GLOBALS['phpgw']->template->set_var('query',$this->query); - $GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id); - - $this->output = $GLOBALS['phpgw']->template->fp('out','import'); - $this->totpl(); + $this->template->set_var('lang_cancel',lang('Cancel')); + $this->template->set_var('lang_cat',lang('Select Category')); + $this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); + $this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']); + $this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']); + $this->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard')); + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import')); + $this->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False)); + $this->template->set_var('tsvfilename',''); + $this->template->set_var('conv',$conv); + $this->template->set_var('debug',lang('Debug output in browser')); + $this->template->set_var('filetype',lang('LDIF')); + $this->template->set_var('download',lang('Submit')); + $this->template->set_var('start',$this->start); + $this->template->set_var('sort',$this->sort); + $this->template->set_var('order',$this->order); + $this->template->set_var('filter',$this->filter); + $this->template->set_var('query',$this->query); + $this->template->set_var('cat_id',$this->cat_id); + $this->template->pparse('out','import'); } +// $GLOBALS['phpgw']->common->phpgw_footer(); } function export() { global $convert,$tsvfilename,$cat_id,$download,$conv_type; - if($convert) + if ($convert) { - if($conv_type == 'none') + if ($conv_type == 'none') { $GLOBALS['phpgw_info']['flags']['noheader'] = False; $GLOBALS['phpgw_info']['flags']['noheader'] = True; $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo lang('No conversion type <none> could be located. Please choose a conversion type from the list'); echo ' ' . lang('OK') . ''; - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_footer(); + $GLOBALS['phpgw']->common->phpgw_exit(); } $buffer = $this->bo->export($conv_type,$cat_id); - if(($download == 'on') || ($conv_type == 'Palm_PDB')) + if(($download == 'on') || ($conv_type == 'Palm_PDB') ) { // filename, default application/octet-stream, length of file, default nocache True $this->browser->content_header($tsvfilename,'application/x-octet-stream',strlen($buffer)); echo $buffer; - exit; } else { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo "

\n";
 					echo $buffer;
 					echo "\n
\n"; echo '' . lang('OK') . ''; + $GLOBALS['phpgw']->common->phpgw_footer(); } } else { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); set_time_limit(0); - - $GLOBALS['phpgw']->template->set_file(array('export' => 'export.tpl')); + + $this->template->set_file(array('export' => 'export.tpl')); $dir_handle = opendir(PHPGW_APP_INC. SEP . 'export'); $i=0; $myfilearray = ''; - while($file = readdir($dir_handle)) + while ($file = readdir($dir_handle)) { - if((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) ) + if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) ) { $myfilearray[$i] = $file; $i++; @@ -222,36 +215,33 @@ } closedir($dir_handle); sort($myfilearray); - for($i=0;$i'.$fname.''."\n"; } - $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); - $GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category')); - $GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False)); - $GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php')); - $GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']); - $GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']); - $GLOBALS['phpgw']->template->set_var('export_text',lang('Export from Addressbook')); - $GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export')); - $GLOBALS['phpgw']->template->set_var('filename',lang('Export file name')); - $GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion')); - $GLOBALS['phpgw']->template->set_var('conv',$conv); - $GLOBALS['phpgw']->template->set_var('debug',lang('')); - $GLOBALS['phpgw']->template->set_var('download',lang('Submit')); - $GLOBALS['phpgw']->template->set_var('download_export',lang('Download export file (Uncheck to debug output in browser)')); - $GLOBALS['phpgw']->template->set_var('none',lang('none')); - $GLOBALS['phpgw']->template->set_var('start',$this->start); - $GLOBALS['phpgw']->template->set_var('sort',$this->sort); - $GLOBALS['phpgw']->template->set_var('order',$this->order); - $GLOBALS['phpgw']->template->set_var('filter',$this->filter); - $GLOBALS['phpgw']->template->set_var('query',$this->query); - $GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id); + $this->template->set_var('lang_cancel',lang('Cancel')); + $this->template->set_var('lang_cat',lang('Select Category')); + $this->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False)); + $this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php')); + $this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']); + $this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']); + $this->template->set_var('export_text',lang('Export from Addressbook')); + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export')); + $this->template->set_var('filename',lang('Export file name')); + $this->template->set_var('conv',$conv); + $this->template->set_var('debug',lang('')); + $this->template->set_var('download',lang('Submit')); + $this->template->set_var('start',$this->start); + $this->template->set_var('sort',$this->sort); + $this->template->set_var('order',$this->order); + $this->template->set_var('filter',$this->filter); + $this->template->set_var('query',$this->query); + $this->template->set_var('cat_id',$this->cat_id); + $this->template->pparse('out','export'); - $this->output = $GLOBALS['phpgw']->template->fp('out','export'); - $this->totpl(); + $GLOBALS['phpgw']->common->phpgw_footer(); } } } diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 68f2aa3fc3..2b283a9c61 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -15,7 +15,7 @@ class uiaddressbook { - var $output = ''; + var $template; var $contacts; var $bo; var $cat; @@ -25,23 +25,23 @@ var $debug = False; var $start; + var $limit; var $query; var $sort; var $order; var $filter; var $cat_id; + var $template; var $public_functions = array( - 'index' => True, - 'view' => True, - 'add' => True, - 'addfromremote' => True, + 'index' => True, + 'view' => True, + 'add' => True, 'add_email' => True, - 'copy' => True, - 'edit' => True, + 'copy' => True, + 'edit' => True, 'delete' => True, - 'preferences' => True, - 'remote_search' => True + 'preferences' => True ); var $extrafields = array( @@ -58,6 +58,7 @@ $this->fields = CreateObject('addressbook.uifields'); $this->bo = CreateObject('addressbook.boaddressbook',True); + $this->template = &$GLOBALS['phpgw']->template; $this->contacts = CreateObject('phpgwapi.contacts'); $this->cat = CreateObject('phpgwapi.categories'); $this->company = CreateObject('phpgwapi.categories','addressbook_company'); @@ -66,36 +67,24 @@ $this->_set_sessiondata(); } - function totpl() - { - if(@isset($this->output) && !empty($this->output)) - { - $GLOBALS['phpgw']->template->set_var('phpgw_body', $this->output,True); - unset($this->output); - } - } - function _set_sessiondata() { $this->start = $this->bo->start; + $this->limit = $this->bo->limit; $this->query = $this->bo->query; - $this->cquery = $this->bo->cquery; $this->sort = $this->bo->sort; $this->order = $this->bo->order; $this->filter = $this->bo->filter; $this->cat_id = $this->bo->cat_id; - if($this->debug) - { - $this->_debug_sqsof(); - } + if($this->debug) { $this->_debug_sqsof(); } } function _debug_sqsof() { $data = array( 'start' => $this->start, + 'limit' => $this->limit, 'query' => $this->query, - 'cquery' => $this->cquery, 'sort' => $this->sort, 'order' => $this->order, 'filter' => $this->filter, @@ -110,8 +99,8 @@ { $data = array( 'start' => $this->start, + 'limit' => $this->limit, 'query' => $this->query, - 'cquery' => $this->cquery, 'sort' => $this->sort, 'order' => $this->order, 'filter' => $this->filter, @@ -122,7 +111,7 @@ function formatted_list($name,$list,$id='',$default=False,$java=False) { - if($java) + if ($java) { $jselect = ' onChange="this.form.submit();"'; } @@ -132,10 +121,10 @@ { $select .= ''."\n"; } - while(list($key,$val) = each($list)) + while (list($key,$val) = each($list)) { $select .= '' . "\n"; - } - - return $search_remote; - } - - function remote_search() - { -// _debug_array($GLOBALS['HTTP_POST_VARS']); - $remote = CreateObject('addressbook.remote',$GLOBALS['HTTP_POST_VARS']['serverid']); - $entries = $remote->search($GLOBALS['HTTP_POST_VARS']['remote_query']); - $this->index($entries); - } - /* this cleans up the fieldnames for display */ function display_name($column) { @@ -256,56 +217,23 @@ 'note' => 'notes' ); - if($abc[$column]) + if ($abc[$column]) { return lang($abc[$column]); } return; } - /* - Former index.php - */ - function index($entries='') + function index() { - $GLOBALS['phpgw']->template->set_file(array('addressbook_list_t' => 'index.tpl')); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_header','addressbook_header'); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','column','column'); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','row','row'); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','remsearch','remsearch'); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer'); - $GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_alpha','addressbook_alpha'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); - $aar = explode(',',lang('alphabet')); - $aar[] = 'all'; - while(list(,$char) = @each($aar)) - { - if($this->cquery == $char || - ($char == 'all' && !$this->cquery)) - { - $GLOBALS['phpgw']->template->set_var('charbgcolor','#000000'); - $GLOBALS['phpgw']->template->set_var('charcolor','#FFFFFF'); - } - else - { - $GLOBALS['phpgw']->template->set_var('charbgcolor',$GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('charcolor',$GLOBALS['phpgw_info']['theme']['th_text']); - } - if($char == 'all') - { - $GLOBALS['phpgw']->template->set_var('charlink', - $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index&cquery=') - ); - } - else - { - $GLOBALS['phpgw']->template->set_var('charlink', - $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index&cquery=' . $char) - ); - } - $GLOBALS['phpgw']->template->set_var('char',$char != 'all' ? strtoupper($char) : lang('all')); - $GLOBALS['phpgw']->template->fp('alphalinks','addressbook_alpha',True); - } + $this->template->set_file(array('addressbook_list_t' => 'index.tpl')); + $this->template->set_block('addressbook_list_t','addressbook_header','addressbook_header'); + $this->template->set_block('addressbook_list_t','column','column'); + $this->template->set_block('addressbook_list_t','row','row'); + $this->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer'); $custom = $this->fields->read_custom_fields(); $customfields = array(); @@ -315,11 +243,12 @@ $namedfields[$y['name']] = $y['title']; } - if(!$this->cat_id) + if ($this->cat_id == -1) { $this->cat_id = $this->prefs['default_category']; - } - if($this->prefs['autosave_category']) + } + + if ($this->prefs['autosave_category']) { $GLOBALS['phpgw']->preferences->read_repository(); $GLOBALS['phpgw']->preferences->delete('addressbook','default_category'); @@ -348,15 +277,16 @@ } /* Setup the columns for non-standard fields, since we don't allow sorting */ $nonstd = $this->extrafields + $customfields; - while($column = each($nonstd)) + while($column = @each($nonstd)) { $test = strtolower($column[1]); - if(isset($this->prefs[$test]) && $this->prefs[$test]) + if (isset($this->prefs[$test]) && $this->prefs[$test]) { $showcol = $this->display_name($column[0]); /* This must be a custom field */ if(!$showcol) { +// $showcol = $column[1]; $showcol = $namedfields[$column[1]]; } $cols .= ' ' . "\n"; @@ -369,8 +299,9 @@ $columns_to_display[$column[0]] = True; } } + /* Check if prefs were set, if not, create some defaults */ - if(!$columns_to_display ) + if(!$columns_to_display) { $columns_to_display = array( 'n_given' => 'n_given', @@ -380,13 +311,10 @@ // $columns_to_display = $columns_to_display + $customfields; /* No prefs,. so cols above may have been set to '' or a bunch of */ $cols=''; - while($column = each($columns_to_display)) + while ($column = each($columns_to_display)) { $showcol = $this->display_name($column[0]); - if(!$showcol) - { - $showcol = $column[1]; - } + if (!$showcol) { $showcol = $column[1]; } $cols .= ' ' . "\n"; $cols .= ' '; $cols .= $GLOBALS['phpgw']->nextmatchs->show_sort_order($this->sort, @@ -405,11 +333,11 @@ if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] && $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0) { - $limit = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; + $this->limit = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; } else { - $limit = 30; + $this->limit = 15; } /*global $filter; */ @@ -431,7 +359,7 @@ else they may be accounts, etc. */ $qfilter = 'tid=n'; - switch($this->filter) + switch ($this->filter) { case 'blank': $nosearch = True; @@ -446,204 +374,181 @@ default: $qfilter .= ',owner=' . $this->filter; } - if($this->cat_id) + if ($this->cat_id) { $qfilter .= ',cat_id='.$this->cat_id; } - if(!$userid) + if (!$userid) { $userid = $GLOBALS['phpgw_info']['user']['account_id']; } - if($nosearch && !$this->query && !$entries) + if ($nosearch && !$this->query) { $entries = array(); $total_records = 0; } - elseif(!$entries) + else { /* read the entry list */ $entries = $this->bo->read_entries(array( 'start' => $this->start, - 'limit' => $limit, + 'limit' => $this->limit, 'fields' => $columns_to_display, 'filter' => $qfilter, 'query' => $this->query, - 'cquery' => $this->cquery, 'sort' => $this->sort, 'order' => $this->order )); $total_records = $this->bo->total; - $GLOBALS['phpgw']->template->set_var('lang_view',lang('View')); - } - else - { - $total_records = count($entries); - $GLOBALS['phpgw']->template->set_var('lang_view',lang('Add')); - $showadd = True; } + /* global here so nextmatchs accepts our setting of $query and $filter */ + $GLOBALS['query'] = $this->query; + $GLOBALS['filter'] = $this->filter; + $search_filter = $GLOBALS['phpgw']->nextmatchs->show_tpl('/index.php', $this->start, $total_records,'&menuaction=addressbook.uiaddressbook.index&fcat_id='.$this->cat_id,'75%', - $GLOBALS['phpgw_info']['theme']['th_bg'],1,1,1,1,$this->cat_id); + $GLOBALS['phpgw_info']['theme']['th_bg'],1,1,1,array('filter'=>$this->filter,'yours'=>1), + $this->cat_id); + $query = $filter = ''; $lang_showing = $GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$this->start); /* set basic vars and parse the header */ - $GLOBALS['phpgw']->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']); - $GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']); -// $GLOBALS['phpgw']->template->set_var('lang_view',lang('View')); - $GLOBALS['phpgw']->template->set_var('lang_vcard',lang('VCard')); - $GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit')); - $GLOBALS['phpgw']->template->set_var('lang_owner',lang('Owner')); - $GLOBALS['phpgw']->template->set_var('lang_go',lang('Go')); + $this->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']); + $this->template->set_var('lang_view',lang('View')); + $this->template->set_var('lang_vcard',lang('VCard')); + $this->template->set_var('lang_edit',lang('Edit')); + $this->template->set_var('lang_owner',lang('Owner')); - $GLOBALS['phpgw']->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn); - $GLOBALS['phpgw']->template->set_var('lang_showing',$lang_showing); - $GLOBALS['phpgw']->template->set_var('search_filter',$search_filter); - $GLOBALS['phpgw']->template->set_var('cats',lang('Category')); - $GLOBALS['phpgw']->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - /* $GLOBALS['phpgw']->template->set_var('cats_link',$this->cat_option($this->cat_id)); */ - $GLOBALS['phpgw']->template->set_var('lang_cats',lang('Select')); - $GLOBALS['phpgw']->template->set_var('lang_addressbook',lang('Address book')); - $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('th_font',$GLOBALS['phpgw_info']['theme']['font']); - $GLOBALS['phpgw']->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']); - $GLOBALS['phpgw']->template->set_var('lang_add',lang('Add')); - $GLOBALS['phpgw']->template->set_var('add_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.add')); - $GLOBALS['phpgw']->template->set_var('lang_addvcard',lang('AddVCard')); - $GLOBALS['phpgw']->template->set_var('vcard_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.in')); - $GLOBALS['phpgw']->template->set_var('lang_import',lang('Import Contacts')); - $GLOBALS['phpgw']->template->set_var('import_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import')); - $GLOBALS['phpgw']->template->set_var('lang_import_alt',lang('Alt. CSV Import')); - $GLOBALS['phpgw']->template->set_var('import_alt_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php')); - $GLOBALS['phpgw']->template->set_var('lang_export',lang('Export Contacts')); - $GLOBALS['phpgw']->template->set_var('export_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export')); + $this->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn); + $this->template->set_var('lang_showing',$lang_showing); + $this->template->set_var('search_filter',$search_filter); + $this->template->set_var('cats',lang('Category')); + $this->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); + /* $this->template->set_var('cats_link',$this->cat_option($this->cat_id)); */ + $this->template->set_var('lang_cats',lang('Select')); +// $this->template->set_var('lang_addressbook',lang('Address book')); + $this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); + $this->template->set_var('th_font',$GLOBALS['phpgw_info']['theme']['font']); + $this->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']); + $this->template->set_var('lang_add',lang('Add')); + $this->template->set_var('add_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.add')); + $this->template->set_var('lang_addvcard',lang('AddVCard')); + $this->template->set_var('vcard_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.in')); + $this->template->set_var('lang_import',lang('Import Contacts')); + $this->template->set_var('import_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import')); + $this->template->set_var('lang_import_alt',lang('Alt. CSV Import')); + $this->template->set_var('import_alt_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php')); + $this->template->set_var('lang_export',lang('Export Contacts')); + $this->template->set_var('export_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export')); - $GLOBALS['phpgw']->template->set_var('start',$this->start); - $GLOBALS['phpgw']->template->set_var('sort',$this->sort); - $GLOBALS['phpgw']->template->set_var('order',$this->order); - $GLOBALS['phpgw']->template->set_var('filter',$this->filter); - $GLOBALS['phpgw']->template->set_var('query',$this->query); - $GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id); + $this->template->set_var('start',$this->start); + $this->template->set_var('sort',$this->sort); + $this->template->set_var('order',$this->order); + $this->template->set_var('filter',$this->filter); + $this->template->set_var('query',$this->query); + $this->template->set_var('cat_id',$this->cat_id); - $GLOBALS['phpgw']->template->set_var('qfield',$qfield); - $GLOBALS['phpgw']->template->set_var('cols',$cols); + $this->template->set_var('qfield',$qfield); + $this->template->set_var('cols',$cols); - if(@isset($GLOBALS['phpgw_info']['server']['enable_remote_addressbook'])) - { - $GLOBALS['phpgw']->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search')); - $GLOBALS['phpgw']->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']); - $GLOBALS['phpgw']->template->set_var('lang_remote_search',lang('Remote Search')); - $GLOBALS['phpgw']->template->set_var('search_remote',$this->remote_search_option()); - $GLOBALS['phpgw']->template->fp('remotesearch','remsearch'); - } - else - { - $GLOBALS['phpgw']->template->set_var('remotesearch',''); - } - $this->output .= $GLOBALS['phpgw']->template->parse('out','addressbook_header'); + $this->template->pparse('out','addressbook_header'); /* Show the entries */ /* each entry */ - for($i=0;$itemplate->set_var('columns',''); + $this->template->set_var('columns',''); $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - $GLOBALS['phpgw']->template->set_var('row_tr_color',$tr_color); + $this->template->set_var('row_tr_color',$tr_color); $myid = $entries[$i]['id']; $myowner = $entries[$i]['owner']; /* each entry column */ @reset($columns_to_display); - while($column = @each($columns_to_display)) + while ($column = @each($columns_to_display)) { - $ref = $data = ''; + $ref = $data=''; $coldata = $entries[$i][$column[0]]; /* echo '
coldata="' . $coldata . '"'; */ /* Some fields require special formatting. */ - if($column[0] == 'url') + if ($column[0] == 'url') { - if(!empty($coldata) && (substr($coldata,0,7) != 'http://')) - { - $coldata = 'http://' . $coldata; - } - $ref = ''; - $data = $coldata . ''; + if ( !empty($coldata) && (substr($coldata,0,7) != 'http://') ) { $coldata = 'http://' . $coldata; } + $ref=''; + $data=$coldata.''; } - elseif(($column[0] == 'email') || ($column[0] == 'email_home')) + elseif ( ($column[0] == 'email') || ($column[0] == 'email_home') ) { - if($GLOBALS['phpgw_info']['user']['apps']['email']) + if ($GLOBALS['phpgw_info']['user']['apps']['email']) { - $ref = ''; + $ref=''; } else { - $ref = ''; + $ref=''; } - $data = $coldata . ''; + $data=$coldata . ''; } else /* But these do not */ { - $ref = ''; - $data = $coldata; + $ref = ''; $data = $coldata; } - $GLOBALS['phpgw']->template->set_var('col_data',$ref . $data); - $GLOBALS['phpgw']->template->parse('columns','column',True); + $this->template->set_var('col_data',$ref.$data); + $this->template->parse('columns','column',True); } - if(!$showadd) + if (1) { - $GLOBALS['phpgw']->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php', - 'menuaction=addressbook.uiaddressbook.view&ab_id=' . $entries[$i]['id'])); + $this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php', + 'menuaction=addressbook.uiaddressbook.view&ab_id='.$entries[$i]['id'])); } else { - $GLOBALS['phpgw']->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php', - 'menuaction=addressbook.uiaddressbook.addfromremote&fields=' . urlencode(serialize($entries[$i])))); -// $GLOBALS['phpgw']->template->set_var('lang_view',lang('Add')); + $this->template->set_var('row_view_link',''); + $this->template->set_var('lang_view',lang('Private')); } - $GLOBALS['phpgw']->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php', + $this->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php', 'menuaction=addressbook.uivcard.out&ab_id='.$entries[$i]['id'])); - /* echo '
: ' . $contacts->grants[$myowner] . ' - ' . $myowner; */ - if($this->contacts->check_perms($this->contacts->grants[$myowner],PHPGW_ACL_EDIT) || - $myowner == $GLOBALS['phpgw_info']['user']['account_id']) + if ($this->contacts->check_perms($this->contacts->grants[$myowner],PHPGW_ACL_EDIT) || $myowner == $GLOBALS['phpgw_info']['user']['account_id']) { - $GLOBALS['phpgw']->template->set_var('row_edit','link('/index.php', 'menuaction=addressbook.uiaddressbook.edit&ab_id='.$entries[$i]['id']) . '">' . lang('Edit') . ''); } else { - $GLOBALS['phpgw']->template->set_var('row_edit',' '); + $this->template->set_var('row_edit',' '); } - $GLOBALS['phpgw']->template->set_var('row_owner',$GLOBALS['phpgw']->accounts->id2name($myowner)); + $this->template->set_var('row_owner',$GLOBALS['phpgw']->accounts->id2name($myowner)); - $GLOBALS['phpgw']->template->parse('rows','row',True); - $this->output .= $GLOBALS['phpgw']->template->fp('out','row'); + $this->template->parse('rows','row',True); + $this->template->pparse('out','row'); reset($columns_to_display); } - $this->output .= $GLOBALS['phpgw']->template->fp('out','addressbook_footer'); + $this->template->pparse('out','addressbook_footer'); $this->save_sessiondata(); - $this->totpl(); + /* $GLOBALS['phpgw']->common->phpgw_footer(); */ } function add_email() { - $name = $GLOBALS['HTTP_POST_VARS']['name'] ? $GLOBALS['HTTP_POST_VARS']['name'] : $GLOBALS['HTTP_GET_VARS']['name']; - $referer = $GLOBALS['HTTP_POST_VARS']['referer'] ? $GLOBALS['HTTP_POST_VARS']['referer'] : $GLOBALS['HTTP_GET_VARS']['referer']; - $add_email = $GLOBALS['HTTP_POST_VARS']['add_email'] ? $GLOBALS['HTTP_POST_VARS']['add_email'] : $GLOBALS['HTTP_GET_VARS']['add_email']; + $name = $_POST['name'] ? $_POST['name'] : $_GET['name']; + $referer = $_POST['referer'] ? $_POST['referer'] : $_GET['referer']; + $add_email = $_POST['add_email'] ? $_POST['add_email'] : $_GET['add_email']; $named = explode(' ', $name); - for($i=count($named);$i>=0;$i--) + for ($i=count($named);$i>=0;$i--) { $names[$i] = $named[$i]; } - if($names[2]) + if ($names[2]) { $fields['n_given'] = $names[0]; $fields['n_middle'] = $names[1]; @@ -673,31 +578,23 @@ function copy() { - $addnew = $this->bo->read_entry(array('id' => $GLOBALS['ab_id'], 'fields' => $this->contacts->stock_contact_fields)); + list($addnew) = $this->bo->read_entry(array( + 'id' => $_GET['ab_id'], + 'fields' => $this->contacts->stock_contact_fields + )); - $addnew[0]['note'] .= "\nCopied from " . $GLOBALS['phpgw']->accounts->id2name($addnew[0]['owner']).", record #".$addnew[0]['id'].'.'; - $addnew[0]['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; - unset($addnew[0]['id']); - $fields = $addnew[0]; + $addnew['note'] .= "\n".lang("Copied by %1, from record #%2.",$GLOBALS['phpgw']->accounts->id2name($addnew['owner']),$addnew['id']); + $addnew['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; + unset($addnew['id']); - $ab_id = $this->bo->add_entry($fields); + $ab_id = $this->bo->add_entry($addnew); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id=' . $ab_id)); - } - - function addfromremote() - { - $fields = get_var('fields',array('GET')); - $fields = stripslashes(urldecode($fields)); - $fields = unserialize($fields); - $fields['note'] = "\nCopied from remote search."; - $ab_id = $this->bo->add_entry($fields); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id=' . $ab_id)); + $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id=' . $ab_id); } function add() { - if($GLOBALS['HTTP_POST_VARS']['submit']) + if ($_POST['submit']) { $fields = $this->get_form(); @@ -708,19 +605,18 @@ $this->bo->add_entry($fields); $ab_id = $this->bo->get_lastid(); - $GLOBALS['ab_id'] = $ab_id; - $GLOBALS['phpgw']->hooks->process('addressbook_save'); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $ab_id . '&referer=' . $referer)); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } - $GLOBALS['phpgw']->template->set_file(array('add' => 'add.tpl')); + $this->template->set_file(array('add' => 'add.tpl')); + + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $custom = $this->fields->read_custom_fields(); - $customfields = array(); while(list($x,$y) = @each($custom)) { $customfields[$y['name']] = $y['title']; @@ -728,26 +624,22 @@ $this->addressbook_form('','menuaction=addressbook.uiaddressbook.add','Add','',$customfields,$this->cat_id); - $GLOBALS['phpgw']->template->set_var('lang_ok',lang('ok')); - $GLOBALS['phpgw']->template->set_var('lang_clear',lang('clear')); - $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel')); - $GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $this->output .= $GLOBALS['phpgw']->template->parse('out','add'); - $this->output .= $GLOBALS['phpgw']->template->parse('out','add'); - $this->totpl(); - $GLOBALS['phpgw']->hooks->process('addressbook_add'); + $this->template->set_var('lang_save',lang('Save')); + $this->template->set_var('lang_cancel',lang('Cancel')); + $this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); + $this->template->parse('out','add'); + $this->template->pparse('out','add'); } function edit() { - if($GLOBALS['HTTP_POST_VARS']['submit']) + if ($_POST['submit']) { $_fields = $this->get_form(); /* _debug_array($_fields);exit; */ $check = $this->bo->read_entry(array('id' => $_fields['ab_id'], 'fields' => array('owner' => 'owner','tid' => 'tid'))); - if(($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_EDIT) && - $check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) + if (($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_EDIT) && $check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) { $userid = $check[0]['owner']; } @@ -760,28 +652,27 @@ unset($_fields['referer']); $this->bo->update_entry($_fields); - $GLOBALS['ab_id'] = $_fields['ab_id']; - $GLOBALS['phpgw']->hooks->process('addressbook_save'); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer) ); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } /* First, make sure they have permission to this entry */ - $check = $this->bo->read_entry(array('id' => $GLOBALS['HTTP_GET_VARS']['ab_id'], 'fields' => array('owner' => 'owner','tid' => 'tid'))); + $check = $this->bo->read_entry(array('id' => $_GET['ab_id'], 'fields' => array('owner' => 'owner','tid' => 'tid'))); - if(!$this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_EDIT) && - ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) + if ( !$this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_EDIT) && + ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) ) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + /* Read in user custom fields, if any */ $custom = $this->fields->read_custom_fields(); $customfields = array(); @@ -792,68 +683,65 @@ /* merge in extra fields */ $qfields = $this->contacts->stock_contact_fields + $this->extrafields + $customfields; - $fields = $this->bo->read_entry(array('id' => $GLOBALS['HTTP_GET_VARS']['ab_id'], 'fields' => $qfields)); + $fields = $this->bo->read_entry(array('id' => $_GET['ab_id'], 'fields' => $qfields)); $this->addressbook_form('edit','menuaction=addressbook.uiaddressbook.edit',lang('Edit'),$fields[0],$customfields); - $GLOBALS['phpgw']->template->set_file(array('edit' => 'edit.tpl')); + $this->template->set_file(array('edit' => 'edit.tpl')); - $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('ab_id',$GLOBALS['HTTP_GET_VARS']['ab_id']); - $GLOBALS['phpgw']->template->set_var('tid',$check[0]['tid']); - $GLOBALS['phpgw']->template->set_var('referer',$referer); - $GLOBALS['phpgw']->template->set_var('lang_ok',lang('ok')); - $GLOBALS['phpgw']->template->set_var('lang_clear',lang('clear')); - $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel')); - $GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit')); - $GLOBALS['phpgw']->template->set_var('cancel_link','
'); - if(($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_DELETE) || - $check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id']) + if (($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_DELETE) || $check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id']) { - $GLOBALS['phpgw']->template->set_var('delete_link',''); - $GLOBALS['phpgw']->template->set_var('delete_button',''); + $this->template->set_var('delete_link',''); + $this->template->set_var('delete_button',''); } - $this->output .= $GLOBALS['phpgw']->template->fp('out','edit'); - $this->totpl(); - $GLOBALS['phpgw']->hooks->process('addressbook_edit'); + $this->template->pfp('out','edit'); } function delete() { - $ab_id = $GLOBALS['HTTP_POST_VARS']['entry']['ab_id'] ? $GLOBALS['HTTP_POST_VARS']['entry']['ab_id'] : $GLOBALS['HTTP_POST_VARS']['ab_id']; - $confirm = $GLOBALS['HTTP_GET_VARS']['confirm'] ? $GLOBALS['HTTP_GET_VARS']['confirm'] :$GLOBALS['HTTP_POST_VARS']['confirm']; - if(!$ab_id) + $ab_id = $_POST['entry']['ab_id'] ? $_POST['entry']['ab_id'] : $_POST['ab_id']; + $confirm = $_GET['confirm'] ? $_GET['confirm'] :$_POST['confirm']; + if (!$ab_id) { - $ab_id = $GLOBALS['HTTP_GET_VARS']['ab_id']; // else plain Link in delete does not work + $ab_id = $_GET['ab_id']; // else plain Link in delete does not work } - if(!$ab_id) + if (!$ab_id || $_POST['no']) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); } $check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner','tid' => 'tid'))); - if(!(($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_DELETE) || - $check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])) + if (!(($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_DELETE) || $check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } - $GLOBALS['phpgw']->template->set_file(array('delete' => 'delete.tpl')); + $this->template->set_file(array('delete' => 'delete.tpl')); - if($confirm != 'true') + if (!$_POST['yes']) { - $GLOBALS['phpgw']->template->set_var('lang_sure',lang('Are you sure you want to delete this entry ?')); - $GLOBALS['phpgw']->template->set_var('no_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->template->set_var('lang_no',lang('NO')); - $GLOBALS['phpgw']->template->set_var('yes_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete&ab_id=' . $ab_id . '&confirm=true')); - $GLOBALS['phpgw']->template->set_var('lang_yes',lang('YES')); - $this->output .= $GLOBALS['phpgw']->template->parse('out','delete'); + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Addressbook').' - '.lang('Delete'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $this->template->set_var('lang_sure',lang('Are you sure you want to delete this entry ?')); + $this->template->set_var('no_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); + $this->template->set_var('lang_no',lang('NO')); + $this->template->set_var('yes_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete&ab_id=' . $ab_id . '&confirm=true')); + $this->template->set_var('lang_yes',lang('YES')); + $this->template->pparse('out','delete'); } else @@ -861,14 +749,13 @@ $this->bo->delete_entry(array('id' => $ab_id)); @Header('Location: ' . $GLOBALS['phpgw']->link('/addressbook/index.php','menuaction=addressbook.uiaddressbook.index')); } - $this->totpl(); } function view() { - $ab_id = $GLOBALS['HTTP_GET_VARS']['ab_id']; - $submit = $GLOBALS['HTTP_POST_VARS']['submit']; - $referer = $GLOBALS['HTTP_GET_VARS']['referer']; + $ab_id = $_GET['ab_id']; + $submit = $_POST['submit']; + $referer = $_GET['referer']; /* First, make sure they have permission to this entry */ $check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner','tid' => 'tid'))); @@ -876,25 +763,29 @@ $tmp = $check[0]['owner']; $perms = $this->contacts->check_perms($this->contacts->grants[$tmp],PHPGW_ACL_READ); - if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) + if ( (!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) ) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } - if(!$ab_id) + if (!$ab_id) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); + } + elseif (!$submit && $ab_id) + { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Address book - view'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); } - $GLOBALS['phpgw']->template->set_file(array('view_t' => 'view.tpl')); - $GLOBALS['phpgw']->template->set_block('view_t','view_header','view_header'); - $GLOBALS['phpgw']->template->set_block('view_t','view_row','view_row'); - $GLOBALS['phpgw']->template->set_block('view_t','view_footer','view_footer'); - $GLOBALS['phpgw']->template->set_block('view_t','view_buttons','view_buttons'); + $this->template->set_file(array('view_t' => 'view.tpl')); + $this->template->set_block('view_t','view_header','view_header'); + $this->template->set_block('view_t','view_row','view_row'); + $this->template->set_block('view_t','view_footer','view_footer'); + $this->template->set_block('view_t','view_buttons','view_buttons'); $custom = $this->fields->read_custom_fields(); $customfields = array(); @@ -904,34 +795,15 @@ } /* _debug_array($this->prefs); */ - while(list($column,$x) = each($this->contacts->stock_contact_fields)) + while (list($column,$x) = each($this->contacts->stock_contact_fields)) { - if(isset($this->prefs[$column]) && $this->prefs[$column]) + if (isset($this->prefs[$column]) && $this->prefs[$column]) { $columns_to_display[$column] = True; $colname[$column] = $column; } } - /* No prefs? */ - if(!$columns_to_display ) - { - $columns_to_display = array( - 'n_given' => 'n_given', - 'n_family' => 'n_family', - 'org_name' => 'org_name', - 'tel_work' => 'tel_work', - 'tel_home' => 'tel_home', - 'email' => 'email', - 'email_home' => 'email_home' - ); - while($column = each($columns_to_display)) - { - $colname[$column[0]] = $column[1]; - } - $noprefs = ' - ' . lang('Please set your preferences for this application'); - } - /* merge in extra fields */ $qfields = $this->contacts->stock_contact_fields + $this->extrafields + $customfields; @@ -939,7 +811,7 @@ $record_owner = $fields[0]['owner']; - if($fields[0]['access'] == 'private') + if ($fields[0]['access'] == 'private') { $access_check = lang('private'); } @@ -948,41 +820,39 @@ $access_check = lang('public'); } - $GLOBALS['phpgw']->template->set_var('lang_viewpref',lang('Address book - view') . $noprefs); - unset($qfields['email_type']); // noone is useing that any more - unset($qfields['privat_email_type']); + unset($qfields['email_home_type']); @reset($qfields); - while(list($column,$null) = @each($qfields)) + while (list($column,$null) = @each($qfields)) { if($this->display_name($colname[$column])) { - $GLOBALS['phpgw']->template->set_var('display_col',$this->display_name($colname[$column])); + $this->template->set_var('display_col',$this->display_name($colname[$column])); } elseif($this->display_name($column)) { - $GLOBALS['phpgw']->template->set_var('display_col',$this->display_name($column)); + $this->template->set_var('display_col',$this->display_name($column)); } else { - $GLOBALS['phpgw']->template->set_var('display_col',ucfirst($column)); + $this->template->set_var('display_col',ucfirst($column)); } $ref = $data = ''; - if($fields[0][$column]) + if ($fields[0][$column]) { $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - $GLOBALS['phpgw']->template->set_var('th_bg',$tr_color); + $this->template->set_var('th_bg',$tr_color); $coldata = $fields[0][$column]; /* Some fields require special formatting. */ - if(($column == 'note' || $column == 'pubkey') && $coldata) + if ( ($column == 'note' || $column == 'pubkey') && $coldata ) { $datarray = explode ("\n",$coldata); - if($datarray[1]) + if ($datarray[1]) { - while(list($key,$info) = each ($datarray)) + while (list($key,$info) = each ($datarray)) { - if($key) + if ($key) { $data .= ' ' .$info; } @@ -1004,11 +874,12 @@ $ref = ''; $data = $coldata . ''; } - elseif((($column == 'email') || ($column == 'email_home')) && $coldata) + elseif ( (($column == 'email') || ($column == 'email_home')) && $coldata) { - if($GLOBALS['phpgw_info']['user']['apps']['email']) + if ($GLOBALS['phpgw_info']['user']['apps']['email']) { - $ref = ''; + $ref=''; } else { @@ -1027,34 +898,34 @@ $ref = ''; $data = $coldata; } - if(!$data) + if (!$data) { - $GLOBALS['phpgw']->template->set_var('ref_data',' '); + $this->template->set_var('ref_data',' '); } else { - $GLOBALS['phpgw']->template->set_var('ref_data',$ref . $data); + $this->template->set_var('ref_data',$ref . $data); } - $GLOBALS['phpgw']->template->parse('cols','view_row',True); + $this->template->parse('cols','view_row',True); } } /* Following cleans up view_row, since we were only using it to fill {cols} */ - $GLOBALS['phpgw']->template->set_var('view_row',''); + $this->template->set_var('view_row',''); $fields['cat_id'] = is_array($this->cat_id) ? implode(',',$this->cat_id) : $this->cat_id; $cats = explode(',',$fields[0]['cat_id']); - if($cats[1]) + if ($cats[1]) { - while(list($key,$contactscat) = each($cats)) + while (list($key,$contactscat) = each($cats)) { - if($contactscat) + if ($contactscat) { $catinfo = $this->cat->return_single(intval($contactscat)); $catname .= $catinfo[0]['name'] . '; '; } } - if(!$this->cat_id) + if (!$this->cat_id) { $this->cat_id = $cats[0]; } @@ -1064,57 +935,52 @@ $fields[0]['cat_id'] = ereg_replace(',','',$fields[0]['cat_id']); $catinfo = $this->cat->return_single(intval($fields[0]['cat_id'])); $catname = $catinfo[0]['name']; - if(!$this->cat_id) + if (!$this->cat_id) { $this->cat_id = $fields[0]['cat_id']; } } - if(!$catname) - { - $catname = lang('none'); - } + if (!$catname) { $catname = lang('none'); } /* These are in the footer */ - $GLOBALS['phpgw']->template->set_var('lang_owner',lang('Record owner')); - $GLOBALS['phpgw']->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($record_owner)); - $GLOBALS['phpgw']->template->set_var('lang_access',lang('Record access')); - $GLOBALS['phpgw']->template->set_var('access',$access_check); - $GLOBALS['phpgw']->template->set_var('lang_category',lang('Category')); - $GLOBALS['phpgw']->template->set_var('catname',$catname); + $this->template->set_var('lang_owner',lang('Record owner')); + $this->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($record_owner)); + $this->template->set_var('lang_access',lang('Record access')); + $this->template->set_var('access',$access_check); + $this->template->set_var('lang_category',lang('Category')); + $this->template->set_var('catname',$catname); - if(($this->contacts->grants[$record_owner] & PHPGW_ACL_EDIT) || - ($record_owner == $GLOBALS['phpgw_info']['user']['account_id'])) + if (($this->contacts->grants[$record_owner] & PHPGW_ACL_EDIT) || ($record_owner == $GLOBALS['phpgw_info']['user']['account_id'])) { $extra_vars = array('cd' => 16,'query' => $this->query,'cat_id' => $this->cat_id); - if($referer) + if ($referer) { $extra_vars += array('referer' => urlencode($referer)); } - $GLOBALS['phpgw']->template->set_var('edit_button',$this->html_1button_form('edit','Edit', + $this->template->set_var('edit_button',$this->html_1button_form('edit','Edit', $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id=' .$ab_id))); } - $GLOBALS['phpgw']->template->set_var('copy_button',$this->html_1button_form('submit','copy', + $this->template->set_var('copy_button',$this->html_1button_form('submit','copy', $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.copy&ab_id=' . $fields[0]['id']))); - if($fields[0]['n_family'] && $fields[0]['n_given']) + if ($fields[0]['n_family'] && $fields[0]['n_given']) { - $GLOBALS['phpgw']->template->set_var('vcard_button',$this->html_1button_form('VCardForm','VCard', + $this->template->set_var('vcard_button',$this->html_1button_form('VCardForm','VCard', $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$ab_id))); } else { - $GLOBALS['phpgw']->template->set_var('vcard_button',lang('no vcard')); + $this->template->set_var('vcard_button',lang('no vcard')); } - $GLOBALS['phpgw']->template->set_var('done_button',$this->html_1button_form('DoneForm','Done', + $this->template->set_var('done_button',$this->html_1button_form('DoneForm','Done', $referer ? $referer : $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'))); - $GLOBALS['phpgw']->template->set_var('access_link',$access_link); + $this->template->set_var('access_link',$access_link); - $this->output .= $GLOBALS['phpgw']->template->fp('out','view_t'); - $this->totpl(); + $this->template->pfp('phpgw_body','view_t'); $GLOBALS['phpgw']->hooks->process(array( 'location' => 'addressbook_view', @@ -1132,12 +998,11 @@ function preferences() { - $submit = $GLOBALS['HTTP_POST_VARS']['submit']; - $prefs = $GLOBALS['HTTP_POST_VARS']['prefs']; - $other = $GLOBALS['HTTP_POST_VARS']['other']; - $fcat_id = $GLOBALS['HTTP_POST_VARS']['fcat_id']; + $submit = $_POST['submit']; + $prefs = $_POST['prefs']; + $other = $_POST['other']; + $fcat_id = (int) $_POST['fcat_id']; - /* _debug_array($this->prefs); */ $custom = $this->fields->read_custom_fields(); $customfields = array(); while(list($x,$y) = @each($custom)) @@ -1147,139 +1012,149 @@ $qfields = $this->contacts->stock_contact_fields + $this->extrafields + $customfields; - if($submit) + if ($submit) { $totalerrors = 0; - if(!count($prefs)) + if (!count($prefs)) { $errors[$totalerrors++] = lang('You must select at least 1 column to display'); } - if(!$totalerrors) + if (!$totalerrors) { @reset($qfields); $this->bo->save_preferences($prefs,$other,$qfields,$fcat_id); } } - if($totalerrors) + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + if ($totalerrors) { echo '

' . $GLOBALS['phpgw']->common->error_list($errors) . '
'; } - $GLOBALS['phpgw']->template->set_file(array('preferences' => 'preferences.tpl')); + $this->template->set_file(array('preferences' => 'preferences.tpl')); - $GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences')); + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences')); $i = 0; $j = 0; $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - while(list($col, $descr) = each($qfields)) + while (list($col, $descr) = each($qfields)) { /* echo '
test: $col - $i $j - ' . count($abc); */ $i++; $j++; $showcol = $this->display_name($col); - if(!$showcol) - { - $showcol = $col; - } + if (!$showcol) { $showcol = $col; } /* yank the *'s prior to testing for a valid column description */ $coltest = ereg_replace('\*','',$showcol); - if($coltest) + if ($coltest) { - $GLOBALS['phpgw']->template->set_var($col,$showcol); - if($GLOBALS['phpgw_info']['user']['preferences']['addressbook'][$col]) + $this->template->set_var($col,$showcol); + if ($GLOBALS['phpgw_info']['user']['preferences']['addressbook'][$col]) { - $GLOBALS['phpgw']->template->set_var($col.'_checked',' checked'); + $this->template->set_var($col.'_checked',' checked'); } else { - $GLOBALS['phpgw']->template->set_var($col.'_checked',''); + $this->template->set_var($col.'_checked',''); } } } - if($customfields) + if ($customfields) { $custom_var = ' - '.lang('Custom').' '.lang('Fields').': - - + '.lang('Custom Fields').': '; - while(list($cf) = each($customfields)) + $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); + $i = 0; + while( list($cf) = each($customfields) ) { - $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - $custom_var .= "\n" . '' . "\n"; + if (!($i % 6)) + { + $custom_var .= "\n \n"; + } $custom_var .= ' prefs[$cf] ? ' checked' : '') - . '>' . $cf . '' . "\n" - . '' . "\n"; + . '>' . str_replace('_',' ',$cf) . '' . "\n"; + + if (!(++$i % 6)) + { + echo "\n"; + } } - $GLOBALS['phpgw']->template->set_var('custom_fields',$custom_var); + if ($i = 6 - ($i % 6)) + { + $custom_var .= "  \n \n"; + } + $this->template->set_var('custom_fields',$custom_var); } else { - $GLOBALS['phpgw']->template->set_var('custom_fields',''); + $this->template->set_var('custom_fields',''); } $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); - $GLOBALS['phpgw']->template->set_var(tr_color,$tr_color); - $GLOBALS['phpgw']->template->set_var('lang_showbirthday',lang('show birthday reminders on main screen')); + $this->template->set_var(tr_color,$tr_color); + $this->template->set_var('lang_showbirthday',lang('show birthday reminders on main screen')); - if($this->prefs['mainscreen_showbirthdays']) + if ($this->prefs['mainscreen_showbirthdays']) { - $GLOBALS['phpgw']->template->set_var('show_birthday',' checked'); + $this->template->set_var('show_birthday',' checked'); } else { - $GLOBALS['phpgw']->template->set_var('show_birthday',''); + $this->template->set_var('show_birthday',''); } $list = array( - '' => lang('All'), - 'private' => lang('Private'), - 'blank' => lang('Blank') + 'none' => lang('Show all'), + 'yours' => lang('Only yours'), + 'private' => lang('Private') /*, + 'blank' => lang('Blank') */ ); - $GLOBALS['phpgw']->template->set_var('lang_default_filter',lang('Default Filter')); - $GLOBALS['phpgw']->template->set_var('filter_select',$this->formatted_list('other[default_filter]',$list,$this->prefs['default_filter'])); + $this->template->set_var('lang_default_filter',lang('Default Filter')); + $this->template->set_var('filter_select',$this->formatted_list('other[default_filter]',$list,$this->prefs['default_filter'])); - $GLOBALS['phpgw']->template->set_var('lang_autosave',lang('Autosave default category')); - if($this->prefs['autosave_category']) + $this->template->set_var('lang_autosave',lang('Autosave default category')); + if ($this->prefs['autosave_category']) { - $GLOBALS['phpgw']->template->set_var('autosave',' checked'); + $this->template->set_var('autosave',' checked'); } else { - $GLOBALS['phpgw']->template->set_var('autosave',''); + $this->template->set_var('autosave',''); } - $GLOBALS['phpgw']->template->set_var('lang_defaultcat',lang('Default Category')); - $GLOBALS['phpgw']->template->set_var('cat_select',$this->cat_option($this->prefs['default_category'])); - $GLOBALS['phpgw']->template->set_var('lang_abprefs',lang('Addressbook').' '.lang('Preferences')); - $GLOBALS['phpgw']->template->set_var('lang_fields',lang('Fields to show in address list')); - $GLOBALS['phpgw']->template->set_var('lang_personal',lang('Personal')); - $GLOBALS['phpgw']->template->set_var('lang_business',lang('Business')); - $GLOBALS['phpgw']->template->set_var('lang_home',lang('Home')); - $GLOBALS['phpgw']->template->set_var('lang_phones',lang('Extra').' '.lang('Phone Numbers')); - $GLOBALS['phpgw']->template->set_var('lang_other',lang('Other').' '.lang('Fields')); - $GLOBALS['phpgw']->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences')); - $GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit')); - $GLOBALS['phpgw']->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']); - $GLOBALS['phpgw']->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); - $GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']); + $this->template->set_var('lang_defaultcat',lang('Default Category')); + $this->template->set_var('cat_select',$this->cat_option($this->prefs['default_category'], false, false)); + $this->template->set_var('lang_abprefs',lang('Addressbook').' '.lang('Preferences')); + $this->template->set_var('lang_fields',lang('Fields to show in address list')); + $this->template->set_var('lang_personal',lang('Personal')); + $this->template->set_var('lang_business',lang('Business')); + $this->template->set_var('lang_home',lang('Home')); + $this->template->set_var('lang_phones',lang('Extra').' '.lang('Phone Numbers')); + $this->template->set_var('lang_other',lang('Other').' '.lang('Fields')); + $this->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences')); + $this->template->set_var('lang_submit',lang('submit')); + $this->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); + $this->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']); + $this->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); + $this->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']); - $this->output .= $GLOBALS['phpgw']->template->parse('out','preferences'); - $this->totpl(); + $this->template->pparse('out','preferences'); } function get_form() { - $entry = $GLOBALS['HTTP_POST_VARS']['entry']; - $fcat_id = $GLOBALS['HTTP_POST_VARS']['fcat_id']; - $referer = $entry['referer'] ? $entry['referer'] : $GLOBALS['HTTP_GET_VARS']['referer']; - $referer = $referer ? $referer : $GLOBALS['HTTP_POST_VARS']['referer']; + $entry = $_POST['entry']; + $fcat_id = $_POST['fcat_id']; + $referer = $entry['referer'] ? $entry['referer'] : $_GET['referer']; + $referer = $referer ? $referer : $_POST['referer']; $test = @unserialize(rawurldecode($entry)); if($test && ($test != $entry)) @@ -1288,14 +1163,14 @@ } /* _debug_array($entry); exit; */ - if(!$entry['bday_month'] && !$entry['bday_day'] && !$entry['bday_year']) + if (!$entry['bday_month'] && !$entry['bday_day'] && !$entry['bday_year']) { $fields['bday'] = ''; } else { $bday_day = $entry['bday_day']; - if(strlen($bday_day) == 1) + if (strlen($bday_day) == 1) { $bday_day = '0' . $entry['bday_day']; } @@ -1305,6 +1180,7 @@ $fields['url'] = $entry['url'] == 'http://' ? '' : $entry['url']; + $fields['lid'] = $entry['lid']; $fields['org_name'] = $entry['company']; $fields['org_unit'] = $entry['department']; $fields['n_given'] = $entry['firstname']; @@ -1312,9 +1188,9 @@ $fields['n_middle'] = $entry['middle']; $fields['n_prefix'] = $entry['prefix']; $fields['n_suffix'] = $entry['suffix']; - if($entry['prefix']) { $pspc = ' '; } - if($entry['middle']) { $mspc = ' '; } else { $nspc = ' '; } - if($entry['suffix']) { $sspc = ' '; } + if ($entry['prefix']) { $pspc = ' '; } + if ($entry['middle']) { $mspc = ' '; } else { $nspc = ' '; } + if ($entry['suffix']) { $sspc = ' '; } $fields['fn'] = $entry['prefix'].$pspc.$entry['firstname'].$nspc.$mspc.$entry['middle'].$mspc.$entry['lastname'].$sspc.$entry['suffix']; $fields['email'] = $entry['email']; $fields['email_type'] = $entry['email_type']; @@ -1384,7 +1260,7 @@ $custom = $this->fields->read_custom_fields(); while(list($name,$val) = @each($custom)) { - @$fields[$name] = $entry[$val]; + $fields[$val['name']] = $entry[$val['name']]; } $fields['ophone'] = $entry['ophone']; @@ -1393,7 +1269,7 @@ $fields['note'] = $entry['notes']; $fields['label'] = $entry['label']; - if($entry['access'] == True) + if ($entry['access'] == True) { $fields['access'] = 'private'; } @@ -1402,7 +1278,7 @@ $fields['access'] = 'public'; } - if(is_array($fcat_id)) + if (is_array($fcat_id)) { $fields['cat_id'] = count($fcat_id) > 1 ? ','.implode(',',$fcat_id).',' : $fcat_id[0]; } @@ -1413,7 +1289,7 @@ $fields['ab_id'] = $entry['ab_id']; $fields['tid'] = $entry['tid']; - if(!$fields['tid']) + if (!$fields['tid']) { $fields['tid'] = 'n'; } @@ -1426,11 +1302,11 @@ /* Following used for add/edit */ function addressbook_form($format,$action,$title='',$fields='',$customfields='',$cat_id='') { - $referer = $GLOBALS['HTTP_GET_VARS']['referer'] ? $GLOBALS['HTTP_GET_VARS']['referer'] : $GLOBALS['HTTP_POST_VARS']['referer']; + $referer = $_GET['referer'] ? $_GET['referer'] : $_POST['referer']; - $GLOBALS['phpgw']->template->set_file(array('form' => 'form.tpl')); + $this->template->set_file(array('form' => 'form.tpl')); - if(($GLOBALS['phpgw_info']['server']['countrylist'] == 'user_choice' && + if ( ($GLOBALS['phpgw_info']['server']['countrylist'] == 'user_choice' && $GLOBALS['phpgw_info']['user']['preferences']['common']['countrylist'] == 'use_select') || ($GLOBALS['phpgw_info']['server']['countrylist'] == 'force_select')) { @@ -1497,7 +1373,7 @@ } $cats_link = $this->cat_option($cat_id,True,False,True); - if($access == 'private') + if ($access == 'private') { $access_check = ' checked'; } @@ -1506,7 +1382,7 @@ $access_check = ''; } - if($customfields) + if ($customfields) { while(list($name,$value) = each($customfields)) { @@ -1521,24 +1397,24 @@ } } - if($format != "view") + if ($format != "view") { /* Preferred phone number radio buttons */ $pref[0] = ''; $pref[1] = '(' . lang('pref') . ')'; - while(list($name,$val) = each($this->contacts->tel_types)) + while (list($name,$val) = each($this->contacts->tel_types)) { $str[$name] = "\n".' template->set_var("pref_".$name,$str[$name]); + $this->template->set_var("pref_".$name,$str[$name]); } - if(strlen($bday) > 2) + if (strlen($bday) > 2) { list( $month, $day, $year ) = split( '/', $bday ); $temp_month[$month] = ' selected'; @@ -1582,14 +1458,14 @@ } $time_zone = '' . "\n"; $email_type = ''; reset($this->contacts->email_types); $hemail_type = ''; reset($this->contacts->adr_types); - while(list($type,$val) = each($this->contacts->adr_types)) + while (list($type,$val) = each($this->contacts->adr_types)) { $badrtype .= "\n".'contacts->adr_types); - while(list($type,$val) = each($this->contacts->adr_types)) + while (list($type,$val) = each($this->contacts->adr_types)) { $hadrtype .= "\n".''; - if($bday == '//') + if ($bday == '//') { $bday = ''; } } - if($action) + if ($action) { echo '
'; } - if(!ereg('^http://',$url)) + if (!ereg('^http://',$url)) { $url = 'http://' . $url; } $birthday = $GLOBALS['phpgw']->common->dateformatorder($bday_year,$bday_month,$bday_day) . '(e.g. 1969)'; - if($format == 'edit') + if ($format == 'edit') { $create .= '' . lang("Created by") . ':' . '' @@ -1688,137 +1558,137 @@ $create .= ''; } - $GLOBALS['phpgw']->template->set_var('lang_home',lang('Home')); - $GLOBALS['phpgw']->template->set_var('lang_business',lang('Business')); - $GLOBALS['phpgw']->template->set_var('lang_personal',lang('Personal')); + $this->template->set_var('lang_home',lang('Home')); + $this->template->set_var('lang_business',lang('Business')); + $this->template->set_var('lang_personal',lang('Personal')); - $GLOBALS['phpgw']->template->set_var('lang_lastname',lang('Last Name')); - $GLOBALS['phpgw']->template->set_var('lastname',$lastname); - $GLOBALS['phpgw']->template->set_var('lang_firstname',lang('First Name')); - $GLOBALS['phpgw']->template->set_var('firstname',$firstname); - $GLOBALS['phpgw']->template->set_var('lang_middle',lang('Middle Name')); - $GLOBALS['phpgw']->template->set_var('middle',$middle); - $GLOBALS['phpgw']->template->set_var('lang_prefix',lang('Prefix')); - $GLOBALS['phpgw']->template->set_var('prefix',$prefix); - $GLOBALS['phpgw']->template->set_var('lang_suffix',lang('Suffix')); - $GLOBALS['phpgw']->template->set_var('suffix',$suffix); - $GLOBALS['phpgw']->template->set_var('lang_birthday',lang('Birthday')); - $GLOBALS['phpgw']->template->set_var('birthday',$birthday); + $this->template->set_var('lang_lastname',lang('Last Name')); + $this->template->set_var('lastname',$lastname); + $this->template->set_var('lang_firstname',lang('First Name')); + $this->template->set_var('firstname',$firstname); + $this->template->set_var('lang_middle',lang('Middle Name')); + $this->template->set_var('middle',$middle); + $this->template->set_var('lang_prefix',lang('Prefix')); + $this->template->set_var('prefix',$prefix); + $this->template->set_var('lang_suffix',lang('Suffix')); + $this->template->set_var('suffix',$suffix); + $this->template->set_var('lang_birthday',lang('Birthday')); + $this->template->set_var('birthday',$birthday); - $GLOBALS['phpgw']->template->set_var('lang_company',lang('Company Name')); - $GLOBALS['phpgw']->template->set_var('company',$company); - $GLOBALS['phpgw']->template->set_var('lang_department',lang('Department')); - $GLOBALS['phpgw']->template->set_var('department',$department); - $GLOBALS['phpgw']->template->set_var('lang_title',lang('Title')); - $GLOBALS['phpgw']->template->set_var('title',$title); - $GLOBALS['phpgw']->template->set_var('lang_email',lang('Business Email')); - $GLOBALS['phpgw']->template->set_var('email',$email); - $GLOBALS['phpgw']->template->set_var('lang_email_type',lang('Business EMail Type')); - $GLOBALS['phpgw']->template->set_var('email_type',$email_type); - $GLOBALS['phpgw']->template->set_var('lang_url',lang('URL')); - $GLOBALS['phpgw']->template->set_var('url',$url); - $GLOBALS['phpgw']->template->set_var('lang_timezone',lang('time zone offset')); - $GLOBALS['phpgw']->template->set_var('timezone',$time_zone); - $GLOBALS['phpgw']->template->set_var('lang_fax',lang('Business Fax')); - $GLOBALS['phpgw']->template->set_var('fax',$fax); - $GLOBALS['phpgw']->template->set_var('lang_wphone',lang('Business Phone')); - $GLOBALS['phpgw']->template->set_var('wphone',$wphone); - $GLOBALS['phpgw']->template->set_var('lang_pager',lang('Pager')); - $GLOBALS['phpgw']->template->set_var('pager',$pager); - $GLOBALS['phpgw']->template->set_var('lang_mphone',lang('Cell Phone')); - $GLOBALS['phpgw']->template->set_var('mphone',$mphone); - $GLOBALS['phpgw']->template->set_var('lang_msgphone',lang('Message Phone')); - $GLOBALS['phpgw']->template->set_var('msgphone',$msgphone); - $GLOBALS['phpgw']->template->set_var('lang_isdnphone',lang('ISDN Phone')); - $GLOBALS['phpgw']->template->set_var('isdnphone',$isdnphone); - $GLOBALS['phpgw']->template->set_var('lang_carphone',lang('Car Phone')); - $GLOBALS['phpgw']->template->set_var('carphone',$carphone); - $GLOBALS['phpgw']->template->set_var('lang_vidphone',lang('Video Phone')); - $GLOBALS['phpgw']->template->set_var('vidphone',$vidphone); + $this->template->set_var('lang_company',lang('Company Name')); + $this->template->set_var('company',$company); + $this->template->set_var('lang_department',lang('Department')); + $this->template->set_var('department',$department); + $this->template->set_var('lang_title',lang('Title')); + $this->template->set_var('title',$title); + $this->template->set_var('lang_email',lang('Business Email')); + $this->template->set_var('email',$email); + $this->template->set_var('lang_email_type',lang('Business EMail Type')); + $this->template->set_var('email_type',$email_type); + $this->template->set_var('lang_url',lang('URL')); + $this->template->set_var('url',$url); + $this->template->set_var('lang_timezone',lang('time zone offset')); + $this->template->set_var('timezone',$time_zone); + $this->template->set_var('lang_fax',lang('Business Fax')); + $this->template->set_var('fax',$fax); + $this->template->set_var('lang_wphone',lang('Business Phone')); + $this->template->set_var('wphone',$wphone); + $this->template->set_var('lang_pager',lang('Pager')); + $this->template->set_var('pager',$pager); + $this->template->set_var('lang_mphone',lang('Cell Phone')); + $this->template->set_var('mphone',$mphone); + $this->template->set_var('lang_msgphone',lang('Message Phone')); + $this->template->set_var('msgphone',$msgphone); + $this->template->set_var('lang_isdnphone',lang('ISDN Phone')); + $this->template->set_var('isdnphone',$isdnphone); + $this->template->set_var('lang_carphone',lang('Car Phone')); + $this->template->set_var('carphone',$carphone); + $this->template->set_var('lang_vidphone',lang('Video Phone')); + $this->template->set_var('vidphone',$vidphone); - $GLOBALS['phpgw']->template->set_var('lang_ophone',lang('Other Number')); - $GLOBALS['phpgw']->template->set_var('ophone',$ophone); - $GLOBALS['phpgw']->template->set_var('lang_bstreet',lang('Business Street')); - $GLOBALS['phpgw']->template->set_var('bstreet',$bstreet); - $GLOBALS['phpgw']->template->set_var('lang_address2',lang('Address Line 2')); - $GLOBALS['phpgw']->template->set_var('address2',$address2); - $GLOBALS['phpgw']->template->set_var('lang_address3',lang('Address Line 3')); - $GLOBALS['phpgw']->template->set_var('address3',$address3); - $GLOBALS['phpgw']->template->set_var('lang_bcity',lang('Business City')); - $GLOBALS['phpgw']->template->set_var('bcity',$bcity); - $GLOBALS['phpgw']->template->set_var('lang_bstate',lang('Business State')); - $GLOBALS['phpgw']->template->set_var('bstate',$bstate); - $GLOBALS['phpgw']->template->set_var('lang_bzip',lang('Business Zip Code')); - $GLOBALS['phpgw']->template->set_var('bzip',$bzip); - $GLOBALS['phpgw']->template->set_var('lang_bcountry',lang('Business Country')); - $GLOBALS['phpgw']->template->set_var('bcountry',$bcountry); - if($countrylist) + $this->template->set_var('lang_ophone',lang('Other Number')); + $this->template->set_var('ophone',$ophone); + $this->template->set_var('lang_bstreet',lang('Business Street')); + $this->template->set_var('bstreet',$bstreet); + $this->template->set_var('lang_address2',lang('Address Line 2')); + $this->template->set_var('address2',$address2); + $this->template->set_var('lang_address3',lang('Address Line 3')); + $this->template->set_var('address3',$address3); + $this->template->set_var('lang_bcity',lang('Business City')); + $this->template->set_var('bcity',$bcity); + $this->template->set_var('lang_bstate',lang('Business State')); + $this->template->set_var('bstate',$bstate); + $this->template->set_var('lang_bzip',lang('Business Zip Code')); + $this->template->set_var('bzip',$bzip); + $this->template->set_var('lang_bcountry',lang('Business Country')); + $this->template->set_var('bcountry',$bcountry); + if ($countrylist) { - $GLOBALS['phpgw']->template->set_var('bcountry',$GLOBALS['phpgw']->country->form_select($bcountry,'entry[bcountry]')); + $this->template->set_var('bcountry',$GLOBALS['phpgw']->country->form_select($bcountry,'entry[bcountry]')); } else { - $GLOBALS['phpgw']->template->set_var('bcountry',''); + $this->template->set_var('bcountry',''); } - $GLOBALS['phpgw']->template->set_var('lang_badrtype',lang('Address Type')); - $GLOBALS['phpgw']->template->set_var('badrtype',$badrtype); + $this->template->set_var('lang_badrtype',lang('Address Type')); + $this->template->set_var('badrtype',$badrtype); - $GLOBALS['phpgw']->template->set_var('lang_hphone',lang('Home Phone')); - $GLOBALS['phpgw']->template->set_var('hphone',$hphone); - $GLOBALS['phpgw']->template->set_var('lang_hemail',lang('Home Email')); - $GLOBALS['phpgw']->template->set_var('hemail',$hemail); - $GLOBALS['phpgw']->template->set_var('lang_hemail_type',lang('Home EMail Type')); - $GLOBALS['phpgw']->template->set_var('hemail_type',$hemail_type); - $GLOBALS['phpgw']->template->set_var('lang_hstreet',lang('Home Street')); - $GLOBALS['phpgw']->template->set_var('hstreet',$hstreet); - $GLOBALS['phpgw']->template->set_var('lang_hcity',lang('Home City')); - $GLOBALS['phpgw']->template->set_var('hcity',$hcity); - $GLOBALS['phpgw']->template->set_var('lang_hstate',lang('Home State')); - $GLOBALS['phpgw']->template->set_var('hstate',$hstate); - $GLOBALS['phpgw']->template->set_var('lang_hzip',lang('Home Zip Code')); - $GLOBALS['phpgw']->template->set_var('hzip',$hzip); - $GLOBALS['phpgw']->template->set_var('lang_hcountry',lang('Home Country')); - if($countrylist) + $this->template->set_var('lang_hphone',lang('Home Phone')); + $this->template->set_var('hphone',$hphone); + $this->template->set_var('lang_hemail',lang('Home Email')); + $this->template->set_var('hemail',$hemail); + $this->template->set_var('lang_hemail_type',lang('Home EMail Type')); + $this->template->set_var('hemail_type',$hemail_type); + $this->template->set_var('lang_hstreet',lang('Home Street')); + $this->template->set_var('hstreet',$hstreet); + $this->template->set_var('lang_hcity',lang('Home City')); + $this->template->set_var('hcity',$hcity); + $this->template->set_var('lang_hstate',lang('Home State')); + $this->template->set_var('hstate',$hstate); + $this->template->set_var('lang_hzip',lang('Home Zip Code')); + $this->template->set_var('hzip',$hzip); + $this->template->set_var('lang_hcountry',lang('Home Country')); + if ($countrylist) { - $GLOBALS['phpgw']->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]')); + $this->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]')); } else { - $GLOBALS['phpgw']->template->set_var('hcountry',''); + $this->template->set_var('hcountry',''); } - $GLOBALS['phpgw']->template->set_var('lang_hadrtype',lang('Address Type')); - $GLOBALS['phpgw']->template->set_var('hadrtype',$hadrtype); + $this->template->set_var('lang_hadrtype',lang('Address Type')); + $this->template->set_var('hadrtype',$hadrtype); - $GLOBALS['phpgw']->template->set_var('create',$create); - $GLOBALS['phpgw']->template->set_var('lang_notes',lang('notes')); - $GLOBALS['phpgw']->template->set_var('notes',$notes); - $GLOBALS['phpgw']->template->set_var('lang_label',lang('label')); - $GLOBALS['phpgw']->template->set_var('label',$label); - $GLOBALS['phpgw']->template->set_var('lang_pubkey',lang('Public Key')); - $GLOBALS['phpgw']->template->set_var('pubkey',$pubkey); - $GLOBALS['phpgw']->template->set_var('access_check',$access_check); + $this->template->set_var('create',$create); + $this->template->set_var('lang_notes',lang('notes')); + $this->template->set_var('notes',$notes); + $this->template->set_var('lang_label',lang('label')); + $this->template->set_var('label',$label); + $this->template->set_var('lang_pubkey',lang('Public Key')); + $this->template->set_var('pubkey',$pubkey); + $this->template->set_var('access_check',$access_check); - $GLOBALS['phpgw']->template->set_var('lang_private',lang('Private')); + $this->template->set_var('lang_private',lang('Private')); - $GLOBALS['phpgw']->template->set_var('lang_cats',lang('Category')); - $GLOBALS['phpgw']->template->set_var('cats_link',$cats_link); - if($customfields) + $this->template->set_var('lang_cats',lang('Category')); + $this->template->set_var('cats_link',$cats_link); + if ($customfields) { - $GLOBALS['phpgw']->template->set_var('lang_custom',lang('Custom Fields').':'); - $GLOBALS['phpgw']->template->set_var('custom',$custom); + $this->template->set_var('lang_custom',lang('Custom Fields').':'); + $this->template->set_var('custom',$custom); } else { - $GLOBALS['phpgw']->template->set_var('lang_custom',''); - $GLOBALS['phpgw']->template->set_var('custom',''); + $this->template->set_var('lang_custom',''); + $this->template->set_var('custom',''); } - $GLOBALS['phpgw']->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']); - $GLOBALS['phpgw']->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); - $GLOBALS['phpgw']->template->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']); - $GLOBALS['phpgw']->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']); + $this->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); + $this->template->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']); + $this->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); + $this->template->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']); + $this->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']); - $this->output .= $GLOBALS['phpgw']->template->fp('out','form'); + $this->template->pfp('out','form'); } /* end form function */ } ?> diff --git a/addressbook/inc/class.uifields.inc.php b/addressbook/inc/class.uifields.inc.php index 2da9f8ad32..562ead7612 100644 --- a/addressbook/inc/class.uifields.inc.php +++ b/addressbook/inc/class.uifields.inc.php @@ -24,8 +24,8 @@ function uifields() { -// $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); -// $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); + $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); $this->config = CreateObject('phpgwapi.config','addressbook'); } @@ -34,9 +34,9 @@ if(!$GLOBALS['phpgw']->acl->check('run',1,'admin')) { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo lang('access not permitted'); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } $GLOBALS['phpgw']->template->set_file(array( @@ -80,6 +80,7 @@ $total_records = count($fields); $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $GLOBALS['phpgw']->template->set_var('left',$GLOBALS['phpgw']->nextmatchs->left('/index.php',$start,$total_records,'menuaction=addressbook.uifields.index')); $GLOBALS['phpgw']->template->set_var('right',$GLOBALS['phpgw']->nextmatchs->right('/index.php',$start,$total_records,'menuaction=addressbook.uifields.index')); @@ -128,9 +129,9 @@ if(!$GLOBALS['phpgw']->acl->check('run',1,'admin')) { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo lang('access not permitted'); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } $field = stripslashes($GLOBALS['HTTP_POST_VARS']['field']); @@ -166,6 +167,7 @@ } $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); if($errorcount) { @@ -204,9 +206,9 @@ if(!$GLOBALS['phpgw']->acl->check('run',1,'admin')) { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo lang('access not permitted'); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } $field = stripslashes($GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field']); @@ -245,6 +247,7 @@ } $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); if($errorcount) { @@ -296,9 +299,9 @@ if(!$GLOBALS['phpgw']->acl->check('run',1,'admin')) { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo lang('access not permitted'); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } $field = $GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field']; @@ -320,6 +323,7 @@ else { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $hidden_vars = '' . "\n" . '' . "\n" diff --git a/addressbook/inc/class.uivcard.inc.php b/addressbook/inc/class.uivcard.inc.php index 6d95c6c334..9b35f3dd69 100644 --- a/addressbook/inc/class.uivcard.inc.php +++ b/addressbook/inc/class.uivcard.inc.php @@ -26,7 +26,7 @@ 'out' => True ); - var $extrafields = array( + var $extrafields = array( 'ophone' => 'ophone', 'address2' => 'address2', 'address3' => 'address3' @@ -43,13 +43,14 @@ function in() { - $action = $GLOBALS['HTTP_POST_VARS']['action']; + $action = $GLOBALS['HTTP_POST_VARS']['action'] ? $GLOBALS['HTTP_POST_VARS']['action'] : $GLOBALS['HTTP_GET_VARS']['action']; $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); echo ''; - if($action == 'GetFile') + if ($action == 'GetFile') { echo '
' . lang('You must select a vcard. (*.vcf)') . '


'; } @@ -64,43 +65,39 @@ $this->template->set_var('group_option',$group_option); $this->template->pparse('out','vcardin'); + + $GLOBALS['phpgw']->common->phpgw_footer(); } function out() { - $ab_id = get_var('ab_id',array('GET','POST')); - $nolname = get_var('nolname',array('GET','POST')); - $nofname = get_var('nofname',array('GET','POST')); + $ab_id = $GLOBALS['HTTP_GET_VARS']['ab_id'] ? $GLOBALS['HTTP_GET_VARS']['ab_id'] : $GLOBALS['HTTP_POST_VARS']['ab_id']; + $nolname = $GLOBALS['HTTP_GET_VARS']['nolname']; + $nofname = $GLOBALS['HTTP_GET_VARS']['nofname']; if($nolname || $nofname) { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); } if(!$ab_id) { Header('Location: ' . $GLOBALS['phpgw']->link('/addressbook/index.php')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } // First, make sure they have permission to this entry - $check = $this->bo->read_entry(array( - 'id' => $ab_id, - 'fields' => array( - 'owner' => 'owner' - ) - )); + $check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner'))); $perms = $this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ); - if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) + if ( (!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']) ) { - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + Header("Location: " . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list')); + $GLOBALS['phpgw']->common->phpgw_exit(); } - $extrafields = array('address2' => 'address2'); + $extrafields = array('address2' => 'address2'); $qfields = $this->contacts->stock_contact_fields + $extrafields; $fieldlist = $this->bo->read_entry(array('id' => $ab_id, 'fields' => $qfields)); @@ -127,49 +124,50 @@ if($lastname == '') { /* Run away here. */ - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nolname=1&ab_id=' . $ab_id)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uivcard.out&nolname=1&ab_id=$ab_id")); } if($firstname == '') { - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&nofname=1&ab_id=' . $ab_id)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uivcard.out&nofname=1&ab_id=$ab_id")); } if ($email) { $fn = explode('@',$email); - $filename = sprintf('%s.vcf', $fn[0]); + $filename = sprintf("%s.vcf", $fn[0]); } elseif ($hemail) { $fn = explode('@',$hemail); - $filename = sprintf('%s.vcf', $fn[0]); + $filename = sprintf("%s.vcf", $fn[0]); } else { $fn = strtolower($firstname); - $filename = sprintf('%s.vcf', $fn); + $filename = sprintf("%s.vcf", $fn); } // set translation variable $myexport = $this->vcard->export; // check that each $fields exists in the export array and // set a new array to equal the translation and original value - while(list($name,$value) = each($fields)) + while( list($name,$value) = each($fields) ) { - if($myexport[$name] && ($value != '')) + if ($myexport[$name] && ($value != "") ) { - //echo '
'.$name.'='.$fields[$name]."\n"; + //echo '
'.$name."=".$fields[$name]."\n"; $buffer[$myexport[$name]] = $value; } } // create a vcard from this translated array - $entry = $this->vcard->out($buffer); + $entry = $this->vcard->out($buffer); // print it using browser class for headers // filename, mimetype, no length, default nocache True $this->browser->content_header($filename,'text/x-vcard'); echo $entry; - $GLOBALS['phpgw']->common->exit; + exit; + //$GLOBALS['phpgw']->common->exit; } /* !nolname && !nofname */ if($nofname) @@ -177,7 +175,8 @@ echo '

'; echo lang("This person's first name was not in the address book.") .'
'; echo lang('Vcards require a first name entry.') . '

'; - echo '
' . lang('OK') . ''; + echo '' . lang('OK') . ''; echo '
'; } @@ -186,9 +185,15 @@ echo '

'; echo lang("This person's last name was not in the address book.") . '
'; echo lang('Vcards require a last name entry.') . '

'; - echo '' . lang('OK') . ''; + echo '' . lang('OK') . ''; echo '
'; } + + if($nolname || $nofname) + { + //$GLOBALS['phpgw']->common->phpgw_footer(); + } } } ?> diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php index cba49654ef..4dcc53672f 100755 --- a/addressbook/inc/functions.inc.php +++ b/addressbook/inc/functions.inc.php @@ -43,8 +43,6 @@ /* Return a select form element with the categories option dialog in it */ function cat_option($cat_id='',$notall=False,$java=True,$multiple=False) { - global $phpgw; - if ($java) { $jselect = ' onChange="this.form.submit();"'; @@ -62,7 +60,7 @@ } /* Get global and app-specific category listings */ - $cats_link .= $phpgw->categories->formatted_list('select','all',$cat_id,True); + $cats_link .= $GLOBALS['phpgw']->categories->formated_list('select','all',$cat_id,True); $cats_link .= ''."\n"; return $cats_link; } @@ -134,12 +132,10 @@ function read_custom_fields() { - global $phpgw_info; - $i = 0; $j = 0; $fields = array(); - @reset($phpgw_info['user']['preferences']['addressbook']); - while (list($col,$descr) = @each($phpgw_info['user']['preferences']['addressbook'])) + @reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']); + while (list($col,$descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook'])) { if ( substr($col,0,6) == 'extra_' ) { @@ -166,17 +162,15 @@ function save_custom_field($old='',$new='') { - global $phpgw,$phpgw_info; - - $phpgw->preferences->read_repository($phpgw_info['user']['account_id']); + $GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']); if ($old) { - $phpgw->preferences->delete("addressbook","extra_".$old); + $GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old); } if($new) { - $phpgw->preferences->add("addressbook","extra_".$new); + $GLOBALS['phpgw']->preferences->add("addressbook","extra_".$new); } - $phpgw->preferences->save_repository(1); + $GLOBALS['phpgw']->preferences->save_repository(1); } ?> diff --git a/addressbook/inc/hook_admin.inc.php b/addressbook/inc/hook_admin.inc.php index d13b4665a9..290e519306 100644 --- a/addressbook/inc/hook_admin.inc.php +++ b/addressbook/inc/hook_admin.inc.php @@ -2,24 +2,24 @@ /**************************************************************************\ * phpGroupWare * * http://www.phpgroupware.org * - * Written by coreteam * - * ----------------------------------------------------- * + * Written by Joseph Engo * + * -------------------------------------------- * * 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$ */ - { -// Only Modify the $file variable..... - $file = Array - ( - 'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname), - 'Edit custom fields' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'), - 'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname . '&global_cats=True') - ); -//Do not modify below this line - $GLOBALS['phpgw']->common->display_mainscreen($appname,$file); - } -?> + // $Id$ + // $Source$ + + // Only Modify the $file and $title variables..... + $title = $appname; + $file = Array( + 'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname), + 'Edit custom fields' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'), + 'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=addressbook') + ); + //Do not modify below this line + display_section($appname,$title,$file); +?> \ No newline at end of file diff --git a/addressbook/inc/hook_help.inc.php b/addressbook/inc/hook_help.inc.php deleted file mode 100644 index 8191bc9918..0000000000 --- a/addressbook/inc/hook_help.inc.php +++ /dev/null @@ -1,41 +0,0 @@ -help->set_params(array('app_name' => 'addressbook', - 'title' => lang('addressbook'), - 'app_version' => $setup_info['addressbook']['version'])); - - $GLOBALS['phpgw']->help->data[] = array - ( - 'text' => lang('owerview'), - 'link' => $GLOBALS['phpgw']->help->check_help_file('overview.php'), - 'lang_link_statustext' => lang('owerview') - ); - - $GLOBALS['phpgw']->help->data[] = array - ( - 'text' => lang('list'), - 'link' => $GLOBALS['phpgw']->help->check_help_file('list.php'), - 'lang_link_statustext' => lang('list') - ); - - $GLOBALS['phpgw']->help->data[] = array - ( - 'text' => lang('add'), - 'link' => $GLOBALS['phpgw']->help->check_help_file('add.php'), - 'lang_link_statustext' => lang('add') - ); - - $GLOBALS['phpgw']->help->draw(); -?> diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index 4e8471b86a..da604e7ddf 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -1,55 +1,83 @@ \n"; - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } unset($d1); if ($GLOBALS['phpgw_info']['user']['apps']['addressbook'] && $GLOBALS['phpgw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays']) { + echo "\n\n"; + $c = CreateObject('phpgwapi.contacts'); - $qfields = array - ( + $qfields = array( 'n_given' => 'n_given', 'n_family' => 'n_family', 'bday' => 'bday' ); $now = time() - ((60 * 60) * intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])); $today = $GLOBALS['phpgw']->common->show_date($now,'n/d/'); - + $bdays = $c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']); + + $title = '
'.lang('Birthdays').'
'; + $portalbox = CreateObject('phpgwapi.listbox', + Array( + 'title' => $title, + 'primary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], + 'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], + 'tertiary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'], + 'width' => '100%', + 'outerborderwidth' => '0', + 'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler') + ) + ); $app_id = $GLOBALS['phpgw']->applications->name2id('addressbook'); $GLOBALS['portal_order'][] = $app_id; + $var = Array( + 'up' => Array('url' => '/set_box.php', 'app' => $app_id), + 'down' => Array('url' => '/set_box.php', 'app' => $app_id), + 'close' => Array('url' => '/set_box.php', 'app' => $app_id), + 'question' => Array('url' => '/set_box.php', 'app' => $app_id), + 'edit' => Array('url' => '/set_box.php', 'app' => $app_id) + ); + + while(list($key,$value) = each($var)) + { + $portalbox->set_controls($key,$value); + } + + $portalbox->data = Array(); - $GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id, - 'title' => lang('addressbook'))); while(list($key,$val) = @each($bdays)) { if (substr($val['bday'],0,strlen($today)) == $today) { - $GLOBALS['phpgw']->portalbox->data[] = array - ( - 'text' => lang("Today is %1's birthday!", $val['n_given'] . ' ' . $val['n_family']), - 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']), - 'lang_link_statustext' => lang('show contact') + $portalbox->data[] = array( + 'text' => lang("Today is %1's birthday!", $val['n_given'] . ' ' . $val['n_family']), + 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']) ); } +// $tmp = '' +// . $val['n_given'] . ' ' . $val['n_family'] . ''; +// echo '' . lang("Today is %1's birthday!", $tmp) . '' . "\n"; } $tomorrow = $GLOBALS['phpgw']->common->show_date($now + 86400,'n/d/'); @@ -60,14 +88,21 @@ { if (substr($val['bday'],0,strlen($tomorrow)) == $tomorrow) { - $GLOBALS['phpgw']->portalbox->data[] = array - ( - 'text' => lang("Tomorrow is %1's birthday.", $val['n_given'] . ' ' . $val['n_family']), - 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']), - 'lang_link_statustext' => lang('show contact') + $portalbox->data[] = array( + 'text' => lang("Tomorrow is %1's birthday.",$val['n_given'] . ' ' . $val['n_family']), + 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']) ); } +// $tmp = '' +// . $val['n_given'] . ' ' . $val["n_family"] . ''; +// echo '' . lang("Tomorrow is %1's birthday.", $tmp) . '' . "\n"; } - $GLOBALS['phpgw']->portalbox->draw(); + if(count($portalbox->data)) + { + echo $portalbox->draw(); + } + unset($portalbox); + echo "\n\n"; } ?> diff --git a/addressbook/inc/hook_manual.inc.php b/addressbook/inc/hook_manual.inc.php new file mode 100755 index 0000000000..365e315b61 --- /dev/null +++ b/addressbook/inc/hook_manual.inc.php @@ -0,0 +1,19 @@ + * + * -------------------------------------------- * + * 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$ */ + +// Only Modify the $file variable..... + $file = Array(); +//Do not modify below this line + display_manual_section($appname,$file); +?> diff --git a/addressbook/inc/hook_notifywindow.inc.php b/addressbook/inc/hook_notifywindow.inc.php index eb4f0a4bc2..7e49f68309 100644 --- a/addressbook/inc/hook_notifywindow.inc.php +++ b/addressbook/inc/hook_notifywindow.inc.php @@ -15,8 +15,7 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo "Failed attempt to break in via an old Security Hole!
\n"; - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } unset($d1); diff --git a/addressbook/index.php b/addressbook/index.php index 47c69e63e6..62e54f74d3 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -1,10 +1,10 @@ * - * and Miles Lott * + * -------------------------------------------- * + * Funding for this program was provided by http://www.checkwithmom.com * * -------------------------------------------- * * 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 * @@ -17,10 +17,14 @@ $GLOBALS['phpgw_info'] = array(); $GLOBALS['phpgw_info']['flags'] = array( - 'currentapp' => 'addressbook' + 'currentapp' => 'addressbook', + 'noheader' => True, + 'nonavbar' => True ); include('../header.inc.php'); $obj = CreateObject('addressbook.uiaddressbook'); $obj->index(); + + $GLOBALS['phpgw']->common->phpgw_footer(); ?> diff --git a/addressbook/setup/phpgw_de.lang b/addressbook/setup/phpgw_de.lang index 641c9a515a..5c465c8b80 100644 --- a/addressbook/setup/phpgw_de.lang +++ b/addressbook/setup/phpgw_de.lang @@ -1,15 +1,19 @@ +%1 records imported addressbook de %1 Datensätze importiert +%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook de %1 Datensätze gelesen (noch nicht importiert, sie können %2zurück%3 gehen und Test-Import auschalten) no conversion type <none> could be located. please choose a conversion type from the list addressbook de Kein Übersetzungstyp <none> konnte gefunden werden. Bitte wählen Sie einen Übersetzungstype aus der Liste -no conversion type could be located. please choose a conversion type from the list addressbook de Kein Übersetzungstyp <none> konnte gefunden werden. Bitte wählen Sie einen Übersetzungstype aus der Liste +@-eval() is only availible to admins!!! addressbook de @-eval() ist nur verfügbar für Administratoren!!! +add a single entry by passing the fields. addressbook de Hinzufügen eines einzelnen Eintrags durch Übergeben der Felder. add custom field addressbook de Benutzerdefiniertes Feld hinzufügen address book common de Adressbuch +address book - vcard in addressbook de Adressbuch - VCard in address book - view addressbook de Adressbuch - Anzeigen address line 2 addressbook de Adreßzeile 2 address line 3 addressbook de Adreßzeile 3 address type addressbook de Adreßtyp addressbook common de Adressbuch addressbook preferences addressbook de Adressbuch Einstellungen +addressbook-fieldname addressbook de Adressbuch Feldname addvcard addressbook de VCard hinzufügen -alphabet addressbook de a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z alt. csv import addressbook de Alt. CSV Import are you sure you want to delete this field? addressbook de Sind Sie sicher, dass sie dieses Feld löschen wollen? bbs phone addressbook de BBS @@ -35,27 +39,32 @@ company name common de Firmenname contact common de Kontakt contact application admin de Kontakt Anwendung contact settings admin de Kontakt Einstellungen +copied by %1, from record #%2. addressbook de Kopiert von %1, vom Datensatz Nr. %2. country common de Land +csv-fieldname addressbook de CSV-Feldname +csv-filename addressbook de CSV-Dateiname custom addressbook de Benutzerdefiniert custom fields addressbook de Benutzerdefinierte Felder -debug output in browser addressbook de Ausgaben zur Fehlersuche im Webbrowser +debug output in browser addressbook de Debugausgaben in Browser default filter addressbook de Standardfilter +delete a single entry by passing the id. addressbook de Löscht einen einzelnen Eintrag durch Übergabe seiner Id. department common de Abteilung domestic addressbook de Wohnung -download export file (uncheck to debug output in browser) addressbook de Exportdatei herunterladen (nicht auswählen um eine Test-Ausgabe im Browser zu bekommen) +download addressbook de Herunterladen edit custom field addressbook de Benutzerdefiniertes Feld bearbeiten edit custom fields admin de Benutzerdefinierte Felder bearbeiten -enable remote search admin de Fern-Suche zulassen -enter the path to the export file here addressbook de Geben Sie hier den Pfad zur exportierent Datei an export contacts addressbook de Kontakte exportieren export file name addressbook de Dateiname zum Exportieren +export from addressbook addressbook de Export vom Addressbuch extra addressbook de Extra fax addressbook de Telefax fax number common de Telefaxnummer -field name addressbook de Feldname field %1 has been added ! addressbook de Feld %1 wurde hinzugefügt ! +field %1 has been updated ! addressbook de Feld %1 wurde aktualisiert ! +field name addressbook de Feldname fields addressbook de Felder fields to show in address list addressbook de Felder, die in der Adressliste angezeigt werden sollen +fieldseparator addressbook de Feldtrenner full name addressbook de vollständiger Name geo addressbook de GEO grant addressbook access common de Berechtigungen @@ -68,10 +77,12 @@ home phone addressbook de Tel privat home state addressbook de Land (priv) home street addressbook de Straße (priv) home zip code addressbook de PLZ (priv) +import addressbook de Import import contacts addressbook de Kontakte importieren +import csv-file into addressbook addressbook de Import CSV-Datei ins Addressbuch import file addressbook de Datei importieren +import from ldif, csv, or vcard addressbook de Import von LDIF, CSV oder VCard import from outlook addressbook de Aus Outlook importieren -in netscape, open the addressbook and select export from the file menu.
the file exported will be in ldif format.

or, in outlook, select your contacts folder, select import and export... from addressbook de international addressbook de International isdn phone addressbook de ISDN Tel. label addressbook de Adreßetikett @@ -79,15 +90,16 @@ ldap context for contacts admin de LDAP Kontext f ldap host for contacts admin de LDAP Host für Kontakte ldap root dn for contacts admin de LDAP rootdn für Kontakte ldap root pw for contacts admin de LDAP Paswort für Kontakte +ldif addressbook de LDIF line 2 addressbook de Zeile 2 -mark records as private addressbook de Einträge als privat markieren message phone addressbook de Anrufbeantworter middle name addressbook de Zweiter Vorname mobile addressbook de Mobil mobile phone addressbook de Mobil-Telefon modem phone addressbook de Modem no vcard addressbook de Keine VCard -none addressbook de keine +number of records to read (<=200) addressbook de Nummer der einzulesenden Datensätze (<= 200) +on addressbook de an other addressbook de Andere other number addressbook de andere Nr. other phone addressbook de Anderes Telefon @@ -96,182 +108,43 @@ parcel addressbook de Lieferadresse personal addressbook de Persönlich phone number common de Telefon phone numbers common de Telefonnummern +please enter a name for that field ! addressbook de Bitte geben sie einen Namen für das Feld an ! +please select addressbook de Bitte auswählen postal common de Postanschrift pref addressbook de pref prefix addressbook de Prefix public key addressbook de öffentlicher Schlüssel +read a list of entries. addressbook de Liest eine Liste von Einträgen. +read a single entry by passing the id and fieldlist. addressbook de Liest einen einzelnen Eintrag über seine Id und Feldliste. +read this list of methods. addressbook de Liest diese Liste der Methoden. record access addressbook de Zugriffsrechte record owner addressbook de Datensatz Eigentümer retrieve contacts admin de Kontakte laden -select the type of conversion addressbook de Art der Umsetzung auswählen +select addressbook de Auswählen select where you want to store admin de Auswählen wo Sie speichern wollen show birthday reminders on main screen addressbook de Geburtstags-Mahner auf der Startseite anzeigen +startrecord addressbook de Startdatensatz state common de Land street common de Straße successfully imported %1 records into your addressbook. addressbook de %1 Kontakte wurden erfolgreich in ihr Adressbuch importiert suffix addressbook de Zusatz -the file menu and export your contacts into a comma separated text (csv) file.

or, in palm desktop 4.0 or greater, visit your addressbook and select export from the file menu. the file exported will be in vcard format.

addressbook de +test import (show importable records only in browser) addressbook de Test-Import (zeigt importierbare Datensätze nur im Browser an) +that field name has been used already ! addressbook de Dieser Feldname wird bereits benutzt ! this person's first name was not in the address book. addressbook de Der Vorname dieser Person ist nicht im Adressbuch. +this person's last name was not in the address book. addressbook de Der Nachname dieser Person ist nicht im Adressbuch. today is %1's birthday! common de Heute ist der Geburtstag von %1! tomorrow is %1's birthday. common de Morgen ist der Geburtstag von %1. +translation addressbook de Übersetzung +update a single entry by passing the fields. addressbook de Aktualisiert einen einzelnen Eintrag durch Übergabe seiner Felder. +use country list addressbook de Länderliste benutzen vcard common de VCard vcards require a first name entry. addressbook de VCards benötigen einen Vornamen. +vcards require a last name entry. addressbook de VCards benötigen einen Nachnamen. video phone addressbook de Bildtelefon voice phone addressbook de Telefon warning!! ldap is valid only if you are not using contacts for accounts storage! admin de WARNUNG!! LDAP darf nur verwendet werden, wenn sie die Benutzerkonten nicht im Adressbuch speichern! work phone addressbook de Tel dienstl. +you appear to be running addressbook de Sie benutzen gerade einen +you must select a vcard. (*.vcf) addressbook de Sie müssen eine VCard auswählen (*.vcf) +you must select at least 1 column to display addressbook de Sie müssen mindestens eine Spalte zum Anzeigen auswählen zip code common de PLZ -
-Fatal error: Call to undefined function: phpgw_exit() in /www/drock/html/cvs_phpgroupware/developer_tools/inc/class.uilangfile.inc.php on line 566
- - - - - - - - - - - - - phpGroupWare@CVS@granit - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Admin -
- E-Mail -
- Calendar -
- Addressbook -
- News Admin -
- Notes -
- Developer Tools -
- eTemplate -
- sitemgr* -
- Filemanager -
- Projects -
- InfoLog -
- Stock Quotes -
- Chora -
- Registration -
- et_media* -
-
- - - diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index 87f3f9d1b7..efe0872b3b 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -1,6 +1,7 @@ %1 records imported addressbook en %1 records imported %1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook en %1 records read (not yet imported, you may go %2back%3 and uncheck Test Import) no conversion type <none> could be located. please choose a conversion type from the list addressbook en No conversion type <none> could be located. Please choose a conversion type from the list +@-eval() is only availible to admins!!! addressbook en @-eval() is only availible to admins!!! add a single entry by passing the fields. addressbook en Add a single entry by passing the fields. add custom field addressbook en Add Custom Field address book common en Address Book @@ -13,7 +14,6 @@ addressbook common en Addressbook addressbook preferences addressbook en Addressbook preferences addressbook-fieldname addressbook en Addressbook-Fieldname addvcard addressbook en Add VCard -alphabet addressbook en a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z alt. csv import addressbook en Alt. CSV Import are you sure you want to delete this field? addressbook en Are you sure you want to delete this field? bbs phone addressbook en BBS Phone @@ -39,6 +39,7 @@ company name common en Company Name contact common en Contact contact application admin en Contact application contact settings admin en Contact Settings +copied by %1, from record #%2. addressbook en Copied by %1, from record #%2. country common en Country csv-fieldname addressbook en CSV-Fieldname csv-filename addressbook en CSV-Filename @@ -50,10 +51,8 @@ delete a single entry by passing the id. addressbook en Delete a single entry by department common en Department domestic addressbook en Domestic download addressbook en Download -download export file (uncheck to debug output in browser) addressbook en Download export file (Uncheck to debug output in browser) edit custom field addressbook en Edit Custom Field edit custom fields admin en Edit Custom Fields -enter the path to the export file here addressbook en Enter the path to the export file here export contacts addressbook en Export Contacts export file name addressbook en Export file name export from addressbook addressbook en Export from Addressbook @@ -67,7 +66,6 @@ fields to show in address list addressbook en Fields to show in address list fieldseparator addressbook en Fieldseparator full name addressbook en Full Name geo addressbook en GEO -go addressbook en Go grant addressbook access common en Grant Addressbook Access home address type addressbook en Home Address Type home city addressbook en Home City @@ -84,7 +82,6 @@ import csv-file into addressbook addressbook en Import CSV-File into Addressbook import file addressbook en Import File import from ldif, csv, or vcard addressbook en Import from LDIF, CSV, or VCard import from outlook addressbook en Import from Outlook -In Netscape, open the Addressbook and select Export from the File menu.
The file exported will be in LDIF format.

Or, in Outlook, select your Contacts folder, select Import and Export... from addressbook en In Netscape, open the Addressbook and select Export from the File menu.
The file exported will be in LDIF format.

Or, in Outlook, select your Contacts folder, select Import and Export... from international addressbook en International isdn phone addressbook en ISDN Phone label addressbook en Label @@ -94,7 +91,6 @@ ldap root dn for contacts admin en LDAP root dn for contacts ldap root pw for contacts admin en LDAP root pw for contacts ldif addressbook en LDIF line 2 addressbook en Line 2 -mark records as private addressbook en Mark records as private message phone addressbook en Message Phone middle name addressbook en Middle Name mobile addressbook en Mobile @@ -104,7 +100,6 @@ no vcard addressbook en No VCard number of records to read (<=200) addressbook en Number of records to read (<=200) other number addressbook en Other Number other phone addressbook en Other Phone -owerview addressbook en owerview pager common en Pager parcel addressbook en Parcel phone number common en Phone Number @@ -118,24 +113,21 @@ read a list of entries. addressbook en Read a list of entries. read a single entry by passing the id and fieldlist. addressbook en Read a single entry by passing the id and fieldlist. record access addressbook en Record Access record owner addressbook en Record owner -remote search addressbook en Remote Search retrieve contacts admin en retrieve contacts -select the type of conversion addressbook en Select the type of conversion select where you want to store admin en Select where you want to store show birthday reminders on main screen addressbook en Show birthday reminders on main screen -show contact addressbook en show contact startrecord addressbook en Startrecord state common en State street common en Street suffix addressbook en Suffix test import (show importable records only in browser) addressbook en Test Import (show importable records only in browser) that field name has been used already ! addressbook en That field name has been used already ! -the File menu and export your contacts into a comma separated text (CSV) file.

Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. The file exported will be in VCard format.

addressbook en the File menu and export your contacts into a comma separated text (CSV) file.

Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. The file exported will be in VCard format.

this person's first name was not in the address book. addressbook en This person's first name was not in the address book. this person's last name was not in the address book. addressbook en This person's last name was not in the address book. today is %1's birthday! common en Today is %1's birthday! tomorrow is %1's birthday. common en Tomorrow is %1's birthday. update a single entry by passing the fields. addressbook en Update a single entry by passing the fields. +use country list addressbook en Use Country List vcard common en VCard vcards require a first name entry. addressbook en VCards require a first name entry. vcards require a last name entry. addressbook en Vcards require a last name entry. diff --git a/addressbook/setup/phpgw_es.lang b/addressbook/setup/phpgw_es.lang index 0eda483ee5..e29a881fd7 100644 --- a/addressbook/setup/phpgw_es.lang +++ b/addressbook/setup/phpgw_es.lang @@ -37,16 +37,13 @@ country common es Pais csv-fieldname addressbook es Campo CSV csv-filename addressbook es Archivo CSV custom fields addressbook es Campos Personalizados -debug output in browser addressbook es Visualizar depuracion default filter preferences es Filtro por Defecto department common es Departmento domestic common es Nacional download addressbook es Descargar Archivo -download export file (uncheck to debug output in browser) addressbook es Descargar archivo exportado edit custom field admin es Editar Campo Personalizado edit custom fields admin es Editar Campos Personalizados e-mail addressbook es E-Mail -enter the path to the export file here addressbook es Ingrese la ruta al archivo exportado aqui export contacts addressbook es Exportar Contactos export file name addressbook es Nombre del Archivo a Exportar export from addressbook addressbook es Exportar de la Libreta de Direcciones @@ -76,8 +73,6 @@ import file addressbook es Importar Archivo import from ldif, csv, or vcard addressbook es Importar desde LDIF, CSV o VCard import from netscape addressbook es Importar desde Netscape import from outlook addressbook es Importar desde Outlook -In Netscape, open the Addressbook and select Export from the File menu.
The file exported will be in LDIF format.

Or, in Outlook, select your Contacts folder, select Import and Export... from addressbook es

-the File menu and export your contacts into a comma separated text (CSV) file.

Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. The file exported will be in VCard format.

addressbook es Desde Outlook, seleccione su carpeta de contactos, seleccione Importar y Exportar del menu Archivo y exporte sus contactos en un archivo de Texto separado por comas (CSV).

international common es Internacional isdn phone addressbook es Telefono ISDN label addressbook es Etiqueta @@ -87,14 +82,12 @@ ldap host for contacts admin es Host LDAP para contacts ldap root dn for contacts admin es Raiz LDAP dn para contactos ldap root pw for contacts admin es Raiz LDAP pw para contactos line 2 addressbook es Linea 2 -mark records as private addressbook es Marcar registros como Privados message phone addressbook es Telefono de Mensajes middle name addressbook es Segundo Nombre mobile addressbook es Tel.Celular mobile phone addressbook es Telefono Movil modem phone addressbook es Telefono Modem no vcard common es Sin VCard -none addressbook es Ninguno number of records to read (<=200) addressbook es Registros a leer (menos de 200) other number addressbook es Otro Numero other phone addressbook es Otro Telefono @@ -112,7 +105,6 @@ record access addressbook es Acceso al registro record owner addressbook es Dueño del registro records read (not yet imported, you may go back and uncheck test import) addressbook es registros leidos (aun no importados, usted puede volver y desmarcar Testear) retrieve contacts admin es Recuperar Contactos -select the type of conversion addressbook es Seleccione el tipo de conversion select where you want to store admin es Seleccione donde desea almacenar show birthday reminders on main screen addressbook es Mostrar recordatorios de Cumpleaños en la Pantalla Principal startrecord addressbook es Registro Inicial diff --git a/addressbook/setup/phpgw_fr.lang b/addressbook/setup/phpgw_fr.lang index 71ad3e2691..f5e03e30db 100644 --- a/addressbook/setup/phpgw_fr.lang +++ b/addressbook/setup/phpgw_fr.lang @@ -1,6 +1,7 @@ %1 records imported addressbook fr %1 enregistrements importés -%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook fr %1 enregistrements lus (pas encore importés, vous pouvez revenir %2en arrière%3 et décocher Tester l'import) +%1 records read (not yet imported, you may go %2back%3 and uncheck test import) addressbook fr %1 enregistrements lus (pas no conversion type <none> could be located. please choose a conversion type from the list addressbook fr Aucun type de conversion <aucun> n'a pu être trouvé. SVP choisissez un type de conversion depuis la liste +@-eval() is only availible to admins!!! addressbook fr @-eval() est disponible uniquement pour les administrateurs!!! add a single entry by passing the fields. addressbook fr Ajouter une seule entrée en passant les champs. add custom field addressbook fr Ajouter champ personnalisé address book common fr Carnet d'adresses @@ -13,7 +14,6 @@ addressbook common fr Carnet d'adresses addressbook preferences addressbook fr Préférences du carnet d'adresses addressbook-fieldname addressbook fr Carnet d'adresses-nomdechamp addvcard addressbook fr Ajouter VCard -alphabet addressbook fr a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z alt. csv import addressbook fr Import Alt. CSV are you sure you want to delete this field? addressbook fr Etes-vous sûr de vouloir effacer ce champ? bbs phone addressbook fr Téléphone BBS @@ -39,6 +39,7 @@ company name common fr Nom de la soci contact common fr Contact contact application admin fr Application contact contact settings admin fr Paramètres du contact +copied by %1, from record #%2. addressbook fr Copié par %1, depuis l'enregistrement #%2. country common fr Pays csv-fieldname addressbook fr CSV-Nomdechamp csv-filename addressbook fr CSV-Nomdefichier @@ -50,10 +51,8 @@ delete a single entry by passing the id. addressbook fr Effacer une seule entr department common fr Département domestic addressbook fr Domestique download addressbook fr Downloader -download export file (uncheck to debug output in browser) addressbook fr Downloader le fichier d'export (Décocher pour débogger la sortie dans le navigateur) edit custom field addressbook fr Editer le champ personnalisé edit custom fields admin fr Editer les champs personnalisés -enter the path to the export file here addressbook fr Entrez le chemin vers le fichier d'export ici export contacts addressbook fr Exporter les contacts export file name addressbook fr Nom du fichier d'export export from addressbook addressbook fr Exporter depuis le carnet d'adresses @@ -67,7 +66,6 @@ fields to show in address list addressbook fr Champs fieldseparator addressbook fr Séparateur de champ full name addressbook fr Nom complet geo addressbook fr GEO -go addressbook fr Allez grant addressbook access common fr Régler les droits d'accès au carnet d'adresses home address type addressbook fr Type d'adresse (domicile) home city addressbook fr Ville (domicile) @@ -84,7 +82,6 @@ import csv-file into addressbook addressbook fr Importer le fichier CSV dans le import file addressbook fr Importer le fichier import from ldif, csv, or vcard addressbook fr Importer depuis LDIF, CSV ou VCard import from outlook addressbook fr Importer depuis Outlook -In Netscape, open the Addressbook and select Export from the File menu.
The file exported will be in LDIF format.

Or, in Outlook, select your Contacts folder, select Import and Export... from addressbook fr Dans Netscape, ouvrez le carnet d'adresses et choisissez Exporter dans le menu Fichier.
Le fichier exporté sera dans le format LDIF.

Ou, dans Outlook, choisissez votre dossier Contacts, choisissez Importer et Exporter... depuis international addressbook fr International isdn phone addressbook fr Téléphone RNIS label addressbook fr Label @@ -94,7 +91,6 @@ ldap root dn for contacts admin fr Racine LDAP dn pour les contacts ldap root pw for contacts admin fr Racine LDAP pw pour les contacts ldif addressbook fr LDIF line 2 addressbook fr Ligne 2 -mark records as private addressbook fr Marquer les enregistrements comme privés message phone addressbook fr Téléphone de message middle name addressbook fr Deuxième prénom mobile addressbook fr Portable @@ -104,7 +100,6 @@ no vcard addressbook fr Pas de VCard number of records to read (<=200) addressbook fr Nombre d'enregistrements à lire (<=200) other number addressbook fr Autre numéro other phone addressbook fr Autre téléphone -owerview addressbook fr Vue globale pager common fr Pager parcel addressbook fr Paquet phone number common fr Numéro de téléphone @@ -118,24 +113,21 @@ read a list of entries. addressbook fr Lire une liste d'entr read a single entry by passing the id and fieldlist. addressbook fr Lire une seule entrée en passant l'ID et la liste des champs. record access addressbook fr Enregistrer l'accès record owner addressbook fr Enregistrer le propriétaire -remote search addressbook fr Recherche à distance retrieve contacts admin fr Récupérer les contacts -select the type of conversion addressbook fr Choisissez le type de conversion select where you want to store admin fr Choisissez où vous voulez stocker show birthday reminders on main screen addressbook fr Montrer les rappels d'anniversaires sur la page principale -show contact addressbook fr Montrer le contact startrecord addressbook fr Enregistrement de départ state common fr Région street common fr Rue suffix addressbook fr Suffixe test import (show importable records only in browser) addressbook fr Tester l'import (montrer seulement les enregistrements importables dans le navigateur) that field name has been used already ! addressbook fr Ce nom de champ a déjà été utilisé ! -the File menu and export your contacts into a comma separated text (CSV) file.

Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. The file exported will be in VCard format.

addressbook fr le menu Fichier et exportez vos contacts dans un fichier aux champs séparés par des virgules (CSV).

Ou, dans Palm Desktop 4.0 ou plus, allez dans votre carnet d'adresses et choisissez Exporter depuis le menu Fichier. Le fichier exporté sera dans le format VCard.

this person's first name was not in the address book. addressbook fr Le prénom de cette personne n'était pas dans le carnet d'adresses. this person's last name was not in the address book. addressbook fr Le nom de cette personne n'était pas dans le carnet d'adresses. today is %1's birthday! common fr Aujourd'hui c'est l'anniversaire de %1 ! tomorrow is %1's birthday. common fr Demain c'est l'anniversaire de %1. update a single entry by passing the fields. addressbook fr Mettre à jour une seule entrée en passant les champs. +use country list addressbook fr Utiliser la liste des pays vcard common fr VCard vcards require a first name entry. addressbook fr Les VCards nécessitent une entrée Prénom. vcards require a last name entry. addressbook fr Les Vcards nécessitent une entrée nom de famille. diff --git a/addressbook/setup/phpgw_ja.lang b/addressbook/setup/phpgw_ja.lang index 95af2fa994..97c01dfffe 100644 --- a/addressbook/setup/phpgw_ja.lang +++ b/addressbook/setup/phpgw_ja.lang @@ -88,7 +88,7 @@ suffix addressbook ja that field name has been used already ! addressbook ja ¹àÌÜ̾¤Ï´û¤Ë¸ºß¤·¤Æ¤¤¤Þ¤¹¡£ this person's first name was not in the address book. addressbook ja ¥¢¥É¥ì¥¹Ä¢¤Ë̾Á°¤¬¤¢¤ê¤Þ¤»¤ó¡£ today is %1's birthday! common ja º£Æü¤Ï %1 ¤µ¤ó¤ÎÃÂÀ¸Æü¤Ç¤¹¡£ -tomorrow is %1's birthday. common ja ÌÀÆü¤Ï %1 ¤µ¤ó¤ÎÃÂÀ¸Æü¤Ç¤¹¡£ +tommorow is %1's birthday. common ja ÌÀÆü¤Ï %1 ¤µ¤ó¤ÎÃÂÀ¸Æü¤Ç¤¹¡£ url addressbook ja URL vcard common ja VCard vcards require a first name entry. addressbook ja VCard ¤Ë¤Ï¡¢Ì¾Á°¤¬É¬ÍפǤ¹¡£ diff --git a/addressbook/setup/setup.inc.php b/addressbook/setup/setup.inc.php index 9f9e15eb2f..77a3288772 100755 --- a/addressbook/setup/setup.inc.php +++ b/addressbook/setup/setup.inc.php @@ -13,23 +13,13 @@ /* Basic information about this app */ $setup_info['addressbook']['name'] = 'addressbook'; - $setup_info['addressbook']['version'] = '0.9.13.003'; + $setup_info['addressbook']['title'] = 'Addressbook'; + $setup_info['addressbook']['version'] = '0.9.13.002'; $setup_info['addressbook']['app_order'] = 4; $setup_info['addressbook']['enable'] = 1; - $setup_info['addressbook']['author'][] = array - ( - 'name' => 'Joseph Engo', - 'email' => 'jengo@phpgroupware.org' - ); - - $setup_info['addressbook']['author'][] = array - ( - 'name' => 'Miles Lott', - 'email' => 'milos@speakeasy.net' - ); - - $setup_info['addressbook']['note'] = 'The phpgwapi manages contact data. Addressbook manages servers for its remote capability'; + $setup_info['addressbook']['author'] = 'Joseph Engo, Miles Lott'; + $setup_info['addressbook']['note'] = 'The phpgwapi manages contact data. Addressbook manages servers for its remote capability.'; $setup_info['addressbook']['license'] = 'GPL'; $setup_info['addressbook']['description'] = 'Contact manager with Vcard support.
@@ -37,28 +27,24 @@ It makes use of the phpgroupware contacts class to store and retrieve contact information via SQL or LDAP.'; - $setup_info['addressbook']['maintainer'] = ''; - - /* Tables */ - $setup_info['addressbook']['tables'][] = 'phpgw_addressbook_servers'; + $setup_info['addressbook']['maintainer'] = 'phpGroupWare coreteam'; + $setup_info['addressbook']['maintainer_email'] = 'phpgroupware-developers@gnu.org'; /* The hooks this app includes, needed for hooks registration */ - $setup_info['addressbook']['hooks'] = array - ( - 'admin', - 'add_def_pref', - 'config_validate', - 'home', - 'deleteaccount', - 'notifywindow', - 'preferences', - 'help' - ); + $setup_info['addressbook']['hooks'][] = 'admin'; + $setup_info['addressbook']['hooks'][] = 'add_def_pref'; + $setup_info['addressbook']['hooks'][] = 'config_validate'; + $setup_info['addressbook']['hooks'][] = 'home'; + $setup_info['addressbook']['hooks'][] = 'manual'; + $setup_info['addressbook']['hooks'][] = 'addaccount'; + $setup_info['addressbook']['hooks'][] = 'editaccount'; + $setup_info['addressbook']['hooks'][] = 'deleteaccount'; + $setup_info['addressbook']['hooks'][] = 'notifywindow'; + $setup_info['addressbook']['hooks'][] = 'preferences'; /* Dependencies for this app to work */ - $setup_info['addressbook']['depends'][] = array - ( - 'appname' => 'phpgwapi', - 'versions' => Array('0.9.15', '0.9.16') + $setup_info['addressbook']['depends'][] = array( + 'appname' => 'phpgwapi', + 'versions' => Array('0.9.13', '0.9.14') ); ?> diff --git a/addressbook/setup/tables_baseline.inc.php b/addressbook/setup/tables_baseline.inc.php deleted file mode 100644 index 51f6ebdce4..0000000000 --- a/addressbook/setup/tables_baseline.inc.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/addressbook/setup/tables_update.inc.php b/addressbook/setup/tables_update.inc.php deleted file mode 100644 index 392e965e26..0000000000 --- a/addressbook/setup/tables_update.inc.php +++ /dev/null @@ -1,36 +0,0 @@ -oProc->CreateTable( - 'phpgw_addressbook_servers', array( - 'fd' => array( - 'name' => array('type' => 'varchar', 'precision' => 64, 'nullable' => False), - 'basedn' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True), - 'search' => array('type' => 'varchar', 'precision' => 32, 'nullable' => True), - 'attrs' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True), - 'enabled' => array('type' => 'int', 'precision' => 4) - ), - 'pk' => array('name'), - 'fk' => array(), - 'ix' => array(), - 'uc' => array() - ) - ); - - $GLOBALS['setup_info']['addressbook']['currentver'] = '0.9.13.003'; - return $GLOBALS['setup_info']['addressbook']['currentver']; - } -?> diff --git a/addressbook/templates/default/about.tpl b/addressbook/templates/default/about.tpl new file mode 100644 index 0000000000..0b819b76e9 --- /dev/null +++ b/addressbook/templates/default/about.tpl @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+ {alt} +
{about_addressbook}
{appear} {agent} {version} {on} {platform}.

diff --git a/addressbook/templates/default/add.tpl b/addressbook/templates/default/add.tpl index a2c7f29ab8..1389086489 100644 --- a/addressbook/templates/default/add.tpl +++ b/addressbook/templates/default/add.tpl @@ -1,17 +1,14 @@ - +
- - - - diff --git a/addressbook/templates/default/config.tpl b/addressbook/templates/default/config.tpl index 1810de2825..36f5d7f27d 100644 --- a/addressbook/templates/default/config.tpl +++ b/addressbook/templates/default/config.tpl @@ -1,25 +1,28 @@
   - - + +  
- + +  
- - + + - + - + + + + - + - + - + - + - + - + - + - - - - - + diff --git a/addressbook/templates/default/csv_import.tpl b/addressbook/templates/default/csv_import.tpl index 3e6838960c..837d0da6c0 100644 --- a/addressbook/templates/default/csv_import.tpl +++ b/addressbook/templates/default/csv_import.tpl @@ -1,3 +1,9 @@ + +
+ + +
 {title}
 {title}
 {error}
 
 {lang_Addressbook}/{lang_Contact_Settings}
{lang_Contact_application}:
{lang_WARNING!!_LDAP_is_valid_only_if_you_are_NOT_using_contacts_for_accounts_storage!}
{lang_Select_where_you_want_to_store}/{lang_retrieve_contacts}.
{lang_LDAP_host_for_contacts}:
{lang_LDAP_context_for_contacts}:
{lang_LDAP_root_dn_for_contacts}:
{lang_LDAP_root_pw_for_contacts}:
{lang_Enable_remote_search}: - {lang_no} - {lang_yes} -
 
+ @@ -36,7 +42,7 @@ {lang_max} - + - -

{lang_addr_action}
-


-
- - -
{lang_csvfile}
{lang_debug} {lang_debug}
 

{help_on_trans} @@ -52,17 +58,7 @@

- {rows} -
- {hiddenvars} - + +{hiddenvars} - diff --git a/addressbook/templates/default/delete.tpl b/addressbook/templates/default/delete.tpl index 9072d06e05..c3ded90e41 100644 --- a/addressbook/templates/default/delete.tpl +++ b/addressbook/templates/default/delete.tpl @@ -1,6 +1,9 @@ +

{lang_sure}

- {lang_no}         - {lang_yes} +
+         + +
diff --git a/addressbook/templates/default/edit.tpl b/addressbook/templates/default/edit.tpl index 45a304281b..80715c0c10 100644 --- a/addressbook/templates/default/edit.tpl +++ b/addressbook/templates/default/edit.tpl @@ -3,14 +3,12 @@ - +
- - - - @@ -20,7 +18,6 @@ {delete_button} -
   - + +   + {cancel_link}  
diff --git a/addressbook/templates/default/export.tpl b/addressbook/templates/default/export.tpl index 366845cef7..cd8ac8fbdf 100644 --- a/addressbook/templates/default/export.tpl +++ b/addressbook/templates/default/export.tpl @@ -1,5 +1,5 @@ - +
@@ -10,13 +10,13 @@
    -
  1. {conversion}: +
  2. Select the type of conversion:

  3. {filename}:
  4. {lang_cat}:{cat_link}
  5. -
  6. {download_export}
  7. +
  8. Download export file (Uncheck to debug output in browser)
diff --git a/addressbook/templates/default/form.tpl b/addressbook/templates/default/form.tpl index 4fba2fc627..2b41af2287 100755 --- a/addressbook/templates/default/form.tpl +++ b/addressbook/templates/default/form.tpl @@ -1,18 +1,17 @@ -{search} - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + {custom} diff --git a/addressbook/templates/default/help_data.xsl b/addressbook/templates/default/help_data.xsl deleted file mode 100644 index 3ce386bc01..0000000000 --- a/addressbook/templates/default/help_data.xsl +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
{lang_personal}:
  {lang_prefix}:
  {lang_firstname}: @@ -23,29 +22,29 @@
  {lang_lastname}:
  {lang_suffix}:
  {lang_birthday}: {birthday}
{lang_business}:
  {lang_title}: @@ -54,7 +53,7 @@
  {lang_company}: @@ -67,7 +66,7 @@
  {lang_email}: @@ -80,7 +79,7 @@ {email_type}
  {lang_department}: @@ -89,28 +88,28 @@
  {lang_bstreet}:
  {lang_address2}:
  {lang_address3}:
  {lang_bcity}: @@ -120,14 +119,14 @@
  {lang_bzip}:
  {lang_bcountry}: @@ -137,14 +136,14 @@ {timezone}
  {lang_badrtype}: {badrtype}
  {lang_wphone}: @@ -155,7 +154,7 @@ {pref_fax}
  {lang_pager}: @@ -166,7 +165,7 @@ {pref_cell}
  {lang_msgphone}: @@ -177,7 +176,7 @@ {pref_isdn}
  {lang_carphone}: @@ -188,20 +187,20 @@ {pref_video}
  {lang_label}: {label}
  {lang_pubkey}: {pubkey}
{lang_home}:
  {lang_hemail}: @@ -211,12 +210,12 @@ {hemail_type}
  {lang_hstreet}:
  {lang_hcity}: @@ -227,28 +226,28 @@
  {lang_hzip}:
  {lang_hcountry}: {hcountry}
  {lang_hadrtype}: {hadrtype}
  {lang_hphone}: @@ -258,22 +257,22 @@
{lang_notes}: {notes}
{lang_private}:
{lang_cats}: {cats_link}  
{lang_custom}
- - - - - - -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-
- - - - - - - - - - - - - - - - - - - - - -
- -
1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
::
::
::
::
::
::
::
::
::
-
2
-
diff --git a/addressbook/templates/default/images/help_add.jpg b/addressbook/templates/default/images/help_add.jpg deleted file mode 100644 index f80671ec2d..0000000000 Binary files a/addressbook/templates/default/images/help_add.jpg and /dev/null differ diff --git a/addressbook/templates/default/images/help_list.jpg b/addressbook/templates/default/images/help_list.jpg deleted file mode 100644 index 9fe55307e2..0000000000 Binary files a/addressbook/templates/default/images/help_list.jpg and /dev/null differ diff --git a/addressbook/templates/default/images/navbar.png b/addressbook/templates/default/images/navbar.png index f7f3e3ecca..bcc658c9ba 100644 Binary files a/addressbook/templates/default/images/navbar.png and b/addressbook/templates/default/images/navbar.png differ diff --git a/addressbook/templates/default/import.tpl b/addressbook/templates/default/import.tpl index f2230b7221..b94948de5f 100644 --- a/addressbook/templates/default/import.tpl +++ b/addressbook/templates/default/import.tpl @@ -12,18 +12,24 @@
    -
  1. {help_import} {help_import2} +
  2. In Netscape, open the Addressbook and select Export from the File menu. + The file exported will be in LDIF format. +

    Or, in Outlook, select your Contacts folder, select Import + and Export... from the File + menu and export your contacts into a comma separated text (CSV) file. +

    Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. + The file exported will be in VCard format.

  3. -
  4. {export_path}: +
  5. Enter the path to the exported file here:

  6. -
  7. {conversion}: +
  8. Select the type of conversion:

  9. {lang_cat}:{cat_link}
  10. -
  11. {mark_private}
  12. -
  13. {debug_browser}
  14. +
  15. Mark records as private
  16. +
  17. Debug output in browser
diff --git a/addressbook/templates/default/index.tpl b/addressbook/templates/default/index.tpl index b0f904f200..301ad5dd66 100644 --- a/addressbook/templates/default/index.tpl +++ b/addressbook/templates/default/index.tpl @@ -1,19 +1,15 @@ -
{lang_addressbook} -
{lang_showing} -
{searchreturn}{search_filter}{remotesearch} - - - {alphalinks} - -
- - {cols} +
+{lang_showing} +
{searchreturn} +{search_filter} +
+{cols} - + @@ -21,34 +17,18 @@ - {columns} +{columns} - + - -
{lang_view} {lang_vcard} {lang_edit} {lang_owner}
{lang_view} {lang_vcard} {row_edit} {row_owner}
- - - - - - - -
{lang_remote_search}: - -
- -
- - +
+ @@ -56,8 +36,5 @@
-
+ - -{char} - diff --git a/addressbook/templates/default/listfields.tpl b/addressbook/templates/default/listfields.tpl index d51682fb14..9338fead4f 100644 --- a/addressbook/templates/default/listfields.tpl +++ b/addressbook/templates/default/listfields.tpl @@ -19,14 +19,14 @@
 
- - {sort_field} - {lang_edit} - {lang_delete} + + {sort_field} + {lang_edit} + {lang_delete} - + {cfield} {lang_edit_entry} {lang_delete_entry} diff --git a/addressbook/templates/default/preference_acl_row.tpl b/addressbook/templates/default/preference_acl_row.tpl index 378507ec6d..5fbfcc6b0a 100755 --- a/addressbook/templates/default/preference_acl_row.tpl +++ b/addressbook/templates/default/preference_acl_row.tpl @@ -1,5 +1,5 @@ - + {user} diff --git a/addressbook/templates/default/preference_colspan.tpl b/addressbook/templates/default/preference_colspan.tpl index 03dded0da5..aea9424902 100755 --- a/addressbook/templates/default/preference_colspan.tpl +++ b/addressbook/templates/default/preference_colspan.tpl @@ -1,6 +1,6 @@ - + {string} - {read_lang} - {edit_lang} - {delete_lang} + {lang_read} + {lang_edit} + {lang_delete} diff --git a/addressbook/templates/default/preferences.tpl b/addressbook/templates/default/preferences.tpl index 57ba74482c..1e8facdca0 100644 --- a/addressbook/templates/default/preferences.tpl +++ b/addressbook/templates/default/preferences.tpl @@ -2,13 +2,13 @@

{lang_abprefs}:


- + - + - + @@ -16,7 +16,7 @@ - + @@ -27,10 +27,10 @@ - + - + @@ -38,7 +38,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -56,10 +56,10 @@ - + - + @@ -67,7 +67,7 @@ - + @@ -77,10 +77,10 @@ - + - + @@ -88,7 +88,7 @@ - + @@ -99,10 +99,10 @@ - + - + @@ -117,10 +117,10 @@ - + - + - + - + @@ -31,10 +31,10 @@ {rows_access} - + - +
{lang_fields}:
{lang_personal}:
{fn} {n_given} {n_family}   
{n_prefix} {n_suffix} {bday}
 
{lang_business}:
{org_name} {org_unit} {title}   
{adr_one_street} {address2} {address3}{adr_one_region} {adr_one_postalcode}
{adr_one_countryname} {adr_one_type} {tel_work}
 
{lang_home}:
{adr_two_street} {adr_two_locality} {adr_two_region}   
{adr_two_countryname} {adr_two_type} {tel_home}
 
{lang_phones}:
{tel_voice} {tel_fax} {tel_msg}{tel_pager} {tel_bbs}
{tel_modem} {tel_car} {tel_isdn}
 
{lang_other}:
{geo} {url} {tz}
 
{lang_otherprefs}:
{lang_default_filter} {filter_select} @@ -129,7 +129,7 @@
{lang_defaultcat} {cat_select} diff --git a/addressbook/templates/default/view.tpl b/addressbook/templates/default/view.tpl index 662b18be4e..28c8b317aa 100644 --- a/addressbook/templates/default/view.tpl +++ b/addressbook/templates/default/view.tpl @@ -1,9 +1,9 @@ -

 {lang_viewpref}


+
- + diff --git a/addressbook/templates/idots/images/navbar.png b/addressbook/templates/idots/images/navbar.png new file mode 100755 index 0000000000..745489ae93 Binary files /dev/null and b/addressbook/templates/idots/images/navbar.png differ diff --git a/admin/acl2_tester.php b/admin/acl2_tester.php deleted file mode 100644 index c49f5f4091..0000000000 --- a/admin/acl2_tester.php +++ /dev/null @@ -1,113 +0,0 @@ -1)); - $sec = New acl2(1,'##DEFAULT##'); -//echo 'phpgw:
'; print_r($GLOBALS['phpgw']); echo '
'; - $sec->get_memberships(); -//echo 'memberships_sql: '.$sec->memberships_sql.'
'; -//echo 'memberships:
'; print_r($sec->memberships); echo '
'; - function ttt($location, $rights) - { - GLOBAL $sec; - if ($sec->check($location, $rights)) - { - echo $rights.' is valid
'; - } - else - { - echo $rights.' is invalid
'; - } - } - - echo 'This test is going to delete all your phpgw_acl2 records to ensure that the tests run as expected.
'; - $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_acl2',__LINE__,__FILE__); - echo 'Action: DELETE FROM phpgw_acl2

'; - echo 'Running checks on .one.two.three after changing directly granted rights as well as ones it will inherit from
'; - - echo '
1: check rights for .one.two which will get inherited by .one.two.three
'; - ttt('.one.two', 1); - ttt('.one.two', 2); - ttt('.one.two', 4); - ttt('.one.two', 8); - echo 'You can see that no rights are set, so none will be inherited
'; - - echo '
2: checking .one.two.three
'; - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - echo 'You can see that no rights are set directly as well
'; - - echo '
3: add rights 4 to .one.two.three
'; - echo 'Action: $acl2->add(\'.one.two.three\',4,0);
'; - $sec->add('.one.two.three',4,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - - echo '
4: add rights 8 to .one.two.three
'; - echo 'Action: $acl2->add(\'.one.two.three\',8,0);
'; - $sec->add('.one.two.three',8,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - - echo '
5: remove rights 4 from .one.two.three
'; - echo 'Action: $acl2->remove(\'.one.two.three\',4,0);
'; - $sec->remove('.one.two.three',4,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - - echo '
5: set rights to 2 on .one.two.three
'; - echo 'Action: $acl2->set(\'.one.two.three\', 2,0);
'; - $sec->set('.one.two.three', 2,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - - echo '
Now to see inheritance in action...
'; - echo '6: add rights 8 to .one.two
'; - echo 'Action: $acl2->add(\'.one.two\',8,0);
'; - $sec->add('.one.two',8,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - echo 'You can see here that it has inherited rights 8 from .one.two
'; - - echo '
7: add rights 4 to .one.two
'; - echo 'Action: $acl2->add(\'.one.two\',4,0);
'; - $sec->add('.one.two',4,0); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - echo 'You can see here that it has also inherited rights 4 from .one.two
'; - - echo '
Now to see inherited rights masks in action...
'; - echo '8: add rights mask for 8 to .one.two
'; - echo 'Action: $acl2->add(\'.one.two\',8,1);
'; - $sec->add('.one.two',8,1); - ttt('.one.two.three', 1); - ttt('.one.two.three', 2); - ttt('.one.two.three', 4); - ttt('.one.two.three', 8); - echo 'You can see here that it no longer inherited rights 8 from .one.two
'; - - echo '
It will help to see the rights for .one.two at this point to clearly see the rights mask doing its work
'; - echo '9: display rights for .one.two
'; - ttt('.one.two', 1); - ttt('.one.two', 2); - ttt('.one.two', 4); - ttt('.one.two', 8); - echo 'You can see here that it has rights for 4 and 8, and yet above you saw that .one.two.three did not inherited rights 4 from it
'; - - //echo 'rights_cache:
'; print_r($sec->rights_cache); echo '
'; -?> diff --git a/admin/debian/changelog b/admin/debian/changelog deleted file mode 100644 index bc99bb2465..0000000000 --- a/admin/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -phpgroupware-admin (0.9.14-0.RC3.3) unstable; urgency=low - - * New release. - - Source is now splitted into modules. - - -- Luca - De Whiskey's - De Vitis Mon, 21 May 2001 15:00:56 +0200 diff --git a/admin/debian/control b/admin/debian/control deleted file mode 100644 index 84926e89cb..0000000000 --- a/admin/debian/control +++ /dev/null @@ -1,16 +0,0 @@ -Source: phpgroupware-admin -Section: web -Priority: optional -Maintainer: Luca - De Whiskey's - De Vitis -Build-Depends: debhelper (>> 3.0.0) -Standards-Version: 3.5.2 - -Package: phpgroupware-admin -Section: web -Architecture: all -Depends: phpgroupware (>= ${Source-Version}), php3-pgsql | php3-cgi-pgsql | php4-pgsql | php3-mysql | php3-cgi-mysql | php4-mysql -Description: The phpGroupWare administration module - This phpGroupWare module provide the administration facilities for - phpGroupWare (add and remove groups, users, modules, session handling - etc.). - diff --git a/admin/debian/copyright b/admin/debian/copyright deleted file mode 100644 index 900148502e..0000000000 --- a/admin/debian/copyright +++ /dev/null @@ -1,15 +0,0 @@ -This package was debianized by Luca - De Whiskey's - De Vitis on -Sat, 29 Jun 2002 17:13:40 +0200 - -It was downloaded from the CVS repository at subversion.gnu.org. Try: -prompt$ CVSROOT=:pserver:anoncvs@subversions.gnu.org:/cvsroot/phpgroupware -prompt$ CVS_RSH=ssh -prompt$ cvs login -prompt$ cvs get all packages - -Upstream Author(s): -Please, see credits.txt, the README file or visit http://apps.phpgroupware.org/ - -Copyright: -A copy of the GNU General Public License, version 2, can be found in -/usr/share/common-licenses/GPL . diff --git a/admin/debian/rules b/admin/debian/rules deleted file mode 100755 index 96af18a79d..0000000000 --- a/admin/debian/rules +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 by Joey Hess. -# -# This version is for a hypothetical package that builds an -# architecture-dependant package, as well as an architecture-independent -# package. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# This is the debhelper compatability version to use. -export DH_COMPAT=3 - -APP = admin -PACKAGE = debian/phpgroupware-$(APP)/usr/share/phpgroupware/$(APP) -PACKAGEDOC = debian/phpgroupware-$(APP)/usr/share/doc/phpgroupware-$(APP) - -COPYRIGHT = -iname copyright\* -or -iname license -CHANGELOG = -iname change\* -INSTALL = -iname install -FINDOPT = -type f -not \( -path \*CVS\* -or -path \*debian\* -or -name .cvsignore \) -SPECIAL = -size 0 -or $(INSTALL) -or $(CHANGELOG) -or $(COPYRIGHT) -or -name \*.sgml -STAMPS = -name configure-stamp -or -name build-stamp -APPFILES = -not \( -path \*doc\* -or -path \. -or -name '*.pl' -or -name '*.py' -or $(STAMPS) \) -DOCFILES = -not \( $(SPECIAL) \) - -configure: configure-stamp -configure-stamp: - dh_testdir - # No configuration needed. - touch configure-stamp - -build: configure-stamp build-stamp -build-stamp: - dh_testdir - # Here should go the commands necessary to build the sgml documentation... - touch build-stamp - -clean: - dh_testdir - rm -f build-stamp configure-stamp - rm -f debian/.builded - rm -f debian/files - # Here should go the commands to clean the builded sgml documents. - dh_clean - -install: build - dh_testdir - - # Install $(APP) files in $(PACKAGE) - find $(FINDOPT) $(APPFILES) \ - -exec install -D --mode=644 {} $(PACKAGE)/{} \; - - # Install $(APP) doc files in $(PACKAGEDOC) - cd doc ;\ - find $(FINDOPT) $(DOCFILES) \ - -exec install -D --mode=644 {} ../$(PACKAGEDOC)/{} \; - -binary-indep: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installchangelogs - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb | tee debian/.builded - -binary: binary-indep -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/admin/doc/adminconfig.dvi b/admin/doc/adminconfig.dvi index 35dbcc1a7d..53c4225c7e 100644 Binary files a/admin/doc/adminconfig.dvi and b/admin/doc/adminconfig.dvi differ diff --git a/admin/doc/adminconfig.lyx b/admin/doc/adminconfig.lyx index 889ad7c6ae..b442d4f0ca 100644 --- a/admin/doc/adminconfig.lyx +++ b/admin/doc/adminconfig.lyx @@ -69,10 +69,6 @@ and the following special types: \layout Enumerate {hook_XXX} - Calls a function named XXX (will be discussed later). -\layout Enumerate - -{checked_XXX+YYY} - Handles checkbox/radio values set to YYY or '' (will - be discussed later). \layout Standard Following is an example from the addressbook application: @@ -179,35 +175,7 @@ Let's take a look at part of the preferences/default/config.tpl: \layout Standard Here, we are adding a new element, {hook_country_set}. - This brings up the next file we will need to parse this value, hook_config.inc.ph -p. - But first, let's look at the last template type, 'checked': -\layout Code - -{lang_no} -\layout Code - -{lang_yes} -\layout Standard - -We want to check the value of the setting 'enable_remote_addressbook'. - The value could be '' or 'True'. - We use the '+' character to isolate the config name from the check value. - If the value is empty or unset in the phpgw_config table, {checked_enable_remot -e_addressbook+} is replaced with ' checked'. - If the value is 'True',{checked_enable_remote_addressbook+True} is replaced - with ' checked'. - Note that the part after the '+' character matches what is in the value= -\begin_inset Quotes erd -\end_inset - -XXX -\begin_inset Quotes erd -\end_inset - - part in the html for this form element. + This brings up the next file we will need to parse this value... \layout Subsection hook_config.inc.php (optional) diff --git a/admin/doc/adminconfig.pdf b/admin/doc/adminconfig.pdf index 7658da426e..34dd19a17f 100644 Binary files a/admin/doc/adminconfig.pdf and b/admin/doc/adminconfig.pdf differ diff --git a/admin/doc/adminconfig.ps b/admin/doc/adminconfig.ps index 531a8497fd..3ff9c89b06 100644 --- a/admin/doc/adminconfig.ps +++ b/admin/doc/adminconfig.ps @@ -1,15 +1,15 @@ %!PS-Adobe-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: adminconfig.dvi -%%Pages: 1 +%%Pages: 6 %%PageOrder: Ascend %%BoundingBox: 0 0 612 792 -%%DocumentFonts: Times-Roman +%%DocumentFonts: Helvetica-Bold Times-Roman Courier Times-Italic %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -t letter -o adminconfig.ps adminconfig.dvi %DVIPSParameters: dpi=600, compressed -%DVIPSSource: TeX output 2002.03.19:1838 +%DVIPSSource: TeX output 2001.12.22:1805 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S @@ -314,13 +314,28 @@ setcmykcolor}DC/White{0 0 0 0 setcmykcolor}DC end %%EndProcSet TeXDict begin 40258431 52099146 1000 600 600 (adminconfig.dvi) -@start /Fa 107[37 22[40 1[40 1[42 42 60 42 42 23 32 28 -42 42 42 42 65 23 42 1[23 42 42 28 37 42 37 42 37 1[42 -1[28 23 28 1[60 60 78 1[60 51 46 55 1[46 60 60 74 51 -2[28 60 60 46 51 60 55 55 60 76 1[47 47 47 23 23 7[42 -42 42 23 21 28 21 47 42 28 28 28 65 1[42 1[34 28 29[46 -46 2[{TeXBase1Encoding ReEncodeFont}76 83.022 /Times-Roman -rf end +@start /Fa 138[42 2[32 1[42 42 42 60 3[23 42 42 1[37 +42 37 1[42 9[69 15[60 16[42 42 42 42 42 42 1[23 21 43[42 +2[{TeXBase1Encoding ReEncodeFont}24 83.022 /Times-Italic +rf /Fb 107[45 22[45 1[45 1[45 45 45 45 45 45 45 45 1[45 +45 45 45 45 45 1[45 45 45 45 45 45 45 45 45 1[45 1[45 +45 45 5[45 45 45 2[45 45 45 1[45 2[45 1[45 45 45 45 45 +45 45 2[45 45 45 45 45 7[45 1[45 45 45 45 45 1[45 45 +45 45 45 1[45 1[45 45 33[{TeXBase1Encoding ReEncodeFont}64 +74.7198 /Courier rf /Fc 137[66 73 40 1[47 73 73 73 73 +1[33 66 1[33 73 73 1[66 73 66 1[66 1[66 43[66 66 66 2[33 +4[40 40 37[73 2[{TeXBase1Encoding ReEncodeFont}25 119.552 +/Helvetica-Bold rf /Fd 140[80 6[40 2[40 3[80 30[88 20[80 +2[40 46[{TeXBase1Encoding ReEncodeFont}7 143.462 /Helvetica-Bold +rf /Fe 107[37 22[40 1[40 1[42 42 60 42 42 23 32 28 1[42 +42 42 65 23 42 1[23 42 42 28 37 42 37 42 37 1[42 1[28 +1[28 2[60 78 2[51 46 55 1[46 60 60 74 51 2[28 60 60 46 +1[60 55 55 60 76 1[47 1[47 1[23 5[42 42 42 42 42 23 21 +28 21 2[28 28 28 2[42 32[46 46 2[{TeXBase1Encoding ReEncodeFont}66 +83.022 /Times-Roman rf /Ff 138[126 2[80 1[126 126 126 +184 3[57 126 126 1[115 126 115 1[115 9[195 15[161 23[57 +57 43[126 2[{TeXBase1Encoding ReEncodeFont}18 206.584 +/Helvetica-Bold rf end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi @@ -331,180 +346,188 @@ letter %%EndSetup %%Page: 1 1 -1 0 bop Black Black -434 -417 a Fa(phpGroupW)-7 b(are)39 -b(admin/con\002g.php)81 b(A)42 b(brief)f(introduction)f(to)i(writing)f -(hooks)g(and)g(templates)h(for)f(an)o(y)g(application)f(to)i(use)h -(this)f(admin)f(interf)o(ace,)-600 -318 y(by)93 b(Miles)47 -b(Lott)g()41 b(Dec)47 -b(22,)f(2001.)91 b(Files)k(con\002g.tpl)45 b(\(required\))91 -b(In)46 b(your)f(application/templates/def)o(ault)e(directory)-5 -b(,)-600 -218 y(create)38 b(a)g(ne)n(w)g(template)g(\002le)h(named)e -('con\002g.tpl'.)e(This)k(will)g(be)f(included)e(by)i(con\002g.php)d -(and)j(used)g(to)g(dra)o(w)g(the)g(page.)f(This)h(template)g(should)f -(include)-600 -118 y(a)45 b(POST)g(method)f(form.)f(The)i(follo)n(wing) -e(template)h(tags)h(may)f(be)h(used:)89 b({action_url})43 -b(-)i(A)g(phpgw->link)d(to)j(con\002g.php)d(will)k(be)e(inserted.)89 -b({title})-600 -19 y(-)50 b(This)g(will)g(be)f(parsed)g(to)h(display)f -('Site)h(Con\002guration'.)97 b({th_bg},{th_te)o(xt},{ro)n(w_)o(on})o -(,{ro)m(w_)o(of)n(f)o(})44 b(-)50 b(Replaced)f(with)h(the)f(current)g -(theme)g(colors.)-600 81 y(and)c(the)g(follo)n(wing)e(special)i(types:) -91 b({lang_XXX})44 b(-)h(Filled)h(with)f(lang\('XXX'\).)89 -b({v)n(alue_XXX})43 b(-)i(Filled)h(with)f(the)g(current)f(v)n(alue)h -(of)f(con\002g)h(item)-600 180 y('XXX'.)95 b({selected_XXX})47 -b(-)h(set)h(to)e(\224,)h(or)g(')g(selected')f(if)h(an)g(option)e(v)n -(alue)h(is)i(current.)94 b({hook_XXX})46 b(-)i(Calls)h(a)f(function)e -(named)g(XXX)i(\(will)-600 280 y(be)54 b(discussed)g(later\).)109 -b({check)o(ed_XXX+YYY})51 b(-)k(Handles)f(checkbox/radio)c(v)n(alues)k -(set)h(to)g(YYY)f(or)g(\224)h(\(will)f(be)h(discussed)f(later\).)108 -b(F)o(ollo)n(wing)-600 380 y(is)70 b(an)f(e)o(xample)e(from)h(the)h -(addressbook)e(application:)g()e()-600 -479 y()c( )o({title})o()e -()96 b()-600 579 y( {erro)o(r})o()56 -b()61 b()i()i -()c( ) -28 b()33 b()27 b( {lang_Ad)o(dre)o(ssbook)o(}/{lan)o(g_)o -(Contact_)o(Setting)o(s})-600 778 y()121 -b()g()116 b -()25 b()31 -b(...)62 b(Note)30 b(the)h(\002eldname,)e(ne)n -(wsettings[contact_application].)d(This)31 b(array)f(name)g(must)h(be)f -(used)h(for)f(the)-600 977 y(form)e(v)n(alues.)h(Ne)o(xt,)g(note)f(the) -i(v)n(alue)e(setting)h(for)g(this)h(form)e(element,)h({v)n -(alue_contact_application}.)23 b(This)30 b(indicates)f(that)g(we)h(w)o -(ant)f(the)g(current)f(v)n(alue)h(of)g(the)-600 1077 -y(con\002g)21 b(setting,)h('contact_application',)c(to)k(be)g(set)h -(and)e(displayed)g(on)h(the)g(form.)f(Lastly)-5 b(,)21 -b(look)g(at)i(the)f(template)g(element,)f({lang_Contact_application}.)c -(Here,)22 b(the)-600 1177 y(v)n(alue)k(from)g(the)h(lang)f(db)g(table)h -(will)h(be)e(inserted)h(if)g(a)n(v)n(ailable.)53 b(Let')-5 -b(s)28 b(tak)o(e)e(a)i(look)e(at)h(part)f(of)h(the)g(preferences/def)o -(ault/con\002g.tpl:)49 b()-600 -1276 y()35 b()f()70 -b(Here,)34 b(we)h(are)g(adding)e(a)i(ne)n(w)f(element,)g -({hook_country_set}.)29 b(This)35 b(brings)f(up)g(the)g(ne)o(xt)g -(\002le)i(we)e(will)i(need)e(to)g(parse)h(this)g(v)n(alue,)-600 -1476 y(hook_con\002g.inc.php.)56 b(But)62 b(\002rst,)g(let')-5 -b(s)63 b(look)d(at)j(the)e(last)i(template)e(type,)g('check)o(ed':)f -()o({lang)o(_n)o(o})c({lang)o(_y)o(es})g(W)-7 -b(e)20 b(w)o(ant)f(to)f(check)g(the)h(v)n(alue)e(of)i(the)f(setting)h -('enable_remote_addressboo)o(k')o(.)13 b(The)-600 1774 -y(v)n(alue)18 b(could)h(be)g(\224)g(or)g('T)m(rue'.)f(W)-7 -b(e)20 b(use)g(the)f('+')g(character)f(to)h(isolate)h(the)f(con\002g)f -(name)h(from)f(the)h(check)f(v)n(alue.)h(If)g(the)g(v)n(alue)f(is)i -(empty)f(or)g(unset)g(in)g(the)g(phpgw_con\002g)-600 -1874 y(table,)38 b({check)o(ed_enable_remote_ad)o(dr)o(essboo)o(k+})32 -b(is)40 b(replaced)d(with)h(')h(check)o(ed'.)d(If)j(the)f(v)n(alue)g -(is)h('T)m(rue',{check)o(ed_enable_r)o(emo)o(te_ad)o(dr)o(essboo)o(k+T) -l(rue)o(})-600 1974 y(is)29 b(replaced)d(with)i(')g(check)o(ed'.)e -(Note)h(that)h(the)g(part)f(after)g(the)h('+')f(character)g(matches)g -(what)h(is)g(in)g(the)g(v)n(alue=\224XXX\224)e(part)i(in)g(the)f(html)h -(for)f(this)h(form)f(element.)-600 2073 y(hook_con\002g.inc.php)19 -b(\(optional\))49 b(At)26 b(each)f(in)m(v)n(ocation)e(of)i -(con\002g.php,)e(a)i(call)h(to)f(the)g(common)f(class)i(function)d -(hook_single\(\))f(is)27 b(made.)d(It)h(attempts)g(to)h(include)-600 -2173 y(a)31 b(\002le,)g(hook_con\002g.inc.php)24 b(as)31 -b(a)g(set)g(of)f(code)g(for)g(con\002g.php)d(to)k(use.)f(In)g(the)h -(case)f(of)g(the)h(preferences)d(e)o(xample)h(abo)o(v)o(e,)g(using)g -(hook_country_set,)d(here)k(is)-600 2273 y(the)39 b(corresponding)d -(function)i(in)i(preferences/inc/hook_con)o(\002g.in)o(c.ph)o(p:)34 -b(function)j(country_set\($con\002g\))e({)40 b($country)d(=)j(array\()e -('user_choice')f(=>)j('Users)-600 2372 y(Choice',)30 -b('force_select')e(=>)j('F)o(orce)e(Selectbox')h(\);)g(while)h(\(list)g -(\($k)o(e)o(y)-5 b(,)29 b($v)n(alue\))g(=)h(each)h(\($country\)\))c({)k -(if)f(\($con\002g['countrylist'])c(==)31 b($k)o(e)o(y\))e({)i -($selected)f(=)h(')-600 2472 y(selected';)23 b(})g(else)h({)g -($selected)e(=)i(\224;)f(})h($descr)e(=)i(lang\($v)n(alue\);)c($out)i -(.=)i('')g(.)g($descr)g(.)g('')e(.)i("\\n";)g(})h -(return)-600 2571 y($out;)31 b(})63 b(Note)31 b(again)g(the)g(template) -g(v)n(alue)g(we)g(used)g(earlier)m(,)g({hook_country_set}.)26 -b(This)31 b(causes)h(con\002g.php)d(to)i(look)g(for)f(a)i(function)e -(named)g(country_set\(\).)-600 2671 y(Since)j(we)g(included)e(the)i -(\002le)h(with)f(this)g(function)e(via)i(the)g(hook_single\(\))c(call,) -34 b(this)f(function)e(is)j(e)o(x)o(ecuted.)c(It')-5 -b(s)34 b(return)e(is)h(a)h(string,)e(and)g(the)h(function)e(prints)-600 -2771 y(nothing)25 b(itself.)54 b(hook_con\002g_v)n(alidate.in)o(c.p)o -(hp)20 b(\(optional\))52 b(Once)26 b(the)h(admin)e(clicks)i(the)f -(submit)g(b)n(utton)g(to)g(post)h(the)f(form,)g(we)g(can)h(optionally)d -(v)n(alidate)i(their)-600 2870 y(input)j(using)h(one)g(or)g(man)o(y)f -(dif)n(ferent)f(functions.)h(This)h(is)h(done)e(by)h(\002rst)h(making)e -(another)f(call)j(to)f(hook_single\(\))d(in)k(the)f(API)g(common)e -(class.)j(This)g(time,)f(the)-600 2970 y(name)k(con\002g_v)n(alidate)e -(is)j(used,)f(so)h(common)d(tries)j(to)g(include)e -('application/inc/hook_con\002g_)o(v)n(alid)o(ate.in)o(c.ph)o(p')o(.)64 -b(If)34 b(this)h(\002le)g(e)o(xists,)g(it)g(sets)h(a)f(v)n(ar)f(to)g -(tell)-600 3070 y(con\002g.php)c(it)j(w)o(as)g(found.)e(F)o(ollo)n -(wing)g(then)h(are)h(functions)e(named)g(after)h(each)g(con\002g)g(we)h -(w)o(ant)f(to)h(v)n(alidate.)f(The)g(follo)n(wing)f(e)o(xample)g(is)i -(for)f(addressbook:)-600 3169 y($GLOB)m(ALS['phpgw_info'][')-5 -b(serv)n(er')o(][)o('fo)o(un)o(d_)o(v)n(alid)o(ation)o(_h)o(oo)o(k'])35 -b(=)41 b(T)m(rue;)f(/*)h(Check)g(a)g(speci\002c)g(setting.)f(Name)h -(must)g(match)f(the)h(setting.)g(*/)g(function)-600 3269 -y(ldap_contact_conte)o(xt\($v)n(a)o(lue=\224\))e({)45 -b(if\($v)n(alue)f(==)h($GLOB)m(ALS['phpgw_info'][')-6 -b(serv)o(er)o('][)o(')o(ldap)o(_c)o(on)o(te)o(xt')o(]\))39 -b({)46 b($GLOB)m(ALS['con\002g_error'])40 b(=)45 b('Contact)-600 -3368 y(conte)o(xt)17 b(for)g(ldap)h(must)g(be)g(dif)n(ferent)f(from)g -(the)h(conte)o(xt)f(used)h(for)f(accounts';)g(})h(elseif\($v)n(alue)f -(==)h($GLOB)m(ALS['phpgw_info'][')-5 b(serv)n(er')o(][')n(ldap)o(_g)o -(rou)o(p_)o(con)o(te)o(x)o(t']\))-600 3468 y({)22 b($GLOB)m -(ALS['con\002g_error'])16 b(=)21 b('Contact)g(conte)o(xt)e(for)i(ldap)f -(must)i(be)f(dif)n(ferent)e(from)h(the)h(conte)o(xt)f(used)h(for)f -(groups';)g(})h(else)h({)f($GLOB)m(ALS['con\002g_error'])16 -b(=)-600 3568 y(\224;)24 b(})h(})48 b(Here)24 b(we)g(created)f(a)h -(function)f(to)h(check)f(the)g(entered)g(v)n(alue)g(for)h(the)f -(con\002g)g(item,)h(ldap_contact_conte)o(xt.)19 b(W)-7 -b(e)25 b(w)o(ant)f(to)g(mak)o(e)g(sure)f(the)h(admin)f(did)h(not)f(set) --600 3667 y(this)d(v)n(alue)f(to)g(one)g(which)g(w)o(ould)g(con\003ict) -g(with)h(another)e(con\002g)g(item,)i(used)f(for)g(accounts)f(or)h -(groups)f(in)i(phpGroupW)-7 b(are.)36 b(con\002g.php)17 -b(calls)k(this)e(function,)f(sending)-600 3767 y(it)j(the)g(POST)-6 -b(ed)21 b(v)n(alue.)f(con\002g.php)e(continues,)h(adding)g(all)j(other) -e(con\002g)f(items)j(from)d(the)i(POST)-6 b(ed)21 b(v)n(alues.)41 -b(The)21 b(v)n(ariable)e($GLOB)m(ALS['con\002g_error'])d(is)22 -b(parsed)-600 3867 y(through)e(lang\(\),)h(then)h(appended)e(to)j(the)f -(local)h(v)n(ariable,)e($error)-5 b(.)21 b(If)h(this)h(has)g(an)o(y)f -(v)n(alue)f(after)h(the)h(POST)-6 b(ed)22 b(v)n(ariables)g(are)g(check) -o(ed,)f(the)i(form)e(then)h(has)h(its)g({error})-600 -3966 y(tag)f(\002lled)g(with)f(this)i(result.)e(The)g(form)g(is)h -(displayed)f(again,)f(with)i(the)g(error)-5 b(.)20 b(If)i($error)e(has) -i(no)f(v)n(alue,)g(con\002g.php)e(redirects)i(to)g(admin/inde)o(x.php.) -40 b(Ho)n(we)n(v)o(er)m(,)19 b(there)-600 4066 y(is)i(one)e(more)g -(function)f(that)i(may)g(be)g(included)e(in)i(hook_con\002g_v)n -(alidate.inc.)o(ph)o(p:)35 b(/*)20 b(Check)g(all)g(settings)g(to)g(v)n -(alidate)f(input.)g(Name)h(must)g(be)g('\002nal_v)n(alidation')d(*/) --600 4165 y(function)36 b(\002nal_v)n(alidation\($v)n(alue=\224\))c({) -38 b(if\($v)n(alue['contact_repository)o('])32 b(==)38 -b(')o(ldap')e(&&)i(!$v)n(alue[')o(ldap_contact_d)o(n')o(]\))32 -b({)38 b($GLOB)m(ALS['con\002g_error'])32 b(=)-600 4265 -y('Contact)37 b(dn)g(must)h(be)f(set';)h(})g(elseif\($v)n -(alue['contact_repositor)o(y'])31 b(==)38 b(')o(ldap')f(&&)g(!$v)n -(alue[')o(ldap_contact_co)o(nte)n(xt'])o(\))32 b({)38 -b($GLOB)m(ALS['con\002g_error'])32 b(=)-600 4365 y('Contact)24 -b(conte)o(xt)f(must)i(be)f(set';)h(})g(else)h({)f($GLOB)m -(ALS['con\002g_error'])19 b(=)25 b(\224;)g(})g(})50 b(con\002g.php)22 -b(checks)i(for)g(the)g(e)o(xistence)g(of)g(the)h(function)e('\002nal_v) -n(alidation\(\)'.)-600 4464 y(This)31 b(function)e(can)i(be)g(used)g -(to)g(check)f(all)i(form)e(v)n(alues)g(at)i(once.)e(It)h(gets)h(sent)f -(the)g(entire)g($ne)n(wsettings)f(array)g(POST)-6 b(ed)31 -b(from)f(the)h(form.)f(As)h(with)h(the)f(other)-600 4564 -y(functions)19 b(in)h(this)h(\002le,)f(\002nal_v)n(alidation\(\))e -(should)h(set)i($GLOB)m(ALS['con\002g_error'])15 b(if)20 -b(there)g(is)h(a)g(problem.)p Black Black eop +1 0 bop Black 0 TeXcolorgray Black Black 505 647 a Ff(phpGr)l(oupW)-8 +b(are)58 b(admin/con\002g.php)695 879 y Fe(A)21 b(brief)e(introduction) +f(to)i(writing)g(hooks)f(and)h(templates)g(for)f(an)o(y)h(application)e +(to)j(use)f(this)695 987 y(admin)f(interf)o(ace,)h(by)695 +1136 y(Miles)h(Lott)f()15 +b(Dec)20 b(22,)g(2001.)-2 1854 y Fd(1.)39 b(Files)-2 +2182 y Fc(1.1.)34 b(con\002g.tpl)h(\(required\))396 2350 +y Fe(In)20 b(your)f(application/templates/def)o(ault)e(directory)-5 +b(,)18 b(create)i(a)g(ne)n(w)g(template)g(\002le)h(named)e +('con\002g.tpl'.)f(This)i(will)396 2458 y(be)g(included)f(by)h +(con\002g.php)d(and)j(used)g(to)g(dra)o(w)g(the)g(page.)f(This)i +(template)e(should)h(include)f(a)h(POST)h(method)396 +2566 y(form.)e(The)h(follo)n(wing)f(template)g(tags)i(may)e(be)i(used:) +p Black 463 2798 a(1.)p Black 40 w({action_url})e(-)h(A)h(phpgw->link)c +(to)j(con\002g.php)e(will)j(be)f(inserted.)p Black 463 +2947 a(2.)p Black 40 w({title})h(-)f(This)h(will)g(be)f(parsed)f(to)i +(display)e('Site)i(Con\002guration'.)p Black 463 3097 +a(3.)p Black 40 w({th_bg},{th_te)o(xt},{ro)n(w_on)o(},{r)o(o)n(w_)o(of) +m(f})15 b(-)20 b(Replaced)g(with)g(the)g(current)f(theme)h(colors.)396 +3246 y(and)g(the)g(follo)n(wing)f(special)h(types:)p +Black 463 3479 a(1.)p Black 40 w({lang_XXX})f(-)i(Filled)f(with)h +(lang\('XXX'\).)p Black 463 3628 a(2.)p Black 40 w({v)n(alue_XXX})e(-)h +(Filled)h(with)f(the)g(current)f(v)n(alue)h(of)g(con\002g)f(item)h +('XXX'.)p Black 463 3778 a(3.)p Black 40 w({selected_XXX})g(-)g(set)h +(to)f(\224,)h(or)f(')g(selected')g(if)g(an)h(option)d(v)n(alue)i(is)h +(current.)p Black 463 3927 a(4.)p Black 40 w({hook_XXX})d(-)j(Calls)g +(a)g(function)d(named)h(XXX)i(\(will)f(be)h(discussed)f(later\).)396 +4077 y(F)o(ollo)n(wing)f(is)i(an)f(e)o(xample)f(from)g(the)h +(addressbook)e(application:)396 4257 y Fb()396 4354 y()441 4451 y()486 +4548 y( {title}<)o(/td>)441 +4645 y()i()486 4742 y( {error})441 +4840 y()p Black 3842 5278 a Fa(1)p Black eop +%%Page: 2 2 +2 1 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8 +b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a +Fb()396 676 y()441 +773 y()486 870 y( )441 967 y()441 1065 y()486 1162 y( {lang_Addressbook}/{)o(lang_C)o(ontact)o(_Setti)o +(ngs}<)o(/b>)396 1259 y()441 1356 y()441 +1453 y()486 1550 y +()486 1647 y()441 1745 y()396 +1842 y(...)396 2130 y Fe(Note)20 b(the)h(\002eldname,)e(ne)n +(wsettings[contact_application].)c(This)20 b(array)f(name)h(must)g(be)g +(used)g(for)g(the)g(form)f(v)n(alues.)396 2238 y(Ne)o(xt,)h(note)g(the) +g(v)n(alue)f(setting)i(for)e(this)i(form)e(element,)g({v)n +(alue_contact_application}.)c(This)20 b(indicates)g(that)h(we)396 +2346 y(w)o(ant)g(the)f(current)f(v)n(alue)g(of)h(the)g(con\002g)g +(setting,)g('contact_application',)c(to)k(be)g(set)h(and)f(displayed)f +(on)g(the)i(form.)396 2454 y(Lastly)-5 b(,)20 b(look)f(at)i(the)f +(template)g(element,)f({lang_Contact_application}.)d(Here,)j(the)i(v)n +(alue)e(from)g(the)i(lang)e(db)h(table)396 2561 y(will)h(be)f(inserted) +g(if)g(a)n(v)n(ailable.)396 2711 y(Let')-5 b(s)21 b(tak)o(e)f(a)h(look) +e(at)i(part)f(of)g(the)g(preferences/def)o(ault/con\002g.tpl:)441 +2891 y Fb()486 2988 y +()441 3571 y()396 3859 y Fe(Here,)20 b(we)h(are)f(adding)f +(a)h(ne)n(w)g(element,)f({hook_country_set}.)d(This)k(brings)f(up)h +(the)g(ne)o(xt)g(\002le)h(we)f(will)h(need)f(to)396 3967 +y(parse)g(this)h(v)n(alue...)-2 4337 y Fc(1.2.)34 b +(hook_con\002g.inc.php)j(\(optional\))396 4504 y Fe(At)21 +b(each)f(in)m(v)n(ocation)e(of)i(con\002g.php,)d(a)k(call)g(to)f(the)g +(common)f(class)i(function)d(hook_single\(\))f(is)k(made.)f(It)g +(attempts)396 4612 y(to)h(include)e(a)h(\002le,)h +(hook_con\002g.inc.php)14 b(as)21 b(a)g(set)g(of)f(code)f(for)h +(con\002g.php)d(to)k(use.)f(In)g(the)g(case)h(of)f(the)g(preferences) +396 4720 y(e)o(xample)f(abo)o(v)o(e,)f(using)i(hook_country_set,)15 +b(here)20 b(is)h(the)f(corresponding)d(function)i(in)396 +4828 y(preferences/inc/hook_con\002g.)o(inc.p)o(hp)o(:)p +Black 3842 5278 a Fa(2)p Black eop +%%Page: 3 3 +3 2 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8 +b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a +Fb(function)44 b(country_set\($config\))396 676 y({)576 +773 y($country)f(=)i(array\()f('user_choice')e(=>)j('Users)f(Choice',)f +('force_select')f(=>)j('Force)f(Se-)396 870 y(lectbox')g(\);)576 +967 y(while)g(\(list)g(\($key,)f($value\))h(=)h(each)f(\($country\)\)) +576 1065 y({)755 1162 y(if)g(\($config['countrylist'])d(==)k($key\))755 +1259 y({)934 1356 y($selected)f(=)g(')h(selected';)755 +1453 y(})755 1550 y(else)755 1647 y({)934 1745 y($selected)f(=)g(\224;) +755 1842 y(})755 1939 y($descr)g(=)g(lang\($value\);)755 +2036 y($out)g(.=)h('')f(.)h($descr)f(.)g('')f(.)i("\\n";)576 +2133 y(})576 2230 y(return)e($out;)396 2327 y(})396 2615 +y Fe(Note)20 b(again)g(the)g(template)f(v)n(alue)h(we)h(used)e(earlier) +m(,)h({hook_country_set}.)15 b(This)20 b(causes)h(con\002g.php)c(to)k +(look)e(for)h(a)396 2723 y(function)f(named)g(country_set\(\).)e(Since) +j(we)h(included)d(the)j(\002le)g(with)f(this)h(function)d(via)i(the)g +(hook_single\(\))d(call,)396 2831 y(this)k(function)d(is)k(e)o(x)o +(ecuted.)c(It')-5 b(s)21 b(return)e(is)i(a)f(string,)g(and)g(the)g +(function)e(prints)i(nothing)f(itself.)-2 3201 y Fc(1.3.)34 +b(hook_con\002g_v)n(alidate)r(.inc.php)39 b(\(optional\))396 +3369 y Fe(Once)20 b(the)g(admin)g(clicks)g(the)g(submit)g(b)n(utton)f +(to)i(post)f(the)g(form,)f(we)i(can)f(optionally)e(v)n(alidate)i(their) +g(input)f(using)396 3477 y(one)h(or)g(man)o(y)f(dif)n(ferent)f +(functions.)h(This)h(is)h(done)e(by)h(\002rst)h(making)e(another)g +(call)h(to)h(hook_single\(\))c(in)j(the)g(API)396 3584 +y(common)f(class.)h(This)h(time,)f(the)g(name)g(con\002g_v)n(alidate)d +(is)k(used,)f(so)h(common)d(tries)j(to)f(include)396 +3692 y('application/inc/hook_con\002g_)o(v)n(a)o(lidate.in)o(c.p)o(hp)o +('.)396 3842 y(If)g(this)h(\002le)g(e)o(xists,)f(it)h(sets)g(a)g(v)n +(ar)f(to)g(tell)h(con\002g.php)d(it)i(w)o(as)i(found.)c(F)o(ollo)n +(wing)h(then)g(are)h(functions)f(named)g(after)396 3950 +y(each)h(con\002g)f(we)i(w)o(ant)f(to)h(v)n(alidate.)e(The)h(follo)n +(wing)e(e)o(xample)h(is)i(for)f(addressbook:)576 4130 +y Fb($GLOBALS['phpgw_info']['server']['fou)o(nd_val)o(idatio)o(n_hook)o +('])39 b(=)45 b(True;)576 4227 y(/*)f(Check)g(a)h(specific)e(setting.)h +(Name)g(must)g(match)g(the)g(setting.)g(*/)576 4324 y(function)f +(ldap_contact_context\($value=\224\))576 4421 y({)755 +4518 y(if\($value)g(==)i($GLOBALS['phpgw_info']['server']['ldap)o +(_conte)o(xt']\))755 4616 y({)934 4713 y($GLOBALS['config_error'])c(=)k +('Contact)e(context)h(for)g(ldap)g(must)g(be)h(differ-)396 +4810 y(ent)g(from)f(the)g(context)g(used)g(for)g(accounts';)p +Black 3842 5278 a Fa(3)p Black eop +%%Page: 4 4 +4 3 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8 +b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 755 579 a +Fb(})755 676 y(elseif\($value)43 b(==)h +($GLOBALS['phpgw_info']['server']['ldap_g)o(roup_)o(contex)o(t']\))755 +773 y({)934 870 y($GLOBALS['config_error'])d(=)k('Contact)e(context)h +(for)g(ldap)g(must)g(be)h(differ-)396 967 y(ent)g(from)f(the)g(context) +g(used)g(for)g(groups';)755 1065 y(})755 1162 y(else)755 +1259 y({)934 1356 y($GLOBALS['config_error'])d(=)k(\224;)755 +1453 y(})576 1550 y(})396 1838 y Fe(Here)20 b(we)f(created)g(a)h +(function)e(to)i(check)e(the)i(entered)e(v)n(alue)h(for)g(the)g +(con\002g)g(item,)g(ldap_contact_conte)o(xt.)c(W)-7 b(e)21 +b(w)o(ant)396 1946 y(to)g(mak)o(e)e(sure)h(the)h(admin)e(did)h(not)g +(set)h(this)f(v)n(alue)g(to)g(one)g(which)g(w)o(ould)f(con\003ict)h +(with)g(another)f(con\002g)g(item,)h(used)396 2054 y(for)g(accounts)f +(or)h(groups)f(in)h(phpGroupW)-7 b(are.)396 2204 y(con\002g.php)18 +b(calls)j(this)g(function,)d(sending)h(it)i(the)f(POST)-6 +b(ed)20 b(v)n(alue.)f(con\002g.php)f(continues,)h(adding)g(all)h(other) +g(con\002g)396 2312 y(items)h(from)e(the)h(POST)-6 b(ed)21 +b(v)n(alues.)396 2461 y(The)f(v)n(ariable)f($GLOB)m +(ALS['con\002g_error'])c(is)21 b(parsed)f(through)e(lang\(\),)h(then)g +(appended)f(to)j(the)f(local)g(v)n(ariable,)396 2569 +y($error)-5 b(.)19 b(If)h(this)h(has)f(an)o(y)g(v)n(alue)f(after)h(the) +g(POST)-6 b(ed)20 b(v)n(ariables)g(are)g(check)o(ed,)f(the)h(form)f +(then)h(has)g(its)h({error})e(tag)396 2677 y(\002lled)i(with)f(this)h +(result.)f(The)g(form)f(is)i(displayed)e(again,)g(with)h(the)g(error)-5 +b(.)20 b(If)g($error)e(has)j(no)e(v)n(alue,)h(con\002g.php)396 +2785 y(redirects)g(to)g(admin/inde)o(x.php.)396 2934 +y(Ho)n(we)n(v)o(er)m(,)e(there)i(is)h(one)f(more)f(function)g(that)h +(may)g(be)g(included)e(in)j(hook_con\002g_v)n(alidate.inc)o(.ph)o(p:) +576 3114 y Fb(/*)44 b(Check)g(all)g(settings)g(to)g(validate)g(input.)g +(Name)g(must)g(be)h('final_validation')c(*/)576 3212 +y(function)i(final_validation\($value=\224\))576 3309 +y({)755 3406 y(if\($value['contact_repository'])d(==)k('ldap')g(&&)g +(!$value['ldap_contact_dn']\))755 3503 y({)934 3600 y +($GLOBALS['config_error'])d(=)k('Contact)e(dn)i(must)f(be)g(set';)755 +3697 y(})755 3794 y(elseif\($value['contact_repository'])39 +b(==)44 b('ldap')g(&&)h(!$value['ldap_contact_context']\))755 +3891 y({)934 3989 y($GLOBALS['config_error'])c(=)k('Contact)e(context)h +(must)g(be)h(set';)755 4086 y(})755 4183 y(else)755 4280 +y({)934 4377 y($GLOBALS['config_error'])c(=)k(\224;)755 +4474 y(})576 4571 y(})p Black 3842 5278 a Fa(4)p Black +eop +%%Page: 5 5 +5 4 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8 +b(ar)m(e)19 b(admin/con\002g)o(.php)p Black 396 579 a +Fe(con\002g.php)f(checks)i(for)f(the)h(e)o(xistence)g(of)g(the)g +(function)e('\002nal_v)n(alidation\(\)'.)f(This)j(function)e(can)i(be)g +(used)g(to)396 687 y(check)g(all)g(form)g(v)n(alues)f(at)i(once.)e(It)i +(gets)f(sent)h(the)f(entire)g($ne)n(wsettings)f(array)g(POST)-6 +b(ed)21 b(from)e(the)h(form.)f(As)i(with)396 795 y(the)f(other)g +(functions)f(in)h(this)h(\002le,)f(\002nal_v)n(alidation\(\))d(should)j +(set)h($GLOB)m(ALS['con\002g_error'])15 b(if)20 b(there)g(is)h(a)396 +903 y(problem.)p Black 3842 5278 a Fa(5)p Black eop +%%Page: 6 6 +6 5 bop Black 0 TeXcolorgray Black 2778 67 a Fa(phpGr)l(oupW)-8 +b(ar)m(e)19 b(admin/con\002g)o(.php)p Black Black 3840 +5278 a(6)p Black eop %%Trailer end userdict /end-hook known{end-hook}if diff --git a/admin/doc/adminconfig.sgml b/admin/doc/adminconfig.sgml index cf4123e770..e1251c01b5 100644 --- a/admin/doc/adminconfig.sgml +++ b/admin/doc/adminconfig.sgml @@ -67,11 +67,6 @@ {hook_XXX} - Calls a function named XXX (will be discussed later). - - - - {checked_XXX+YYY} - Handles checkbox/radio values set to YYY or '' (will be discussed later). - @@ -117,14 +112,7 @@ ]]> ]]> - Here, we are adding a new element, {hook_country_set}. This brings up the next file we will need to parse this value, hook_config.inc.php. But first, let's look at the last template type, 'checked': - - -{lang_no} -]]>{lang_yes} -]]> - - We want to check the value of the setting 'enable_remote_addressbook'. The value could be '' or 'True'. We use the '+' character to isolate the config name from the check value. If the value is empty or unset in the phpgw_config table, {checked_enable_remote_addressbook+} is replaced with ' checked'. If the value is 'True',{checked_enable_remote_addressbook+True} is replaced with ' checked'. Note that the part after the '+' character matches what is in the value=”XXX” part in the html for this form element. + Here, we are adding a new element, {hook_country_set}. This brings up the next file we will need to parse this value... diff --git a/admin/doc/adminconfig.txt b/admin/doc/adminconfig.txt index 55cc0c8354..1f1fdaa659 100644 --- a/admin/doc/adminconfig.txt +++ b/admin/doc/adminconfig.txt @@ -1,15 +1,10 @@ - phpGroupWare admin/config.php Abstract -A brief introduction to writing hooks and templates for any -application to use this admin interface, by - -Abstract - -Miles Lott Dec 22, 2001. +A brief introduction to writing hooks and templates for any application to use +this admin interface, by Miles Lott Dec 22, 2001. 1 Files @@ -22,70 +17,39 @@ include a POST method form. The following template tags may be used: 1. {action_url} - A phpgw->link to config.php will be inserted. - 2. {title} - This will be parsed to display 'Site Configuration'. - -3. {th_bg},{th_text},{row_on},{row_off} - Replaced with the - current theme colors. +3. {th_bg},{th_text},{row_on},{row_off} - Replaced with the current theme colors. and the following special types: 1. {lang_XXX} - Filled with lang('XXX'). - -2. {value_XXX} - Filled with the current value of config item - 'XXX'. - -3. {selected_XXX} - set to '', or ' selected' if an option - value is current. - -4. {hook_XXX} - Calls a function named XXX (will be discussed - later). - -5. {checked_XXX+YYY} - Handles checkbox/radio values set to - YYY or '' (will be discussed later). +2. {value_XXX} - Filled with the current value of config item 'XXX'. +3. {selected_XXX} - set to '', or ' selected' if an option value is current. +4. {hook_XXX} - Calls a function named XXX (will be discussed later). Following is an example from the addressbook application: -
{display_col}:{ref_data}
{lang_Contact_application}:)g(
{lang_Country_Selection})35 b(\({lang_T)-6 -b(e)o(xt_Entry}/{lang_)o(SelectBox}\))o(:)40 -b()36 b -({hook_country_set})-600 1376 y()f(
{lang_Contact_application}:
{lang_Country_Selection})c +(\({lang_Text_Entry}/{lang_SelectBox}\):)486 +3085 y()531 3182 y()396 +3280 y({hook_country_set})531 3377 y()486 3474 +y(
- - - - - - - - - - - - - - - - - ... Note the fieldname, newsettings[contact_application]. This @@ -100,40 +64,16 @@ if available. Let's take a look at part of the preferences/default/config.tpl: - - - Here, we are adding a new element, {hook_country_set}. This -brings up the next file we will need to parse this value, -hook_config.inc.php. But first, let's look at the last template -type, 'checked': - -{lang_no} - -{lang_yes} - -We want to check the value of the setting 'enable_remote_addressbook'. -The value could be '' or 'True'. We use the '+' character -to isolate the config name from the check value. If the -value is empty or unset in the phpgw_config table, {checked_enable_remote_addressbook+} -is replaced with ' checked'. If the value is 'True',{checked_enable_remote_addressbook+True} -is replaced with ' checked'. Note that the part after the -'+' character matches what is in the value="XXX" -part in the html for this form element. +brings up the next file we will need to parse this value... 1.2 hook_config.inc.php (optional) @@ -145,41 +85,22 @@ hook_country_set, here is the corresponding function in preferences/inc/hook_config.inc.php: function country_set($config) - { - - $country = array( 'user_choice' => 'Users Choice', 'force_select' -=> 'Force Selectbox' ); - + $country = array( 'user_choice' => 'Users Choice', 'force_select' => 'Force Selectbox' ); while (list ($key, $value) = each ($country)) - { - if ($config['countrylist'] == $key) - { - $selected = ' selected'; - } - else - { - $selected = ''; - } - $descr = lang($value); - - $out .= '' . "\n"; - + $out .= '' . "\n"; } - return $out; - } Note again the template value we used earlier, {hook_country_set}. @@ -202,42 +123,24 @@ was found. Following then are functions named after each config we want to validate. The following example is for addressbook: - $GLOBALS['phpgw_info']['server']['found_validation_hook'] -= True; + $GLOBALS['phpgw_info']['server']['found_validation_hook'] = True; - /* Check a specific setting. Name must match the setting. -*/ + /* Check a specific setting. Name must match the setting. */ function ldap_contact_context($value='') - { - if($value == $GLOBALS['phpgw_info']['server']['ldap_context']) - { - - $GLOBALS['config_error'] = 'Contact context for -ldap must be different from the context used for accounts'; - + $GLOBALS['config_error'] = 'Contact context for ldap must be different from the context used for accounts'; } - elseif($value == $GLOBALS['phpgw_info']['server']['ldap_group_context']) - { - - $GLOBALS['config_error'] = 'Contact context for -ldap must be different from the context used for groups'; - + $GLOBALS['config_error'] = 'Contact context for ldap must be different from the context used for groups'; } - else - { - $GLOBALS['config_error'] = ''; - } - } Here we created a function to check the entered value for @@ -260,40 +163,21 @@ config.php redirects to admin/index.php. However, there is one more function that may be included in hook_config_validate.inc.php: - /* Check all settings to validate input. Name must be -'final_validation' */ - + /* Check all settings to validate input. Name must be 'final_validation' */ function final_validation($value='') - { - if($value['contact_repository'] == 'ldap' && !$value['ldap_contact_dn']) - { - - $GLOBALS['config_error'] = 'Contact dn must be -set'; - + $GLOBALS['config_error'] = 'Contact dn must be set'; } - - elseif($value['contact_repository'] == 'ldap' && -!$value['ldap_contact_context']) - + elseif($value['contact_repository'] == 'ldap' && !$value['ldap_contact_context']) { - - $GLOBALS['config_error'] = 'Contact context must -be set'; - + $GLOBALS['config_error'] = 'Contact context must be set'; } - else - { - $GLOBALS['config_error'] = ''; - } - } config.php checks for the existence of the function 'final_validation()'. diff --git a/admin/help/DE/account.php b/admin/help/DE/account.php new file mode 100644 index 0000000000..fe2abe1f2a --- /dev/null +++ b/admin/help/DE/account.php @@ -0,0 +1,32 @@ + 'manual', + 'admin_header' => True, + ); + $phpgw_info['flags'] = $phpgw_flags; + include('../../../header.inc.php'); + $appname = 'admin'; +?> + +

   +Diese Funktion ist normalerweise nur für den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle. +

    +
  • Benutzerkonten-Verwaltung:

       +Benutzerkonten:
    +Erstellen, Edittieren und löschen von Benutzerkonten. Setzen von Gruppenmidgliedschaft und der Zugriff auf Programme.

       +Benutzergruppen:
    +Erstellen, Edittieren und löschen von Benutzergruppen.

       +

+common->phpgw_footer(); ?> diff --git a/admin/help/DE/admin.php b/admin/help/DE/admin.php new file mode 100644 index 0000000000..6e6806309d --- /dev/null +++ b/admin/help/DE/admin.php @@ -0,0 +1,54 @@ + 'manual', + 'admin_header' => True, + ); + $phpgw_info['flags'] = $phpgw_flags; + include('../../../header.inc.php'); + $appname = 'admin'; +?> + +

     +Diese Funktion ist normalerweise nur für den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle. +

    +
  • Benutzerkonten-Verwaltung:
    +Benutzerkonten:
    +Erstellen, Edittieren und löschen von Benutzerkonten. Setzen von Gruppenmidgliedschaft und der Zugriff auf Programme.
    Benutzergruppen:
    + Erstellen, Editieren und löschen von Benutzergruppen. +

         +

  • Sitzungs-Verwaltung:
    + Session's anzeigen::
    +Aktuelle Sitzungen, IP's, Login-Zeit, Inaktivitätszeit und die Möglichkeit sessions zu beenden (kill).
    +Zugriffsaufzeichnungen (Access Log) anzeigen:
    + LoginId, IP, Login Time (Zeit), Logout Time (Zeit), Total time spent (gesamte + Verbrachte Zeit).
  • +

         +

  • Headline-Seiten (Schlagzeilen):
    + Administrieren von Headline-Seiten die von den Benutzern im Headline Programm + gesehen werden.
    +Edit: Optionen für die Headline-Seiten:
    + Anzeige, BasisURL, NewsDatei, Minuten zwischen Neuladungen (reloads), Angezeigte + Auflistung und die Art der Neuigkeiten.
    + Löschen:Entfernen von einer existierenden Headline-Seite, klicken + auf Löschen bringt Sie auf eine Überprüffungsseite, um das löschen + zu verifizieren.
    +Anzeigen:Zeigt die Optionen wie in Edit.
    +Hinzufügen:Formular um eine neue Headline-Seite hinzuzufügen, wie in Edit.
  •      +

  • Netzwerk News:
    +Manuelle Aktualisierung für Newsgruppen.
  •      +

  • Server Information:
    +Zeigt die phpinfo(); des Servers an.
  •      +

+common->phpgw_footer(); ?> diff --git a/admin/help/DE/other.php b/admin/help/DE/other.php new file mode 100644 index 0000000000..36539853d9 --- /dev/null +++ b/admin/help/DE/other.php @@ -0,0 +1,33 @@ + 'manual', + 'admin_header' => True, + 'enable_utilities_class' => True + ); + $phpgw_info['flags'] = $phpgw_flags; + include('../../../header.inc.php'); + $appname = 'admin'; +?> + +

    +Diese Funktion ist normalerweise nur für den Administrator zugänglich. Administration +aller Programme, Benutzer und Benutzergruppen und Sitzung's/Logging Kontrolle. +

  • Netzwerk News:
    +Manuelle Aktualisierung für Newsgruppen.
  •     +

  • Server Information:
    + Zeigt die phpinfo(); des Server's an.
  • +

        +

+common->phpgw_footer(); ?> diff --git a/admin/help/DE/session.php b/admin/help/DE/session.php new file mode 100644 index 0000000000..07ea40e73f --- /dev/null +++ b/admin/help/DE/session.php @@ -0,0 +1,35 @@ + 'manual', + 'admin_header' => True, + 'enable_utilities_class' => True + ); + $phpgw_info['flags'] = $phpgw_flags; + include('../../../header.inc.php'); + $appname = 'admin'; +?> + + +

+Diese Funktion ist normalerweise nur für den Administrator zugänglich. Administration aller Programme, Benutzer und Benutzergruppen und Sitzungs/Logging Kontrolle. +

    +
  • Session : +

    Sessions anzeigen: +
    Aktuelle Sitzungen, IP's, Login-Zeit, Inaktivitätszeit und die Möglichkeit sessions zu beenden (kill). +

    Zugriffsaufzeichnungen (Access Log) anzeigen: +
    + LoginId, IP, Login Time (Zeit), Logout Time (Zeit), Total time spent (gesamte + verbrachte Zeit).

+common->phpgw_footer(); ?> diff --git a/admin/help/EN/account.php b/admin/help/EN/account.php index bcb28134b7..c259892d75 100755 --- a/admin/help/EN/account.php +++ b/admin/help/EN/account.php @@ -30,3 +30,4 @@ Create, edit and delete users accounts. Set membership of groups, and access to User groups:
Create, edit and delete groups.

+common->phpgw_footer(); ?> diff --git a/admin/help/EN/admin.php b/admin/help/EN/admin.php index cb474dbaf8..cafc5aff26 100755 --- a/admin/help/EN/admin.php +++ b/admin/help/EN/admin.php @@ -46,3 +46,4 @@ Manual update for news groups.

  • Server information:
    At present phpinfo of the server that is running.
  • +common->phpgw_footer(); ?> diff --git a/admin/help/EN/other.php b/admin/help/EN/other.php index a0524dbe63..236d78f639 100755 --- a/admin/help/EN/other.php +++ b/admin/help/EN/other.php @@ -29,3 +29,4 @@ Manual update for news groups.

  • Server information:
    At present phpinfo of the server that is running.
  • +common->phpgw_footer(); ?> diff --git a/admin/help/EN/session.php b/admin/help/EN/session.php index 86e7853d00..31a68f2501 100755 --- a/admin/help/EN/session.php +++ b/admin/help/EN/session.php @@ -32,3 +32,4 @@ Administration of all applications, user and group accounts, session logging and

    View Access Log:
    LoginId, IP, Login Time, Logout Time, Total time spent. +common->phpgw_footer(); ?> diff --git a/admin/help/FI/account.php b/admin/help/FI/account.php index 52628033ea..5c52f1d97d 100644 --- a/admin/help/FI/account.php +++ b/admin/help/FI/account.php @@ -32,3 +32,4 @@ ryhm Käyttäjäryhmät:
    Toiminnolla voit lisätä, muuttaa ja poistaa käyttäjäryhmiä.

    +common->phpgw_footer(); ?> diff --git a/admin/help/FI/admin.php b/admin/help/FI/admin.php index bd893b8238..50998b5cd4 100644 --- a/admin/help/FI/admin.php +++ b/admin/help/FI/admin.php @@ -50,3 +50,4 @@ Uutisryhmien p

  • Palvelimen tiedot:
    Tällä hetkellä palvelimen phpinfo.
  • +common->phpgw_footer(); ?> diff --git a/admin/help/FI/other.php b/admin/help/FI/other.php index 0936a17b69..f2cc7269cd 100644 --- a/admin/help/FI/other.php +++ b/admin/help/FI/other.php @@ -30,3 +30,4 @@ Uutisryhmien p

  • Palvelimen tiedot:
    Tällä hetkellä palvelimen phpinfo.
  • +common->phpgw_footer(); ?> diff --git a/admin/help/FI/session.php b/admin/help/FI/session.php index 5d6ead5d42..10f78bac5b 100644 --- a/admin/help/FI/session.php +++ b/admin/help/FI/session.php @@ -34,3 +34,4 @@ on ollut tekem

    Näytä käyttöloki:
    Tunnus, IP-osoite, Sisäänkirjautumisaika, Uloskirjautumisaika, Istunnon kesto. +common->phpgw_footer(); ?> diff --git a/admin/help/JA/account.php b/admin/help/JA/account.php index d37e04e78a..e97c8894ed 100644 --- a/admin/help/JA/account.php +++ b/admin/help/JA/account.php @@ -30,3 +30,4 @@ ¥æ¡¼¥¶¥°¥ë¡¼¥×:
    ¥æ¡¼¥¶¤¬½ê°¤¹¤ë¥°¥ë¡¼¥×¤òÄɲá¢ÄûÀµºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

    +common->phpgw_footer(); ?> diff --git a/admin/help/JA/admin.php b/admin/help/JA/admin.php index edff4e6b98..4218bac9cc 100644 --- a/admin/help/JA/admin.php +++ b/admin/help/JA/admin.php @@ -51,3 +51,4 @@ you a checking page to be sure you do want to delete.

  • ¥µ¡¼¥Ð¾ðÊó:
    ¥µ¡¼¥Ð¤ÇÆ°ºî¤·¤Æ¤¤¤ë PHP ¤Î¾ðÊó¤ò¡¢phpinfo() ¤Çɽ¼¨¤·¤Þ¤¹¡£
  • +common->phpgw_footer(); ?> diff --git a/admin/help/JA/other.php b/admin/help/JA/other.php index 606df88473..af359ce4ba 100644 --- a/admin/help/JA/other.php +++ b/admin/help/JA/other.php @@ -29,3 +29,4 @@

  • ¥µ¡¼¥Ð¾ðÊó:
    ¥µ¡¼¥Ð¤ÇÆ°ºî¤·¤Æ¤¤¤ë PHP ¤Î¾ðÊó¤ò¡¢phpinfo() ¤Çɽ¼¨¤·¤Þ¤¹¡£
  • +common->phpgw_footer(); ?> diff --git a/admin/help/JA/session.php b/admin/help/JA/session.php index f3bcedef4e..807bdc1260 100644 --- a/admin/help/JA/session.php +++ b/admin/help/JA/session.php @@ -32,3 +32,4 @@

    ¥¢¥¯¥»¥¹¥í¥°»²¾È:
    phpGroupWare¤Ø¤Î¥¢¥¯¥»¥¹¥í¥°¤òɽ¼¨¤·¤Þ¤¹¡£¥í¥°¥¤¥óID,IP¥¢¥É¥ì¥¹,¥í¥°¥¤¥ó»þ´Ö,¥í¥°¥¢¥¦¥È»þ´Ö,ÍøÍÑ»þ´Ö¤òɽ¼¨¤·¤Þ¤¹¡£ +common->phpgw_footer(); ?> diff --git a/admin/help/index.php b/admin/help/index.php index 30d99b641b..cb180ca5dd 100755 --- a/admin/help/index.php +++ b/admin/help/index.php @@ -24,3 +24,4 @@ Version: +common->phpgw_footer(); ?> diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index 1318246769..ba33115697 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -1,37 +1,35 @@ * - * ----------------------------------------------------- * + * -------------------------------------------- * * 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 boaccounts { var $so; - var $public_functions = array - ( - 'add_group' => True, - 'delete_group' => True, - 'delete_user' => True, - 'edit_group' => True, - 'save_user' => True, + var $public_functions = array( + 'add_group' => True, + 'add_user' => True, + 'delete_group' => True, + 'delete_user' => True, + 'edit_group' => True, + 'edit_user' => True, 'set_group_managers' => True ); var $xml_functions = array(); - var $soap_functions = array - ( - 'add_user' => array - ( - 'in' => array('int','struct'), - 'out' => array() + var $soap_functions = array( + 'add_user' => array( + 'in' => array('int', 'struct'), + 'out' => array() ) ); @@ -77,28 +75,113 @@ } } - function check_rights($action, $access = 'group_access') + function delete_group() { - switch($action) + if (!@isset($_POST['account_id']) || !@$_POST['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) { - case 'view': $right = '8'; break; - case 'add': $right = '4'; break; - case 'edit': $right = '16'; break; - case 'delete': $right = '32'; break; - case 'search': $right = '2'; break; + ExecMethod('admin.uiaccounts.list_groups'); + return False; + } + + $account_id = intval($_POST['account_id']); + + $GLOBALS['phpgw']->db->lock( + Array( + 'phpgw_accounts', + 'phpgw_acl' + ) + ); + + $old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group'); + + @reset($old_group_list); + while($old_group_list && $id = each($old_group_list)) + { + $GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1])); + $GLOBALS['phpgw']->session->delete_cache(intval($id[1])); } - if (!$GLOBALS['phpgw']->acl->check($access,$right,'admin')) + $GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id); + + if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id))) { - return True; + $cd = 38; } - return False; + else + { + $cd = 32; + } + + $GLOBALS['phpgw']->accounts->delete($account_id); + + $GLOBALS['phpgw']->db->unlock(); + + Header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); + $GLOBALS['phpgw']->common->phpgw_exit(); } - - function add_group($values) + function delete_user() { - $temp_users = ($values['account_user']?$values['account_user']:Array()); + if (isset($_POST['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) + { + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + elseif($_POST['delete_account']) + { + $accountid = $_POST['account_id']; + settype($account_id,'integer'); + $account_id = get_account_id($accountid); + // make this information also in hook available + $lid = $GLOBALS['phpgw']->accounts->id2name($account_id); + $db = $GLOBALS['phpgw']->db; + $db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__); + if($db->num_rows()) + { + while($db->next_record()) + { + $appname = $db->f('app_name'); + + if($appname <> 'admin') + { + $GLOBALS['phpgw']->hooks->single('deleteaccount', $appname); + } + } + } + + $GLOBALS['hook_values']['account_id'] = $account_id; + $GLOBALS['hook_values']['account_lid'] = $lid; + + $GLOBALS['phpgw']->hooks->single('deleteaccount','preferences'); + $GLOBALS['phpgw']->hooks->single('deleteaccount','admin'); + + $GLOBALS['phpgw']->hooks->process('deleteaccount'); + + $basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP; + + if (! @rmdir($basedir . $lid)) + { + $cd = 34; + } + else + { + $cd = 29; + } + + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + } + + function add_group() + { + if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + { + ExecMethod('admin.uiaccounts.list_groups'); + return False; + } + + $temp_users = ($_POST['account_user']?$_POST['account_user']:Array()); $account_user = Array(); @reset($temp_users); while(list($key,$user_id) = each($temp_users)) @@ -107,7 +190,7 @@ } @reset($account_user); - $group_permissions = ($values['account_apps']?$values['account_apps']:Array()); + $group_permissions = ($_POST['account_apps']?$_POST['account_apps']:Array()); $account_apps = Array(); @reset($group_permissions); while(list($key,$value) = each($group_permissions)) @@ -119,30 +202,31 @@ } @reset($account_apps); - $group_info = Array - ( - 'account_id' => ($values['account_id']?intval($values['account_id']):0), - 'account_name' => ($values['account_name']?$values['account_name']:''), + $group_info = Array( + 'account_id' => ($_POST['account_id']?intval($_POST['account_id']):0), + 'account_name' => ($_POST['account_name']?$_POST['account_name']:''), 'account_user' => $account_user, 'account_apps' => $account_apps ); - $GLOBALS['phpgw']->db->lock(array - ( - 'phpgw_accounts', - 'phpgw_nextid', - 'phpgw_preferences', - 'phpgw_sessions', - 'phpgw_acl', - 'phpgw_applications', - 'phpgw_app_sessions', - 'phpgw_hooks' - )); + $this->validate_group($group_info); + + $GLOBALS['phpgw']->db->lock( + Array( + 'phpgw_accounts', + 'phpgw_nextid', + 'phpgw_preferences', + 'phpgw_sessions', + 'phpgw_acl', + 'phpgw_applications', + 'phpgw_app_sessions', + 'phpgw_hooks' + ) + ); $group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); $group->acct_type = 'g'; - $account_info = array - ( + $account_info = array( 'account_type' => 'g', 'account_lid' => $group_info['account_name'], 'account_passwd' => '', @@ -181,7 +265,7 @@ $GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$user_id); $t = $GLOBALS['pref']->read_repository(); @reset($new_apps); - while(list($app_key,$app_name) = each($new_apps)) + while(is_array($new_apps) && list($app_key,$app_name) = each($new_apps)) { if (!$t[($app_name=='admin'?'common':$app_name)]) { @@ -204,17 +288,92 @@ { $cd = 37; } + $GLOBALS['phpgw']->db->unlock(); + + ExecMethod('admin.uiaccounts.list_groups'); + return False; } - function edit_group($values) + function add_user() + { + if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) + { + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + + if ($_POST['submit']) + { + $userData = array( + 'account_type' => 'u', + 'account_lid' => $_POST['account_lid'], + 'account_firstname' => $_POST['account_firstname'], + 'account_lastname' => $_POST['account_lastname'], + 'account_passwd' => $_POST['account_passwd'], + 'status' => ($_POST['account_status'] ? 'A' : ''), + 'account_status' => ($_POST['account_status'] ? 'A' : ''), + 'old_loginid' => ($_GET['old_loginid']?rawurldecode($_GET['old_loginid']):''), + 'account_id' => ($_GET['account_id']?$_GET['account_id']:0), + 'account_passwd_2' => $_POST['account_passwd_2'], + 'account_groups' => $_POST['account_groups'], + 'anonymous' => $_POST['anonymous'], + 'changepassword' => $_POST['changepassword'], + 'account_permissions' => $_POST['account_permissions'], + 'homedirectory' => $_POST['homedirectory'], + 'loginshell' => $_POST['loginshell'], + 'account_expires_never' => $_POST['never_expires'] + /* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */ + ); + if ($_POST['expires'] !== '' && !$_POST['never_expires']) + { + $jscal = CreateObject('phpgwapi.jscalendar',False); + $userData += $jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year'); + } + if (!$errors = $this->validate_user($userData)) + { + $account_id = $this->so->add_user($userData); + + if ($userData['anonymous']) + { + $GLOBALS['phpgw']->acl->add_repository('phpgwapi','anonymous',$account_id,1); + } + else + { + $GLOBALS['phpgw']->acl->delete_repository('phpgwapi','anonymous',$account_id); + } + // make this information for the hooks available + $GLOBALS['hook_values']['account_lid'] = $userData['account_lid']; + $GLOBALS['hook_values']['account_id'] = $account_id; + $GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd']; + $GLOBALS['hook_values']['account_firstname'] = $userData['account_firstname']; + $GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname']; + $GLOBALS['phpgw']->hooks->process('addaccount'); + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + else + { + $ui = createobject('admin.uiaccounts'); + $ui->create_edit_user($userData['account_id'],$userData,$errors); + } + } + else + { + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + } + + function edit_group() { if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) { - $error[] = lang('no permission to create groups'); + ExecMethod('admin.uiaccounts.list_groups'); + return False; } - $temp_users = ($values['account_user']?$values['account_user']:Array()); + $temp_users = ($_POST['account_user']?$_POST['account_user']:Array()); $account_user = Array(); @reset($temp_users); while($temp_users && list($key,$user_id) = each($temp_users)) @@ -223,7 +382,7 @@ } @reset($account_user); - $group_permissions = ($values['account_apps']?$values['account_apps']:Array()); + $group_permissions = ($_POST['account_apps']?$_POST['account_apps']:Array()); $account_apps = Array(); @reset($group_permissions); while(list($key,$value) = each($group_permissions)) @@ -236,12 +395,14 @@ @reset($account_apps); $group_info = Array( - 'account_id' => ($values['account_id']?intval($values['account_id']):0), - 'account_name' => ($values['account_name']?$values['account_name']:''), + 'account_id' => ($_POST['account_id']?intval($_POST['account_id']):0), + 'account_name' => ($_POST['account_name']?$_POST['account_name']:''), 'account_user' => $account_user, 'account_apps' => $account_apps ); + $this->validate_group($group_info); + // Lock tables $GLOBALS['phpgw']->db->lock( Array( @@ -365,198 +526,140 @@ /* // Update any other options here, since the above save_repository () depends // on a group having users - $group->data['file_space'] = $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type']; + $group->data['file_space'] = $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type']; $group->save_repository(); */ $GLOBALS['phpgw']->db->unlock(); + + ExecMethod('admin.uiaccounts.list_groups'); + return False; } - function save_user($values) + function edit_user() { - if (is_array($values)) + if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) { - if($values['expires_never']) - { - $values['expires'] = $values['account_expires'] = -1; - } - else - { - $values['expires'] = $values['account_expires'] = mktime(2,0,0,$values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year']); - } + ExecMethod('admin.uiaccounts.list_users'); + return False; + } - $userData = array - ( - 'account_type' => 'u', - 'account_lid' => $values['account_lid'], - 'account_firstname' => $values['account_firstname'], - 'account_lastname' => $values['account_lastname'], - 'account_passwd' => $values['account_passwd'], - 'status' => ($values['account_status'] ? 'A' : ''), - 'account_status' => ($values['account_status'] ? 'A' : ''), - 'old_loginid' => ($values['old_loginid']?rawurldecode($GLOBALS['HTTP_GET_VARS']['old_loginid']):''), - 'account_id' => ($values['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:0), - 'account_passwd_2' => $values['account_passwd_2'], - 'account_groups' => $values['account_groups'], - 'account_permissions' => $values['account_permissions'], - 'homedirectory' => $values['homedirectory'], - 'loginshell' => $values['loginshell'], - 'account_expires_month' => $values['account_expires_month'], - 'account_expires_day' => $values['account_expires_day'], - 'account_expires_year' => $values['account_expires_year'], - 'account_expires_never' => $values['expires'], - 'expires' => $values['expires'], - 'account_expires' => $values['expires'] - /* 'file_space' => $GLOBALS['HTTP_POST_VARS']['account_file_space_number'] . "-" . $GLOBALS['HTTP_POST_VARS']['account_file_space_type'] */ + if ($_POST['submit']) + { + $userData = array( + 'account_lid' => $_POST['account_lid'], + 'firstname' => $_POST['account_firstname'], + 'lastname' => $_POST['account_lastname'], + 'account_passwd' => $_POST['account_passwd'], + 'status' => ($_POST['account_status'] ? 'A' : ''), + 'account_status' => ($_POST['account_status'] ? 'A' : ''), + 'old_loginid' => ($_GET['old_loginid']?rawurldecode($_GET['old_loginid']):''), + 'account_id' => ($_GET['account_id']?$_GET['account_id']:0), + 'account_passwd_2' => $_POST['account_passwd_2'], + 'account_groups' => $_POST['account_groups'], + 'anonymous' => $_POST['anonymous'], + 'changepassword' => $_POST['changepassword'], + 'account_permissions' => $_POST['account_permissions'], + 'homedirectory' => $_POST['homedirectory'], + 'loginshell' => $_POST['loginshell'], + 'account_expires_never' => $_POST['never_expires'] + /* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */ ); - - if ($values['account_id']) + if ($_POST['expires'] !== '' && !$_POST['never_expires']) { - $userData['account_id'] = $values['account_id']; - $this->update_user($userData); - /* check if would create a menu + $jscal = CreateObject('phpgwapi.jscalendar',False); + $userData += $jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year'); + } + if (!$errors = $this->validate_user($userData)) + { + $this->save_user($userData); + $GLOBALS['hook_values']['account_id'] = $userData['account_id']; + $GLOBALS['hook_values']['account_lid'] = $userData['account_lid']; + $GLOBALS['hook_values']['account_firstname'] = $userData['account_firstname']; + $GLOBALS['hook_values']['account_lastname'] = $userData['account_lastname']; + $GLOBALS['phpgw']->hooks->process('editaccount'); + + // check if would create a menu // if we do, we can't return to the users list, because // there are also some other plugins if (!ExecMethod('admin.uimenuclass.createHTMLCode','edit_user')) { - }*/ - } - else - { - $account_id = $this->so->add_user($userData); - $GLOBALS['hook_values']['account_lid'] = $userData['account_lid']; - $GLOBALS['hook_values']['account_id'] = $account_id; //$userData['account_id']; - $GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd']; - $GLOBALS['phpgw']->hooks->process('addaccount'); - } - } - } - - /* stores the userdata */ - function update_user($userData) - { - $account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u'); - $account->update_data($userData); - $account->save_repository(); - if ($userData['account_passwd']) - { - $auth = CreateObject('phpgwapi.auth'); - $auth->change_password($old_passwd,$userData['account_passwd'],$userData['account_id']); - $GLOBALS['hook_values']['account_id'] = $userData['account_id']; - $GLOBALS['hook_values']['old_passwd'] = $old_passwd; - $GLOBALS['hook_values']['new_passwd'] = $userData['account_passwd']; - $GLOBALS['phpgw']->hooks->process('changepassword'); - } - - $apps = CreateObject('phpgwapi.applications',array(intval($userData['account_id']),'u')); - - $apps->account_id = $userData['account_id']; - if ($_userData['account_permissions']) - { - while($app = each($userData['account_permissions'])) - { - if($app[1]) + ExecMethod('admin.uiaccounts.list_users'); + return False; + } + else { - $apps->add($app[0]); + ExecMethod('admin.uiaccounts.edit_user',$_GET['account_id']); + return False; } } - } - $apps->save_repository(); - - $account = CreateObject('phpgwapi.accounts',$userData['account_id'],'u'); - $allGroups = $account->get_list('groups'); - - if ($userData['account_groups']) - { - reset($userData['account_groups']); - while (list($key,$value) = each($userData['account_groups'])) - { - $newGroups[$value] = $value; - } - } - - $acl = CreateObject('phpgwapi.acl',$userData['account_id']); - - reset($allGroups); - while (list($key,$groupData) = each($allGroups)) - { - /* print "$key,". $groupData['account_id'] ."
    ";*/ - /* print "$key,". $userData['account_groups'][1] ."
    "; */ - - if ($newGroups[$groupData['account_id']]) - { - $acl->add_repository('phpgw_group',$groupData['account_id'],$userData['account_id'],1); - } else { - $acl->delete_repository('phpgw_group',$groupData['account_id'],$userData['account_id']); + $ui = createobject('admin.uiaccounts'); + $ui->create_edit_user($userData['account_id'],$userData,$errors); } } - $GLOBALS['phpgw']->session->delete_cache(intval($userData['account_id'])); } function set_group_managers() { - if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $GLOBALS['HTTP_POST_VARS']['cancel']) + if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $_POST['cancel']) { $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } - elseif($GLOBALS['HTTP_POST_VARS']['submit']) + elseif($_POST['submit']) { - $acl = CreateObject('phpgwapi.acl',intval($GLOBALS['HTTP_POST_VARS']['account_id'])); + $acl = CreateObject('phpgwapi.acl',intval($_POST['account_id'])); - $users = $GLOBALS['phpgw']->accounts->member($GLOBALS['HTTP_POST_VARS']['account_id']); + $users = $GLOBALS['phpgw']->accounts->member($_POST['account_id']); @reset($users); while($managers && list($key,$user) = each($users)) { - $acl->add_repository('phpgw_group',intval($GLOBALS['HTTP_POST_VARS']['account_id']),$user['account_id'],1); + $acl->add_repository('phpgw_group',intval($_POST['account_id']),$user['account_id'],1); } - $managers = $GLOBALS['HTTP_POST_VARS']['managers']; + $managers = $_POST['managers']; @reset($managers); while($managers && list($key,$manager) = each($managers)) { - $acl->add_repository('phpgw_group',intval($GLOBALS['HTTP_POST_VARS']['account_id']),$manager,(1 + PHPGW_ACL_GROUP_MANAGERS)); + $acl->add_repository('phpgw_group',intval($_POST['account_id']),$manager,(1 + PHPGW_ACL_GROUP_MANAGERS)); } } $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->common->phpgw_exit(); } - function validate_group($values) + function validate_group($group_info) { - $group = CreateObject('phpgwapi.accounts',$values['account_id'],'g'); + $errors = Array(); + + $group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); $group->read_repository(); - if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + if(!$group_info['account_name']) { - $error[] = lang('no permission to add groups'); + $errors[] = lang('You must enter a group name.'); } - if(!$values['account_name']) + if($group_info['account_name'] != $group->id2name($group_info['account_id'])) { - $error[] = lang('You must enter a group name.'); - } - - if($values['account_name'] != $group->id2name($values['account_id'])) - { - if ($group->exists($values['account_name'])) + if ($group->exists($group_info['account_name'])) { - $error[] = lang('Sorry, that group name has already been taken.'); + $errors[] = lang('Sorry, that group name has already been taken.'); } } /* if (preg_match ("/\D/", $account_file_space_number)) { - $error[] = lang ('File space must be an integer'); + $errors[] = lang ('File space must be an integer'); } */ - if(is_array($error)) + if(count($errors)) { - return $error; + $ui = createobject('admin.uiaccounts'); + $ui->create_edit_group($group_info,$errors); + $GLOBALS['phpgw']->common->phpgw_exit(); } } @@ -564,69 +667,76 @@ returns FALSE if the data are correct otherwise the error array */ - function validate_user($values) + function validate_user(&$_userData) { - if (!$values['account_id'] && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) - { - $error[] = lang('no permission to add users'); - } + $totalerrors = 0; /* - if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $values['allow_long_loginids']) + if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && ! $allow_long_loginids) { - if (strlen($values['account_lid']) > 8) + if (strlen($_userData['account_lid']) > 8) { - $error[] = lang('The loginid can not be more then 8 characters'); + $error[$totalerrors] = lang('The loginid can not be more then 8 characters'); + $totalerrors++; } } */ - if (!$values['account_lid']) + if (!$_userData['account_lid']) { - $error[] = lang('You must enter a loginid'); + $error[$totalerrors] = lang('You must enter a loginid'); + $totalerrors++; } - if ($values['old_loginid'] != $values['account_lid']) + if ($_userData['old_loginid'] != $_userData['account_lid']) { - if ($GLOBALS['phpgw']->accounts->exists($values['account_lid'])) + if ($GLOBALS['phpgw']->accounts->exists($_userData['account_lid'])) { - $error[] = lang('That loginid has already been taken'); + $error[$totalerrors] = lang('That loginid has already been taken'); + $totalerrors++; } } - if ($values['account_passwd'] || $values['account_passwd_2']) + if ($_userData['account_passwd'] || $_userData['account_passwd_2']) { - if ($values['account_passwd'] != $values['account_passwd_2']) + if ($_userData['account_passwd'] != $_userData['account_passwd_2']) { - $error[] = lang('The two passwords are not the same'); + $error[$totalerrors] = lang('The two passwords are not the same'); + $totalerrors++; } + } - /* $temp_msgbox_data = $GLOBALS['phpgw_info']['flags']['msgbox_data']; - unset($GLOBALS['phpgw_info']['flags']['msgbox_data']); - if(!sanitize($_userData['account_passwd'],'password')) + if (!count($_userData['account_permissions']) && !count($_userData['account_groups'])) + { + $error[$totalerrors] = lang('You must add at least 1 permission or group to this account'); + $totalerrors++; + } + + if ($_userData['account_expires_month'] || $_userData['account_expires_day'] || $_userData['account_expires_year'] || $_userData['account_expires_never']) + { + if($_userData['account_expires_never']) { - reset($GLOBALS['phpgw_info']['flags']['msgbox_data']); - while(list($key) = each($GLOBALS['phpgw_info']['flags']['msgbox_data'])) + $_userData['expires'] = -1; + $_userData['account_expires'] = $_userData['expires']; + } + else + { + if (! checkdate($_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year'])) { - $error[$totalerrors] = lang($key); + $error[$totalerrors] = lang('You have entered an invalid expiration date'); $totalerrors++; } + else + { + $_userData['expires'] = mktime(2,0,0,$_userData['account_expires_month'],$_userData['account_expires_day'],$_userData['account_expires_year']); + $_userData['account_expires'] = $_userData['expires']; + } } - $GLOBALS['phpgw_info']['flags']['msgbox_data'] = $temp_msgbox_data; - unset($temp_msgbox_data); */ } - - if (!count($values['account_permissions']) && !count($values['account_groups'])) + else { - $error[] = lang('You must add at least 1 permission or group to this account'); - } - - if ($values['account_expires_month'] || $values['account_expires_day'] || $values['account_expires_year'] || $values['account_expires_never']) - { - if (! checkdate($values['account_expires_month'],$values['account_expires_day'],$values['account_expires_year'])) - { - $error[] = lang('You have entered an invalid expiration date'); - } + $_userData['expires'] = -1; + $_userData['account_expires'] = $_userData['expires']; } /* @@ -638,99 +748,93 @@ } */ - if (is_array($error)) + if ($totalerrors == 0) + { + return FALSE; + } + else { return $error; } } - - function delete_group($account_id) + /* stores the userdata */ + function save_user($_userData) { - if ($GLOBALS['phpgw']->acl->check('group_access',32,'admin')) + $account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); + $account->update_data($_userData); + $account->save_repository(); + if ($_userData['account_passwd']) { - return False; + $auth = CreateObject('phpgwapi.auth'); + $auth->change_password($old_passwd, $_userData['account_passwd'], $_userData['account_id']); + $GLOBALS['hook_values']['account_id'] = $_userData['account_id']; + $GLOBALS['hook_values']['old_passwd'] = $old_passwd; + $GLOBALS['hook_values']['new_passwd'] = $_userData['account_passwd']; + $GLOBALS['phpgw']->hooks->process('changepassword'); } - $GLOBALS['phpgw']->db->lock(array - ( - 'phpgw_accounts', - 'phpgw_acl' - ) - ); + $apps = CreateObject('phpgwapi.applications',array(intval($_userData['account_id']),'u')); - $old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group'); - - @reset($old_group_list); - while($old_group_list && $id = each($old_group_list)) + $apps->account_id = $_userData['account_id']; + if ($_userData['account_permissions']) { - $GLOBALS['phpgw']->acl->delete_repository('phpgw_group',$account_id,intval($id[1])); - $GLOBALS['phpgw']->session->delete_cache(intval($id[1])); - } - - $GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id); - - if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id))) - { - $cd = 38; - } - else - { - $cd = 32; - } - - $GLOBALS['phpgw']->accounts->delete($account_id); - $GLOBALS['phpgw']->db->unlock(); - } - - function delete_user() - { - if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) - { - ExecMethod('admin.uiaccounts.list_users'); - return False; - } - elseif($GLOBALS['HTTP_POST_VARS']['delete_account']) - { - $accountid = $GLOBALS['HTTP_POST_VARS']['account_id']; - settype($account_id,'integer'); - $account_id = get_account_id($accountid); - $lid = $GLOBALS['phpgw']->accounts->id2name($account_id); - $db = $GLOBALS['phpgw']->db; - $db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__); - if($db->num_rows()) + while($app = each($_userData['account_permissions'])) { - while($db->next_record()) + if($app[1]) { - $appname = $db->f('app_name'); - - if($appname <> 'admin') - { - $GLOBALS['phpgw']->hooks->single('deleteaccount', $appname); - } + $apps->add($app[0]); } } + } + $apps->save_repository(); - $GLOBALS['phpgw']->hooks->single('deleteaccount','preferences'); - $GLOBALS['phpgw']->hooks->single('deleteaccount','admin'); + $account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); + $allGroups = $account->get_list('groups'); - $GLOBALS['hook_values']['account_id'] = $account_id; - $GLOBALS['phpgw']->hooks->process('deleteaccount'); - - $basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP; - - if (! @rmdir($basedir . $lid)) + if ($_userData['account_groups']) + { + reset($_userData['account_groups']); + while (list($key,$value) = each($_userData['account_groups'])) { - $cd = 34; + $newGroups[$value] = $value; + } + } + + $acl = CreateObject('phpgwapi.acl',$_userData['account_id']); + + reset($allGroups); + while (list($key,$groupData) = each($allGroups)) + { + /* print "$key,". $groupData['account_id'] ."
    ";*/ + /* print "$key,". $_userData['account_groups'][1] ."
    "; */ + + if ($newGroups[$groupData['account_id']]) + { + $acl->add_repository('phpgw_group',$groupData['account_id'],$_userData['account_id'],1); } else { - $cd = 29; + $acl->delete_repository('phpgw_group',$groupData['account_id'],$_userData['account_id']); } - - ExecMethod('admin.uiaccounts.list_users'); - return False; } + if ($_userData['anonymous']) + { + $acl->add_repository('phpgwapi','anonymous',$_userData['account_id'],1); + } + else + { + $acl->delete_repository('phpgwapi','anonymous',$_userData['account_id']); + } + if ($_userData['changepassword']) + { + $GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1); + } + else + { + $GLOBALS['phpgw']->acl->delete_repository('preferences','changepassword',$_userData['account_id']); + } + $GLOBALS['phpgw']->session->delete_cache(intval($_userData['account_id'])); } function load_group_users($account_id) diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index 0f8b2a6ba7..b5fc2f4a7c 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -28,9 +28,9 @@ function bocategories() { - if ($GLOBALS['appname']) + if ($_GET['appname']) { - $this->cats = CreateObject('phpgwapi.categories',-1,$GLOBALS['appname']); + $this->cats = CreateObject('phpgwapi.categories',-1,$_GET['appname']); } else { @@ -39,24 +39,19 @@ $this->read_sessiondata(); - /* _debug_array($GLOBALS['HTTP_POST_VARS']); */ - - $start = intval(get_var('start',array('POST','GET'))); + /* _debug_array($_POST); */ + /* Might change this to '' at the end---> */ + $start = get_var('start',array('POST','GET')); $query = get_var('query',array('POST','GET')); - $sort = get_var('sort',array('POST','GET')); + $sort = get_var('sort', array('POST','GET')); $order = get_var('order',array('POST','GET')); - $cat_id = intval(get_var('cat_id', array('POST','GET'))); + $cat_id = get_var('cat_id',array('POST','GET')); - if(!empty($start) || $start == 0) + if(!empty($start) || $start == '0' || $start == 0) { if($this->debug) { echo '
    overriding start: "' . $this->start . '" now "' . $start . '"'; } $this->start = $start; } - else - { - $this->start = 0; - } - if((empty($query) && !empty($this->query)) || !empty($query)) { if($this->debug) { echo '
    setting query to: "' . $query . '"'; } @@ -67,17 +62,14 @@ { $this->cat_id = $cat_id; } - - if($cat_id == 0) + if($cat_id == '0' || $cat_id == 0 || $cat_id == '') { unset($this->cat_id); } - if(isset($sort) && !empty($sort)) { $this->sort = $sort; } - if(isset($order) && !empty($order)) { $this->order = $order; @@ -105,23 +97,15 @@ } } - function get_list($global_cats=False) + function get_list() { if($this->debug) { echo '
    querying: "' . $this->query . '"'; } - - if ($global_cats) - { - return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True); - } - else - { - return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order); - } + return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True); } function save_cat($values) { - if ($values['cat_id'] && $values['cat_id'] != 0) + if ($values['id'] && $values['id'] != 0) { return $this->cats->edit($values); } @@ -133,20 +117,19 @@ function exists($data) { - return $this->cats->exists($data); + $data['type'] = $data['type'] ? $data['type'] : ''; + $data['cat_id'] = $data['cat_id'] ? $data['cat_id'] : ''; + return $this->cats->exists($data['type'],$data['cat_name'],$data['cat_id']); } function formatted_list($data) { - return $this->cats->formatted_list($data); + return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent'],True); } - function delete($data) + function delete($cat_id,$subs=False) { - if (is_array($data)) - { - $this->cats->delete($data); - } + return $this->cats->delete($cat_id,$subs); } function check_values($values) @@ -168,7 +151,7 @@ ( 'type' => 'appandmains', 'cat_name' => $values['name'], - 'cat_id' => $values['cat_id'] + 'cat_id' => $values['id'] )); } else @@ -177,7 +160,7 @@ ( 'type' => 'appandsubs', 'cat_name' => $values['name'], - 'cat_id' => $values['cat_id'] + 'cat_id' => $values['id'] )); } diff --git a/admin/inc/class.soaccounts.inc.php b/admin/inc/class.soaccounts.inc.php index f40e38c097..1aa86f73b6 100755 --- a/admin/inc/class.soaccounts.inc.php +++ b/admin/inc/class.soaccounts.inc.php @@ -19,10 +19,9 @@ function add_user($userData) { - $GLOBALS['phpgw']->db->lock - ( - array - ( + $userData['account_expires'] = $userData['expires']; + $GLOBALS['phpgw']->db->lock( + Array( 'phpgw_accounts', 'phpgw_nextid', 'phpgw_preferences', @@ -37,10 +36,9 @@ $GLOBALS['phpgw']->accounts->create($userData); $userData['account_id'] = $GLOBALS['phpgw']->accounts->name2id($userData['account_lid']); - - $apps = CreateObject('phpgwapi.applications',array($userData['account_id'],'u')); + + $apps = CreateObject('phpgwapi.applications',$userData['account_id']); $apps->read_installed_apps(); - // Read Group Apps if ($userData['account_groups']) { @@ -63,7 +61,7 @@ $apps->account_type = 'u'; $apps->account_id = $userData['account_id']; - $apps->account_apps = Array(Array()); + $apps->data = Array(Array()); if ($userData['account_permissions']) { @@ -82,8 +80,10 @@ } $apps->save_repository(); - $GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1); - + if ($userData['changepassword']) + { + $GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1); + } // Assign user to groups if ($userData['account_groups']) { @@ -94,32 +94,11 @@ } } -/* if ($apps_after) - { - $GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$userData['account_id']); - $GLOBALS['phpgw']->hooks->single('add_def_pref','admin'); - while ($apps = each($apps_after)) - { - if (strcasecmp ($apps[0], 'admin') != 0) - { - $GLOBALS['phpgw']->hooks->single('add_def_pref', $apps[1]); - } - } - $GLOBALS['pref']->save_repository(False); - } */ - $apps->account_apps = array(array()); $apps_after = array(array()); $GLOBALS['phpgw']->db->unlock(); -/* - // start inlcuding other admin tools - while($app = each($apps_after)) - { - $GLOBALS['phpgw']->hooks->single('add_user_data', $value); - } -*/ return $userData['account_id']; } } diff --git a/admin/inc/class.soapplications.inc.php b/admin/inc/class.soapplications.inc.php index da6ea945be..92ddd72d23 100644 --- a/admin/inc/class.soapplications.inc.php +++ b/admin/inc/class.soapplications.inc.php @@ -28,7 +28,7 @@ $this->db->next_record(); $app_info = array( $this->db->f('app_name'), - $this->db->f('app_name'), + $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')]['title'], $this->db->f('app_enabled'), $this->db->f('app_name'), $this->db->f('app_order') @@ -44,7 +44,7 @@ while ($this->db->next_record()) { $apps[$this->db->f('app_name')] = array( - 'title' => str_replace('- ','-',ucwords(str_replace('_','- ',$this->db->f('app_name')))), + 'title' => $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')], 'name' => $this->db->f('app_name'), 'status' => $this->db->f('app_enabled') ); @@ -74,7 +74,7 @@ function save($data) { $sql = "UPDATE phpgw_applications SET app_name='" . addslashes($data['n_app_name']) . "'," - . "app_enabled='" . $data['n_app_status'] . "',app_order='" . $data['app_order'] + . "app_enabled='" . $data['n_app_status'] . "',app_order='" . $data['app_order'] . "' WHERE app_name='" . $data['old_app_name'] . "'"; $this->db->query($sql,__LINE__,__FILE__); diff --git a/admin/inc/class.uiaccess_history.inc.php b/admin/inc/class.uiaccess_history.inc.php index 43915293a6..e9ed137b01 100644 --- a/admin/inc/class.uiaccess_history.inc.php +++ b/admin/inc/class.uiaccess_history.inc.php @@ -20,6 +20,11 @@ function uiaccess_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; @@ -35,13 +40,14 @@ function list_history() { - $account_id = ($GLOBALS['HTTP_GET_VARS']['account_id']?$GLOBALS['HTTP_GET_VARS']['account_id']:$GLOBALS['HTTP_POST_VARS']['account_id']); - $start = ($GLOBALS['HTTP_POST_VARS']['start']?$GLOBALS['HTTP_POST_VARS']['start']:0); - $sort = ($GLOBALS['HTTP_POST_VARS']['sort']?$GLOBALS['HTTP_POST_VARS']['sort']:0); - $order = ($GLOBALS['HTTP_POST_VARS']['order']?$GLOBALS['HTTP_POST_VARS']['order']:0); + $account_id = get_var('account_id',array('GET','POST')); + $start = get_var('start',array('POST'),0); + $sort = get_var('sort',array('POST'),0); + $order = get_var('order',array('POST'),0); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View access log'); $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $total_records = $this->bo->total($account_id); diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index da20139433..93279f74b0 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -2,8 +2,7 @@ /**************************************************************************\ * phpGroupWare - account administration * * http://www.phpgroupware.org * - * Written by coreteam * - * ----------------------------------------------------- * + * -------------------------------------------- * * 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 * @@ -15,14 +14,19 @@ { var $public_functions = array ( - 'list_groups' => True, - 'list_users' => True, - 'delete_group' => True, - 'delete_user' => True, - 'edit_user' => True, - 'edit_group' => True, - 'view_user' => True, - 'group_manager' => True + 'list_groups' => True, + 'list_users' => True, + 'add_group' => True, + 'add_user' => True, + 'delete_group' => True, + 'delete_user' => True, + 'edit_user' => True, + 'edit_user_hook' => True, + 'edit_group' => True, + 'view_user' => True, + 'view_user_hook' => True, + 'group_manager' => True, + 'accounts_popup' => True ); var $bo; @@ -30,11 +34,8 @@ function uiaccounts() { - $GLOBALS['phpgw_info']['flags']['xslt_app'] = True; - - $this->bo = createobject('admin.boaccounts'); - $this->nextmatchs = createobject('phpgwapi.nextmatchs'); - + $this->bo = createobject('admin.boaccounts'); + $this->nextmatchs = createobject('phpgwapi.nextmatchs'); @set_time_limit(300); } @@ -48,27 +49,28 @@ function list_groups() { - if ($_POST['done'] || $GLOBALS['phpgw']->acl->check('group_access',1,'admin')) + if ($GLOBALS['phpgw']->acl->check('group_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uimainscreen.mainscreen'); - } - - if($_POST['add']) - { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.edit_group'); + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); } $query = (isset($_POST['query'])?$_POST['query']:''); $GLOBALS['cd'] = ($_GET['cd']?$_GET['cd']:0); + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . lang('list groups'); - - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','groups', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'search_field', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'nextmatchs')); - -/* what should this be for??? this is the same call for both cases! can this be removed? [ceb] */ + $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p->set_file( + array( + 'groups' => 'groups.tpl' + ) + ); + $p->set_block('groups','list','list'); + $p->set_block('groups','row','row'); + $p->set_block('groups','row_empty','row_empty'); if ($GLOBALS['phpgw']->acl->check('group_access',2,'admin')) { @@ -81,85 +83,117 @@ $total = $GLOBALS['phpgw']->accounts->total; } - $group_header = array - ( - 'sort_name' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $sort, - 'var' => 'account_lid', - 'order' => $order, - 'extra' => 'menuaction=admin.uiaccounts.list_groups' - )), - 'lang_name' => lang('name'), - 'lang_edit' => lang('edit'), - 'lang_delete' => lang('delete'), - 'lang_sort_statustext' => lang('sort the entries') - ); + $url = $GLOBALS['phpgw']->link('/index.php'); - while (list($null,$account) = each($account_info)) + $var = Array( + 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], + 'left_next_matchs' => $this->nextmatchs->left('/index.php',$start,$total,'menuaction=admin.uiaccounts.list_groups'), + 'right_next_matchs' => $this->nextmatchs->right('/admin/groups.php',$start,$total,'menuaction=admin.uiaccounts.list_groups'), + 'lang_groups' => lang('user groups'), + 'sort_name' => $this->nextmatchs->show_sort_order($sort,'account_lid',$order,'/index.php',lang('name'),'menuaction=admin.uiaccounts.list_groups'), + 'header_edit' => lang('Edit'), + 'header_delete' => lang('Delete') + ); + $p->set_var($var); + + if (!count($account_info) || !$total) { - $group_data[] = Array - ( - 'edit_url' => ($this->bo->check_rights('edit')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_group&account_id=' . $account['account_id']):''), - 'lang_edit' => ($this->bo->check_rights('edit')?lang('edit'):''), - 'lang_edit_statustext' => ($this->bo->check_rights('edit')?lang('edit this group'):''), - 'group_name' => (!$account['account_lid']?'':$account['account_lid']), - 'delete_url' => ($this->bo->check_rights('delete')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id=' . $account['account_id']):''), - 'lang_delete_statustext' => ($this->bo->check_rights('delete')?lang('delete this group'):''), - 'lang_delete' => ($this->bo->check_rights('delete')?lang('delete'):'') - ); + $p->set_var('message',lang('No matches found')); + $p->parse('rows','row_empty',True); + } + else + { + if (! $GLOBALS['phpgw']->acl->check('group_access',8,'admin')) + { + $can_view = True; + } + + if (! $GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + { + $can_edit = True; + } + + if (! $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) + { + $can_delete = True; + } + + while (list($null,$account) = each($account_info)) + { + $tr_color = $this->nextmatchs->alternate_row_color($tr_color); + $var = Array( + 'tr_color' => $tr_color, + 'group_name' => (!$account['account_lid']?' ':$account['account_lid']), + 'delete_link' => $this->row_action('delete','group',$account['account_id']) + ); + $p->set_var($var); + + if ($can_edit) + { + $p->set_var('edit_link',$this->row_action('edit','group',$account['account_id'])); + } + else + { + $p->set_var('edit_link',' '); + } + + if ($can_delete) + { + $p->set_var('delete_link',$this->row_action('delete','group',$account['account_id'])); + } + else + { + $p->set_var('delete_link',' '); + } + + $p->fp('rows','row',True); + + } + } + $var = Array( + 'new_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.add_group'), + 'search_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups') + ); + $p->set_var($var); + + if (! $GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + { + $p->set_var('input_add',''); } - $group_add = array - ( - 'lang_add' => lang('add'), - 'lang_add_statustext' => lang('add a group'), - 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), - 'lang_done' => lang('done'), - 'lang_done_statustext' => lang('return to admin mainscreen'), - 'add_access' => ($this->bo->check_rights('add')?'yes':''), - ); + if (! $GLOBALS['phpgw']->acl->check('group_access',2,'admin')) + { + $p->set_var('input_search',lang('Search') . ' '); + } - $data = array - ( - 'start_record' => $start, - 'record_limit' => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'], - 'num_records' => count($account_info), - 'all_records' => $total, - 'nextmatchs_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), - 'nextmatchs_img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'), - 'select_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), - 'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), - 'lang_searchbutton_statustext' => lang('Submit the search string'), - 'query' => $query, - 'lang_search' => lang('search'), - 'group_header' => $group_header, - 'group_data' => $group_data, - 'group_add' => $group_add, - 'search_access' => ($this->bo->check_rights('search')?'yes':'') - ); - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_list' => $data)); + $p->pfp('out','list'); } function list_users($param_cd='') { - if ($_POST['done'] || $GLOBALS['phpgw']->acl->check('account_access',1,'admin')) + if ($GLOBALS['phpgw']->acl->check('account_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uimainscreen.mainscreen'); - } - - if ($_POST['add']) - { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.edit_user'); + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); } if($param_cd) { $cd = $param_cd; } - - $GLOBALS['query'] = (isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:''); - $start = (isset($GLOBALS['HTTP_POST_VARS']['start'])?intval($GLOBALS['HTTP_POST_VARS']['start']):''); + + if(isset($_POST['query'])) + { + $GLOBALS['query'] = $_POST['query']; + } + + if(isset($_POST['start'])) + { + $start = intval($_POST['start']); + } + else + { + $start = 0; + } if(isset($_GET['order'])) { @@ -178,537 +212,362 @@ { $sort = 'ASC'; } + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . lang('list users'); + $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','users', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'search_field', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'nextmatchs')); - -/* the same like in groups... we really should remove this... :) [ceb] */ + $p->set_file( + Array( + 'accounts' => 'accounts.tpl' + ) + ); + $p->set_block('accounts','list','list'); + $p->set_block('accounts','row','row'); + $p->set_block('accounts','row_empty','row_empty'); if ($GLOBALS['phpgw']->acl->check('account_access',2,'admin')) { - $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total); + $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query']); $total = $GLOBALS['phpgw']->accounts->total; } else { - $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total); + $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query']); $total = $GLOBALS['phpgw']->accounts->total; } + + $url = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'); - $user_header = array - ( - 'sort_lid' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $sort, - 'var' => 'account_lid', - 'order' => $order, - 'extra' => 'menuaction=admin.uiaccounts.list_users' - )), - 'lang_lid' => lang('loginid'), - 'sort_lastname' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $sort, - 'var' => 'account_lastname', - 'order' => $order, - 'extra' => 'menuaction=admin.uiaccounts.list_users' - )), - 'lang_lastname' => lang('Lastname'), - 'sort_firstname' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $sort, - 'var' => 'account_firstname', - 'order' => $order, - 'extra' => 'menuaction=admin.uiaccounts.list_users' - )), - 'lang_firstname' => lang('firstname'), - 'lang_view' => lang('view'), - 'lang_edit' => lang('edit'), - 'lang_delete' => lang('delete'), - 'lang_sort_statustext' => lang('sort the entries') + $var = Array( + 'bg_color' => $GLOBALS['phpgw_info']['theme']['bg_color'], + 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], + 'left_next_matchs' => $this->nextmatchs->left($url,$start,$total,'menuaction=admin.uiaccounts.list_users'), + 'lang_user_accounts' => lang('%1 - %2 of %3 user accounts',$start+1,$start+count($account_info),$total), + 'right_next_matchs' => $this->nextmatchs->right($url,$start,$total,'menuaction=admin.uiaccounts.list_users'), + 'lang_loginid' => $this->nextmatchs->show_sort_order($sort,'account_lid',$order,$url,lang('LoginID')), + 'lang_lastname' => $this->nextmatchs->show_sort_order($sort,'account_lastname',$order,$url,lang('last name')), + 'lang_firstname' => $this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first name')), + 'lang_edit' => lang('edit'), + 'lang_delete' => lang('delete'), + 'lang_view' => lang('view'), + 'actionurl' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.add_user'), + 'accounts_url' => $url, + 'lang_search' => lang('search') ); - - while (list($null,$account) = each($account_info)) + $p->set_var($var); + + if (! $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) { - $user_data[] = Array - ( - 'view_url' => ($this->bo->check_rights('view','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.view_user&account_id=' . $account['account_id']):''), - 'lang_view' => ($this->bo->check_rights('view','account_access')?lang('view'):''), - 'lang_view_statustext' => ($this->bo->check_rights('view','account_access')?lang('view this user'):''), - 'edit_url' => ($this->bo->check_rights('edit','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_user&account_id=' . $account['account_id']):''), - 'lang_edit' => ($this->bo->check_rights('edit','account_access')?lang('edit'):''), - 'lang_edit_statustext' => ($this->bo->check_rights('edit','account_access')?lang('edit this user'):''), - 'lid' => (!$account['account_lid']?'':$account['account_lid']), - 'firstname' => (!$account['account_firstname']?'':$account['account_firstname']), - 'lastname' => (!$account['account_lastname']?'':$account['account_lastname']), - 'delete_url' => ($this->bo->check_rights('delete','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_user&account_id=' . $account['account_id']):''), - 'lang_delete_statustext' => ($this->bo->check_rights('delete','account_access')?lang('delete this user'):''), - 'lang_delete' => ($this->bo->check_rights('delete','account_access')?lang('delete'):'') - ); + $p->set_var('input_add',''); } - $user_add = array - ( - 'lang_add' => lang('add'), - 'lang_add_statustext' => lang('add a user'), - 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), - 'lang_done' => lang('done'), - 'lang_done_statustext' => lang('return to admin mainscreen'), - 'add_access' => ($this->bo->check_rights('add','account_access')?'yes':''), - ); - - $data = array - ( - 'start_record' => $start, - 'record_limit' => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'], - 'num_records' => count($account_info), - 'all_records' => $total, - 'nextmatchs_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), - 'nextmatchs_img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'), - 'select_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), - 'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), - 'lang_searchbutton_statustext' => lang('Submit the search string'), - 'query' => $query, - 'lang_search' => lang('search'), - 'user_header' => $user_header, - 'user_data' => $user_data, - 'user_add' => $user_add, - 'search_access' => ($this->bo->check_rights('search','account_access')?'yes':'') - ); - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('account_list' => $data)); - } - - function edit_group() - { - $account_id = get_var('account_id',array('POST','GET')); - $values = get_var('values',array('POST')); - $account_user = get_var('account_user',array('POST')); - $account_apps = get_var('account_apps',array('POST')); - - if ($values['save']) + if (! $GLOBALS['phpgw']->acl->check('account_access',2,'admin')) { - $error = $this->bo->validate_group($values); + $p->set_var('input_search',lang('Search') . ' '); + } - if (is_array($error)) + if (!count($account_info) || !$total) + { + $p->set_var('message',lang('No matches found')); + $p->parse('rows','row_empty',True); + } + else + { + if (! $GLOBALS['phpgw']->acl->check('account_access',8,'admin')) { - $error_list = $GLOBALS['phpgw']->common->error_list($error); + $can_view = True; } - else + + if (! $GLOBALS['phpgw']->acl->check('account_access',16,'admin')) { - if (is_array($account_user)) - { - $values['account_user'] = $account_user; - } + $can_edit = True; + } - if (is_array($account_apps)) - { - $values['account_apps'] = $account_apps; - } + if (! $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) + { + $can_delete = True; + } - if ($values['account_id']) + while (list($null,$account) = each($account_info)) + { + $this->nextmatchs->template_alternate_row_color($p); + + $var = array( + 'row_loginid' => $account['account_lid'], + 'row_firstname' => (!$account['account_firstname']?' ':$account['account_firstname']), + 'row_lastname' => (!$account['account_lastname']?' ':$account['account_lastname']) + ); + $p->set_var($var); + + if ($can_edit) { - $this->bo->edit_group($values); - $account_id = $values['account_id']; + $p->set_var('row_edit',$this->row_action('edit','user',$account['account_id'])); } else { - $this->bo->add_group($values); - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_groups'); + $p->set_var('row_edit',' '); } + + if ($can_delete) + { + $p->set_var('row_delete',($GLOBALS['phpgw_info']['user']['userid'] != $account['account_lid']?$this->row_action('delete','user',$account['account_id']):' ')); + } + else + { + $p->set_var('row_delete',' '); + } + + if ($can_view) + { + $p->set_var('row_view',$this->row_action('view','user',$account['account_id'])); + } + else + { + $p->set_var('row_view',' '); + } + $p->parse('rows','row',True); } + } // End else + $p->pfp('out','list'); + } + + function add_group() + { + if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + { + $this->list_groups(); + return False; } - if ($values['cancel'] || (!$account_id && $GLOBALS['phpgw']->acl->check('group_access',4,'admin')) || ($account_id && $GLOBALS['phpgw']->acl->check('group_access',16,'admin'))) + $group_info = Array( + 'account_id' => $_GET['account_id'], + 'account_name' => '', + 'account_user' => Array(), + 'account_apps' => Array() + ); + $this->create_edit_group($group_info); + } + + function add_user() + { + if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_groups'); + $this->list_users(); + } + else + { + $this->create_edit_user(0); + } + } + + function delete_group() + { + if ($_POST['no'] || $_POST['yes'] || !@isset($_GET['account_id']) || !@$_GET['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) + { + if ($_POST['yes']) + { + $this->bo->delete_group(); + } + $this->list_groups(); + return False; + } + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p->set_file( + Array( + 'body' => 'delete_common.tpl', + 'message_row' => 'message_row.tpl', + 'form_button' => 'form_button_script.tpl' + ) + ); + + $p->set_var('message_display',lang('Are you sure you want to delete this group ?')); + $p->parse('messages','message_row'); + + $old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location(intval($_GET['account_id']),1,'phpgw_group'); + + if($old_group_list) + { + $group_name = $GLOBALS['phpgw']->accounts->id2name($_GET['account_id']); + + $p->set_var('message_display','
    '); + $p->parse('messages','message_row',True); + + $user_list = ''; + while (list(,$id) = each($old_group_list)) + { + $user_list .= '' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '
    '; + } + $p->set_var('message_display',$user_list); + $p->parse('messages','message_row',True); + + $p->set_var('message_display',lang("Sorry, the above users are still a member of the group %1",$group_name) + . '.
    ' . lang('They must be removed before you can continue'). '.
    ' . lang('Remove all users from this group').'?'); + $p->parse('messages','message_row',True); + } + + $var = Array( + 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group'), + 'hidden_vars' => '', + 'yes' => lang('Yes'), + 'no' => lang('No') + ); + $p->set_var($var); +/* + $p->parse('yes','form_button'); + + + $var = Array( + 'submit_button' => lang('Submit'), + 'action_url_button' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), + 'action_text_button' => ' '.lang('No'), + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); + $p->parse('no','form_button'); +*/ + $p->pparse('phpgw_body','body'); + } + + function delete_user() + { + if ($GLOBALS['phpgw']->acl->check('account_access',32,'admin') || $GLOBALS['phpgw_info']['user']['account_id'] == $_GET['account_id']) + { + $this->list_users(); + return False; + } + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file( + Array( + 'form' => 'delete_account.tpl' + ) + ); + $var = Array( + 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.delete_user'), + 'account_id' => $_GET['account_id'] + ); + + // the account can have special chars/white spaces, if it is a ldap dn + $account_id = rawurlencode($_GET['account_id']); + + // Find out who the new owner is of the deleted users records... + $users = $GLOBALS['phpgw']->accounts->get_list('accounts'); + $c_users = count($users); + $str = ''; + for($i=0;$i<$c_users;$i++) + { + $str .= ''."\n"; + } + $var['lang_new_owner'] = lang('Who would you like to transfer ALL records owned by the deleted user to?'); + $var['new_owner_select'] = ''."\n"; + $var['cancel'] = lang('cancel'); + $var['delete'] = lang('delete'); + $t->set_var($var); + $t->pparse('out','form'); + } + + function edit_group($cd='',$account_id='') + { + if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + { + $this->list_groups(); + return False; } $cdid = $cd; settype($cd,'integer'); $cd = ($_GET['cd']?$_GET['cd']:intval($cdid)); - if ($account_id) + $accountid = $account_id; + settype($account_id,'integer'); + $account_id = ($_GET['account_id']?$_GET['account_id']:intval($accountid)); + + // todo + // not needed if i use the same file for new groups too + if (! $account_id) { - $group_info = Array - ( - 'account_name' => $GLOBALS['phpgw']->accounts->id2name($account_id), - 'account_user' => $this->bo->load_group_users($account_id), - 'account_apps' => $this->bo->load_group_apps($account_id) + $this->list_groups(); + } + else + { + $group_info = Array( + 'account_id' => intval($_GET['account_id']), + 'account_name' => $GLOBALS['phpgw']->accounts->id2name($_GET['account_id']), + 'account_user' => $this->bo->load_group_users($_GET['account_id']), + 'account_apps' => $this->bo->load_group_apps($_GET['account_id']) ); + + $this->create_edit_group($group_info); } - - $apps_with_acl = Array - ( - 'addressbook' => True, - 'bookmarks' => True, - 'calendar' => True, - 'filemanager' => True, - 'img' => True, - 'infolog' => True, - 'inv' => True, - 'netsaint' => True, - 'notes' => True, - 'phonelog' => True, - 'phpwebhosting' => True, - 'projects' => True, - 'todo' => True, - 'tts' => True - ); - - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','groups')); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . ((intval($account_id) > 0)?lang('edit group'):lang('add group')); - - $accounts = CreateObject('phpgwapi.accounts',$account_id,'u'); - $account_list = $accounts->get_list('accounts'); - $account_num = count($account_list); - - while (list($key,$entry) = each($account_list)) - { - $user_list[] = array - ( - 'account_id' => $entry['account_id'], - 'account_name' => $GLOBALS['phpgw']->common->display_fullname($entry['account_lid'],$entry['account_firstname'], - $entry['account_lastname']), - 'selected' => $group_info['account_user'][intval($entry['account_id'])] - ); - } - - $group_repository = $accounts->read_repository(); - if (!$group_repository['file_space']) - { - $group_repository['file_space'] = $GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['phpgw_info']['server']['vfs_default_account_size_type']; - } - /* - $file_space_array = explode ('-', $group_repository['file_space']); - $account_file_space_types = array ('gb', 'mb', 'kb', 'b'); - while (list ($num, $type) = each ($account_file_space_types)) - { - $account_file_space_select .= ''."\n"; - } - $p->set_var ('lang_file_space', lang('File space')); - $p->set_var ('account_file_space', ''); - $p->set_var ('account_file_space_select',''."\n"); - */ - - reset($GLOBALS['phpgw_info']['apps']); - $sorted_apps = $GLOBALS['phpgw_info']['apps']; - @asort($sorted_apps); - @reset($sorted_apps); - while ($permission = each($sorted_apps)) - { - if ($permission[1]['enabled'] && $permission[1]['status'] != 3) - { - $perm_display[] = array - ( - $permission[0], - $permission[1]['title'] - ); - } - } - - /*$perm_html = '

    '; - $perm_html = ''.$perm_html.$perm_html."\n";*/ - - for ($i=0;$i < count($perm_display);$i++) - { - $app = $perm_display[$i][0]; - /*$perm_html .= '' - . ''.($i & 1?'':'')."\n";*/ - - $app_list[] = array - ( - 'app_name' => $perm_display[$i][1], - 'checkbox_name' => 'account_apps[' . $perm_display[$i][0] . ']', - 'checked' => ($group_info['account_apps'][$app]?'checked':''), - 'acl_url' => ($apps_with_acl[$app] && $account_id?$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$account_id):''), - 'acl_img' => $GLOBALS['phpgw']->common->image('admin','dot'), - 'img_name' => lang('Grant Access') - ); - } - - /*if($i & 1) - { - $perm_html .= ''; - }*/ - - $link_data = array - ( - 'menuaction' => 'admin.uiaccounts.edit_group', - 'account_id' => $account_id - ); - - $data = array - ( - 'msgbox_data' => $error_list, - 'edit_url' => $GLOBALS['phpgw']->link('/index.php',$link_data), - 'account_id' => $group_info['account_id'], - 'lang_account_name' => lang('group name'), - 'value_account_name' => $group_info['account_name'], - 'lang_include_user' => lang('select users for inclusion'), - 'select_size' => ($account_num < 5?$account_num:5), - 'user_list' => $user_list, - 'lang_permissions' => lang('permissions this group has'), - 'lang_application' => lang('application'), - 'lang_acl' => lang('acl'), - 'lang_cancel' => lang('cancel'), - 'lang_save' => lang('save'), - 'app_list' => $app_list, - 'account_id' => $account_id - ); - - /* create the menu on the left, if needed - $p->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','group_manager')); */ - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_edit' => $data)); } - function edit_user() + function edit_view_user_hook() { - $cd = get_var('cd',array('GET')); - $account_id = get_var('account_id',array('GET','POST')); - $values = get_var('values',array('POST')); - $account_groups = get_var('account_groups',array('POST')); - $account_permissions = get_var('account_permissions',array('POST')); - - if ($values['cancel'] || (!$account_id && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || ($account_id && $GLOBALS['phpgw']->acl->check('account_access',16,'admin'))) + if (!$GLOBALS['phpgw']->acl->check('current_sessions_access',1,'admin')) // no rights to view { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_users'); + $GLOBALS['menuData'][] = array( + 'description' => 'Login History', + 'url' => '/index.php', + 'extradata' => 'menuaction=admin.uiaccess_history.list_history' + ); + } + // not sure if this realy belongs here, or only in edit_user + if ($_GET['account_id'] && // can't set it on add + !$GLOBALS['phpgw']->acl->check('account_access',64,'admin')) // no rights to set ACL-rights + { + $GLOBALS['menuData'][] = array( + 'description' => 'ACL Rights', + 'url' => '/index.php', + 'extradata' => 'menuaction=admin.uiaclmanager.list_apps' + ); + } + } + + function edit_user($cd='',$account_id='') + { + if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) + { + $this->list_users(); + return False; } - /*$cdid = $cd; + $cdid = $cd; settype($cd,'integer'); $cd = ($_GET['cd']?$_GET['cd']:intval($cdid)); $accountid = $account_id; settype($account_id,'integer'); - $account_id = ($_GET['account_id']?$_GET['account_id']:intval($accountid));*/ + $account_id = intval($_GET['account_id'] ? $_GET['account_id'] : $accountid); - if ($values['save']) + // todo + // not needed if i use the same file for new users too + if (! $account_id) { - if (is_array($account_groups)) - { - $values['account_groups'] = $account_groups; - } - - if (is_array($account_permissions)) - { - $values['account_permissions'] = $account_permissions; - } - - $error = $this->bo->validate_user($values); - - if (is_array($error)) - { - $error_list = $GLOBALS['phpgw']->common->error_list($error); - } - else - { - if ($account_id) - { - $values['account_id'] = $account_id; - } - $this->bo->save_user($values); - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_users'); - } - } - - $sbox = createobject('phpgwapi.sbox'); - - if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes'] && ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')) - { - } - - print_debug('Type : '.gettype($_userData).'
    _userData(size) = "'.$_userData.'"('.strlen($_userData).')'); - - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','users')); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . ($account_id?lang('edit user account'):lang('add user account')); - - if ($account_id) - { - $user_info = Array - ( - 'account_name' => $GLOBALS['phpgw']->accounts->id2name($account_id), - 'account_user' => $this->bo->load_group_users($account_id), - 'account_apps' => $this->bo->load_group_apps($account_id) - ); - } - - if($account_id) - { - $account = CreateObject('phpgwapi.accounts',intval($account_id),'u'); - $userData = $account->read_repository(); - $userGroups = $account->membership($account_id); + $this->list_users(); + return False; } else { - $account = CreateObject('phpgwapi.accounts'); - $userData = Array(); - $userData['status'] = 'A'; - $userGroups = Array(); + $this->create_edit_user($account_id); } - $allGroups = $account->get_list('groups'); - - if ($userData['expires'] == -1) - { - $userData['account_expires_month'] = 0; - $userData['account_expires_day'] = 0; - $userData['account_expires_year'] = 0; - } - else - { - /* Change this to be an admin/setup setting. For now, default to expire one week from today. */ - $time_var = time() + (60*60*24*7); - $userData['account_expires_month'] = date('m',$userData['expires'] > 0 ? $userData['expires'] : $time_var); - $userData['account_expires_day'] = date('d',$userData['expires'] > 0 ? $userData['expires'] : $time_var); - $userData['account_expires_year'] = date('Y',$userData['expires'] > 0 ? $userData['expires'] : $time_var); - } - - if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes']) - { - $lang_homedir = lang('home directory'); - $lang_shell = lang('login shell'); - $homedirectory = ''; - $loginshell = ''; - } - - $_y = $sbox->getyears('account_expires_year',$userData['account_expires_year'],date('Y'),date('Y')+10); - $_m = $sbox->getmonthtext('account_expires_month',$userData['account_expires_month']); - $_d = $sbox->getdays('account_expires_day',$userData['account_expires_day']); - - /* $account_file_space = ''; - if (!$userData['file_space']) - { - $userData['file_space'] = $GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['phpgw_info']['server']['vfs_default_account_size_type']; - } - $file_space_array = explode ('-', $userData['file_space']); - $account_file_space_number = $file_space_array[0]; - $account_file_space_type = $file_space_array[1]; - $account_file_space_type_selected[$account_file_space_type] = ' selected'; - - $account_file_space = ''; - $account_file_space_select =''; - - $var = Array( - 'lang_file_space' => 'File space', - 'account_file_space' => $account_file_space, - 'account_file_space_select' => $account_file_space_select - ); - $t->set_var($var); - */ - - reset($allGroups); - while (list($key,$value) = each($allGroups)) - { - $group_list[] = array - ( - 'account_id' => $value['account_id'], - 'account_lid' => $value['account_lid'] - ); - } - - for ($i=0;$iread_account_specific(); - - @reset($GLOBALS['phpgw_info']['apps']); - $availableApps = $GLOBALS['phpgw_info']['apps']; - @asort($availableApps); - @reset($availableApps); - while (list($key,$application) = each($availableApps)) - { - if ($application['enabled'] && $application['status'] != 3) - { - $perm_display[$i]['appName'] = $key; - $perm_display[$i]['translatedName'] = $application['title']; - $i++; - } - } - - /* create apps output */ - $appRightsOutput = ''; -// @reset($perm_display); - for ($i=0;$i $perm_display[$i]['translatedName'], - 'checkbox_name' => 'account_permissions[' . $perm_display[$i]['appName'] . ']', - 'checked' => ($userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]?'yes':'') - ); - } - - $page_params['menuaction'] = 'admin.uiaccounts.edit_user'; - if($account_id) - { - $page_params['account_id'] = $account_id; - $page_params['old_loginid'] = rawurlencode($userData['account_lid']); - } - - $data = array - ( - 'msgbox_data' => $error_list, - 'edit_url' => $GLOBALS['phpgw']->link('/index.php',$page_params), - 'lang_lid' => lang('loginid'), - 'lang_account_active' => lang('account active'), - 'lang_password' => lang('password'), - 'lang_reenter_password' => lang('Re-Enter Password'), - 'lang_lastname' => lang('lastname'), - 'lang_groups' => lang('groups'), - 'lang_expires' => lang('expires'), - 'lang_firstname' => lang('firstname'), - 'lang_applications' => lang('applications'), - 'lang_save' => lang('save'), - 'lang_cancel' => lang('cancel'), - 'select_expires' => $GLOBALS['phpgw']->common->dateformatorder($_y,$_m,$_d,True), - 'lang_never' => lang('Never'), - 'account_lid' => $userData['account_lid'], - 'lang_homedir' => $lang_homedir, - 'lang_shell' => $lang_shell, - 'homedirectory' => $homedirectory, - 'loginshell' => $loginshell, - 'account_status' => ($userData['status']?'yes':''), - 'account_firstname' => $userData['firstname'], - 'account_lastname' => $userData['lastname'], - 'account_passwd' => $account_passwd, - 'account_passwd_2' => $account_passwd_2, - 'expires_never' => (($userData['expires'] == -1)?'yes':''), - 'group_list' => $group_list, - 'app_list' => $app_list - ); - - /* create the menu on the left, if needed - $menuClass = CreateObject('admin.uimenuclass'); - This is now using ExecMethod() - $t->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','edit_user')); */ - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('account_edit' => $data)); } function view_user() @@ -734,13 +593,16 @@ $t->set_block('account','link_row'); $var = Array( + 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], + 'tr_color1' => $GLOBALS['phpgw_info']['theme']['row_on'], + 'tr_color2' => $GLOBALS['phpgw_info']['theme']['row_off'], 'lang_action' => lang('View user account'), 'lang_loginid' => lang('LoginID'), 'lang_account_active' => lang('Account active'), - 'lang_password' => lang('Password'), - 'lang_reenter_password' => lang('Re-Enter Password'), 'lang_lastname' => lang('Last Name'), 'lang_groups' => lang('Groups'), + 'lang_anonymous' => lang('Anonymous user (not shown in list sessions)'), + 'lang_changepassword'=> lang('Can change password'), 'lang_firstname' => lang('First Name'), 'lang_lastlogin' => lang('Last login'), 'lang_lastloginfrom' => lang('Last login from'), @@ -756,6 +618,11 @@ $var['account_firstname'] = $userData['firstname']; $var['account_lastname'] = $userData['lastname']; + $acl = CreateObject('phpgwapi.acl',intval($_GET['account_id'])); + $var['anonymous'] = $acl->check('anonymous',1,'phpgwapi') ? '  X' : ' '; + $var['changepassword'] = $acl->check('changepassword',0xFFFF,'preferences') ? '  X' : ' '; + unset($acl); + if ($userData['status']) { $var['account_status'] = lang('Enabled'); @@ -807,7 +674,7 @@ { $group_names[] = $group['account_name']; } - $var['groups_select'] = implode(',',$group_names); + $var['groups_select'] = implode(', ',$group_names); } $account_lastlogin = $userData['account_lastlogin']; @@ -820,12 +687,12 @@ $availableApps = $GLOBALS['phpgw_info']['apps']; @asort($availableApps); @reset($availableApps); - while ($application = each($availableApps)) + foreach($availableApps as $app => $data) { - if ($application[1]['enabled'] && $application[1]['status'] != 2) + if ($data['enabled'] && $data['status'] != 2) { - $perm_display[$i]['appName'] = $application[0]; - $perm_display[$i]['translatedName'] = $application[1]['title']; + $perm_display[$i]['appName'] = $app; + $perm_display[$i]['title'] = $data['title']; $i++; } } @@ -836,25 +703,25 @@ @reset($db_perms); - for ($i=0;$i<=count($perm_display);$i++) + for ($i=0;$i%s
    ",lang($perm_display[$i]['translatedName']),($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]?'  X':' ')); + $part1 = sprintf("",$perm_display[$i]['title'],($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]?'  X':' ')); } $i++; - if ($perm_display[$i]['translatedName']) + if ($perm_display[$i]['title']) { - $part2 = sprintf("",lang($perm_display[$i]['translatedName']),($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]?'  X':' ')); + $part2 = sprintf("",$perm_display[$i]['title'],($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]?'  X':' ')); } else { $part2 = ''; } - $appRightsOutput .= "$part1$part2\n"; + $appRightsOutput .= sprintf("$part1$part2\n",$GLOBALS['phpgw_info']['theme']['row_on']); } $var['permissions_list'] = $appRightsOutput; @@ -867,101 +734,6 @@ $t->pfp('out','form'); } - function delete_group() - { - $account_id = get_var('account_id',array('POST','GET')); - - if ($_POST['cancel'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) - { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_groups'); - } - - if ($account_id && $_POST['delete']) - { - $this->bo->delete_group($account_id); - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_groups'); - } - - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_delete')); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('administration') . ': ' . lang('delete group'); - - $data = array - ( - 'delete_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id=' . $account_id), - 'lang_delete' => lang('delete'), - 'lang_cancel' => lang('cancel'), - 'lang_delete_statustext' => lang('delete the group'), - 'lang_cancel_statustext' => lang('Leave the group untouched and return back to the list'), - 'lang_delete_msg' => lang('are you sure you want to delete this group ?') - ); - - $old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location(intval($account_id),1,'phpgw_group'); - - if($old_group_list) - { - $group_name = $GLOBALS['phpgw']->accounts->id2name($account_id); - - $user_list = ''; - while (list(,$id) = each($old_group_list)) - { - $data['user_list'][] = array - ( - 'user_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_user&account_id=' . $id), - 'user_name' => $GLOBALS['phpgw']->common->grab_owner_name($id), - 'lang_user_url_statustext' => lang('edit user') - ); - } - - $data['lang_confirm_msg'] = lang('the users bellow are still members of group %1',$group_name) . '. ' - . lang('they must be removed before you can continue'); - $data['lang_remove_user'] = lang('Remove all users from this group ?'); - } - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data)); - } - - function delete_user() - { - if ($GLOBALS['phpgw']->acl->check('account_access',32,'admin') || $GLOBALS['phpgw_info']['user']['account_id'] == $_GET['account_id']) - { - $this->list_users(); - return False; - } - - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - $GLOBALS['phpgw']->common->phpgw_header(); - - $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $t->set_file( - Array( - 'form' => 'delete_account.tpl' - ) - ); - $var = Array( - 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.delete_user'), - 'account_id' => $_GET['account_id'] - ); - - // the account can have special chars/white spaces, if it is a ldap dn - $account_id = rawurlencode($_GET['account_id']); - - // Find out who the new owner is of the deleted users records... - $users = $GLOBALS['phpgw']->accounts->get_list('accounts'); - $c_users = count($users); - $str = ''; - for($i=0;$i<$c_users;$i++) - { - $str .= ''."\n"; - } - $var['lang_new_owner'] = lang('Who would you like to transfer ALL records owned by the deleted user to?'); - $var['new_owner_select'] = ''."\n"; - $var['cancel'] = lang('cancel'); - $var['delete'] = lang('delete'); - $t->set_var($var); - $t->pparse('out','form'); - } - function group_manager($cd='',$account_id='') { if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) @@ -997,6 +769,412 @@ } } + function accounts_popup() + { + $GLOBALS['phpgw']->accounts->accounts_popup('admin'); + } + + function create_edit_group($group_info,$_errors='') + { + // Maybe we should list this in setup/setup.inc.php and put it into the + // phpgw_applications table ? (jengo) + $apps_with_acl = array( + 'addressbook' => True, + 'todo' => True, + 'calendar' => True, + 'notes' => True, + 'projects' => True, + 'phonelog' => True, + 'infolog' => True, + 'filemanager' => True, + 'tts' => True, + 'bookmarks' => True, + 'img' => True, + 'netsaint' => True, + 'inv' => True + ); + + $sbox = createobject('phpgwapi.sbox'); + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p->set_file(Array('edit' => 'group_form.tpl')); + $p->set_block('edit','select'); + $p->set_block('edit','popwin'); + + $accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'u'); + + if ($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'] == 'popup') + { + $p->set_var('accounts_link',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.accounts_popup')); + $p->set_var('lang_open_popup',lang('open popup window')); + + while(is_array($group_info['account_user']) && list($ac_id,) = each($group_info['account_user'])) + { + $ac_name = $GLOBALS['phpgw']->accounts->get_account_data($ac_id); + + $user_list .= ''."\n"; + } + $account_num = count($group_info['account_user']); + $p->set_var('select_size',($account_num < 25?$account_num:25)); + $p->set_var('user_list',$user_list); + $p->fp('accounts','popwin',True); + } + else + { + $account_list = $accounts->get_list('accounts'); + $account_num = count($account_list); + + $user_list = ''; + while (list($key,$entry) = each($account_list)) + { + $user_list .= ''."\n"; + } + $p->set_var('select_size',($account_num < 7?$account_num:7)); + $p->set_var('user_list',$user_list); + $p->fp('accounts','select',True); + } + + $var = Array( + 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.'.($group_info['account_id']?'edit':'add').'_group'), + 'hidden_vars' => '', + 'lang_group_name' => lang('group name'), + 'group_name_value' => $group_info['account_name'], + 'lang_include_user' => lang('Select users for inclusion'), + 'error' => (!$_errors?'':'
    '.$GLOBALS['phpgw']->common->error_list($_errors).'
    '), + 'lang_permissions' => lang('Permissions this group has') + ); + $p->set_var($var); + + $group_repository = $accounts->read_repository(); + if (!$group_repository['file_space']) + { + $group_repository['file_space'] = $GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['phpgw_info']['server']['vfs_default_account_size_type']; + } + /* + $file_space_array = explode ('-', $group_repository['file_space']); + $account_file_space_types = array ('gb', 'mb', 'kb', 'b'); + while (list ($num, $type) = each ($account_file_space_types)) + { + $account_file_space_select .= ''."\n"; + } + $p->set_var ('lang_file_space', lang('File space')); + $p->set_var ('account_file_space', ''); + $p->set_var ('account_file_space_select',''."\n"); + */ + + reset($GLOBALS['phpgw_info']['apps']); + $sorted_apps = $GLOBALS['phpgw_info']['apps']; + @asort($sorted_apps); + @reset($sorted_apps); + while ($permission = each($sorted_apps)) + { + if ($permission[1]['enabled'] && $permission[1]['status'] != 3) + { + $perm_display[] = Array( + $permission[0], + $permission[1]['title'] + ); + } + } + + $perm_html = '
    '; + $perm_html = ''. + $perm_html.$perm_html."\n"; + + $tr_color = $GLOBALS['phpgw_info']['theme']['row_off']; + for ($i=0;$i < count($perm_display);$i++) + { + $app = $perm_display[$i][0]; + if(!($i & 1)) + { + $tr_color = $this->nextmatchs->alternate_row_color(); + $perm_html .= ''; + } + $perm_html .= '' + . ''.($i & 1?'':'')."\n"; + } + if($i & 1) + { + $perm_html .= ''; + } + + $var = Array( + 'permissions_list' => $perm_html, + 'lang_submit_button' => lang('submit changes') + ); + $p->set_var($var); + + // create the menu on the left, if needed + $p->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','group_manager')); + + $p->set_var('select',''); + $p->set_var('popwin',''); + $p->pfp('out','edit'); + + } + + function create_edit_user($_account_id,$_userData='',$_errors='') + { + $sbox = createobject('phpgwapi.sbox'); + $jscal = CreateObject('phpgwapi.jscalendar'); + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_unknowns('remove'); + + if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes'] && ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')) + { + $t->set_file(array('account' => 'account_form_ldap.tpl')); + } + else + { + $t->set_file(array('account' => 'account_form.tpl')); + } + $t->set_block('account','form','form'); + $t->set_block('account','form_passwordinfo','form_passwordinfo'); + $t->set_block('account','form_buttons_','form_buttons_'); + $t->set_block('account','link_row','link_row'); + + print_debug('Type : '.gettype($_userData).'
    _userData(size) = "'.$_userData.'"('.strlen($_userData).')'); + if (is_array($_userData)) + { + $userData = Array(); + $userData=$_userData; + @reset($userData['account_groups']); + while (list($key, $value) = @each($userData['account_groups'])) + { + $userGroups[$key]['account_id'] = $value; + } + + $account = CreateObject('phpgwapi.accounts'); + $allGroups = $account->get_list('groups'); + } + elseif(is_string($_userData) && $_userData=='') + { + if($_account_id) + { + $account = CreateObject('phpgwapi.accounts',intval($_account_id),'u'); + $userData = $account->read_repository(); + $userGroups = $account->membership($_account_id); + $acl = CreateObject('phpgwapi.acl',$_account_id); + $acl->read_repository(); + $userData['anonymous'] = $acl->check('anonymous',1,'phpgwapi'); + $userData['changepassword'] = $acl->check('changepassword',0xFFFF,'preferences'); + unset($acl); + } + else + { + $account = CreateObject('phpgwapi.accounts'); + $userData = Array(); + $userData['status'] = 'A'; + $userGroups = Array(); + $userData['anonymous'] = False; + $userData['changepassword'] = True; + } + $allGroups = $account->get_list('groups'); + } + $page_params['menuaction'] = 'admin.boaccounts.'.($_account_id?'edit':'add').'_user'; + if($_account_id) + { + $page_params['account_id'] = $_account_id; + $page_params['old_loginid'] = rawurlencode($userData['account_lid']); + } + + $var = Array( + 'form_action' => $GLOBALS['phpgw']->link('/index.php',$page_params), + 'error_messages' => (!$_errors?'':'
    '.$GLOBALS['phpgw']->common->error_list($_errors).'
    '), + 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], + 'tr_color1' => $GLOBALS['phpgw_info']['theme']['row_on'], + 'tr_color2' => $GLOBALS['phpgw_info']['theme']['row_off'], + 'lang_action' => ($_account_id?lang('Edit user account'):lang('Add new account')), + 'lang_loginid' => lang('LoginID'), + 'lang_account_active' => lang('Account active'), + 'lang_password' => lang('Password'), + 'lang_reenter_password' => lang('Re-Enter Password'), + 'lang_lastname' => lang('Last Name'), + 'lang_groups' => lang('Groups'), + 'lang_expires' => lang('Expires'), + 'lang_firstname' => lang('First Name'), + 'lang_anonymous' => lang('Anonymous User (not shown in list sessions)'), + 'lang_changepassword' => lang('Can change password'), + 'lang_button' => ($_account_id?lang('Save'):lang('Add')) + /* 'lang_file_space' => lang('File Space') */ + ); + $t->set_var($var); + $t->parse('form_buttons','form_buttons_',True); + + if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes']) { + $lang_homedir = lang('home directory'); + $lang_shell = lang('login shell'); + $homedirectory = ''; + $loginshell = ''; + } + else + { + $lang_homedir = ''; + $lang_shell = ''; + $homedirectory = ''; + $loginshell = ''; + } + $account_file_space = ''; + /* + if (!$userData['file_space']) + { + $userData['file_space'] = $GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['phpgw_info']['server']['vfs_default_account_size_type']; + } + $file_space_array = explode ('-', $userData['file_space']); + $account_file_space_number = $file_space_array[0]; + $account_file_space_type = $file_space_array[1]; + $account_file_space_type_selected[$account_file_space_type] = ' selected'; + + $account_file_space = ''; + $account_file_space_select =''; + + $var = Array( + 'lang_file_space' => 'File space', + 'account_file_space' => $account_file_space, + 'account_file_space_select' => $account_file_space_select + ); + $t->set_var($var); + */ + $var = Array( + 'input_expires' => $jscal->input('expires',$userData['expires']<0?'':($userData['expires']?$userData['expires']:time()+(60*60*24*7))), + 'lang_never' => lang('Never'), + 'account_lid' => '', + 'lang_homedir' => $lang_homedir, + 'lang_shell' => $lang_shell, + 'homedirectory' => $homedirectory, + 'loginshell' => $loginshell, + 'anonymous' => '', + 'changepassword'=> '', + 'account_status' => '', + 'account_firstname' => '', + 'account_lastname' => '', + 'account_passwd' => $account_passwd, + 'account_passwd_2' => $account_passwd_2, + 'account_file_space' => $account_file_space + ); + + if($userData['expires'] == -1) + { + $var['never_expires'] = ''; + } + else + { + $var['never_expires'] = ''; + } + + $t->set_var($var); + $t->parse('password_fields','form_passwordinfo',True); + +// $allAccounts; +// $userGroups; + + $groups_select = ''; + reset($allGroups); + while (list($key,$value) = each($allGroups)) + { + $groups_select .= ''."\n"; + } + + /* create list of available apps */ + $i = 0; + + $apps = CreateObject('phpgwapi.applications',$_account_id); + $db_perms = $apps->read_account_specific(); + + @reset($GLOBALS['phpgw_info']['apps']); + $availableApps = $GLOBALS['phpgw_info']['apps']; + @asort($availableApps); + @reset($availableApps); + while (list($key,$application) = each($availableApps)) + { + if ($application['enabled'] && $application['status'] != 3) + { + $perm_display[$i]['appName'] = $key; + $perm_display[$i]['title'] = $application['title']; + $i++; + } + } + + /* create apps output */ + $appRightsOutput = ''; +// @reset($perm_display); + for ($i=0;$i<=count($perm_display);$i++) + { + $checked = ((($userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]) && $_account_id)?' checked':''); + + if ($perm_display[$i]['title']) + { + $part[$i&1] = sprintf('
    ', + $perm_display[$i]['title'], + $perm_display[$i]['appName'], + $checked); + } + else + { + $part[1] = ''; + } + + if ($i & 1) + { + $appRightsOutput .= sprintf('%s%s',$this->nextmatchs->alternate_row_color()/*$GLOBALS['phpgw_info']['theme']['row_on']*/, $part[0], $part[1]); + } + } + + $var = Array( + 'groups_select' => ''."\n", + 'permissions_list' => $appRightsOutput + ); + $t->set_var($var); + + // create the menu on the left, if needed +// $menuClass = CreateObject('admin.uimenuclass'); + // This is now using ExecMethod() + $GLOBALS['account_id'] = $_account_id; + $t->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','edit_user')); + + echo $t->fp('out','form'); + } + function edit_group_managers($group_info,$_errors='') { if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) diff --git a/admin/inc/class.uiaclmanager.inc.php b/admin/inc/class.uiaclmanager.inc.php index 4e6dfd2c2c..956dcd3628 100644 --- a/admin/inc/class.uiaclmanager.inc.php +++ b/admin/inc/class.uiaclmanager.inc.php @@ -23,12 +23,20 @@ function uiaclmanager() { + $this->account_id = intval($_GET['account_id']); + if (!$this->account_id || $GLOBALS['phpgw']->acl->check('account_access',64,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } $this->template = createobject('phpgwapi.Template',PHPGW_APP_TPL); } function common_header() { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('ACL Manager') . + ': ' . $GLOBALS['phpgw']->common->grab_owner_name($this->account_id); $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); } function list_apps() @@ -46,14 +54,12 @@ $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')); - 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('app_name',$GLOBALS['phpgw_info']['apps'][$app]['title']); $this->template->set_var('a_name',$appname); $this->template->set_var('app_icon',$icon); @@ -68,83 +74,83 @@ while (is_array($locations) && list($loc,$value) = each($locations)) { - $total_rights = 0; - while (list($k,$v) = each($value['rights'])) - { - $total_rights += $v; - } - reset($value['rights']); + $link_values = array( + 'menuaction' => 'admin.uiaclmanager.access_form', + 'location' => urlencode($loc), + 'acl_app' => $app, + 'account_id' => $this->account_id + ); - // 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)) - { - $link_values = array( - 'menuaction' => 'admin.uiaclmanager.access_form', - 'location' => urlencode(base64_encode($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->set_var(array( + 'cancel_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), + 'lang_cancel' => lang('Cancel') + )); $this->template->pfp('out','list'); } function access_form() { - $GLOBALS['phpgw']->hooks->single('acl_manager',$GLOBALS['acl_app']); - $location = base64_decode($GLOBALS['location']); + $location = $_GET['location']; - $acl_manager = $GLOBALS['acl_manager'][$GLOBALS['acl_app']][$location]; + if ($_POST['submit'] || $_POST['cancel']) + { + if ($_POST['submit']) + { + $total_rights = 0; + while (is_array($_POST['acl_rights']) && list(,$rights) = each($_POST['acl_rights'])) + { + $total_rights += $rights; + } + if ($total_rights) + { + $GLOBALS['phpgw']->acl->add_repository($_GET['acl_app'], $location, $this->account_id, $total_rights); + } + else // we dont need to save 0 rights (= no restrictions) + { + $GLOBALS['phpgw']->acl->delete_repository($_GET['acl_app'], $location, $this->account_id); + } + } + $this->list_apps(); + return; + } + $GLOBALS['phpgw']->hooks->single('acl_manager',$_GET['acl_app']); + $acl_manager = $GLOBALS['acl_manager'][$_GET['acl_app']][$location]; $this->common_header(); $this->template->set_file('form','acl_manager_form.tpl'); - $acc = createobject('phpgwapi.accounts',$GLOBALS['account_id']); + $acc = createobject('phpgwapi.accounts',$this->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 %1 to %2 for %3',$acl_manager['name'],$GLOBALS['acl_app'],$afn)); + $this->template->set_var('lang_message',lang('Check items to %1 to %2 for %3',lang($acl_manager['name']),$GLOBALS['phpgw_info']['apps'][$_GET['acl_app']]['title'],$afn)); $link_values = array( - 'menuaction' => 'admin.boaclmanager.submit', - 'acl_app' => $GLOBALS['acl_app'], - 'location' => urlencode($GLOBALS['location']), - 'account_id' => $GLOBALS['account_id'] + 'menuaction' => 'admin.uiaclmanager.access_form', + 'acl_app' => $_GET['acl_app'], + 'location' => urlencode($_GET['location']), + 'account_id' => $this->account_id ); - $acl = createobject('phpgwapi.acl',$GLOBALS['account_id']); + $acl = createobject('phpgwapi.acl',$this->account_id); $acl->read_repository(); + $grants = $acl->get_rights($location,$_GET['acl_app']); $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,$GLOBALS['acl_app']); - - if (! $GLOBALS['phpgw']->acl->check($location,$value,$GLOBALS['acl_app'])) - { - $s .= '' @@ -310,38 +346,47 @@ $this->display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),''); $GLOBALS['phpgw']->template->set_var('select_status',$status_html); - $GLOBALS['phpgw']->template->pparse('out','form'); + $GLOBALS['phpgw']->template->pparse('phpgw_body','form'); } function delete() { - $app_name = $GLOBALS['HTTP_GET_VARS']['app_name']; - - if (!$app_name) + if ($GLOBALS['phpgw']->acl->check('applications_access',8,'admin')) { - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list')); + $GLOBALS['phpgw']->redirect_link('/index.php'); + } + $app_name = get_var('app_name',array('POST','GET')); + $start = get_var('start',array('POST','GET')); + + if (!$app_name || $_POST['no'] || $_POST['yes']) + { + if ($_POST['yes']) + { + $this->bo->delete($app_name); + } + $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); } $GLOBALS['phpgw']->template->set_file(array('body' => 'delete_common.tpl')); - if ($GLOBALS['HTTP_GET_VARS']['confirm']) - { - $this->bo->delete($app_name); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; - } - $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); - $GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete this application ?')); - $GLOBALS['phpgw']->template->set_var('no','' . lang('No') . ''); - $GLOBALS['phpgw']->template->set_var('yes','' . lang('Yes') . ''); - $GLOBALS['phpgw']->template->pparse('out','body'); + $GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete the application %1 ?',$GLOBALS['phpgw_info']['apps'][$app_name]['title'])); + $GLOBALS['phpgw']->template->set_var('no',lang('No')); + $GLOBALS['phpgw']->template->set_var('yes',lang('Yes')); + $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete')); + $GLOBALS['phpgw']->template->set_var('hidden_vars',''. + ''); + $GLOBALS['phpgw']->template->pparse('phpgw_body','body'); } function register_all_hooks() { + if ($GLOBALS['phpgw']->acl->check('applications_access',16,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } if (!is_object($GLOBALS['phpgw']->hooks)) { $GLOBALS['phpgw']->hooks = CreateObject('phpgwapi.hooks'); diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index 9223bb2f9d..14e35c725a 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -4,10 +4,12 @@ * http://www.phpgroupware.org * * Written by Bettina Gille [ceb@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. * + * Copyright 2000 - 2003 Free Software Foundation, Inc * + * * + * 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$ */ /* $Source$ */ @@ -15,8 +17,7 @@ class uicategories { var $bo; - var $nextmatchs; - var $xslttpl; + var $template; var $start; var $query; @@ -28,20 +29,35 @@ var $public_functions = array ( 'index' => True, + 'add' => True, 'edit' => True, 'delete' => True ); function uicategories() { - $GLOBALS['phpgw_info']['flags']['xslt_app'] = True; + if ($GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } $this->bo = CreateObject('admin.bocategories'); + $this->template = $GLOBALS['phpgw']->template; $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); + $this->acl_search = !$GLOBALS['phpgw']->acl->check('global_categories_access',2,'admin'); + $this->acl_add = !$GLOBALS['phpgw']->acl->check('global_categories_access',4,'admin'); + $this->acl_view = !$GLOBALS['phpgw']->acl->check('global_categories_access',8,'admin'); + $this->acl_edit = !$GLOBALS['phpgw']->acl->check('global_categories_access',16,'admin'); + $this->acl_delete = !$GLOBALS['phpgw']->acl->check('global_categories_access',32,'admin'); + $this->acl_add_sub= !$GLOBALS['phpgw']->acl->check('global_categories_access',64,'admin'); + + $this->appname = get_var('appname',array('GET','POST')); + $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps'][$this->appname ? $this->appname : 'admin']['title']; + $this->start = $this->bo->start; $this->query = $this->bo->query; - $this->sort = $this->bo->sort; + $this->sort = $this->bo->sort; $this->order = $this->bo->order; $this->cat_id = $this->bo->cat_id; if($this->debug) { $this->_debug_sqsof(); } @@ -50,11 +66,11 @@ function _debug_sqsof() { $data = array( - 'start' => $this->start, - 'query' => $this->query, - 'sort' => $this->sort, - 'order' => $this->order, - 'cat_id' => $this->cat_id + 'start' => $this->start, + 'query' => $this->query, + 'sort' => $this->sort, + 'order' => $this->order, + 'cat_id' => $this->cat_id ); echo '
    UI:
    '; _debug_array($data); @@ -64,10 +80,10 @@ { $data = array ( - 'start' => $this->start, - 'query' => $this->query, - 'sort' => $this->sort, - 'order' => $this->order + 'start' => $this->start, + 'query' => $this->query, + 'sort' => $this->sort, + 'order' => $this->order ); if(isset($this->cat_id)) @@ -77,106 +93,133 @@ $this->bo->save_sessiondata($data); } + function set_langs() + { + $this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); + $this->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']); + $this->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']); + $this->template->set_var('lang_save',lang('Save')); + $this->template->set_var('lang_search',lang('Search')); + $this->template->set_var('lang_sub',lang('Add sub')); + $this->template->set_var('lang_edit',lang('Edit')); + $this->template->set_var('lang_delete',lang('Delete')); + $this->template->set_var('lang_parent',lang('Parent category')); + $this->template->set_var('lang_none',lang('None')); + $this->template->set_var('lang_name',lang('Name')); + $this->template->set_var('lang_descr',lang('Description')); + $this->template->set_var('lang_add',lang('Add')); + $this->template->set_var('lang_reset',lang('Clear Form')); + $this->template->set_var('lang_cancel',lang('Cancel')); + $this->template->set_var('lang_done',lang('Done')); + } + function index() { - $global_cats = get_var('global_cats',array('POST','GET')); - - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'search_field', - $GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'nextmatchs')); - $link_data = array ( - 'menuaction' => 'admin.uicategories.index', - 'appname' => $GLOBALS['appname'], - 'global_cats' => $global_cats + 'menuaction' => 'admin.uicategories.add', + 'appname' => $this->appname ); if ($_POST['add']) { - $link_data['menuaction'] = 'admin.uicategories.edit'; $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } if ($_POST['done']) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uimainscreen.mainscreen'); + $GLOBALS['phpgw']->redirect_link('/admin/index.php'); } - if ($GLOBALS['appname']) + $this->template->set_file(array('cat_list_t' => 'listcats.tpl')); + $this->template->set_block('cat_list_t','cat_list','list'); + if (!$this->acl_add) { - $GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . lang('category list'); + $this->template->set_block('cat_list_t','add','addhandle'); } - else + if (!$this->acl_search) { - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('global categories') . ': ' . lang('category list'); + $this->template->set_block('cat_list_t','search','searchhandle'); } - if (!$global_cats) + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Global categories'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + $this->set_langs(); + $this->template->set_var('query',$this->query); + + $link_data['menuaction'] = 'admin.uicategories.index'; + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data)); + + if(!$start) { - $global_cats = False; + $start = 0; } - $categories = $this->bo->get_list($global_cats); + $categories = $this->bo->get_list(); - $cat_header[] = array - ( - 'sort_name' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $this->sort, - 'var' => 'cat_name', - 'order' => $this->order, - 'extra' => $link_data - )), - 'lang_add_sub' => lang('add sub'), - 'lang_name' => lang('name'), - 'lang_descr' => lang('description'), - 'lang_edit' => lang('edit'), - 'lang_delete' => lang('delete'), - 'lang_sort_statustext' => lang('sort the entries'), - 'sort_descr' => $this->nextmatchs->show_sort_order(array - ( - 'sort' => $this->sort, - 'var' => 'cat_description', - 'order' => $this->order, - 'extra' => $link_data - )) - ); + $left = $this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,$link_data); + $right = $this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,$link_data); + $this->template->set_var('left',$left); + $this->template->set_var('right',$right); - while (is_array($categories) && list(,$cat) = each($categories)) + $this->template->set_var('lang_showing',$this->nextmatchs->show_hits($this->bo->cats->total_records,$this->start)); + + $this->template->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'cat_name',$this->order,'/index.php',lang('Name'),$link_data)); + $this->template->set_var('sort_description',$this->nextmatchs->show_sort_order($this->sort,'cat_description',$this->order,'/index.php',lang('Description'),$link_data)); + + for ($i=0;$istrip_html($cat['name']); + $tr_color = $this->nextmatchs->alternate_row_color($tr_color); + $this->template->set_var(tr_color,$tr_color); + + $id = $categories[$i]['id']; + $level = $categories[$i]['level']; + $cat_name = $GLOBALS['phpgw']->strip_html($categories[$i]['name']); - $main = 'yes'; if ($level > 0) { - $space = ' . '; + $space = '  '; $spaceset = str_repeat($space,$level); $cat_name = $spaceset . $cat_name; - $main = 'no'; } - $descr = $GLOBALS['phpgw']->strip_html($cat['descr']); + $descr = $GLOBALS['phpgw']->strip_html($categories[$i]['description']); + if (!$descr) { $descr = ' '; } - if ($GLOBALS['appname'] && $cat['app_name'] == 'phpgw') + if ($level == 0) { - $appendix = ' <' . lang('Global') . '>'; + $cat_name = '' . $cat_name . ''; + $descr = '' . $descr . ''; + } + + if ($this->appname && $categories[$i]['app_name'] == 'phpgw') + { + $appendix = '<' . lang('Global') . '>'; } else { $appendix = ''; } - $link_data['menuaction'] = 'admin.uicategories.edit'; - $link_data['parent'] = $cat['cat_id']; - $add_sub_url = $GLOBALS['phpgw']->link('/index.php',$link_data); + $this->template->set_var(array + ( + 'name' => $cat_name . $appendix, + 'descr' => $descr + )); - if ($GLOBALS['appname'] && $cat['app_name'] == $GLOBALS['appname']) + if ($this->acl_add_sub) + { + $link_data['menuaction'] = 'admin.uicategories.add'; + $link_data['cat_parent'] = $id; + $this->template->set_var('add_sub',''. + lang('Add sub').''); + } + if ($this->appname && $categories[$i]['app_name'] == $this->appname) { $show_edit_del = True; } - elseif(!$GLOBALS['appname'] && $cat['app_name'] == 'phpgw') + elseif(!$this->appname && $categories[$i]['app_name'] == 'phpgw') { $show_edit_del = True; } @@ -185,242 +228,251 @@ $show_edit_del = False; } - if ($show_edit_del) + $link_data['cat_id'] = $id; + if ($show_edit_del && $this->acl_edit) { - $link_data['cat_id'] = $cat['cat_id']; - $link_data['menuaction'] = 'admin.uicategories.edit'; - $edit_url = $GLOBALS['phpgw']->link('/index.php',$link_data); - $lang_edit = lang('edit'); - - $link_data['menuaction'] = 'admin.uicategories.delete'; - $delete_url = $GLOBALS['phpgw']->link('/index.php',$link_data); - $lang_delete = lang('delete'); + $link_data['menuaction'] = 'admin.uicategories.edit'; + $this->template->set_var('edit',''. + lang('Edit').''); } else { - $edit_url = ''; - $lang_edit = ''; - $delete_url = ''; - $lang_delete = ''; + $this->template->set_var('edit',''); } - - $content[] = array - ( - 'name' => $cat_name . $appendix, - 'descr' => $descr, - 'date' => $note['date'], - 'main' => $main, - 'add_sub_url' => $add_sub_url, - 'edit_url' => $edit_url, - 'delete_url' => $delete_url, - 'lang_add_sub_statustext' => lang('add a subcategory'), - 'lang_edit_statustext' => lang('edit this category'), - 'lang_delete_statustext' => lang('delete this category'), - 'lang_add_sub' => lang('add sub'), - 'lang_edit' => $lang_edit, - 'lang_delete' => $lang_delete - ); + if ($show_edit_del && $this->acl_delete) + { + $link_data['menuaction'] = 'admin.uicategories.delete'; + $this->template->set_var('delete',''. + lang('Delete').''); + } + else + { + $this->template->set_var('delete',''); + } + $this->template->fp('list','cat_list',True); } - - $link_data['menuaction'] = 'admin.uicategories.index'; - $link_data['parent'] = ''; - - $cat_add[] = array - ( - 'lang_add' => lang('add'), - 'lang_add_statustext' => lang('add a category'), - 'action_url' => $GLOBALS['phpgw']->link('/index.php',$link_data), - 'lang_done' => lang('done'), - 'lang_done_statustext' => lang('return to admin mainscreen') - ); - - $link_data['menuaction'] = 'admin.uicategories.index'; - - $data = array - ( - 'start_record' => $this->start, - 'record_limit' => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'], - 'num_records' => count($categoris), - 'all_records' => $this->bo->cats->total_records, - 'nextmatchs_url' => $GLOBALS['phpgw']->link('/index.php',$link_data), - 'nextmatchs_img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'), - 'select_url' => $GLOBALS['phpgw']->link('/index.php',$link_data), - 'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), - 'lang_searchbutton_statustext' => lang('Submit the search string'), - 'query' => $this->query, - 'lang_search' => lang('search'), - 'cat_header' => $cat_header, - 'cat_data' => $content, - 'cat_add' => $cat_add - ); + $link_data['menuaction'] = 'admin.uicategories.add'; + $link_data['cat_parent'] = ''; + $this->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',$link_data)); $this->save_sessiondata(); - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_list' => $data)); + $this->template->pfp('out','cat_list_t',True); } - function edit() + function add() { - $global_cats = get_var('global_cats',array('POST','GET')); - $parent = get_var('parent',array('GET')); - $values = get_var('values',array('POST')); + $new_parent = $_POST['new_parent']; + $cat_parent = intval(get_var('cat_parent',array('POST','GET'))); + $cat_name = $_POST['cat_name']; + $cat_description = $_POST['cat_description']; + if ($new_parent) + { + $cat_parent = intval($new_parent); + } + if (!$this->acl_add && $cat_parent == 0 || !$this->acl_add_sub && $cat_parent != 0) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } $link_data = array ( - 'menuaction' => 'admin.uicategories.index', - 'appname' => $GLOBALS['appname'], - 'global_cats' => $global_cats + 'menuaction' => 'admin.uicategories.index', + 'appname' => $this->appname ); - if ($values['cancel']) + if ($_POST['cancel']) { $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } - if ($values['save'] || $values['apply']) + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Add global category'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $this->set_langs(); + + $this->template->set_file(array('form' => 'category_form.tpl')); + $this->template->set_block('form','delete','deletehandle'); + + if ($_POST['save']) { - $values['cat_id'] = $this->cat_id; - $values['access'] = 'public'; + $values = array + ( + 'parent' => $cat_parent, + 'descr' => $cat_description, + 'name' => $cat_name, + 'access' => 'public' + ); $error = $this->bo->check_values($values); if (is_array($error)) { - $message = $GLOBALS['phpgw']->common->error_list($error); + $this->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error)); } else { - $this->cat_id = $this->bo->save_cat($values); - if ($values['apply']) - { - $message = lang('Category %1 has been saved !',$values['name']); - } - else - { - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); - } + $this->bo->save_cat($values); + $this->template->set_var('message',lang('Category %1 has been added !', $cat_name)); } } - if ($this->cat_id) - { - $cats = $this->bo->cats->return_single($this->cat_id); - $parent = $cats['parent']; - } + $link_data['menuaction'] = 'admin.uicategories.add'; + $this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data)); - if ($GLOBALS['appname']) - { - $GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['appname']) . ' ' . lang('global categories') . ': ' . ($this->cat_id?lang('edit category'):lang('add category')); - } - else - { - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('global categories') . ': ' . $function; - } + $this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cat_parent))); + $this->template->set_var('cat_name',$cat_name); + $this->template->set_var('cat_description',$cat_description); - $GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats')); - - if ($GLOBALS['appname']) - { - $GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category for %1',lang($GLOBALS['appname']))); - } - else - { - $GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global category')); - } - - $data = array - ( - 'lang_name' => lang('name'), - 'lang_descr' => lang('description'), - 'lang_parent' => lang('parent category'), - 'old_parent' => $cats['parent'], - 'lang_save' => lang('save'), - 'lang_apply' => lang('apply'), - 'lang_cancel' => lang('cancel'), - 'value_name' => $GLOBALS['phpgw']->strip_html($cats['name']), - 'value_descr' => $GLOBALS['phpgw']->strip_html($cats['descr']), - 'message' => $message, - 'lang_content_statustext' => lang('enter a description for the category'), - 'lang_cancel_statustext' => lang('leave the category untouched and return back to the list'), - 'lang_save_statustext' => lang('save the category and return back to the list'), - 'lang_apply_statustext' => lang('save the category'), - 'lang_no_cat' => lang('no category'), - 'lang_cat_statustext' => lang('Select the parent category. If this is a main category select NO CATEGORY'), - 'select_name' => 'values[parent]', - 'cat_list' => $this->bo->cats->formatted_xslt_list(array('format' => 'select', 'selected' => $parent,'self' => $this->cat_id,'globals' => $global_cats)) - ); - - $link_data['menuaction'] = 'admin.uicategories.edit'; - if ($this->cat_id) - { - $link_data['cat_id'] = $this->cat_id; - } - $data['edit_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data); - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data)); + $this->template->pfp('out','form'); } - function delete() + function edit() { - $global_cats = get_var('global_cats',array('POST','GET')); + $new_parent = intval($_POST['new_parent']); + $cat_parent = intval($_POST['cat_parent']); + $cat_name = $_POST['cat_name']; + $cat_description = $_POST['cat_description']; + $old_parent = intval($_POST['old_parent']); + + if ($new_parent) + { + $cat_parent = $new_parent; + } $link_data = array ( - 'menuaction' => 'admin.uicategories.index', - 'appname' => $GLOBALS['appname'], - 'global_cats' => $global_cats + 'menuaction' => 'admin.uicategories.index', + 'appname' => $this->appname ); - if ($_POST['done'] || $_POST['cancel'] || !$this->cat_id) + if ($_POST['cancel'] || !$this->cat_id || !$this->acl_edit) { $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); } - if ($_POST['delete']) + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Edit global category'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $this->set_langs(); + + $this->template->set_file(array('form' => 'category_form.tpl')); + + if ($_POST['save']) { - if ($_POST['subs']) + $values = array + ( + 'id' => $this->cat_id, + 'old_parent' => $old_parent, + 'parent' => $cat_parent, + 'descr' => $cat_description, + 'name' => $cat_name, + 'access' => 'public' + ); + + $error = $this->bo->check_values($values); + if (is_array($error)) { - switch ($_POST['subs']) - { - case 'move': - $this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True)); - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); - break; - case 'drop': - $this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True)); - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); - break; - default: - $error = array('Please choose one of the methods to handle the subcategories'); - $msgbox_error = $GLOBALS['phpgw']->common->error_list($error); - break; - } + $this->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error)); } else { - $this->bo->delete(array('cat_id' => $this->cat_id)); - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + $this->cat_id = $this->bo->save_cat($values); + $this->template->set_var('message',lang('Category %1 has been updated !',$cat_name)); } } - $GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_delete')); + $cats = $this->bo->cats->return_single($this->cat_id); - $GLOBALS['phpgw_info']['flags']['app_header'] = ($GLOBALS['appname']?lang($GLOBALS['appname']) . ' ':'') . lang('global categories') . ': ' . lang('delete category'); + $hidden_vars = '' . "\n" + . '' . "\n"; + $this->template->set_var('hidden_vars',$hidden_vars); - $type = ($GLOBALS['appname']?'noglobalapp':'noglobal'); + $link_data['menuaction'] = 'admin.uicategories.edit'; + $link_data['cat_id'] = $this->cat_id; + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data)); - $apps_cats = $this->bo->exists(array('type' => $type, - 'cat_name' => '', - 'cat_id' => $this->cat_id)); - if ($apps_cats) + $this->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name'])); + $this->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description'])); + $this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cats[0]['parent'],'self' => $this->cat_id))); + $this->template->pfp('out','form'); + } + + function delete() + { + if (!$this->acl_delete) { - $error = array('This category is currently being used by applications as a parent category', - 'You will need to reassign these subcategories before you can delete this category'); + $GLOBALS['phpgw']->redirect_link('/index.php'); + } + $link_data = array + ( + 'menuaction' => 'admin.uicategories.index', + 'appname' => $this->appname + ); - $msgbox_error = $GLOBALS['phpgw']->common->error_list($error); - $show_done = 'yes'; + if (!$this->cat_id || $_POST['cancel']) + { + $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + } + + if ($_POST['confirm']) + { + if ($_POST['subs']) + { + $this->bo->delete($this->cat_id,True); + } + else + { + $this->bo->delete($this->cat_id); + } + $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + } + $this->template->set_file(array('category_delete' => 'delete_cat.tpl')); + + if ($this->appname) + { + $type = 'noglobalapp'; } else { - $confirm_msg = lang('Are you sure you want to delete this global category ?'); + $type = 'noglobal'; + } + + $apps_cats = $this->bo->exists(array + ( + 'type' => $type, + 'cat_name' => '', + 'cat_id' => $this->cat_id + )); + + $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Delete category'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + $hidden_vars = '' . "\n"; + $this->template->set_var('hidden_vars',$hidden_vars); + + $cats = $this->bo->cats->return_single($this->cat_id); + $this->template->set_var('cat_name',$cats[0]['name']); + + if ($apps_cats) + { + $this->template->set_block('category_delete','delete','deletehandle'); + $this->template->set_var('messages',lang('This category is currently being used by applications as a parent category') . '
    ' + . lang('You will need to remove the subcategories before you can delete this category')); + + $this->template->set_var('lang_subs',''); + $this->template->set_var('subs',''); + $this->template->set_var('nolink',$nolink); + $this->template->set_var('deletehandle',''); + $this->template->set_var('donehandle',''); + $this->template->set_var('lang_ok',lang('Ok')); + $this->template->pfp('out','category_delete'); + } + else + { + $this->template->set_block('category_delete','done','donehandle'); + $this->template->set_var('messages',lang('Are you sure you want to delete this category ?')); $exists = $this->bo->exists(array ( @@ -431,33 +483,22 @@ if ($exists) { - $subs = 'yes'; - $lang_sub_select_move = lang('Do you want to move all global subcategories one level down ?'); - $lang_sub_select_drop = lang('Do you want to delete all global subcategories ?'); + $this->template->set_var('lang_subs',lang('Do you also want to delete all global subcategories ?')); + $this->template->set_var('subs',''); } + else + { + $this->template->set_var('lang_subs',''); + $this->template->set_var('subs', ''); + } + + $link_data['menuaction'] = 'admin.uicategories.delete'; + $link_data['cat_id'] = $this->cat_id; + $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data)); + $this->template->set_var('lang_yes',lang('Yes')); + $this->template->set_var('lang_no',lang('No')); + $this->template->pfp('out','category_delete'); } - - $data = array - ( - 'show_done' => $show_done, - 'msgbox_data' => $msgbox_error, - 'lang_delete' => lang('delete'), - 'subs' => $subs, - 'lang_sub_select_move' => $lang_sub_select_move, - 'lang_sub_select_drop' => $lang_sub_select_drop, - 'lang_delete_statustext' => lang('delete the category'), - 'lang_cancel_statustext' => lang('do NOT delete the category and return back to the list'), - 'lang_done_statustext' => lang('back to the list'), - 'lang_cancel' => lang('cancel'), - 'lang_done' => lang('done'), - 'lang_confirm_msg' => $confirm_msg - ); - - $link_data['menuaction'] = 'admin.uicategories.delete'; - $link_data['cat_id'] = $this->cat_id; - $data['delete_url'] = $GLOBALS['phpgw']->link('/index.php',$link_data); - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data)); } } ?> diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 2fa6ba6ceb..a422f605ea 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -18,29 +18,14 @@ function index() { - $referer = urldecode($GLOBALS['HTTP_GET_VARS']['referer']); - - if($referer) + if ($GLOBALS['phpgw']->acl->check('site_config_access',1,'admin')) { - $_redir = $referer; - $GLOBALS['phpgw']->session->appsession('session_data','admin_config',$referer); + $GLOBALS['phpgw']->redirect_link('/index.php'); } - else - { - $referer = $GLOBALS['phpgw']->session->appsession('session_data','admin_config'); - if($referer == '-1') - { - $referer = ''; - } - $_redir = $referer ? $referer : $GLOBALS['phpgw']->link('/admin/index.php'); - } - - $appname = $GLOBALS['HTTP_GET_VARS']['appname']; - switch($appname) + + switch($_GET['appname']) { case 'admin': - //case 'preferences': - //$appname = 'preferences'; case 'addressbook': case 'calendar': case 'email': @@ -49,14 +34,16 @@ Other special apps can go here for now, e.g.: case 'bogusappname': */ + $appname = $_GET['appname']; $config_appname = 'phpgwapi'; break; case 'phpgwapi': case '': /* This keeps the admin from getting into what is a setup-only config */ - Header('Location: ' . $_redir); + $GLOBALS['phpgw']->redirect_link('/admin/index.php'); break; default: + $appname = $_GET['appname']; $config_appname = $appname; break; } @@ -76,17 +63,17 @@ $current_config = $c->config_data; } - if ($GLOBALS['HTTP_POST_VARS']['cancel']) + if ($_POST['cancel'] || $_POST['submit'] && $GLOBALS['phpgw']->acl->check('site_config_access',2,'admin')) { - Header('Location: ' . $_redir); + $GLOBALS['phpgw']->redirect_link('/admin/index.php'); } - if ($GLOBALS['HTTP_POST_VARS']['submit']) + if ($_POST['submit']) { /* Load hook file with functions to validate each config (one/none/all) */ $GLOBALS['phpgw']->hooks->single('config_validate',$appname); - while (list($key,$config) = each($GLOBALS['HTTP_POST_VARS']['newsettings'])) + while (list($key,$config) = each($_POST['newsettings'])) { if ($config) { @@ -128,14 +115,11 @@ unset($GLOBALS['phpgw_info']['server']['found_validation_hook']); } - $c->save_repository(True); + $c->save_repository(); if(!$errors) { - $GLOBALS['phpgw']->session->appsession('session_data','admin_config',-1); - Header('Location: ' . $_redir); - $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; - exit; + $GLOBALS['phpgw']->redirect_link('/admin/index.php'); } } @@ -149,12 +133,18 @@ else { $t->set_var('error',''); + $t->set_var('th_err',$GLOBALS['phpgw_info']['theme']['th_bg']); } $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $t->set_var('title',lang('Site Configuration')); $t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname)); + $t->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); + $t->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']); + $t->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); + $t->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']); $t->pparse('out','header'); $vars = $t->get_undefined('body'); @@ -173,7 +163,7 @@ } $newval = implode(' ',$new); - switch($type) + switch ($type) { case 'lang': $t->set_var($value,lang($newval)); @@ -190,19 +180,19 @@ $t->set_var($value,$current_config[$newval]); } break; + /* case 'checked': - /* '+' is used as a delimiter for the check value */ - list($newvalue,$check) = split('\+',$newval); - $newval = ereg_replace(' ','_',$newvalue); - if($current_config[$newval] == $check) + $newval = ereg_replace(' ','_',$newval); + if ($current_config[$newval]) { - $t->set_var($value, ' checked'); + $t->set_var($value,' checked'); } else { - $t->set_var($value, ''); + $t->set_var($value,''); } break; + */ case 'selected': $configs = array(); $config = ''; @@ -235,15 +225,15 @@ } break; default: - $t->set_var($value,''); - break; + $t->set_var($value,''); + break; } } $t->pfp('out','body'); - $t->set_var('lang_submit', lang('submit')); - $t->set_var('lang_cancel', lang('cancel')); + $t->set_var('lang_submit', $GLOBALS['phpgw']->acl->check('site_config_access',2,'admin') ? lang('Cancel') : lang('Save')); + $t->set_var('lang_cancel', lang('Cancel')); $t->pfp('out','footer'); } } diff --git a/admin/inc/class.uicurrentsessions.inc.php b/admin/inc/class.uicurrentsessions.inc.php index 0d03db25b9..6d680c20e7 100644 --- a/admin/inc/class.uicurrentsessions.inc.php +++ b/admin/inc/class.uicurrentsessions.inc.php @@ -23,6 +23,10 @@ function uicurrentsessions() { + if ($GLOBALS['phpgw']->acl->check('current_sessions_access',1,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } $this->template = createobject('phpgwapi.Template',PHPGW_APP_TPL); $this->bo = createobject('admin.bocurrentsessions'); $this->nextmatchs = createobject('phpgwapi.nextmatchs'); @@ -31,6 +35,7 @@ function header() { $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); } function store_location($info) @@ -78,15 +83,9 @@ $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_view_ip = True; - } - - if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',2,'admin')) - { - $can_view_action = True; - } + $can_view_action = !$GLOBALS['phpgw']->acl->check('current_sessions_access',2,'admin'); + $can_view_ip = !$GLOBALS['phpgw']->acl->check('current_sessions_access',4,'admin'); + $can_kill = !$GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'); $total = $this->bo->total(); @@ -115,14 +114,7 @@ $this->template->set_var('row_loginid',$value['session_lid']); - if ($can_view_ip) - { - $this->template->set_var('row_ip',$value['session_ip']); - } - else - { - $this->template->set_var('row_ip','  --  '); - } + $this->template->set_var('row_ip',$can_view_ip?$value['session_ip']:' '); $this->template->set_var('row_logintime',$value['session_logintime']); $this->template->set_var('row_idle',$value['session_idle']); @@ -131,16 +123,12 @@ { $this->template->set_var('row_action',$GLOBALS['phpgw']->strip_html($value['session_action'])); } - elseif(! $can_view_action) - { - $this->template->set_var('row_action','  --  '); - } else { $this->template->set_var('row_action',' '); } - if ($value['session_id'] != $GLOBALS['phpgw_info']['user']['sessionid'] && ! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin')) + if ($value['session_id'] != $GLOBALS['phpgw_info']['user']['sessionid'] && $can_kill) { $this->template->set_var('row_kill','' . lang('Kill').''); @@ -160,10 +148,8 @@ { if ($GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin')) { - $this->list_sessions(); - return False; + $GLOBALS['phpgw']->redirect_link('/index.php'); } - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Kill session'); $this->header(); $this->template->set_file('form','kill_session.tpl'); diff --git a/admin/inc/class.uilog.inc.php b/admin/inc/class.uilog.inc.php index aa6d7f36f0..ab718ffba3 100644 --- a/admin/inc/class.uilog.inc.php +++ b/admin/inc/class.uilog.inc.php @@ -26,6 +26,11 @@ function uilog() { + if ($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } + $_cols = $GLOBALS['HTTP_POST_VARS']['_cols']; $nocols = $GLOBALS['HTTP_POST_VARS']['nocols']; $_delcol = $GLOBALS['HTTP_POST_VARS']['_delcol']; @@ -257,6 +262,7 @@ $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.($this->editmode?lang('Edit Table format') : lang('View error log')); $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); $this->t->pfp('out','log_list_t'); // $this->set_app_langs(); } diff --git a/admin/inc/class.uimainscreen.inc.php b/admin/inc/class.uimainscreen.inc.php index 3a5335861f..52b2570a71 100644 --- a/admin/inc/class.uimainscreen.inc.php +++ b/admin/inc/class.uimainscreen.inc.php @@ -1,49 +1,44 @@ * - * -------------------------------------------- * - * 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 * + * 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$ */ class uimainscreen { - var $public_functions = array - ( - 'index' => True, - 'mainscreen' => True - ); + var $public_functions = array('index' => True); function uimainscreen() { - $GLOBALS['phpgw_info']['flags']['xslt_app'] = True; $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); } - function mainscreen() - { - $GLOBALS['phpgw']->xslttpl->add_file('app_data'); - - function display_section($appname,$file,$file2='') - { - $GLOBALS['phpgw']->common->display_mainscreen($appname,$file2 ? $file2 : $file); - } - - $GLOBALS['phpgw']->hooks->process('admin'); - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $GLOBALS['phpgw']->common->output)); - } - function index() { - if ($GLOBALS['HTTP_POST_VARS']['cancel']) + $section = addslashes($_POST['section']); + $select_lang = addslashes($_POST['select_lang']); + $message = addslashes($_POST['message']); + + $acl_ok = array(); + if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',1,'admin')) { - header('Location: ' . $GLOBALS['phpgw']->link('/admin/index.php')); + $acl_ok['mainscreen'] = True; + } + if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin')) + { + $acl_ok['loginscreen'] = True; + } + if ($_POST['cancel'] && !isset($_POST['message']) || + !count($acl_ok) || $_POST['submit'] && !isset($acl_ok[$section])) + { + $GLOBALS['phpgw']->redirect_link('/admin/index.php'); } $GLOBALS['phpgw']->template->set_file(array('message' => 'mainscreen_message.tpl')); @@ -51,24 +46,37 @@ $GLOBALS['phpgw']->template->set_block('message','row','row'); $GLOBALS['phpgw']->template->set_block('message','row_2','row_2'); - $section = $GLOBALS['HTTP_POST_VARS']['section']; - $select_lang = $GLOBALS['HTTP_POST_VARS']['select_lang']; - $message = $GLOBALS['HTTP_POST_VARS']['message']; - - $GLOBALS['phpgw']->common->phpgw_header(); - - if ($GLOBALS['HTTP_POST_VARS']['submit']) + if ($_POST['submit']) { $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_lang WHERE message_id='$section" . "_message' AND app_name='" . "$section' AND lang='$select_lang'",__LINE__,__FILE__); $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_lang VALUES ('$section" . "_message','$section','$select_lang','" - . addslashes($message) . "')",__LINE__,__FILE__); + . $message . "')",__LINE__,__FILE__); $message = '
    '.lang('message has been updated').'
    '; + + $section = ''; } - - if (empty($select_lang)) + if ($_POST['cancel']) // back to section/lang-selection + { + $message = $section = ''; + } + switch ($section) + { + case 'mainscreen': + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit main screen message') . ': '.strtoupper($select_lang); + break; + case 'loginscreen': + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit login screen message') . ': '.strtoupper($select_lang); + break; + default: + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Main screen message'); + break; + } + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + if (empty($section)) { - $GLOBALS['phpgw']->template->set_var('header_lang',lang('Main screen message')); $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); $GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']); $GLOBALS['phpgw']->template->set_var('value',' '); @@ -77,51 +85,48 @@ $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $select_lang = ''; $GLOBALS['phpgw']->db->query("SELECT lang,phpgw_languages.lang_name,phpgw_languages.lang_id FROM phpgw_lang,phpgw_languages WHERE " . "phpgw_lang.lang=phpgw_languages.lang_id GROUP BY lang,phpgw_languages.lang_name," - . "phpgw_languages.lang_id ORDER BY lang"); + . "phpgw_languages.lang_id ORDER BY lang",__LINE__,__FILE__); while ($GLOBALS['phpgw']->db->next_record()) { - $select_lang .= ''; + $lang = $GLOBALS['phpgw']->db->f('lang'); + $lang_select .= '\n"; } - $select_lang .= ''; + $lang_select .= ''; $GLOBALS['phpgw']->template->set_var('label',lang('Language')); - $GLOBALS['phpgw']->template->set_var('value',$select_lang); + $GLOBALS['phpgw']->template->set_var('value',$lang_select); $GLOBALS['phpgw']->template->fp('rows','row',True); $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $select_section = ''; + $select_section = ''; $GLOBALS['phpgw']->template->set_var('label',lang('Section')); $GLOBALS['phpgw']->template->set_var('value',$select_section); $GLOBALS['phpgw']->template->fp('rows','row',True); $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $GLOBALS['phpgw']->template->set_var('value',''); $GLOBALS['phpgw']->template->fp('rows','row_2',True); } else { $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" - . "_message'"); + . "_message'",__LINE__,__FILE__); $GLOBALS['phpgw']->db->next_record(); $current_message = $GLOBALS['phpgw']->db->f('content'); - if ($section == 'mainscreen') - { - $GLOBALS['phpgw']->template->set_var('header_lang',lang('Edit main screen message')); - } - else - { - $GLOBALS['phpgw']->template->set_var('header_lang',lang('Edit login screen message')); - } - $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); $GLOBALS['phpgw']->template->set_var('select_lang',$select_lang); $GLOBALS['phpgw']->template->set_var('section',$section); @@ -136,7 +141,7 @@ $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $GLOBALS['phpgw']->template->set_var('value','' ); $GLOBALS['phpgw']->template->fp('rows','row_2',True); diff --git a/admin/inc/class.uimenuclass.inc.php b/admin/inc/class.uimenuclass.inc.php index e52167716d..87bf0be114 100644 --- a/admin/inc/class.uimenuclass.inc.php +++ b/admin/inc/class.uimenuclass.inc.php @@ -45,15 +45,18 @@ { $i=0; + // reset the value of all_rows + $this->t->set_var('all_rows',''); + while(list($key,$value) = each($_menuData)) { if (!empty($value['extradata'])) { - $link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . $GLOBALS['account_id'] . '&' . $value['extradata']); + $link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST')) . '&' . $value['extradata']); } else { - $link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . $GLOBALS['account_id']); + $link = $GLOBALS['phpgw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST'))); } $this->section_item($link,lang($value['description']),$this->rowColor[($i % 2)]); $i++; @@ -115,7 +118,6 @@ } $GLOBALS['phpgw']->hooks->process($_hookname); - if (count($GLOBALS['menuData']) >= 1) { $result = $this->display_section($GLOBALS['menuData']); diff --git a/admin/inc/class.uiserver.inc.php b/admin/inc/class.uiserver.inc.php index d38d9851fe..0750abc9d7 100644 --- a/admin/inc/class.uiserver.inc.php +++ b/admin/inc/class.uiserver.inc.php @@ -33,6 +33,16 @@ function uiserver() { + if ($GLOBALS['phpgw']->acl->check('peer_server_access',1,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } + $this->acl_search = !$GLOBALS['phpgw']->acl->check('peer_server_access',2,'admin'); + $this->acl_add = !$GLOBALS['phpgw']->acl->check('peer_server_access',4,'admin'); + $this->acl_view = !$GLOBALS['phpgw']->acl->check('peer_server_access',8,'admin'); + $this->acl_edit = !$GLOBALS['phpgw']->acl->check('peer_server_access',16,'admin'); + $this->acl_delete = !$GLOBALS['phpgw']->acl->check('peer_server_access',32,'admin'); + $this->bo = createobject('admin.boserver',True); $this->nextmatchs = createobject('phpgwapi.nextmatchs'); @@ -70,7 +80,7 @@ $this->bo->save_sessiondata($data); } - function formatted_list($name,$list,$id='',$default=False,$java=False) + function formatted_list($name,$list,$id='',$default=False) { $select = "\n" .'' - . '' - . '' - . ''; - - $GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to delete this server?')); - $GLOBALS['phpgw']->template->set_var('no','' . lang('No') . ''); - $GLOBALS['phpgw']->template->set_var('yes',$yeslink); - $GLOBALS['phpgw']->template->pparse('out','server_delete'); + $GLOBALS['phpgw']->template->set_var(array( + 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.delete'), + 'hidden_vars' => '', + 'messages' => lang('Are you sure you want to delete this server?'), + 'no' => lang('No'), + 'yes' => lang('Yes'), + )); + $GLOBALS['phpgw']->template->pparse('phpgw_body','server_delete'); } } } diff --git a/admin/inc/hook_acl_manager.inc.php b/admin/inc/hook_acl_manager.inc.php index 171fa2ef67..e8a015250f 100644 --- a/admin/inc/hook_acl_manager.inc.php +++ b/admin/inc/hook_acl_manager.inc.php @@ -17,7 +17,7 @@ 'List config settings' => 1, 'Change config settings' => 2 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['account_access'] = array( 'name' => 'Deny access to user accounts', @@ -27,9 +27,10 @@ 'Add account' => 4, 'View account' => 8, 'Edit account' => 16, - 'Delete account' => 32 + 'Delete account' => 32, + 'change ACL Rights' => 64 ) - ); + ); // was already there and seems to work ralfbecker $GLOBALS['acl_manager']['admin']['group_access'] = array( 'name' => 'Deny access to groups', @@ -41,7 +42,7 @@ 'Edit group' => 16, 'Delete group' => 32 ) - ); + ); // was already there and seems to work ralfbecker $GLOBALS['acl_manager']['admin']['peer_server_access'] = array( 'name' => 'Deny access to peer servers', @@ -49,7 +50,7 @@ 'Peer server list' => 1, 'Search peer servers' => 2, 'Add peer server' => 4, - 'View peer server' => 8, +// 'View peer server' => 8, // there's no view-routine atm. 'Edit peer server' => 16, 'Delete peer server' => 32 ) @@ -61,9 +62,10 @@ 'Applications list' => 1, 'Add application' => 2, 'Edit application' => 4, - 'Delete application' => 8 + 'Delete application' => 8, + 'Register application hooks' => 16 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['global_categories_access'] = array( 'name' => 'Deny access to global categories', @@ -73,9 +75,10 @@ 'Add category' => 4, 'View category' => 8, 'Edit category' => 16, - 'Delete category' => 32 + 'Delete category' => 32, + 'Add sub-category' => 64 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['mainscreen_message_access'] = array( 'name' => 'Deny access to mainscreen message', @@ -83,7 +86,7 @@ 'Main screen message' => 1, 'Login message' => 2 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['current_sessions_access'] = array( 'name' => 'Deny access to current sessions', @@ -93,33 +96,33 @@ 'Show session IP address' => 4, 'Kill session' => 8 ) - ); + ); // checked and working ralfbecker $GLOBALS['acl_manager']['admin']['access_log_access'] = array( - 'name' => 'Deny access to session log', + 'name' => 'Deny access to access log', 'rights' => array( - 'Show session log' => 1 + 'Show access log' => 1 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['error_log_access'] = array( 'name' => 'Deny access to error log', 'rights' => array( 'Show error log' => 1 ) - ); + ); // added and working ralfbecker - $GLOBALS['acl_manager']['admin']['appreg_access'] = array( - 'name' => 'Deny access to application registery', + $GLOBALS['acl_manager']['admin']['asyncservice_access'] = array( + 'name' => 'Deny access to asynchronous timed services', 'rights' => array( - 'Register applications' => 1 + 'Asynchronous timed services' => 1 ) - ); + ); // added and working ralfbecker $GLOBALS['acl_manager']['admin']['info_access'] = array( 'name' => 'Deny access to phpinfo', 'rights' => array( 'Show phpinfo()' => 1 ) - ); + ); // added and working ralfbecker diff --git a/admin/inc/hook_admin.inc.php b/admin/inc/hook_admin.inc.php index 0c693d5685..4f433a371e 100644 --- a/admin/inc/hook_admin.inc.php +++ b/admin/inc/hook_admin.inc.php @@ -8,36 +8,37 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ + /* $Id$ */ if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin')) { - $file['Site Configuration'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); + $file['Site Configuration'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); } if (! $GLOBALS['phpgw']->acl->check('peer_server_access',1,'admin')) { - $file['Peer Servers'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.list_servers'); + $file['Peer Servers'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.list_servers'); } if (! $GLOBALS['phpgw']->acl->check('account_access',1,'admin')) { - $file['User Accounts'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'); + $file['User Accounts'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'); } if (! $GLOBALS['phpgw']->acl->check('group_access',1,'admin')) { - $file['User Groups'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'); + $file['User Groups'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'); } if (! $GLOBALS['phpgw']->acl->check('applications_access',1,'admin')) { - $file['Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'); + $file['Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'); } if (! $GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin')) { - $file['Global Categories'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'); + $file['Global Categories'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'); } if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',1,'admin') || !$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin')) @@ -49,7 +50,7 @@ { $file['View Sessions'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions'); } - + if (! $GLOBALS['phpgw']->acl->check('access_log_access',1,'admin')) { $file['View Access Log'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccess_history.list_history'); @@ -57,7 +58,7 @@ if (! $GLOBALS['phpgw']->acl->check('error_log_access',1,'admin')) { - $file['View Error Log'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uilog.list_log'); + $file['View Error Log'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uilog.list_log'); } if (! $GLOBALS['phpgw']->acl->check('applications_access',16,'admin')) @@ -72,10 +73,9 @@ if (! $GLOBALS['phpgw']->acl->check('info_access',1,'admin')) { - $file['phpInfo'] = "javascript:openwindow('" . $GLOBALS['phpgw']->link('/admin/phpinfo.php') . "','700','600')"; + $file['phpInfo'] = "javascript:openwindow('" . $GLOBALS['phpgw']->link('/admin/phpinfo.php') . "')"; //$GLOBALS['phpgw']->link('/admin/phpinfo.php'); } /* Do not modify below this line */ - - $GLOBALS['phpgw']->common->display_mainscreen('admin',$file); + display_section('admin',$file); ?> diff --git a/admin/inc/hook_after_navbar.inc.php b/admin/inc/hook_after_navbar.inc.php index 4dced0cae9..dbd907a18b 100644 --- a/admin/inc/hook_after_navbar.inc.php +++ b/admin/inc/hook_after_navbar.inc.php @@ -23,7 +23,7 @@ $GLOBALS['phpgw_info']['user']['apps']['admin']) || $GLOBALS['phpgw_info']['server']['checkappversions'] == 'All') { - $_current = array(); + $_current = False; $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__); while($GLOBALS['phpgw']->db->next_record()) @@ -36,34 +36,29 @@ include($_versionfile); /* echo '
    ' . $_versionfile . ','; */ $_file_version = $setup_info[$app_name]['version']; - $_app_title = str_replace('- ','-',ucwords(str_replace('_','- ',$setup_info[$app_name]['name']))), + $_app_title = $setup_info[$app_name]['title']; unset($setup_info); - /* echo '
    ' . $app_name . ',' . $_db_version . ',' . $_file_version; */ - $test = $GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version); - if($test == '') + if($app_name == 'phpgwapi') { - $_current[$app_name] = True; + $api_str = '
    ' . lang('The API requires an upgrade'); + } + /* echo $app_name . ',' . $_db_version . ',' . $_file_version; */ + if(!$GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version)) + { + $_current = True; if($app_name == 'phpgwapi') { $api_str = '
    ' . lang('The API is current'); } } - else - { - if($app_name == 'phpgwapi') - { - $api_str = '
    ' . lang('The API requires an upgrade'); - } - } - unset($test); unset($_file_version); unset($_app_title); } unset($_db_version); unset($_versionfile); } - if(!@isset($_current[$GLOBALS['phpgw_info']['flags']['currentapp']])) + if(!$_current) { echo '
    '; echo $api_str; diff --git a/admin/inc/hook_config.inc.php b/admin/inc/hook_config.inc.php new file mode 100644 index 0000000000..2a412a9dfd --- /dev/null +++ b/admin/inc/hook_config.inc.php @@ -0,0 +1,104 @@ + * + * -------------------------------------------- * + * 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$ */ + + function encryptalgo($config) + { + if(@function_exists('mcrypt_list_algorithms')) + { + $listed = array(); + if(!isset($config['mcrypt_algo'])) + { + $config['mcrypt_algo'] = 'tripledes'; /* MCRYPT_TRIPLEDES */ + } + $algos = @mcrypt_list_algorithms(); + $found = False; + + while (list ($key, $value) = each ($algos)) + { + $found = True; + /* Only show each once - seems this is a problem in some installs */ + if(!in_array($value,$listed)) + { + if ($config['mcrypt_algo'] == $value) + { + $selected = ' selected'; + } + else + { + $selected = ''; + } + $descr = strtoupper($value); + + $out .= '' . "\n"; + $listed[] = $value; + } + } + if(!$found) + { + /* Something is wrong with their mcrypt install or php.ini */ + $out = '' . "\n";; + } + } + else + { + $out = '' . "\n";; + } + return $out; + } + + function encryptmode($config) + { + if(@function_exists('mcrypt_list_modes')) + { + $listed = array(); + if(!isset($config['mcrypt_mode'])) + { + $config['mcrypt_mode'] = 'cbc'; /* MCRYPT_MODE_CBC */ + } + $modes = @mcrypt_list_modes(); + $found = False; + + while (list ($key, $value) = each ($modes)) + { + $found = True; + /* Only show each once - seems this is a problem in some installs */ + if(!in_array($value,$listed)) + { + if ($config['mcrypt_mode'] == $value) + { + $selected = ' selected'; + } + else + { + $selected = ''; + } + $descr = strtoupper($value); + + $out .= '' . "\n"; + $listed[] = $value; + } + } + if(!$found) + { + /* Something is wrong with their mcrypt install or php.ini */ + $out = '' . "\n"; + } + } + else + { + $out = '' . "\n"; + } + return $out; + } +?> diff --git a/admin/inc/hook_sidebox_menu.inc.php b/admin/inc/hook_sidebox_menu.inc.php new file mode 100644 index 0000000000..dfac14c6fa --- /dev/null +++ b/admin/inc/hook_sidebox_menu.inc.php @@ -0,0 +1,95 @@ + * + * -------------------------------------------- * + * 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$ */ + { + + /* + This hookfile is for generating an app-specific side menu used in the idots + template set. + + $menu_title speaks for itself + $file is the array with link to app functions + + display_sidebox can be called as much as you like + */ + + $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu'); + $file = array(); + + if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin')) + { + $file['Site Configuration'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); + } +/* + if (! $GLOBALS['phpgw']->acl->check('peer_server_access',1,'admin')) + { + $file['Peer Servers'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.list_servers'); + } +*/ + if (! $GLOBALS['phpgw']->acl->check('account_access',1,'admin')) + { + $file['User Accounts'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'); + } + + if (! $GLOBALS['phpgw']->acl->check('group_access',1,'admin')) + { + $file['User Groups'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'); + } + + if (! $GLOBALS['phpgw']->acl->check('applications_access',1,'admin')) + { + $file['Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'); + } + + if (! $GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin')) + { + $file['Global Categories'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'); + } + + if (!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',1,'admin') || !$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin')) + { + $file['Change Main Screen Message'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index'); + } + + if (! $GLOBALS['phpgw']->acl->check('current_sessions_access',1,'admin')) + { + $file['View Sessions'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicurrentsessions.list_sessions'); + } + + if (! $GLOBALS['phpgw']->acl->check('access_log_access',1,'admin')) + { + $file['View Access Log'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccess_history.list_history'); + } + + if (! $GLOBALS['phpgw']->acl->check('error_log_access',1,'admin')) + { + $file['View Error Log'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uilog.list_log'); + } + + if (! $GLOBALS['phpgw']->acl->check('applications_access',16,'admin')) + { + $file['Find and Register all Application Hooks'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.register_all_hooks'); + } + + if (! $GLOBALS['phpgw']->acl->check('asyncservice_access',1,'admin')) + { + $file['Asynchronous timed services'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiasyncservice.index'); + } + + if (! $GLOBALS['phpgw']->acl->check('info_access',1,'admin')) + { + $file['phpInfo'] = "javascript:openwindow('" . $GLOBALS['phpgw']->link('/admin/phpinfo.php') . "')"; + } + + display_sidebox($appname,$menu_title,$file); + } diff --git a/admin/inc/hook_view_account.inc.php b/admin/inc/hook_view_account.inc.php deleted file mode 100644 index 40e7004ebc..0000000000 --- a/admin/inc/hook_view_account.inc.php +++ /dev/null @@ -1,30 +0,0 @@ - 'Login History', - 'url' => '/index.php', - 'extradata' => 'menuaction=admin.uiaccess_history.list_history' - ); - - $GLOBALS['menuData'][] = array( - 'description' => 'ACL Rights', - 'url' => '/index.php', - 'extradata' => 'menuaction=admin.uiaclmanager.list_apps' - ); - - //Do not modify below this line -// global $menuData; - -// $GLOBALS['menuData'][] = $data; -?> \ No newline at end of file diff --git a/admin/inc/hook_view_user.inc.php b/admin/inc/hook_view_user.inc.php deleted file mode 100755 index a451d73603..0000000000 --- a/admin/inc/hook_view_user.inc.php +++ /dev/null @@ -1,25 +0,0 @@ - 'Login History', - 'url' => '/index.php', - 'extradata' => 'menuaction=admin.uiaccess_history.list_history' - ); - - $GLOBALS['menuData'][] = array( - 'description' => 'ACL Rights', - 'url' => '/index.php', - 'extradata' => 'menuaction=admin.uiaclmanager.list_apps' - ); -?> \ No newline at end of file diff --git a/admin/index.php b/admin/index.php index 4718dab574..d94e572457 100755 --- a/admin/index.php +++ b/admin/index.php @@ -2,23 +2,96 @@ /**************************************************************************\ * phpGroupWare - administration * * http://www.phpgroupware.org * - * Written by coreteam * - * & Stephen Brown * - * to distribute admin across the application directories * - * ------------------------------------------------------ * - * 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. * + * Written by Joseph Engo * + * Modified by Stephen Brown * + * to distribute admin across the application directories * + * -------------------------------------------- * + * 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$ */ - $GLOBALS['phpgw_info']['flags'] = array - ( - 'currentapp' => 'admin' - ); + $GLOBALS['phpgw_info'] = array(); + $GLOBALS['phpgw_info']['flags']['currentapp'] = 'admin'; include('../header.inc.php'); - header('Location: '. $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen')); - exit; + $GLOBALS['admin_tpl'] = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $GLOBALS['admin_tpl']->set_file( + Array( + 'admin' => 'index.tpl' + ) + ); + + $GLOBALS['admin_tpl']->set_block('admin','list'); + $GLOBALS['admin_tpl']->set_block('admin','app_row'); + $GLOBALS['admin_tpl']->set_block('admin','app_row_noicon'); + $GLOBALS['admin_tpl']->set_block('admin','link_row'); + $GLOBALS['admin_tpl']->set_block('admin','spacer_row'); + + $GLOBALS['admin_tpl']->set_var('title',lang('Administration')); + + // This func called by the includes to dump a row header + function section_start($appname='',$icon='') + { + $GLOBALS['admin_tpl']->set_var('icon_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']); + $GLOBALS['admin_tpl']->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']); + $GLOBALS['admin_tpl']->set_var('app_name',$GLOBALS['phpgw_info']['apps'][$appname]['title']); + $GLOBALS['admin_tpl']->set_var('a_name',$appname); + $GLOBALS['admin_tpl']->set_var('app_icon',$icon); + if ($icon) + { + $GLOBALS['admin_tpl']->parse('rows','app_row',True); + } + else + { + $GLOBALS['admin_tpl']->parse('rows','app_row_noicon',True); + } + } + + function section_item($pref_link='',$pref_text='') + { + $GLOBALS['admin_tpl']->set_var('pref_link',$pref_link); + $GLOBALS['admin_tpl']->set_var('pref_text',$pref_text); + $GLOBALS['admin_tpl']->parse('rows','link_row',True); + } + + function section_end() + { + $GLOBALS['admin_tpl']->parse('rows','spacer_row',True); + } + + function display_section($appname,$file,$file2=False) + { + if ($file2) + { + $file = $file2; + } + if(is_array($file)) + { + section_start($appname, + $GLOBALS['phpgw']->common->image( + $appname, + Array( + 'navbar', + $appname, + 'nonav' + ) + ) + ); + + while(list($text,$url) = each($file)) + { + section_item($url,lang($text)); + } + section_end(); + } + } + + $GLOBALS['phpgw']->hooks->process('admin'); + $GLOBALS['admin_tpl']->pparse('out','list'); + + $GLOBALS['phpgw']->common->phpgw_footer(); ?> diff --git a/admin/navbar-create.php b/admin/navbar-create.php index 5d3e116475..13fc39cefb 100644 --- a/admin/navbar-create.php +++ b/admin/navbar-create.php @@ -27,4 +27,6 @@ The instructions are as follows: echo "\nlink("/admin/navbar-sel.php","filename=".$phpgw_info["server"]["server_root"]."/".$key."/images/navbar.gif")."\">"; echo $phpgw_info["apps"][$key]["title"]."
    "; } + + $phpgw->common->phpgw_footer(); ?> diff --git a/admin/phpinfo.php b/admin/phpinfo.php index fca0a7fd00..3c5b718137 100755 --- a/admin/phpinfo.php +++ b/admin/phpinfo.php @@ -8,14 +8,20 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ + /* $Id$ */ - $GLOBALS['phpgw_info']['flags'] = array - ( - 'noframework' => True, - 'currentapp' => 'admin' + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'admin' ); include('../header.inc.php'); + + if ($GLOBALS['phpgw']->acl->check('info_access',1,'admin')) + { + $GLOBALS['phpgw']->redirect_link('/index.php'); + } // Throw a little notice out if PHPaccelerator is enabled. if($GLOBALS['_PHPA']['ENABLED']) @@ -23,6 +29,8 @@ echo 'PHPaccelerator enabled:
    '."\n"; echo 'PHPaccelerator Version: '.$GLOBALS['_PHPA']['VERSION'].'

    '."\n"; } - + phpinfo(); + +// $phpgw->common->phpgw_footer(); ?> diff --git a/admin/templates/default/accesslog.tpl b/admin/templates/default/accesslog.tpl index 95febfc2c9..16fa29cb3f 100644 --- a/admin/templates/default/accesslog.tpl +++ b/admin/templates/default/accesslog.tpl @@ -23,7 +23,7 @@
     {title}
     {error}
     
     {lang_Addressbook}/{lang_Contact_Settings} -
    {lang_Contact_application}:
    {lang_Country_Selection} ({lang_Text_Entry}/{lang_SelectBox}): - -
    '.lang('Application').' '.lang('ACL').'
    ' . $perm_display[$i][1] . '' - . ($apps_with_acl[$app] && $group_info['account_id']?''
-					. lang('Grant Access').'':' ').'
     
    %s%s%s%s%s%s%s 
    '.lang('Application').' '.lang('ACL').'
    ' . $perm_display[$i][1] . '' + . ($apps_with_acl[$app] && $group_info['account_id']?''
+					. lang('Grant Access').'':' ').'
     
    %s 

    {lang_loginid} {lang_ip} {lang_login}{lang_total}
    {footer_total}
    {lang_percent}
    @@ -46,7 +46,7 @@ - + {row_loginid} {row_ip} {row_li} @@ -56,7 +56,7 @@ - + {row_message} diff --git a/admin/templates/default/account_form.tpl b/admin/templates/default/account_form.tpl new file mode 100644 index 0000000000..4a688c7e78 --- /dev/null +++ b/admin/templates/default/account_form.tpl @@ -0,0 +1,93 @@ + +{error_messages} + +
    +
    + + + + + +
    + {rows} + + + + + + + + + + + + + + + + + + + + + + + {password_fields} + + + + + + + + + + + + + + + + + + + {permissions_list} + + {form_buttons} + +
    {lang_action}
    {lang_loginid}{account_lid} {lang_account_active}:{account_status}
    {lang_firstname}{account_firstname} {lang_lastname}{account_lastname} 
    {lang_changepassword}{changepassword}{lang_anonymous}{anonymous}
    {lang_expires}{input_expires}  {lang_never} {never_expires}
    {lang_groups}{groups_select} 
    +
    +
    +
    + + + + + {lang_password} + + {lang_reenter_password} + + + + + + + + + + + + + {lang_lastlogin} + {account_lastlogin} + + {lang_lastloginfrom} + {account_lastloginfrom} + + + + + +  {row_text} + + diff --git a/admin/templates/default/account_form_ldap.tpl b/admin/templates/default/account_form_ldap.tpl index 309811d983..9c163607dd 100644 --- a/admin/templates/default/account_form_ldap.tpl +++ b/admin/templates/default/account_form_ldap.tpl @@ -2,56 +2,74 @@ {error_messages}
    -
    - - - - - -
    - {rows} - - - - - - - - - - - - - - - - - - {password_fields} - - - - - - - - - - - - - - - {permissions_list} - {form_buttons} -
    {lang_action}
    {lang_loginid}{account_lid} {lang_account_active}:{account_status}
    {lang_firstname}{account_firstname} {lang_lastname}{account_lastname} 
    {lang_homedir}{homedirectory} {lang_shell}{loginshell} 
    {lang_groups}{groups_select} 
    {lang_expires}{input_expires}  {lang_never} {never_expires}
    -
    -
    +
    + + + + + +
    + {rows} + + + + + + + + + + + + + + + + + + + + + + + {password_fields} + + + + + + + + + + + + + + + + + + + + + + + + + + {permissions_list} + + {form_buttons} + +
    {lang_action}
    {lang_loginid}{account_lid} {lang_account_active}:{account_status}
    {lang_firstname}{account_firstname} {lang_lastname}{account_lastname} 
    {lang_homedir}{homedirectory} {lang_shell}{loginshell} 
    {lang_expires}{input_expires}  {lang_never} {never_expires}
    {lang_changepassword}{changepassword}{lang_anonymous}{anonymous}
    {lang_groups}{groups_select} 
    +
    +
    - + {lang_password} {lang_reenter_password} @@ -60,16 +78,13 @@ - - - -
    - + + - + {lang_lastlogin} {account_lastlogin} @@ -79,7 +94,7 @@ - -  {row_text} - + +  {row_text} + diff --git a/admin/templates/default/accounts.tpl b/admin/templates/default/accounts.tpl new file mode 100644 index 0000000000..de2834693b --- /dev/null +++ b/admin/templates/default/accounts.tpl @@ -0,0 +1,62 @@ + +

    +

    + + + + + + +
    {left_next_matchs}{lang_user_accounts}{right_next_matchs}
    +
    + +
    + + + + + + + + + + + {rows} + +
    {lang_loginid}{lang_lastname}{lang_firstname}{lang_edit}{lang_delete}{lang_view}
    +
    + + +
    + + + + + +
    + {input_add} + + +
    + {input_search} +
    +
    +
    + + + + + {row_loginid} + {row_lastname} + {row_firstname} + {row_edit} + {row_delete} + {row_view} + + + + + + {message} + + diff --git a/admin/templates/default/acl_accounts.tpl b/admin/templates/default/acl_accounts.tpl index e2c30522fb..0938c91de7 100644 --- a/admin/templates/default/acl_accounts.tpl +++ b/admin/templates/default/acl_accounts.tpl @@ -14,7 +14,7 @@
    - + @@ -42,7 +42,7 @@ - + diff --git a/admin/templates/default/acl_applist.tpl b/admin/templates/default/acl_applist.tpl index 3bfa6d08f3..ed5312c15c 100644 --- a/admin/templates/default/acl_applist.tpl +++ b/admin/templates/default/acl_applist.tpl @@ -1,21 +1,21 @@ -{lang_header} -

    -

    {lang_loginid} {lang_lastname} {lang_firstname}
    {row_loginid} {row_lastname} {row_firstname}
    {rows}
    +
    + +
    - + [ {app_name} ]   {app_name} - +   {app_name} diff --git a/admin/templates/default/acl_manager_form.tpl b/admin/templates/default/acl_manager_form.tpl index c10c9a75bd..0def47790c 100644 --- a/admin/templates/default/acl_manager_form.tpl +++ b/admin/templates/default/acl_manager_form.tpl @@ -1,20 +1,11 @@ -{lang_title} -

    -

    - - - - - - - - - - - -
    {lang_message}
    {select_values}
    +
    +

    {lang_message}

    +

    {select_values}

    +

      +

    +
    diff --git a/admin/templates/default/app_data.xsl b/admin/templates/default/app_data.xsl deleted file mode 100644 index e70fafebdc..0000000000 --- a/admin/templates/default/app_data.xsl +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - {$app_title} - - - - -   - - - - - -   - - - -   - - - - - - - - - - - - - row_off - - - row_on - - - -  •  - - diff --git a/admin/templates/default/application_form.tpl b/admin/templates/default/application_form.tpl index acbd227345..a584dffdd8 100644 --- a/admin/templates/default/application_form.tpl +++ b/admin/templates/default/application_form.tpl @@ -1,21 +1,25 @@ -

    {lang_header} -


    {error} - +

    {hidden_vars}
    - + {rows} - + @@ -25,7 +29,7 @@ - + diff --git a/admin/templates/default/applications.tpl b/admin/templates/default/applications.tpl index c92fa434e4..2b44c8f692 100644 --- a/admin/templates/default/applications.tpl +++ b/admin/templates/default/applications.tpl @@ -1,10 +1,8 @@ -

    {lang_installed}


    - -

    +

     
    - + +   + +   + + +
    {label} {value}
    - + {left} {right} @@ -12,7 +10,7 @@
    {lang_showing}
    - + @@ -22,10 +20,14 @@ {rows}
    {sort_title} {lang_edit} {lang_delete}
    + + {addbutton} + + -
    + @@ -36,13 +38,13 @@
    - + - + {name} {edit} {delete} - {status} + {status} diff --git a/admin/templates/default/category_form.tpl b/admin/templates/default/category_form.tpl new file mode 100644 index 0000000000..1bea5d9bd8 --- /dev/null +++ b/admin/templates/default/category_form.tpl @@ -0,0 +1,28 @@ + + + + +
    +{message}
    +
    + + + + + + + + + + + + + + + + + +
    {lang_parent}
    {lang_name}:
    {lang_descr}:
    +
    + + diff --git a/admin/templates/default/cats.xsl b/admin/templates/default/cats.xsl deleted file mode 100644 index f376730482..0000000000 --- a/admin/templates/default/cats.xsl +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - row_off - - - row_on - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - window.status=' - - '; return true; - - - - - - - - window.status=' - - '; return true; - - - -
    - -
    - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    : - - window.status=' - - '; return true; - - - - - -
    : -
    - - - - - - window.status=' - - '; return true; - - - - - - - window.status=' - - '; return true; - - - - - - - window.status=' - - '; return true; - - -
    -
    diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index fc0c79f8d8..71bf009dd0 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -1,19 +1,13 @@ - - -
    - +
    - - - - + + + + + + - - - @@ -92,8 +70,7 @@ - - - + - + - - - - - - - - + @@ -232,17 +200,15 @@ - @@ -255,6 +221,7 @@
     {title}
    {lang_Would_you_like_phpGroupWare_to_check_for_new_application_versions_when_admins_login_?}:{lang_Would_you_like_phpGroupWare_to_check_for_a_new_version
    when_admins_login_?}:
    {lang_Maximum_entries_in_click_path_history}:
    {lang_Would_you_like_to_automaticaly_load_new_langfiles_(at_login-time)_?}:
     {lang_appearance}
     {lang_security}
    {lang_Use_cookies_to_pass_sessionid}:
    {lang_check_ip_address_of_all_sessions}:
    {lang_Minimum_password_length}:
    {lang_Require_non-alpha_characters}: - -
    {lang_How_many_days_should_entries_stay_in_the_access_log,_before_they_get_deleted_(default_90)_?}:
    +
    diff --git a/admin/templates/default/config_footer.tpl b/admin/templates/default/config_footer.tpl index c640044646..dd925ed01c 100644 --- a/admin/templates/default/config_footer.tpl +++ b/admin/templates/default/config_footer.tpl @@ -1,5 +1,5 @@ - +   diff --git a/admin/templates/default/config_head.tpl b/admin/templates/default/config_head.tpl index 7929450181..a30664540c 100644 --- a/admin/templates/default/config_head.tpl +++ b/admin/templates/default/config_head.tpl @@ -1,7 +1,7 @@ - + diff --git a/admin/templates/default/currentusers.tpl b/admin/templates/default/currentusers.tpl index 9c248d310a..0379944735 100644 --- a/admin/templates/default/currentusers.tpl +++ b/admin/templates/default/currentusers.tpl @@ -1,14 +1,14 @@
     {title}
    - + {left_next_matchs} {right_next_matchs} - + @@ -24,7 +24,7 @@ - + @@ -33,3 +33,5 @@ + + diff --git a/admin/templates/default/delete_cat.tpl b/admin/templates/default/delete_cat.tpl new file mode 100644 index 0000000000..af38b9c23a --- /dev/null +++ b/admin/templates/default/delete_cat.tpl @@ -0,0 +1,35 @@ + + + +
    + + {hidden_vars} +
       
    {sort_loginid} {sort_ip} {sort_login_time}
    {row_loginid} {row_ip} {row_logintime}{row_kill}
    + + + + + + + + + + + + + + + +
    +

    {cat_name}

    + {messages} +
    {lang_subs} {subs}
    + + + + + +
    +
    + + diff --git a/admin/templates/default/delete_common.tpl b/admin/templates/default/delete_common.tpl index c92490b32a..188635320c 100644 --- a/admin/templates/default/delete_common.tpl +++ b/admin/templates/default/delete_common.tpl @@ -1,16 +1,20 @@ -
    +

    +

    +
    + {hidden_vars} {messages}
    - {no} + - {yes} +
    -
    + +
    diff --git a/admin/templates/default/group_form.tpl b/admin/templates/default/group_form.tpl new file mode 100644 index 0000000000..012bd15057 --- /dev/null +++ b/admin/templates/default/group_form.tpl @@ -0,0 +1,79 @@ + + + {error} + + + + + +
    + {rows} + + + + {hidden_vars} + + + + + + + + + + + + + + + + + + + + + + + + + +
    {lang_group_name}
    {lang_include_user} + {accounts} +
    {lang_file_space} + {account_file_space}{account_file_space_select} +
    {lang_permissions} + {permissions_list} +
    + +
    +
    + + + + + + + + + + + + + + +
    + + + + +
    + + diff --git a/admin/templates/default/group_manager.tpl b/admin/templates/default/group_manager.tpl index 82f2aa5575..7554e2abc2 100755 --- a/admin/templates/default/group_manager.tpl +++ b/admin/templates/default/group_manager.tpl @@ -10,14 +10,14 @@ - + {hidden} - + @@ -31,7 +31,7 @@ - + diff --git a/admin/templates/default/groups.tpl b/admin/templates/default/groups.tpl new file mode 100644 index 0000000000..55a6d44ae9 --- /dev/null +++ b/admin/templates/default/groups.tpl @@ -0,0 +1,50 @@ + +

    +

    {lang_group}: {group_name}
    {lang_select_managers} {group_members}
     {row_text}
    + + + + + +
    {left_next_matchs}{lang_groups}{right_next_matchs}
    + + + + + + + + + {rows} + +
    {sort_name}{header_edit}{header_delete}
    + + + + + + +
    + + {input_add} + + +
    + {input_search} +
    +
    + + + + + {group_name} + {edit_link} + {delete_link} + + + + + + {message} + + diff --git a/admin/templates/default/groups.xsl b/admin/templates/default/groups.xsl deleted file mode 100644 index 1ccaebae6d..0000000000 --- a/admin/templates/default/groups.xsl +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - -
    - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - row_off - - - row_on - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - window.status=' - - '; return true; - - - - - - - - - - window.status=' - - '; return true; - - - -
    - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - -
    - -
    - - - - - - - -
     
    -
    - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - row_off - - - row_on - - - - - - - - - - - - - - - - - - - - - {$img_name} - - - - - diff --git a/admin/templates/default/images/navbar.png b/admin/templates/default/images/navbar.png index 677112d33c..7bcb24ceec 100644 Binary files a/admin/templates/default/images/navbar.png and b/admin/templates/default/images/navbar.png differ diff --git a/admin/templates/default/index.tpl b/admin/templates/default/index.tpl new file mode 100755 index 0000000000..410675d84a --- /dev/null +++ b/admin/templates/default/index.tpl @@ -0,0 +1,51 @@ + + + + + {rows} +
    + + + + + [ {app_name} ] +   {app_name} + + + + + +   {app_name} + + + + + +  • {pref_text} + + + + + +   + + diff --git a/admin/templates/default/kill_session.tpl b/admin/templates/default/kill_session.tpl index fd47b4fef8..5f9d1eec8a 100644 --- a/admin/templates/default/kill_session.tpl +++ b/admin/templates/default/kill_session.tpl @@ -1,6 +1,4 @@ -{lang_title} -

    - +
    + diff --git a/admin/templates/default/nntp.tpl b/admin/templates/default/nntp.tpl index 2632a54fff..bcde39b313 100755 --- a/admin/templates/default/nntp.tpl +++ b/admin/templates/default/nntp.tpl @@ -34,7 +34,7 @@ function check_all() {common_hidden_vars}
    {lang_message} diff --git a/admin/templates/default/listcats.tpl b/admin/templates/default/listcats.tpl new file mode 100644 index 0000000000..95ff7edf60 --- /dev/null +++ b/admin/templates/default/listcats.tpl @@ -0,0 +1,53 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + {left} + + {right} + +
    {lang_showing}
    +
    +
    +  
    {sort_name}{sort_description}{lang_sub}{lang_edit}{lang_delete}
    {name}{descr}{add_sub}{edit}{delete}
    +
    diff --git a/admin/templates/default/listservers.tpl b/admin/templates/default/listservers.tpl index aab1bf94f4..a5832a645d 100644 --- a/admin/templates/default/listservers.tpl +++ b/admin/templates/default/listservers.tpl @@ -1,8 +1,5 @@
    - - - + + - - - - - - - - + + + + + + + + + - + - - + + - - - - - - - - + + + +
    {title_servers}
    @@ -14,42 +11,45 @@
     
     
    {sort_name}{sort_url}{sort_mode}{sort_security}{lang_edit}{lang_delete}
    {sort_name}{sort_url}{sort_mode}{sort_security}{lang_edit}{lang_delete}
    {server_name} {server_url} {server_mode} {server_security} {lang_edit_entry}{lang_delete_entry}{edit}{delete}
    +
    +
    +
    +
    diff --git a/admin/templates/default/mainscreen_message.tpl b/admin/templates/default/mainscreen_message.tpl index 43c6fbc8cc..7be96641cf 100644 --- a/admin/templates/default/mainscreen_message.tpl +++ b/admin/templates/default/mainscreen_message.tpl @@ -1,7 +1,5 @@ -

    {header_lang}


    - -{error_message}

    +

    {error_message}

    @@ -14,14 +12,14 @@ - + - + diff --git a/admin/templates/default/menurow.tpl b/admin/templates/default/menurow.tpl index cd69238a5a..8a4dd5d2fa 100644 --- a/admin/templates/default/menurow.tpl +++ b/admin/templates/default/menurow.tpl @@ -1,6 +1,6 @@
    {label} {value}
    {value}
    - + {all_rows} @@ -8,12 +8,12 @@ - +
     
     
      {lang_done}  {lang_done}
    -
      {row_text}
    - + @@ -45,7 +45,7 @@ function check_all() - + @@ -55,7 +55,7 @@ function check_all() - + - - - - - - - - - - - - - - - - - - - - - - - row_off - - - row_on - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {sort_con} {sort_group} {sort_active}
    {con} {group} {active}
      diff --git a/admin/templates/default/server_form.tpl b/admin/templates/default/server_form.tpl index fc6dafda78..e859e50e3f 100644 --- a/admin/templates/default/server_form.tpl +++ b/admin/templates/default/server_form.tpl @@ -1,84 +1,63 @@ -
    - - - - -
    {title_servers}
    - {message} +
    + {message} + + - - + - + - + - + - + - + - + - + - + - + -
    {lang_name}:
    {lang_url}:
    {lang_mode}: {server_mode}
    {lang_security}: {server_security} {ssl_note}
    {lang_trust}: {trust_level}
    {lang_relationship}: {trust_relationship}
    {lang_username}:
    {lang_password}:  {pass_note}
    {lang_admin_name}:
    {lang_admin_email}:
    - - - - - - + + + + + +
    - - -
    -
    +   + + + +
    -
    - - - - - - - - - -
    - -
    -
    -
    -
    -
    - - + + diff --git a/admin/templates/default/users.xsl b/admin/templates/default/users.xsl deleted file mode 100644 index 9f3c7a5dd6..0000000000 --- a/admin/templates/default/users.xsl +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - -
    - - - - - -
    -
    -
    - - - - - - - - -
    - - - - - - - - -
    - - - - - - window.status=' - - '; return true; - - - - - - - - - window.status=' - - '; return true; - - -
    - - - - - - - - - - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    - -
    - - - - - - - - -
    - - - - - - -
    -
    - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - row_off - - - row_on - - - - - - - - - - - - - - - - diff --git a/admin/templates/idots/images/navbar.png b/admin/templates/idots/images/navbar.png new file mode 100755 index 0000000000..5de9eb1142 Binary files /dev/null and b/admin/templates/idots/images/navbar.png differ diff --git a/admin/templates/idots/index.tpl b/admin/templates/idots/index.tpl new file mode 100644 index 0000000000..673af0e6b3 --- /dev/null +++ b/admin/templates/idots/index.tpl @@ -0,0 +1,51 @@ + + + + + {rows} +
    + + + + + [ {app_name} ] +   {app_name} + + + + + +   {app_name} + + + + + +  • {pref_text} + + + + + +   + + diff --git a/admin/templates/verdilak/images/navbar.gif b/admin/templates/verdilak/images/navbar.gif new file mode 100755 index 0000000000..d2b0bfccf1 Binary files /dev/null and b/admin/templates/verdilak/images/navbar.gif differ diff --git a/admin/templates/verdilak/images/navbar.png b/admin/templates/verdilak/images/navbar.png new file mode 100644 index 0000000000..7bcb24ceec Binary files /dev/null and b/admin/templates/verdilak/images/navbar.png differ diff --git a/admin/testbutton.php b/admin/testbutton.php index 7235918686..78f3b4f624 100755 --- a/admin/testbutton.php +++ b/admin/testbutton.php @@ -28,4 +28,6 @@ print "
    the same as ascii
    "; print $button->createInputButton("Lars is the best ;)",'submit','ascii'); print ""; + + $phpgw->common->phpgw_footer(); ?> diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 8810f8a02a..0000000000 Binary files a/favicon.ico and /dev/null differ diff --git a/header.inc.php.template b/header.inc.php.template index 1a0e58defa..9a01218564 100644 --- a/header.inc.php.template +++ b/header.inc.php.template @@ -44,12 +44,6 @@ /* Select which login template set you want, most people will use default */ $GLOBALS['phpgw_info']['login_template_set'] = 'default'; - /* Select which login theme you want */ - $GLOBALS['phpgw_info']['login_theme'] = 'submarine'; - - /* Enables support for non xslt apps or apps which weren't already ported to the last version of class.Templates.inc.php */ - $GLOBALS['phpgw_info']['server']['support_old_style_apps'] = True; - /* This is used to control mcrypt's use */ $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = {ENABLE_MCRYPT}; /* Set this to 'old' for versions < 2.4, otherwise the exact mcrypt version you use. */ diff --git a/help.php b/help.php deleted file mode 100644 index d665efad36..0000000000 --- a/help.php +++ /dev/null @@ -1,43 +0,0 @@ - True, - 'currentapp' => $app - ); - include('header.inc.php'); - - $GLOBALS['phpgw']->help = CreateObject('phpgwapi.help_helper'); - - if ($app == 'help') - { - $GLOBALS['phpgw']->hooks->process('help',array('manual')); - } - else - { - $GLOBALS['phpgw']->hooks->single('help',$app); - } - - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->help->output); -?> diff --git a/home.php b/home.php index 161d2423e3..c3fc9db783 100755 --- a/home.php +++ b/home.php @@ -20,79 +20,124 @@ exit; } - $GLOBALS['sessionid'] = $GLOBALS['HTTP_GET_VARS']['sessionid'] ? $GLOBALS['HTTP_GET_VARS']['sessionid'] : $GLOBALS['HTTP_COOKIE_VARS']['sessionid']; + $GLOBALS['sessionid'] = @$GLOBALS['HTTP_GET_VARS']['sessionid'] ? $GLOBALS['HTTP_GET_VARS']['sessionid'] : $GLOBALS['HTTP_COOKIE_VARS']['sessionid']; if (!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid']) { Header('Location: login.php'); exit; } + $GLOBALS['phpgw_info']['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'home', + 'enable_network_class' => True, + 'enable_contacts_class' => True, + 'enable_nextmatchs_class' => True + ); + include('header.inc.php'); + + if ($_GET['phpgw_forward']) + { + foreach($_GET as $name => $value) + { + if (ereg('phpgw_',$name)) + { + $extra_vars .= '&' . $name . '=' . urlencode($value); + } + } + $GLOBALS['phpgw']->redirect_link($_GET['phpgw_forward'],$extra_vars); + exit; + } + if ($GLOBALS['phpgw_info']['server']['force_default_app'] && $GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice') { $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app']; } - if ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] - && $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']]) - { - //$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); - Header('Location: ' . $GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); - } - else - { - $GLOBALS['phpgw_info']['flags'] = array - ( - 'noheader' => True, - 'nonavbar' => True, - 'currentapp' => 'home', - 'enable_network_class' => True, - 'enable_contacts_class' => True, - 'enable_nextmatchs_class' => True - ); - include('header.inc.php'); - - if ($GLOBALS['phpgw_forward']) - { - while (list($name,$value) = each($GLOBALS['HTTP_GET_VARS'])) + if (($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] && + $GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') || + ($GLOBALS['phpgw_info']['server']['useframes'] == 'always')) { - if (ereg('phpgw_',$name)) + if ($GLOBALS['HTTP_GET_VARS']['cd'] == 'yes') { - $extra_vars .= '&' . $name . '=' . urlencode($value); + if (! $navbarframe && ! $framebody) + { + $tpl = new Template(PHPGW_TEMPLATE_DIR); + $tpl->set_file(array( + 'frames' => 'frames.tpl', + 'frame_body' => 'frames_body.tpl', + 'frame_navbar' => 'frames_navbar.tpl' + )); + $tpl->set_var('navbar_link',$GLOBALS['phpgw']->link('index.php','navbarframe=True&cd=yes')); + if ($GLOBALS['forward']) + { + $tpl->set_var('body_link',$GLOBALS['phpgw']->link($GLOBALS['forward'])); + } + else + { + $tpl->set_var('body_link',$GLOBALS['phpgw']->link('index.php','framebody=True&cd=yes')); + } + + if ($GLOBALS['phpgw_info']['user']['preferences']['common']['frame_navbar_location'] == 'bottom') + { + $tpl->set_var('frame_size','*,60'); + $tpl->parse('frames_','frame_body',True); + $tpl->parse('frames_','frame_navbar',True); + } + else + { + $tpl->set_var('frame_size','60,*'); + $tpl->parse('frames_','frame_navbar',True); + $tpl->parse('frames_','frame_body',True); + } + $tpl->pparse('out','frames'); + } + if ($navbarframe) + { + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + } } } - $GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_forward'],$extra_vars); - } - - $GLOBALS['phpgw']->translation->add_app('mainscreen'); - if (lang('mainscreen_message') != 'mainscreen_message'.lang_char()) - { - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array( - 'mainscreen_message' => stripslashes(lang('mainscreen_message')) - )); - } - - if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && - $GLOBALS['phpgw_info']['user']['apps']['admin']) && - (isset($GLOBALS['phpgw_info']['server']['checkfornewversion']) && - $GLOBALS['phpgw_info']['server']['checkfornewversion'])) - { - $GLOBALS['phpgw']->network->set_addcrlf(False); - $lines = $GLOBALS['phpgw']->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion'); - for ($i=0; $iredirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); } - if($GLOBALS['phpgw']->common->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1])) + else { - $message = '

    There is a new version of phpGroupWare available. http://www.phpgroupware.org'; - $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True; - } + } - $_found = False; + $_found = False; $GLOBALS['phpgw']->db->query("select app_name,app_version from phpgw_applications",__LINE__,__FILE__); while($GLOBALS['phpgw']->db->next_record()) { @@ -103,26 +148,25 @@ { include($_versionfile); $_file_version = $setup_info[$_app_name]['version']; + $_app_title = $GLOBALS['phpgw_info']['apps'][$_app_name]['title']; unset($setup_info); if($GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version)) { $_found = True; - $_app_string .= '
    ' . $GLOBALS['phpgw_info']['apps'][$_app_name]['title']; + $_app_string .= '
    ' . $_app_title; } unset($_file_version); + unset($_app_title); } unset($_db_version); unset($_versionfile); } if($_found) { - $message = '
    ' . lang('The following applications require upgrades') . ':' . "\n"; - $message .= $_app_string . "\n"; - $message .= '
    ' . lang('Please run setup to become current') . '.' . "\n"; - - $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False; - unset($message); + echo '
    ' . lang('The following applications require upgrades') . ':' . "\n"; + echo $_app_string . "\n"; + echo '
    ' . lang('Please run setup to become current') . '.' . "\n"; unset($_app_string); } } @@ -130,7 +174,7 @@ if (isset($GLOBALS['phpgw_info']['user']['apps']['notifywindow']) && $GLOBALS['phpgw_info']['user']['apps']['notifywindow']) { -/* need to figure out how to implement this properly +?> +' . lang('Open notify window') . ''; -*/ } /* This initializes the users portal_order preference if it does not exist. */ @@ -187,19 +231,15 @@ } else { - $sorted_apps = Array - ( + $sorted_apps = Array( 'email', 'calendar', - 'news', + 'news_admin', 'addressbook', 'squirrelmail' ); } @reset($sorted_apps); - - $GLOBALS['phpgw']->portalbox = CreateObject('phpgwapi.listbox'); - $GLOBALS['phpgw']->hooks->process('home',$sorted_apps); if($GLOBALS['portal_order']) @@ -212,8 +252,8 @@ } $GLOBALS['phpgw']->preferences->save_repository(); } - $GLOBALS['phpgw_info']['flags']['currentapp'] = 'home'; // has been changed by hook_home's - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output); - } + //$phpgw->common->debug_phpgw_info(); + //$phpgw->common->debug_list_core_functions(); + $GLOBALS['phpgw']->common->phpgw_footer(); ?> diff --git a/index.php b/index.php index 78f9b9d42e..66b80d0bd9 100755 --- a/index.php +++ b/index.php @@ -8,9 +8,10 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ + /* $Id$ */ - $GLOBALS['phpgw_info'] = array(); + $phpgw_info = array(); if (!file_exists('header.inc.php')) { Header('Location: setup/index.php'); @@ -44,20 +45,17 @@ $invalid_data = True; } - // FIX ME! Don't leave this, we need to create a common place where applications can access - // things like the spell check class that the API has. (jengo) if ($app == 'phpgwapi') { $app = 'home'; $api_requested = True; } - $GLOBALS['phpgw_info']['flags'] = array - ( - //'noheader' => True, + $GLOBALS['phpgw_info']['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, 'currentapp' => $app ); - include('./header.inc.php'); if ($app == 'home' && ! $api_requested) @@ -76,12 +74,6 @@ { // eval("\$GLOBALS['obj']->$method();"); execmethod($_GET['menuaction']); - - if ($GLOBALS['phpgw_info']['server']['support_old_style_apps']) - { - $GLOBALS['phpgw']->common->stop_xslt_capture(); // send captured output to the xslttpl - } - unset($app); unset($obj); unset($class); @@ -118,4 +110,9 @@ $_obj->get_list(); */ } + + if (! $GLOBALS['phpgw_info']['nofooter']) + { + $GLOBALS['phpgw']->common->phpgw_footer(); + } ?> diff --git a/login.php b/login.php index 5be600e240..6f0494d23d 100755 --- a/login.php +++ b/login.php @@ -10,15 +10,16 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ - /* $Id$ */ - $GLOBALS['phpgw_info'] = array(); - $GLOBALS['phpgw_info']['flags'] = array - ( - 'login' => True, - 'currentapp' => 'login', - 'noheader' => True, - ); + /* $Id$ */ + + $phpgw_info = array(); + $GLOBALS['phpgw_info']['flags'] = array( + 'disable_template_class' => True, + 'login' => True, + 'currentapp' => 'login', + 'noheader' => True + ); if(file_exists('./header.inc.php')) { include('./header.inc.php'); @@ -29,62 +30,72 @@ Header('Location: setup/index.php'); exit; } - + $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set']; - - if (!$GLOBALS['phpgw_info']['login_theme']) - { - $GLOBALS['phpgw_info']['login_theme'] = 'submarine'; - } - - $GLOBALS['phpgw']->common = CreateObject('phpgwapi.common'); - - $GLOBALS['phpgw']->xslttpl = CreateObject('phpgwapi.xslttemplates',$GLOBALS['phpgw_info']['server']['template_dir']); - $GLOBALS['phpgw']->xslttpl->add_file('login'); - - $data = array - ( - 'phpgw_theme' => 'phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'] . '/css/phpgw.css', - 'login_theme' => 'phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'] . '/css/' . $GLOBALS['phpgw_info']['login_theme'] . '.css', - 'phpgw_head_charset' => lang('charset'), - 'phpgw_head_website_title' => $GLOBALS['phpgw_info']['server']['site_title'] - ); - - $data['login_standard'] = array - ( - 'login_layout' => $GLOBALS['phpgw_info']['login_template_set'], - 'lang_phpgw_statustext' => lang('phpGroupWare --> homepage') - ); + $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); // This is used for system downtime, to prevent new logins. if ($GLOBALS['phpgw_info']['server']['deny_all_logins']) { - $GLOBALS['phpgw']->xslttpl->set_var('login',$data); - $GLOBALS['phpgw']->xslttpl->pp(); + $tmpl->set_file(array( + 'login_form' => 'login_denylogin.tpl' + )); + $tmpl->set_var('template_set','default'); + $tmpl->pfp('loginout','login_form'); exit; } - $data['login_standard']['loginscreen'] = True; + // !! NOTE !! + // Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file. + // If there is a problem, tell me and I will fix it. (jengo) - function check_logoutcode() +/* + if ($_GET['cd'] != 10 && $GLOBALS['phpgw_info']['server']['usecookies'] == False) { - switch($_GET['code']) + $GLOBALS['phpgw']->sessions->setcookie('sessionid'); + $GLOBALS['phpgw']->sessions->setcookie('kp3'); + $GLOBALS['phpgw']->sessions->setcookie('domain'); + } +*/ + +/* This is not working yet because I need to figure out a way to clear the $cd =1 + if (isset($_SERVER['PHP_AUTH_USER']) && $_GET['cd'] == '1') + { + Header('HTTP/1.0 401 Unauthorized'); + Header('WWW-Authenticate: Basic realm="phpGroupWare"'); + echo 'You have to re-authentificate yourself'; + exit; + } +*/ + + if (! $deny_login && ! $GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $tmpl->set_file(array('login_form' => 'login.tpl')); + $tmpl->set_var('charset',lang('charset')); + } + elseif ($GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $tmpl->set_file(array('login_form' => 'login_selectdomain.tpl')); + $tmpl->set_var('charset',lang('charset')); + } + + function check_logoutcode($code) + { + switch($code) { case 1: - $GLOBALS['phpgw_info']['flags']['msgbox_data']['You have been successfully logged out'] = True; + return lang('You have been successfully logged out'); break; case 2: - $GLOBALS['phpgw_info']['flags']['msgbox_data']['Sorry, your login has expired'] = False; + return lang('Sorry, your login has expired'); break; case 5: - $GLOBALS['phpgw_info']['flags']['msgbox_data']['Bad login or password'] = False; + return '' . lang('Bad login or password') . ''; break; case 99: - $GLOBALS['phpgw_info']['flags']['msgbox_data']['Blocked, too many attempts'] = False; + return '' . lang('Blocked, too many attempts') . ''; break; case 10: - $GLOBALS['phpgw_info']['flags']['msgbox_data']['Your session could not be verified'] = False; - $GLOBALS['phpgw']->sessions->phpgw_setcookie('sessionid'); $GLOBALS['phpgw']->sessions->phpgw_setcookie('kp3'); $GLOBALS['phpgw']->sessions->phpgw_setcookie('domain'); @@ -94,17 +105,22 @@ { $GLOBALS['phpgw']->sessions->phpgw_setcookie(PHPGW_PHPSESSID); } + + return '' . lang('Your session could not be verified.') . ''; break; + default: + return ' '; } } function check_langs() { - //$f = fopen('/tmp/log','a'); fwrite($f,"\ncheck_langs()\n"); + //echo "

    check_langs()

    \n"; if ($GLOBALS['phpgw_info']['server']['lang_ctimes'] && !is_array($GLOBALS['phpgw_info']['server']['lang_ctimes'])) { $GLOBALS['phpgw_info']['server']['lang_ctimes'] = unserialize($GLOBALS['phpgw_info']['server']['lang_ctimes']); } + //_debug_array($GLOBALS['phpgw_info']['server']['lang_ctimes']); $lang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; $apps = $GLOBALS['phpgw_info']['user']['apps']; @@ -117,18 +133,15 @@ { $ctime = filectime($fname); $ltime = intval($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app]); - //fwrite($f,"checking lang='$lang', app='$app', ctime='$ctime', ltime='$ltime'\n"); + //echo "checking lang='$lang', app='$app', ctime='$ctime', ltime='$ltime'
    \n"; if ($ctime != $ltime) { - //fwrite($f,"\nupdate_langs()\n"); - update_langs(); // update all langs break; } } } - //fclose ($f); } function update_langs() @@ -151,6 +164,7 @@ } /* Program starts here */ + if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) { $submit = True; @@ -160,7 +174,7 @@ # Apache + mod_ssl style SSL certificate authentication # Certificate (chain) verification occurs inside mod_ssl - if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['code'])) + if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd'])) { # an X.509 subject looks like: # /CN=john.doe/OU=Department/O=Company/C=xx/Email=john@comapy.tld/L=City/ @@ -205,9 +219,9 @@ } $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,$_POST['passwd'],$_POST['passwd_type']); - if(!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid']) + if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?code=' . $GLOBALS['phpgw']->session->cd_reason); + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason); } else { @@ -262,22 +276,25 @@ $GLOBALS['phpgw']->translation->add_app('loginscreen'); if (lang('loginscreen_message') != 'loginscreen_message*') { - $data['login_standard']['phpgw_loginscreen_message'] = stripslashes(lang('loginscreen_message')); + $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message'))); } } $last_loginid = $_COOKIE['last_loginid']; if ($GLOBALS['phpgw_info']['server']['show_domain_selectbox']) { - foreach ($phpgw_domain as $domain => $domain_data) - { - $ds = array('domain' => $domain); - if ($domain == $_COOKIE['last_domain']) + $domain_select = ''; // For security ... just in case + foreach($GLOBALS['phpgw_domain'] as $domain_name => $domain_vars) + { + $domain_select .= '