mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 11:23:54 +01:00
Account -> view is working again. I made it use the same template as new/edit account.
This commit is contained in:
parent
2509cf0e65
commit
269d28222a
@ -26,13 +26,17 @@
|
|||||||
|
|
||||||
$t = new Template($phpgw->common->get_tpl_dir('admin'));
|
$t = new Template($phpgw->common->get_tpl_dir('admin'));
|
||||||
$t->set_unknowns('remove');
|
$t->set_unknowns('remove');
|
||||||
$t->set_file(array('form' => 'account_form.tpl'));
|
$t->set_file(array(
|
||||||
|
'form' => 'account_form.tpl',
|
||||||
|
'form_passwordinfo' => 'account_form_password.tpl',
|
||||||
|
'form_buttons_' => 'account_form_buttons.tpl',
|
||||||
|
));
|
||||||
|
|
||||||
if ($_userData)
|
if ($_userData)
|
||||||
{
|
{
|
||||||
$userData=$_userData;
|
$userData=$_userData;
|
||||||
reset($userData['account_groups']);
|
@reset($userData['account_groups']);
|
||||||
while (list($key, $value) = each($userData['account_groups']))
|
while (list($key, $value) = @each($userData['account_groups']))
|
||||||
{
|
{
|
||||||
$userGroups[$key]['account_id'] = $value;
|
$userGroups[$key]['account_id'] = $value;
|
||||||
}
|
}
|
||||||
@ -69,18 +73,25 @@
|
|||||||
$t->set_var('lang_groups',lang('Groups'));
|
$t->set_var('lang_groups',lang('Groups'));
|
||||||
$t->set_var('lang_firstname',lang('First Name'));
|
$t->set_var('lang_firstname',lang('First Name'));
|
||||||
$t->set_var('lang_button',lang('Save'));
|
$t->set_var('lang_button',lang('Save'));
|
||||||
|
$t->parse('form_buttons','form_buttons_',True);
|
||||||
|
|
||||||
|
$t->set_var('account_lid','<input name="account_lid" value="' . $userData['account_lid'] . '">');
|
||||||
|
|
||||||
$t->set_var('account_lid',$userData['account_lid']);
|
|
||||||
$t->set_var('account_passwd',$account_passwd);
|
$t->set_var('account_passwd',$account_passwd);
|
||||||
$t->set_var('account_passwd_2',$account_passwd_2);
|
$t->set_var('account_passwd_2',$account_passwd_2);
|
||||||
|
$t->parse('password_fields','form_passwordinfo',True);
|
||||||
|
|
||||||
if ($userData['status'])
|
if ($userData['status'])
|
||||||
{
|
{
|
||||||
$t->set_var('account_status',' checked');
|
$t->set_var('account_status','<input type="checkbox" name="account_status" value="A" checked>');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$t->set_var('account_status','<input type="checkbox" name="account_status" value="A">');
|
||||||
}
|
}
|
||||||
|
|
||||||
$t->set_var('account_firstname',$userData['firstname']);
|
$t->set_var('account_firstname','<input name="account_firstname" value="' . $userData['firstname'] . '">');
|
||||||
$t->set_var('account_lastname',$userData['lastname']);
|
$t->set_var('account_lastname','<input name="account_lastname" value="' . $userData['lastname'] . '">');
|
||||||
|
|
||||||
$allAccounts;
|
$allAccounts;
|
||||||
$userGroups;
|
$userGroups;
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$phpgw_info["flags"] = array("currentapp" => "admin", "noheader" => True, "nonavbar" => True,
|
$phpgw_info["flags"] = array("currentapp" => "admin", "noheader" => True, "nonavbar" => True,
|
||||||
"parent_page" => "accounts.php");
|
"parent_page" => "accounts.php");
|
||||||
include("../header.inc.php");
|
include("../header.inc.php");
|
||||||
#include($phpgw_info["server"]["app_inc"]."/accounts_".$phpgw_info["server"]["account_repository"].".inc.php");
|
|
||||||
|
|
||||||
function is_odd($n)
|
function is_odd($n)
|
||||||
{
|
{
|
||||||
@ -146,50 +145,59 @@
|
|||||||
$account_status = 'A';
|
$account_status = 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->template->set_file(array('form' => 'account_form.tpl'));
|
|
||||||
$phpgw->template->set_unknowns('remove');
|
$phpgw->template->set_unknowns('remove');
|
||||||
|
$phpgw->template->set_file(array(
|
||||||
|
'form' => 'account_form.tpl',
|
||||||
|
'form_passwordinfo' => 'account_form_password.tpl',
|
||||||
|
'form_buttons_' => 'account_form_buttons.tpl',
|
||||||
|
));
|
||||||
|
|
||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
echo parse_navbar();
|
echo parse_navbar();
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_action",lang("Add new account"));
|
$phpgw->template->set_var('lang_action',lang('Add new account'));
|
||||||
|
|
||||||
if ($totalerrors) {
|
if ($totalerrors)
|
||||||
$phpgw->template->set_var("error_messages","<center>" . $phpgw->common->error_list($error) . "</center>");
|
{
|
||||||
} else {
|
$phpgw->template->set_var('error_messages','<center>' . $phpgw->common->error_list($error) . '</center>');
|
||||||
$phpgw->template->set_var("error_messages","");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
$phpgw->template->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
||||||
$phpgw->template->set_var("tr_color1",$phpgw_info["theme"]["row_on"]);
|
$phpgw->template->set_var('tr_color1',$phpgw_info['theme']['row_on']);
|
||||||
$phpgw->template->set_var("tr_color2",$phpgw_info["theme"]["row_off"]);
|
$phpgw->template->set_var('tr_color2',$phpgw_info['theme']['row_off']);
|
||||||
|
|
||||||
$phpgw->template->set_var("form_action",$phpgw->link("newaccount.php"));
|
$phpgw->template->set_var('form_action',$phpgw->link('newaccount.php'));
|
||||||
$phpgw->template->set_var("lang_loginid",lang("LoginID"));
|
$phpgw->template->set_var('lang_loginid',lang('LoginID'));
|
||||||
|
|
||||||
if ($account_status)
|
if ($account_status)
|
||||||
{
|
{
|
||||||
$phpgw->template->set_var('account_status',' checked');
|
$phpgw->template->set_var('account_status','<input type="checkbox" name="account_status" value="A" checked>');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$phpgw->template->set_var('account_status','<input type="checkbox" name="account_status" value="A">');
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->template->set_var("account_lid",$account_lid);
|
$phpgw->template->set_var('account_lid','<input name="account_lid" value="' . $account_lid . '">');
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_account_active",lang("Account active"));
|
$phpgw->template->set_var('lang_account_active',lang('Account active'));
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_password",lang("Password"));
|
$phpgw->template->set_var('lang_password',lang('Password'));
|
||||||
$phpgw->template->set_var("account_passwd",$account_passwd);
|
$phpgw->template->set_var('account_passwd',$account_passwd);
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_reenter_password",lang("Re-Enter Password"));
|
$phpgw->template->set_var('lang_reenter_password',lang('Re-Enter Password'));
|
||||||
$phpgw->template->set_var("account_passwd_2",$account_passwd_2);
|
$phpgw->template->set_var('account_passwd_2',$account_passwd_2);
|
||||||
|
$phpgw->template->parse('password_fields','form_passwordinfo',True);
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_firstname",lang("First Name"));
|
$phpgw->template->set_var('lang_firstname',lang('First Name'));
|
||||||
$phpgw->template->set_var("account_firstname",$account_firstname);
|
$phpgw->template->set_var('account_firstname','<input name="account_firstname" value="' . $account_firstname . '">');
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_lastname",lang("Last Name"));
|
$phpgw->template->set_var('lang_lastname',lang('Last Name'));
|
||||||
$phpgw->template->set_var("account_lastname",$account_lastname);
|
$phpgw->template->set_var('account_lastname','<input name="account_lastname" value="' . $account_lastname . '">');
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_groups",lang("Groups"));
|
$phpgw->template->set_var('lang_groups',lang('Groups'));
|
||||||
|
|
||||||
|
$phpgw->template->parse('form_buttons','form_buttons_',True);
|
||||||
|
|
||||||
// groups list
|
// groups list
|
||||||
$groups_select = '<select name="account_groups[]" multiple>';
|
$groups_select = '<select name="account_groups[]" multiple>';
|
||||||
@ -208,55 +216,70 @@
|
|||||||
}
|
}
|
||||||
@reset($account_groups);
|
@reset($account_groups);
|
||||||
|
|
||||||
$groups_select .= ">" . $group["account_lid"] . "</option>\n";
|
$groups_select .= '>' . $group['account_lid'] . '</option>';
|
||||||
|
$groups_select .= "\n";
|
||||||
}
|
}
|
||||||
$groups_select .= '</select>';
|
$groups_select .= '</select>';
|
||||||
$phpgw->template->set_var('groups_select',$groups_select);
|
$phpgw->template->set_var('groups_select',$groups_select);
|
||||||
// end groups list
|
// end groups list
|
||||||
|
|
||||||
$phpgw->template->set_var("","");
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$sorted_apps = $phpgw_info["apps"];
|
$sorted_apps = $phpgw_info['apps'];
|
||||||
@asort($sorted_apps);
|
@asort($sorted_apps);
|
||||||
@reset($sorted_apps);
|
@reset($sorted_apps);
|
||||||
while ($permission = each($sorted_apps)) {
|
while ($permission = each($sorted_apps))
|
||||||
if ($permission[1]["enabled"]) {
|
{
|
||||||
|
if ($permission[1]['enabled'])
|
||||||
|
{
|
||||||
$perm_display[$i][0] = $permission[0];
|
$perm_display[$i][0] = $permission[0];
|
||||||
$perm_display[$i][1] = $permission[1]["title"];
|
$perm_display[$i][1] = $permission[1]['title'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0;$i<200;) { // The $i<200 is only used for a brake
|
// The $i<200 is only used for a brake
|
||||||
if (! $perm_display[$i][1]) break;
|
for ($i=0;$i<200;)
|
||||||
|
{
|
||||||
|
if (! $perm_display[$i][1])
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$perms_html .= '<tr bgcolor="' . $phpgw_info["theme"]["row_on"] . '"><td>' . lang($perm_display[$i][1]) . '</td>'
|
$perms_html .= '<tr bgcolor="' . $phpgw_info['theme']['row_on'] . '"><td>' . lang($perm_display[$i][1]) . '</td>'
|
||||||
. '<td><input type="checkbox" name="account_permissions['
|
. '<td><input type="checkbox" name="account_permissions['
|
||||||
. $perm_display[$i][0] . ']" value="True"';
|
. $perm_display[$i][0] . ']" value="True"';
|
||||||
if ($account_permissions[$perm_display[$i][0]]) {
|
|
||||||
$perms_html .= " checked";
|
if ($account_permissions[$perm_display[$i][0]])
|
||||||
|
{
|
||||||
|
$perms_html .= ' checked';
|
||||||
}
|
}
|
||||||
$perms_html .= "></td>";
|
$perms_html .= '></td>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if ($i == count($perm_display) && is_odd(count($perm_display))) {
|
if ($i == count($perm_display) && is_odd(count($perm_display)))
|
||||||
|
{
|
||||||
$perms_html .= '<td colspan="2"> </td></tr>';
|
$perms_html .= '<td colspan="2"> </td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $perm_display[$i][1]) break;
|
if (! $perm_display[$i][1])
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$perms_html .= '<td>' . lang($perm_display[$i][1]) . '</td>'
|
$perms_html .= '<td>' . lang($perm_display[$i][1]) . '</td>'
|
||||||
. '<td><input type="checkbox" name="account_permissions['
|
. '<td><input type="checkbox" name="account_permissions['
|
||||||
. $perm_display[$i][0] . ']" value="True"';
|
. $perm_display[$i][0] . ']" value="True"';
|
||||||
if ($account_permissions[$perm_display[$i][0]]) {
|
|
||||||
$perms_html .= " checked";
|
if ($account_permissions[$perm_display[$i][0]])
|
||||||
|
{
|
||||||
|
$perms_html .= ' checked';
|
||||||
}
|
}
|
||||||
$perms_html .= "></td></tr>";
|
$perms_html .= '></td></tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$phpgw->template->set_var("permissions_list",$perms_html);
|
$phpgw->template->set_var('permissions_list',$perms_html);
|
||||||
|
|
||||||
$includedSomething = False;
|
$includedSomething = False;
|
||||||
// Skeeter: I don't see this as a player, if creating new accounts...
|
// Skeeter: I don't see this as a player, if creating new accounts...
|
||||||
@ -268,11 +291,9 @@
|
|||||||
// {gui_hooks} to ""
|
// {gui_hooks} to ""
|
||||||
// if ($phpgw->common->hook_single("show_newuser_data", $value)) $includedSomething="true";
|
// if ($phpgw->common->hook_single("show_newuser_data", $value)) $includedSomething="true";
|
||||||
// }
|
// }
|
||||||
if (!$includedSomething) $phpgw->template->set_var("gui_hooks","");
|
|
||||||
|
|
||||||
$phpgw->template->set_var("lang_button",Lang("Add"));
|
$phpgw->template->set_var('lang_button',Lang('Add'));
|
||||||
echo $phpgw->template->finish($phpgw->template->parse("out","form"));
|
$phpgw->template->pfp('out','form');
|
||||||
|
|
||||||
#account_close();
|
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
||||||
|
@ -9,41 +9,33 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr bgcolor="{tr_color1}">
|
<tr bgcolor="{tr_color1}">
|
||||||
<td>{lang_loginid}</td>
|
<td width="25%">{lang_loginid}</td>
|
||||||
<td><input name="account_lid" value="{account_lid}"></td>
|
<td width="25%">{account_lid} </td>
|
||||||
<td colspan="2" align="center">
|
|
||||||
{lang_account_active}: <input type="checkbox" name="account_status" value="A"{account_status}>
|
<td width="25%">{lang_account_active}:</td>
|
||||||
</td>
|
<td width="25%">{account_status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
<tr bgcolor="{tr_color2}">
|
||||||
<td>{lang_firstname}</td>
|
<td>{lang_firstname}</td>
|
||||||
<td><input name="account_firstname" value="{account_firstname}"></td>
|
<td>{account_firstname} </td>
|
||||||
<td>{lang_lastname}</td>
|
<td>{lang_lastname}</td>
|
||||||
<td><input name="account_lastname" value="{account_lastname}"></td>
|
<td>{account_lastname} </td>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr bgcolor="{tr_color1}">
|
|
||||||
<td>{lang_password}</td>
|
|
||||||
<td><input type="password" name="account_passwd" value="{account_passwd}"></td>
|
|
||||||
<td>{lang_reenter_password}</td>
|
|
||||||
<td><input type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
{password_fields}
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
<tr bgcolor="{tr_color2}">
|
||||||
<td>{lang_groups}</td>
|
<td>{lang_groups}</td>
|
||||||
<td>{groups_select} </td>
|
<td colspan=3>{groups_select} </td>
|
||||||
<td colspan=2> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{permissions_list}
|
{permissions_list}
|
||||||
|
|
||||||
{gui_hooks}
|
{gui_hooks}
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
{form_buttons}
|
||||||
<td colspan="4" align="right"><input type="submit" name="submit" value="{lang_button}"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
</form>
|
</form>
|
||||||
|
4
admin/templates/default/account_form_buttons.tpl
Normal file
4
admin/templates/default/account_form_buttons.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color2}">
|
||||||
|
<td colspan="4" align="right"><input type="submit" name="submit" value="{lang_button}"></td>
|
||||||
|
</tr>
|
8
admin/templates/default/account_form_logininfo.tpl
Normal file
8
admin/templates/default/account_form_logininfo.tpl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color1}">
|
||||||
|
<td>{lang_lastlogin}</td>
|
||||||
|
<td>{account_lastlogin}</td>
|
||||||
|
|
||||||
|
<td>{lang_lastloginfrom}</td>
|
||||||
|
<td>{account_lastloginfrom}</td>
|
||||||
|
</tr>
|
7
admin/templates/default/account_form_password.tpl
Normal file
7
admin/templates/default/account_form_password.tpl
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color1}">
|
||||||
|
<td>{lang_password}</td>
|
||||||
|
<td><input type="password" name="account_passwd" value="{account_passwd}"></td>
|
||||||
|
<td>{lang_reenter_password}</td>
|
||||||
|
<td><input type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
||||||
|
</tr>
|
@ -1,14 +0,0 @@
|
|||||||
<!-- BEGIN display -->
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<p>
|
|
||||||
<table border="0" width="50%">
|
|
||||||
|
|
||||||
<tr bgcolor="{th_bg}">
|
|
||||||
<td colspan="2"> </td>
|
|
||||||
</tr>
|
|
||||||
{rows}
|
|
||||||
</table>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
<!-- END display -->
|
|
@ -1,8 +0,0 @@
|
|||||||
<!-- BEGIN row -->
|
|
||||||
|
|
||||||
<tr bgcolor="{tr_color}">
|
|
||||||
<td width="40%" valign="top">{lable} </td>
|
|
||||||
<td width="60%" valign="top">{value} </td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- END row -->
|
|
@ -9,41 +9,33 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr bgcolor="{tr_color1}">
|
<tr bgcolor="{tr_color1}">
|
||||||
<td>{lang_loginid}</td>
|
<td width="25%">{lang_loginid}</td>
|
||||||
<td><input name="account_lid" value="{account_lid}"></td>
|
<td width="25%">{account_lid} </td>
|
||||||
<td colspan="2" align="center">
|
|
||||||
{lang_account_active}: <input type="checkbox" name="account_status" value="A"{account_status}>
|
<td width="25%">{lang_account_active}:</td>
|
||||||
</td>
|
<td width="25%">{account_status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
<tr bgcolor="{tr_color2}">
|
||||||
<td>{lang_firstname}</td>
|
<td>{lang_firstname}</td>
|
||||||
<td><input name="account_firstname" value="{account_firstname}"></td>
|
<td>{account_firstname} </td>
|
||||||
<td>{lang_lastname}</td>
|
<td>{lang_lastname}</td>
|
||||||
<td><input name="account_lastname" value="{account_lastname}"></td>
|
<td>{account_lastname} </td>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr bgcolor="{tr_color1}">
|
|
||||||
<td>{lang_password}</td>
|
|
||||||
<td><input type="password" name="account_passwd" value="{account_passwd}"></td>
|
|
||||||
<td>{lang_reenter_password}</td>
|
|
||||||
<td><input type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
{password_fields}
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
<tr bgcolor="{tr_color2}">
|
||||||
<td>{lang_groups}</td>
|
<td>{lang_groups}</td>
|
||||||
<td>{groups_select} </td>
|
<td colspan=3>{groups_select} </td>
|
||||||
<td colspan=2> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{permissions_list}
|
{permissions_list}
|
||||||
|
|
||||||
{gui_hooks}
|
{gui_hooks}
|
||||||
|
|
||||||
<tr bgcolor="{tr_color2}">
|
{form_buttons}
|
||||||
<td colspan="4" align="right"><input type="submit" name="submit" value="{lang_button}"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
</form>
|
</form>
|
||||||
|
4
admin/templates/verdilak/account_form_buttons.tpl
Normal file
4
admin/templates/verdilak/account_form_buttons.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color2}">
|
||||||
|
<td colspan="4" align="right"><input type="submit" name="submit" value="{lang_button}"></td>
|
||||||
|
</tr>
|
8
admin/templates/verdilak/account_form_logininfo.tpl
Normal file
8
admin/templates/verdilak/account_form_logininfo.tpl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color1}">
|
||||||
|
<td>{lang_lastlogin}</td>
|
||||||
|
<td>{account_lastlogin}</td>
|
||||||
|
|
||||||
|
<td>{lang_lastloginfrom}</td>
|
||||||
|
<td>{account_lastloginfrom}</td>
|
||||||
|
</tr>
|
7
admin/templates/verdilak/account_form_password.tpl
Normal file
7
admin/templates/verdilak/account_form_password.tpl
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
<tr bgcolor="{tr_color1}">
|
||||||
|
<td>{lang_password}</td>
|
||||||
|
<td><input type="password" name="account_passwd" value="{account_passwd}"></td>
|
||||||
|
<td>{lang_reenter_password}</td>
|
||||||
|
<td><input type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
||||||
|
</tr>
|
@ -1,14 +0,0 @@
|
|||||||
<!-- BEGIN display -->
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<p>
|
|
||||||
<table border="0" width="50%">
|
|
||||||
|
|
||||||
<tr bgcolor="{th_bg}">
|
|
||||||
<td colspan="2"> </td>
|
|
||||||
</tr>
|
|
||||||
{rows}
|
|
||||||
</table>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
<!-- END display -->
|
|
@ -1,8 +0,0 @@
|
|||||||
<!-- BEGIN row -->
|
|
||||||
|
|
||||||
<tr bgcolor="{tr_color}">
|
|
||||||
<td width="40%" valign="top">{lable} </td>
|
|
||||||
<td width="60%" valign="top">{value} </td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- END row -->
|
|
@ -12,97 +12,172 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_info = array();
|
if (! $account_id)
|
||||||
if (! $account_id) {
|
|
||||||
$phpgw_info["flags"] = array("nonavbar" => True, "noheader" => True);
|
|
||||||
}
|
|
||||||
|
|
||||||
$phpgw_info["flags"]["enable_nextmatchs_class"] = True;
|
|
||||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
|
||||||
$phpgw_info["flags"]["parent_page"] = "accounts.php";
|
|
||||||
|
|
||||||
include("../header.inc.php");
|
|
||||||
include($phpgw_info["server"]["app_inc"]."/accounts_".$phpgw_info["server"]["account_repository"].".inc.php");
|
|
||||||
|
|
||||||
if (! $account_id) {
|
|
||||||
Header("Location: " . $phpgw->link("accounts.php"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function display_row($lable,$value)
|
|
||||||
{
|
{
|
||||||
global $phpgw, $tr_color;
|
$phpgw_info['flags'] = array(
|
||||||
|
'nonavbar' => True,
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
'noheader' => True
|
||||||
|
);
|
||||||
$phpgw->template->set_var("tr_color",$tr_color);
|
|
||||||
$phpgw->template->set_var("lable",$lable);
|
|
||||||
$phpgw->template->set_var("value",$value);
|
|
||||||
|
|
||||||
$phpgw->template->parse("rows","row",True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->template->set_file(array("display" => "account_view.tpl",
|
$phpgw_info['flags']['enable_nextmatchs_class'] = True;
|
||||||
"row" => "account_view_row.tpl"));
|
$phpgw_info['flags']['currentapp'] = 'admin';
|
||||||
|
$phpgw_info['flags']['parent_page'] = 'accounts.php';
|
||||||
|
|
||||||
|
include('../header.inc.php');
|
||||||
|
|
||||||
|
if (! $account_id)
|
||||||
|
{
|
||||||
|
Header('Location: ' . $phpgw->link('accounts.php'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$t = new Template($phpgw->common->get_tpl_dir('admin'));
|
||||||
|
$t->set_unknowns('remove');
|
||||||
|
$t->set_file(array(
|
||||||
|
'form' => 'account_form.tpl',
|
||||||
|
'form_logininfo' => 'account_form_logininfo.tpl'
|
||||||
|
));
|
||||||
|
|
||||||
|
$t->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
||||||
|
$t->set_var('tr_color1',$phpgw_info['theme']['row_on']);
|
||||||
|
$t->set_var('tr_color2',$phpgw_info['theme']['row_off']);
|
||||||
|
$t->set_var('lang_action',lang('View user account'));
|
||||||
|
$t->set_var('lang_loginid',lang('LoginID'));
|
||||||
|
$t->set_var('lang_account_active',lang('Account active'));
|
||||||
|
$t->set_var('lang_password',lang('Password'));
|
||||||
|
$t->set_var('lang_reenter_password',lang('Re-Enter Password'));
|
||||||
|
$t->set_var('lang_lastname',lang('Last Name'));
|
||||||
|
$t->set_var('lang_groups',lang('Groups'));
|
||||||
|
$t->set_var('lang_firstname',lang('First Name'));
|
||||||
|
$t->set_var('lang_lastlogin',lang('Last login'));
|
||||||
|
$t->set_var('lang_lastloginfrom',lang('Last login from'));
|
||||||
|
|
||||||
|
$account = CreateObject('phpgwapi.accounts',$account_id);
|
||||||
|
$userData = $account->read_repository();
|
||||||
|
|
||||||
|
$t->set_var('account_lid',$userData['account_lid']);
|
||||||
|
$t->set_var('account_firstname',$userData['firstname']);
|
||||||
|
$t->set_var('account_lastname',$userData['lastname']);
|
||||||
|
|
||||||
|
// Account status
|
||||||
|
if ($userData['status'])
|
||||||
|
{
|
||||||
|
$t->set_var('account_status',lang('Enabled'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$t->set_var('account_status','<b>' . lang('Disabled') . '</b>');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last login time
|
||||||
|
if ($userData['account_lastlogin'])
|
||||||
|
{
|
||||||
|
$t->set_var('account_lastlogin',$phpgw->common->show_date($userData['lastlogin']));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$t->set_var('account_lastlogin',lang('Never'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last login IP
|
||||||
|
if ($userData['account_lastloginfrom'])
|
||||||
|
{
|
||||||
|
$t->set_var('account_lastloginfrom',$userData['lastloginfrom']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$t->set_var('account_lastloginfrom',lang('Never'));
|
||||||
|
}
|
||||||
|
$t->parse('password_fields','form_logininfo',True);
|
||||||
|
|
||||||
|
|
||||||
|
// Find out which groups they are members of
|
||||||
|
$usergroups = $account->memberships(intval($account_id));
|
||||||
|
if (gettype($usergroups) != 'array')
|
||||||
|
{
|
||||||
|
$t->set_var('groups_select',lang('None'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (list(,$group) = each($usergroups))
|
||||||
|
{
|
||||||
|
$group_names[] = $group['account_name'];
|
||||||
|
}
|
||||||
|
$t->set_var('groups_select',implode(',',$group_names));
|
||||||
|
}
|
||||||
|
|
||||||
$userData = $phpgw->accounts->read_userData($account_id);
|
|
||||||
|
|
||||||
$loginid = $userData["account_lid"];
|
$loginid = $userData["account_lid"];
|
||||||
$account_lastlogin = $userData["account_lastlogin"];
|
$account_lastlogin = $userData["account_lastlogin"];
|
||||||
$account_lastloginfrom = $userData["account_lastloginfrom"];
|
$account_lastloginfrom = $userData["account_lastloginfrom"];
|
||||||
$account_status = $userData["account_status"];
|
$account_status = $userData["account_status"];
|
||||||
|
|
||||||
$db_perms = $phpgw->accounts->read_apps($loginid);
|
|
||||||
|
|
||||||
|
|
||||||
#$phpgw->db->query("select account_lid from accounts where account_id='$account_id'");
|
|
||||||
#$phpgw->db->next_record();
|
|
||||||
#$loginid = $phpgw->db->f("account_lid");
|
|
||||||
|
|
||||||
#$account_info = account_view($loginid);
|
|
||||||
|
|
||||||
#$phpgw->db->query("select account_lastlogin,account_lastloginfrom,account_status from accounts "
|
|
||||||
# . "where account_id='$account_id'");
|
|
||||||
#$phpgw->db->next_record();
|
|
||||||
|
|
||||||
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
|
||||||
|
|
||||||
display_row(lang("LoginID"),$loginid);
|
|
||||||
display_row(lang("First Name"),$userData["firstname"]);
|
|
||||||
display_row(lang("Last Name"),$userData["lastname"]);
|
|
||||||
|
|
||||||
|
// create list of available app
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($permission = each($db_perms)) {
|
|
||||||
if ($phpgw_info["apps"][$permission[0]]["enabled"]) {
|
$availableApps = $phpgw_info['apps'];
|
||||||
$perm_display[$i] = lang($phpgw_info["apps"][$permission[0]]["title"]);
|
@asort($availableApps);
|
||||||
|
@reset($availableApps);
|
||||||
|
while ($application = each($availableApps))
|
||||||
|
{
|
||||||
|
if ($application[1]['enabled'])
|
||||||
|
{
|
||||||
|
$perm_display[$i]['appName'] = $application[0];
|
||||||
|
$perm_display[$i]['translatedName'] = $application[1]['title'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
display_row(lang("account permissions"),implode(", ", $perm_display));
|
|
||||||
|
|
||||||
if ($userData["status"] == "A") {
|
// create apps output
|
||||||
$account_status = lang("yes");
|
$apps = CreateObject('phpgwapi.applications',intval($account_id));
|
||||||
} else {
|
$db_perms = $apps->read_account_specific();
|
||||||
$account_status = "<b>" . lang("no") . "</b>";
|
|
||||||
}
|
|
||||||
display_row(lang("account active"),$account_status);
|
|
||||||
|
|
||||||
$user_groups = $phpgw->accounts->read_group_names($userData["account_lid"]);
|
@reset($db_perms);
|
||||||
for ($i=0;$i<count($user_groups); $i++) {
|
|
||||||
$group_html .= $user_groups[$i][1];
|
|
||||||
if (count($user_groups) !=0 && $i != count($user_groups)-1) {
|
|
||||||
$group_html .= ", ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
display_row(lang("Groups"),$group_html);
|
|
||||||
|
|
||||||
if (! $userData["lastlogin"]) {
|
for ($i=0;$i<=count($perm_display);$i++)
|
||||||
$lastlogin = lang("Never");
|
{
|
||||||
} else {
|
$checked = '';
|
||||||
$lastlogin = $phpgw->common->show_date($userData["lastlogin"]);
|
if ($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']])
|
||||||
|
{
|
||||||
|
$checked = ' X';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$checked = ' ';
|
||||||
}
|
}
|
||||||
display_row(lang("Last login"),$lastlogin);
|
|
||||||
display_row(lang("Last login from"),$userData["lastloginfrom"]);
|
|
||||||
|
|
||||||
$phpgw->template->pparse("out","display");
|
if ($perm_display[$i]['translatedName'])
|
||||||
|
{
|
||||||
|
$part1 = sprintf("<td>%s</td><td>%s</td>",lang($perm_display[$i]['translatedName']),$checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
if ($_userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']])
|
||||||
|
{
|
||||||
|
$checked = ' X';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$checked = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($perm_display[$i]['translatedName'])
|
||||||
|
{
|
||||||
|
$part2 = sprintf("<td>%s</td><td>%s</td>",lang($perm_display[$i]['translatedName']),$checked);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$part2 = '<td colspan="2"> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$appRightsOutput .= sprintf("<tr bgcolor=\"%s\">$part1$part2</tr>\n",$phpgw_info["theme"]["row_on"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$t->set_var('permissions_list',$appRightsOutput);
|
||||||
|
|
||||||
|
|
||||||
|
$t->pfp('out','form');
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user