user_attributes.inc
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:4k
- <?php
- $url_util = new UrlObject();
- Function true_false_attribute( $desc, $value ) {
- if ( $value == 0 ) {
- $value = 'False';
- } else {
- $value = 'True';
- }
- attribute( $desc, $value );
- }
- Function attribute( $desc, $value ) {
- global $html_content;
- global $default;
- $html_content .=
- '<tr ' . $template_obj->GetValue( 'default_bgcolor' ) . '>' .
- '<td>' .
- $template_obj->GetValue( 'default_font' ) .
- '<b>' . $desc . '</b></td>' .
- '<td>' .
- $template_obj->GetValue( 'default_font' ) .
- $value . '</td>' .
- '</tr>' .
- "n";
- }
- $temp_obj = new User();
- $temp_obj->user_name = $target_username;
- $temp_obj->domain_id = $user_obj->domain_id;
- $ret_vals = $user_db->Get( $temp_obj );
- $html_content = '';
- $html_content = $template_obj->GetValue( 'content_table_start' );
- if ( $ret_vals[ 0 ] == 1 ) {
- $temp_obj = $ret_vals[ 1 ];
- $edit_user_url =
- $url_util->PostUrl(
- $default->base_url,
- Array(
- 'session_id' => $session_id,
- 'target_username' => $target_username'
- 'form_mode' => MGR_USER_EDIT_FRM
- )
- );
- $delete_user_url =
- $url_util->PostUrl(
- $default->base_url,
- Array(
- 'session_id' => $session_id,
- 'target_username' => $target_username'
- 'form_mode' => MGR_USER_DELETE_FRM
- )
- );
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td><b>Attributes for : ' . $temp_obj->user_name . '@' . $user_domain_obj->domain_name .
- '</b></td>' .
- '<td align="right" valign="center">' .
- '<h4>Actions :' .
- '<A Href="' . $edit_user_url .
- '"><img src="/graphics/edit.gif" alt="Edit" border="0"></a>' .
- '<A Href="' . $delete_user_url .
- '"><img src="/graphics/trash.gif" alt="Delete" border="0"></a>' .
- '</h4></td>' .
- '</tr>' .
- "n";
- attribute( 'User ID :', $temp_obj->user_id );
- attribute( 'Username :', $temp_obj->user_name );
- attribute( 'Password :', $temp_obj->password );
- true_false_attribute( 'Login disabled :', $temp_obj->login_deny );
- } else {
- $html_content .=
- '<tr bgcolor="' . $default->item_bg . '">' .
- '<td colspan="2">No users found with that id.</td>' .
- '</tr>';
- }
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td colspan="2"><b>Administrative Permissions :</b></td>' .
- '</tr>' ;
- list( $ret, $admin_privs ) = $admin_db->Get( $temp_obj->user_id );
- if ( ! is_object( $admin_privs ) ) {
- $admin_privs = new AdminPrivileges();
- }
- true_false_attribute( 'Add Users :', $admin_privs->add_users );
- true_false_attribute( 'Edit Users :', $admin_privs->edit_users );
- true_false_attribute( 'Delete Users :', $admin_privs->delete_users );
- /* By Module Permissions */
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td colspan="2"><b>Module Permissions :</b></td>' .
- '</tr>' ;
- if ( $IMP ) {
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td colspan="2"><b>IMP -</b></td>' .
- '</tr>' ;
- }
- if ( $NAG ) {
- $nag_priv_db = new NagDb_TodoPrivileges();
- $ret_vals = $nag_priv_db->Get( $target_uid );
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td colspan="2"><b>NAG - ( Global Permissions - Affects all sections )</b></td>' .
- '</tr>' ;
- if ( $ret_vals[ 0 ] == true ) {
- $temp_obj = $ret_vals[ 1 ];
-
- attribute( 'Privlage ID :', $temp_obj->privlage_id );
- true_false_attribute( 'Admin privlage :', $temp_obj->admin_privlage );
- true_false_attribute( 'Can add :', $temp_obj->can_add );
- true_false_attribute( 'Can edit :', $temp_obj->can_edit );
- true_false_attribute( 'Can delete :', $temp_obj->can_delete );
- true_false_attribute( 'Can move :', $temp_obj->can_move );
- true_false_attribute( 'Create section :', $temp_obj->create_section );
- true_false_attribute( 'Create public section :', $temp_obj->create_section );
-
- } else {
- $html_content .=
- '<tr bgcolor="#a0b8c8">' .
- '<td colspan="2"><center><b>- NONE -</b></center></td>' .
- '</tr>' ;
- }
- }
- $html_content .= '</table></tr></td></table>';
- include( './templates/main.inc' );
- ?>