From aac9ec7d10e94984a8c5cee74ff53005d6b15706 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 14 Oct 2005 17:03:16 +0000 Subject: [PATCH] phpgw --> egw --- admin/inc/class.admin_db_backup.inc.php | 14 +- admin/inc/class.boaccess_history.inc.php | 6 +- admin/inc/class.boaccounts.inc.php | 192 ++++++------ admin/inc/class.boaclmanager.inc.php | 6 +- admin/inc/class.boapplications.inc.php | 22 +- admin/inc/class.bocategories.inc.php | 8 +- admin/inc/class.boconfig.inc.php | 8 +- admin/inc/class.bocurrentsessions.inc.php | 12 +- admin/inc/class.boldap_mgr.inc.php | 26 +- admin/inc/class.bolog.inc.php | 10 +- admin/inc/class.boserver.inc.php | 28 +- admin/inc/class.html_tables.inc.php | 12 +- admin/inc/class.soaccess_history.inc.php | 2 +- admin/inc/class.soaccounts.inc.php | 14 +- admin/inc/class.soapplications.inc.php | 28 +- admin/inc/class.soldap_mgr.inc.php | 14 +- admin/inc/class.solog.inc.php | 2 +- admin/inc/class.soserver.inc.php | 24 +- admin/inc/class.uiaccess_history.inc.php | 30 +- admin/inc/class.uiaccounts.inc.php | 344 +++++++++++----------- admin/inc/class.uiaclmanager.inc.php | 42 +-- admin/inc/class.uiapplications.inc.php | 236 +++++++-------- admin/inc/class.uiasyncservice.inc.php | 50 ++-- admin/inc/class.uicategories.inc.php | 106 +++---- admin/inc/class.uiconfig.inc.php | 30 +- admin/inc/class.uicurrentsessions.inc.php | 50 ++-- admin/inc/class.uildap_mgr.inc.php | 52 ++-- admin/inc/class.uilog.inc.php | 96 +++--- admin/inc/class.uimainscreen.inc.php | 160 +++++----- admin/inc/class.uimenuclass.inc.php | 34 +-- admin/inc/class.uiserver.inc.php | 218 +++++++------- admin/inc/hook_add_def_pref.inc.php | 12 +- admin/inc/hook_admin.inc.php | 56 ++-- admin/inc/hook_after_navbar.inc.php | 26 +- admin/inc/hook_config.inc.php | 22 +- admin/inc/hook_deleteaccount.inc.php | 28 +- admin/inc/hook_sidebox_menu.inc.php | 58 ++-- admin/index.php | 21 +- admin/navbar-create.php | 32 -- admin/navbar-sel.php | 74 ----- admin/phpinfo.php | 8 +- admin/testbutton.php | 33 --- 42 files changed, 1055 insertions(+), 1191 deletions(-) delete mode 100644 admin/navbar-create.php delete mode 100644 admin/navbar-sel.php delete mode 100755 admin/testbutton.php diff --git a/admin/inc/class.admin_db_backup.inc.php b/admin/inc/class.admin_db_backup.inc.php index 1814b404e1..fc81f21d15 100644 --- a/admin/inc/class.admin_db_backup.inc.php +++ b/admin/inc/class.admin_db_backup.inc.php @@ -22,14 +22,14 @@ function admin_db_backup() { - } + } /** * Method for sheduled backups, called via asynservice */ function do_backup() { - $this->db_backup = CreateObject('phpgwapi.db_backup'); + $this->db_backup =& CreateObject('phpgwapi.db_backup'); if ($f = $this->db_backup->fopen_backup()) { @@ -43,12 +43,12 @@ */ function index() { - $tpl_root = PHPGW_SERVER_ROOT.'/setup/templates/default'; - $self = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.admin_db_backup.index')); - $GLOBALS['phpgw']->translation->add_app('setup'); + $tpl_root = EGW_SERVER_ROOT.'/setup/templates/default'; + $self = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'admin.admin_db_backup.index')); + $GLOBALS['egw']->translation->add_app('setup'); - include PHPGW_SERVER_ROOT.'/setup/db_backup.php'; + include EGW_SERVER_ROOT.'/setup/db_backup.php'; - $GLOBALS['phpgw']->common->phpgw_footer(); + $GLOBALS['egw']->common->egw_footer(); } } \ No newline at end of file diff --git a/admin/inc/class.boaccess_history.inc.php b/admin/inc/class.boaccess_history.inc.php index 1e30bc4543..52179070a4 100644 --- a/admin/inc/class.boaccess_history.inc.php +++ b/admin/inc/class.boaccess_history.inc.php @@ -15,7 +15,7 @@ { function boaccess_history() { - $this->so = createobject('admin.soaccess_history'); + $this->so =& CreateObject('admin.soaccess_history'); } function list_history($account_id,$start,$order,$sort) @@ -42,12 +42,12 @@ if ($record['li']) { - $record['li'] = $GLOBALS['phpgw']->common->show_date($record['li']); + $record['li'] = $GLOBALS['egw']->common->show_date($record['li']); } if ($record['lo']) { - $record['lo'] = $GLOBALS['phpgw']->common->show_date($record['lo']); + $record['lo'] = $GLOBALS['egw']->common->show_date($record['lo']); } else { diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index dedfbc0e60..76591734fb 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -35,15 +35,15 @@ function boaccounts() { - $this->so = createobject('admin.soaccounts'); + $this->so =& CreateObject('admin.soaccounts'); } function DONTlist_methods($_type='xmlrpc') { /* - This handles introspection or discovery by the logged in client, - in which case the input might be an array. The server always calls - this function to fill the server dispatch map using a string. + This handles introspection or discovery by the logged in client, + in which case the input might be an array. The server always calls + this function to fill the server dispatch map using a string. */ if (is_array($_type)) { @@ -77,7 +77,7 @@ function delete_group() { - if (!@isset($_POST['account_id']) || !@$_POST['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) + if (!@isset($_POST['account_id']) || !@$_POST['account_id'] || $GLOBALS['egw']->acl->check('group_access',32,'admin')) { ExecMethod('admin.uiaccounts.list_groups'); return False; @@ -85,7 +85,7 @@ $account_id = (int)$_POST['account_id']; - $GLOBALS['phpgw']->db->lock( + $GLOBALS['egw']->db->lock( Array( 'phpgw_accounts', 'phpgw_app_sessions', @@ -93,18 +93,18 @@ ) ); - $old_group_list = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group'); + $old_group_list = $GLOBALS['egw']->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,(int)$id[1]); - $GLOBALS['phpgw']->session->delete_cache((int)$id[1]); + $GLOBALS['egw']->acl->delete_repository('phpgw_group',$account_id,(int)$id[1]); + $GLOBALS['egw']->session->delete_cache((int)$id[1]); } - $GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id); + $GLOBALS['egw']->acl->delete_repository('%%','run',$account_id); - if (! @rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id))) + if (! @rmdir($GLOBALS['egw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['egw']->accounts->id2name($account_id))) { $cd = 38; } @@ -113,17 +113,17 @@ $cd = 32; } - $GLOBALS['phpgw']->accounts->delete($account_id); + $GLOBALS['egw']->accounts->delete($account_id); - $GLOBALS['phpgw']->db->unlock(); + $GLOBALS['egw']->db->unlock(); - Header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + Header('Location: '.$GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); + $GLOBALS['egw']->common->egw_exit(); } function delete_user() { - if (isset($_POST['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) + if (isset($_POST['cancel']) || $GLOBALS['egw']->acl->check('account_access',32,'admin')) { ExecMethod('admin.uiaccounts.list_users'); return False; @@ -134,14 +134,14 @@ settype($account_id,'integer'); $account_id = get_account_id($accountid); // make this information also in hook available - $lid = $GLOBALS['phpgw']->accounts->id2name($account_id); + $lid = $GLOBALS['egw']->accounts->id2name($account_id); $GLOBALS['hook_values']['account_id'] = $account_id; $GLOBALS['hook_values']['account_lid'] = $lid; $singleHookValues = $GLOBALS['hook_values']+array('location' => 'deleteaccount'); - $db = $GLOBALS['phpgw']->db; + $db = clone($GLOBALS['egw']->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()) { @@ -151,15 +151,15 @@ if($appname <> 'admin' || $appname <> 'preferences') { - $GLOBALS['phpgw']->hooks->single($singleHookValues, $appname); + $GLOBALS['egw']->hooks->single($singleHookValues, $appname); } } } - $GLOBALS['phpgw']->hooks->single('deleteaccount','preferences'); - $GLOBALS['phpgw']->hooks->single('deleteaccount','admin'); + $GLOBALS['egw']->hooks->single('deleteaccount','preferences'); + $GLOBALS['egw']->hooks->single('deleteaccount','admin'); - $basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP; + $basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'users' . SEP; if (! @rmdir($basedir . $lid)) { @@ -177,7 +177,7 @@ function add_group() { - if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',4,'admin')) { ExecMethod('admin.uiaccounts.list_groups'); return False; @@ -213,7 +213,7 @@ $this->validate_group($group_info); - $GLOBALS['phpgw']->db->lock( + $GLOBALS['egw']->db->lock( Array( 'phpgw_accounts', 'phpgw_nextid', @@ -226,7 +226,7 @@ ) ); - $group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); + $group =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); $group->acct_type = 'g'; $account_info = array( 'account_type' => 'g', @@ -242,7 +242,7 @@ // do the following only if we got an id - the create succided if ($group_info['account_id']) { - $apps = CreateObject('phpgwapi.applications',$group_info['account_id']); + $apps =& CreateObject('phpgwapi.applications',$group_info['account_id']); $apps->update_data(Array()); reset($group_info['account_apps']); while(list($app,$value) = each($group_info['account_apps'])) @@ -252,7 +252,7 @@ } $apps->save_repository(); - $acl = CreateObject('phpgwapi.acl',$group_info['account_id']); + $acl =& CreateObject('phpgwapi.acl',$group_info['account_id']); $acl->read_repository(); @reset($group_info['account_user']); @@ -265,14 +265,14 @@ $acl->add_repository('phpgw_group',$group_info['account_id'],$user_id,1); $docommit = False; - $GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$user_id); + $GLOBALS['pref'] =& CreateObject('phpgwapi.preferences',$user_id); $t = $GLOBALS['pref']->read_repository(); @reset($new_apps); while(is_array($new_apps) && list($app_key,$app_name) = each($new_apps)) { if (!$t[($app_name=='admin'?'common':$app_name)]) { - $GLOBALS['phpgw']->hooks->single('add_def_pref', $app_name); + $GLOBALS['egw']->hooks->single('add_def_pref', $app_name); $docommit = True; } } @@ -284,7 +284,7 @@ $acl->save_repository(); - $basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'groups' . SEP; + $basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'groups' . SEP; $cd = 31; umask(000); if (! @mkdir ($basedir . $group_info['account_name'], 0707)) @@ -292,7 +292,7 @@ $cd = 37; } - $GLOBALS['phpgw']->db->unlock(); + $GLOBALS['egw']->db->unlock(); } ExecMethod('admin.uiaccounts.list_groups'); @@ -301,16 +301,16 @@ function add_user() { - if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) + if ($GLOBALS['egw']->acl->check('account_access',4,'admin')) { ExecMethod('admin.uiaccounts.list_users'); return False; } $accountPrefix = ''; - if(isset($GLOBALS['phpgw_info']['server']['account_prefix'])) + if(isset($GLOBALS['egw_info']['server']['account_prefix'])) { - $accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix']; + $accountPrefix = $GLOBALS['egw_info']['server']['account_prefix']; } if ($_POST['submit']) @@ -354,7 +354,7 @@ // when does the account expire if ($_POST['expires'] !== '' && !$_POST['never_expires']) { - $jscal = CreateObject('phpgwapi.jscalendar',False); + $jscal =& CreateObject('phpgwapi.jscalendar',False); $userData += $jscal->input2date($_POST['expires'],False,'account_expires_day','account_expires_month','account_expires_year'); } @@ -364,15 +364,15 @@ { if ($userData['anonymous']) { - $GLOBALS['phpgw']->acl->add_repository('phpgwapi','anonymous',$account_id,1); + $GLOBALS['egw']->acl->add_repository('phpgwapi','anonymous',$account_id,1); } else { - $GLOBALS['phpgw']->acl->delete_repository('phpgwapi','anonymous',$account_id); + $GLOBALS['egw']->acl->delete_repository('phpgwapi','anonymous',$account_id); } // make this information for the hooks available $GLOBALS['hook_values'] = $userData + array('new_passwd' => $userData['account_passwd']); - $GLOBALS['phpgw']->hooks->process($GLOBALS['hook_values']+array( + $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array( 'location' => 'addaccount' ),False,True); // called for every app now, not only enabled ones @@ -381,7 +381,7 @@ } else { - $ui = createobject('admin.uiaccounts'); + $ui =& CreateObject('admin.uiaccounts'); $ui->create_edit_user($userData['account_id'],$userData,$errors); } } @@ -394,7 +394,7 @@ function edit_group() { - if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',16,'admin')) { ExecMethod('admin.uiaccounts.list_groups'); return False; @@ -431,7 +431,7 @@ $this->validate_group($group_info); // Lock tables - $GLOBALS['phpgw']->db->lock( + $GLOBALS['egw']->db->lock( Array( 'phpgw_accounts', 'phpgw_preferences', @@ -444,11 +444,11 @@ ) ); - $group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); + $group =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); $old_group_info = $group->read_repository(); // Set group apps - $apps = CreateObject('phpgwapi.applications',$group_info['account_id']); + $apps =& CreateObject('phpgwapi.applications',$group_info['account_id']); $apps_before = $apps->read_account_specific(); $apps->update_data(Array()); $new_apps = Array(); @@ -472,7 +472,7 @@ $group->data['account_lid'] = $group_info['account_name']; $group->data['firstname'] = $group_info['account_name']; - $basedir = $GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'groups' . SEP; + $basedir = $GLOBALS['egw_info']['server']['files_dir'] . SEP . 'groups' . SEP; if (! @rename($basedir . $old_group_info['account_lid'], $basedir . $group_info['account_name'])) { $cd = 39; @@ -488,7 +488,7 @@ } // Set group acl - $acl = CreateObject('phpgwapi.acl',$group_info['account_id']); + $acl =& CreateObject('phpgwapi.acl',$group_info['account_id']); $old_group_list = $acl->get_ids_for_location($group_info['account_id'],1,'phpgw_group'); @reset($old_group_list); while($old_group_list && list($key,$user_id) = each($old_group_list)) @@ -497,10 +497,10 @@ if(!$group_info['account_user'][$user_id]) { // If the user is logged in, it will force a refresh of the session_info - $GLOBALS['phpgw']->db->query("update phpgw_sessions set session_action='' " - ."where session_lid='" . $GLOBALS['phpgw']->accounts->id2name($user_id) - . '@' . $GLOBALS['phpgw_info']['user']['domain'] . "'",__LINE__,__FILE__); - $GLOBALS['phpgw']->session->delete_cache($user_id); + $GLOBALS['egw']->db->query("update phpgw_sessions set session_action='' " + ."where session_lid='" . $GLOBALS['egw']->accounts->id2name($user_id) + . '@' . $GLOBALS['egw_info']['user']['domain'] . "'",__LINE__,__FILE__); + $GLOBALS['egw']->session->delete_cache($user_id); } } @@ -514,25 +514,25 @@ $acl->add_repository('phpgw_group',$group_info['account_id'],$user_id,1); // If the user is logged in, it will force a refresh of the session_info - $GLOBALS['phpgw']->db->query("update phpgw_sessions set session_action='' " - ."where session_lid='" . $GLOBALS['phpgw']->accounts->id2name($user_id) - . '@' . $GLOBALS['phpgw_info']['user']['domain'] . "'",__LINE__,__FILE__); + $GLOBALS['egw']->db->query("update phpgw_sessions set session_action='' " + ."where session_lid='" . $GLOBALS['egw']->accounts->id2name($user_id) + . '@' . $GLOBALS['egw_info']['user']['domain'] . "'",__LINE__,__FILE__); - $GLOBALS['phpgw']->session->delete_cache($user_id); + $GLOBALS['egw']->session->delete_cache($user_id); // The following sets any default preferences needed for new applications.. // This is smart enough to know if previous preferences were selected, use them. $docommit = False; if($new_apps) { - $GLOBALS['pref'] = CreateObject('phpgwapi.preferences',$user_id); + $GLOBALS['pref'] =& CreateObject('phpgwapi.preferences',$user_id); $t = $GLOBALS['pref']->read_repository(); @reset($new_apps); while(list($app_key,$app_name) = each($new_apps)) { if (!$t[($app_name=='admin'?'common':$app_name)]) { - $GLOBALS['phpgw']->hooks->single('add_def_pref', $app_name); + $GLOBALS['egw']->hooks->single('add_def_pref', $app_name); $docommit = True; } } @@ -547,7 +547,7 @@ // for LDAP to update the memberuid attribute $group->save_repository(); - $GLOBALS['phpgw']->db->unlock(); + $GLOBALS['egw']->db->unlock(); ExecMethod('admin.uiaccounts.list_groups'); return False; @@ -555,16 +555,16 @@ function edit_user() { - if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('account_access',16,'admin')) { ExecMethod('admin.uiaccounts.list_users'); return False; } $accountPrefix = ''; - if(isset($GLOBALS['phpgw_info']['server']['account_prefix'])) + if(isset($GLOBALS['egw_info']['server']['account_prefix'])) { - $accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix']; + $accountPrefix = $GLOBALS['egw_info']['server']['account_prefix']; } if ($_POST['submit']) @@ -596,14 +596,14 @@ } if ($_POST['expires'] !== '' && !$_POST['never_expires']) { - $jscal = CreateObject('phpgwapi.jscalendar',False); + $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'] = $userData; - $GLOBALS['phpgw']->hooks->process($GLOBALS['hook_values']+array( + $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array( 'location' => 'editaccount' ),False,True); // called for every app now, not only enabled ones) @@ -636,7 +636,7 @@ } else { - $ui = createobject('admin.uiaccounts'); + $ui =& CreateObject('admin.uiaccounts'); $ui->create_edit_user($userData['account_id'],$userData,$errors); } } @@ -644,16 +644,16 @@ function set_group_managers() { - if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $_POST['cancel']) + if($GLOBALS['egw']->acl->check('group_access',16,'admin') || $_POST['cancel']) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['egw']->redirect($GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); + $GLOBALS['egw']->common->egw_exit(); } elseif($_POST['submit']) { - $acl = CreateObject('phpgwapi.acl',(int)$_POST['account_id']); + $acl =& CreateObject('phpgwapi.acl',(int)$_POST['account_id']); - $users = $GLOBALS['phpgw']->accounts->member($_POST['account_id']); + $users = $GLOBALS['egw']->accounts->member($_POST['account_id']); @reset($users); while($managers && list($key,$user) = each($users)) { @@ -663,18 +663,18 @@ @reset($managers); while($managers && list($key,$manager) = each($managers)) { - $acl->add_repository('phpgw_group',(int)$_POST['account_id'],$manager,(1 + PHPGW_ACL_GROUP_MANAGERS)); + $acl->add_repository('phpgw_group',(int)$_POST['account_id'],$manager,(1 + EGW_ACL_GROUP_MANAGERS)); } } - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['egw']->redirect($GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); + $GLOBALS['egw']->common->egw_exit(); } function validate_group($group_info) { $errors = Array(); - $group = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); + $group =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); $group->read_repository(); if(!$group_info['account_name']) @@ -698,9 +698,9 @@ */ if(count($errors)) { - $ui = createobject('admin.uiaccounts'); + $ui =& CreateObject('admin.uiaccounts'); $ui->create_edit_group($group_info,$errors); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['egw']->common->egw_exit(); } } @@ -712,7 +712,7 @@ { $totalerrors = 0; - if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap' && + if ($GLOBALS['egw_info']['server']['account_repository'] == 'ldap' && (!$_userData['account_lastname'] && !$_userData['lastname'])) { $error[$totalerrors] = lang('You must enter a lastname'); @@ -733,17 +733,17 @@ if ($_userData['old_loginid'] != $_userData['account_lid']) { - if ($GLOBALS['phpgw']->accounts->exists($_userData['account_lid'])) + if ($GLOBALS['egw']->accounts->exists($_userData['account_lid'])) { - if ($GLOBALS['phpgw']->accounts->exists($_userData['account_lid']) && $GLOBALS['phpgw']->accounts->get_type($_userData['account_lid'])=='g') - { - $error[$totalerrors] = lang('There already is a group with this name. Userid\'s can not have the same name as a groupid'); - } - else - { - $error[$totalerrors] = lang('That loginid has already been taken'); - } - $totalerrors++; + if ($GLOBALS['egw']->accounts->exists($_userData['account_lid']) && $GLOBALS['egw']->accounts->get_type($_userData['account_lid'])=='g') + { + $error[$totalerrors] = lang('There already is a group with this name. Userid\'s can not have the same name as a groupid'); + } + else + { + $error[$totalerrors] = lang('That loginid has already been taken'); + } + $totalerrors++; } } @@ -811,23 +811,23 @@ /* stores the userdata */ function save_user($_userData) { - $account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); + $account =& CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); $account->update_data($_userData); $account->save_repository(); if ($_userData['account_passwd']) { - $auth = CreateObject('phpgwapi.auth'); + $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($GLOBALS['hook_values']+array( + $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array( 'location' => 'changepassword' ),False,True); // called for every app now, not only enabled ones) } - $apps = CreateObject('phpgwapi.applications',(int)$_userData['account_id']); + $apps =& CreateObject('phpgwapi.applications',(int)$_userData['account_id']); if ($_userData['account_permissions']) { foreach($_userData['account_permissions'] as $app => $enabled) @@ -840,7 +840,7 @@ } $apps->save_repository(); - $account = CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); + $account =& CreateObject('phpgwapi.accounts',$_userData['account_id'],'u'); $allGroups = $account->get_list('groups'); if ($_userData['account_groups']) @@ -852,7 +852,7 @@ } } - $acl = CreateObject('phpgwapi.acl',$_userData['account_id']); + $acl =& CreateObject('phpgwapi.acl',$_userData['account_id']); reset($allGroups); while (list($key,$groupData) = each($allGroups)) @@ -879,18 +879,18 @@ } if ($_userData['changepassword']) { - $GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1); + $GLOBALS['egw']->acl->add_repository('preferences','changepassword',$_userData['account_id'],1); } else { - $GLOBALS['phpgw']->acl->delete_repository('preferences','changepassword',$_userData['account_id']); + $GLOBALS['egw']->acl->delete_repository('preferences','changepassword',$_userData['account_id']); } - $GLOBALS['phpgw']->session->delete_cache((int)$_userData['account_id']); + $GLOBALS['egw']->session->delete_cache((int)$_userData['account_id']); } function load_group_users($account_id) { - $temp_user = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group'); + $temp_user = $GLOBALS['egw']->acl->get_ids_for_location($account_id,1,'phpgw_group'); if(!$temp_user) { return Array(); @@ -910,7 +910,7 @@ function load_group_managers($account_id) { - $temp_user = $GLOBALS['phpgw']->acl->get_ids_for_location($account_id,PHPGW_ACL_GROUP_MANAGERS,'phpgw_group'); + $temp_user = $GLOBALS['egw']->acl->get_ids_for_location($account_id,EGW_ACL_GROUP_MANAGERS,'phpgw_group'); if(!$temp_user) { return Array(); @@ -930,7 +930,7 @@ function load_group_apps($account_id) { - $apps = CreateObject('phpgwapi.applications',(int)$account_id); + $apps =& CreateObject('phpgwapi.applications',(int)$account_id); $app_list = $apps->read_account_specific(); $account_apps = Array(); while(list($key,$app) = each($app_list)) diff --git a/admin/inc/class.boaclmanager.inc.php b/admin/inc/class.boaclmanager.inc.php index 3d9c11aa30..3576dda942 100644 --- a/admin/inc/class.boaclmanager.inc.php +++ b/admin/inc/class.boaclmanager.inc.php @@ -21,8 +21,8 @@ function boaclmanager() { - //$this->so = createobject('admin.soaclmanager'); - $this->ui = createobject('admin.uiaclmanager'); + //$this->so =& CreateObject('admin.soaclmanager'); + $this->ui =& CreateObject('admin.uiaclmanager'); } function submit() @@ -41,7 +41,7 @@ $total_rights += $rights; } - $GLOBALS['phpgw']->acl->add_repository($GLOBALS['acl_app'], $location, $GLOBALS['account_id'], $total_rights); + $GLOBALS['egw']->acl->add_repository($GLOBALS['acl_app'], $location, $GLOBALS['account_id'], $total_rights); $this->ui->list_apps(); } diff --git a/admin/inc/class.boapplications.inc.php b/admin/inc/class.boapplications.inc.php index abfcb6bc23..0d32c8f332 100644 --- a/admin/inc/class.boapplications.inc.php +++ b/admin/inc/class.boapplications.inc.php @@ -1,15 +1,15 @@ so = CreateObject('admin.soapplications'); + $this->so =& CreateObject('admin.soapplications'); } function get_list() diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index f79f117174..970d03985f 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -30,11 +30,11 @@ { if ($_GET['appname']) { - $this->cats = CreateObject('phpgwapi.categories',-1,$_GET['appname']); + $this->cats =& CreateObject('phpgwapi.categories',-1,$_GET['appname']); } else { - $this->cats = CreateObject('phpgwapi.categories',$GLOBALS['phpgw_info']['user']['account_id'],'phpgw'); + $this->cats =& CreateObject('phpgwapi.categories',$GLOBALS['egw_info']['user']['account_id'],'phpgw'); } $this->read_sessiondata(); @@ -79,12 +79,12 @@ function save_sessiondata($data) { if($this->debug) { echo '
Save:'; _debug_array($data); } - $GLOBALS['phpgw']->session->appsession('session_data','admin_cats',$data); + $GLOBALS['egw']->session->appsession('session_data','admin_cats',$data); } function read_sessiondata() { - $data = $GLOBALS['phpgw']->session->appsession('session_data','admin_cats'); + $data = $GLOBALS['egw']->session->appsession('session_data','admin_cats'); if($this->debug) { echo '
Read:'; _debug_array($data); } $this->start = $data['start']; diff --git a/admin/inc/class.boconfig.inc.php b/admin/inc/class.boconfig.inc.php index f048ccf3a6..f782927f7c 100644 --- a/admin/inc/class.boconfig.inc.php +++ b/admin/inc/class.boconfig.inc.php @@ -28,9 +28,9 @@ function list_methods($_type='xmlrpc') { /* - This handles introspection or discovery by the logged in client, - in which case the input might be an array. The server always calls - this function to fill the server dispatch map using a string. + This handles introspection or discovery by the logged in client, + in which case the input might be an array. The server always calls + this function to fill the server dispatch map using a string. */ if (is_array($_type)) { @@ -83,7 +83,7 @@ return $errors; } - $conf = CreateObject('phpgwapi.config', $data['appname']); + $conf =& CreateObject('phpgwapi.config', $data['appname']); $conf->read_repository(); reset($newsettings); diff --git a/admin/inc/class.bocurrentsessions.inc.php b/admin/inc/class.bocurrentsessions.inc.php index 5d88564e1a..14c09ed94d 100644 --- a/admin/inc/class.bocurrentsessions.inc.php +++ b/admin/inc/class.bocurrentsessions.inc.php @@ -22,12 +22,12 @@ function total() { - return $GLOBALS['phpgw']->session->total(); + return $GLOBALS['egw']->session->total(); } function list_sessions($start,$order,$sort) { - $values = $GLOBALS['phpgw']->session->list_sessions($start,$sort,$order); + $values = $GLOBALS['egw']->session->list_sessions($start,$sort,$order); while (list(,$value) = @each($values)) { @@ -48,7 +48,7 @@ 'session_id' => $value['session_id'], 'session_lid' => $session_lid, 'session_ip' => $value['session_ip'], - 'session_logintime' => $GLOBALS['phpgw']->common->show_date($value['session_logintime']), + 'session_logintime' => $GLOBALS['egw']->common->show_date($value['session_logintime']), 'session_action' => $value['session_action'], 'session_dla' => $value['session_dla'], 'session_idle' => str_pad($hours, 2, '0', STR_PAD_LEFT) . ':' . str_pad($mins, 2, '0', STR_PAD_LEFT) . ':' . str_pad($secs, 2, '0', STR_PAD_LEFT) @@ -61,11 +61,11 @@ { if ($_GET['ksession'] && ($GLOBALS['sessionid'] != $_GET['ksession']) && - ! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin')) + ! $GLOBALS['egw']->acl->check('current_sessions_access',8,'admin')) { - $GLOBALS['phpgw']->session->destroy($_GET['ksession'],0); + $GLOBALS['egw']->session->destroy($_GET['ksession'],0); } - $this->ui = createobject('admin.uicurrentsessions'); + $this->ui =& CreateObject('admin.uicurrentsessions'); $this->ui->list_sessions(); } } diff --git a/admin/inc/class.boldap_mgr.inc.php b/admin/inc/class.boldap_mgr.inc.php index ac127e7076..6411b11bc1 100644 --- a/admin/inc/class.boldap_mgr.inc.php +++ b/admin/inc/class.boldap_mgr.inc.php @@ -35,7 +35,7 @@ function boldap_mgr($_profileID=-1) { - $this->soldapmgr = CreateObject('admin.soldap_mgr'); + $this->soldapmgr =& CreateObject('admin.soldap_mgr'); $this->SMTPServerType = array( '1' => array( @@ -186,7 +186,7 @@ # if(!is_object($this->imapClass)) # { # $profileData = $this->getProfile($_profileID); -# $this->imapClass = CreateObject('emailadmin.cyrusimap',$profileData); +# $this->imapClass =& CreateObject('emailadmin.cyrusimap',$profileData); # } # # return $this->imapClass; @@ -246,7 +246,7 @@ # if(!is_object($this->smtpClass)) # { # $profileData = $this->getProfile($_profileID); -# $this->smtpClass = CreateObject('emailadmin.postfixldap',$profileData); +# $this->smtpClass =& CreateObject('emailadmin.postfixldap',$profileData); # } # # return $this->smtpClass; @@ -279,10 +279,10 @@ function restoreSessionData() { - global $phpgw; + - $this->sessionData = $phpgw->session->appsession('session_data'); - $this->userSessionData = $phpgw->session->appsession('user_session_data'); + $this->sessionData = $GLOBALS['egw']->session->appsession('session_data'); + $this->userSessionData = $GLOBALS['egw']->session->appsession('user_session_data'); #while(list($key, $value) = each($this->userSessionData)) #{ @@ -309,10 +309,10 @@ function saveSessionData() { - global $phpgw; - $phpgw->session->appsession('session_data','',$this->sessionData); - $phpgw->session->appsession('user_session_data','',$this->userSessionData); + + $GLOBALS['egw']->session->appsession('session_data','',$this->sessionData); + $GLOBALS['egw']->session->appsession('user_session_data','',$this->userSessionData); } @@ -371,12 +371,12 @@ $this->soldapmgr->saveUserData( $_accountID, $this->userSessionData[$_accountID]); - $bofelamimail = CreateObject('felamimail.bofelamimail'); + $bofelamimail =& CreateObject('felamimail.bofelamimail'); $bofelamimail->openConnection('','',true); - $bofelamimail->imapSetQuota($GLOBALS['phpgw']->accounts->id2name($_accountID), - $this->userSessionData[$_accountID]['quotaLimit']); + $bofelamimail->imapSetQuota($GLOBALS['egw']->accounts->id2name($_accountID), + $this->userSessionData[$_accountID]['quotaLimit']); $bofelamimail->closeConnection(); - $GLOBALS['phpgw']->accounts->cache_invalidate($_accountID); + $GLOBALS['egw']->accounts->cache_invalidate($_accountID); break; diff --git a/admin/inc/class.bolog.inc.php b/admin/inc/class.bolog.inc.php index 3be8b7dc7b..5271920605 100755 --- a/admin/inc/class.bolog.inc.php +++ b/admin/inc/class.bolog.inc.php @@ -21,7 +21,7 @@ function bolog($session=False) { - $this->so = CreateObject('admin.solog'); + $this->so =& CreateObject('admin.solog'); } function get_error_cols() @@ -68,11 +68,11 @@ while(list($rno,$r)=each($rows)) { unset($r['acount_pwd']); // remove the accounts_pwd - $r['log_date_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_date']['value'])); - $r['log_msg_date_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_msg_date']['value'])); + $r['log_date_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['log_date']['value'])); + $r['log_msg_date_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['log_msg_date']['value'])); $r['log_full_name']['value'] = $r['account_lastname']['value'] . ', ' .$r['account_firstname']['value']; - $r['account_lastlogin_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastlogin']['value'])); - $r['account_lastpwd_change_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastpwd_change']['value'])); + $r['account_lastlogin_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['account_lastlogin']['value'])); + $r['account_lastpwd_change_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['account_lastpwd_change']['value'])); $r['account_lastloginfrom_e']['value'] = 'www.nowhere.com'; $r['log_msg_text']['value'] = lang($r['log_msg_msg']['value'],explode('|',$r['log_msg_parms']['value'])); diff --git a/admin/inc/class.boserver.inc.php b/admin/inc/class.boserver.inc.php index 8ea99aa1ba..074b38e2f1 100644 --- a/admin/inc/class.boserver.inc.php +++ b/admin/inc/class.boserver.inc.php @@ -1,16 +1,16 @@ * - * -------------------------------------------- * - * 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. * - \**************************************************************************/ + /**************************************************************************\ + * eGroupWare - Admin * + * http://www.egroupware.org * + * Written by Miles Lott * + * -------------------------------------------- * + * 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$ */ + /* $Id$ */ class boserver { @@ -38,7 +38,7 @@ function boserver($session=False) { - $this->so = CreateObject('admin.soserver'); + $this->so =& CreateObject('admin.soserver'); if($session) { @@ -72,13 +72,13 @@ if ($this->use_session) { if($this->debug) { echo '
Save:'; _debug_array($data); } - $GLOBALS['phpgw']->session->appsession('session_data','admin_servers',$data); + $GLOBALS['egw']->session->appsession('session_data','admin_servers',$data); } } function read_sessiondata() { - $data = $GLOBALS['phpgw']->session->appsession('session_data','admin_servers'); + $data = $GLOBALS['egw']->session->appsession('session_data','admin_servers'); if($this->debug) { echo '
Read:'; _debug_array($data); } $this->start = $data['start']; diff --git a/admin/inc/class.html_tables.inc.php b/admin/inc/class.html_tables.inc.php index 771aeb34fd..36bed4f452 100644 --- a/admin/inc/class.html_tables.inc.php +++ b/admin/inc/class.html_tables.inc.php @@ -30,20 +30,20 @@ else { #$html .= '
' . "\n"; - $bo = CreateObject('admin.bolog',True); + $bo =& CreateObject('admin.bolog',True); if(!isset($start)) { $start = 0; } - $num_rows = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; + $num_rows = $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs']; $stop = $start + $num_rows; if($stop > count($rows)) { $stop = count($rows); } - $nextmatchs = CreateObject('phpgwapi.nextmatchs'); + $nextmatchs =& CreateObject('phpgwapi.nextmatchs'); $total_records = $bo->get_no_errors(); $left = $nextmatchs->left('/index.php',$start,$total_records,'menuaction=admin.uilog.list_log'); $right = $nextmatchs->right('/index.php',$start,$total_records,'menuaction=admin.uilog.list_log'); @@ -52,7 +52,7 @@ $html .= ''; $html .= $left; $html .= ''; - $html .= ''; + $html .= ''; $html .= $right; $html .= '
' . $hits . ' link('/index.php','menuaction=admin.uilog.list_log&editable=true') .'> ' . lang('Edit Table format') . ' link('/index.php','menuaction=admin.uilog.list_log&editable=true') .'> ' . lang('Edit Table format') . '
'; } @@ -251,7 +251,7 @@ $html = ''; $html .= '' . "\n"; $params = $head['_table_parms']; diff --git a/admin/inc/class.soaccess_history.inc.php b/admin/inc/class.soaccess_history.inc.php index a43714f15c..7a650c5e2a 100644 --- a/admin/inc/class.soaccess_history.inc.php +++ b/admin/inc/class.soaccess_history.inc.php @@ -17,7 +17,7 @@ function soaccess_history() { - $this->db = $GLOBALS['phpgw']->db; + $this->db = clone($GLOBALS['egw']->db); } function test_account_id($account_id) diff --git a/admin/inc/class.soaccounts.inc.php b/admin/inc/class.soaccounts.inc.php index 639323a02d..121fab15d3 100755 --- a/admin/inc/class.soaccounts.inc.php +++ b/admin/inc/class.soaccounts.inc.php @@ -27,7 +27,7 @@ $userData['account_email'] = $userData['email']; } - $GLOBALS['phpgw']->db->lock( + $GLOBALS['egw']->db->lock( Array( 'phpgw_accounts', 'phpgw_nextid', @@ -40,11 +40,11 @@ ) ); - $GLOBALS['phpgw']->accounts->create($userData); + $GLOBALS['egw']->accounts->create($userData); - $userData['account_id'] = $GLOBALS['phpgw']->accounts->name2id($userData['account_lid']); + $userData['account_id'] = $GLOBALS['egw']->accounts->name2id($userData['account_lid']); - $apps = CreateObject('phpgwapi.applications',$userData['account_id']); + $apps =& CreateObject('phpgwapi.applications',$userData['account_id']); $apps->read_installed_apps(); // Read Group Apps if ($userData['account_groups']) @@ -89,7 +89,7 @@ if ($userData['changepassword']) { - $GLOBALS['phpgw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1); + $GLOBALS['egw']->acl->add_repository('preferences','changepassword',$userData['account_id'],1); } // Assign user to groups if ($userData['account_groups']) @@ -97,14 +97,14 @@ $c_acct_groups = count($userData['account_groups']); for ($i=0;$i<$c_acct_groups;$i++) { - $GLOBALS['phpgw']->acl->add_repository('phpgw_group',$userData['account_groups'][$i],$userData['account_id'],1); + $GLOBALS['egw']->acl->add_repository('phpgw_group',$userData['account_groups'][$i],$userData['account_id'],1); } } $apps->account_apps = array(array()); $apps_after = array(array()); - $GLOBALS['phpgw']->db->unlock(); + $GLOBALS['egw']->db->unlock(); return $userData['account_id']; } diff --git a/admin/inc/class.soapplications.inc.php b/admin/inc/class.soapplications.inc.php index 603e4d93b6..8b0e6f220f 100644 --- a/admin/inc/class.soapplications.inc.php +++ b/admin/inc/class.soapplications.inc.php @@ -1,15 +1,15 @@ db = $GLOBALS['phpgw']->db; + $this->db = clone($GLOBALS['egw']->db); } function read($app_name) @@ -28,7 +28,7 @@ $this->db->next_record(); $app_info = array( $this->db->f('app_name'), - $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')]['title'], + $GLOBALS['egw_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()) { $app = $this->db->f('app_name'); - $title = @$GLOBALS['phpgw_info']['apps'][$app]['title']; + $title = @$GLOBALS['egw_info']['apps'][$app]['title']; if (empty($title)) { $title = lang($app) == $app.'*' ? $app : lang($app); @@ -62,7 +62,7 @@ function add($data) { /* Yes, the sequence should work, but after a mass import in setup (new install) - it does not work on pg + it does not work on pg */ $sql = 'SELECT MAX(app_id) from phpgw_applications'; $this->db->query($sql,__LINE__,__FILE__); diff --git a/admin/inc/class.soldap_mgr.inc.php b/admin/inc/class.soldap_mgr.inc.php index a586216191..4c91e8ca36 100644 --- a/admin/inc/class.soldap_mgr.inc.php +++ b/admin/inc/class.soldap_mgr.inc.php @@ -15,8 +15,8 @@ { function soldap_mgr() { - $this->db = $GLOBALS['phpgw']->db; - include(PHPGW_INCLUDE_ROOT.'/emailadmin/setup/tables_current.inc.php'); + $this->db = clone($GLOBALS['egw']->db); + include(EGW_INCLUDE_ROOT.'/emailadmin/setup/tables_current.inc.php'); $this->tables = &$phpgw_baseline; unset($phpgw_baseline); $this->table = &$this->tables['phpgw_emailadmin']; @@ -27,10 +27,10 @@ { global $phpgw, $phpgw_info; - $ldap = $phpgw->common->ldapConnect(); + $ldap = $GLOBALS['egw']->common->ldapConnect(); $filter = "(&(uidnumber=$_accountID))"; - $sri = @ldap_search($ldap,$phpgw_info['server']['ldap_context'],$filter); + $sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],$filter); if ($sri) { $allValues = ldap_get_entries($ldap, $sri); @@ -57,7 +57,7 @@ function saveUserData($_accountID, $_accountData) { - $ldap = $GLOBALS['phpgw']->common->ldapConnect(); + $ldap = $GLOBALS['egw']->common->ldapConnect(); // need to be fixed if(is_numeric($_accountID)) { @@ -68,7 +68,7 @@ $filter = "uid=$_accountID"; } - $sri = @ldap_search($ldap,$GLOBALS['phpgw_info']['server']['ldap_context'],$filter); + $sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],$filter); if ($sri) { $allValues = ldap_get_entries($ldap, $sri); @@ -158,7 +158,7 @@ // also update the account_email field in phpgw_accounts // when using sql account storage - if($GLOBALS['phpgw_info']['server']['account_repository'] == 'sql') + if($GLOBALS['egw_info']['server']['account_repository'] == 'sql') { $this->db->update('phpgw_accounts',array( 'account_email' => $_accountData["mail"] diff --git a/admin/inc/class.solog.inc.php b/admin/inc/class.solog.inc.php index d1202c97e2..45a4849ad5 100755 --- a/admin/inc/class.solog.inc.php +++ b/admin/inc/class.solog.inc.php @@ -29,7 +29,7 @@ function solog() { - $this->db = $GLOBALS['phpgw']->db; + $this->db = clone($GLOBALS['egw']->db); } function get_error_cols() diff --git a/admin/inc/class.soserver.inc.php b/admin/inc/class.soserver.inc.php index bfc390df30..dd8838373e 100644 --- a/admin/inc/class.soserver.inc.php +++ b/admin/inc/class.soserver.inc.php @@ -1,16 +1,16 @@ * - * -------------------------------------------- * - * 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. * - \**************************************************************************/ + /**************************************************************************\ + * eGroupWare - Admin - Peer Servers * + * http://www.egroupware.org * + * 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$ */ + /* $Id$ */ class soserver { @@ -19,7 +19,7 @@ function soserver() { - $this->is = CreateObject('phpgwapi.interserver'); + $this->is =& CreateObject('phpgwapi.interserver'); } function list_servers($data='',&$total) diff --git a/admin/inc/class.uiaccess_history.inc.php b/admin/inc/class.uiaccess_history.inc.php index 125fe68429..e88a21a267 100644 --- a/admin/inc/class.uiaccess_history.inc.php +++ b/admin/inc/class.uiaccess_history.inc.php @@ -20,14 +20,14 @@ function uiaccess_history() { - if ($GLOBALS['phpgw']->acl->check('access_log_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('access_log_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - $this->bo = createobject('admin.boaccess_history'); - $this->nextmatchs = createobject('phpgwapi.nextmatchs'); - $this->template = $GLOBALS['phpgw']->template; + $this->bo =& CreateObject('admin.boaccess_history'); + $this->nextmatchs =& CreateObject('phpgwapi.nextmatchs'); + $this->template = $GLOBALS['egw']->template; $this->template->set_file( Array( 'accesslog' => 'accesslog.tpl' @@ -45,19 +45,19 @@ $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'); - if(!@is_object($GLOBALS['phpgw']->js)) + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View access log'); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); $total_records = $this->bo->total($account_id); $var = Array( - 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], + 'th_bg' => $GLOBALS['egw_info']['theme']['th_bg'], 'nextmatchs_left' => $this->nextmatchs->left('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'nextmatchs_right' => $this->nextmatchs->right('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'showing' => $this->nextmatchs->show_hits($total_records,$start), @@ -70,13 +70,13 @@ if ($account_id) { - $var['link_return_to_view_account'] = 'link('/index.php', Array( 'menuaction' => 'admin.uiaccounts.view', 'account_id' => $account_id ) ) . '">' . lang('Return to view account') . ''; - $var['lang_last_x_logins'] = lang('Last %1 logins for %2',$total_records,$GLOBALS['phpgw']->common->grab_owner_name($account_id)); + $var['lang_last_x_logins'] = lang('Last %1 logins for %2',$total_records,$GLOBALS['egw']->common->grab_owner_name($account_id)); } else { @@ -120,7 +120,7 @@ } $var = Array( - 'bg_color' => $GLOBALS['phpgw_info']['themes']['bg_color'], + 'bg_color' => $GLOBALS['egw_info']['themes']['bg_color'], 'footer_total' => lang('Total records') . ': ' . $total_records ); if ($account_id) @@ -133,7 +133,7 @@ } // create the menu on the left, if needed - $menuClass = CreateObject('admin.uimenuclass'); + $menuClass =& CreateObject('admin.uimenuclass'); $var['rows'] = $menuClass->createHTMLCode('view_account'); $this->template->set_var($var); diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index 2fb15be179..25e5202433 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -52,14 +52,14 @@ function uiaccounts() { - $this->bo = createobject('admin.boaccounts'); - $this->nextmatchs = createobject('phpgwapi.nextmatchs'); + $this->bo =& CreateObject('admin.boaccounts'); + $this->nextmatchs =& CreateObject('phpgwapi.nextmatchs'); @set_time_limit(300); } function row_action($action,$type,$account_id) { - return 'link('/index.php',Array( 'menuaction' => 'admin.uiaccounts.'.$action.'_'.$type, 'account_id' => $account_id )).'"> '.lang($action).' '; @@ -67,9 +67,9 @@ function list_groups() { - if ($GLOBALS['phpgw']->acl->check('group_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',1,'admin')) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); + $GLOBALS['egw']->redirect($GLOBALS['egw']->link('/admin/index.php')); } $GLOBALS['cd'] = ($_GET['cd']?$_GET['cd']:0); @@ -111,18 +111,18 @@ break; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['admin']['title'].' - '. + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['admin']['title'].' - '. lang('User groups'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->common->egw_header(); - $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $p->set_file( array( 'groups' => 'groups.tpl' @@ -132,15 +132,15 @@ $p->set_block('groups','row','row'); $p->set_block('groups','row_empty','row_empty'); - if (! $GLOBALS['phpgw']->acl->check('account_access',2,'admin')) + if (! $GLOBALS['egw']->acl->check('account_access',2,'admin')) { - $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $GLOBALS['query']); + $account_info = $GLOBALS['egw']->accounts->get_list('groups',$start,$sort, $order, $GLOBALS['query']); } else { - $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order); + $account_info = $GLOBALS['egw']->accounts->get_list('groups',$start,$sort, $order); } - $total = $GLOBALS['phpgw']->accounts->total; + $total = $GLOBALS['egw']->accounts->total; $var = Array( 'left_next_matchs' => $this->nextmatchs->left('/index.php',$start,$total,'menuaction=admin.uiaccounts.list_groups'), @@ -159,17 +159,17 @@ } else { - if (! $GLOBALS['phpgw']->acl->check('group_access',8,'admin')) + if (! $GLOBALS['egw']->acl->check('group_access',8,'admin')) { $can_view = True; } - if (! $GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + if (! $GLOBALS['egw']->acl->check('group_access',16,'admin')) { $can_edit = True; } - if (! $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) + if (! $GLOBALS['egw']->acl->check('group_access',32,'admin')) { $can_delete = True; } @@ -206,17 +206,17 @@ } } $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') + 'new_action' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.add_group'), + 'search_action' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups') ); $p->set_var($var); - if (! $GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + if (! $GLOBALS['egw']->acl->check('group_access',4,'admin')) { $p->set_var('input_add',''); } - if (! $GLOBALS['phpgw']->acl->check('group_access',2,'admin')) + if (! $GLOBALS['egw']->acl->check('group_access',2,'admin')) { $p->set_var('input_search',lang('Search') . ' '); } @@ -226,13 +226,13 @@ function list_users($param_cd='') { - if ($GLOBALS['phpgw']->acl->check('account_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('account_access',1,'admin')) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); + $GLOBALS['egw']->redirect($GLOBALS['egw']->link('/admin/index.php')); } - if (!is_object($GLOBALS['phpgw']->html)) + if (!is_object($GLOBALS['egw']->html)) { - $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html'); + $GLOBALS['egw']->html =& CreateObject('phpgwapi.html'); } if($param_cd) @@ -280,18 +280,18 @@ break; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['admin']['title'].' - '. + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['admin']['title'].' - '. lang('User accounts'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->common->egw_header(); - $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $p->set_file( Array( @@ -309,22 +309,22 @@ 'order' => $order, 'query_type' => $_REQUEST['query_type'], ); - if (!$GLOBALS['phpgw']->acl->check('account_access',2,'admin')) + if (!$GLOBALS['egw']->acl->check('account_access',2,'admin')) { $search_param['query'] = $GLOBALS['query']; } - $account_info = $GLOBALS['phpgw']->accounts->search($search_param); - $total = $GLOBALS['phpgw']->accounts->total; + $account_info = $GLOBALS['egw']->accounts->search($search_param); + $total = $GLOBALS['egw']->accounts->total; $link_data = array( 'menuaction' => 'admin.uiaccounts.list_users', 'group_id' => $_REQUEST['group_id'], 'query_type' => $_REQUEST['query_type'], ); - $uiaccountsel = CreateObject('phpgwapi.uiaccountsel'); + $uiaccountsel =& CreateObject('phpgwapi.uiaccountsel'); $p->set_var(array( 'left_next_matchs' => $this->nextmatchs->left('/index.php',$start,$total,$link_data), - 'lang_showing' => ($_REQUEST['group_id'] ? $GLOBALS['phpgw']->common->grab_owner_name($_REQUEST['group_id']).': ' : ''). + 'lang_showing' => ($_REQUEST['group_id'] ? $GLOBALS['egw']->common->grab_owner_name($_REQUEST['group_id']).': ' : ''). ($GLOBALS['query'] ? lang("Search %1 '%2'",lang($uiaccountsel->query_types[$_REQUEST['query_type']]),$GLOBALS['query']).': ' : '') .$this->nextmatchs->show_hits($total,$start), 'right_next_matchs' => $this->nextmatchs->right('/index.php',$start,$total,$link_data), @@ -342,10 +342,10 @@ 'sort' => $sort, ); $p->set_var(array( - 'query_type' => is_array($uiaccountsel->query_types) ? $GLOBALS['phpgw']->html->select('query_type',$_REQUEST['query_type'],$uiaccountsel->query_types) : '', + 'query_type' => is_array($uiaccountsel->query_types) ? $GLOBALS['egw']->html->select('query_type',$_REQUEST['query_type'],$uiaccountsel->query_types) : '', 'lang_group' => lang('group'), 'group' => $uiaccountsel->selection('group_id','admin_uiaccount_listusers_group_id',$_REQUEST['group_id'],'groups',0,False,'','this.form.submit();',lang('all')), - 'accounts_url' => $GLOBALS['phpgw']->link('/index.php',$link_data), + 'accounts_url' => $GLOBALS['egw']->link('/index.php',$link_data), )); $letters = lang('alphabet'); $letters = explode(',',substr($letters,-1) != '*' ? $letters : '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'); @@ -355,7 +355,7 @@ $link_data['query'] = $letter; $p->set_var(array( 'letter' => $letter, - 'link' => $GLOBALS['phpgw']->link('/index.php',$link_data), + 'link' => $GLOBALS['egw']->link('/index.php',$link_data), 'class' => $GLOBALS['query'] == $letter && $_REQUEST['query_type'] == 'start' ? 'letter_box_active' : 'letter_box', )); $p->fp('letter_search_cells','letter_search',True); @@ -364,14 +364,14 @@ unset($link_data['query_type']); $p->set_var(array( 'letter' => lang('all'), - 'link' => $GLOBALS['phpgw']->link('/index.php',$link_data), + 'link' => $GLOBALS['egw']->link('/index.php',$link_data), 'class' => $_REQUEST['query_type'] != 'start' || !in_array($GLOBALS['query'],$letters) ? 'letter_box_active' : 'letter_box', )); $p->fp('letter_search_cells','letter_search',True); - if (! $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) + if (! $GLOBALS['egw']->acl->check('account_access',4,'admin')) { - $p->set_var('new_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.add_user')); + $p->set_var('new_action',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.add_user')); $p->set_var('input_add',''); } @@ -382,17 +382,17 @@ } else { - if (! $GLOBALS['phpgw']->acl->check('account_access',8,'admin')) + if (! $GLOBALS['egw']->acl->check('account_access',8,'admin')) { $can_view = True; } - if (! $GLOBALS['phpgw']->acl->check('account_access',16,'admin')) + if (! $GLOBALS['egw']->acl->check('account_access',16,'admin')) { $can_edit = True; } - if (! $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) + if (! $GLOBALS['egw']->acl->check('account_access',32,'admin')) { $can_delete = True; } @@ -414,7 +414,7 @@ if ($can_delete) { - $p->set_var('row_delete',($GLOBALS['phpgw_info']['user']['userid'] != $account['account_lid']?$this->row_action('delete','user',$account['account_id']):' ')); + $p->set_var('row_delete',($GLOBALS['egw_info']['user']['userid'] != $account['account_lid']?$this->row_action('delete','user',$account['account_id']):' ')); } else { @@ -437,7 +437,7 @@ function add_group() { - if ($GLOBALS['phpgw']->acl->check('group_access',4,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',4,'admin')) { $this->list_groups(); return False; @@ -454,7 +454,7 @@ function add_user() { - if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) + if ($GLOBALS['egw']->acl->check('account_access',4,'admin')) { $this->list_users(); } @@ -466,7 +466,7 @@ 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['no'] || $_POST['yes'] || !@isset($_GET['account_id']) || !@$_GET['account_id'] || $GLOBALS['egw']->acl->check('group_access',32,'admin')) { if ($_POST['yes']) { @@ -476,16 +476,16 @@ return False; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); - $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $p->set_file( Array( 'body' => 'delete_common.tpl', @@ -497,11 +497,11 @@ $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((int)$_GET['account_id'],1,'phpgw_group'); + $old_group_list = $GLOBALS['egw']->acl->get_ids_for_location((int)$_GET['account_id'],1,'phpgw_group'); if($old_group_list) { - $group_name = $GLOBALS['phpgw']->accounts->id2name($_GET['account_id']); + $group_name = $GLOBALS['egw']->accounts->id2name($_GET['account_id']); $p->set_var('message_display','
'); $p->parse('messages','message_row',True); @@ -509,12 +509,12 @@ $user_list = ''; while (list(,$id) = each($old_group_list)) { - $user_list .= 'link('/index.php', Array( 'menuaction' => 'admin.uiaccounts.edit_user', 'account_id' => $id ) - ) . '">' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '
'; + ) . '">' . $GLOBALS['egw']->common->grab_owner_name($id) . '
'; } $p->set_var('message_display',$user_list); $p->parse('messages','message_row',True); @@ -525,7 +525,7 @@ } $var = Array( - 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group'), + 'form_action' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.delete_group'), 'hidden_vars' => '', 'yes' => lang('Yes'), 'no' => lang('No') @@ -536,7 +536,7 @@ $var = Array( 'submit_button' => lang('Submit'), - 'action_url_button' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), + 'action_url_button' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'), 'action_text_button' => ' '.lang('No'), 'action_confirm_button' => '', 'action_extra_field' => '' @@ -549,29 +549,29 @@ function delete_user() { - if ($GLOBALS['phpgw']->acl->check('account_access',32,'admin') || $GLOBALS['phpgw_info']['user']['account_id'] == $_GET['account_id']) + if ($GLOBALS['egw']->acl->check('account_access',32,'admin') || $GLOBALS['egw_info']['user']['account_id'] == $_GET['account_id']) { $this->list_users(); return False; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); - $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $t->set_file( Array( 'form' => 'delete_account.tpl' ) ); $var = Array( - 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.delete_user'), + 'form_action' => $GLOBALS['egw']->link('/index.php','menuaction=admin.boaccounts.delete_user'), 'account_id' => $_GET['account_id'] ); @@ -579,12 +579,12 @@ $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'); + $users = $GLOBALS['egw']->accounts->get_list('accounts'); $c_users = count($users); $str = ''; for($i=0;$i<$c_users;$i++) { - $str .= ''."\n"; + $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"; @@ -600,7 +600,7 @@ function edit_group_hook() // (regis) why only for users, it works with groups as well so I add it { 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['egw']->acl->check('account_access',64,'admin')) // no rights to set ACL-rights { $GLOBALS['menuData'][] = array( 'description' => 'ACL Rights', @@ -614,7 +614,7 @@ function edit_group($cd='',$account_id='') { - if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',16,'admin')) { $this->list_groups(); return False; @@ -638,7 +638,7 @@ { $group_info = Array( 'account_id' => (int)$_GET['account_id'], - 'account_name' => $GLOBALS['phpgw']->accounts->id2name($_GET['account_id']), + 'account_name' => $GLOBALS['egw']->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']) ); @@ -649,7 +649,7 @@ function edit_view_user_hook() { - if (!$GLOBALS['phpgw']->acl->check('current_sessions_access',1,'admin')) // no rights to view + if (!$GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) // no rights to view { $GLOBALS['menuData'][] = array( 'description' => 'Login History', @@ -659,7 +659,7 @@ } // 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['egw']->acl->check('account_access',64,'admin')) // no rights to set ACL-rights { $GLOBALS['menuData'][] = array( 'description' => 'ACL Rights', @@ -672,7 +672,7 @@ // added for different way of handling ldap entries inside account manager // we show this only, if accounts are stored in ldap - if ($GLOBALS['phpgw_info']['server']['account_repository'] == "ldap") + if ($GLOBALS['egw_info']['server']['account_repository'] == "ldap") { $GLOBALS['menuData'][] = array( 'description' => 'LDAP-MGR', @@ -687,7 +687,7 @@ function edit_user($cd='',$account_id='') { - if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('account_access',16,'admin')) { $this->list_users(); return False; @@ -716,21 +716,21 @@ function view_user() { - if ($GLOBALS['phpgw']->acl->check('account_access',8,'admin') || ! $_GET['account_id']) + if ($GLOBALS['egw']->acl->check('account_access',8,'admin') || ! $_GET['account_id']) { $this->list_users(); return False; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); - $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $t->set_unknowns('remove'); $t->set_file( Array( @@ -742,8 +742,8 @@ $t->set_block('account','link_row'); $var = Array( - 'tr_color1' => $GLOBALS['phpgw_info']['theme']['row_on'], - 'tr_color2' => $GLOBALS['phpgw_info']['theme']['row_off'], + 'tr_color1' => $GLOBALS['egw_info']['theme']['row_on'], + 'tr_color2' => $GLOBALS['egw_info']['theme']['row_off'], 'lang_action' => lang('View user account'), 'lang_loginid' => lang('LoginID'), 'lang_account_active' => lang('Account active'), @@ -759,14 +759,14 @@ $t->parse('password_fields','form_logininfo',True); - $account = CreateObject('phpgwapi.accounts',(int)$_GET['account_id'],'u'); + $account =& CreateObject('phpgwapi.accounts',(int)$_GET['account_id'],'u'); $userData = $account->read_repository(); $var['account_lid'] = $userData['account_lid']; $var['account_firstname'] = $userData['firstname']; $var['account_lastname'] = $userData['lastname']; - $acl = CreateObject('phpgwapi.acl',(int)$_GET['account_id']); + $acl =& CreateObject('phpgwapi.acl',(int)$_GET['account_id']); $var['anonymous'] = $acl->check('anonymous',1,'phpgwapi') ? '  X' : ' '; $var['changepassword'] = $acl->check('changepassword',0xFFFF,'preferences') ? '  X' : ' '; unset($acl); @@ -783,7 +783,7 @@ // Last login time if ($userData['lastlogin']) { - $var['account_lastlogin'] = $GLOBALS['phpgw']->common->show_date($userData['lastlogin']); + $var['account_lastlogin'] = $GLOBALS['egw']->common->show_date($userData['lastlogin']); } else { @@ -803,7 +803,7 @@ // Account expires if ($userData['expires'] != -1) { - $var['input_expires'] = $GLOBALS['phpgw']->common->show_date($userData['expires']); + $var['input_expires'] = $GLOBALS['egw']->common->show_date($userData['expires']); } else { @@ -832,7 +832,7 @@ // create list of available app $i = 0; - $availableApps = $GLOBALS['phpgw_info']['apps']; + $availableApps = $GLOBALS['egw_info']['apps']; @asort($availableApps); @reset($availableApps); foreach($availableApps as $app => $data) @@ -846,7 +846,7 @@ } // create apps output - $apps = CreateObject('phpgwapi.applications',(int)$_GET['account_id']); + $apps =& CreateObject('phpgwapi.applications',(int)$_GET['account_id']); $db_perms = $apps->read_account_specific(); @reset($db_perms); @@ -869,13 +869,13 @@ $part2 = ' '; } - $appRightsOutput .= sprintf("$part1$part2\n",$GLOBALS['phpgw_info']['theme']['row_on']); + $appRightsOutput .= sprintf("$part1$part2\n",$GLOBALS['egw_info']['theme']['row_on']); } $var['permissions_list'] = $appRightsOutput; // create the menu on the left, if needed -// $menuClass = CreateObject('admin.uimenuclass'); +// $menuClass =& CreateObject('admin.uimenuclass'); // This is now using ExecMethod() $var['rows'] = ExecMethod('admin.uimenuclass.createHTMLCode','view_user'); $t->set_var($var); @@ -884,7 +884,7 @@ function group_manager($cd='',$account_id='') { - if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',16,'admin')) { $this->list_groups(); return False; @@ -908,8 +908,8 @@ { $group_info = Array( 'account_id' => (int)$_GET['account_id'], - 'account_name' => $GLOBALS['phpgw']->accounts->id2name($_GET['account_id']), - 'account_user' => $GLOBALS['phpgw']->accounts->member($_GET['account_id']), + 'account_name' => $GLOBALS['egw']->accounts->id2name($_GET['account_id']), + 'account_user' => $GLOBALS['egw']->accounts->member($_GET['account_id']), 'account_managers' => $this->bo->load_group_managers($_GET['account_id']) ); @@ -919,37 +919,37 @@ function create_edit_group($group_info,$_errors='') { - $sbox = createobject('phpgwapi.sbox'); + $sbox =& CreateObject('phpgwapi.sbox'); - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); - $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $p =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $p->set_file(Array('edit' => 'group_form.tpl')); $p->set_block('edit','select'); $p->set_block('edit','popwin'); //fix from Maanus 280105 - $accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); + $accounts =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'g'); - if (!is_object($GLOBALS['phpgw']->uiaccountsel)) + if (!is_object($GLOBALS['egw']->uiaccountsel)) { - $GLOBALS['phpgw']->uiaccountsel = CreateObject('phpgwapi.uiaccountsel'); + $GLOBALS['egw']->uiaccountsel =& CreateObject('phpgwapi.uiaccountsel'); } - $p->set_var('accounts',$GLOBALS['phpgw']->uiaccountsel->selection('account_user[]','admin_uiaccounts_user',$group_info['account_user'],'accounts',min(3+count($group_info['account_user']),10))); + $p->set_var('accounts',$GLOBALS['egw']->uiaccountsel->selection('account_user[]','admin_uiaccounts_user',$group_info['account_user'],'accounts',min(3+count($group_info['account_user']),10))); $var = Array( - 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.'.($group_info['account_id']?'edit':'add').'_group'), + 'form_action' => $GLOBALS['egw']->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).'
'), + 'error' => (!$_errors?'':'
'.$GLOBALS['egw']->common->error_list($_errors).'
'), 'lang_permissions' => lang('Permissions this group has') ); $p->set_var($var); @@ -957,7 +957,7 @@ $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']; + $group_repository['file_space'] = $GLOBALS['egw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['egw_info']['server']['vfs_default_account_size_type']; } /* $file_space_array = explode ('-', $group_repository['file_space']); @@ -971,8 +971,8 @@ $p->set_var ('account_file_space_select',''."\n"); */ - reset($GLOBALS['phpgw_info']['apps']); - $sorted_apps = $GLOBALS['phpgw_info']['apps']; + reset($GLOBALS['egw_info']['apps']); + $sorted_apps = $GLOBALS['egw_info']['apps']; @asort($sorted_apps); @reset($sorted_apps); while ($permission = each($sorted_apps)) @@ -990,7 +990,7 @@ $perm_html = ''. $perm_html.$perm_html."\n"; - $tr_color = $GLOBALS['phpgw_info']['theme']['row_off']; + $tr_color = $GLOBALS['egw_info']['theme']['row_off']; for ($i=0;$i < count($perm_display);$i++) { $app = $perm_display[$i][0]; @@ -1002,8 +1002,8 @@ $perm_html .= '' . $perm_display[$i][1] . '' . ' ' - . ($this->apps_with_acl[$app] && $group_info['account_id']?'link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$group_info['account_id']) + . '">':' ').''.($i & 1?'':'')."\n"; } if($i & 1) @@ -1028,23 +1028,23 @@ function create_edit_user($_account_id,$_userData='',$_errors='') { - $sbox = createobject('phpgwapi.sbox'); - $jscal = CreateObject('phpgwapi.jscalendar'); + $sbox =& CreateObject('phpgwapi.sbox'); + $jscal =& CreateObject('phpgwapi.jscalendar'); - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->common->egw_header(); - $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $t->set_unknowns('remove'); - if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes'] && ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')) + if ($GLOBALS['egw_info']['server']['ldap_extra_attributes'] && ($GLOBALS['egw_info']['server']['account_repository'] == 'ldap')) { $t->set_file(array('account' => 'account_form_ldap.tpl')); } @@ -1057,8 +1057,8 @@ $t->set_block('account','form_buttons_','form_buttons_'); $t->set_block('account','link_row','link_row'); - $theme = $GLOBALS['phpgw_info']['user']['preferences']['common']['theme']; - $t->set_var('icon_create_edit', ''); + $theme = $GLOBALS['egw_info']['user']['preferences']['common']['theme']; + $t->set_var('icon_create_edit', ''); print_debug('Type : '.gettype($_userData).'
_userData(size) = "'.$_userData.'"('.strlen($_userData).')'); if (is_array($_userData)) @@ -1073,17 +1073,17 @@ $userGroups[$key]['account_id'] = $value; } - $account = CreateObject('phpgwapi.accounts'); + $account =& CreateObject('phpgwapi.accounts'); $allGroups = $account->get_list('groups'); } elseif(is_string($_userData) && $_userData=='') { if($_account_id) { - $account = CreateObject('phpgwapi.accounts',(int)$_account_id,'u'); + $account =& CreateObject('phpgwapi.accounts',(int)$_account_id,'u'); $userData = $account->read_repository(); $userGroups = $account->membership($_account_id); - $acl = CreateObject('phpgwapi.acl',$_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'); @@ -1091,7 +1091,7 @@ } else { - $account = CreateObject('phpgwapi.accounts'); + $account =& CreateObject('phpgwapi.accounts'); $userData = Array(); $userData['status'] = 'A'; $userGroups = Array(); @@ -1108,11 +1108,11 @@ } $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'], + 'form_action' => $GLOBALS['egw']->link('/index.php',$page_params), + 'error_messages' => (!$_errors?'':'
'.$GLOBALS['egw']->common->error_list($_errors).'
'), + 'th_bg' => $GLOBALS['egw_info']['theme']['th_bg'], + 'tr_color1' => $GLOBALS['egw_info']['theme']['row_on'], + 'tr_color2' => $GLOBALS['egw_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'), @@ -1132,12 +1132,12 @@ $t->set_var($var); $t->parse('form_buttons','form_buttons_',True); - if ($GLOBALS['phpgw_info']['server']['ldap_extra_attributes']) { + if ($GLOBALS['egw_info']['server']['ldap_extra_attributes']) { $lang_homedir = lang('home directory'); $lang_shell = lang('login shell'); - $homedirectory = ''; + $homedirectory = ''; $loginshell = ''; } else @@ -1151,7 +1151,7 @@ /* 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']; + $userData['file_space'] = $GLOBALS['egw_info']['server']['vfs_default_account_size_number'] . "-" . $GLOBALS['egw_info']['server']['vfs_default_account_size_type']; } $file_space_array = explode ('-', $userData['file_space']); $account_file_space_number = $file_space_array[0]; @@ -1175,9 +1175,9 @@ $t->set_var($var); */ $accountPrefix = ''; - if(isset($GLOBALS['phpgw_info']['server']['account_prefix'])) + if(isset($GLOBALS['egw_info']['server']['account_prefix'])) { - $accountPrefix = $GLOBALS['phpgw_info']['server']['account_prefix']; + $accountPrefix = $GLOBALS['egw_info']['server']['account_prefix']; if (preg_match ("/^$accountPrefix(.*)/i", $userData['account_lid'], $matches)) { $userData['account_lid'] = $matches[1]; @@ -1253,10 +1253,10 @@ } /* create list of available apps */ - $apps = CreateObject('phpgwapi.applications',$_account_id); + $apps =& CreateObject('phpgwapi.applications',$_account_id); $db_perms = $apps->read_account_specific(); - $availableApps = $GLOBALS['phpgw_info']['apps']; + $availableApps = $GLOBALS['egw_info']['apps']; uasort($availableApps,create_function('$a,$b','return strcasecmp($a["title"],$b["title"]);')); $appRightsOutput = ''; @@ -1270,8 +1270,8 @@ $checked = (@$userData['account_permissions'][$app] || @$db_perms[$app]) && $_account_id ? ' checked="1"' : ''; $part[$i&1] = sprintf('%s', $data['title'],$app,$checked). - ($this->apps_with_acl[$app] && $_account_id?'link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$_account_id) + . '">':' ').''; if ($i & 1) @@ -1295,7 +1295,7 @@ name="account_primary_group">'."\n".$primary_group_select.''."\n", 'permissions_list' - => $appRightsOutput, + => $appRightsOutput, 'lang_app' => lang('application'), 'lang_acl' => lang('enabled').' / '.lang('ACL'), ); @@ -1316,7 +1316,7 @@ $t->set_var($var); // create the menu on the left, if needed -// $menuClass = CreateObject('admin.uimenuclass'); +// $menuClass =& CreateObject('admin.uimenuclass'); // This is now using ExecMethod() $GLOBALS['account_id'] = $_account_id; $t->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','edit_user')); @@ -1326,33 +1326,33 @@ function edit_group_managers($group_info,$_errors='') { - if ($GLOBALS['phpgw']->acl->check('group_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('group_access',16,'admin')) { $this->list_groups(); return False; } - $accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'u'); + $accounts =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'u'); $account_list = $accounts->member($group_info['account_id']); $user_list = ''; while (list($key,$entry) = each($account_list)) { $user_list .= ''."\n"; } - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - if(!@is_object($GLOBALS['phpgw']->js)) + unset($GLOBALS['egw_info']['flags']['noheader']); + unset($GLOBALS['egw_info']['flags']['nonavbar']); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); - $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t =& CreateObject('phpgwapi.Template',EGW_APP_TPL); $t->set_unknowns('remove'); $t->set_file( @@ -1364,11 +1364,11 @@ $t->set_block('manager','form','form'); $t->set_block('manager','link_row','link_row'); - $var['th_bg'] = $GLOBALS['phpgw_info']['user']['theme']['th_bg']; + $var['th_bg'] = $GLOBALS['egw_info']['user']['theme']['th_bg']; $var['lang_group'] = lang('Group'); $var['group_name'] = $group_info['account_name']; - $var['tr_color1'] = $GLOBALS['phpgw_info']['user']['theme']['row_on']; - $var['form_action'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.set_group_managers'); + $var['tr_color1'] = $GLOBALS['egw_info']['user']['theme']['row_on']; + $var['form_action'] = $GLOBALS['egw']->link('/index.php','menuaction=admin.boaccounts.set_group_managers'); $var['hidden'] = ''; $var['lang_select_managers'] = lang('Select Group Managers'); $var['group_members'] = ''; diff --git a/admin/inc/class.uiaclmanager.inc.php b/admin/inc/class.uiaclmanager.inc.php index 887ea88615..61f92076a4 100644 --- a/admin/inc/class.uiaclmanager.inc.php +++ b/admin/inc/class.uiaclmanager.inc.php @@ -24,18 +24,18 @@ function uiaclmanager() { $this->account_id = (int)$_GET['account_id']; - if (!$this->account_id || $GLOBALS['phpgw']->acl->check('account_access',64,'admin')) + if (!$this->account_id || $GLOBALS['egw']->acl->check('account_access',64,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - $this->template = createobject('phpgwapi.Template',PHPGW_APP_TPL); + $this->template =& CreateObject('phpgwapi.Template',EGW_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(); + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('ACL Manager') . + ': ' . $GLOBALS['egw']->common->grab_owner_name($this->account_id); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); } @@ -43,7 +43,7 @@ { $this->common_header(); - $GLOBALS['phpgw']->hooks->process('acl_manager',array('preferences')); + $GLOBALS['egw']->hooks->process('acl_manager',array('preferences')); $this->template->set_file(array( 'app_list' => 'acl_applist.tpl' @@ -58,10 +58,10 @@ { foreach($GLOBALS['acl_manager'] as $app => $locations) { - $icon = $GLOBALS['phpgw']->common->image($app,array('navbar.png',$app.'png','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',$GLOBALS['phpgw_info']['apps'][$app]['title']); + $icon = $GLOBALS['egw']->common->image($app,array('navbar.png',$app.'png','navbar.gif',$app.'.gif')); + $this->template->set_var('icon_backcolor',$GLOBALS['egw_info']['theme']['row_off']); + $this->template->set_var('link_backcolor',$GLOBALS['egw_info']['theme']['row_off']); + $this->template->set_var('app_name',$GLOBALS['egw_info']['apps'][$app]['title']); $this->template->set_var('a_name',$appname); $this->template->set_var('app_icon',$icon); @@ -85,7 +85,7 @@ 'account_id' => $this->account_id ); - $this->template->set_var('link_location',$GLOBALS['phpgw']->link('/index.php',$link_values)); + $this->template->set_var('link_location',$GLOBALS['egw']->link('/index.php',$link_values)); $this->template->set_var('lang_location',lang($value['name'])); $this->template->fp('rows','link_row',True); } @@ -95,7 +95,7 @@ } } $this->template->set_var(array( - 'cancel_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), + 'cancel_action' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_users'), 'lang_cancel' => lang('Cancel') )); $this->template->pfp('out','list'); @@ -119,27 +119,27 @@ } if ($total_rights) { - $GLOBALS['phpgw']->acl->add_repository($_GET['acl_app'], $location, $this->account_id, $total_rights); + $GLOBALS['egw']->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); + $GLOBALS['egw']->acl->delete_repository($_GET['acl_app'], $location, $this->account_id); } } $this->list_apps(); return; } - $GLOBALS['phpgw']->hooks->single('acl_manager',$_GET['acl_app']); + $GLOBALS['egw']->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',$this->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']); + $afn = $GLOBALS['egw']->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',lang($acl_manager['name']),$GLOBALS['phpgw_info']['apps'][$_GET['acl_app']]['title'],$afn)); + $this->template->set_var('lang_message',lang('Check items to %1 to %2 for %3',lang($acl_manager['name']),$GLOBALS['egw_info']['apps'][$_GET['acl_app']]['title'],$afn)); $link_values = array( 'menuaction' => 'admin.uiaclmanager.access_form', 'acl_app' => $_GET['acl_app'], @@ -147,11 +147,11 @@ 'account_id' => $this->account_id ); - $acl = createobject('phpgwapi.acl',$this->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('form_action',$GLOBALS['egw']->link('/index.php',$link_values)); $total = 0; foreach($acl_manager['rights'] as $name => $value) diff --git a/admin/inc/class.uiapplications.inc.php b/admin/inc/class.uiapplications.inc.php index c29d6d5e2e..45df5cd204 100644 --- a/admin/inc/class.uiapplications.inc.php +++ b/admin/inc/class.uiapplications.inc.php @@ -1,15 +1,15 @@ bo = CreateObject('admin.boapplications'); - $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); + $this->bo =& CreateObject('admin.boapplications'); + $this->nextmatchs =& CreateObject('phpgwapi.nextmatchs'); } function get_list() { - if ($GLOBALS['phpgw']->acl->check('applications_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('applications_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - $can_add = !$GLOBALS['phpgw']->acl->check('applications_access',2,'admin'); - $can_edit = !$GLOBALS['phpgw']->acl->check('applications_access',4,'admin'); - $can_delete = !$GLOBALS['phpgw']->acl->check('applications_access',8,'admin'); + $can_add = !$GLOBALS['egw']->acl->check('applications_access',2,'admin'); + $can_edit = !$GLOBALS['egw']->acl->check('applications_access',4,'admin'); + $can_delete = !$GLOBALS['egw']->acl->check('applications_access',8,'admin'); - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Installed applications'); - if(!@is_object($GLOBALS['phpgw']->js)) + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Installed applications'); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); - $GLOBALS['phpgw']->template->set_file(array('applications' => 'applications.tpl')); - $GLOBALS['phpgw']->template->set_block('applications','list','list'); - $GLOBALS['phpgw']->template->set_block('applications','row','row'); - $GLOBALS['phpgw']->template->set_block('applications','add','add'); + $GLOBALS['egw']->template->set_file(array('applications' => 'applications.tpl')); + $GLOBALS['egw']->template->set_block('applications','list','list'); + $GLOBALS['egw']->template->set_block('applications','row','row'); + $GLOBALS['egw']->template->set_block('applications','add','add'); $start = get_var('start',array('POST','GET')); $sort = $_GET['sort']; $order = $_GET['order']; - $offset = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; + $offset = $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs']; $apps = $this->bo->get_list(); $total = count($apps); @@ -100,31 +100,31 @@ $i++; } - $GLOBALS['phpgw']->template->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['bg_color']); - $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); + $GLOBALS['egw']->template->set_var('bg_color',$GLOBALS['egw_info']['theme']['bg_color']); + $GLOBALS['egw']->template->set_var('th_bg',$GLOBALS['egw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($sort,'title','title','/index.php',lang('Title'),'&menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($total,$start)); - $GLOBALS['phpgw']->template->set_var('left',$this->nextmatchs->left('/index.php',$start,$total,'menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->template->set_var('right',$this->nextmatchs->right('index.php',$start,$total,'menuaction=admin.uiapplications.get_list')); + $GLOBALS['egw']->template->set_var('sort_title',$this->nextmatchs->show_sort_order($sort,'title','title','/index.php',lang('Title'),'&menuaction=admin.uiapplications.get_list')); + $GLOBALS['egw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($total,$start)); + $GLOBALS['egw']->template->set_var('left',$this->nextmatchs->left('/index.php',$start,$total,'menuaction=admin.uiapplications.get_list')); + $GLOBALS['egw']->template->set_var('right',$this->nextmatchs->right('index.php',$start,$total,'menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit')); - $GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete')); - $GLOBALS['phpgw']->template->set_var('lang_enabled',lang('Enabled')); + $GLOBALS['egw']->template->set_var('lang_edit',lang('Edit')); + $GLOBALS['egw']->template->set_var('lang_delete',lang('Delete')); + $GLOBALS['egw']->template->set_var('lang_enabled',lang('Enabled')); - $GLOBALS['phpgw']->template->set_var('new_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.add')); - $GLOBALS['phpgw']->template->set_var('lang_note',lang('(To install new applications use
Setup [Manage Applications] !!!)')); - $GLOBALS['phpgw']->template->set_var('lang_add',lang('add')); + $GLOBALS['egw']->template->set_var('new_action',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiapplications.add')); + $GLOBALS['egw']->template->set_var('lang_note',lang('(To install new applications use
Setup [Manage Applications] !!!)')); + $GLOBALS['egw']->template->set_var('lang_add',lang('add')); foreach($applications as $app) { $tr_color = $this->nextmatchs->alternate_row_color($tr_color); - $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $GLOBALS['phpgw']->template->set_var('name',$app['title']); + $GLOBALS['egw']->template->set_var('tr_color',$tr_color); + $GLOBALS['egw']->template->set_var('name',$app['title']); - $GLOBALS['phpgw']->template->set_var('edit',$can_edit ? ' ' . lang('Edit') . ' ' : ' '); - $GLOBALS['phpgw']->template->set_var('delete',$can_delete ? ' ' . lang('Delete') . ' ' : ' '); + $GLOBALS['egw']->template->set_var('edit',$can_edit ? ' ' . lang('Edit') . ' ' : ' '); + $GLOBALS['egw']->template->set_var('delete',$can_delete ? ' ' . lang('Delete') . ' ' : ' '); if ($app['status']) { @@ -134,47 +134,47 @@ { $status = '' . lang('No') . ''; } - $GLOBALS['phpgw']->template->set_var('status',$status); + $GLOBALS['egw']->template->set_var('status',$status); - $GLOBALS['phpgw']->template->parse('rows','row',True); + $GLOBALS['egw']->template->parse('rows','row',True); } if ($can_add) { - $GLOBALS['phpgw']->template->parse('addbutton','add'); + $GLOBALS['egw']->template->parse('addbutton','add'); } else { - $GLOBALS['phpgw']->template->set_var('addbutton',''); + $GLOBALS['egw']->template->set_var('addbutton',''); } - $GLOBALS['phpgw']->template->pparse('out','list'); + $GLOBALS['egw']->template->pparse('out','list'); } function display_row($label, $value) { - $GLOBALS['phpgw']->template->set_var('tr_color',$this->nextmatchs->alternate_row_color()); - $GLOBALS['phpgw']->template->set_var('label',$label); - $GLOBALS['phpgw']->template->set_var('value',$value); - $GLOBALS['phpgw']->template->parse('rows','row',True); + $GLOBALS['egw']->template->set_var('tr_color',$this->nextmatchs->alternate_row_color()); + $GLOBALS['egw']->template->set_var('label',$label); + $GLOBALS['egw']->template->set_var('value',$value); + $GLOBALS['egw']->template->parse('rows','row',True); } function add() { - if ($GLOBALS['phpgw']->acl->check('applications_access',2,'admin')) + if ($GLOBALS['egw']->acl->check('applications_access',2,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } $start = get_var('start',array('POST','GET')); - $GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl')); - $GLOBALS['phpgw']->template->set_block('application','form','form'); - $GLOBALS['phpgw']->template->set_block('application','row','row'); - $GLOBALS['phpgw']->template->set_block('form','delete_button'); - $GLOBALS['phpgw']->template->set_var('delete_button',''); + $GLOBALS['egw']->template->set_file(array('application' => 'application_form.tpl')); + $GLOBALS['egw']->template->set_block('application','form','form'); + $GLOBALS['egw']->template->set_block('application','row','row'); + $GLOBALS['egw']->template->set_block('form','delete_button'); + $GLOBALS['egw']->template->set_var('delete_button',''); if ($_POST['cancel']) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); + $GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); } if ($_POST['save']) @@ -206,32 +206,32 @@ 'app_order' => $app_order )); - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); + $GLOBALS['egw']->common->egw_exit(); } else { - $GLOBALS['phpgw']->template->set_var('error','

' . $GLOBALS['phpgw']->common->error_list($error) . '

'); + $GLOBALS['egw']->template->set_var('error','

' . $GLOBALS['egw']->common->error_list($error) . '

'); } } else { // else submit - $GLOBALS['phpgw']->template->set_var('error',''); + $GLOBALS['egw']->template->set_var('error',''); } - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Add new application'); - if(!@is_object($GLOBALS['phpgw']->js)) + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Add new application'); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); - $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); + $GLOBALS['egw']->template->set_var('th_bg',$GLOBALS['egw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('hidden_vars',''); - $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.add')); + $GLOBALS['egw']->template->set_var('hidden_vars',''); + $GLOBALS['egw']->template->set_var('form_action',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiapplications.add')); $this->display_row(lang('application name'),''); @@ -254,27 +254,27 @@ $this->display_row(lang('Select which location this app should appear on the navbar, lowest (left) to highest (right)'),''); - $GLOBALS['phpgw']->template->set_var('lang_save_button',lang('Add')); - $GLOBALS['phpgw']->template->set_var('lang_cancel_button',lang('Cancel')); - $GLOBALS['phpgw']->template->pparse('phpgw_body','form'); + $GLOBALS['egw']->template->set_var('lang_save_button',lang('Add')); + $GLOBALS['egw']->template->set_var('lang_cancel_button',lang('Cancel')); + $GLOBALS['egw']->template->pparse('phpgw_body','form'); } function edit() { - if ($GLOBALS['phpgw']->acl->check('applications_access',4,'admin')) + if ($GLOBALS['egw']->acl->check('applications_access',4,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } $app_name = get_var('app_name',array('POST','GET')); $start = get_var('start',array('POST','GET')); - $GLOBALS['phpgw']->template->set_file(array('application' => 'application_form.tpl')); - $GLOBALS['phpgw']->template->set_block('application','form','form'); - $GLOBALS['phpgw']->template->set_block('application','row','row'); + $GLOBALS['egw']->template->set_file(array('application' => 'application_form.tpl')); + $GLOBALS['egw']->template->set_block('application','form','form'); + $GLOBALS['egw']->template->set_block('application','row','row'); if ($_POST['cancel']) { - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); + $GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); } if ($_POST['delete']) @@ -297,39 +297,39 @@ 'app_name' => urldecode($app_name) )); - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); + $GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); } } - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit application'); - if(!@is_object($GLOBALS['phpgw']->js)) + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit application'); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); if ($totalerrors) { - $GLOBALS['phpgw']->template->set_var('error','

' . $GLOBALS['phpgw']->common->error_list($error) . '

'); + $GLOBALS['egw']->template->set_var('error','

' . $GLOBALS['egw']->common->error_list($error) . '

'); } else { - $GLOBALS['phpgw']->template->set_var('error',''); + $GLOBALS['egw']->template->set_var('error',''); list($n_app_name,$n_app_title,$n_app_status,$old_app_name,$app_order) = $this->bo->read($app_name); } - $GLOBALS['phpgw']->template->set_var('hidden_vars',''. + $GLOBALS['egw']->template->set_var('hidden_vars',''. ''); - $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); - $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.edit')); + $GLOBALS['egw']->template->set_var('th_bg',$GLOBALS['egw_info']['theme']['th_bg']); + $GLOBALS['egw']->template->set_var('form_action',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiapplications.edit')); $this->display_row(lang('application name'), $n_app_name ); - $GLOBALS['phpgw']->template->set_var('lang_status',lang('Status')); - $GLOBALS['phpgw']->template->set_var('lang_save_button',lang('Save')); - $GLOBALS['phpgw']->template->set_var('lang_cancel_button',lang('Cancel')); - $GLOBALS['phpgw']->template->set_var('lang_delete_button',lang('Delete')); + $GLOBALS['egw']->template->set_var('lang_status',lang('Status')); + $GLOBALS['egw']->template->set_var('lang_save_button',lang('Save')); + $GLOBALS['egw']->template->set_var('lang_cancel_button',lang('Cancel')); + $GLOBALS['egw']->template->set_var('lang_delete_button',lang('Delete')); $selected[$n_app_status] = ' selected'; $status_html = '' @@ -340,15 +340,15 @@ $this->display_row(lang("Status"),''); $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('phpgw_body','form'); + $GLOBALS['egw']->template->set_var('select_status',$status_html); + $GLOBALS['egw']->template->pparse('phpgw_body','form'); } function delete() { - if ($GLOBALS['phpgw']->acl->check('applications_access',8,'admin')) + if ($GLOBALS['egw']->acl->check('applications_access',8,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } $app_name = get_var('app_name',array('POST','GET')); $start = get_var('start',array('POST','GET')); @@ -359,41 +359,41 @@ { $this->bo->delete($app_name); } - $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); + $GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); } - $GLOBALS['phpgw']->template->set_file(array('body' => 'delete_common.tpl')); + $GLOBALS['egw']->template->set_file(array('body' => 'delete_common.tpl')); - if(!@is_object($GLOBALS['phpgw']->js)) + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); - $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['egw']->template->set_var('messages',lang('Are you sure you want to delete the application %1 ?',$GLOBALS['egw_info']['apps'][$app_name]['title'])); + $GLOBALS['egw']->template->set_var('no',lang('No')); + $GLOBALS['egw']->template->set_var('yes',lang('Yes')); + $GLOBALS['egw']->template->set_var('form_action',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiapplications.delete')); + $GLOBALS['egw']->template->set_var('hidden_vars',''. ''); - $GLOBALS['phpgw']->template->pparse('phpgw_body','body'); + $GLOBALS['egw']->template->pparse('phpgw_body','body'); } function register_all_hooks() { - if ($GLOBALS['phpgw']->acl->check('applications_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('applications_access',16,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - if (!is_object($GLOBALS['phpgw']->hooks)) + if (!is_object($GLOBALS['egw']->hooks)) { - $GLOBALS['phpgw']->hooks = CreateObject('phpgwapi.hooks'); + $GLOBALS['egw']->hooks =& CreateObject('phpgwapi.hooks'); } - $GLOBALS['phpgw']->hooks->register_all_hooks(); + $GLOBALS['egw']->hooks->register_all_hooks(); - $GLOBALS['phpgw']->redirect_link('/admin/index.php'); + $GLOBALS['egw']->redirect_link('/admin/index.php'); } } ?> diff --git a/admin/inc/class.uiasyncservice.inc.php b/admin/inc/class.uiasyncservice.inc.php index 242965956c..38297ae84f 100644 --- a/admin/inc/class.uiasyncservice.inc.php +++ b/admin/inc/class.uiasyncservice.inc.php @@ -29,28 +29,28 @@ ); function uiasyncservice() { - if (!is_object($GLOBALS['phpgw']->asyncservice)) + if (!is_object($GLOBALS['egw']->asyncservice)) { - $GLOBALS['phpgw']->asyncservice = CreateObject('phpgwapi.asyncservice'); + $GLOBALS['egw']->asyncservice =& CreateObject('phpgwapi.asyncservice'); } } function index() { - if ($GLOBALS['phpgw']->acl->check('asyncservice_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('asyncservice_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Asynchronous timed services'); - if(!@is_object($GLOBALS['phpgw']->js)) + $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Asynchronous timed services'); + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); - $async = $GLOBALS['phpgw']->asyncservice; // use an own instance, as we might set debug=True + $async = $GLOBALS['egw']->asyncservice; // use an own instance, as we might set debug=True $async->debug = !!$_POST['debug']; @@ -76,7 +76,7 @@ if ($_POST['test']) { - if (!$async->set_timer($times,'test','admin.uiasyncservice.test',$GLOBALS['phpgw_info']['user']['email'])) + if (!$async->set_timer($times,'test','admin.uiasyncservice.test',$GLOBALS['egw_info']['user']['email'])) { echo '

'.lang("Error setting timer, wrong syntax or maybe there's one already running !!!")."

\n"; } @@ -101,18 +101,18 @@ { $times = array('min' => '*/5'); // set some default } - echo ''."\n

"; + echo ''."\n

"; echo '

'."\n"; $last_run = $async->last_check_run(); - $lr_date = $last_run['end'] ? $GLOBALS['phpgw']->common->show_date($last_run['end']) : lang('never'); + $lr_date = $last_run['end'] ? $GLOBALS['egw']->common->show_date($last_run['end']) : lang('never'); echo '

'.lang('Async services last executed').': '.$lr_date.' ('.$last_run['run_by'].")

\n
\n"; - if (isset($_POST['asyncservice']) && $_POST['asyncservice'] != $GLOBALS['phpgw_info']['server']['asyncservice']) + if (isset($_POST['asyncservice']) && $_POST['asyncservice'] != $GLOBALS['egw_info']['server']['asyncservice']) { - $config = CreateObject('phpgwapi.config','phpgwapi'); + $config =& CreateObject('phpgwapi.config','phpgwapi'); $config->read_repository(); - $config->value('asyncservice',$GLOBALS['phpgw_info']['server']['asyncservice']=$_POST['asyncservice']); + $config->value('asyncservice',$GLOBALS['egw_info']['server']['asyncservice']=$_POST['asyncservice']); $config->save_repository(); unset($config); } @@ -130,7 +130,7 @@ ' \n"; @@ -179,7 +179,7 @@ { $next = $async->next_run($times,True); - echo "

asyncservice::next_run(";print_r($times);echo")=".($next === False ? 'False':"'$next'=".$GLOBALS['phpgw']->common->show_date($next))."

\n"; + echo "

asyncservice::next_run(";print_r($times);echo")=".($next === False ? 'False':"'$next'=".$GLOBALS['egw']->common->show_date($next))."

\n"; } echo '

 \n"; echo '\n"; @@ -192,11 +192,11 @@ echo "\n\n\n"; foreach($jobs as $job) { - echo "\n\n\n"; + echo "\n"; } echo "
Id".lang('Next run').''.lang('Times').''.lang('Method').''.lang('Data')."".lang('LoginID')."
$job[id]".$GLOBALS['phpgw']->common->show_date($job['next']).""; + echo "
$job[id]".$GLOBALS['egw']->common->show_date($job['next']).""; print_r($job['times']); echo "$job[method]"; print_r($job['data']); - echo "".$GLOBALS['phpgw']->accounts->id2name($job[account_id])."
".$GLOBALS['egw']->accounts->id2name($job[account_id])."
\n"; } @@ -211,17 +211,17 @@ function test($to) { - if (!is_object($GLOBALS['phpgw']->send)) + if (!is_object($GLOBALS['egw']->send)) { - $GLOBALS['phpgw']->send = CreateObject('phpgwapi.send'); + $GLOBALS['egw']->send =& CreateObject('phpgwapi.send'); } - $returncode = $GLOBALS['phpgw']->send->msg('email',$to,$subject='Asynchronous timed services','Greatings from cron ;-)'); + $returncode = $GLOBALS['egw']->send->msg('email',$to,$subject='Asynchronous timed services','Greatings from cron ;-)'); if (!$returncode) // not nice, but better than failing silently { echo "

bocalendar::send_update: sending message to '$to' subject='$subject' failed !!!
\n"; - echo $GLOBALS['phpgw']->send->err['desc']."

\n"; + echo $GLOBALS['egw']->send->err['desc']."

\n"; } - //print_r($GLOBALS['phpgw_info']['user']); + //print_r($GLOBALS['egw_info']['user']); } } diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index c30cd61929..5b5d5da501 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -36,30 +36,30 @@ function uicategories() { - if ($GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('global_categories_access',1,'admin')) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } - $this->bo = CreateObject('admin.bocategories'); - $this->template = $GLOBALS['phpgw']->template; - $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); + $this->bo =& CreateObject('admin.bocategories'); + $this->template = $GLOBALS['egw']->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->acl_search = !$GLOBALS['egw']->acl->check('global_categories_access',2,'admin'); + $this->acl_add = !$GLOBALS['egw']->acl->check('global_categories_access',4,'admin'); + $this->acl_view = !$GLOBALS['egw']->acl->check('global_categories_access',8,'admin'); + $this->acl_edit = !$GLOBALS['egw']->acl->check('global_categories_access',16,'admin'); + $this->acl_delete = !$GLOBALS['egw']->acl->check('global_categories_access',32,'admin'); + $this->acl_add_sub= !$GLOBALS['egw']->acl->check('global_categories_access',64,'admin'); - if(!@is_object($GLOBALS['phpgw']->js)) + if(!@is_object($GLOBALS['egw']->js)) { - $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['egw']->js->validate_file('jscode','openwindow','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']; + $GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps'][$this->appname ? $this->appname : 'admin']['title']; $this->start = $this->bo->start; $this->query = $this->bo->query; @@ -68,7 +68,7 @@ $this->cat_id = $this->bo->cat_id; if($this->debug) { $this->_debug_sqsof(); } - $dir = dir(PHPGW_SERVER_ROOT.'/phpgwapi/images'); + $dir = dir(EGW_SERVER_ROOT.'/phpgwapi/images'); while($file = $dir->read()) { if (preg_match('/\\.(png|gif|jpe?g)$/i',$file)) @@ -78,7 +78,7 @@ } $dir->close(); sort($this->icons); - $this->img_url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/images/'; + $this->img_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images/'; } function _debug_sqsof() @@ -141,12 +141,12 @@ if ($_POST['add']) { - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + $GLOBALS['egw']->redirect_link('/index.php',$link_data); } if ($_POST['done']) { - $GLOBALS['phpgw']->redirect_link('/admin/index.php'); + $GLOBALS['egw']->redirect_link('/admin/index.php'); } $this->template->set_file(array('cat_list_t' => 'listcats.tpl')); @@ -160,14 +160,14 @@ $this->template->set_block('cat_list_t','search','searchhandle'); } - $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.lang('Global categories'); - $GLOBALS['phpgw']->common->phpgw_header(); + $GLOBALS['egw_info']['flags']['app_header'] .= ' - '.lang('Global categories'); + $GLOBALS['egw']->common->egw_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)); + $this->template->set_var('action_url',$GLOBALS['egw']->link('/index.php',$link_data)); if(!$start) { @@ -215,7 +215,7 @@ $id = $cat['id']; $level = $cat['level']; - $cat_name = $GLOBALS['phpgw']->strip_html($cat['name']); + $cat_name = $GLOBALS['egw']->strip_html($cat['name']); if ($level > 0) { @@ -224,7 +224,7 @@ $cat_name = $spaceset . $cat_name; } - $descr = $GLOBALS['phpgw']->strip_html($cat['description']); + $descr = $GLOBALS['egw']->strip_html($cat['description']); if (!$descr) { $descr = ' '; } if ($level == 0) @@ -253,7 +253,7 @@ $link_data['menuaction'] = 'admin.uicategories.edit'; $link_data['cat_parent'] = $id; unset($link_data['cat_id']); - $this->template->set_var('add_sub',''. + $this->template->set_var('add_sub',''. lang('Add sub').''); } if ($this->appname && $cat['app_name'] == $this->appname) @@ -274,7 +274,7 @@ if ($show_edit_del && $this->acl_edit) { $link_data['menuaction'] = 'admin.uicategories.edit'; - $this->template->set_var('edit',''. + $this->template->set_var('edit',''. lang('Edit').''); } else @@ -284,7 +284,7 @@ if ($show_edit_del && $this->acl_delete) { $link_data['menuaction'] = 'admin.uicategories.delete'; - $this->template->set_var('delete',''. + $this->template->set_var('delete',''. lang('Delete').''); } else @@ -294,19 +294,19 @@ $data = unserialize($cat['data']); $icon = $data['icon']; - $dir_img = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'images' . SEP; + $dir_img = $GLOBALS['egw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'images' . SEP; if (strlen($icon) > 0) - $this->template->set_var('icon', ""); + $this->template->set_var('icon', ""); else - $this->template->set_var('icon', " "); + $this->template->set_var('icon', " "); $this->template->fp('list','cat_list',True); } $link_data['menuaction'] = 'admin.uicategories.edit'; unset($link_data['cat_id']); unset($link_data['cat_parent']); - $this->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',$link_data)); + $this->template->set_var('add_action',$GLOBALS['egw']->link('/index.php',$link_data)); $this->save_sessiondata(); $this->template->pfp('out','cat_list_t',True); @@ -334,12 +334,12 @@ if (!$this->acl_add && $cat_parent == 0 || !$this->acl_add_sub && $cat_parent != 0) { - $GLOBALS['phpgw']->redirect_link('/index.php'); + $GLOBALS['egw']->redirect_link('/index.php'); } if ($_POST['cancel'] || $this->cat_id && !$this->acl_edit || $this->cat_id && (!$this->acl_add && $cat_parent == 0 || !$this->acl_add_sub && $cat_parent != 0)) { - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + $GLOBALS['egw']->redirect_link('/index.php',$link_data); } if ($_POST['save']) @@ -362,16 +362,16 @@ $error = $this->bo->check_values($values); if (is_array($error)) { - $this->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error)); + $this->template->set_var('message',$GLOBALS['egw']->common->error_list($error)); } else { $this->cat_id = $this->bo->save_cat($values); - $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); + $GLOBALS['egw']->redirect_link('/index.php',$link_data); } } - $GLOBALS['phpgw_info']['flags']['app_header'] .= ' - '.($this->cat_id ? lang('Edit global category'):lang('Add global category')); + $GLOBALS['egw_info']['flags']['app_header'] .= ' - '.($this->cat_id ? lang('Edit global category'):lang('Add global category')); $this->set_langs(); @@ -399,28 +399,28 @@ $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)); + $this->template->set_var('action_url',$GLOBALS['egw']->link('/index.php',$link_data)); if ($this->acl_delete) { $link_data['menuaction'] = 'admin.uicategories.delete'; - $this->template->set_var('delete',''); } else { $this->template->set_var('delete',' '); } - $this->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cat['name'])); - $this->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cat['description'])); + $this->template->set_var('cat_name',$GLOBALS['egw']->strip_html($cat['name'])); + $this->template->set_var('cat_description',$GLOBALS['egw']->strip_html($cat['description'])); $this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cat['parent'],'self' => $this->cat_id))); - if (!is_object($GLOBALS['phpgw']->html)) + if (!is_object($GLOBALS['egw']->html)) { - $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html'); + $GLOBALS['egw']->html =& CreateObject('phpgwapi.html'); } - $this->template->set_var('color',$GLOBALS['phpgw']->html->inputColor('cat_data[color]',$cat['data']['color'],lang('Click to select a color'))); + $this->template->set_var('color',$GLOBALS['egw']->html->inputColor('cat_data[color]',$cat['data']['color'],lang('Click to select a color'))); //$options = '