main.inc
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:6k
- <?php
- Function true_false_attribute( $desc, $value ) {
- global $template_obj;
- if ( $value == 0 ) {
- $value = 'False';
- } else {
- $value = 'True';
- }
- attribute( $desc, $value );
- }
- Function attribute( $desc, $value ) {
- global $default;
- global $template_obj;
- include( './manager/templates/user/attributes/attribute.inc' );
- }
- $customer_db = new CustomerInformation_Db();
- $customer_db = $customer_db->Db(
- $default->customer_db->driver,
- $default->customer_db
- );
- $temp_obj = new User();
- $temp_obj->user_name = $target_username;
- $temp_obj->domain_id = $target_domain_id;
- $user_db->debug->On();
- $user_db->user_db->debug->On();
- $ret_vals = $user_db->Get( $temp_obj );
- $temp_obj = $ret_vals[ 1 ];
- $url_util = new UrlObject();
- $base_ref = $url_util->PostUrl(
- $default->base_url,
- Array(
- 'session_id' => $session_id,
- 'target_username' => $target_username,
- 'target_domain_id' => $target_domain_id
- )
- );
- $edit_url = $url_util->PostUrl(
- $base_ref, Array( 'form_mode' => MANAGER_USER_EDIT_FRM )
- );
- $delete_url = $url_util->PostUrl(
- $base_ref, Array( 'form_mode' => MANAGER_USER_DELETE_FRM )
- );
- $add_address_url = $url_util->PostUrl(
- $base_ref, Array( 'form_mode' => MANAGER_USER_ADD_ADDRESS_FRM )
- );
- $add_phone_url = $url_util->PostUrl(
- $base_ref, Array( 'form_mode' => MANAGER_USER_ADD_PHONE_FRM )
- );
- list( $ret, $admin_privs ) = $admin_db->Get( $temp_obj->user_id );
- if ( ! is_object( $admin_privs ) ) {
- $admin_privs = new AdminPrivileges();
- }
- echo( $template_obj->GetValue( 'content_table_start' ) );
- include( './manager/templates/user/attributes/title.inc' );
- if ( $temp_obj->user_name != '' ) {
- 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 );
- $title = 'Administative Privileges';
- include( './manager/templates/user/attributes/section_title.inc' );
- 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 );
- $title = 'Phone information ( ';
- $title .= '<A Href="' . $add_phone_url . '">' .
- $template_obj->GetValue( 'title_font' ) .
- 'Add Phone Number' . '</a>' .
- $template_obj->GetValue( 'title_font' ) .
- ' )';
- include( './manager/templates/user/attributes/section_title.inc' );
- $phones = $customer_db->phone->ListAll( $temp_obj->user_id );
- for( $i = 0; $i < count( $phones ); $i++ ) {
- $t_obj = $phones[ $i ];
- if ( is_object( $t_obj ) ) {
- $edit_phone_url = $url_util->PostUrl(
- $base_ref, Array(
- 'form_mode' => MANAGER_USER_EDIT_PHONE_FRM,
- 'phone_id' => $t_obj->phone_num_id
- )
- );
- $delete_phone_url = $url_util->PostUrl(
- $base_ref, Array(
- 'form_mode' => MANAGER_USER_DELETE_PHONE,
- 'phone_id' => $t_obj->phone_num_id
- )
- );
- $template_obj->Register( 'delete_phone_url', $delete_phone_url );
- $template_obj->Register( 'edit_phone_url', $edit_phone_url );
- $template_obj->Register(
- 'phone_number_name', $t_obj->phone_number_name
- );
- $template_obj->Register(
- 'phone_number', $t_obj->phone_number
- );
- $template_obj->ParseTemplate(
- './manager/templates/user/attributes/phone.inc'
- );
- }
- }
- if ( count( $phones ) == 0 ) {
- $template_obj->ParseTemplate(
- './manager/templates/user/attributes/no_information.inc'
- );
- }
- $title = 'Address information ( ';
- $title .= '<A Href="' . $add_address_url . '">' .
- $template_obj->GetValue( 'title_font' ) .
- 'Add Address' . '</a>' .
- $template_obj->GetValue( 'title_font' ) .
- ' )';
- include( './manager/templates/user/attributes/section_title.inc' );
- $addresses = $customer_db->address->ListAll( $temp_obj->user_id );
- for( $i = 0; $i < count( $addresses ); $i++ ) {
- $t_obj = $addresses[ $i ];
- if ( is_object( $t_obj ) ) {
- $edit_address_url = $url_util->PostUrl(
- $base_ref, Array(
- 'form_mode' => MANAGER_USER_EDIT_ADDRESS_FRM,
- 'address_id' => $t_obj->address_id
- )
- );
- $delete_address_url = $url_util->PostUrl(
- $base_ref, Array(
- 'form_mode' => MANAGER_USER_DELETE_ADDRESS,
- 'address_id' => $t_obj->address_id
- )
- );
- $template_obj->Register( 'delete_address_url', $delete_address_url );
- $template_obj->Register( 'edit_address_url', $edit_address_url );
- $template_obj->Register( 'address_name', $t_obj->address_name );
- $template_obj->Register( 'address', $t_obj->address );
- $template_obj->Register( 'city', $t_obj->city );
- $template_obj->Register( 'state', $t_obj->state );
- $template_obj->Register( 'zip', $t_obj->zip );
- $template_obj->Register( 'country', $t_obj->country );
- if ( $t_obj->mailing_address == 1 ) {
- $template_obj->Register( 'mailing_address', 'True' );
- } else {
- $template_obj->Register( 'mailing_address', 'False' );
- }
- $template_obj->ParseTemplate(
- './manager/templates/user/attributes/address.inc'
- );
- }
- }
- if ( count( $addresses ) == 0 ) {
- $template_obj->ParseTemplate(
- './manager/templates/user/attributes/no_information.inc'
- );
- }
- /*
- $title = 'By Module Privileges and Settings';
- include( './manager/templates/user/attributes/section_title.inc' );
- reset( $app_server->apps );
- while( list( $app_name, $app_obj ) = each( $app_server->apps ) ) {
- $module_include = './manager/templates/user/attributes/modules/' . strtolower( $app_name ) . '.inc';
- if ( file_exists( $module_include ) ) {
- include( $module_include );
- }
- }
- */
- include( './manager/templates/user/attributes/bottom.inc' );
- ?>