diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index a92fffebb2..c88f9f1d71 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -220,13 +220,17 @@ if(!$errors) { + $new_user = !$userData['account_id']; + $passwd = $userData['account_passwd']; $errors = $this->save_user($userData); - $GLOBALS['hook_values'] = $userData; + $GLOBALS['hook_values'] = $userData + ($new_user ? array( + 'new_password' => $passwd, + ) : array()); $GLOBALS['egw']->hooks->process($GLOBALS['hook_values']+array( - 'location' => 'editaccount' + 'location' => $new_user ? 'addaccount' : 'editaccount', ),False,True); // called for every app now, not only enabled ones) } - error_log(__METHOD__."(".array2string($userData).") returning ".array2string($errors ? $errors : true)); + //error_log(__METHOD__."(".array2string($userData).") returning ".array2string($errors ? $errors : true)); return $errors ? $errors : true; } diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index de77caf945..45e76682a9 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -1561,7 +1561,7 @@ // $menuClass =& CreateObject('admin.uimenuclass'); // This is now using ExecMethod() $GLOBALS['account_id'] = $_account_id; - $t->set_var('rows', $_account_id ? ExecMethod('admin.uimenuclass.createHTMLCode','edit_user') : ''); + $t->set_var('rows', $_account_id ? ExecMethod2('admin.uimenuclass.createHTMLCode','edit_user',$_account_id) : ''); echo $t->fp('out','form'); } diff --git a/admin/inc/class.uimenuclass.inc.php b/admin/inc/class.uimenuclass.inc.php index 6a6ce0573f..149689c8bd 100644 --- a/admin/inc/class.uimenuclass.inc.php +++ b/admin/inc/class.uimenuclass.inc.php @@ -8,14 +8,14 @@ * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ - + /* $Id$ */ class uimenuclass { var $t; var $rowColor = Array(); - + function uimenuclass() { $this->t =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('admin')); @@ -42,7 +42,7 @@ // 'Login History' => array('/index.php','menuaction=admin.uiaccess_history.list') // ); // This allows extra data to be sent along - function display_section($_menuData) + function display_section($_menuData, $_account_id) { $i=0; @@ -53,11 +53,11 @@ { if (!empty($value['extradata'])) { - $link = $GLOBALS['egw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST')) . '&' . $value['extradata']); + $link = egw::link($value['url'],'account_id=' . $_account_id . '&' . $value['extradata']); } else { - $link = $GLOBALS['egw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST'))); + $link = egw::link($value['url'],'account_id=' . get_var('account_id',array('GET','POST'))); } $this->section_item($link,lang($value['description']),($i%2) ? "row_on": "row_off",$value['options']); $i++; @@ -77,14 +77,17 @@ $this->t->set_var('row_on',$this->rowColor[0]); $this->t->parse('out','menu_links'); - + return $this->t->get('out','menu_links'); } // create the html code for the menu - function createHTMLCode($_hookname) + function createHTMLCode($_hookname, $_account_id=null) { - $hook['location'] = $_hookname; + $hook = array('location' => $_hookname); + if (!$_account_id) $_account_id = get_var('account_id',array('GET','POST')); + if ($_account_id) $hook['account_id'] = $_account_id; + switch ($_hookname) { case 'edit_user': @@ -93,7 +96,6 @@ 'url' => '/index.php', 'extradata' => 'menuaction=admin.uiaccounts.edit_user' ); - if (get_var('account_id',array('GET','POST'))) $hook['account_id'] = get_var('account_id',array('GET','POST')); break; case 'view_user': $GLOBALS['menuData'][] = array( @@ -101,7 +103,6 @@ 'url' => '/index.php', 'extradata' => 'menuaction=admin.uiaccounts.view_user' ); - //if (get_var('account_id',array('GET','POST'))) $hook['account_id'] = get_var('account_id',array('GET','POST')); break; case 'edit_group': $GLOBALS['menuData'][] = array( @@ -120,9 +121,9 @@ } //_debug_array($hook); $GLOBALS['egw']->hooks->process($hook); - if (count($GLOBALS['menuData']) >= 1) + if (count($GLOBALS['menuData']) >= 1) { - $result = $this->display_section($GLOBALS['menuData']); + $result = $this->display_section($GLOBALS['menuData'], $_account_id); //clear $menuData $GLOBALS['menuData'] = ''; return $result; @@ -135,4 +136,3 @@ } } } -?>