user_attributes.inc
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:4k
源码类别:

WEB邮件程序

开发平台:

PHP

  1. <?php
  2. $url_util = new UrlObject();
  3. Function true_false_attribute( $desc, $value ) {
  4. if ( $value == 0 ) {
  5.    $value = 'False';
  6. } else {
  7.    $value = 'True';
  8. }
  9. attribute( $desc, $value );
  10. }
  11. Function attribute( $desc, $value ) {
  12. global $html_content;
  13. global $default;
  14. $html_content .= 
  15. '<tr ' . $template_obj->GetValue( 'default_bgcolor' ) . '>' .
  16. '<td>' . 
  17. $template_obj->GetValue( 'default_font' ) .
  18. '<b>' . $desc . '</b></td>' .
  19. '<td>' . 
  20. $template_obj->GetValue( 'default_font' ) .
  21. $value . '</td>' .
  22. '</tr>' .
  23. "n";
  24. }
  25. $temp_obj = new User();
  26. $temp_obj->user_name = $target_username;
  27. $temp_obj->domain_id = $user_obj->domain_id;
  28. $ret_vals = $user_db->Get( $temp_obj );
  29. $html_content = '';
  30. $html_content = $template_obj->GetValue( 'content_table_start' );
  31. if ( $ret_vals[ 0 ] == 1 ) {
  32.       $temp_obj = $ret_vals[ 1 ];
  33.       $edit_user_url = 
  34.             $url_util->PostUrl(
  35.                $default->base_url,
  36.                Array(
  37.                   'session_id'         => $session_id,
  38.                   'target_username'    => $target_username'
  39.                   'form_mode'          => MGR_USER_EDIT_FRM
  40.                )
  41.       );
  42.       $delete_user_url = 
  43.             $url_util->PostUrl(
  44.                $default->base_url,
  45.                Array(
  46.                   'session_id'         => $session_id,
  47.                   'target_username'    => $target_username'
  48.                   'form_mode'          => MGR_USER_DELETE_FRM
  49.                )
  50.       );
  51. $html_content .= 
  52. '<tr bgcolor="#a0b8c8">' .
  53. '<td><b>Attributes for : ' . $temp_obj->user_name . '@' . $user_domain_obj->domain_name .
  54. '</b></td>' .
  55. '<td align="right" valign="center">' .
  56. '<h4>Actions :' .
  57. '<A Href="' . $edit_user_url .
  58. '"><img src="/graphics/edit.gif" alt="Edit" border="0"></a>' .
  59. '<A Href="' . $delete_user_url .
  60. '"><img src="/graphics/trash.gif" alt="Delete" border="0"></a>' .
  61. '</h4></td>' .
  62. '</tr>' .
  63. "n";
  64. attribute( 'User ID  :', $temp_obj->user_id );
  65. attribute( 'Username :', $temp_obj->user_name );
  66. attribute( 'Password :', $temp_obj->password );
  67. true_false_attribute( 'Login disabled :',  $temp_obj->login_deny );
  68.    } else {
  69. $html_content .=
  70. '<tr bgcolor="' . $default->item_bg . '">' .
  71. '<td colspan="2">No users found with that id.</td>' .
  72. '</tr>';
  73.    }
  74. $html_content .=
  75. '<tr bgcolor="#a0b8c8">' .
  76. '<td colspan="2"><b>Administrative Permissions :</b></td>' .
  77. '</tr>' ;
  78. list( $ret, $admin_privs ) = $admin_db->Get( $temp_obj->user_id );
  79. if ( ! is_object( $admin_privs ) ) {
  80.    $admin_privs = new AdminPrivileges();
  81. }
  82. true_false_attribute( 'Add Users :',        $admin_privs->add_users );
  83. true_false_attribute( 'Edit Users :',       $admin_privs->edit_users );
  84. true_false_attribute( 'Delete Users :',     $admin_privs->delete_users );
  85. /* By Module Permissions */ 
  86. $html_content .=
  87. '<tr bgcolor="#a0b8c8">' .
  88. '<td colspan="2"><b>Module Permissions :</b></td>' .
  89. '</tr>' ;
  90. if ( $IMP ) {
  91. $html_content .=
  92. '<tr bgcolor="#a0b8c8">' .
  93. '<td colspan="2"><b>IMP -</b></td>' .
  94. '</tr>' ;
  95. }
  96. if ( $NAG ) {
  97. $nag_priv_db = new NagDb_TodoPrivileges();
  98. $ret_vals = $nag_priv_db->Get( $target_uid );
  99. $html_content .=
  100.    '<tr bgcolor="#a0b8c8">' .
  101.    '<td colspan="2"><b>NAG - ( Global Permissions - Affects all sections )</b></td>' .
  102.    '</tr>' ;
  103. if ( $ret_vals[ 0 ] == true ) {
  104.    $temp_obj = $ret_vals[ 1 ];
  105.  
  106.    attribute( 'Privlage ID  :', $temp_obj->privlage_id );
  107.    true_false_attribute( 'Admin privlage :', $temp_obj->admin_privlage );
  108.    true_false_attribute( 'Can add :', $temp_obj->can_add );
  109.    true_false_attribute( 'Can edit :', $temp_obj->can_edit );
  110.    true_false_attribute( 'Can delete :', $temp_obj->can_delete );
  111.    true_false_attribute( 'Can move :', $temp_obj->can_move );
  112.    true_false_attribute( 'Create section :', $temp_obj->create_section );
  113.    true_false_attribute( 'Create public section :', $temp_obj->create_section );
  114.    
  115. } else {
  116. $html_content .=
  117.    '<tr bgcolor="#a0b8c8">' .
  118.    '<td colspan="2"><center><b>- NONE -</b></center></td>' .
  119.    '</tr>' ;
  120. }
  121. }
  122. $html_content .= '</table></tr></td></table>';
  123. include( './templates/main.inc' );
  124. ?>